text:
.048" width="0.0508" layer="21"/>
<wire x1="-1.27" y1="-2.794" x2="-1.27" y2="-3.048" width="0.0508" layer="21"/>
<wire x1="2.54" y1="-3.048" x2="2.159" y2="-3.048" width="0.1524" layer="51"/>
<wire x1="-2.54" y1="-3.048" x2="-2.159" y2="-3.048" width="0.1524" layer="51"/>
<wire x1="-2.159" y1="-3.048" x2="-1.27" y2="-3.048" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="3.048" x2="-2.159" y2="3.048" width="0.1524" layer="51"/>
<wire x1="2.54" y1="3.048" x2="2.159" y2="3.048" width="0.1524" layer="51"/>
<wire x1="2.159" y1="3.048" x2="1.27" y2="3.048" width="0.1524" layer="21"/>
<wire x1="1.27" y1="3.048" x2="-1.27" y2="3.048" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="3.048" x2="-2.159" y2="3.048" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="-3.048" x2="1.143" y2="-3.048" width="0.1524" layer="21"/>
<wire x1="1.143" y1="-3.048" x2="2.159" y2="-3.048" width="0.1524" layer="21"/>
<wire x1="3.048" y1="-0.762" x2="3.048" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="3.048" y1="0.762" x2="3.048" y2="1.016" width="0.1524" layer="21"/>
<wire x1="-3.048" y1="-0.762" x2="-3.048" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="-3.048" y1="0.762" x2="-3.048" y2="1.016" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="-2.159" x2="1.27" y2="-2.159" width="0.1524" layer="51"/>
<wire x1="1.27" y1="2.286" x2="-1.27" y2="2.286" width="0.1524" layer="51"/>
<wire x1="-2.413" y1="1.27" x2="-2.413" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-2.413" y1="-0.508" x2="-2.413" y2="-1.27" width="0.1524" layer="51"/>
<wire x1="-2.413" y1="0.508" x2="-2.159" y2="-0.381" width="0.1524" layer="51"/>
<circle x="0" y="0" radius="1.778" width="0.1524" layer="21"/>
<circle x="-2.159" y="-2.159" radius="0.508" width="0.1524" layer="51"/>
<circle x="2.159" y="-2.032" radius="0.508" width="0.1524" layer="51"/>
<circle x="2.159" y="2.159" radius="0.508" width="0.1524" layer="51"/>
<circle x="-2.159" y="2.159" radius="0.508" width="0.1524" layer="51"/>
<circle x="0" y="0" radius="0.635" width="0.0508" layer="51"/>
<circle x="0" y="0" radius="0.254" width="0.1524" layer="21"/>
<pad name="1" x="-3.2512" y="2.2606" drill="1.016" shape="long"/>
<pad name="3" x="-3.2512" y="-2.2606" drill="1.016" shape="long"/>
<pad name="2" x="3.2512" y="2.2606" drill="1.016" shape="long"/>
<pad name="4" x="3.2512" y="-2.2606" drill="1.016" shape="long"/>
<text x="-3.048" y="3.683" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-3.048" y="-5.08" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-4.318" y="1.651" size="1.27" layer="51" ratio="10">1</text>
<text x="3.556" y="1.524" size="1.27" layer="51" ratio="10">2</text>
<text x="-4.572" y="-2.794" size="1.27" layer="51" ratio="10">3</text>
<text x="3.556" y="-2.794" size="1.27" layer="51" ratio="10">4</text>
</package>
</packages>
</library>
<library name="con-wago-508">
<description>Wago Screw Clamps

Grid 5.08 mm

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="W237-6P">
<description>WAGO SREW CLAMP</description>
<wire x1="11.7856" y1="-1.6002" x2="13.589" y2="0.3556" width="0.254" layer="51"/>
<wire x1="6.7056" y1="-1.6764" x2="8.6106" y2="0.3556" width="0.254" layer="51"/>
<wire x1="1.5494" y1="-1.651" x2="3.556" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-3.4544" y1="-1.6002" x2="-1.651" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-8.5344" y1="-1.6764" x2="-6.6294" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-13.6906" y1="-1.651" x2="-11.684" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-15.24" y1="-4.826" x2="15.24" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="15.24" y1="4.445" x2="0" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="-4.826" x2="-15.24" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="-2.413" x2="-13.589" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-13.589" y1="-2.413" x2="-11.811" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-11.811" y1="-2.413" x2="-8.509" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-6.731" y1="-2.413" x2="-3.429" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-1.651" y1="-2.413" x2="0" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="-2.413" x2="-15.24" y2="4.191" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="4.191" x2="-15.24" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="4.191" x2="15.24" y2="4.191" width="0.1524" layer="21"/>
<wire x1="15.24" y1="4.445" x2="15.24" y2="4.191" width="0.1524" layer="21"/>
<wire x1="15.24" y1="4.191" x2="15.24" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="15.24" y1="-2.413" x2="15.24" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="0" y1="4.445" x2="0" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="0" y1="4.445" x2="-15.24" y2="4.445" width="0.1524" layer="21"/>
<wire x1="0" y1="-2.413" x2="1.651" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="3.429" y1="-2.413" x2="6.731" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="8.509" y1="-2.413" x2="11.811" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="13.589" y1="-2.413" x2="15.24" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-8.509" y1="-2.413" x2="-6.731" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-3.429" y1="-2.413" x2="-1.651" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="1.651" y1="-2.413" x2="3.429" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="6.731" y1="-2.413" x2="8.509" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="11.811" y1="-2.413" x2="13.589" y2="-2.413" width="0.1524" layer="51"/>
<circle x="-12.7" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-12.7" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-7.62" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-7.62" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="12.7" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="12.7" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="7.62" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="7.62" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<pad name="1" x="-12.7" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="2" x="-7.62" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="3" x="-2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="4" x="2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="5" x="7.62" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="6" x="12.7" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<text x="-14.605" y="1.27" size="1.27" layer="51" ratio="10">1</text>
<text x="-9.4742" y="1.2192" size="1.27" layer="51" ratio="10">2</text>
<text x="-4.3942" y="1.27" size="1.27" layer="51" ratio="10">3</text>
<text x="-13.97" y="-4.318" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-13.97" y="-6.858" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="0.635" y="1.27" size="1.27" layer="51" ratio="10">4</text>
<text x="5.7658" y="1.2192" size="1.27" layer="51" ratio="10">5</text>
<text x="10.8458" y="1.27" size="1.27" layer="51" ratio="10">6</text>
</package>
<package name="W237-8P">
<description>WAGO SREW CLAMP</description>
<wire x1="-18.7706" y1="-1.651" x2="-16.764" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-13.6144" y1="-1.6764" x2="-11.7094" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-8.6106" y1="-1.651" x2="-6.604" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-3.4544" y1="-1.6764" x2="-1.5494" y2="0.3556" width="0.254" layer="51"/>
<wire x1="1.5494" y1="-1.651" x2="3.556" y2="0.3556" width="0.254" layer="51"/>
<wire x1="6.7056" y1="-1.6764" x2="8.6106" y2="0.3556" width="0.254" layer="51"/>
<wire x1="11.7094" y1="-1.651" x2="13.716" y2="0.3556" width="0.254" layer="51"/>
<wire x1="16.8656" y1="-1.6764" x2="18.7706" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-20.32" y1="-4.826" x2="20.32" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="20.32" y1="4.445" x2="20.32" y2="4.191" width="0.1524" layer="21"/>
<wire x1="20.32" y1="4.445" x2="10.16" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-20.32" y1="-4.826" x2="-20.32" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-20.32" y1="-2.413" x2="-18.669" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-18.669" y1="-2.413" x2="-16.891" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-16.891" y1="-2.413" x2="-13.589" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-20.32" y1="-2.413" x2="-20.32" y2="4.191" width="0.1524" layer="21"/>
<wire x1="20.32" y1="4.191" x2="-20.32" y2="4.191" width="0.1524" layer="21"/>
<wire x1="20.32" y1="4.191" x2="20.32" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="20.32" y1="-2.413" x2="20.32" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="-20.32" y1="4.191" x2="-20.32" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="4.445" x2="-5.08" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="4.445" x2="-20.32" y2="4.445" width="0.1524" layer="21"/>
<wire x1="10.16" y1="4.445" x2="10.16" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="10.16" y1="4.445" x2="-5.08" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-13.589" y1="-2.413" x2="-11.811" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-11.811" y1="-2.413" x2="-8.509" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-8.509" y1="-2.413" x2="-6.731" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-6.731" y1="-2.413" x2="-5.08" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-2.413" x2="-3.429" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-3.429" y1="-2.413" x2="-1.651" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-1.651" y1="-2.413" x2="1.651" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="1.651" y1="-2.413" x2="3.429" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="3.429" y1="-2.413" x2="6.731" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="6.731" y1="-2.413" x2="8.509" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="8.509" y1="-2.413" x2="10.16" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="10.16" y1="-2.413" x2="11.811" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="11.811" y1="-2.413" x2="13.589" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="13.589" y1="-2.413" x2="16.891" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="16.891" y1="-2.413" x2="18.669" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="18.669" y1="-2.413" x2="20.32" y2="-2.413" width="0.1524" layer="21"/>
<circle x="-17.78" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-17.78" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-12.7" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-12.7" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-7.62" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-7.62" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="7.62" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="7.62" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="12.7" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="12.7" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="17.78" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="17.78" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<pad name="1" x="-17.78" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="2" x="-12.7" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="3" x="-7.62" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="4" x="-2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="5" x="2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="6" x="7.62" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="7" x="12.7" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="8" x="17.78" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<text x="-19.685" y="1.27" size="1.27" layer="51" ratio="10">1</text>
<text x="-14.5542" y="1.2192" size="1.27" layer="51" ratio="10">2</text>
<text x="-19.05" y="-4.318" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-18.923" y="-6.858" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-9.525" y="1.27" size="1.27" layer="51" ratio="10">3</text>
<text x="-4.3942" y="1.2192" size="1.27" layer="51" ratio="10">4</text>
<text x="0.635" y="1.27" size="1.27" layer="51" ratio="10">5</text>
<text x="5.7658" y="1.2192" size="1.27" layer="51" ratio="10">6</text>
<text x="10.795" y="1.27" size="1.27" layer="51" ratio="10">7</text>
<text x="15.9258" y="1.2192" size="1.27" layer="51" ratio="10">8</text>
</package>
<package name="W237-132">
<description>WAGO SREW CLAMP</description>
<wire x1="-3.5306" y1="-1.651" x2="-1.524" y2="0.3556" width="0.254" layer="51"/>
<wire x1="1.6256" y1="-1.6764" x2="3.5306" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-5.08" y1="4.191" x2="5.08" y2="4.191" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-4.826" x2="5.08" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-4.826" x2="-5.08" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="4.191" x2="-5.08" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-2.413" x2="-3.429" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-3.429" y1="-2.413" x2="-1.651" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-1.651" y1="-2.413" x2="1.651" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="3.429" y1="-2.413" x2="5.08" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-2.413" x2="-5.08" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-2.413" x2="5.08" y2="4.191" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="4.191" x2="-5.08" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="4.445" x2="5.08" y2="4.445" width="0.1524" layer="21"/>
<wire x1="5.08" y1="4.191" x2="5.08" y2="4.445" width="0.1524" layer="21"/>
<wire x1="1.651" y1="-2.413" x2="3.429" y2="-2.413" width="0.1524" layer="51"/>
<circle x="-2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="2.54" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="2.54" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<pad name="1" x="-2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="2" x="2.54" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<text x="-4.445" y="1.27" size="1.27" layer="51" ratio="10">1</text>
<text x="0.6858" y="1.2192" size="1.27" layer="51" ratio="10">2</text>
<text x="-3.81" y="-6.985" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-3.81" y="-4.318" size="1.27" layer="25" ratio="10">>NAME</text>
</package>
<package name="W237-5P">
<description>WAGO SREW CLAMP</description>
<wire x1="-11.1506" y1="-1.651" x2="-9.144" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-5.9944" y1="-1.6764" x2="-4.0894" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-0.9144" y1="-1.6002" x2="0.889" y2="0.3556" width="0.254" layer="51"/>
<wire x1="4.0894" y1="-1.651" x2="6.096" y2="0.3556" width="0.254" layer="51"/>
<wire x1="9.2456" y1="-1.6764" x2="11.1506" y2="0.3556" width="0.254" layer="51"/>
<wire x1="-12.7" y1="-4.826" x2="12.7" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="12.7" y1="4.445" x2="12.7" y2="4.191" width="0.1524" layer="21"/>
<wire x1="12.7" y1="4.445" x2="2.54" y2="4.445" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="-4.826" x2="-12.7" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="-2.413" x2="-11.049" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-11.049" y1="-2.413" x2="-9.271" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-9.271" y1="-2.413" x2="-5.969" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-4.191" y1="-2.413" x2="-0.889" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="0.889" y1="-2.413" x2="2.54" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="-2.413" x2="-12.7" y2="4.191" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="4.191" x2="12.7" y2="4.191" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="4.191" x2="-12.7" y2="4.445" width="0.1524" layer="21"/>
<wire x1="12.7" y1="4.191" x2="12.7" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="12.7" y1="-2.413" x2="12.7" y2="-4.826" width="0.1524" layer="21"/>
<wire x1="2.54" y1="4.445" x2="2.54" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="2.54" y1="4.445" x2="-12.7" y2="4.445" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-2.413" x2="4.191" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="5.969" y1="-2.413" x2="9.271" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="11.049" y1="-2.413" x2="12.7" y2="-2.413" width="0.1524" layer="21"/>
<wire x1="-5.969" y1="-2.413" x2="-4.191" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="-0.889" y1="-2.413" x2="0.889" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="4.191" y1="-2.413" x2="5.969" y2="-2.413" width="0.1524" layer="51"/>
<wire x1="9.271" y1="-2.413" x2="11.049" y2="-2.413" width="0.1524" layer="51"/>
<circle x="-10.16" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="0" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-10.16" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="0" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="-5.08" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-5.08" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="5.08" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="5.08" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<circle x="10.16" y="-0.635" radius="1.4986" width="0.1524" layer="51"/>
<circle x="10.16" y="2.8448" radius="0.508" width="0.1524" layer="21"/>
<pad name="1" x="-10.16" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="2" x="-5.08" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="3" x="0" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="4" x="5.08" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<pad name="5" x="10.16" y="-0.635" drill="1.1938" shape="long" rot="R90"/>
<text x="-12.065" y="1.27" size="1.27" layer="51" ratio="10">1</text>
<text x="-6.9342" y="1.2192" size="1.27" layer="51" ratio="10">2</text>
<text x="-1.8542" y="1.27" size="1.27" layer="51" ratio="10">3</text>
<text x="-11.43" y="-4.318" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-11.43" y="-6.858" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="3.175" y="1.27" size="1.27" layer="51" ratio="10">4</text>
<text x="8.3058" y="1.2192" size="1.27" layer="51" ratio="10">5</text>
</package>
</packages>
</library>
<library name="v-reg">
<description>Voltage Regulators

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="SOT223">
<description>Small Outline Transistor 223

PLASTIC PACKAGE CASE 318E-04

Source: http://www.onsemi.co.jp .. LM137M-D.PDF</description>
<wire x1="3.277" y1="1.778" x2="3.277" y2="-1.778" width="0.2032" layer="21"/>
<wire x1="3.277" y1="-1.778" x2="-3.277" y2="-1.778" width="0.2032" layer="21"/>
<wire x1="-3.277" y1="-1.778" x2="-3.277" y2="1.778" width="0.2032" layer="21"/>
<wire x1="-3.277" y1="1.778" x2="3.277" y2="1.778" width="0.2032" layer="21"/>
<wire x1="0" y1="-0.7" x2="0" y2="0.6" width="0.127" layer="48"/>
<wire x1="0" y1="0.6" x2="-0.2" y2="0.2" width="0.127" layer="48"/>
<wire x1="-0.2" y1="0.2" x2="0.2" y2="0.2" width="0.127" layer="48"/>
<wire x1="0.2" y1="0.2" x2="0" y2="0.6" width="0.127" layer="48"/>
<wire x1="0" y1="-0.7" x2="0.2" y2="-0.3" width="0.127" layer="48"/>
<wire x1="0.2" y1="-0.3" x2="-0.2" y2="-0.3" width="0.127" layer="48"/>
<wire x1="-0.2" y1="-0.3" x2="0" y2="-0.7" width="0.127" layer="48"/>
<smd name="1" x="-2.3" y="-3.15" dx="1.5" dy="2" layer="1"/>
<smd name="2" x="0" y="-3.15" dx="1.5" dy="2" layer="1"/>
<smd name="3" x="2.3" y="-3.15" dx="1.5" dy="2" layer="1"/>
<smd name="4" x="0" y="3.15" dx="3.8" dy="2" layer="1"/>
<text x="-2.54" y="0.0508" size="1.27" layer="25">>NAME</text>
<text x="-2.54" y="-1.3208" size="1.27" layer="27">>VALUE</text>
<text x="0.4" y="0.4" size="0.254" layer="48">direction of pcb</text>
<text x="0.4" y="-0.05" size="0.254" layer="48">transportation for</text>
<text x="0.4" y="-0.5" size="0.254" layer="48">wavesoldering</text>
<rectangle x1="-0.9271" y1="1.1303" x2="0.9271" y2="4.3307" layer="51" rot="R270"/>
<rectangle x1="-0.9271" y1="-3.1623" x2="0.9271" y2="-2.2987" layer="51" rot="R270"/>
<rectangle x1="-3.2385" y1="-3.1623" x2="-1.3843" y2="-2.2987" layer="51" rot="R270"/>
<rectangle x1="1.3843" y1="-3.1623" x2="3.2385" y2="-2.2987" layer="51" rot="R270"/>
<rectangle x1="-0.9271" y1="1.1303" x2="0.9271" y2="4.3307" layer="51" rot="R270"/>
<rectangle x1="-0.9271" y1="-3.1623" x2="0.9271" y2="-2.2987" layer="51" rot="R270"/>
<rectangle x1="-3.2385" y1="-3.1623" x2="-1.3843" y2="-2.2987" layer="51" rot="R270"/>
<rectangle x1="1.3843" y1="-3.1623" x2="3.2385" y2="-2.2987" layer="51" rot="R270"/>
</package>
<package name="78XXS">
<description>VOLTAGE REGULATOR</description>
<wire x1="4.826" y1="-4.318" x2="5.08" y2="-4.064" width="0.1524" layer="21"/>
<wire x1="4.826" y1="-4.318" x2="-4.826" y2="-4.318" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-4.064" x2="-4.826" y2="-4.318" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-1.143" x2="5.08" y2="-4.064" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-4.064" x2="-5.08" y2="-1.143" width="0.1524" layer="21"/>
<circle x="-4.6228" y="-3.7084" radius="0.254" width="0" layer="21"/>
<pad name="IN" x="-2.54" y="-2.54" drill="1.016" shape="long" rot="R90"/>
<pad name="GND" x="0" y="-2.54" drill="1.016" shape="long" rot="R90"/>
<pad name="OUT" x="2.54" y="-2.54" drill="1.016" shape="long" rot="R90"/>
<text x="-5.08" y="-6.0452" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-5.08" y="-7.62" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-0.635" y="-3.81" size="1.27" layer="51" ratio="10">-</text>
<text x="-3.175" y="-3.81" size="1.27" layer="51" ratio="10">I</text>
<text x="1.905" y="-3.81" size="1.27" layer="51" ratio="10">O</text>
<rectangle x1="-5.334" y1="-1.27" x2="-3.429" y2="0" layer="21"/>
<rectangle x1="-3.429" y1="-0.762" x2="-1.651" y2="0" layer="21"/>
<rectangle x1="-1.651" y1="-1.27" x2="-0.889" y2="0" layer="21"/>
<rectangle x1="-0.889" y1="-0.762" x2="0.889" y2="0" layer="21"/>
<rectangle x1="0.889" y1="-1.27" x2="1.651" y2="0" layer="21"/>
<rectangle x1="1.651" y1="-0.762" x2="3.429" y2="0" layer="21"/>
<rectangle x1="3.429" y1="-1.27" x2="5.334" y2="0" layer="21"/>
<rectangle x1="-3.429" y1="-1.27" x2="-1.651" y2="-0.762" layer="51"/>
<rectangle x1="-0.889" y1="-1.27" x2="0.889" y2="-0.762" layer="51"/>
<rectangle x1="1.651" y1="-1.27" x2="3.429" y2="-0.762" layer="51"/>
</package>
</packages>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<designrules name="Elecrow_2-layer_eagle_rule">
<description language="de">EAGLE Design Rules

Die Standard-Design-Rules sind so gewählt, dass sie für
die meisten Anwendungen passen. Sollte ihre Platine
besondere Anforderungen haben, treffen Sie die erforderlichen
Einstellungen hier und speichern die Design Rules unter
einem neuen Namen ab.</description>
<description language="en">EAGLE Design Rules

The default Design Rules have been set to cover
a wide range of applications. Your particular design
may have different requirements, so please make the
necessary adjustments and save your customized
design rules under a new name.</description>
<description language="zh">Elecrow EAGLE Design Rules
</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="6mil"/>
<param name="mdWirePad" value="6mil"/>
<param name="mdWireVia" value="6mil"/>
<param name="mdPadPad" value="6mil"/>
<param name="mdPadVia" value="6mil"/>
<param name="mdViaVia" value="6mil"/>
<param name="mdSmdPad" value="0mil"/>
<param name="mdSmdVia" value="0mil"/>
<param name="mdSmdSmd" value="0mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="10mil"/>
<param name="mdDrill" value="10mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="6mil"/>
<param name="msDrill" value="12mil"/>
<param name="msMicroVia" value="12mil"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="10mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="10mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="10mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="6mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="6mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="0"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="2mil"/>
<param name="mlMaxStopFrame" value="2mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="100mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkGrid" value="0"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="0"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="|"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="-"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="IC4" library="SchlegelAr_Master" package="TQFP64-0.8MM" value="ATXMEGA192A3" x="37" y="42" smashed="yes">
<attribute name="NAME" x="46.145" y="48.9027" size="1.27" layer="25"/>
<attribute name="VALUE" x="30.51" y="40.1077" size="1.27" layer="27"/>
</element>
<element name="Q1" library="SchlegelAr_Master" package="HC49/USSM" value="16MHz" x="35.3" y="56" rot="R180"/>
<element name="C1" library="SchlegelAr_Master" package="C0603" value="18p" x="28.3" y="58.8" smashed="yes" rot="R270">
<attribute name="NAME" x="26.435" y="59.435" size="0.8128" layer="25" rot="R270"/>
<attribute name="VALUE" x="26.395" y="59.435" size="0.8128" layer="27" rot="R270"/>
</element>
<element name="C2" library="SchlegelAr_Master" package="C0603" value="18p" x="42.3" y="58.8" rot="R270"/>
<element name="C3" library="SchlegelAr_Master" package="C0603" value="100n" x="31" y="52.35" rot="MR180"/>
<element name="C5" library="SchlegelAr_Master" package="C0603" value="100n" x="47.9" y="44.4" rot="MR90"/>
<element name="C6" library="SchlegelAr_Master" package="C0603" value="100n" x="25.95" y="37.7" rot="MR270"/>
<element name="C7" library="SchlegelAr_Master" package="C0603" value="100n" x="49.55" y="37" rot="MR0"/>
<element name="C8" library="SchlegelAr_Master" package="C0603" value="100n" x="37.55" y="52.6" rot="MR180"/>
<element name="JP1" library="pinhead" package="2X03" value="PDI" x="45.4" y="24.3" smashed="yes" rot="R270">
<attribute name="NAME" x="43.89" y="28.575" size="1.27" layer="25" ratio="10"/>
<attribute name="VALUE" x="40.955" y="28.11" size="1.27" layer="27" rot="R270"/>
</element>
<element name="R1" library="SchlegelAr_Master" package="R0603" value="10k" x="56" y="25" rot="MR180"/>
<element name="JP2" library="pinhead" package="1X02" value="RESET" x="50.5" y="24.4" smashed="yes" rot="R270">
<attribute name="NAME" x="48.9838" y="27.3288" size="1.27" layer="25" ratio="10"/>
<attribute name="VALUE" x="47.325" y="26.94" size="1.27" layer="27" rot="R270"/>
</element>
<element name="IC2" library="SchlegelAr_Master" package="SSOP28" value="FT232RL" x="17" y="16" rot="R90"/>
<element name="C11" library="SchlegelAr_Master" package="C0603" value="100n" x="17.1" y="19.9" rot="MR90"/>
<element name="C12" library="SchlegelAr_Master" package="C0603" value="100n" x="10" y="11" rot="MR270"/>
<element name="C9" library="SchlegelAr_Master" package="C0603" value="100n" x="16.9" y="13.1" rot="MR90"/>
<element name="X1" library="con-berg" package="PN61729-S" value="PN61729-S" x="6" y="15" rot="R270">
<attribute name="OC_NEWARK" value="unknown" x="-13" y="32" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MPN" value="" x="-13" y="32" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MF" value="" x="-13" y="32" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="-13" y="32" size="1.778" layer="27" rot="R270" display="off"/>
</element>
<element name="S1" library="switch-omron" package="B3F-10XX" value="" x="56.1" y="24.9" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="36M3542" x="56.1" y="24.9" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="B3F-1000" x="56.1" y="24.9" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="56.1" y="24.9" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="176432" x="56.1" y="24.9" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="NAME" x="61.417" y="23.852" size="1.27" layer="25" ratio="10" rot="R90"/>
<attribute name="VALUE" x="61.18" y="21.852" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="JP4" library="pinhead" package="1X02" value="RESET" x="21" y="43.3"/>
<element name="C13" library="SchlegelAr_Master" package="C0805" value="220n" x="13.2" y="87.9" smashed="yes" rot="R180">
<attribute name="NAME" x="15.87" y="88.47" size="1.27" layer="25" rot="R270"/>
<attribute name="VALUE" x="14.47" y="90.44" size="1.27" layer="27" rot="R180"/>
</element>
<element name="R2" library="SchlegelAr_Master" package="R0603" value="2k7" x="13.2" y="85.9" smashed="yes">
<attribute name="NAME" x="10.165" y="85.635" size="0.8128" layer="25"/>
<attribute name="VALUE" x="12.565" y="83.995" size="0.8128" layer="27"/>
</element>
<element name="C14" library="SchlegelAr_Master" package="C0805" value="220n" x="20.2" y="87.8" smashed="yes" rot="R180">
<attribute name="NAME" x="24.03" y="85.53" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="21.47" y="90.34" size="1.27" layer="27" rot="R180"/>
</element>
<element name="R3" library="SchlegelAr_Master" package="R0603" value="2k7" x="20.2" y="85.8" smashed="yes">
<attribute name="NAME" x="18.265" y="85.265" size="0.8128" layer="25" rot="R90"/>
<attribute name="VALUE" x="19.565" y="83.895" size="0.8128" layer="27"/>
</element>
<element name="C15" library="SchlegelAr_Master" package="C0805" value="220n" x="63.2" y="88" smashed="yes">
<attribute name="NAME" x="68.93" y="88.77" size="1.27" layer="25"/>
<attribute name="VALUE" x="61.93" y="85.46" size="1.27" layer="27"/>
</element>
<element name="R4" library="SchlegelAr_Master" package="R0603" value="2k7" x="63.2" y="86" rot="R180"/>
<element name="C16" library="SchlegelAr_Master" package="C0805" value="220n" x="58.7" y="88.1" smashed="yes">
<attribute name="NAME" x="55.63" y="85.43" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="57.43" y="85.56" size="1.27" layer="27"/>
</element>
<element name="R5" library="SchlegelAr_Master" package="R0603" value="2k7" x="58.7" y="86.1" rot="R180"/>
<element name="C17" library="SchlegelAr_Master" package="C0805" value="220n" x="44.2" y="87.9" smashed="yes">
<attribute name="NAME" x="41.83" y="85.43" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="42.93" y="85.36" size="1.27" layer="27"/>
</element>
<element name="R6" library="SchlegelAr_Master" package="R0603" value="2k7" x="44.2" y="85.9" rot="R180"/>
<element name="C18" library="SchlegelAr_Master" package="C0805" value="220n" x="50.2" y="87.7" smashed="yes">
<attribute name="NAME" x="48.03" y="85.43" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="48.93" y="85.16" size="1.27" layer="27"/>
</element>
<element name="R7" library="SchlegelAr_Master" package="R0603" value="2k7" x="50.2" y="85.7" rot="R180"/>
<element name="C19" library="SchlegelAr_Master" package="C0805" value="220n" x="28.2" y="88" smashed="yes">
<attribute name="NAME" x="31.23" y="85.43" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="26.93" y="85.46" size="1.27" layer="27"/>
</element>
<element name="R8" library="SchlegelAr_Master" package="R0603" value="2k7" x="28.2" y="86" rot="R180"/>
<element name="C20" library="SchlegelAr_Master" package="C0805" value="220n" x="33.8" y="88" smashed="yes">
<attribute name="NAME" x="37.23" y="85.53" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="32.53" y="85.46" size="1.27" layer="27"/>
</element>
<element name="R9" library="SchlegelAr_Master" package="R0603" value="2k7" x="33.8" y="86" rot="R180"/>
<element name="X2" library="con-wago-508" package="W237-6P" value="" x="22" y="94" smashed="yes">
<attribute name="OC_NEWARK" value="unknown" x="22" y="94" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="" x="22" y="94" size="1.778" layer="27" display="off"/>
<attribute name="MF" value="" x="22" y="94" size="1.778" layer="27" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="22" y="94" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="8.03" y="89.682" size="1.27" layer="27" ratio="10"/>
<attribute name="NAME" x="7.53" y="89.642" size="1.27" layer="25" ratio="10"/>
</element>
<element name="X3" library="con-wago-508" package="W237-6P" value="" x="53" y="94" smashed="yes">
<attribute name="OC_NEWARK" value="unknown" x="53" y="94" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="" x="53" y="94" size="1.778" layer="27" display="off"/>
<attribute name="MF" value="" x="53" y="94" size="1.778" layer="27" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="53" y="94" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="39.03" y="89.682" size="1.27" layer="27" ratio="10"/>
<attribute name="NAME" x="38.53" y="89.642" size="1.27" layer="25" ratio="10"/>
</element>
<element name="X4" library="con-wago-508" package="W237-8P" value="" x="70" y="68" smashed="yes" rot="R270">
<attribute name="OC_NEWARK" value="unknown" x="70" y="68" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MPN" value="" x="70" y="68" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MF" value="" x="70" y="68" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="70" y="68" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="VALUE" x="65.682" y="87.05" size="1.27" layer="27" ratio="10" rot="R270"/>
<attribute name="NAME" x="65.642" y="87.923" size="1.27" layer="25" ratio="10" rot="R270"/>
</element>
<element name="X5" library="con-wago-508" package="W237-8P" value="" x="70" y="25" smashed="yes" rot="R270">
<attribute name="OC_NEWARK" value="unknown" x="70" y="25" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MPN" value="" x="70" y="25" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MF" value="" x="70" y="25" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="70" y="25" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="VALUE" x="65.682" y="44.05" size="1.27" layer="27" ratio="10" rot="R270"/>
<attribute name="NAME" x="65.642" y="44.923" size="1.27" layer="25" ratio="10" rot="R270"/>
</element>
<element name="X6" library="con-wago-508" package="W237-132" value="" x="4" y="31" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="4" y="31" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="" x="4" y="31" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="4" y="31" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="4" y="31" size="1.778" layer="27" rot="R90" display="off"/>
</element>
<element name="T1" library="SchlegelAr_Master" package="SOT23" value="IRLML5203TRPBF" x="11" y="35" smashed="yes" rot="R90">
<attribute name="NAME" x="11.095" y="37.095" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="14.175" y="33.095" size="1.27" layer="27" rot="R90"/>
</element>
<element name="R10" library="SchlegelAr_Master" package="R0603" value="100k" x="11" y="32"/>
<element name="IC1" library="v-reg" package="SOT223" value="LM317-3V3" x="17.1" y="25.5" rot="R270"/>
<element name="C21" library="SchlegelAr_Master" package="C0805" value="1u" x="22.6" y="23.8" rot="R90"/>
<element name="C22" library="SchlegelAr_Master" package="C0805" value="100n" x="11.2" y="24.6" smashed="yes" rot="R270">
<attribute name="NAME" x="6.13" y="23.47" size="1.27" layer="25"/>
<attribute name="VALUE" x="8.66" y="25.87" size="1.27" layer="27" rot="R270"/>
</element>
<element name="X7" library="con-wago-508" package="W237-5P" value="" x="5" y="67" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="5" y="67" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="" x="5" y="67" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="5" y="67" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="5" y="67" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="9.318" y="55.57" size="1.27" layer="27" ratio="10" rot="R90"/>
<attribute name="NAME" x="9.358" y="55.57" size="1.27" layer="25" ratio="10" rot="R90"/>
</element>
<element name="IC3" library="v-reg" package="78XXS" value="7812" x="24.1" y="36" rot="R270"/>
<element name="C10" library="SchlegelAr_Master" package="C0805" value="1u" x="21" y="31" rot="MR0"/>
<element name="JP5" library="pinhead" package="1X02" value="" x="17" y="34" smashed="yes" rot="R270">
<attribute name="NAME" x="13.3838" y="36.8288" size="1.27" layer="25" ratio="10"/>
<attribute name="VALUE" x="13.825" y="36.54" size="1.27" layer="27" rot="R270"/>
</element>
<element name="X8" library="con-wago-508" package="W237-132" value="" x="5" y="47" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="5" y="47" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="" x="5" y="47" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="5" y="47" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="5" y="47" size="1.778" layer="27" rot="R90" display="off"/>
</element>
<element name="JP6" library="pinhead" package="2X04" value="" x="26" y="10" rot="R90"/>
<element name="JP3" library="pinhead" package="1X07" value="" x="38.65" y="3.25" rot="R180"/>
</elements>
<signals>
<signal name="GND">
<contactref element="IC4" pad="14"/>
<contactref element="IC4" pad="24"/>
<contactref element="IC4" pad="34"/>
<contactref element="IC4" pad="44"/>
<contactref element="IC4" pad="52"/>
<contactref element="IC4" pad="60"/>
<contactref element="C1" pad="1"/>
<contactref element="C2" pad="1"/>
<contactref element="C3" pad="1"/>
<contactref element="C5" pad="1"/>
<contactref element="C6" pad="1"/>
<contactref element="C7" pad="1"/>
<contactref element="C8" pad="1"/>
<contactref element="JP1" pad="6"/>
<contactref element="IC2" pad="7"/>
<contactref element="IC2" pad="25"/>
<contactref element="IC2" pad="18"/>
<contactref element="IC2" pad="21"/>
<contactref element="X1" pad="4"/>
<contactref element="X1" pad="S1"/>
<contactref element="X1" pad="S2"/>
<contactref element="C11" pad="2"/>
<contactref element="IC2" pad="26"/>
<contactref element="C12" pad="2"/>
<contactref element="C9" pad="1"/>
<contactref element="S1" pad="4"/>
<contactref element="S1" pad="3"/>
<contactref element="JP2" pad="1"/>
<contactref element="JP4" pad="1"/>
<contactref element="C13" pad="1"/>
<contactref element="C14" pad="1"/>
<contactref element="C15" pad="1"/>
<contactref element="C16" pad="1"/>
<contactref element="C17" pad="1"/>
<contactref element="C18" pad="1"/>
<contactref element="C19" pad="1"/>
<contactref element="C20" pad="1"/>
<contactref element="X2" pad="4"/>
<contactref element="X2" pad="1"/>
<contactref element="X3" pad="1"/>
<contactref element="X3" pad="4"/>
<contactref element="X6" pad="1"/>
<contactref element="R10" pad="1"/>
<contactref element="C22" pad="1"/>
<contactref element="IC1" pad="1"/>
<contactref element="C21" pad="1"/>
<contactref element="X7" pad="1"/>
<contactref element="IC3" pad="GND"/>
<contactref element="C10" pad="1"/>
<contactref element="X8" pad="1"/>
<contactref element="X5" pad="1"/>
<contactref element="X5" pad="5"/>
<contactref element="X4" pad="1"/>
<contactref element="X4" pad="5"/>
<contactref element="JP6" pad="4"/>
<contactref element="JP6" pad="3"/>
<polygon width="0.1" layer="16" isolate="0.4064" orphans="yes" rank="6">
<vertex x="0" y="100"/>
<vertex x="75" y="100"/>
<vertex x="75" y="0"/>
<vertex x="0" y="0"/>
</polygon>
<polygon width="0.1" layer="1" isolate="0.4064" orphans="yes" rank="6">
<vertex x="0" y="100"/>
<vertex x="75" y="100"/>
<vertex x="75" y="0"/>
<vertex x="0" y="0"/>
</polygon>
<via x="30.9" y="47.9" extent="1-16" drill="0.6"/>
<wire x1="30.9" y1="47.9" x2="31.2" y2="47.9" width="0.4" layer="1"/>
<wire x1="34.06" y1="49.8" x2="34.06" y2="48.14" width="0.4" layer="1"/>
<wire x1="34.06" y1="48.14" x2="34.1" y2="48.2" width="0.4" layer="1"/>
<via x="34.1" y="48.2" extent="1-16" drill="0.6"/>
<wire x1="36.7" y1="50.1" x2="36.7" y2="52.6" width="0.4" layer="16"/>
<wire x1="47.9" y1="43.55" x2="47.85" y2="43.6" width="0.4" layer="16"/>
<wire x1="47.85" y1="43.6" x2="42.5" y2="43.6" width="0.4" layer="16"/>
<wire x1="42.5" y1="43.6" x2="42.3" y2="43.8" width="0.4" layer="16"/>
<wire x1="42.3" y1="43.8" x2="42.3" y2="44.1" width="0.4" layer="16"/>
<via x="42.3" y="44.1" extent="1-16" drill="0.6"/>
<wire x1="42.3" y1="44.1" x2="43" y2="44.8" width="0.4" layer="1"/>
<wire x1="43" y1="44.8" x2="44.66" y2="44.8" width="0.4" layer="1"/>
<wire x1="25.95" y1="38.55" x2="26.2" y2="38.3" width="0.4" layer="16"/>
<wire x1="29.06" y1="37.6" x2="30.4" y2="37.6" width="0.4" layer="1"/>
<wire x1="30.4" y1="37.6" x2="30.8" y2="38" width="0.4" layer="1"/>
<wire x1="30.8" y1="38" x2="30.8" y2="38.3" width="0.4" layer="1"/>
<via x="30.8" y="38.3" extent="1-16" drill="0.6"/>
<wire x1="30.8" y1="38.3" x2="30.55" y2="38.55" width="0.4" layer="16"/>
<wire x1="30.55" y1="38.55" x2="25.95" y2="38.55" width="0.4" layer="16"/>
<wire x1="20.625" y1="15.675" x2="20.6" y2="15.7" width="0.4" layer="1"/>
<wire x1="20.6" y1="15.7" x2="19.1" y2="15.7" width="0.4" layer="1"/>
<wire x1="13.375" y1="13.075" x2="13.4" y2="13.1" width="0.4" layer="1"/>
<wire x1="13.4" y1="13.1" x2="15.2" y2="13.1" width="0.4" layer="1"/>
<wire x1="13.375" y1="18.275" x2="13.4" y2="18.3" width="0.35" layer="1"/>
<wire x1="13.4" y1="18.3" x2="14.3" y2="18.3" width="0.35" layer="1"/>
<wire x1="14.3" y1="18.3" x2="14.8" y2="17.8" width="0.35" layer="1"/>
<wire x1="14.8" y1="17.8" x2="15.55" y2="17.8" width="0.35" layer="1"/>
<wire x1="13.375" y1="16.325" x2="13.4" y2="16.35" width="0.35" layer="1"/>
<wire x1="13.4" y1="16.35" x2="15" y2="16.35" width="0.35" layer="1"/>
<wire x1="15" y1="16.35" x2="15.2" y2="16.15" width="0.35" layer="1"/>
<wire x1="15.2" y1="16.15" x2="15.2" y2="15.8" width="0.35" layer="1"/>
<wire x1="13.375" y1="13.725" x2="13.4" y2="13.75" width="0.35" layer="1"/>
<wire x1="13.4" y1="13.75" x2="14.85" y2="13.75" width="0.35" layer="1"/>
<contactref element="JP3" pad="2"/>
<wire x1="34.1" y1="48.2" x2="34.8" y2="48.2" width="0.35" layer="16"/>
<wire x1="34.8" y1="48.2" x2="36.7" y2="50.1" width="0.35" layer="16"/>
<wire x1="30.15" y1="52.35" x2="30.15" y2="48.65" width="0.35" layer="16"/>
<wire x1="30.15" y1="48.65" x2="30.9" y2="47.9" width="0.35" layer="16"/>
<wire x1="40.46" y1="49.8" x2="40.5" y2="49.84" width="0.4" layer="1"/>
<wire x1="40.5" y1="49.84" x2="40.5" y2="52" width="0.4" layer="1"/>
<via x="40.2" y="52.4" extent="1-16" drill="0.6"/>
<wire x1="40.2" y1="52.4" x2="40.2" y2="52.3" width="0.4" layer="1"/>
<wire x1="40.2" y1="52.3" x2="40.5" y2="52" width="0.4" layer="1"/>
<wire x1="36.7" y1="52.6" x2="36.7" y2="53.4" width="0.4" layer="16"/>
<wire x1="36.7" y1="53.4" x2="37" y2="53.7" width="0.4" layer="16"/>
<wire x1="37" y1="53.7" x2="39.8" y2="53.7" width="0.4" layer="16"/>
<wire x1="39.8" y1="53.7" x2="40.2" y2="53.3" width="0.4" layer="16"/>
<wire x1="40.2" y1="53.3" x2="40.2" y2="52.4" width="0.4" layer="16"/>
</signal>
<signal name="+3V3">
<contactref element="IC4" pad="45"/>
<contactref element="IC4" pad="53"/>
<contactref element="IC4" pad="15"/>
<contactref element="IC4" pad="25"/>
<contactref element="IC4" pad="35"/>
<contactref element="IC4" pad="61"/>
<contactref element="C3" pad="2"/>
<contactref element="C5" pad="2"/>
<contactref element="C6" pad="2"/>
<contactref element="C7" pad="2"/>
<contactref element="C8" pad="2"/>
<contactref element="JP1" pad="2"/>
<contactref element="R1" pad="1"/>
<contactref element="R2" pad="2"/>
<contactref element="R3" pad="2"/>
<contactref element="R4" pad="2"/>
<contactref element="R5" pad="2"/>
<contactref element="R6" pad="2"/>
<contactref element="R7" pad="2"/>
<contactref element="R8" pad="2"/>
<contactref element="R9" pad="2"/>
<contactref element="C21" pad="2"/>
<contactref element="IC1" pad="4"/>
<wire x1="29.06" y1="36.8" x2="27.4" y2="36.8" width="0.4064" layer="1"/>
<via x="27.4" y="36.8" extent="1-16" drill="0.6"/>
<wire x1="27.4" y1="36.8" x2="26" y2="36.8" width="0.4064" layer="16"/>
<wire x1="26" y1="36.8" x2="25.95" y2="36.85" width="0.4064" layer="16"/>
<wire x1="44.66" y1="37.6" x2="46.2" y2="37.6" width="0.4064" layer="1"/>
<wire x1="46.2" y1="37.6" x2="46.7" y2="37.1" width="0.4064" layer="1"/>
<via x="46.7" y="37.1" extent="1-16" drill="0.6"/>
<wire x1="46.7" y1="37.1" x2="48.6" y2="37.1" width="0.4064" layer="16"/>
<wire x1="48.6" y1="37.1" x2="48.7" y2="37" width="0.4064" layer="16"/>
<wire x1="44.66" y1="45.6" x2="46.2" y2="45.6" width="0.4064" layer="1"/>
<wire x1="46.2" y1="45.6" x2="46.4" y2="45.4" width="0.4064" layer="1"/>
<via x="46.4" y="45.4" extent="1-16" drill="0.6"/>
<wire x1="46.4" y1="45.4" x2="47.75" y2="45.4" width="0.4064" layer="16"/>
<wire x1="47.75" y1="45.4" x2="47.9" y2="45.25" width="0.4064" layer="16"/>
<wire x1="33.26" y1="49.8" x2="33.26" y2="51.16" width="0.4064" layer="1"/>
<wire x1="33.26" y1="51.16" x2="33.8" y2="51.7" width="0.4064" layer="1"/>
<via x="33.8" y="51.7" extent="1-16" drill="0.6"/>
<wire x1="33.8" y1="51.7" x2="33.8" y2="52.1" width="0.4064" layer="16"/>
<wire x1="33.8" y1="52.1" x2="33.7" y2="52.2" width="0.4064" layer="16"/>
<wire x1="33.7" y1="52.2" x2="32" y2="52.2" width="0.4064" layer="16"/>
<wire x1="32" y1="52.2" x2="31.85" y2="52.35" width="0.4064" layer="16"/>
<polygon width="0.63" layer="16" isolate="0.4064">
<vertex x="22.2" y="24.2"/>
<vertex x="37.7" y="24.2"/>
<vertex x="45" y="16.9"/>
<vertex x="45" y="1"/>
<vertex x="49" y="1"/>
<vertex x="49" y="17"/>
<vertex x="51" y="19"/>
<vertex x="60.5" y="19"/>
<vertex x="62" y="20.5"/>
<vertex x="62" y="27.6"/>
<vertex x="57.5" y="32.1"/>
<vertex x="49.7" y="32.1"/>
<vertex x="48.9" y="32.9"/>
<vertex x="49" y="55"/>
<vertex x="49" y="62"/>
<vertex x="45" y="66"/>
<vertex x="37" y="66"/>
<vertex x="34" y="69"/>
<vertex x="34" y="81"/>
<vertex x="36" y="83"/>
<vertex x="65" y="83"/>
<vertex x="66" y="84"/>
<vertex x="66" y="86"/>
<vertex x="65" y="87"/>
<vertex x="11" y="87"/>
<vertex x="10" y="86"/>
<vertex x="10" y="84"/>
<vertex x="11" y="83"/>
<vertex x="28" y="83"/>
<vertex x="30" y="81"/>
<vertex x="30" y="67.8"/>
<vertex x="22.8" y="60.6"/>
<vertex x="22.8" y="47.3"/>
<vertex x="26" y="44.1"/>
<vertex x="26" y="31.7"/>
<vertex x="21.7" y="27.4"/>
<vertex x="21.7" y="24.7"/>
</polygon>
<via x="22.4" y="27.2" extent="1-16" drill="0.6"/>
<wire x1="44.66" y1="37.6" x2="43" y2="37.6" width="0.4064" layer="1"/>
<wire x1="37.26" y1="34.2" x2="37.26" y2="35.76" width="0.4064" layer="1"/>
<wire x1="43.35" y1="85.9" x2="41.7" y2="85.9" width="0.4064" layer="1"/>
<via x="41.7" y="85.9" extent="1-16" drill="0.6"/>
<via x="47.9" y="85.7" extent="1-16" drill="0.6"/>
<via x="56.4" y="86" extent="1-16" drill="0.6"/>
<via x="60.9" y="86" extent="1-16" drill="0.6"/>
<via x="31.4" y="86" extent="1-16" drill="0.6"/>
<via x="25.9" y="86" extent="1-16" drill="0.6"/>
<via x="22.5" y="85.8" extent="1-16" drill="0.6"/>
<via x="15.5" y="85.9" extent="1-16" drill="0.6"/>
<wire x1="14.05" y1="85.9" x2="15.5" y2="85.9" width="0.4064" layer="1"/>
<wire x1="21.05" y1="85.8" x2="22.5" y2="85.8" width="0.4064" layer="1"/>
<wire x1="27.35" y1="86" x2="25.9" y2="86" width="0.4064" layer="1"/>
<wire x1="32.95" y1="86" x2="31.4" y2="86" width="0.4064" layer="1"/>
<wire x1="49.35" y1="85.7" x2="47.9" y2="85.7" width="0.4064" layer="1"/>
<wire x1="57.85" y1="86.1" x2="56.5" y2="86.1" width="0.4064" layer="1"/>
<wire x1="56.5" y1="86.1" x2="56.4" y2="86" width="0.4064" layer="1"/>
<wire x1="62.35" y1="86" x2="60.9" y2="86" width="0.4064" layer="1"/>
<via x="33.75" y="82.45" extent="1-16" drill="0.6"/>
<polygon width="0.1" layer="1" isolate="0.4064">
<vertex x="11" y="87"/>
<vertex x="65" y="87"/>
<vertex x="66" y="86"/>
<vertex x="66" y="84"/>
<vertex x="65" y="83"/>
<vertex x="36" y="83"/>
<vertex x="34" y="81"/>
<vertex x="30" y="81"/>
<vertex x="28" y="83"/>
<vertex x="11" y="83"/>
<vertex x="10" y="84"/>
<vertex x="10" y="86"/>
</polygon>
<via x="30.25" y="82.45" extent="1-16" drill="0.6"/>
<contactref element="JP3" pad="1"/>
<wire x1="39.66" y1="49.8" x2="39.6" y2="49.86" width="0.4" layer="1"/>
<wire x1="39.6" y1="49.86" x2="39.6" y2="51" width="0.4" layer="1"/>
<wire x1="39.6" y1="51" x2="39.3" y2="51.3" width="0.4" layer="1"/>
<wire x1="39.3" y1="51.3" x2="38.8" y2="51.3" width="0.4" layer="1"/>
<via x="38.8" y="51.3" extent="1-16" drill="0.6"/>
<wire x1="38.8" y1="51.3" x2="38.4" y2="51.7" width="0.4" layer="16"/>
<wire x1="38.4" y1="51.7" x2="38.4" y2="52.6" width="0.4" layer="16"/>
<wire x1="20.25" y1="25.5" x2="21" y2="24.75" width="0.8" layer="1"/>
<wire x1="21" y1="24.75" x2="22.6" y2="24.75" width="0.8" layer="1"/>
<via x="23.8" y="27.2" extent="1-16" drill="0.6"/>
<wire x1="22.6" y1="24.75" x2="22.4" y2="24.95" width="0.8" layer="1"/>
<wire x1="22.4" y1="24.95" x2="22.4" y2="27.2" width="0.8" layer="1"/>
<wire x1="22.4" y1="27.2" x2="23.9" y2="27.2" width="0.8" layer="1"/>
<wire x1="43" y1="37.6" x2="42.9" y2="37.6" width="0.4" layer="1"/>
<wire x1="42.9" y1="37.6" x2="40.6" y2="39.9" width="0.4" layer="1"/>
<wire x1="40.6" y1="39.9" x2="38.8" y2="39.9" width="0.4" layer="1"/>
<wire x1="38.8" y1="39.9" x2="38.4" y2="39.5" width="0.4" layer="1"/>
<wire x1="38.4" y1="39.5" x2="38.4" y2="36.9" width="0.4" layer="1"/>
<wire x1="38.4" y1="36.9" x2="37.26" y2="35.76" width="0.4" layer="1"/>
</signal>
<signal name="N$1">
<contactref element="C1" pad="2"/>
<contactref element="Q1" pad="2"/>
<contactref element="IC4" pad="59"/>
<wire x1="34.86" y1="49.8" x2="34.86" y2="55.34" width="0.4" layer="1"/>
<wire x1="34.86" y1="55.34" x2="34.2" y2="56" width="0.4" layer="1"/>
<wire x1="34.2" y1="56" x2="30.474" y2="56" width="0.4" layer="1"/>
<wire x1="28.3" y1="57.95" x2="28.3" y2="56.7" width="0.4" layer="1"/>
<wire x1="28.3" y1="56.7" x2="28.5" y2="56.5" width="0.4" layer="1"/>
<wire x1="28.5" y1="56.5" x2="29.974" y2="56.5" width="0.4" layer="1"/>
<wire x1="29.974" y1="56.5" x2="30.474" y2="56" width="0.4" layer="1"/>
</signal>
<signal name="N$2">
<contactref element="C2" pad="2"/>
<contactref element="Q1" pad="1"/>
<contactref element="IC4" pad="58"/>
<wire x1="35.66" y1="49.8" x2="35.66" y2="55.26" width="0.4" layer="1"/>
<wire x1="35.66" y1="55.26" x2="36.4" y2="56" width="0.4" layer="1"/>
<wire x1="36.4" y1="56" x2="40.126" y2="56" width="0.4" layer="1"/>
<wire x1="42.3" y1="57.95" x2="42.3" y2="56.2" width="0.4" layer="1"/>
<wire x1="42.3" y1="56.2" x2="42.1" y2="56" width="0.4" layer="1"/>
<wire x1="42.1" y1="56" x2="40.126" y2="56" width="0.4" layer="1"/>
</signal>
<signal name="+5V">
<contactref element="IC2" pad="19"/>
<contactref element="IC2" pad="4"/>
<contactref element="IC2" pad="20"/>
<contactref element="C12" pad="1"/>
<contactref element="X1" pad="1"/>
<contactref element="C9" pad="2"/>
<contactref element="JP6" pad="1"/>
<contactref element="JP6" pad="2"/>
<wire x1="13.375" y1="17.625" x2="13.375" y2="16.975" width="0.4" layer="1"/>
<wire x1="13.375" y1="16.975" x2="12.175" y2="16.975" width="0.4" layer="1"/>
<wire x1="12.175" y1="16.975" x2="12.1" y2="16.9" width="0.4" layer="1"/>
<wire x1="12.1" y1="16.9" x2="12.1" y2="15.14" width="0.4" layer="1"/>
<wire x1="12.1" y1="15.14" x2="10.71" y2="13.75" width="0.4" layer="1"/>
<wire x1="10" y1="11.85" x2="10" y2="13.04" width="0.4" layer="16"/>
<wire x1="10" y1="13.04" x2="10.71" y2="13.75" width="0.4" layer="16"/>
<wire x1="13.375" y1="16.975" x2="15.925" y2="16.975" width="0.4" layer="1"/>
<wire x1="15.925" y1="16.975" x2="16.9" y2="16" width="0.4" layer="1"/>
<wire x1="16.9" y1="16" x2="16.9" y2="14.7" width="0.4" layer="1"/>
<wire x1="20.625" y1="13.725" x2="18.9" y2="13.725" width="0.4" layer="1"/>
<wire x1="18.9" y1="13.725" x2="18.475" y2="13.725" width="0.4" layer="1"/>
<wire x1="18.475" y1="13.725" x2="18.4" y2="13.8" width="0.4" layer="1"/>
<via x="18.4" y="13.8" extent="1-16" drill="0.6"/>
<wire x1="18.4" y1="13.8" x2="17.05" y2="13.8" width="0.4" layer="16"/>
<wire x1="17.05" y1="13.8" x2="16.9" y2="13.95" width="0.4" layer="16"/>
<wire x1="16.9" y1="14.7" x2="17.8" y2="13.8" width="0.4" layer="1"/>
<wire x1="17.8" y1="13.8" x2="18.4" y2="13.8" width="0.4" layer="1"/>
<wire x1="24.73" y1="6.19" x2="23.51" y2="6.19" width="0.4" layer="1"/>
<wire x1="23.51" y1="6.19" x2="18.4" y2="11.3" width="0.4" layer="1"/>
<wire x1="18.4" y1="11.3" x2="18.4" y2="13.225" width="0.4" layer="1"/>
<wire x1="18.4" y1="13.225" x2="18.9" y2="13.725" width="0.4" layer="1"/>
<wire x1="24.73" y1="6.19" x2="27.27" y2="6.19" width="0.4" layer="1"/>
</signal>
<signal name="FTDI_3V3OUT">
<contactref element="IC2" pad="17"/>
<contactref element="C11" pad="1"/>
<wire x1="13.375" y1="18.925" x2="15.675" y2="18.925" width="0.4" layer="1"/>
<wire x1="15.675" y1="18.925" x2="15.7" y2="18.9" width="0.4" layer="1"/>
<via x="15.7" y="18.9" extent="1-16" drill="0.6"/>
<wire x1="15.7" y1="18.9" x2="16.95" y2="18.9" width="0.4" layer="16"/>
<wire x1="16.95" y1="18.9" x2="17.1" y2="19.05" width="0.4" layer="16"/>
</signal>
<signal name="USB_DM">
<contactref element="X1" pad="2"/>
<contactref element="IC2" pad="16"/>
<wire x1="13.375" y1="19.575" x2="11.375" y2="19.575" width="0.4" layer="1"/>
<wire x1="11.375" y1="19.575" x2="10.7" y2="18.9" width="0.4" layer="1"/>
<wire x1="10.7" y1="18.9" x2="10.7" y2="16.26" width="0.4" layer="1"/>
<wire x1="10.7" y1="16.26" x2="10.71" y2="16.25" width="0.4" layer="1"/>
</signal>
<signal name="USB_DP">
<contactref element="X1" pad="3"/>
<contactref element="IC2" pad="15"/>
<wire x1="13.375" y1="20.225" x2="11.025" y2="20.225" width="0.4" layer="1"/>
<wire x1="11.025" y1="20.225" x2="8.7" y2="17.9" width="0.4" layer="1"/>
<wire x1="8.7" y1="17.9" x2="8.7" y2="16.26" width="0.4" layer="1"/>
<wire x1="8.7" y1="16.26" x2="8.71" y2="16.25" width="0.4" layer="1"/>
</signal>
<signal name="C_DIO_RXD">
<contactref element="IC4" pad="19"/>
<contactref element="JP6" pad="5"/>
<wire x1="32.46" y1="34.2" x2="32.46" y2="13.26" width="0.4" layer="1"/>
<wire x1="32.46" y1="13.26" x2="30.47" y2="11.27" width="0.4" layer="1"/>
<wire x1="27.27" y1="11.27" x2="30.47" y2="11.27" width="0.4" layer="1"/>
</signal>
<signal name="C_DIO_TXD">
<contactref

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: brd


text:
element="IC4" pad="18"/>
<contactref element="JP6" pad="7"/>
<wire x1="31.66" y1="34.2" x2="31.66" y2="14.76" width="0.4" layer="1"/>
<wire x1="31.66" y1="14.76" x2="30.71" y2="13.81" width="0.4" layer="1"/>
<wire x1="27.27" y1="13.81" x2="30.71" y2="13.81" width="0.4" layer="1"/>
</signal>
<signal name="C_DIO_BOOT">
<contactref element="IC4" pad="6"/>
<contactref element="JP4" pad="2"/>
<wire x1="29.06" y1="44" x2="22.97" y2="44" width="0.4" layer="1"/>
<wire x1="22.97" y1="44" x2="22.27" y2="43.3" width="0.4" layer="1"/>
</signal>
<signal name="C_DIO_PDI_CLK">
<contactref element="R1" pad="2"/>
<contactref element="S1" pad="2"/>
<contactref element="S1" pad="1"/>
<contactref element="JP2" pad="2"/>
<contactref element="JP1" pad="5"/>
<contactref element="IC4" pad="57"/>
<via x="34.9" y="36.1" extent="1-16" drill="0.6"/>
<wire x1="34.9" y1="28.9" x2="42.2" y2="21.6" width="0.4" layer="16"/>
<wire x1="49" y1="21.63" x2="50.5" y2="23.13" width="0.4" layer="16"/>
<wire x1="50.5" y1="23.13" x2="52.3582" y2="23.13" width="0.4" layer="16"/>
<wire x1="52.3582" y1="23.13" x2="53.8394" y2="21.6488" width="0.4" layer="16"/>
<wire x1="53.8394" y1="21.6488" x2="54.8488" y2="21.6488" width="0.4" layer="16"/>
<wire x1="54.8488" y1="21.6488" x2="56.8" y2="23.6" width="0.4" layer="16"/>
<wire x1="56.8" y1="23.6" x2="56.8" y2="24.95" width="0.4" layer="16"/>
<wire x1="56.8" y1="24.95" x2="56.85" y2="25" width="0.4" layer="16"/>
<wire x1="53.8394" y1="28.1512" x2="55.1488" y2="28.1512" width="0.4" layer="16"/>
<wire x1="55.1488" y1="28.1512" x2="57" y2="26.3" width="0.4" layer="16"/>
<wire x1="57" y1="26.3" x2="57" y2="25.15" width="0.4" layer="16"/>
<wire x1="57" y1="25.15" x2="56.85" y2="25" width="0.4" layer="16"/>
<wire x1="36.46" y1="49.8" x2="36.46" y2="39.76" width="0.4" layer="1"/>
<wire x1="36.46" y1="39.76" x2="34.9" y2="38.2" width="0.4" layer="1"/>
<wire x1="34.9" y1="38.2" x2="34.9" y2="36.1" width="0.4" layer="1"/>
<wire x1="34.9" y1="36.1" x2="34.9" y2="28.9" width="0.4" layer="16"/>
<wire x1="42.2" y1="21.6" x2="43.97" y2="21.6" width="0.4" layer="16"/>
<wire x1="43.97" y1="21.6" x2="44.13" y2="21.76" width="0.4" layer="16"/>
<wire x1="44.13" y1="21.76" x2="44.13" y2="21.07" width="0.4" layer="16"/>
<wire x1="44.13" y1="21.07" x2="45.7" y2="19.5" width="0.4" layer="16"/>
<wire x1="45.7" y1="19.5" x2="47.8" y2="19.5" width="0.4" layer="16"/>
<wire x1="47.8" y1="19.5" x2="49" y2="20.7" width="0.4" layer="16"/>
<wire x1="49" y1="20.7" x2="49" y2="21.63" width="0.4" layer="16"/>
</signal>
<signal name="C_DIO_PDI">
<contactref element="JP1" pad="1"/>
<contactref element="IC4" pad="56"/>
<via x="36.3" y="36.3" extent="1-16" drill="0.6"/>
<wire x1="36.3" y1="34.67" x2="44.13" y2="26.84" width="0.4" layer="16"/>
<wire x1="37.26" y1="49.8" x2="37.26" y2="38.96" width="0.4" layer="1"/>
<wire x1="37.26" y1="38.96" x2="36.3" y2="38" width="0.4" layer="1"/>
<wire x1="36.3" y1="38" x2="36.3" y2="36.3" width="0.4" layer="1"/>
<wire x1="36.3" y1="36.3" x2="36.3" y2="34.67" width="0.4" layer="16"/>
</signal>
<signal name="C_DI_XMIN">
<contactref element="IC4" pad="4"/>
<contactref element="C14" pad="2"/>
<contactref element="R3" pad="1"/>
<contactref element="X2" pad="3"/>
<wire x1="19.46" y1="93.365" x2="19.46" y2="88.01" width="0.4" layer="1"/>
<wire x1="19.46" y1="88.01" x2="19.25" y2="87.8" width="0.4" layer="1"/>
<wire x1="19.35" y1="85.8" x2="19.35" y2="87.7" width="0.4" layer="1"/>
<wire x1="19.35" y1="87.7" x2="19.25" y2="87.8" width="0.4" layer="1"/>
<wire x1="19.35" y1="85.8" x2="19.35" y2="78.65" width="0.4" layer="1"/>
<wire x1="19.35" y1="78.65" x2="21.2" y2="76.8" width="0.4" layer="1"/>
<wire x1="21.2" y1="76.8" x2="21.2" y2="49.2" width="0.4" layer="1"/>
<wire x1="29.06" y1="45.6" x2="24.8" y2="45.6" width="0.4" layer="1"/>
<wire x1="21.2" y1="49.2" x2="24.8" y2="45.6" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_XMAX">
<contactref element="C13" pad="2"/>
<contactref element="R2" pad="1"/>
<contactref element="IC4" pad="5"/>
<contactref element="X2" pad="2"/>
<wire x1="12.25" y1="87.9" x2="12.25" y2="91.235" width="0.4" layer="1"/>
<wire x1="12.25" y1="91.235" x2="14.38" y2="93.365" width="0.4" layer="1"/>
<wire x1="12.25" y1="87.9" x2="12.25" y2="86" width="0.4" layer="1"/>
<wire x1="12.25" y1="86" x2="12.35" y2="85.9" width="0.4" layer="1"/>
<wire x1="29.06" y1="44.8" x2="24.1" y2="44.8" width="0.4" layer="1"/>
<wire x1="24.1" y1="44.8" x2="23.45" y2="45.45" width="0.4" layer="1"/>
<wire x1="23.45" y1="45.45" x2="22.8" y2="46.1" width="0.4" layer="1"/>
<wire x1="20.2" y1="48.7" x2="20.2" y2="76.1" width="0.4" layer="1"/>
<wire x1="20.2" y1="76.1" x2="12.4" y2="83.9" width="0.4" layer="1"/>
<wire x1="12.4" y1="83.9" x2="12.4" y2="85.85" width="0.4" layer="1"/>
<wire x1="12.4" y1="85.85" x2="12.35" y2="85.9" width="0.4" layer="1"/>
<wire x1="20.2" y1="48.7" x2="22.8" y2="46.1" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_YMIN">
<contactref element="IC4" pad="32"/>
<contactref element="C15" pad="2"/>
<contactref element="R4" pad="1"/>
<wire x1="64.19" y1="88.04" x2="64.15" y2="88" width="0.6" layer="1"/>
<contactref element="X3" pad="6"/>
<wire x1="65.7" y1="93.365" x2="65.7" y2="92.2" width="0.4" layer="1"/>
<wire x1="65.7" y1="92.2" x2="64" y2="90.5" width="0.4" layer="1"/>
<wire x1="64" y1="90.5" x2="64" y2="88.15" width="0.4" layer="1"/>
<wire x1="64" y1="88.15" x2="64.15" y2="88" width="0.4" layer="1"/>
<wire x1="64.05" y1="86" x2="64.05" y2="87.9" width="0.4" layer="1"/>
<wire x1="64.05" y1="87.9" x2="64.15" y2="88" width="0.4" layer="1"/>
<wire x1="42.86" y1="34.2" x2="53.2" y2="34.2" width="0.4" layer="1"/>
<wire x1="53.2" y1="34.2" x2="53.4" y2="34.4" width="0.4" layer="1"/>
<via x="53.4" y="34.4" extent="1-16" drill="0.6"/>
<wire x1="53.4" y1="34.4" x2="53.4" y2="73.2" width="0.4" layer="16"/>
<wire x1="53.4" y1="73.2" x2="64" y2="83.8" width="0.4" layer="16"/>
<via x="64" y="83.8" extent="1-16" drill="0.6"/>
<wire x1="64" y1="83.8" x2="64" y2="85.95" width="0.4" layer="1"/>
<wire x1="64" y1="85.95" x2="64.05" y2="86" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_YMAX">
<contactref element="IC4" pad="33"/>
<contactref element="C16" pad="2"/>
<contactref element="R5" pad="1"/>
<wire x1="59.67" y1="88.12" x2="59.65" y2="88.1" width="0.6" layer="1"/>
<contactref element="X3" pad="5"/>
<wire x1="60.62" y1="93.365" x2="60.62" y2="91.62" width="0.4" layer="1"/>
<wire x1="60.62" y1="91.62" x2="59.5" y2="90.5" width="0.4" layer="1"/>
<wire x1="59.5" y1="90.5" x2="59.5" y2="88.25" width="0.4" layer="1"/>
<wire x1="59.5" y1="88.25" x2="59.65" y2="88.1" width="0.4" layer="1"/>
<wire x1="59.55" y1="86.1" x2="59.55" y2="88" width="0.4" layer="1"/>
<wire x1="59.55" y1="88" x2="59.65" y2="88.1" width="0.4" layer="1"/>
<wire x1="44.66" y1="36" x2="51.9" y2="36" width="0.4" layer="1"/>
<wire x1="51.9" y1="36" x2="52.1" y2="36.2" width="0.4" layer="1"/>
<via x="52.1" y="36.2" extent="1-16" drill="0.6"/>
<wire x1="52.1" y1="36.2" x2="52.1" y2="76.7" width="0.4" layer="16"/>
<wire x1="52.1" y1="76.7" x2="59.6" y2="84.2" width="0.4" layer="16"/>
<via x="59.6" y="84.2" extent="1-16" drill="0.6"/>
<wire x1="59.6" y1="84.2" x2="59.6" y2="86.05" width="0.4" layer="1"/>
<wire x1="59.6" y1="86.05" x2="59.55" y2="86.1" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_ZMIN">
<contactref element="IC4" pad="42"/>
<contactref element="C18" pad="2"/>
<contactref element="R7" pad="1"/>
<wire x1="51.05" y1="87.6" x2="51.15" y2="87.7" width="0.6" layer="1"/>
<contactref element="X3" pad="3"/>
<wire x1="51.05" y1="87.6" x2="51.05" y2="92.775" width="0.4" layer="1"/>
<wire x1="51.05" y1="92.775" x2="50.46" y2="93.365" width="0.4" layer="1"/>
<wire x1="51.05" y1="87.6" x2="51.05" y2="85.7" width="0.4" layer="1"/>
<wire x1="44.66" y1="43.2" x2="50.4" y2="43.2" width="0.4" layer="1"/>
<wire x1="50.4" y1="43.2" x2="50.6" y2="43.4" width="0.4" layer="1"/>
<via x="50.6" y="43.4" extent="1-16" drill="0.6"/>
<wire x1="50.6" y1="43.4" x2="50.6" y2="82.4" width="0.4" layer="16"/>
<wire x1="50.6" y1="82.4" x2="51.1" y2="82.9" width="0.4" layer="16"/>
<via x="51.1" y="82.9" extent="1-16" drill="0.6"/>
<wire x1="51.1" y1="82.9" x2="51.1" y2="85.65" width="0.4" layer="1"/>
<wire x1="51.1" y1="85.65" x2="51.05" y2="85.7" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_ZMAX">
<contactref element="IC4" pad="43"/>
<contactref element="C17" pad="2"/>
<contactref element="R6" pad="1"/>
<wire x1="45.17" y1="87.88" x2="45.15" y2="87.9" width="0.6" layer="1"/>
<wire x1="45.05" y1="87.8" x2="45.15" y2="87.9" width="0.6" layer="1"/>
<contactref element="X3" pad="2"/>
<wire x1="45.38" y1="93.365" x2="45.38" y2="88.13" width="0.4" layer="1"/>
<wire x1="45.38" y1="88.13" x2="45.15" y2="87.9" width="0.4" layer="1"/>
<wire x1="45.05" y1="87.8" x2="45.05" y2="85.9" width="0.4" layer="1"/>
<wire x1="44.66" y1="44" x2="48.9" y2="44" width="0.4" layer="1"/>
<wire x1="48.9" y1="44" x2="49.4" y2="44.5" width="0.4" layer="1"/>
<via x="49.4" y="44.5" extent="1-16" drill="0.6"/>
<wire x1="49.4" y1="44.5" x2="49.4" y2="79.9" width="0.4" layer="16"/>
<wire x1="49.4" y1="79.9" x2="45.1" y2="84.2" width="0.4" layer="16"/>
<via x="45.1" y="84.2" extent="1-16" drill="0.6"/>
<wire x1="45.1" y1="84.2" x2="45.1" y2="85.85" width="0.4" layer="1"/>
<wire x1="45.1" y1="85.85" x2="45.05" y2="85.9" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_AMIN">
<contactref element="IC4" pad="54"/>
<contactref element="C20" pad="2"/>
<contactref element="R9" pad="1"/>
<wire x1="34.79" y1="88.04" x2="34.75" y2="88" width="0.6" layer="1"/>
<wire x1="34.65" y1="87.9" x2="34.75" y2="88" width="0.6" layer="1"/>
<contactref element="X2" pad="6"/>
<wire x1="34.7" y1="93.365" x2="34.7" y2="88.05" width="0.4" layer="1"/>
<wire x1="34.7" y1="88.05" x2="34.75" y2="88" width="0.4" layer="1"/>
<wire x1="34.65" y1="87.9" x2="34.65" y2="86" width="0.4" layer="1"/>
<via x="40.7" y="47.2" extent="1-16" drill="0.6"/>
<wire x1="48.4" y1="48.8" x2="48.4" y2="76" width="0.4" layer="16"/>
<wire x1="48.4" y1="76" x2="38.2" y2="86.2" width="0.4" layer="16"/>
<via x="38.2" y="86.2" extent="1-16" drill="0.6"/>
<wire x1="38.2" y1="86.2" x2="34.85" y2="86.2" width="0.4" layer="1"/>
<wire x1="34.85" y1="86.2" x2="34.65" y2="86" width="0.4" layer="1"/>
<wire x1="40.5" y1="47.4" x2="40.7" y2="47.2" width="0.4" layer="1"/>
<wire x1="40.7" y1="47.2" x2="46.8" y2="47.2" width="0.4" layer="16"/>
<wire x1="46.8" y1="47.2" x2="48.4" y2="48.8" width="0.4" layer="16"/>
<wire x1="38.86" y1="49.8" x2="38.86" y2="49.04" width="0.4" layer="1"/>
<wire x1="38.86" y1="49.04" x2="40.7" y2="47.2" width="0.4" layer="1"/>
</signal>
<signal name="C_DI_AMAX">
<contactref element="IC4" pad="55"/>
<contactref element="C19" pad="2"/>
<contactref element="R8" pad="1"/>
<wire x1="29.27" y1="88.12" x2="29.15" y2="88" width="0.6" layer="1"/>
<wire x1="29.05" y1="87.9" x2="29.15" y2="88" width="0.6" layer="1"/>
<contactref element="X2" pad="5"/>
<wire x1="29.62" y1="93.365" x2="29.62" y2="88.47" width="0.4" layer="1"/>
<wire x1="29.62" y1="88.47" x2="29.15" y2="88" width="0.4" layer="1"/>
<wire x1="29.05" y1="87.9" x2="29.05" y2="86" width="0.4" layer="1"/>
<wire x1="40.4" y1="49.3" x2="46.9" y2="49.3" width="0.4" layer="16"/>
<wire x1="46.9" y1="49.3" x2="47.4" y2="49.8" width="0.4" layer="16"/>
<wire x1="47.4" y1="49.8" x2="47.4" y2="73.5" width="0.4" layer="16"/>
<wire x1="47.4" y1="73.5" x2="37.1" y2="83.8" width="0.4" layer="16"/>
<wire x1="37.1" y1="83.8" x2="29.7" y2="83.8" width="0.4" layer="16"/>
<via x="29.1" y="84.4" extent="1-16" drill="0.6"/>
<wire x1="29.1" y1="84.4" x2="29.1" y2="85.95" width="0.4" layer="1"/>
<wire x1="29.1" y1="85.95" x2="29.05" y2="86" width="0.4" layer="1"/>
<wire x1="40.4" y1="49.3" x2="39" y2="47.9" width="0.4" layer="16"/>
<wire x1="38.06" y1="49.8" x2="38.06" y2="48.14" width="0.4" layer="1"/>
<wire x1="38.06" y1="48.14" x2="38.3" y2="47.9" width="0.4" layer="1"/>
<via x="38.3" y="47.9" extent="1-16" drill="0.6"/>
<wire x1="38.3" y1="47.9" x2="39" y2="47.9" width="0.4" layer="16"/>
<wire x1="29.7" y1="83.8" x2="29.1" y2="84.4" width="0.4" layer="16"/>
</signal>
<signal name="C_DO_XDIR">
<contactref element="IC4" pad="63"/>
<contactref element="X4" pad="3"/>
<wire x1="31.66" y1="49.8" x2="31.66" y2="50.64" width="0.4" layer="1"/>
<wire x1="31.66" y1="50.64" x2="30.9" y2="51.4" width="0.4" layer="1"/>
<wire x1="30.9" y1="51.4" x2="26.1" y2="51.4" width="0.4" layer="1"/>
<wire x1="26.1" y1="51.4" x2="25.2" y2="52.3" width="0.4" layer="1"/>
<wire x1="25.2" y1="52.3" x2="25.2" y2="73" width="0.4" layer="1"/>
<wire x1="25.2" y1="73" x2="27.3" y2="75.1" width="0.4" layer="1"/>
<wire x1="27.3" y1="75.1" x2="27.82" y2="75.62" width="0.4" layer="1"/>
<wire x1="40.2" y1="75.7" x2="69.285" y2="75.7" width="0.4064" layer="1"/>
<wire x1="69.285" y1="75.7" x2="69.365" y2="75.62" width="0.4064" layer="1"/>
<wire x1="40.2" y1="75.7" x2="27.9" y2="75.7" width="0.4" layer="1"/>
<wire x1="27.9" y1="75.7" x2="27.82" y2="75.62" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_XSTEP">
<contactref element="IC4" pad="62"/>
<contactref element="X4" pad="4"/>
<wire x1="32.46" y1="49.8" x2="32.46" y2="51.24" width="0.4" layer="1"/>
<wire x1="32.46" y1="51.24" x2="31.2" y2="52.5" width="0.4" layer="1"/>
<wire x1="31.2" y1="52.5" x2="27" y2="52.5" width="0.4" layer="1"/>
<wire x1="27" y1="52.5" x2="26.3" y2="53.2" width="0.4" layer="1"/>
<wire x1="26.3" y1="53.2" x2="26.3" y2="68.9" width="0.4" layer="1"/>
<wire x1="26.3" y1="68.9" x2="27.8" y2="70.4" width="0.4" layer="1"/>
<wire x1="39.9" y1="70.4" x2="69.225" y2="70.4" width="0.4064" layer="1"/>
<wire x1="69.225" y1="70.4" x2="69.365" y2="70.54" width="0.4064" layer="1"/>
<wire x1="39.9" y1="70.4" x2="27.8" y2="70.4" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_ZDIR">
<contactref element="IC4" pad="37"/>
<contactref element="X5" pad="3"/>
<wire x1="44.66" y1="39.2" x2="53.6" y2="39.2" width="0.4" layer="1"/>
<wire x1="53.6" y1="39.2" x2="60.2" y2="32.6" width="0.4" layer="1"/>
<wire x1="69.365" y1="32.62" x2="60.22" y2="32.62" width="0.4" layer="1"/>
<wire x1="60.22" y1="32.62" x2="60.2" y2="32.6" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_ZSTEP">
<contactref element="IC4" pad="36"/>
<contactref element="X5" pad="4"/>
<wire x1="44.66" y1="38.4" x2="53.1" y2="38.4" width="0.4" layer="1"/>
<wire x1="53.1" y1="38.4" x2="63.96" y2="27.54" width="0.4" layer="1"/>
<wire x1="69.365" y1="27.54" x2="63.96" y2="27.54" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_ASTEP">
<contactref element="IC4" pad="26"/>
<contactref element="X5" pad="8"/>
<wire x1="38.06" y1="34.2" x2="38.06" y2="12.94" width="0.4" layer="1"/>
<wire x1="38.06" y1="12.94" x2="43.78" y2="7.22" width="0.4" layer="1"/>
<wire x1="69.365" y1="7.22" x2="43.78" y2="7.22" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_ADIR">
<contactref element="IC4" pad="27"/>
<contactref element="X5" pad="7"/>
<wire x1="38.86" y1="34.2" x2="38.86" y2="15.94" width="0.4" layer="1"/>
<wire x1="38.86" y1="15.94" x2="42.5" y2="12.3" width="0.4" layer="1"/>
<wire x1="69.365" y1="12.3" x2="42.5" y2="12.3" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_YDIR">
<contactref element="IC4" pad="47"/>
<contactref element="X4" pad="7"/>
<wire x1="44.66" y1="47.2" x2="58.9" y2="47.2" width="0.4" layer="1"/>
<wire x1="58.9" y1="47.2" x2="67" y2="55.3" width="0.4" layer="1"/>
<wire x1="67" y1="55.3" x2="69.365" y2="55.3" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_YSTEP">
<contactref element="IC4" pad="46"/>
<contactref element="X4" pad="8"/>
<wire x1="44.66" y1="46.4" x2="61.8" y2="46.4" width="0.4" layer="1"/>
<wire x1="61.8" y1="46.4" x2="65.6" y2="50.2" width="0.4" layer="1"/>
<wire x1="65.6" y1="50.2" x2="69.345" y2="50.2" width="0.4" layer="1"/>
<wire x1="69.345" y1="50.2" x2="69.365" y2="50.22" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_!XEN">
<contactref element="IC4" pad="64"/>
<contactref element="X4" pad="2"/>
<wire x1="30.86" y1="49.8" x2="25.7" y2="49.8" width="0.4" layer="1"/>
<wire x1="25.7" y1="49.8" x2="24.3" y2="51.2" width="0.4" layer="1"/>
<wire x1="24.3" y1="51.2" x2="24.3" y2="77.6" width="0.4" layer="1"/>
<wire x1="24.3" y1="77.6" x2="27.25" y2="80.55" width="0.4" layer="1"/>
<wire x1="27.25" y1="80.55" x2="27.4" y2="80.7" width="0.4" layer="1"/>
<wire x1="35.6" y1="80.9" x2="69.165" y2="80.9" width="0.4064" layer="1"/>
<wire x1="69.165" y1="80.9" x2="69.365" y2="80.7" width="0.4064" layer="1"/>
<wire x1="35.6" y1="80.9" x2="27.6" y2="80.9" width="0.4" layer="1"/>
<wire x1="27.6" y1="80.9" x2="27.4" y2="80.7" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_!YEN">
<contactref element="IC4" pad="48"/>
<contactref element="X4" pad="6"/>
<wire x1="44.66" y1="48" x2="56.985" y2="48" width="0.4" layer="1"/>
<wire x1="56.985" y1="48" x2="69.365" y2="60.38" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_!AEN">
<contactref element="IC4" pad="28"/>
<contactref element="X5" pad="6"/>
<wire x1="39.66" y1="34.2" x2="39.66" y2="18.94" width="0.4" layer="1"/>
<wire x1="39.66" y1="18.94" x2="41.22" y2="17.38" width="0.4" layer="1"/>
<wire x1="69.365" y1="17.38" x2="41.22" y2="17.38" width="0.4" layer="1"/>
</signal>
<signal name="C_DO_!ZEN">
<contactref element="IC4" pad="38"/>
<contactref element="X5" pad="2"/>
<wire x1="44.66" y1="40" x2="54.2" y2="40" width="0.4" layer="1"/>
<wire x1="54.2" y1="40" x2="56.5" y2="37.7" width="0.4" layer="1"/>
<wire x1="56.5" y1="37.7" x2="69.365" y2="37.7" width="0.4" layer="1"/>
</signal>
<signal name="N$3">
<contactref element="T1" pad="1"/>
<contactref element="R10" pad="2"/>
<wire x1="12.1" y1="34.05" x2="12.1" y2="32.25" width="0.8" layer="1"/>
<wire x1="12.1" y1="32.25" x2="11.85" y2="32" width="0.8" layer="1"/>
</signal>
<signal name="N$4">
<contactref element="X6" pad="2"/>
<contactref element="T1" pad="3"/>
<wire x1="9.9" y1="35" x2="6.095" y2="35" width="0.8" layer="1"/>
<wire x1="6.095" y1="35" x2="4.635" y2="33.54" width="0.8" layer="1"/>
</signal>
<signal name="+24V">
<contactref element="T1" pad="2"/>
<contactref element="C22" pad="2"/>
<contactref element="IC1" pad="3"/>
<contactref element="IC3" pad="IN"/>
<contactref element="JP5" pad="1"/>
<wire x1="12.1" y1="35.95" x2="14.4" y2="35.95" width="0.8" layer="1"/>
<wire x1="13.95" y1="23.2" x2="16.4" y2="23.2" width="0.8" layer="1"/>
<wire x1="16.4" y1="23.2" x2="17.2" y2="24" width="0.8" layer="1"/>
<wire x1="17.2" y1="24" x2="17.2" y2="29.1" width="0.8" layer="1"/>
<wire x1="17.2" y1="29.1" x2="16.4" y2="29.9" width="0.8" layer="1"/>
<wire x1="16.4" y1="29.9" x2="14.4" y2="29.9" width="0.8" layer="1"/>
<wire x1="14.4" y1="29.9" x2="13.6" y2="30.7" width="0.8" layer="1"/>
<wire x1="13.6" y1="30.7" x2="13.6" y2="35.15" width="0.8" layer="1"/>
<wire x1="13.6" y1="35.15" x2="14.4" y2="35.95" width="0.8" layer="1"/>
<wire x1="14.4" y1="35.95" x2="16.32" y2="35.95" width="0.8" layer="1"/>
<wire x1="16.32" y1="35.95" x2="17" y2="35.27" width="0.8" layer="1"/>
<wire x1="17" y1="35.27" x2="17" y2="35.4" width="0.8" layer="1"/>
<wire x1="17" y1="35.4" x2="20.14" y2="38.54" width="0.8" layer="1"/>
<wire x1="20.14" y1="38.54" x2="21.56" y2="38.54" width="0.8" layer="1"/>
<wire x1="13.95" y1="23.2" x2="11.65" y2="23.2" width="0.8" layer="1"/>
<wire x1="11.65" y1="23.2" x2="11.2" y2="23.65" width="0.8" layer="1"/>
</signal>
<signal name="C_DO_SPINDLE">
<contactref element="IC4" pad="3"/>
<contactref element="X7" pad="4"/>
<via x="27.2" y="48" extent="1-16" drill="0.6"/>
<wire x1="5.715" y1="72" x2="5.635" y2="72.08" width="0.4" layer="16"/>
<wire x1="29.06" y1="46.4" x2="27.9" y2="46.4" width="0.4" layer="1"/>
<wire x1="27.9" y1="46.4" x2="27.3" y2="47" width="0.4" layer="1"/>
<wire x1="27.3" y1="47" x2="27.3" y2="47.9" width="0.4" layer="1"/>
<wire x1="27.3" y1="47.9" x2="27.2" y2="48" width="0.4" layer="1"/>
<wire x1="27.2" y1="48" x2="26" y2="48" width="0.4" layer="16"/>
<wire x1="26" y1="48" x2="9.5" y2="64.5" width="0.4" layer="16"/>
<wire x1="9.5" y1="64.5" x2="9.5" y2="70.4" width="0.4" layer="16"/>
<wire x1="9.5" y1="70.4" x2="7.82" y2="72.08" width="0.4" layer="16"/>
<wire x1="7.82" y1="72.08" x2="5.635" y2="72.08" width="0.4" layer="16"/>
</signal>
<signal name="C_DO_SPINDLEDIR">
<contactref element="IC4" pad="51"/>
<contactref element="X7" pad="5"/>
<wire x1="41.26" y1="49.8" x2="41.26" y2="51.06" width="0.4" layer="1"/>
<wire x1="41.26" y1="51.06" x2="41.5" y2="51.3" width="0.4" layer="1"/>
<wire x1="41.5" y1="51.3" x2="43.8" y2="51.3" width="0.4" layer="1"/>
<via x="43.8" y="51.3" extent="1-16" drill="0.6"/>
<wire x1="43.8" y1="51.3" x2="46.2" y2="51.3" width="0.4" layer="16"/>
<wire x1="46.2" y1="51.3" x2="46.4" y2="51.5" width="0.4" layer="16"/>
<wire x1="46.4" y1="51.5" x2="46.4" y2="71.8" width="0.4" layer="16"/>
<wire x1="46.4" y1="71.8" x2="41" y2="77.2" width="0.4" layer="16"/>
<via x="41" y="77.2" extent="1-16" drill="0.6"/>
<wire x1="41" y1="77.2" x2="40.4" y2="77.8" width="0.4" layer="1"/>
<wire x1="40.4" y1="77.8" x2="27" y2="77.8" width="0.4" layer="1"/>
<via x="27" y="77.8" extent="1-16" drill="0.6"/>
<wire x1="27" y1="77.8" x2="26.36" y2="77.16" width="0.4" layer="16"/>
<wire x1="26.36" y1="77.16" x2="5.635" y2="77.16" width="0.4" layer="16"/>
</signal>
<signal name="C_DO_SPINDLEPWM">
<contactref element="IC4" pad="31"/>
<contactref element="X7" pad="2"/>
<via x="39.5" y="38.7" extent="1-16" drill="0.6"/>
<wire x1="42.06" y1="34.2" x2="42.06" y2="36.24" width="0.4" layer="1"/>
<wire x1="23.9" y1="46.1" x2="25.2" y2="44.8" width="0.35" layer="16"/>
<wire x1="5.635" y1="61.92" x2="8" y2="61.92" width="0.4" layer="16"/>
<wire x1="23.9" y1="46.1" x2="23.82" y2="46.1" width="0.4" layer="16"/>
<wire x1="23.82" y1="46.1" x2="8" y2="61.92" width="0.4" layer="16"/>
<wire x1="25.2" y1="44.8" x2="30" y2="40" width="0.4" layer="16"/>
<wire x1="30" y1="40" x2="38.2" y2="40" width="0.4" layer="16"/>
<wire x1="39.5" y1="38.7" x2="39.6" y2="38.7" width="0.4" layer="1"/>
<wire x1="39.6" y1="38.7" x2="42.06" y2="36.24" width="0.4" layer="1"/>
<wire x1="38.2" y1="40" x2="39.5" y2="38.7" width="0.4" layer="16"/>
</signal>
<signal name="C_DO_COOLAND">
<contactref element="IC4" pad="41"/>
<contactref element="X7" pad="3"/>
<via x="40.9" y="41" extent="1-16" drill="0.6"/>
<wire x1="40.9" y1="41" x2="42.3" y2="42.4" width="0.4" layer="1"/>
<wire x1="42.3" y1="42.4" x2="44.66" y2="42.4" width="0.4" layer="1"/>
<wire x1="25.1" y1="46.9" x2="26" y2="46" width="0.35" layer="16"/>
<wire x1="40" y1="40.9" x2="40.8" y2="40.9" width="0.35" layer="16"/>
<wire x1="40.8" y1="40.9" x2="40.9" y2="41" width="0.35" layer="16"/>
<wire x1="25.1" y1="46.9" x2="5.635" y2="66.365" width="0.4" layer="16"/>
<wire x1="5.635" y1="67" x2="5.635" y2="66.365" width="0.4" layer="16"/>
<wire x1="26" y1="46" x2="31.1" y2="40.9" width="0.4" layer="16"/>
<wire x1="31.1" y1="40.9" x2="40" y2="40.9" width="0.4" layer="16"/>
</signal>
<signal name="+12V">
<contactref element="IC3" pad="OUT"/>
<contactref element="C10" pad="2"/>
<contactref element="JP5" pad="2"/>
<contactref element="X8" pad="2"/>
<wire x1="5.675" y1="49.5" x2="5.635" y2="49.54" width="0.8" layer="16"/>
<wire x1="21.56" y1="33.46" x2="20.83" y2="32.73" width="0.8" layer="1"/>
<wire x1="20.83" y1="32.73" x2="17" y2="32.73" width="0.8" layer="1"/>
<wire x1="20.05" y1="31" x2="20.05" y2="31.95" width="0.8" layer="16"/>
<wire x1="20.05" y1="31.95" x2="21.56" y2="33.46" width="0.8" layer="16"/>
<wire x1="17" y1="32.73" x2="14.17" y2="32.73" width="0.8" layer="16"/>
<wire x1="14.17" y1="32.73" x2="13.5" y2="33.4" width="0.8" layer="16"/>
<wire x1="13.5" y1="33.4" x2="13.5" y2="43.5" width="0.8" layer="16"/>
<wire x1="13.5" y1="43.5" x2="7.46" y2="49.54" width="0.8" layer="16"/>
<wire x1="5.635" y1="49.54" x2="7.46" y2="49.54" width="0.8" layer="16"/>
</signal>
<signal name="FTDI_RXD">
<contactref element="IC2" pad="5"/>
<contactref element="JP6" pad="8"/>
<wire x1="20.625" y1="14.375" x2="24.165" y2="14.375" width="0.4" layer="1"/>
<wire x1="24.165" y1="14.375" x2="24.73" y2="13.81" width="0.4" layer="1"/>
</signal>
<signal name="FTDI_TXD">
<contactref element="IC2" pad="1"/>
<contactref element="JP6" pad="6"/>
<wire x1="20.625" y1="11.775" x2="24.225" y2="11.775" width="0.4" layer="1"/>
<wire x1="24.225" y1="11.775" x2="24.73" y2="11.27" width="0.4" layer="1"/>
</signal>
<signal name="C_SPI_SCK">
<contactref element="IC4" pad="23"/>
<contactref element="JP3" pad="3"/>
<wire x1="35.66" y1="34.2" x2="35.66" y2="10.94" width="0.35" layer="1"/>
<wire x1="35.66" y1="10.94" x2="41.2" y2="5.4" width="0.35" layer="1"/>
<wire x1="41.2" y1="5.4" x2="41.2" y2="3.26" width="0.35" layer="1"/>
<wire x1="41.2" y1="3.26" x2="41.19" y2="3.25" width="0.35" layer="1"/>
</signal>
<signal name="C_SPI_MISO">
<contactref element="IC4" pad="22"/>
<contactref element="JP3" pad="4"/>
<wire x1="34.86" y1="34.2" x2="34.86" y2="9.09" width="0.35" layer="1"/>
<wire x1="34.86" y1="9.09" x2="38.65" y2="5.3" width="0.35" layer="1"/>
<wire x1="38.65" y1="5.3" x2="38.65" y2="3.25" width="0.35" layer="1"/>
</signal>
<signal name="C_SPI_MOSI">
<contactref element="IC4" pad="21"/>
<contactref element="JP3" pad="5"/>
<wire x1="34.06" y1="34.2" x2="34.06" y2="7.39" width="0.35" layer="1"/>
<wire x1="34.06" y1="7.39" x2="36.15" y2="5.3" width="0.35" layer="1"/>
<wire x1="36.15" y1="5.3" x2="36.15" y2="3.29" width="0.35" layer="1"/>
<wire x1="36.15" y1="3.29" x2="36.11" y2="3.25" width="0.35" layer="1"/>
</signal>
<signal name="C_SPI_!SS1">
<contactref element="IC4" pad="20"/>
<contactref element="JP3" pad="6"/>
<wire x1="33.26" y1="34.2" x2="33.26" y2="5.79" width="0.35" layer="1"/>
<wire x1="33.26" y1="5.79" x2="33.6" y2="5.45" width="0.35" layer="1"/>
<wire x1="33.6" y1="5.45" x2="33.6" y2="3.28" width="0.35" layer="1"/>
<wire x1="33.6" y1="3.28" x2="33.57" y2="3.25" width="0.35" layer="1"/>
</signal>
<signal name="C_SPI_!SS2">
<contactref element="IC4" pad="9"/>
<contactref element="JP3" pad="7"/>
<wire x1="29.06" y1="41.6" x2="30.35" y2="41.6" width="0.35" layer="1"/>
<wire x1="30.35" y1="41.6" x2="32.6" y2="39.35" width="0.35" layer="1"/>
<wire x1="32.6" y1="39.35" x2="32.6" y2="36.95" width="0.35" layer="1"/>
<wire x1="32.6" y1="36.95" x2="31.55" y2="35.9" width="0.35" layer="1"/>
<via x="31.55" y="35.9" extent="1-16" drill="0.6"/>
<wire x1="31.55" y1="35.9" x2="31.55" y2="3.77" width="0.35" layer="16"/>
<wire x1="31.55" y1="3.77" x2="31.03" y2="3.25" width="0.35" layer="16"/>
</signal>
</signals>
</board>
</drawing>
<compatibility>
<note version="6.3" minversion="6.2.2" severity="warning">
Since Version 6.2.2 text objects can contain more than one line,
which will not be processed correctly with this version.
</note>
</compatibility>
</eagle>


text:
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package endpoints

import (
	"bytes"
	"context"
	"encoding/json"
	"net/http"
	"reflect"
	"testing"

	"bou.ke/monkey"

	"github.com/erda-project/erda/apistructs"
	"github.com/erda-project/erda/internal/core/legacy/dao"
	"github.com/erda-project/erda/internal/core/legacy/services/permission"
	"github.com/erda-project/erda/internal/pkg/user"
	"github.com/erda-project/erda/pkg/http/httpserver"
)

func generateProjectWorkspaceCreateRequest() apistructs.ProjectWorkSpaceAbility {

	return apistructs.ProjectWorkSpaceAbility{
		ProjectID: 1,
		Workspace: "DEV",
		Abilities: "{\"ECI\":\"enable\"}",
	}
}

func TestEndpoints_CreateProjectWorkSpace(t *testing.T) {
	type fields struct {
		db         *dao.DBClient
		permission *permission.Permission
	}
	type args struct {
		ctx  context.Context
		r    *http.Request
		vars map[string]string
	}

	req := generateProjectWorkspaceCreateRequest()

	reqStr, _ := json.Marshal(req)
	httpReq, _ := http.NewRequest(http.MethodPost, "/api/project-workspace-abilitie", bytes.NewBuffer(reqStr))

	tests := []struct {
		name    string
		fields  fields
		args    args
		want    httpserver.Responser
		wantErr bool
	}{
		{
			name: "Test_01",
			fields: fields{
				db:         &dao.DBClient{},
				permission: &permission.Permission{},
			},
			args: args{
				r: httpReq,
			},
			want: httpserver.HTTPResponse{
				Status: http.StatusOK,
				Content: httpserver.Resp{
					Success: true,
					Data:    nil,
				},
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			e := &Endpoints{
				db:         tt.fields.db,
				permission: tt.fields.permission,
			}

			patch1 := monkey.PatchInstanceMethod(reflect.TypeOf(e.permission), "CheckPermission", func(_ *permission.Permission, req *apistructs.PermissionCheckRequest) (bool, error) {
				return true, nil
			})

			patch2 := monkey.PatchInstanceMethod(reflect.TypeOf(e.db), "CreateProjectWorkspaceAbilities", func(_ *dao.DBClient, ability apistructs.ProjectWorkSpaceAbility) error {
				return nil
			})

			patch3 := monkey.Patch(user.GetUserID, func(r *http.Request) (user.ID, error) {
				return "2", nil
			})

			patch4 := monkey.Patch(user.GetOrgID, func(r *http.Request) (uint64, error) {

				return 1, nil
			})

			defer patch4.Unpatch()
			defer patch3.Unpatch()
			defer patch2.Unpatch()
			defer patch1.Unpatch()

			got, err := e.CreateProjectWorkSpace(tt.args.ctx, tt.args.r, tt.args.vars)
			if (err != nil) != tt.wantErr {
				t.Errorf("CreateProjectWorkSpace() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("CreateProjectWorkSpace() got = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestEndpoints_GetProjectWorkSpace(t *testing.T) {
	type fields struct {
		db         *dao.DBClient
		permission *permission.Permission
	}
	type args struct {
		ctx  context.Context
		r    *http.Request
		vars map[string]string
	}

	httpReq, _ := http.NewRequest(http.MethodGet, "/api/project-workspace-abilities/{projectID}/{workspace}", nil)

	tests := []struct {
		name    string
		fields  fields
		args    args
		want    httpserver.Responser
		wantErr bool
	}{
		// TODO: Add test cases.
		{
			name: "Test_01",
			fields: fields{
				db:         &dao.DBClient{},
				permission: &permission.Permission{},
			},
			args: args{
				r: httpReq,
				vars: map[string]string{
					"projectID": "1",
					"workspace": "DEV",
				},
			},
			want: httpserver.HTTPResponse{
				Status: http.StatusOK,
				Content: httpserver.Resp{
					Success: true,
					Data:    generateProjectWorkspaceCreateRequest(),
				},
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			e := &Endpoints{
				db:         tt.fields.db,
				permission: tt.fields.permission,
			}

			patch1 := monkey.PatchInstanceMethod(reflect.TypeOf(e.permission), "CheckPermission", func(_ *permission.Permission, req *apistructs.PermissionCheckRequest) (bool, error) {
				return true, nil
			})

			patch2 := monkey.PatchInstanceMethod(reflect.TypeOf(e.db), "GetProjectWorkspaceAbilities", func(_ *dao.DBClient, projectID uint64, workspace string) (apistructs.ProjectWorkSpaceAbility, error) {
				return generateProjectWorkspaceCreateRequest(), nil
			})

			patch3 := monkey.Patch(user.GetUserID, func(r *http.Request) (user.ID, error) {
				return "2", nil
			})

			patch4 := monkey.Patch(user.GetOrgID, func(r *http.Request) (uint64, error) {

				return 1, nil
			})

			defer patch4.Unpatch()
			defer patch3.Unpatch()
			defer patch2.Unpatch()
			defer patch1.Unpatch()

			got, err := e.GetProjectWorkSpace(tt.args.ctx, tt.args.r, tt.args.vars)
			if (err != nil) != tt.wantErr {
				t.Errorf("GetProjectWorkSpace() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("GetProjectWorkSpace() got = %v, want %v", got, tt.want)
			}
		})
	}
}

repository: erda-project/erda

repo_name: erda-project/erda

gha_language: Go

extension: go


text:
# This file is part of the pCloud Console Client.
#
# (c) 2021 Serghei Iakovlev <egrep@protonmail.ch>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.

# Require C99. Some parts of the client use GNU extensions to ISO C99 standard,
# thus the compiler should support `-std=gnu99`
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

# Require C++11. We don't use GNU extensions to ISO C++11 standard, thus make
# sure we're able build project using ISO C++.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

repository: pclausen/pcloud-console-client

repo_name: pclausen/pcloud-console-client

extension: cmake


text:
package calculator

import (
	"math"
	"strconv"

	"github.com/netlify/gocommerce/claims"
)

type Price struct {
	Items []ItemPrice

	Subtotal uint64
	Discount uint64
	Taxes    uint64
	Total    uint64
}

type ItemPrice struct {
	Quantity uint64

	Subtotal uint64
	Discount uint64
	Taxes    uint64
	Total    uint64
}

type Settings struct {
	PricesIncludeTaxes bool              `json:"prices_include_taxes"`
	Taxes              []*Tax            `json:"taxes"`
	MemberDiscounts    []*MemberDiscount `json:"member_discounts"`
}

type Tax struct {
	Percentage   uint64   `json:"percentage"`
	ProductTypes []string `json:"product_types"`
	Countries    []string `json:"countries"`
}

type taxAmount struct {
	price      uint64
	percentage uint64
}

type FixedMemberDiscount struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
}

type MemberDiscount struct {
	Claims       map[string]string      `json:"claims"`
	Percentage   uint64                 `json:"percentage"`
	FixedAmount  []*FixedMemberDiscount `json:"fixed"`
	ProductTypes []string               `json:"product_types"`
}

func (d *MemberDiscount) ValidForType(productType string) bool {
	if d.ProductTypes == nil || len(d.ProductTypes) == 0 {
		return true
	}
	for _, validType := range d.ProductTypes {
		if validType == productType {
			return true
		}
	}
	return false
}

type Item interface {
	PriceInLowestUnit() uint64
	ProductType() string
	FixedVAT() uint64
	TaxableItems() []Item
	GetQuantity() uint64
}

type Coupon interface {
	ValidForType(string) bool
	ValidForPrice(string, uint64) bool
	PercentageDiscount() uint64
	FixedDiscount(string) uint64
}

func (c *MemberDiscount) FixedDiscount(currency string) uint64 {
	if c.FixedAmount != nil {
		for _, discount := range c.FixedAmount {
			if discount.Currency == currency {
				amount, _ := strconv.ParseFloat(discount.Amount, 64)
				return rint(amount * 100)
			}
		}
	}

	return 0
}

func (t *Tax) AppliesTo(country, productType string) bool {
	applies := true
	if t.ProductTypes != nil && len(t.ProductTypes) > 0 {
		applies = false
		for _, t := range t.ProductTypes {
			if t == productType {
				applies = true
				break
			}
		}
	}
	if !applies {
		return false
	}
	if t.Countries != nil && len(t.Countries) > 0 {
		applies = false
		for _, c := range t.Countries {
			if c == country {
				applies = true
				break
			}
		}
	}
	return applies
}

func CalculatePrice(settings *Settings, jwtClaims map[string]interface{}, country, currency string, coupon Coupon, items []Item) Price {
	price := Price{}
	includeTaxes := settings != nil && settings.PricesIncludeTaxes
	for _, item := range items {
		itemPrice := ItemPrice{Quantity: item.GetQuantity()}
		itemPrice.Subtotal = item.PriceInLowestUnit()

		taxAmounts := []taxAmount{}
		if item.FixedVAT() != 0 {
			taxAmounts = append(taxAmounts, taxAmount{price: itemPrice.Subtotal, percentage: item.FixedVAT()})
		} else if settings != nil && item.TaxableItems() != nil && len(item.TaxableItems()) > 0 {
			for _, item := range item.TaxableItems() {
				amount := taxAmount{price: item.PriceInLowestUnit()}
				for _, t := range settings.Taxes {
					if t.AppliesTo(country, item.ProductType()) {
						amount.percentage = t.Percentage
						break
					}
				}
				taxAmounts = append(taxAmounts, amount)
			}
		} else if settings != nil {
			for _, t := range settings.Taxes {
				if t.AppliesTo(country, item.ProductType()) {
					taxAmounts = append(taxAmounts, taxAmount{price: itemPrice.Subtotal, percentage: t.Percentage})
					break
				}
			}
		}

		if len(taxAmounts) != 0 {
			if includeTaxes {
				itemPrice.Subtotal = 0
			}
			for _, tax := range taxAmounts {
				if includeTaxes {
					tax.price = rint(float64(tax.price) / (100 + float64(tax.percentage)) * 100)
					itemPrice.Subtotal += tax.price
				}
				itemPrice.Taxes += rint(float64(tax.price) * float64(tax.percentage) / 100)
			}
		}
		if coupon != nil && coupon.ValidForType(item.ProductType()) {
			itemPrice.Discount = calculateDiscount(itemPrice.Subtotal, itemPrice.Taxes, coupon.PercentageDiscount(), coupon.FixedDiscount(currency), includeTaxes)
		}
		if settings != nil && settings.MemberDiscounts != nil {
			for _, discount := range settings.MemberDiscounts {
				if jwtClaims != nil && claims.HasClaims(jwtClaims, discount.Claims) && discount.ValidForType(item.ProductType()) {
					itemPrice.Discount += calculateDiscount(itemPrice.Subtotal, itemPrice.Taxes, discount.Percentage, discount.FixedDiscount(currency), includeTaxes)
				}
			}
		}

		itemPrice.Total = itemPrice.Subtotal - itemPrice.Discount + itemPrice.Taxes

		price.Items = append(price.Items, itemPrice)

		price.Subtotal += (itemPrice.Subtotal * itemPrice.Quantity)
		price.Discount += (itemPrice.Discount * itemPrice.Quantity)
		price.Taxes += (itemPrice.Taxes * itemPrice.Quantity)
		price.Total += (itemPrice.Total * itemPrice.Quantity)
	}

	price.Total = price.Subtotal - price.Discount + price.Taxes

	return price
}

func calculateDiscount(amountToDiscount, taxes, percentage, fixed uint64, includeTaxes bool) uint64 {
	if includeTaxes {
		amountToDiscount += taxes
	}
	var discount uint64
	if percentage > 0 {
		discount = rint(float64(amountToDiscount) * float64(percentage) / 100)
	}
	discount += fixed

	if discount > amountToDiscount {
		return amountToDiscount
	}
	return discount
}

// Nopes - no `round` method in go
// See https://gist.github.com/siddontang/1806573b9a8574989ccb
func rint(x float64) uint64 {
	v, frac := math.Modf(x)
	if x > 0.0 {
		if frac > 0.5 || (frac == 0.5 && uint64(v)%2 != 0) {
			v += 1.0
		}
	} else {
		if frac < -0.5 || (frac == -0.5 && uint64(v)%2 != 0) {
			v -= 1.0
		}
	}

	return uint64(v)
}

repository: aryanugroho/gocommerce

repo_name: aryanugroho/gocommerce