text:
1.4335"/>
<vertex x="-2.9988" y="-2.567"/>
<vertex x="-1.6494" y="-2.567"/>
<vertex x="-1.6494" y="-1.4335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-2.9988" y="-2.767"/>
<vertex x="-2.9988" y="-3.9005"/>
<vertex x="-1.6494" y="-3.9005"/>
<vertex x="-1.6494" y="-2.767"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-2.9988" y="-4.1005"/>
<vertex x="-2.9988" y="-5.234"/>
<vertex x="-1.6494" y="-5.234"/>
<vertex x="-1.6494" y="-4.1005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-2.9988" y="-5.434"/>
<vertex x="-2.9988" y="-6.5675"/>
<vertex x="-1.6494" y="-6.5675"/>
<vertex x="-1.6494" y="-5.434"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-2.9988" y="-6.7675"/>
<vertex x="-2.9988" y="-7.901"/>
<vertex x="-1.6494" y="-7.901"/>
<vertex x="-1.6494" y="-6.7675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="7.901"/>
<vertex x="-1.4494" y="6.7675"/>
<vertex x="-0.1" y="6.7675"/>
<vertex x="-0.1" y="7.901"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="6.5675"/>
<vertex x="-1.4494" y="5.434"/>
<vertex x="-0.1" y="5.434"/>
<vertex x="-0.1" y="6.5675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="5.234"/>
<vertex x="-1.4494" y="4.1005"/>
<vertex x="-0.1" y="4.1005"/>
<vertex x="-0.1" y="5.234"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="3.9005"/>
<vertex x="-1.4494" y="2.767"/>
<vertex x="-0.1" y="2.767"/>
<vertex x="-0.1" y="3.9005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="2.567"/>
<vertex x="-1.4494" y="1.4335"/>
<vertex x="-0.1" y="1.4335"/>
<vertex x="-0.1" y="2.567"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="1.2335"/>
<vertex x="-1.4494" y="0.1"/>
<vertex x="-0.1" y="0.1"/>
<vertex x="-0.1" y="1.2335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-0.1"/>
<vertex x="-1.4494" y="-1.2335"/>
<vertex x="-0.1" y="-1.2335"/>
<vertex x="-0.1" y="-0.1"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-1.4335"/>
<vertex x="-1.4494" y="-2.567"/>
<vertex x="-0.1" y="-2.567"/>
<vertex x="-0.1" y="-1.4335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-2.767"/>
<vertex x="-1.4494" y="-3.9005"/>
<vertex x="-0.1" y="-3.9005"/>
<vertex x="-0.1" y="-2.767"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-4.1005"/>
<vertex x="-1.4494" y="-5.234"/>
<vertex x="-0.1" y="-5.234"/>
<vertex x="-0.1" y="-4.1005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-5.434"/>
<vertex x="-1.4494" y="-6.5675"/>
<vertex x="-0.1" y="-6.5675"/>
<vertex x="-0.1" y="-5.434"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="-1.4494" y="-6.7675"/>
<vertex x="-1.4494" y="-7.901"/>
<vertex x="-0.1" y="-7.901"/>
<vertex x="-0.1" y="-6.7675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="7.901"/>
<vertex x="0.1" y="6.7675"/>
<vertex x="1.4494" y="6.7675"/>
<vertex x="1.4494" y="7.901"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="6.5675"/>
<vertex x="0.1" y="5.434"/>
<vertex x="1.4494" y="5.434"/>
<vertex x="1.4494" y="6.5675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="5.234"/>
<vertex x="0.1" y="4.1005"/>
<vertex x="1.4494" y="4.1005"/>
<vertex x="1.4494" y="5.234"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="3.9005"/>
<vertex x="0.1" y="2.767"/>
<vertex x="1.4494" y="2.767"/>
<vertex x="1.4494" y="3.9005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="2.567"/>
<vertex x="0.1" y="1.4335"/>
<vertex x="1.4494" y="1.4335"/>
<vertex x="1.4494" y="2.567"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="1.2335"/>
<vertex x="0.1" y="0.1"/>
<vertex x="1.4494" y="0.1"/>
<vertex x="1.4494" y="1.2335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-0.1"/>
<vertex x="0.1" y="-1.2335"/>
<vertex x="1.4494" y="-1.2335"/>
<vertex x="1.4494" y="-0.1"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-1.4335"/>
<vertex x="0.1" y="-2.567"/>
<vertex x="1.4494" y="-2.567"/>
<vertex x="1.4494" y="-1.4335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-2.767"/>
<vertex x="0.1" y="-3.9005"/>
<vertex x="1.4494" y="-3.9005"/>
<vertex x="1.4494" y="-2.767"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-4.1005"/>
<vertex x="0.1" y="-5.234"/>
<vertex x="1.4494" y="-5.234"/>
<vertex x="1.4494" y="-4.1005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-5.434"/>
<vertex x="0.1" y="-6.5675"/>
<vertex x="1.4494" y="-6.5675"/>
<vertex x="1.4494" y="-5.434"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="0.1" y="-6.7675"/>
<vertex x="0.1" y="-7.901"/>
<vertex x="1.4494" y="-7.901"/>
<vertex x="1.4494" y="-6.7675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="7.901"/>
<vertex x="1.6494" y="6.7675"/>
<vertex x="2.9988" y="6.7675"/>
<vertex x="2.9988" y="7.901"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="6.5675"/>
<vertex x="1.6494" y="5.434"/>
<vertex x="2.9988" y="5.434"/>
<vertex x="2.9988" y="6.5675"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="5.234"/>
<vertex x="1.6494" y="4.1005"/>
<vertex x="2.9988" y="4.1005"/>
<vertex x="2.9988" y="5.234"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="3.9005"/>
<vertex x="1.6494" y="2.767"/>
<vertex x="2.9988" y="2.767"/>
<vertex x="2.9988" y="3.9005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="2.567"/>
<vertex x="1.6494" y="1.4335"/>
<vertex x="2.9988" y="1.4335"/>
<vertex x="2.9988" y="2.567"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="1.2335"/>
<vertex x="1.6494" y="0.1"/>
<vertex x="2.9988" y="0.1"/>
<vertex x="2.9988" y="1.2335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-0.1"/>
<vertex x="1.6494" y="-1.2335"/>
<vertex x="2.9988" y="-1.2335"/>
<vertex x="2.9988" y="-0.1"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-1.4335"/>
<vertex x="1.6494" y="-2.567"/>
<vertex x="2.9988" y="-2.567"/>
<vertex x="2.9988" y="-1.4335"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-2.767"/>
<vertex x="1.6494" y="-3.9005"/>
<vertex x="2.9988" y="-3.9005"/>
<vertex x="2.9988" y="-2.767"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-4.1005"/>
<vertex x="1.6494" y="-5.234"/>
<vertex x="2.9988" y="-5.234"/>
<vertex x="2.9988" y="-4.1005"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-5.434"/>
<vertex x="1.6494" y="-6.5675"/>
<vertex x="2.9988" y="-6.5675"/>
<vertex x="2.9988" y="-5.434"/>
</polygon>
<polygon width="0.0254" layer="31">
<vertex x="1.6494" y="-6.7675"/>
<vertex x="1.6494" y="-7.901"/>
<vertex x="2.9988" y="-7.901"/>
<vertex x="2.9988" y="-6.7675"/>
</polygon>
<text x="-3.2766" y="-0.635" size="1.27" layer="25" ratio="6" rot="SR0">>Name</text>
</package>
<package name="DIODE_400V_5A">
<smd name="1" x="-3.1272" y="0" dx="3.18" dy="2.1804" layer="1" rot="R90"/>
<smd name="2" x="3.1272" y="0" dx="3.18" dy="2.1804" layer="1" rot="R90"/>
<wire x1="-4.572" y1="0" x2="-5.588" y2="0" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-5.842" y2="0" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0.635" x2="-5.588" y2="0" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-5.588" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.508" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.381" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.254" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.127" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.508" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.381" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.254" width="0.1524" layer="21"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.127" width="0.1524" layer="21"/>
<wire x1="-4.826" y1="0.635" x2="-4.826" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-4.191" y1="-3.2258" x2="4.191" y2="-3.2258" width="0.1524" layer="21"/>
<wire x1="4.191" y1="-3.2258" x2="4.191" y2="-1.9304" width="0.1524" layer="21"/>
<wire x1="4.191" y1="3.2258" x2="-4.191" y2="3.2258" width="0.1524" layer="21"/>
<wire x1="-4.191" y1="3.2258" x2="-4.191" y2="1.9304" width="0.1524" layer="21"/>
<wire x1="-4.191" y1="-1.9304" x2="-4.191" y2="-3.2258" width="0.1524" layer="21"/>
<wire x1="4.191" y1="1.9304" x2="4.191" y2="3.2258" width="0.1524" layer="21"/>
<wire x1="-4.572" y1="0" x2="-5.588" y2="0" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-5.842" y2="0" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0.635" x2="-5.588" y2="0" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-5.588" y2="-0.635" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.635" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.381" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.254" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="0.127" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.635" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.381" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.254" width="0.1524" layer="51"/>
<wire x1="-5.588" y1="0" x2="-4.826" y2="-0.127" width="0.1524" layer="51"/>
<wire x1="-4.826" y1="0.635" x2="-4.826" y2="-0.635" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="-3.0988" x2="4.064" y2="-3.0988" width="0.1524" layer="51"/>
<wire x1="4.064" y1="-3.0988" x2="4.064" y2="3.0988" width="0.1524" layer="51"/>
<wire x1="4.064" y1="3.0988" x2="-4.064" y2="3.0988" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="3.0988" x2="-4.064" y2="-3.0988" width="0.1524" layer="51"/>
<text x="-3.2766" y="-0.635" size="1.27" layer="25" ratio="6" rot="SR0">>Name</text>
</package>
<package name="CAP_5750">
<smd name="1" x="-3.048" y="0" dx="0.4064" dy="5.4102" layer="1"/>
<smd name="2" x="3.048" y="0" dx="0.4064" dy="5.4102" layer="1"/>
<wire x1="-2.54" y1="-2.8448" x2="2.54" y2="-2.8448" width="0.1524" layer="21"/>
<wire x1="2.54" y1="2.8448" x2="-2.54" y2="2.8448" width="0.1524" layer="21"/>
<wire x1="-4.0132" y1="0" x2="-4.1656" y2="0" width="0.1524" layer="21" curve="-180"/>
<wire x1="-4.1656" y1="0" x2="-4.0132" y2="0" width="0.1524" layer="21" curve="-180"/>
<wire x1="-2.8448" y1="-2.6924" x2="-2.8448" y2="0" width="0.1524" layer="51"/>
<wire x1="-2.8448" y1="0" x2="-2.8448" y2="2.6924" width="0.1524" layer="51"/>
<wire x1="-2.8448" y1="2.6924" x2="-3.048" y2="2.6924" width="0.1524" layer="51"/>
<wire x1="-3.048" y1="-2.6924" x2="-2.8448" y2="-2.6924" width="0.1524" layer="51"/>
<wire x1="2.8448" y1="2.7178" x2="2.8448" y2="-2.6924" width="0.1524" layer="51"/>
<wire x1="2.8448" y1="-2.6924" x2="3.048" y2="-2.6924" width="0.1524" layer="51"/>
<wire x1="3.048" y1="2.6924" x2="3.048" y2="2.7178" width="0.1524" layer="51"/>
<wire x1="3.048" y1="2.7178" x2="2.8448" y2="2.7178" width="0.1524" layer="51"/>
<wire x1="-2.8448" y1="-2.6924" x2="2.8448" y2="-2.6924" width="0.1524" layer="51"/>
<wire x1="3.048" y1="-2.6924" x2="3.048" y2="2.6924" width="0.1524" layer="51"/>
<wire x1="3.048" y1="2.6924" x2="-2.8448" y2="2.6924" width="0.1524" layer="51"/>
<wire x1="-3.048" y1="2.6924" x2="-3.048" y2="-2.6924" width="0.1524" layer="51"/>
<wire x1="-2.8448" y1="0" x2="-2.9972" y2="0" width="0" layer="51" curve="-180"/>
<wire x1="-2.9972" y1="0" x2="-2.8448" y2="0" width="0" layer="51" curve="-180"/>
<text x="-3.2766" y="-0.635" size="1.27" layer="25" ratio="6" rot="SR0">>Name</text>
</package>
<package name="SOP65P500X110-8N">
<wire x1="1.402209375" y1="1.39976875" x2="1.402209375" y2="-1.40023125" width="0.2032" layer="21"/>
<wire x1="1.402209375" y1="-1.40023125" x2="-1.397790625" y2="-1.40023125" width="0.2032" layer="21"/>
<wire x1="-1.397790625" y1="-1.40023125" x2="-1.397790625" y2="1.39976875" width="0.2032" layer="21"/>
<wire x1="-1.397790625" y1="1.39976875" x2="1.402209375" y2="1.39976875" width="0.2032" layer="21"/>
<wire x1="-1.097790625" y1="0.699775" x2="-0.3977875" y2="0.699775" width="0.2032" layer="21" curve="-180"/>
<text x="-2.29413125" y="1.64318125" size="1.275759375" layer="25">>NAME</text>
<text x="-2.28908125" y="-2.91295" size="1.272940625" layer="27">>VALUE</text>
<rectangle x1="-2.10123125" y1="0.4932625" x2="-1.740990625" y2="1.45738125" layer="51" rot="R270"/>
<rectangle x1="-2.10008125" y1="-0.1580875" x2="-1.740990625" y2="0.807375" layer="51" rot="R270"/>
<rectangle x1="-2.10533125" y1="-0.811196875" x2="-1.740990625" y2="0.157375" layer="51" rot="R270"/>
<rectangle x1="-2.1006" y1="-1.460609375" x2="-1.740990625" y2="-0.492625" layer="51" rot="R270"/>
<rectangle x1="1.748040625" y1="-1.46001875" x2="2.101009375" y2="-0.492625" layer="51" rot="R270"/>
<rectangle x1="1.748840625" y1="-0.809409375" x2="2.101009375" y2="0.157375" layer="51" rot="R270"/>
<rectangle x1="1.75055" y1="-0.1582875" x2="2.101009375" y2="0.807375" layer="51" rot="R270"/>
<rectangle x1="1.752759375" y1="0.494246875" x2="2.101009375" y2="1.45738125" layer="51" rot="R270"/>
<smd name="1" x="-2.175" y="0.975" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="2" x="-2.175" y="0.325" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="3" x="-2.175" y="-0.325" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="4" x="-2.175" y="-0.975" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="5" x="2.175" y="-0.975" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="6" x="2.175" y="-0.325" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="7" x="2.175" y="0.325" dx="0.45" dy="1.2" layer="1" rot="R270"/>
<smd name="8" x="2.175" y="0.975" dx="0.45" dy="1.2" layer="1" rot="R270"/>
</package>
<package name="YAG_CC0805">
<smd name="1" x="-0.8255" y="0" dx="0.9652" dy="1.4478" layer="1"/>
<smd name="2" x="0.8255" y="0" dx="0.9652" dy="1.4478" layer="1"/>
<wire x1="-0.3556" y1="-0.7112" x2="-0.3556" y2="0.7112" width="0.1524" layer="51"/>
<wire x1="-0.3556" y1="0.7112" x2="-1.1176" y2="0.7112" width="0.1524" layer="51"/>
<wire x1="-1.1176" y1="-0.7112" x2="-0.3556" y2="-0.7112" width="0.1524" layer="51"/>
<wire x1="0.3302" y1="0.7366" x2="0.3556" y2="-0.7112" width="0.1524" layer="51"/>
<wire x1="0.3556" y1="-0.7112" x2="1.1176" y2="-0.7112" width="0.1524" layer="51"/>
<wire x1="1.1176" y1="-0.7112" x2="1.0922" y2="0.7366" width="0.1524" layer="51"/>
<wire x1="1.0922" y1="0.7366" x2="0.3302" y2="0.7366" width="0.1524" layer="51"/>
<wire x1="-0.3556" y1="-0.7112" x2="0.3556" y2="-0.7112" width="0.1524" layer="51"/>
<wire x1="1.1176" y1="-0.7112" x2="1.1176" y2="0.7112" width="0.1524" layer="51"/>
<wire x1="1.1176" y1="0.7112" x2="-0.3556" y2="0.7112" width="0.1524" layer="51"/>
<wire x1="-1.1176" y1="0.7112" x2="-1.1176" y2="-0.7112" width="0.1524" layer="51"/>
<text x="-3.2766" y="-0.635" size="1.27" layer="25" ratio="6" rot="SR0">>Name</text>
</package>
</packages>
<symbols>
<symbol name="L298P">
<pin name="GND_2" x="2.54" y="0" length="middle" direction="pas"/>
<pin name="SENSEA" x="2.54" y="-2.54" length="middle" direction="in"/>
<pin name="NC_2" x="2.54" y="-5.08" length="middle" direction="nc"/>
<pin name="OUT1" x="2.54" y="-7.62" length="middle" direction="out"/>
<pin name="OUT2" x="2.54" y="-10.16" length="middle" direction="out"/>
<pin name="VS" x="2.54" y="-12.7" length="middle" direction="pwr"/>
<pin name="INPUT1" x="2.54" y="-15.24" length="middle" direction="in"/>
<pin name="ENABLEA" x="2.54" y="-17.78" length="middle" direction="in"/>
<pin name="INPUT2" x="2.54" y="-20.32" length="middle" direction="in"/>
<pin name="GND_3" x="2.54" y="-22.86" length="middle" direction="pas"/>
<pin name="GND_4" x="68.58" y="-25.4" length="middle" direction="pas" rot="R180"/>
<pin name="VSS" x="68.58" y="-22.86" length="middle" direction="pwr" rot="R180"/>
<pin name="INPUT3" x="68.58" y="-20.32" length="middle" direction="in" rot="R180"/>
<pin name="ENABLEB" x="68.58" y="-17.78" length="middle" direction="in" rot="R180"/>
<pin name="INPUT4" x="68.58" y="-15.24" length="middle" direction="in" rot="R180"/>
<pin name="OUT3" x="68.58" y="-12.7" length="middle" direction="out" rot="R180"/>
<pin name="OUT4" x="68.58" y="-10.16" length="middle" direction="out" rot="R180"/>
<pin name="NC" x="68.58" y="-7.62" length="middle" direction="nc" rot="R180"/>
<pin name="SENSEB" x="68.58" y="-5.08" length="middle" direction="in" rot="R180"/>
<pin name="GND" x="68.58" y="-2.54" length="middle" direction="pas" rot="R180"/>
<pin name="21" x="68.58" y="0" length="middle" direction="pas" rot="R180"/>
<wire x1="7.62" y1="5.08" x2="7.62" y2="-30.48" width="0.1524" layer="94"/>
<wire x1="7.62" y1="-30.48" x2="63.5" y2="-30.48" width="0.1524" layer="94"/>
<wire x1="63.5" y1="-30.48" x2="63.5" y2="5.08" width="0.1524" layer="94"/>
<wire x1="63.5" y1="5.08" x2="7.62" y2="5.08" width="0.1524" layer="94"/>
<text x="30.8356" y="9.1186" size="1.6764" layer="95" ratio="6" rot="SR0">>Name</text>
<text x="30.2006" y="6.5786" size="1.6764" layer="96" ratio="6" rot="SR0">>Value</text>
</symbol>
<symbol name="GND">
<wire x1="-1.905" y1="0" x2="1.905" y2="0" width="0.254" layer="94"/>
<text x="-2.54" y="-2.54" size="1.6764" layer="96">GND</text>
<pin name="GND" x="0" y="2.54" visible="off" length="short" direction="sup" rot="R270"/>
</symbol>
<symbol name="DIODE">
<pin name="21" x="0" y="0" visible="off" length="short" direction="pas" swaplevel="1"/>
<pin name="12" x="10.16" y="0" visible="off" length="short" direction="pas" swaplevel="1" rot="R180"/>
<wire x1="3.81" y1="1.905" x2="3.81" y2="0" width="0.2032" layer="94"/>
<wire x1="3.81" y1="0" x2="3.81" y2="-1.905" width="0.2032" layer="94"/>
<wire x1="2.54" y1="0" x2="3.81" y2="0" width="0.2032" layer="94"/>
<wire x1="6.35" y1="-1.905" x2="6.35" y2="0" width="0.2032" layer="94"/>
<wire x1="6.35" y1="0" x2="6.35" y2="1.905" width="0.2032" layer="94"/>
<wire x1="6.35" y1="0" x2="7.62" y2="0" width="0.2032" layer="94"/>
<wire x1="6.35" y1="0" x2="3.81" y2="1.905" width="0.2032" layer="94"/>
<wire x1="3.81" y1="-1.905" x2="6.35" y2="0" width="0.2032" layer="94"/>
<text x="-0.762" y="-4.064" size="1.6764" layer="96" ratio="10" rot="SR0">>Value</text>
<text x="-0.762" y="2.286" size="1.6764" layer="95" ratio="10" rot="SR0">>Name</text>
</symbol>
<symbol name="CAPH">
<pin name="2" x="7.62" y="0" visible="off" length="short" direction="pas" swaplevel="1" rot="R180"/>
<pin name="1" x="0" y="0" visible="off" length="short" direction="pas" swaplevel="1"/>
<wire x1="3.4798" y1="-1.905" x2="3.4798" y2="0" width="0.2032" layer="94"/>
<wire x1="3.4798" y1="0" x2="3.4798" y2="1.905" width="0.2032" layer="94"/>
<wire x1="4.1148" y1="-1.905" x2="4.1148" y2="0" width="0.2032" layer="94"/>
<wire x1="4.1148" y1="0" x2="4.1148" y2="1.905" width="0.2032" layer="94"/>
<wire x1="4.1148" y1="0" x2="5.08" y2="0" width="0.2032" layer="94"/>
<wire x1="2.54" y1="0" x2="3.4798" y2="0" width="0.2032" layer="94"/>
<text x="-3.302" y="-2.54" size="1.6764" layer="96" ratio="10" rot="SR0">>Value</text>
<text x="-1.27" y="1.016" size="1.6764" layer="95" ratio="10" rot="SR0">>Name</text>
</symbol>
<symbol name="5V">
<description>
5V Voltage Supply
</description>
<wire x1="0.762" y1="1.27" x2="0" y2="2.54" width="0.254" layer="94"/>
<wire x1="0" y1="2.54" x2="-0.762" y2="1.27" width="0.254" layer="94"/>
<pin name="5V" x="0" y="0" visible="off" length="short" direction="sup" rot="R90"/>
<text x="0" y="2.794" size="1.6764" layer="96" align="bottom-center">5V</text>
</symbol>
<symbol name="DS18B20U+T&R">
<wire x1="7.62" y1="12.7" x2="7.62" y2="-10.16" width="0.254" layer="94"/>
<wire x1="7.62" y1="-10.16" x2="-7.62" y2="-10.16" width="0.254" layer="94"/>
<wire x1="-7.62" y1="-10.16" x2="-7.62" y2="12.7" width="0.254" layer="94"/>
<wire x1="-7.62" y1="12.7" x2="-2.54" y2="12.7" width="0.254" layer="94"/>
<wire x1="2.54" y1="12.7" x2="7.62" y2="12.7" width="0.254" layer="94"/>
<wire x1="2.54" y1="12.7" x2="-2.54" y2="12.7" width="0.254" layer="94" curve="-180"/>
<text x="-7.64955" y="15.2991" size="1.6764" layer="95">>NAME</text>
<text x="-7.653490625" y="-15.3069" size="1.6764" layer="96">>VALUE</text>
<pin name="DQ" x="-12.7" y="0" length="middle"/>
<pin name="VDD" x="12.7" y="7.62" length="middle" direction="pwr" rot="R180"/>
<pin name="GND" x="12.7" y="-7.62" length="middle" direction="pas" rot="R180"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="L298P013TR" prefix="U">
<description>Digikey 497-3624-1-ND</description>
<gates>
<gate name="A" symbol="L298P" x="0" y="0"/>
</gates>
<devices>
<device name="" package="POWERSO-20">
<connects>
<connect gate="A" pin="21" pad="21"/>
<connect gate="A" pin="ENABLEA" pad="8"/>
<connect gate="A" pin="ENABLEB" pad="14"/>
<connect gate="A" pin="GND" pad="20"/>
<connect gate="A" pin="GND_2" pad="1"/>
<connect gate="A" pin="GND_3" pad="10"/>
<connect gate="A" pin="GND_4" pad="11"/>
<connect gate="A" pin="INPUT1" pad="7"/>
<connect gate="A" pin="INPUT2" pad="9"/>
<connect gate="A" pin="INPUT3" pad="13"/>
<connect gate="A" pin="INPUT4" pad="15"/>
<connect gate="A" pin="NC" pad="18"/>
<connect gate="A" pin="NC_2" pad="3"/>
<connect gate="A" pin="OUT1" pad="4"/>
<connect gate="A" pin="OUT2" pad="5"/>
<connect gate="A" pin="OUT3" pad="16"/>
<connect gate="A" pin="OUT4" pad="17"/>
<connect gate="A" pin="SENSEA" pad="2"/>
<connect gate="A" pin="SENSEB" pad="19"/>
<connect gate="A" pin="VS" pad="6"/>
<connect gate="A" pin="VSS" pad="12"/>
</connects>
<technologies>
<technology name="">
<attribute name="MANUFACTURER_PART_NUMBER" value="L298P013TR" constant="no"/>
<attribute name="VENDOR" value="ST Microelectronics" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="POWER_GND" prefix="GND">
<gates>
<gate name="G$1" symbol="GND" x="0" y="-2.54"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="DIODE_400V_5A" prefix="CR">
<description>Digikey S5GC-FDICT-ND</description>
<gates>
<gate name="A" symbol="DIODE" x="0" y="0" swaplevel="1"/>
</gates>
<devices>
<device name="" package="DIODE_400V_5A">
<connects>
<connect gate="A" pin="12" pad="1"/>
<connect gate="A" pin="21" pad="2"/>
</connects>
<technologies>
<technology name="">
<attribute name="MANUFACTURER_PART_NUMBER" value="S5GC13F" constant="no"/>
<attribute name="VENDOR" value="Diodes Inc" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="CAP_47UF" prefix="C" uservalue="yes">
<description>CGA9N3X7R1C476M230KB
Digikey 445-7935-1-ND</description>
<gates>
<gate name="G$1" symbol="CAPH" x="0" y="0"/>
</gates>
<devices>
<device name="" package="CAP_5750">
<connects>
<connect gate="G$1" pin="1" pad="1"/>
<connect gate="G$1" pin="2" pad="2"/>
</connects>
<technologies>
<technology name="">
<attribute name="MANUFACTURER_PART_NUMBER" value="CGA9N3X7R1C476M230KB" constant="no"/>
<attribute name="VENDOR" value="TDK" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="POWER_5V" prefix="5V">
<gates>
<gate name="G$1" symbol="5V" x="0" y="0"/>
</gates>
<devices>
<device name="">
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="DS18B20U+T&R" prefix="U">
<description>Programmable Resolution 1-Wire Digital Thermometer</description>
<gates>
<gate name="G$1" symbol="DS18B20U+T&R" x="0" y="0"/>
</gates>
<devices>
<device name="" package="SOP65P500X110-8N">
<connects>
<connect gate="G$1" pin="DQ" pad="1"/>
<connect gate="G$1" pin="GND" pad="4"/>
<connect gate="G$1" pin="VDD" pad="8"/>
</connects>
<technologies>
<technology name="">
<attribute name="AVAILABILITY" value="Good"/>
<attribute name="DESCRIPTION" value=" Temp Sensor Digital Serial (1-Wire) 8-Pin uMAX T/R "/>
<attribute name="MF" value="Maxim Integrated"/>
<attribute name="MP" value="DS18B20U+T&amp;R"/>
<attribute name="PACKAGE" value="MSOP-8 Maxim Integrated"/>
<attribute name="PRICE" value="2.79 USD"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="CAP_1UF" prefix="C">
<description>Digikey 311-1365-1-ND</description>
<gates>
<gate name="A" symbol="CAPH" x="0" y="0"/>
</gates>
<devices>
<device name="" package="YAG_CC0805">
<connects>
<connect gate="A" pin="1" pad="1"/>
<connect gate="A" pin="2" pad="2"/>
</connects>
<technologies>
<technology name="">
<attribute name="MANUFACTURER_PART_NUMBER" value="CC0805KKX7R7BB105" constant="no"/>
<attribute name="VENDOR" value="Yageo" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
<class number="1" name="power" width="0.254" drill="0">
</class>
<class number="2" name="gnd" width="0.3048" drill="0.4064">
<clearance class="0" value="0.205"/>
<clearance class="1" value="0.205"/>
<clearance class="2" value="0.205"/>
</class>
<class number="3" name="power usb" width="0.508" drill="0.4064">
<clearance class="0" value="0.205"/>
<clearance class="1" value="0.205"/>
<clearance class="2" value="0.205"/>
<clearance class="3" value="0.205"/>
</class>
</classes>
<parts>
<part name="H3" library="holes" library_urn="urn:adsk.eagle:library:237" deviceset="MOUNT-PAD-SQUARE" device="3.2" package3d_urn="urn:adsk.eagle:package:14292/1"/>
<part name="H4" library="holes" library_urn="urn:adsk.eagle:library:237" deviceset="MOUNT-PAD-SQUARE" device="3.2" package3d_urn="urn:adsk.eagle:package:14292/1"/>
<part name="H1" library="holes" library_urn="urn:adsk.eagle:library:237" deviceset="MOUNT-PAD-SQUARE" device="3.2" package3d_urn="urn:adsk.eagle:package:14292/1"/>
<part name="H2" library="holes" library_urn="urn:adsk.eagle:library:237" deviceset="MOUNT-PAD-SQUARE" device="3.2" package3d_urn="urn:adsk.eagle:package:14292/1"/>
<part name="J$1" library="cubesat" deviceset="WIREPOST" device=""/>
<part name="J$3" library="cubesat" deviceset="WIREPOST" device=""/>
<part name="FRAME4" library="frames" library_urn="urn:adsk.eagle:library:229" deviceset="LETTER_L" device=""/>
<part name="U1" library="cubesat_" deviceset="L298P013TR" device=""/>
<part name="GND10" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND11" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY17" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="SUPPLY18" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="CR21" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR22" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR23" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR24" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="GND12" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND13" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY19" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="C9" library="cubesat_" deviceset="CAP_47UF" device="" value="47uF"/>
<part name="GND14" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="5V1" library="cubesat_" deviceset="POWER_5V" device=""/>
<part name="GND15" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="FRAME1" library="frames" library_urn="urn:adsk.eagle:library:229" deviceset="LETTER_L" device=""/>
<part name="FRAME2" library="frames" library_urn="urn:adsk.eagle:library:229" deviceset="LETTER_L" device=""/>
<part name="U2" library="cubesat_" deviceset="L298P013TR" device=""/>
<part name="GND1" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND2" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY1" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="SUPPLY2" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="CR1" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR2" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR3" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR4" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="GND3" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND4" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY3" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="C1" library="cubesat_" deviceset="CAP_47UF" device="" value="47uF"/>
<part name="GND5" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="5V2" library="cubesat_" deviceset="POWER_5V" device=""/>
<part name="GND6" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="FRAME3" library="frames" library_urn="urn:adsk.eagle:library:229" deviceset="LETTER_L" device=""/>
<part name="U3" library="cubesat_" deviceset="L298P013TR" device=""/>
<part name="GND7" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND8" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY4" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="SUPPLY5" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="CR5" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR6" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR7" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="CR8" library="cubesat_" deviceset="DIODE_400V_5A" device=""/>
<part name="GND9" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="GND16" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="SUPPLY6" library="kls_cubesat" deviceset="VIN" device=""/>
<part name="GND17" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="5V3" library="cubesat_" deviceset="POWER_5V" device=""/>
<part name="GND18" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="FRAME5" library="frames" library_urn="urn:adsk.eagle:library:229" deviceset="LETTER_L" device=""/>
<part name="U4" library="cubesat_" deviceset="DS18B20U+T&R" device=""/>
<part name="U5" library="cubesat_" deviceset="DS18B20U+T&R" device=""/>
<part name="U6" library="cubesat_" deviceset="DS18B20U+T&R" device=""/>
<part name="U7" library="cubesat_" deviceset="DS18B20U+T&R" device=""/>
<part name="GND19" library="cubesat_" deviceset="POWER_GND" device=""/>
<part name="5V4" library="cubesat_" deviceset="POWER_5V" device=""/>
<part name="C2" library="cubesat_" deviceset="CAP_1UF" device="" value="1uF"/>
<part name="C5" library="cubesat_" deviceset="CAP_1UF" device="" value="1uF"/>
<part name="C6" library="cubesat_" deviceset="CAP_1UF" device="" value="1uF"/>
<part name="C4" library="cubesat_" deviceset="CAP_47UF" device="" value="47uF"/>
</parts>
<sheets>
<sheet>
<plain>
<text x="149.86" y="25.4" size="3.81" layer="94">POWER</text>
</plain>
<instances>
<instance part="H3" gate="G$1" x="68.58" y="68.58"/>
<instance part="H4" gate="G$1" x="22.86" y="66.04"/>
<instance part="H1" gate="G$1" x="22.86" y="81.28"/>
<instance part="H2" gate="G$1" x="68.58" y="81.28"/>
<instance part="J$1" gate="G$1" x="124.46" y="119.38"/>
<instance part="J$3" gate="G$1" x="58.42" y="121.92"/>
<instance part="FRAME1" gate="G$1" x="0" y="0"/>
<instance part="FRAME1" gate="G$2" x="147.32" y="0"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="2">
<segment>
<pinref part="J$3" gate="G$1" pin="9"/>
<wire x1="68.58" y1="127" x2="83.82" y2="127" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="J$3" gate="G$1" pin="11"/>
<wire x1="68.58" y1="132.08" x2="83.82" y2="132.08" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="J$3" gate="G$1" pin="2"/>
<wire x1="68.58" y1="109.22" x2="83.82" y2="109.22" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="J$3" gate="G$1" pin="1"/>
<wire x1="68.58" y1="106.68" x2="83.82" y2="106.68" width="0.1524" layer="91"/>

</segment>
</net>
<net name="VIN" class="1">
<segment>
<pinref part="J$3" gate="G$1" pin="12"/>
<wire x1="68.58" y1="134.62" x2="83.82" y2="134.62" width="0.1524" layer="91"/>

</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="J$3" gate="G$1" pin="10"/>
<wire x1="68.58" y1="129.54" x2="83.82" y2="129.54" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC1_INPUT1" class="0">
<segment>
<wire x1="134.62" y1="116.84" x2="149.86" y2="116.84" width="0.1524" layer="91"/>

<pinref part="J$1" gate="G$1" pin="6"/>
</segment>
</net>
<net name="TEC1_INPUT2" class="0">
<segment>
<wire x1="134.62" y1="114.3" x2="149.86" y2="114.3" width="0.1524" layer="91"/>

<pinref part="J$1" gate="G$1" pin="5"/>
</segment>
</net>
<net name="TEC1_ENABLE" class="0">
<segment>
<wire x1="134.62" y1="111.76" x2="149.86" y2="111.76" width="0.1524" layer="91"/>

<pinref part="J$1" gate="G$1" pin="4"/>
</segment>
</net>
<net name="TEC2_INPUT1" class="0">
<segment>
<pinref part="J$1" gate="G$1" pin="9"/>
<wire x1="134.62" y1="124.46" x2="149.86" y2="124.46" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC2_INPUT2" class="0">
<segment>
<wire x1="134.62" y1="121.92" x2="149.86" y2="121.92" width="0.1524" layer="91"/>

<pinref part="J$1" gate="G$1" pin="8"/>
</segment>
</net>
<net name="TEC2_ENABLE" class="0">
<segment>
<wire x1="134.62" y1="119.38" x2="149.86" y2="119.38" width="0.1524" layer="91"/>

<pinref part="J$1" gate="G$1" pin="7"/>
</segment>
</net>
<net name="TEMP" class="0">
<segment>
<pinref part="J$1" gate="G$1" pin="3"/>
<wire x1="134.62" y1="109.22" x2="149.86" y2="109.22" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC1_OUT1" class="0">
<segment>
<wire x1="68.58" y1="124.46" x2="83.82" y2="124.46" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="8"/>
</segment>
</net>
<net name="TEC1_OUT2" class="0">
<segment>
<wire x1="68.58" y1="121.92" x2="83.82" y2="121.92" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="7"/>
</segment>
</net>
<net name="TEC2_OUT1" class="0">
<segment>
<wire x1="68.58" y1="119.38" x2="83.82" y2="119.38" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="6"/>
</segment>
</net>
<net name="TEC2_OUT2" class="0">
<segment>
<wire x1="68.58" y1="116.84" x2="83.82" y2="116.84" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="5"/>
</segment>
</net>
<net name="TEC3_OUT1" class="0">
<segment>
<wire x1="68.58" y1="114.3" x2="83.82" y2="114.3" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="4"/>
</segment>
</net>
<net name="TEC3_OUT2" class="0">
<segment>
<wire x1="68.58" y1="111.76" x2="83.82" y2="111.76" width="0.1524" layer="91"/>

<pinref part="J$3" gate="G$1" pin="3"/>
</segment>
</net>
<net name="TEC3_INPUT1" class="0">
<segment>
<pinref part="J$1" gate="G$1" pin="12"/>
<wire x1="134.62" y1="132.08" x2="149.86" y2="132.08" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC3_INPUT2" class="0">
<segment>
<pinref part="J$1" gate="G$1" pin="11"/>
<wire x1="134.62" y1="129.54" x2="149.86" y2="129.54" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC3_ENABLE" class="0">
<segment>
<pinref part="J$1" gate="G$1" pin="10"/>
<wire x1="134.62" y1="127" x2="149.86" y2="127" width="0.1524" layer="91"/>

</segment>
</net>
</nets>
</sheet>
<sheet>
<plain>
<text x="149.86" y="25.4" size="3.81" layer="94">POWER</text>
<circle x="96.52" y="134.62" radius="2.54" width="0.4064" layer="91"/>
</plain>
<instances>
<instance part="FRAME4" gate="G$1" x="0" y="0"/>
<instance part="FRAME4" gate="G$2" x="147.32" y="0"/>
<instance part="U1" gate="A" x="60.96" y="86.36"/>
<instance part="GND10" gate="G$1" x="106.68" y="106.68"/>
<instance part="GND11" gate="G$1" x="86.36" y="106.68"/>
<instance part="SUPPLY17" gate="G$1" x="86.36" y="154.94"/>
<instance part="SUPPLY18" gate="G$1" x="106.68" y="154.94"/>
<instance part="CR21" gate="A" x="86.36" y="137.16" rot="R90"/>
<instance part="CR22" gate="A" x="106.68" y="116.84" rot="R90"/>
<instance part="CR23" gate="A" x="106.68" y="137.16" rot="R90"/>
<instance part="CR24" gate="A" x="86.36" y="116.84" rot="R90"/>
<instance part="GND12" gate="G$1" x="139.7" y="30.48"/>
<instance part="GND13" gate="G$1" x="40.64" y="30.48"/>
<instance part="SUPPLY19" gate="G$1" x="22.86" y="124.46"/>
<instance part="C9" gate="G$1" x="22.86" y="66.04" rot="R90"/>
<instance part="GND14" gate="G$1" x="22.86" y="30.48"/>
<instance part="5V1" gate="G$1" x="167.64" y="121.92"/>
<instance part="GND15" gate="G$1" x="167.64" y="40.64"/>
<instance part="C6" gate="A" x="167.64" y="55.88" rot="R90"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="2">
<segment>
<pinref part="CR24" gate="A" pin="21"/>
<pinref part="GND11" gate="G$1" pin="GND"/>
<wire x1="86.36" y1="116.84" x2="86.36" y2="109.22" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="GND10" gate="G$1" pin="GND"/>
<pinref part="CR22" gate="A" pin="21"/>
<wire x1="106.68" y1="109.22" x2="106.68" y2="116.84" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U1" gate="A" pin="SENSEB"/>
<pinref part="GND12" gate="G$1" pin="GND"/>
<wire x1="129.54" y1="81.28" x2="139.7" y2="81.28" width="0.1524" layer="91"/>
<wire x1="139.7" y1="81.28" x2="139.7" y2="60.96" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="GND_4"/>
<wire x1="139.7" y1="60.96" x2="139.7" y2="33.02" width="0.1524" layer="91"/>
<wire x1="129.54" y1="60.96" x2="139.7" y2="60.96" width="0.1524" layer="91"/>
<junction x="139.7" y="60.96"/>
</segment>
<segment>
<pinref part="U1" gate="A" pin="SENSEA"/>
<wire x1="63.5" y1="83.82" x2="40.64" y2="83.82" width="0.1524" layer="91"/>
<wire x1="40.64" y1="83.82" x2="40.64" y2="33.02" width="0.1524" layer="91"/>
<pinref part="GND13" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="GND14" gate="G$1" pin="GND"/>
<pinref part="C9" gate="G$1" pin="1"/>
<wire x1="22.86" y1="33.02" x2="22.86" y2="66.04" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C6" gate="A" pin="1"/>
<pinref part="GND15" gate="G$1" pin="GND"/>
<wire x1="167.64" y1="55.88" x2="167.64" y2="43.18" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VIN" class="1">
<segment>
<pinref part="SUPPLY17" gate="G$1" pin="VIN"/>
<pinref part="CR21" gate="A" pin="12"/>
<wire x1="86.36" y1="154.94" x2="86.36" y2="147.32" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="CR23" gate="A" pin="12"/>
<pinref part="SUPPLY18" gate="G$1" pin="VIN"/>
<wire x1="106.68" y1="147.32" x2="106.68" y2="154.94" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C9" gate="G$1" pin="2"/>
<pinref part="U1" gate="A" pin="VS"/>
<wire x1="22.86" y1="73.66" x2="63.5" y2="73.66" width="0.1524" layer="91"/>
<pinref part="SUPPLY19" gate="G$1" pin="VIN"/>
<wire x1="22.86" y1="73.66" x2="22.86" y2="124.46" width="0.1524" layer="91"/>
<junction x="22.86" y="73.66"/>
</segment>
</net>
<net name="N$113" class="0">
<segment>
<pinref part="CR21" gate="A" pin="21"/>
<pinref part="CR24" gate="A" pin="12"/>
<wire x1="86.36" y1="137.16" x2="86.36" y2="127" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$114" class="0">
<segment>
<pinref part="CR22" gate="A" pin="12"/>
<pinref part="CR23" gate="A" pin="21"/>
<wire x1="106.68" y1="127" x2="106.68" y2="137.16" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC1_OUT1" class="0">
<segment>
<pinref part="U1" gate="A" pin="OUT1"/>
<wire x1="63.5" y1="78.74" x2="35.56" y2="78.74" width="0.1524" layer="91"/>
<wire x1="35.56" y1="78.74" x2="35.56" y2="99.06" width="0.1524" layer="91"/>
<wire x1="35.56" y1="99.06" x2="157.48" y2="99.06" width="0.1524" layer="91"/>
<wire x1="157.48" y1="99.06" x2="157.48" y2="76.2" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="OUT4"/>
<wire x1="157.48" y1="76.2" x2="129.54" y2="76.2" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC1_OUT2" class="0">
<segment>
<pinref part="U1" gate="A" pin="OUT2"/>
<wire x1="63.5" y1="76.2" x2="33.02" y2="76.2" width="0.1524" layer="91"/>
<wire x1="33.02" y1="76.2" x2="33.02" y2="101.6" width="0.1524" layer="91"/>
<wire x1="33.02" y1="101.6" x2="71.12" y2="101.6" width="0.1524" layer="91"/>
<wire x1="71.12" y1="101.6" x2="71.12" y2="134.62" width="0.1524" layer="91"/>
<wire x1="71.12" y1="134.62" x2="71.12" y2="165.1" width="0.1524" layer="91"/>
<wire x1="71.12" y1="165.1" x2="124.46" y2="165.1" width="0.1524" layer="91"/>
<wire x1="124.46" y1="165.1" x2="124.46" y2="134.62" width="0.1524" layer="91"/>
<wire x1="124.46" y1="134.62" x2="124.46" y2="101.6" width="0.1524" layer="91"/>
<wire x1="124.46" y1="101.6" x2="160.02" y2="101.6" width="0.1524" layer="91"/>
<wire x1="160.02" y1="101.6" x2="160.02" y2="73.66" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="OUT3"/>
<wire x1="160.02" y1="73.66" x2="129.54" y2="73.66" width="0.1524" layer="91"/>
<wire x1="71.12" y1="134.62" x2="124.46" y2="134.62" width="0.1524" layer="91"/>
<junction x="71.12" y="134.62"/>
<junction x="124.46" y="134.62"/>

</segment>
</net>
<net name="TEC1_INPUT1" class="0">
<segment>
<pinref part="U1" gate="A" pin="INPUT1"/>
<wire x1="63.5" y1="71.12" x2="38.1" y2="71.12" width="0.1524" layer="91"/>

<wire x1="38.1" y1="71.12" x2="38.1" y2="48.26" width="0.1524" layer="91"/>
<wire x1="38.1" y1="48.26" x2="149.86" y2="48.26" width="0.1524" layer="91"/>
<wire x1="149.86" y1="48.26" x2="149.86" y2="66.04" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="INPUT3"/>
<wire x1="149.86" y1="66.04" x2="129.54" y2="66.04" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC1_INPUT2" class="0">
<segment>
<pinref part="U1" gate="A" pin="INPUT2"/>
<wire x1="63.5" y1="66.04" x2="33.02" y2="66.04" width="0.1524" layer="91"/>

<pinref part="U1" gate="A" pin="INPUT4"/>
<wire x1="129.54" y1="71.12" x2="157.48" y2="71.12" width="0.1524" layer="91"/>
<wire x1="157.48" y1="71.12" x2="157.48" y2="43.18" width="0.1524" layer="91"/>
<wire x1="157.48" y1="43.18" x2="33.02" y2="43.18" width="0.1524" layer="91"/>
<wire x1="33.02" y1="43.18" x2="33.02" y2="66.04" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC1_ENABLE" class="0">
<segment>
<pinref part="U1" gate="A" pin="ENABLEA"/>
<wire x1="63.5" y1="68.58" x2="35.56" y2="68.58" width="0.1524" layer="91"/>
<wire x1="35.56" y1="68.58" x2="35.56" y2="45.72" width="0.1524" layer="91"/>
<wire x1="35.56" y1="45.72" x2="154.94" y2="45.72" width="0.1524" layer="91"/>
<wire x1="154.94" y1="45.72" x2="154.94" y2="68.58" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="ENABLEB"/>
<wire x1="154.94" y1="68.58" x2="129.54" y2="68.58" width="0.1524" layer="91"/>

</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="5V1" gate="G$1" pin="5V"/>
<pinref part="C6" gate="A" pin="2"/>
<wire x1="167.64" y1="121.92" x2="167.64" y2="63.5" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="VSS"/>
<wire x1="167.64" y1="63.5" x2="129.54" y2="63.5" width="0.1524" layer="91"/>
<junction x="167.64" y="63.5"/>
</segment>
</net>
</nets>
</sheet>
<sheet>
<plain>
<text x="149.86" y="25.4" size="3.81" layer="94">POWER</text>
<circle x="96.52" y="134.62" radius="2.54" width="0.4064" layer="91"/>
</plain>
<instances>
<instance part="FRAME2" gate="G$1" x="0" y="0"/>
<instance part="FRAME2" gate="G$2" x="147.32" y="0"/>
<instance part="U2" gate="A" x="60.96" y="86.36"/>
<instance part="GND1" gate="G$1" x="106.68" y="106.68"/>
<instance part="GND2" gate="G$1" x="86.36" y="106.68"/>
<instance part="SUPPLY1" gate="G$1" x="86.36" y="154.94"/>
<instance part="SUPPLY2" gate="G$1" x="106.68" y="154.94"/>
<instance part="CR1" gate="A" x="86.36" y="137.16" rot="R90"/>
<instance part="CR2" gate="A" x="106.68" y="116.84" rot="R90"/>
<instance part="CR3" gate="A" x="106.68" y="137.16" rot="R90"/>
<instance part="CR4" gate="A" x="86.36" y="116.84" rot="R90"/>
<instance part="GND3" gate="G$1" x="139.7" y="30.48"/>
<instance part="GND4" gate="G$1" x="40.64" y="30.48"/>
<instance part="SUPPLY3" gate="G$1" x="22.86" y="96.52"/>
<instance part="C1" gate="G$1" x="22.86" y="66.04" rot="R90"/>
<instance part="GND5" gate="G$1" x="22.86" y="30.48"/>
<instance part="5V2" gate="G$1" x="167.64" y="93.98"/>
<instance part="GND6" gate="G$1" x="167.64" y="40.64"/>
<instance part="C2" gate="A" x="167.64" y="63.5" rot="R90"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="2">
<segment>
<pinref part="CR4" gate="A" pin="21"/>
<pinref part="GND2" gate="G$1" pin="GND"/>
<wire x1="86.36" y1="116.84" x2="86.36" y2="109.22" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="GND1" gate="G$1" pin="GND"/>
<pinref part="CR2" gate="A" pin="21"/>
<wire x1="106.68" y1="109.22" x2="106.68" y2="116.84" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U2" gate="A" pin="SENSEB"/>
<pinref part="GND3" gate="G$1" pin="GND"/>
<wire x1="129.54" y1="81.28" x2="139.7" y2="81.28" width="0.1524" layer="91"/>
<wire x1="139.7" y1="81.28" x2="139.7" y2="60.96" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="GND_4"/>
<wire x1="139.7" y1="60.96" x2="139.7" y2="33.02" width="0.1524" layer="91"/>
<wire x1="129.54" y1="60.96" x2="139.7" y2="60.96" width="0.1524" layer="91"/>
<junction x="139.7" y="60.96"/>
</segment>
<segment>
<pinref part="U2" gate="A" pin="SENSEA"/>
<wire x1="63.5" y1="83.82" x2="40.64" y2="83.82" width="0.1524" layer="91"/>
<wire x1="40.64" y1="83.82" x2="40.64" y2="33.02" width="0.1524" layer="91"/>
<pinref part="GND4" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="C1" gate="G$1" pin="1"/>
<pinref part="GND5" gate="G$1" pin="GND"/>
<wire x1="22.86" y1="66.04" x2="22.86" y2="33.02" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="GND6" gate="G$1" pin="GND"/>
<pinref part="C2" gate="A" pin="1"/>
<wire x1="167.64" y1="43.18" x2="167.64" y2="63.5" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VIN" class="1">
<segment>
<pinref part="SUPPLY1" gate="G$1" pin="VIN"/>
<pinref part="CR1" gate="A" pin="12"/>
<wire x1="86.36" y1="154.94" x2="86.36" y2="147.32" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="CR3" gate="A" pin="12"/>
<pinref part="SUPPLY2" gate="G$1" pin="VIN"/>
<wire x1="106.68" y1="147.32" x2="106.68" y2="154.94" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U2" gate="A" pin="VS"/>
<pinref part="C1" gate="G$1" pin="2"/>
<wire x1="63.5" y1="73.66" x2="22.86" y2="73.66" width="0.1524" layer="91"/>
<pinref part="SUPPLY3" gate="G$1" pin="VIN"/>
<wire x1="22.86" y1="73.66" x2="22.86" y2="96.52" width="0.1524" layer="91"/>
<junction x="22.86" y="73.66"/>
</segment>
</net>
<net name="N$1" class="0">
<segment>
<pinref part="CR1" gate="A" pin="21"/>
<pinref part="CR4" gate="A" pin="12"/>
<wire x1="86.36" y1="137.16" x2="86.36" y2="127" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$2" class="0">
<segment>
<pinref part="CR2" gate="A" pin="12"/>
<pinref part="CR3" gate="A" pin="21"/>
<wire x1="106.68" y1="127" x2="106.68" y2="137.16" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC2_OUT1" class="0">
<segment>
<pinref part="U2" gate="A" pin="OUT1"/>
<wire x1="63.5" y1="78.74" x2="35.56" y2="78.74" width="0.1524" layer="91"/>
<wire x1="35.56" y1="78.74" x2="35.56" y2="99.06" width="0.1524" layer="91"/>
<wire x1="35.56" y1="99.06" x2="157.48" y2="99.06" width="0.1524" layer="91"/>
<wire x1="157.48" y1="99.06" x2="157.48" y2="76.2" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="OUT4"/>
<wire x1="157.48" y1="76.2" x2="129.54" y2="76.2" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC2_OUT2" class="0">
<segment>
<pinref part="U2" gate="A" pin="OUT2"/>
<wire x1="63.5" y1="76.2" x2="33.02" y2="76.2" width="0.1524" layer="91"/>
<wire x1="33.02" y1="76.2" x2="33.02" y2="101.6" width="0.1524" layer="91"/>
<wire x1="33.02" y1="101.6" x2="71.12" y2="101.6" width="0.1524" layer="91"/>
<wire x1="71.12" y1="101.6" x2="71.12" y2="134.62" width="0.1524" layer="91"/>
<wire x1="71.12" y1="134.62" x2="71.12" y2="165.1" width="0.1524" layer="91"/>
<wire x1="71.12" y1="165.1" x2="124.46" y2="165.1" width="0.1524" layer="91"/>
<wire x1="124.46" y1="165.1" x2="124.46" y2="134.62" width="0.1524" layer="91"/>
<wire x1="124.46" y1="134.62" x2="124.46" y2="101.6" width="0.1524" layer="91"/>
<wire x1="124.46" y1="101.6" x2="160.02" y2="101.6" width="0.1524" layer="91"/>
<wire x1="160.02" y1="101.6" x2="160.02" y2="73.66" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="OUT3"/>
<wire x1="160.02" y1="73.66" x2="129.54" y2="73.66" width="0.1524" layer="91"/>
<wire x1="71.12" y1="134.62" x2="124.46" y2="134.62" width="0.1524" layer="91"/>
<junction x="71.12" y="134.62"/>
<junction x="124.46" y="134.62"/>

</segment>
</net>
<net name="TEC2_INPUT1" class="0">
<segment>
<pinref part="U2" gate="A" pin="INPUT1"/>
<wire x1="63.5" y1="71.12" x2="38.1" y2="71.12" width="0.1524" layer="91"/>

<wire x1="38.1" y1="71.12" x2="38.1" y2="48.26" width="0.1524" layer="91"/>
<wire x1="38.1" y1="48.26" x2="149.86" y2="48.26" width="0.1524" layer="91"/>
<wire x1="149.86" y1="48.26" x2="149.86" y2="66.04" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="INPUT3"/>
<wire x1="149.86" y1="66.04" x2="129.54" y2="66.04" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC2_ENABLE" class="0">
<segment>
<pinref part="U2" gate="A" pin="ENABLEA"/>
<wire x1="63.5" y1="68.58" x2="35.56" y2="68.58" width="0.1524" layer="91"/>
<wire x1="35.56" y1="68.58" x2="35.56" y2="45.72" width="0.1524" layer="91"/>
<wire x1="35.56" y1="45.72" x2="154.94" y2="45.72" width="0.1524" layer="91"/>
<wire x1="154.94" y1="45.72" x2="154.94" y2="68.58" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="ENABLEB"/>
<wire x1="154.94" y1="68.58" x2="129.54" y2="68.58" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC2_INPUT2" class="0">
<segment>
<pinref part="U2" gate="A" pin="INPUT2"/>
<wire x1="63.5" y1="66.04" x2="33.02" y2="66.04" width="0.1524" layer="91"/>

<pinref part="U2" gate="A" pin="INPUT4"/>
<wire x1="129.54" y1="71.12" x2="157.48" y2="71.12" width="0.1524" layer="91"/>
<wire x1="157.48" y1="71.12" x2="157.48" y2="43.18" width="0.1524" layer="91"/>
<wire x1="157.48" y1="43.18" x2="33.02" y2="43.18" width="0.1524" layer="91"/>
<wire x1="33.02" y1="43.18" x2="33.02" y2="66.04" width="0.1524" layer="91"/>
</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="C2" gate="A" pin="2"/>
<wire x1="167.64" y1="71.12" x2="160.02" y2="71.12" width="0.1524" layer="91"/>
<wire x1="160.02" y1="71.12" x2="160.02" y2="63.5" width="0.1524" layer="91"/>
<pinref part="U2" gate="A" pin="VSS"/>
<wire x1="160.02" y1="63.5" x2="129.54" y2="63.5" width="0.1524" layer="91"/>
<pinref part="5V2" gate="G$1" pin="5V"/>
<wire x1="167.64" y1="93.98" x2="167.64" y2="71.12" width="0.1524" layer="91"/>
<junction x="167.64" y="71.12"/>
</segment>
</net>
</nets>
</sheet>
<sheet>
<plain>
<text x="129.54" y="5.08" size="3.81" layer="94">POWER</text>
<circle x="76.2" y="114.3" radius="2.54" width="0.4064" layer="91"/>
</plain>
<instances>
<instance part="FRAME3" gate="G$1" x="-20.32" y="-20.32"/>
<instance part="FRAME3" gate="G$2" x="127" y="-20.32"/>
<instance part="U3" gate="A" x="40.64" y="66.04"/>
<instance part="GND7" gate="G$1" x="86.36" y="86.36"/>
<instance part="GND8" gate="G$1" x="66.04" y="86.36"/>
<instance part="SUPPLY4" gate="G$1" x="66.04" y="134.62"/>
<instance part="SUPPLY5" gate="G$1" x="86.36" y="134.62"/>
<instance part="CR5" gate="A" x="66.04" y="116.84" rot="R90"/>
<instance part="CR6" gate="A" x="86.36" y="96.52" rot="R90"/>
<instance part="CR7" gate="A" x="86.36" y="116.84" rot="R90"/>
<instance part="CR8" gate="A" x="66.04" y="96.52" rot="R90"/>
<instance part="GND9" gate="G$1" x="119.38" y="10.16"/>
<instance part="GND16" gate="G$1" x="20.32" y="10.16"/>
<instance part="SUPPLY6" gate="G$1" x="2.54" y="86.36"/>
<instance part="GND17" gate="G$1" x="2.54" y="10.16"/>
<instance part="5V3" gate="G$1" x="147.32" y="101.6"/>
<instance part="GND18" gate="G$1" x="147.32" y="20.32"/>
<instance part="C5" gate="A" x="147.32" y="35.56" rot="R90"/>
<instance part="C4" gate="G$1" x="2.54" y="45.72" rot="R90"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="2">
<segment>
<pinref part="CR8" gate="A" pin="21"/>
<pinref part="GND8" gate="G$1" pin="GND"/>
<wire x1="66.04" y1="96.52" x2="66.04" y2="88.9" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="GND7" gate="G$1" pin="GND"/>
<pinref part="CR6" gate="A" pin="21"/>
<wire x1="86.36" y1="88.9" x2="86.36" y2="96.52" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U3" gate="A" pin="SENSEB"/>
<pinref part="GND9" gate="G$1" pin="GND"/>
<wire x1="109.22" y1="60.96" x2="119.38" y2="60.96" width="0.1524" layer="91"/>
<wire x1="119.38" y1="60.96" x2="119.38" y2="40.64" width="0.1524" layer="91"/>
<pinref part="U3" gate="A" pin="GND_4"/>
<wire x1="119.38" y1="40.64" x2="119.38" y2="12.7" width="0.1524" layer="91"/>
<wire x1="109.22" y1="40.64" x2="119.38" y2="40.64" width="0.1524" layer="91"/>
<junction x="119.38" y="40.64"/>
</segment>
<segment>
<pinref part="U3" gate="A" pin="SENSEA"/>
<wire x1="43.18" y1="63.5" x2="20.32" y2="63.5" width="0.1524" layer="91"/>
<wire x1="20.32" y1="63.5" x2="20.32" y2="12.7" width="0.1524" layer="91"/>
<pinref part="GND16" gate="G$1" pin="GND"/>
</segment>
<segment>
<pinref part="C4" gate="G$1" pin="1"/>
<pinref part="GND17" gate="G$1" pin="GND"/>
<wire x1="2.54" y1="45.72" x2="2.54" y2="12.7" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="C5" gate="A" pin="1"/>
<pinref part="GND18" gate="G$1" pin="GND"/>
<wire x1="147.32" y1="35.56" x2="147.32" y2="22.86" width="0.1524" layer="91"/>
</segment>
</net>
<net name="VIN" class="1">
<segment>
<pinref part="SUPPLY4" gate="G$1" pin="VIN"/>
<pinref part="CR5" gate="A" pin="12"/>
<wire x1="66.04" y1="134.62" x2="66.04" y2="127" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="CR7" gate="A" pin="12"/>
<pinref part="SUPPLY5" gate="G$1" pin="VIN"/>
<wire x1="86.36" y1="127" x2="86.36" y2="134.62" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U3" gate="A" pin="VS"/>
<pinref part="C4" gate="G$1" pin="2"/>
<wire x1="43.18" y1="53.34" x2="2.54" y2="53.34" width="0.1524" layer="91"/>
<pinref part="SUPPLY6" gate="G$1" pin="VIN"/>
<wire x1="2.54" y1="53.34" x2="2.54" y2="86.36" width="0.1524" layer="91"/>
<junction x="2.54" y="53.34"/>
</segment>
</net>
<net name="N$5" class="0">
<segment>
<pinref part="CR5" gate="A" pin="21"/>
<pinref part="CR8" gate="A" pin="12"/>
<wire x1="66.04" y1="116.84" x2="66.04" y2="106.68" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$6" class="0">
<segment>
<pinref part="CR6" gate="A" pin="12"/>
<pinref part="CR7" gate="A" pin="21"/>
<wire x1="86.36" y1="106.68" x2="86.36" y2="116.84" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC3_OUT1" class="0">
<segment>
<pinref part="U3" gate="A" pin="OUT1"/>
<wire x1="43.18" y1="58.42" x2="15.24" y2="58.42" width="0.1524" layer="91"/>
<wire x1="15.24" y1="58.42" x2="15.24" y2="78.74" width="0.1524" layer="91"/>
<wire x1="15.24" y1="78.74" x2="137.16" y2="78.74" width="0.1524" layer="91"/>
<wire x1="137.16" y1="78.74" x2="137.16" y2="55.88" width="0.1524" layer="91"/>
<pinref part="U3" gate="A" pin="OUT4"/>
<wire x1="137.16" y1="55.88" x2="109.22" y2="55.88" width="0.1524" layer="91"/>

</segment>
</net>
<net name="TEC3_OUT2" class="0">
<segment>
<pinref part="U3" gate="A" pin="OUT2"/>
<wire x1="43.18" y1="55.88" x2="12.7" y2="55.88" width="0.1524" layer="91"/>
<wire x1="12.7" y1="55.88" x2="12.7" y2="81.28" width="0.1524" layer="91"/>
<wire x1="12.7" y1="81.28" x2="50.8" y2="81.28" width="0.1524" layer="91"/>
<wire x1="50.8" y1="81.28" x2="50.8" y2="114.3" width="0.1524" layer="91"/>
<wire x1="50.8" y1="114.3" x2="50.8" y2="144.78" width="0.1524" layer="91"/>
<wire x1="50.8" y1="144.78" x2="104.14" y2="144.78" width="0.1524" layer="91"/>
<wire x1="104.14" y1="144.78" x2="104.14" y2="114.3" width="0.1524" layer="91"/>
<wire x1="104.14" y1="114.3" x2="104.14" y2="81.28" width="0.1524" layer="91"/>
<wire x1="104.14" y1="81.28" x2="139.7" y2="81.28" width="0.1524" layer="91"/>
<wire x1="139.7" y1="81.28" x2="139.7" y2="53.34" width="0.1524" layer="91"/>
<pinref part="U3" gate="A" pin="OUT3"/>
<wire x1="139.7" y1="53.34" x2="109.22" y2="53.34" width="0.1524" layer="91"/>
<wire x1="50.8" y1="114.3" x2="104.14" y2="114.3" width="0.1524" layer="91"/>
<junction x="50.8" y="114.3"/>
<junction x="104.14" y="114.3"/>

</segment>
</net>
<net name="TEC3_INPUT1" class="0">
<segment>
<pinref part="U3" gate="A" pin="INPUT1"/>
<wire x1="43.18" y1="50.8" x2="17.78" y2="50.8" width="0.1524" layer="91"/>

<wire x1="17.78" y1="50.8" x2="17.78"

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: sch


text:
y2="27.94" width="0.1524" layer="91"/>
<wire x1="17.78" y1="27.94" x2="129.54" y2="27.94" width="0.1524" layer="91"/>
<wire x1="129.54" y1="27.94" x2="129.54" y2="45.72" width="0.1524" layer="91"/>
<pinref part="U3" gate="A" pin="INPUT3"/>
<wire x1="129.54" y1="45.72" x2="109.22" y2="45.72" width="0.1524" layer="91"/>
</segment>
</net>
<net name="TEC3_ENABLE" class="0">
<segment>
<pinref part="U3" gate="A" pin="ENABLEA"/>
<wire x1="43.18" y1="48.26" x2="15.24" y2="48.26" width="0.1524" layer="91"/>
<wire x1="15.24" y1="48.26" x2="15.24" y2="25.4" width="0.1524" layer="91"/>
<wire x1="15.24" y1="25.4" x2="134.62" y2="25.4" width="0.1524" layer="91"/>
<wire x1="134.62" y1="25.4" x2="134.62" y2="48.26" width="0.1524" layer="91"/>
<pinref part="U3" gate="A" pin="ENABLEB"/>
<wire x1="134.62" y1="48.26" x2="109.22" y2="48.26" width="0.1524" layer="91"/>
<label x="22.86" y="48.26" size="1.778" layer="95"/>
</segment>
</net>
<net name="TEC3_INPUT2" class="0">
<segment>
<pinref part="U3" gate="A" pin="INPUT2"/>
<wire x1="43.18" y1="45.72" x2="12.7" y2="45.72" width="0.1524" layer="91"/>
<label x="22.86" y="45.72" size="1.778" layer="95"/>
<pinref part="U3" gate="A" pin="INPUT4"/>
<wire x1="109.22" y1="50.8" x2="137.16" y2="50.8" width="0.1524" layer="91"/>
<wire x1="137.16" y1="50.8" x2="137.16" y2="22.86" width="0.1524" layer="91"/>
<wire x1="137.16" y1="22.86" x2="12.7" y2="22.86" width="0.1524" layer="91"/>
<wire x1="12.7" y1="22.86" x2="12.7" y2="45.72" width="0.1524" layer="91"/>
</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="U3" gate="A" pin="VSS"/>
<pinref part="C5" gate="A" pin="2"/>
<wire x1="109.22" y1="43.18" x2="147.32" y2="43.18" width="0.1524" layer="91"/>
<pinref part="5V3" gate="G$1" pin="5V"/>
<wire x1="147.32" y1="43.18" x2="147.32" y2="101.6" width="0.1524" layer="91"/>
<junction x="147.32" y="43.18"/>
</segment>
</net>
</nets>
</sheet>
<sheet>
<plain>
<text x="149.86" y="25.4" size="3.81" layer="94">POWER</text>
</plain>
<instances>
<instance part="FRAME5" gate="G$1" x="0" y="0"/>
<instance part="FRAME5" gate="G$2" x="147.32" y="0"/>
<instance part="U4" gate="G$1" x="48.26" y="121.92"/>
<instance part="U5" gate="G$1" x="93.98" y="121.92"/>
<instance part="U6" gate="G$1" x="137.16" y="121.92"/>
<instance part="U7" gate="G$1" x="180.34" y="121.92"/>
<instance part="GND19" gate="G$1" x="20.32" y="93.98"/>
<instance part="5V4" gate="G$1" x="198.12" y="152.4"/>
</instances>
<busses>
</busses>
<nets>
<net name="TEMP" class="0">
<segment>
<pinref part="U4" gate="G$1" pin="DQ"/>
<wire x1="35.56" y1="121.92" x2="27.94" y2="121.92" width="0.1524" layer="91"/>
<label x="27.94" y="121.92" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U5" gate="G$1" pin="DQ"/>
<wire x1="81.28" y1="121.92" x2="73.66" y2="121.92" width="0.1524" layer="91"/>
<label x="73.66" y="121.92" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U6" gate="G$1" pin="DQ"/>
<wire x1="124.46" y1="121.92" x2="116.84" y2="121.92" width="0.1524" layer="91"/>
<label x="116.84" y="121.92" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U7" gate="G$1" pin="DQ"/>
<wire x1="167.64" y1="121.92" x2="157.48" y2="121.92" width="0.1524" layer="91"/>
<label x="160.02" y="121.92" size="1.778" layer="95"/>
</segment>
</net>
<net name="GND" class="2">
<segment>
<pinref part="GND19" gate="G$1" pin="GND"/>
<wire x1="20.32" y1="96.52" x2="20.32" y2="104.14" width="0.1524" layer="91"/>
<wire x1="20.32" y1="104.14" x2="66.04" y2="104.14" width="0.1524" layer="91"/>
<wire x1="66.04" y1="104.14" x2="66.04" y2="114.3" width="0.1524" layer="91"/>
<pinref part="U4" gate="G$1" pin="GND"/>
<wire x1="66.04" y1="114.3" x2="60.96" y2="114.3" width="0.1524" layer="91"/>
<pinref part="U5" gate="G$1" pin="GND"/>
<wire x1="106.68" y1="114.3" x2="111.76" y2="114.3" width="0.1524" layer="91"/>
<wire x1="111.76" y1="114.3" x2="111.76" y2="104.14" width="0.1524" layer="91"/>
<wire x1="111.76" y1="104.14" x2="66.04" y2="104.14" width="0.1524" layer="91"/>
<junction x="66.04" y="104.14"/>
<pinref part="U6" gate="G$1" pin="GND"/>
<wire x1="149.86" y1="114.3" x2="154.94" y2="114.3" width="0.1524" layer="91"/>
<wire x1="154.94" y1="114.3" x2="154.94" y2="104.14" width="0.1524" layer="91"/>
<wire x1="154.94" y1="104.14" x2="111.76" y2="104.14" width="0.1524" layer="91"/>
<junction x="111.76" y="104.14"/>
<pinref part="U7" gate="G$1" pin="GND"/>
<wire x1="193.04" y1="114.3" x2="198.12" y2="114.3" width="0.1524" layer="91"/>
<wire x1="198.12" y1="114.3" x2="198.12" y2="104.14" width="0.1524" layer="91"/>
<wire x1="198.12" y1="104.14" x2="154.94" y2="104.14" width="0.1524" layer="91"/>
<junction x="154.94" y="104.14"/>
</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="5V4" gate="G$1" pin="5V"/>
<wire x1="198.12" y1="152.4" x2="198.12" y2="144.78" width="0.1524" layer="91"/>
<pinref part="U7" gate="G$1" pin="VDD"/>
<wire x1="198.12" y1="144.78" x2="198.12" y2="129.54" width="0.1524" layer="91"/>
<wire x1="198.12" y1="129.54" x2="193.04" y2="129.54" width="0.1524" layer="91"/>
<pinref part="U6" gate="G$1" pin="VDD"/>
<wire x1="149.86" y1="129.54" x2="152.4" y2="129.54" width="0.1524" layer="91"/>
<wire x1="152.4" y1="129.54" x2="152.4" y2="144.78" width="0.1524" layer="91"/>
<wire x1="152.4" y1="144.78" x2="198.12" y2="144.78" width="0.1524" layer="91"/>
<junction x="198.12" y="144.78"/>
<pinref part="U5" gate="G$1" pin="VDD"/>
<wire x1="106.68" y1="129.54" x2="109.22" y2="129.54" width="0.1524" layer="91"/>
<wire x1="109.22" y1="129.54" x2="109.22" y2="144.78" width="0.1524" layer="91"/>
<wire x1="109.22" y1="144.78" x2="152.4" y2="144.78" width="0.1524" layer="91"/>
<junction x="152.4" y="144.78"/>
<pinref part="U4" gate="G$1" pin="VDD"/>
<wire x1="60.96" y1="129.54" x2="60.96" y2="144.78" width="0.1524" layer="91"/>
<wire x1="60.96" y1="144.78" x2="109.22" y2="144.78" width="0.1524" layer="91"/>
<junction x="109.22" y="144.78"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
<compatibility>
<note version="8.2" severity="warning">
Since Version 8.2, EAGLE supports online libraries. The ids
of those online libraries will not be understood (or retained)
with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports URNs for individual library
assets (packages, symbols, and devices). The URNs of those assets
will not be understood (or retained) with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports the association of 3D packages
with devices in libraries, schematics, and board files. Those 3D
packages will not be understood (or retained) with this version.
</note>
</compatibility>
</eagle>


text:
SUMMARY = "Phosphor Fan"
DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
control applications."
# Common build dependencies
DEPENDS += "${PYTHON_PN}-pyyaml-native"
DEPENDS += "${PYTHON_PN}-mako-native"
DEPENDS += "sdbusplus"
DEPENDS += "${PYTHON_PN}-sdbus++-native"
DEPENDS += "sdeventplus"
DEPENDS += "gpioplus"
DEPENDS += "phosphor-logging"
DEPENDS += "libevdev"
DEPENDS += "nlohmann-json"
DEPENDS += "cli11"
PACKAGECONFIG ?= "presence control monitor sensor-monitor"
# The control, monitor, and presence apps can either be JSON or YAML driven.
PACKAGECONFIG[json] = "-Djson-config=enabled, -Djson-config=disabled"
# --------------------------------------
# ${PN}-presence-tach specific configuration
PACKAGECONFIG[presence] = "-Dpresence-service=enabled \
    -Dmachine-name=${PKG_DEFAULT_MACHINE} \
    -Dpresence-config=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \
    -Dpresence-service=disabled, \
    virtual/phosphor-fan-presence-config \
    , \
"
# --------------------------------------
# ${PN}-control specific configuration
PACKAGECONFIG[control] = "-Dcontrol-service=enabled \
    -Dmachine-name=${PKG_DEFAULT_MACHINE} \
    -Dfan-def-yaml-file=${STAGING_DIR_HOST}${control_datadir}/fans.yaml \
    -Dfan-zone-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zones.yaml \
    -Dzone-events-yaml-file=${STAGING_DIR_HOST}${control_datadir}/events.yaml \
    -Dzone-conditions-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \
    -Dcontrol-service=disabled, \
    virtual/phosphor-fan-control-fan-config \
    phosphor-fan-control-zone-config \
    phosphor-fan-control-events-config \
    phosphor-fan-control-zone-conditions-config \
    , \
"
# --------------------------------------
# ${PN}-monitor specific configuration
PACKAGECONFIG[monitor] = "-Dmonitor-service=enabled \
    -Dmachine-name=${PKG_DEFAULT_MACHINE} \
    -Dfan-monitor-yaml-file=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \
    -Dmonitor-service=disabled, \
    phosphor-fan-monitor-config \
    , \
"
# --------------------------------------
# phosphor-cooling-type specific configuration
PACKAGECONFIG[cooling-type] = "-Dcooling-type-service=enabled,-Dcooling-type-service=disabled,,"
# --------------------------------------
# ${PN}-sensor-monitor specific configuration
PACKAGECONFIG[sensor-monitor] = "-Dsensor-monitor-service=enabled,-Dsensor-monitor-service=disabled"
PV = "1.0+git${SRCPV}"
PR = "r1"

S = "${WORKDIR}/git"

# OBMC_CHASSIS_ZERO_ONLY: hacky way to fix the templates until
# openbmc/phosphor-fan-presence#26 is resolved.  This should likely be
# returned to OBMC_CHASSIS_INSTANCES.
OBMC_CHASSIS_ZERO_ONLY = "0"

SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}"
SYSTEMD_LINK:${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_ZERO_ONLY')}"
# JSON mode also gets linked into multi-user
SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
        compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), '', d)}"
SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}"
SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}"
# JSON: Linked to multi-user and poweron
# YAML: Linked to fans-ready and fan control-init poweron
SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
        compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), \
        compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
        compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_ZERO_ONLY'), \
        compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}"
SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}"

# JSON: power on and multi-user links.  YAML: fans-ready and fan monitor init links
SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
                                compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_ZERO_ONLY'), \
                                compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
                                compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), \
                                compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
SYSTEMD_SERVICE:sensor-monitor += "sensor-monitor.service"
SYSTEMD_LINK:sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service"

inherit meson pkgconfig python3native
inherit obmc-phosphor-systemd
inherit phosphor-fan

EXTRA_OEMESON:append = " -Dtests=disabled"

PACKAGE_ARCH = "${MACHINE_ARCH}"

FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
# Package the JSON config files installed from the repo
FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
    '${datadir}/phosphor-fan-presence/presence/*', '', d)}"
FILES:${PN}-control = "${bindir}/phosphor-fan-control"
FILES:${PN}-control += "${bindir}/fanctl"
# Package the JSON config files installed from the repo
FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
    '${datadir}/phosphor-fan-presence/control/*', '', d)}"
FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor"
# Package the JSON config files installed from the repo
FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
    '${datadir}/phosphor-fan-presence/monitor/*', '', d)}"
FILES:sensor-monitor += " ${bindir}/sensor-monitor"

require ${BPN}.inc

ALLOW_EMPTY:${PN} = "1"

PKG_DEFAULT_MACHINE ??= "${MACHINE}"

# Package configuration
FAN_PACKAGES = " \
        ${PN}-presence-tach \
        ${PN}-control \
        ${PN}-monitor \
        ${PN}-sensor-monitor \
"
PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
MULTI_USR_TGT = "multi-user.target"
TMPL_TACH = "phosphor-fan-presence-tach@.service"
INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
POWERON_TGT = "obmc-chassis-poweron@{0}.target"
FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}"
FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
TMPL_CONTROL = "phosphor-fan-control@.service"
INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}"
TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
TMPL_MONITOR = "phosphor-fan-monitor@.service"
INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}"
FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}"
TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}"

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python

extension: bb


text:
package main

import (
	"bufio"
	"flag"
	"fmt"
	"io"
	"os"
	"regexp"
	"strconv"
	"strings"
	"time"

	"github.com/fatih/color"
)

type Process struct {
	Tag string
	Pid uint64
}

type LogcatLine struct {
	Type string
	Tag  string
	Pid  uint64
}

const (
	MATCH_V1         = `(\d\d.\d\d\s\d\d:\d\d:\d\d.\d\d\d)\s*(\d*)\s*(\d*)\s([VDIWEFS])\s(.*?)(:\s)(.*)`
	MATCH_V2         = `([VDIWEFS])/(.*?)\((\s*|)(\d*)\):.`
	MATCH_PROCESS_V1 = `\d\d.\d\d\s\d\d:\d\d:\d\d.\d\d\d\s*\d*\s*\d*\s[VDIWEFS]\sActivityManager:\sStart\sproc\s(\d*):(.*?)/.*`
	MATCH_PROCESS_V2 = `.*Start\sproc\s(.*)\sfor\sactivity\s.*:\spid=(\d*)\s.*`
)

func matchProcessV1(inputLine string) *Process {
	exp := regexp.MustCompile(MATCH_PROCESS_V1)
	m := exp.FindStringSubmatch(inputLine)
	if len(m) > 0 {
		var i uint64
		i, _ = strconv.ParseUint(m[1], 10, 64)
		return &Process{
			Tag: m[2],
			Pid: i,
		}
	}
	return nil
}

func matchProcessV2(inputLine string) *Process {
	exp := regexp.MustCompile(MATCH_PROCESS_V2)
	m := exp.FindStringSubmatch(inputLine)
	if len(m) > 0 {
		var i uint64
		i, _ = strconv.ParseUint(m[2], 10, 64)
		return &Process{
			Tag: m[1],
			Pid: i,
		}
	}
	return nil
}

func process(inputLine string) *Process {
	if proc := matchProcessV1(inputLine); proc != nil {
		return proc
	}
	if proc := matchProcessV2(inputLine); proc != nil {
		return proc
	}
	return nil
}

func matchV1(inputLine string) *LogcatLine {
	exp := regexp.MustCompile(MATCH_V1)
	m := exp.FindStringSubmatch(inputLine)
	if len(m) > 0 {
		var i uint64
		i, _ = strconv.ParseUint(m[2], 10, 64)
		return &LogcatLine{
			Type: m[4],
			Tag:  m[5],
			Pid:  i,
		}
	}
	return nil
}

func matchV2(inputLine string) *LogcatLine {
	exp := regexp.MustCompile(MATCH_V2)
	m := exp.FindStringSubmatch(inputLine)
	if len(m) > 0 {
		var i uint64
		i, _ = strconv.ParseUint(m[4], 10, 64)
		return &LogcatLine{
			Type: m[1],
			Tag:  m[2],
			Pid:  i,
		}
	}
	return nil
}

func detectFormat(inputLine string) *LogcatLine {
	if line := matchV1(inputLine); line != nil {
		return line
	}
	if line := matchV2(inputLine); line != nil {
		return line
	}
	return &LogcatLine{
		Type: "",
		Tag:  "",
		Pid:  0,
	}
}

var (
	tag    string
	filter string
)

func init() {
	flag.StringVar(&tag, "tag", "", "-tag com.yourcompany.yourapp")
	flag.StringVar(&filter, "filter", "", "-filter Networking")
}

func main() {
	flag.Parse()
	reader := bufio.NewReader(os.Stdin)
	var currentPid uint64
	currentPid = 0
	filterProcess := false
	if tag != "" {
		filterProcess = true
	}

	filterText := false

	if len(tag) > 0 {
		fmt.Println("tag:" + tag)
	}
	if len(filter) > 0 {
		filterText = true
		filter = strings.ToLower(filter)
		fmt.Println("filter:" + filter)
	}

	for {
		text, err := reader.ReadString('\n')
		if err == io.EOF {
			return
		}

		if err != nil {
			fmt.Println(err.Error())
		}

		kind := detectFormat(text)

		if filterProcess {
			process := process(text)
			if process != nil && process.Tag == tag {
				currentPid = process.Pid
			}
			if kind.Pid != currentPid {
				continue
			}
		}

		if filterText {
			if !strings.Contains(strings.ToLower(text), filter) {
				continue
			}
		}

		text = time.Now().Format(time.StampMilli) + "| " + text

		switch kind.Type {
		case "D":
			color.Green(text)
			break
		case "W":
			color.Yellow(text)
			break
		case "E":
			color.Red(text)
			break
		case "I":
			color.Cyan(text)
		case "":
			fmt.Print(text)
		}
	}
}

repository: fsuhrau/gocat

repo_name: fsuhrau/gocat

extension: go


text:
SUMMARY = "Yet Another Flash File System"
DESCRIPTION = "Tools for managing 'yaffs2' file systems."

SECTION = "base"
HOMEPAGE = "http://www.yaffs.net"

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://utils/mkyaffs2image.c;beginline=11;endline=13;md5=5f5464f9b3e981ca574e65b00e438561 \
                    file://utils/mkyaffsimage.c;beginline=10;endline=12;md5=5f5464f9b3e981ca574e65b00e438561 \
                    "

PV = "0.0+git${SRCPV}"

DEPENDS = "mtd-utils"

# Source is the HEAD of master branch at the time of writing this recipe
SRC_URI = "git://www.aleph1.co.uk/yaffs2;protocol=git;branch=master \
           file://makefile-add-ldflags.patch \
           file://0001-define-loff_t-if-not-already-defined.patch \
           "

SRCREV = "9a6f486e56f927eeb8dc7e4e0d84f6bb95eeaa0f"

UPSTREAM_CHECK_COMMITS = "1"

S = "${WORKDIR}/git"

CFLAGS:append = " -I.. -DCONFIG_YAFFS_UTIL -DCONFIG_YAFFS_DEFINES_TYPES"
EXTRA_OEMAKE = "-e MAKEFLAGS="

do_compile() {
    cd utils && oe_runmake
}

INSTALL_FILES = "mkyaffsimage \
                 mkyaffs2image \
                "
do_install() {
    install -d ${D}${sbindir}/
    for i in ${INSTALL_FILES}; do
        install -m 0755 utils/$i ${D}${sbindir}/
    done
}

BBCLASSEXTEND = "native"

# Fixed make clean error:
#make -C /lib/modules/4.4.0-112-generic/build M=<snip>
#make: *** /lib/modules/4.4.0-112-generic/build: No such file or directory.  Stop.
#make: *** [clean] Error 2
CLEANBROKEN = "1"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_license_id: MIT

gha_language: BitBake


text:
# - try to find Windows HID support, part of the WDK/DDK
#
# Cache Variables: (probably not for direct use in your scripts)
#  WINHID_INCLUDE_DIR
#  WINHID_CRT_INCLUDE_DIR
#  WINHID_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
#  WINHID_FOUND
#  WINHID_INCLUDE_DIRS
#  WINHID_LIBRARIES
#
# Requires these CMake modules:
#  FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#  PrefixListGlob
#  CleanDirectoryList
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

if(NOT WIN32)
	find_package_handle_standard_args(WinHID
		"Skipping search for Windows HID on non-Windows platform"
		WIN32)
	return()
endif()

if( (NOT WINHID_ROOT_DIR) AND (NOT ENV{DDKROOT} STREQUAL "") )
	set(WINHID_ROOT_DIR "$ENV{DDKROOT}")
endif()
set(WINHID_ROOT_DIR
	"${WINHID_ROOT_DIR}"
	CACHE
	PATH
	"Directory to search")

if(CMAKE_SIZEOF_VOID_P MATCHES "8")
	set(_arch amd64)
else()
	set(_arch i386)
endif()

include(PrefixListGlob)
include(CleanDirectoryList)
prefix_list_glob(_prefixed "*/" "$ENV{SYSTEMDRIVE}/WinDDK/" "c:/WinDDK/")
clean_directory_list(_prefixed)

find_library(WINHID_LIBRARY
	NAMES
	hid
	HINTS
	"${WINHID_ROOT_DIR}"
	${_prefixed}
	PATH_SUFFIXES
	"lib/w2k/${_arch}" # Win2k min requirement
	"lib/wxp/${_arch}" # WinXP min requirement
	"lib/wnet/${_arch}" # Win Server 2003 min requirement
	"lib/wlh/${_arch}" # Win Vista ("Long Horn") min requirement
	"lib/win7/${_arch}" # Win 7 min requirement
	)

# Might want to look close to the library first for the includes.
get_filename_component(_libdir "${WINHID_LIBRARY}" PATH)
get_filename_component(_basedir "${_libdir}/../../.." ABSOLUTE)

find_path(WINHID_INCLUDE_DIR
	NAMES
	hidsdi.h
	HINTS
	"${_basedir}"
	PATHS
	"${WINHID_ROOT_DIR}"
	PATH_SUFFIXES
	inc/api
	inc/w2k
	inc/wxp
	inc/wnet)

find_path(WINHID_CRT_INCLUDE_DIR # otherwise you get weird compile errors
	NAMES
	stdio.h
	HINTS
	"${_basedir}"
	PATHS
	"${WINHID_ROOT_DIR}"
	PATH_SUFFIXES
	inc/crt
	NO_DEFAULT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WinHID
	DEFAULT_MSG
	WINHID_LIBRARY
	WINHID_INCLUDE_DIR
	WINHID_CRT_INCLUDE_DIR)

if(WINHID_FOUND)
	set(_winreq "Unknown")
	if(WINHID_LIBRARY MATCHES "lib/w2k")
		set(_winreq "Windows 2000")
	elseif(WINHID_LIBRARY MATCHES "lib/wxp")
		set(_winreq "Windows XP")
	elseif(WINHID_LIBRARY MATCHES "lib/wnet")
		set(_winreq "Windows Server 2003")
	elseif(WINHID_LIBRARY MATCHES "lib/wlh")
		set(_winreq "Windows Vista")
	elseif(WINHID_LIBRARY MATCHES "lib/win7")
		set(_winreq "Windows 7")
	endif()
	if(NOT "${WINHID_MIN_WINDOWS_VER}" STREQUAL "${_winreq}")
		if(NOT WinHID_FIND_QUIETLY)
			message(STATUS "Linking against WINHID_LIBRARY will enforce this minimum version: ${_winreq}")
		endif()
		set(WINHID_MIN_WINDOWS_VER "${_winreq}" CACHE INTERNAL "" FORCE)
	endif()
	set(WINHID_LIBRARIES "${WINHID_LIBRARY}")
	set(WINHID_INCLUDE_DIRS "${WINHID_CRT_INCLUDE_DIR}" "${WINHID_INCLUDE_DIR}")
	mark_as_advanced(WINHID_ROOT_DIR)
endif()

mark_as_advanced(WINHID_INCLUDE_DIR
	WINHID_CRT_INCLUDE_DIR
	WINHID_LIBRARY)

repository: OSVR/eigen-kalman

repo_name: OSVR/eigen-kalman

extension: cmake


text:
DESCRIPTION = "QCOM Firmware for DragonBoard 845c"

LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSE.qcom.txt;md5=cbbe399f2c983ad51768f4561587f000"

SRC_URI = "https://releases.linaro.org/96boards/dragonboard845c/qualcomm/firmware/RB3_firmware_${PV}.zip \
           file://generate_board-2_json.sh"
SRC_URI[md5sum] = "ad69855a1275547b16d94a1b5405ac62"
SRC_URI[sha256sum] = "4289d2f2a7124b104d0274879e702aae9b1e50c42eec3747f8584c6744ef65e3"

PACKAGE_ARCH = "${MACHINE_ARCH}"
DEPENDS += "bash-native qca-swiss-army-knife-native"
inherit python3native

S = "${WORKDIR}"

do_compile() {
    # Build board-2.bin needed by WiFi
    mkdir -p bdf
    cp ./38-bdwlan_split/bdwlan*.* bdf
    bash generate_board-2_json.sh bdf board-2.json
    python3 "${STAGING_BINDIR_NATIVE}/ath10k-bdencoder" -c board-2.json -o board-2.bin
}

do_install() {
    install -d ${D}${nonarch_base_libdir}/firmware/
    install -d ${D}${nonarch_base_libdir}/firmware/qcom/sdm845

    install -m 0444 ./17-USB3-201-202-FW/K2026090.mem ${D}${nonarch_base_libdir}/firmware/
    install -m 0444 ./18-adreno-fw/a630_zap*.* ${D}${nonarch_base_libdir}/firmware/qcom/
    install -m 0444 ./20-adsp_split/firmware/adsp*.* ${D}${nonarch_base_libdir}/firmware/qcom/sdm845
    install -m 0444 ./21-cdsp_split/firmware/cdsp*.* ${D}${nonarch_base_libdir}/firmware/qcom/sdm845

    install -d ${D}${nonarch_base_libdir}/firmware/ath10k/WCN3990/hw1.0/
    install -m 0444 ./board-2.bin ${D}${nonarch_base_libdir}/firmware/ath10k/WCN3990/hw1.0/

    install -d ${D}${sysconfdir}/
    install -m 0644 LICENSE.qcom.txt ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE-${PN}
}

FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
INSANE_SKIP_${PN} += "arch"

repository: Mani-Sadhasivam/meta-qcom

repo_name: Mani-Sadhasivam/meta-qcom


text:
package ocr

import (
	"strings"
)

const (
	zero string = `
 _
| |
|_|
   `
	one string = `

  |
  |
   `
	two string = `
 _
 _|
|_
   `
	three string = `
 _
 _|
 _|
   `
	four string = `

|_|
  |
   `
	five string = `
 _
|_
 _|
   `
	six string = `
 _
|_
|_|
   `
	seven string = `
 _
  |
  |
   `
	eight string = `
 _
|_|
|_|
   `
	nine string = `
 _
|_|
 _|
   `
)

var digits = map[string]string{
	zero: "0", one: "1", two: "2", three: "3", four: "4", five: "5", six: "6", seven: "7", eight: "8", nine: "9",
}

func recognizeDigit(digit string) (string, bool) {
	d, ok := digits[digit]
	return d, ok
}

func getLineGroups(str string) [][]string {
	var lineGroups [][]string
	for i, line := range strings.Split(str, "\n") {
		if i%4 == 0 {
			lineGroups = append(lineGroups, []string{})
		}
		lineGroups[i/4] = append(lineGroups[i/4], line)
	}
	return lineGroups
}

func readLine(lines []string) []string {
	var chars []string
	for c := 0; c+3 <= len(lines[0]); c += 3 {
		char := ""
		for l := 0; l < 4; l++ {
			char += "\n" + lines[l][c:c+3]
		}
		chars = append(chars, char)
	}
	return chars
}

// Recognize reads an input string consisting of underscores, pipes, and space
// characters and returns the corresponding number.
func Recognize(input string) []string {
	var digits []string
	for i, line := range getLineGroups(input[1:]) {
		digits = append(digits, "")
		for _, digit := range readLine(line) {
			if d, ok := recognizeDigit(digit); ok {
				digits[i] += d
			} else {
				digits[i] += "?"
			}
		}
	}
	return digits
}

repository: aculclasure/code-journal

repo_name: aculclasure/code-journal


text:
# - FindSciG4engine: Module to find include directories and
#   libraries for G4engine.
#
# Module usage:
#   find_package(SciG4engine ...)
#
# This module will define the following variables:
#  HAVE_G4ENGINE, G4ENGINE_FOUND = Whether libraries and includes are found
#  G4engine_INCLUDE_DIRS       = Location of G4engine includes
#  G4engine_LIBRARY_DIRS       = Location of G4engine libraries
#  G4engine_LIBRARIES          = Required libraries

###########################################################
#
# Find module for G4engine installation
#
# $Id: FindSciG4engine.cmake 792 2015-04-17 14:07:44Z jrobcary $
#
# Copyright 2010-2015, Tech-X Corporation, Boulder, CO.
# See LICENSE file (EclipseLicense.txt) for conditions of use.
#
###########################################################

if (DEFINED G4ENGINE_DIR)
  message(STATUS "[FindSciG4engine.cmake] - G4ENGINE_DIR is ${G4ENGINE_DIR}")
endif ()

# We have a problem in SciFindPackage
# where if the executable has the same name as a directory
# scimake's find_program() will return the DIRECTORY instead
# of the executable on windows (as scimake is a windows program
# and the cygwin soft link just looks like a file).
SciFindPackage(
  PACKAGE G4engine
  INSTALL_DIR g4engine-sersh
  PROGRAMS g4engine
)

if (G4ENGINE_FOUND)
  message(STATUS "Found G4engine")
  set(HAVE_G4ENGINE 1 CACHE BOOL "Whether have G4engine")

  set(G4engine_FOUND_PROGRAM ${G4engine_g4engine})
# This can only happen if there is something wrong with SciFindPackage,
# and so a fatal error is appropriate.
  if (NOT G4engine_FOUND_PROGRAM)
    message(FATAL_ERROR "Neither G4engine executable was found?  Failing.")
  endif ()

  if (DEBUG_CMAKE)
    message(STATUS "Using path ${G4engine_FOUND_PROGRAM} to derive base G4engine directory.")
  endif ()

  get_filename_component(G4ENGINE_DIR ${G4engine_FOUND_PROGRAM} PATH)
  # get_filename_component(G4ENGINE_DIR ${G4ENGINE_DIR} PATH)
  get_filename_component(G4ENGINE_DIR ${G4ENGINE_DIR}/.. REALPATH)
  if (DEBUG_CMAKE)
    message(STATUS "G4ENGINE_DIR is ${G4ENGINE_DIR}")
  endif ()

  if (DEBUG_CMAKE)
    message("Trying to run executable ${G4engine_FOUND_PROGRAM} to determine G4engine version.")
  endif ()

# G4engine_VERSION is required by SciComposerBase.cmake to set the package
# installer name.  It is provided by executing "executable --version",
# and contains version number/revision number.
  include(${TXCMAKE_DIR}/TxEngFindVersion.cmake)
  TxEngFindVersion(${G4engine_FOUND_PROGRAM} EXE_VERSION EXE_REVISION)
  set(G4engine_VERSION ${EXE_VERSION})
  set(G4ENGINE_VERSION ${EXE_VERSION})
  set(G4engine_REVISION ${EXE_REVISION})
else ()
  message(STATUS "G4engine not found. Use -DG4ENGINE_DIR to specify the installation directory.")
  if (SciG4engine_FIND_REQUIRED)
    message(FATAL_ERROR "Failed.")
  endif ()
  set(G4engine_VERSION "G4engineNotFound")
  set(G4engine_REVISION "G4engineNotFound")
endif ()

repository: UKFELs/Puffin

repo_name: UKFELs/Puffin

gha_language: Fortran


text:
@inproceedings{stoehr+al.aistats23,
  title = {The Ordered Matrix {D}irichlet for State-Space Models},
  venue = {AISTATS},
  year = {2023},
  slides = {https://drive.google.com/file/d/17oqQRwyonvSGSudNXlJVYD2FHwUZPmhz/view?usp=share_link},
  code = {https://github.com/niklasstoehr/ordered-matrix-dirichlet},
  arXiv = {https://arxiv.org/abs/2212.04130},
  author = {Stoehr, Niklas and
	J. Radford, Benjamin and
	Cotterell, Ryan and
	Schein, Aaron},
  booktitle = {Proceedings of the 26th International Conference on Artificial Intelligence and Statistics},
  month = {April},
  publisher = {Society for Artificial Intelligence and Statistics},
  address = {Valencia, Spain},
  pages = {1888-1903},
  abstract = {Many dynamical systems in the real world are naturally described by latent states with intrinsic orderings, such as "ally", "neutral", and "enemy" relationships in international relations. These latent states manifest through countries' cooperative versus conflictual interactions over time. State-space models (SSMs) explicitly relate the dynamics of observed measurements to transitions in latent states. For discrete data, SSMs commonly do so through a state-to-action emission matrix and a state-to-state transition matrix. This paper introduces the Ordered Matrix Dirichlet (OMD) as a prior distribution over ordered stochastic matrices wherein the discrete distribution in the kth row stochastically dominates the (k+1)th, such that probability mass is shifted to the right when moving down rows. We illustrate the OMD prior within two SSMs: a hidden Markov model, and a novel dynamic Poisson Tucker decomposition model tailored to international relations data. We find that models built on the OMD recover interpretable ordered latent structure without forfeiting predictive performance. We suggest future applications to other domains where models with stochastic matrices are popular (e.g., topic modeling), and publish user-friendly code.},
  url = {https://arxiv.org/abs/2212.04130},
}

repository: rycolab/website

repo_name: rycolab/website

extension: bib


text:
#include "utils/loggingDevice.h"
#include "utils/rawAssert.h"

namespace safekiddo
{
namespace utils
{

bool checkLogLevel(LogLevelEnum level)
{
	LoggingDevice * ptr = LoggingDevice::getImpl();
	RAW_DASSERT(ptr != NULL, "logging system not initialized");
	return ptr && ptr->checkLoggingLevel(level);
}

void handleLogLine(LogLevelEnum level, char const * file, uint32_t line, char const * function, char const * msg)
{
	LoggingDevice * ptr = LoggingDevice::getImpl();
	RAW_DASSERT(ptr != NULL, "logging system not initialized");
	if (ptr)
	{
		ptr->writeLog(level, file, line, function, msg);
	}
}

void flushLogBuffers()
{
	LoggingDevice * ptr = LoggingDevice::getImpl();
	RAW_DASSERT(ptr != NULL, "logging system not initialized");
	if (ptr)
	{
		ptr->flush();
	}
}

} // utils
} // safekiddo

repository: securesonic/safekiddo-backend

repo_name: securesonic/safekiddo-backend

extension: cpp


text:
#GNU radio image

IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"

IMAGE_EXTRA_INSTALL ?= ""

ZZAPSPLASH = ' ${@base_contains("MACHINE_FEATURES", "screen", "psplash-zap", "",d)}'

DEPENDS = "task-base-extended \
           ${SPLASH} \
           ${ZZAPSPLASH} \
	   "

IMAGE_INSTALL = "task-base-extended \
	    ${IMAGE_EXTRA_INSTALL} \
	    ${SPLASH} \
	    ${ZZAPSPLASH} \
            oprofile \
            screen \
            ntp ntp-bin \
            make \
            nfs-utils-client \
            gnuradio gnuradio-examples \
	    "

export IMAGE_BASENAME = "gnuradio-image"
IMAGE_LINGUAS = ""

inherit image

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@article{Gautier:2018hu,
 author = {Gautier, Arnaud and Tebo, Alison G},
 journal = {BioEssays},
 month = {August},
 pages = {509--10},
 title = {Fluorogenic Protein-Based Strategies for Detection, Actuation, and Sensing},
 volume = {67},
 year = {2018}
}

repository: agtebo/academic-kickstart

repo_name: agtebo/academic-kickstart


text:
package http

import (
	"encoding/json"
	"net/http"
	"net/http/httptest"
	"testing"

	"io/ioutil"
	"time"

	"github.com/caalberts/localroast/types"
	"github.com/stretchr/testify/assert"
)

func TestNewServer(t *testing.T) {
	port := "8888"
	server := NewServer(port).(*server)
	assert.Equal(t, ":8888", server.Server.Addr)
}

func TestServer_Watch(t *testing.T) {
	server := &server{router: newRouter()}
	schemaChannel := make(chan []types.Schema)
	server.Watch(schemaChannel)

	t.Run("new server has empty router", func(t *testing.T) {
		req := httptest.NewRequest("GET", "/", nil)
		resp := httptest.NewRecorder()
		server.router.ServeHTTP(resp, req)
		assert.Equal(t, http.StatusNotImplemented, resp.Code)
	})

	t.Run("with updated schema", func(t *testing.T) {
		schemas := []types.Schema{
			{
				Method:   "GET",
				Path:     "/",
				Status:   200,
				Response: []byte(`{"success": true}`),
			},
			{
				Method:   "GET",
				Path:     "/users",
				Status:   200,
				Response: []byte(`{"success": true, "ids": [1, 2]}`),
			},
			{
				Method:   "POST",
				Path:     "/users",
				Status:   201,
				Response: []byte(`{"success": true, "id": 3}`),
			},
		}
		schemaChannel <- schemas
		time.Sleep(1 * time.Millisecond)

		type testData struct {
			Success bool   `json:"success"`
			ID      int    `json:"id"`
			IDs     []int  `json:"ids"`
			Message string `json:"message"`
		}

		var expected, actual testData
		for _, schema := range schemas {
			t.Run(schema.Method+schema.Path, func(t *testing.T) {
				req := httptest.NewRequest(schema.Method, schema.Path, nil)
				resp := httptest.NewRecorder()
				server.router.ServeHTTP(resp, req)

				assert.Equal(t, "*", resp.Header().Get("Access-Control-Allow-Origin"))
				assert.Equal(t, "application/json", resp.Header().Get("Content-Type"))
				assert.Equal(t, schema.Status, resp.Code)

				body := resp.Result().Body
				defer body.Close()
				json.NewDecoder(body).Decode(&actual)
				json.Unmarshal(schema.Response, &expected)
				assert.Equal(t, expected, actual)
			})
		}

		req := httptest.NewRequest(http.MethodGet, "/unknown", nil)
		resp := httptest.NewRecorder()
		server.router.ServeHTTP(resp, req)

		assert.Equal(t, http.StatusNotFound, resp.Code)
		body := resp.Result().Body
		defer body.Close()
		bodyBytes, _ := ioutil.ReadAll(body)
		assert.Equal(t, "404 page not found\n", string(bodyBytes))
	})
}

func TestPathParam(t *testing.T) {
	schema := types.Schema{
		Method:   "GET",
		Path:     "/users/:id",
		Status:   200,
		Response: []byte(`{"success": true}`),
	}

	router := newRouter()
	router.updateSchema([]types.Schema{schema})

	testPath := "/users/1"

	req := httptest.NewRequest(schema.Method, testPath, nil)
	resp := httptest.NewRecorder()
	router.ServeHTTP(resp, req)

	assert.Equal(t, schema.Status, resp.Code)
}

func TestPrettyJSON(t *testing.T) {
	schema := types.Schema{
		Method:   "GET",
		Path:     "/users",
		Status:   200,
		Response: []byte(`{"success": true}`),
	}
	router := newRouter()
	router.updateSchema([]types.Schema{schema})
	testPath := "/users?pretty"
	req := httptest.NewRequest(schema.Method, testPath, nil)
	resp := httptest.NewRecorder()
	router.ServeHTTP(resp, req)

	assert.Equal(t, schema.Status, resp.Code)
	assert.JSONEq(t, string(schema.Response), resp.Body.String())
}

repository: wuchunfu/localroast

repo_name: wuchunfu/localroast