增加了相关文档说明

This commit is contained in:
2026-05-11 10:32:35 +08:00
parent 0f5368bb51
commit 773b506f40
34 changed files with 6745 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
<mxfile host="Electron" agent="AI-Drawio-Replicator">
<diagram id="page-1" name="传感器工厂模式">
<mxGraphModel dx="2204" dy="2155" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="900" background="#f0f8ff" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6f2ff;strokeColor=#6699cc;strokeWidth=2;shadow=1;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;display:flex;align-items:center;justify-content:center;gap:15px;font-size:20px;font-weight:bold;&quot;&gt;&lt;div style=&quot;font-size:40px;&quot;&gt;📱&lt;/div&gt;&lt;div&gt;应用层&lt;br&gt;&lt;span style=&quot;font-size:16px;font-weight:normal;&quot;&gt;(调用者)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="100" width="220" x="20" y="120" as="geometry" />
</mxCell>
<mxCell id="3" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Times New Roman;" value="&lt;div style=&quot;font-size: 18px; line-height: 1.6;&quot;&gt;sensor = &lt;span style=&quot;color:#0066cc;font-weight:bold;&quot;&gt;sensor_create&lt;/span&gt;(SENSOR_DS18B20);&lt;br&gt;sensor-&amp;gt;read(); &lt;span style=&quot;color:#666666;&quot;&gt;// 不关心具体实现&lt;/span&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="100" width="350" x="250" y="120" as="geometry" />
</mxCell>
<mxCell id="4" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6f9f2;strokeColor=#33cc99;strokeWidth=3;shadow=1;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;display:flex;align-items:center;justify-content:center;gap:15px;font-size:24px;font-weight:bold;&quot;&gt;&lt;div style=&quot;font-size:40px;&quot;&gt;🏭&lt;/div&gt;&lt;div&gt;工厂函数&lt;/div&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="100" width="280" x="230" y="320" as="geometry" />
</mxCell>
<mxCell id="5" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Times New Roman;" value="&lt;div style=&quot;font-size:16px;&quot;&gt;根据类型参数,选择并返回对应的操作集合&lt;/div&gt;" vertex="1">
<mxGeometry height="30" width="350" x="380" y="280" as="geometry" />
</mxCell>
<mxCell id="6" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6f2ff;strokeColor=#6699cc;strokeWidth=3;shadow=1;fontSize=14;fontFamily=Times New Roman;" value="" vertex="1">
<mxGeometry height="280" width="700" x="20" y="540" as="geometry" />
</mxCell>
<mxCell id="7" parent="6" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f7ff;strokeColor=#6699cc;strokeWidth=2;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;font-size:24px;font-weight:bold;text-align:center;&quot;&gt;传感器操作接口&lt;/div&gt;" vertex="1">
<mxGeometry height="50" width="600" x="50" y="20" as="geometry" />
</mxCell>
<mxCell id="8" parent="6" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f7ff;strokeColor=#6699cc;strokeWidth=2;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;display:flex;align-items:center;justify-content:center;gap:10px;font-size:20px;font-weight:bold;&quot;&gt;&lt;div style=&quot;font-size:36px;&quot;&gt;🌡️&lt;/div&gt;&lt;div&gt;DS18B20&lt;br&gt;&lt;span style=&quot;font-size: 16px; font-weight: normal;&quot;&gt;.init&lt;br&gt;.read&lt;br&gt;.deinit&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="160" width="180" x="50" y="100" as="geometry" />
</mxCell>
<mxCell id="9" parent="6" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6f9f2;strokeColor=#33cc99;strokeWidth=2;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;display:flex;align-items:center;justify-content:center;gap:10px;font-size:20px;font-weight:bold;&quot;&gt;&lt;div style=&quot;font-size:36px;&quot;&gt;🌡️&lt;/div&gt;&lt;div&gt;NTC&lt;br&gt;&lt;span style=&quot;font-size: 16px; font-weight: normal;&quot;&gt;.init&lt;br&gt;.read&lt;br&gt;.deinit&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="160" width="180" x="260" y="100" as="geometry" />
</mxCell>
<mxCell id="10" parent="6" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f7ff;strokeColor=#6699cc;strokeWidth=2;fontSize=14;fontFamily=Times New Roman;" value="&lt;div style=&quot;display:flex;align-items:center;justify-content:center;gap:10px;font-size:20px;font-weight:bold;&quot;&gt;&lt;div style=&quot;font-size:36px;&quot;&gt;🌡️&lt;/div&gt;&lt;div&gt;PT100&lt;br&gt;&lt;span style=&quot;font-size: 16px; font-weight: normal;&quot;&gt;.init&lt;br&gt;.read&lt;br&gt;.deinit&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;" vertex="1">
<mxGeometry height="160" width="180" x="470" y="100" as="geometry" />
</mxCell>
<mxCell id="11" edge="1" parent="1" source="2" style="endArrow=classic;html=1;strokeColor=#336699;strokeWidth=2;labelPosition=top;verticalAlign=bottom;labelBackgroundColor=#ffffff;edgeStyle=orthogonalEdgeStyle;fontFamily=Times New Roman;" target="4" value="&lt;div style=&quot;font-size:16px;&quot;&gt;调用工厂函数&lt;/div&gt;">
<mxGeometry height="50" relative="1" width="50" as="geometry">
<Array as="points">
<mxPoint x="130" y="370" />
</Array>
<mxPoint x="130" y="220" as="sourcePoint" />
<mxPoint x="320" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="12" edge="1" parent="1" source="4" style="endArrow=classic;html=1;strokeColor=#33cc99;strokeWidth=3;labelPosition=right;verticalAlign=middle;labelBackgroundColor=#ffffff;fontFamily=Times New Roman;" target="6" value="&lt;div style=&quot;font-size:16px;&quot;&gt;返回具体实例&lt;/div&gt;">
<mxGeometry height="50" relative="1" width="50" as="geometry">
<mxPoint x="460" y="420" as="sourcePoint" />
<mxPoint x="460" y="540" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3jtoW8cGR1RTCXEpEOqW-14" edge="1" parent="1" style="endArrow=classic;html=1;strokeColor=#336699;strokeWidth=2;labelPosition=top;verticalAlign=bottom;labelBackgroundColor=#ffffff;edgeStyle=orthogonalEdgeStyle;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontFamily=Times New Roman;" target="4" value="&lt;div style=&quot;font-size:16px;&quot;&gt;&lt;br&gt;&lt;/div&gt;">
<mxGeometry height="50" relative="1" width="50" as="geometry">
<mxPoint as="offset" />
<Array as="points">
<mxPoint x="370" y="270" />
</Array>
<mxPoint x="130" y="270" as="sourcePoint" />
<mxPoint x="320" y="420" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="13" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=32;fontFamily=Times New Roman;" value="📄" vertex="1">
<mxGeometry height="40" width="40" x="260" y="251" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>