Run It
Every instrument is mocked, so the example runs without hardware.
bash
git clone https://github.com/tofupilot/panelscd panelstofupilot run temperature-scannerThe procedure
procedure.yaml
name: Temperature Scannerversion: 1.0.0plugs: - key: scanner name: Temperature scanner python: plugs.scanner:TemperatureScannermain: - key: scan name: Charge and discharge python: phases.temperature_scanner:scan measurements: - key: max_temperature name: Highest temperature unit: "°C" validators: - operator: "<=" expected_value: 60 ui: panel: panels/scanner.htmlThe panel
panels/scanner.html
<div class="inst"><svg viewBox="0 0 320 210" role="img"><defs><linearGradient id="fp" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3a4048"/><stop offset="1" stop-color="#262b31"/></linearGradient><linearGradient id="win" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#000" stop-opacity=".55"/><stop offset=".14" stop-color="#000" stop-opacity="0"/></linearGradient></defs><rect x="1" y="1" width="318" height="208" rx="10" fill="url(#fp)" stroke="#14171b" stroke-width="2"/><circle cx="12" cy="12" r="3.2" fill="#1b1f24" stroke="#14171b"/><circle cx="308" cy="12" r="3.2" fill="#1b1f24" stroke="#14171b"/><circle cx="12" cy="198" r="3.2" fill="#1b1f24" stroke="#14171b"/><circle cx="308" cy="198" r="3.2" fill="#1b1f24" stroke="#14171b"/><defs><linearGradient id="bl" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#dfe9f1"/><stop offset="1" stop-color="#c9d8e4"/></linearGradient></defs><text x="18" y="24" text-anchor="start" style="font: 700 7.5px system-ui, sans-serif; letter-spacing: .14em; fill: #c9cfd5">TEMPERATURE SCANNER</text><text x="302" y="24" text-anchor="end" style="font: 600 7px ui-monospace, Menlo, monospace; letter-spacing: .04em; fill: #9aa1a8">8 CH · TYPE K</text><rect x="16" y="32" width="288" height="130" rx="6" fill="#0c0e10"/><rect x="20" y="36" width="280" height="122" rx="3" fill="url(#bl)"/><path d="M160 40V154" stroke="#a9bccb"/><g class="blcd"><text x="26" y="51" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH1</text><text x="26" y="60" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">CELL 1</text><g class="d7" data-bind="ui.t1_0" transform="translate(66.0 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t1_1" transform="translate(79.3 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t1_2" transform="translate(92.5 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(89.1 42.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="134" y="51" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="134" y="61" text-anchor="start" data-bind="ui.a1" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="164" y="51" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH2</text><text x="164" y="60" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">CELL 4</text><g class="d7" data-bind="ui.t2_0" transform="translate(204.0 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t2_1" transform="translate(217.3 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t2_2" transform="translate(230.5 42.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(227.1 42.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="272" y="51" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="272" y="61" text-anchor="start" data-bind="ui.a2" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="26" y="81" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH3</text><text x="26" y="90" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">CELL 7</text><g class="d7" data-bind="ui.t3_0" transform="translate(66.0 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t3_1" transform="translate(79.3 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t3_2" transform="translate(92.5 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(89.1 72.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="134" y="81" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="134" y="91" text-anchor="start" data-bind="ui.a3" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="164" y="81" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH4</text><text x="164" y="90" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">BUSBAR</text><g class="d7" data-bind="ui.t4_0" transform="translate(204.0 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t4_1" transform="translate(217.3 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t4_2" transform="translate(230.5 72.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(227.1 72.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="272" y="81" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="272" y="91" text-anchor="start" data-bind="ui.a4" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="26" y="111" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH5</text><text x="26" y="120" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">CELL 10</text><g class="d7" data-bind="ui.t5_0" transform="translate(66.0 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t5_1" transform="translate(79.3 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t5_2" transform="translate(92.5 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(89.1 102.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="134" y="111" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="134" y="121" text-anchor="start" data-bind="ui.a5" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="164" y="111" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH6</text><text x="164" y="120" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">CELL 13</text><g class="d7" data-bind="ui.t6_0" transform="translate(204.0 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t6_1" transform="translate(217.3 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t6_2" transform="translate(230.5 102.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(227.1 102.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="272" y="111" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="272" y="121" text-anchor="start" data-bind="ui.a6" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="26" y="141" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH7</text><text x="26" y="150" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">INLET</text><g class="d7" data-bind="ui.t7_0" transform="translate(66.0 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t7_1" transform="translate(79.3 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t7_2" transform="translate(92.5 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(89.1 132.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="134" y="141" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="134" y="151" text-anchor="start" data-bind="ui.a7" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text><text x="164" y="141" text-anchor="start" style="font: 700 6.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26">CH8</text><text x="164" y="150" text-anchor="start" style="font: 600 5.5px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #4d6070">OUTLET</text><g class="d7" data-bind="ui.t8_0" transform="translate(204.0 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t8_1" transform="translate(217.3 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="d7" data-bind="ui.t8_2" transform="translate(230.5 132.0) skewX(-7)"><rect class="sa" x="1.4" y="0.0" width="6.3" height="2.0" rx="1.0"/><rect class="sd" x="1.4" y="15.0" width="6.3" height="2.0" rx="1.0"/><rect class="sg" x="1.4" y="7.5" width="6.3" height="2.0" rx="1.0"/><rect class="sf" x="0.0" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="se" x="0.0" y="8.9" width="2.0" height="6.6" rx="1.0"/><rect class="sb" x="7.1" y="1.4" width="2.0" height="6.6" rx="1.0"/><rect class="sc" x="7.1" y="8.9" width="2.0" height="6.6" rx="1.0"/></g><g class="dp on" transform="translate(227.1 132.0) skewX(-7)"><rect x="0" y="15.0" width="2.0" height="2.0" rx="0.7"/></g><text x="272" y="141" text-anchor="start" style="font: 700 7px system-ui, sans-serif; letter-spacing: .14em; fill: #0d1a26">°C</text><text class="al" x="272" y="151" text-anchor="start" data-bind="ui.a8" style="font: 800 6px ui-monospace, Menlo, monospace; letter-spacing: 0; fill: #0d1a26"></text></g><text x="18" y="182" text-anchor="start" data-bind="ui.mode" style="font: 700 7px ui-monospace, Menlo, monospace; letter-spacing: .1em; fill: #9aa1a8">LIMIT 45 °C · CHARGE</text><text x="302" y="182" text-anchor="end" style="font: 600 7px ui-monospace, Menlo, monospace; letter-spacing: .04em; fill: #9aa1a8">SCAN 1 s</text></svg></div><style> .inst { width: min(560px, 100%); margin: 0 auto; } .inst svg { display: block; width: 100%; height: auto; } .inst text { font-family: system-ui, sans-serif; } .dp rect { fill: var(--off); } .dp.on rect, .dp[data-value=true] rect { fill: var(--on); } .led circle { fill: #2a2f35; transition: fill .15s; } .led[data-value=true] circle { fill: var(--led, #38e07a); } .ann text { fill: var(--off); transition: fill .15s; } .ann[data-value=true] text { fill: var(--on); } .d7 rect { fill: var(--off); transition: fill .08s; } .d7[data-value="0"] :is(.sa, .sb, .sc, .sd, .se, .sf) { fill: var(--on); } .d7[data-value="1"] :is(.sb, .sc) { fill: var(--on); } .d7[data-value="2"] :is(.sa, .sb, .sd, .se, .sg) { fill: var(--on); } .d7[data-value="3"] :is(.sa, .sb, .sc, .sd, .sg) { fill: var(--on); } .d7[data-value="4"] :is(.sb, .sc, .sf, .sg) { fill: var(--on); } .d7[data-value="5"] :is(.sa, .sc, .sd, .sf, .sg) { fill: var(--on); } .d7[data-value="6"] :is(.sa, .sc, .sd, .se, .sf, .sg) { fill: var(--on); } .d7[data-value="7"] :is(.sa, .sb, .sc) { fill: var(--on); } .d7[data-value="8"] :is(.sa, .sb, .sc, .sd, .se, .sf, .sg) { fill: var(--on); } .d7[data-value="9"] :is(.sa, .sb, .sc, .sd, .sf, .sg) { fill: var(--on); } .d7[data-value="-"] :is(.sg) { fill: var(--on); } .d7[data-value="E"] :is(.sa, .sd, .se, .sf, .sg) { fill: var(--on); } .d7[data-value="U"] :is(.sb, .sc, .sd, .se, .sf) { fill: var(--on); } .d7[data-value="r"] :is(.se, .sg) { fill: var(--on); } .blcd { --on: #0d1a26; --off: #c7d6e2; } .al[data-value=HI] { fill: #b26a00 !important; } .al[data-value=ALM] { fill: #c62828 !important; }</style>The phase
phases/temperature_scanner.py
"""Scans eight thermocouples on the pack while it charges and discharges.`ui.t1_*` to `ui.t8_*` drive each channel's digits; `ui.a1` to `ui.a8` show HIor ALM against the step's limit: 45 °C charging, 60 °C discharging, HI 5 °Cbefore. The run records the highest temperature."""import timedef show(ui, prefix, text): """One 7-segment glyph per character, decimal points left to the panel.""" for k, ch in enumerate(c for c in text if c != "."): setattr(ui, f"{prefix}{k}", "_" if ch == " " else ch)LIMITS = {True: (40, 45), False: (55, 60)}def scan(ui, measurements, scanner): peak = 0.0 for _ in range(scanner.length()): temps, charging = scanner.read() warn, alarm = LIMITS[charging] for k, c in enumerate(temps, start=1): show(ui, f"t{k}_", f"{c:4.1f}") setattr(ui, f"a{k}", "ALM" if c > alarm else "HI" if c > warn else "") ui.mode = f"LIMIT {alarm} °C · {'CHARGE' if charging else 'DISCHARGE'}" peak = max(peak, *temps) time.sleep(0.1) measurements.max_temperature = round(peak, 1) time.sleep(1.5)The mocked instrument
plugs/scanner.py
"""Mock instrument replaying a simulated 13S NMC, 50 Ah pack through a CC-CVcharge, a rest and a 75 A discharge."""import mathCELL_OFFSETS = [-0.42, 0.18, 0.05, -0.12, 0.5, -0.3, 0.1, 0.32, -0.05, -0.5, 0.24, 0.0, -0.2]SENSORS = [("CELL 1", -1.5), ("CELL 4", 0.0), ("CELL 7", 1.2), ("BUSBAR", 4.6), ("CELL 10", -0.8), ("CELL 13", 0.4), ("INLET", -2.0), ("OUTLET", 0.9)]STEPS = [("CC", 0, 18), ("CV", 18, 28), ("REST", 28, 33), ("DSG", 33, 53), ("REST", 53, 60)]CYCLE_S, DT = 60, 0.3def _lerp(a, b, x): return a + (b - a) * min(1.0, max(0.0, x))def _ease(x): return 0.5 - 0.5 * math.cos(math.pi * min(1.0, max(0.0, x)))def _wob(t, k): return math.sin(t * k) * 0.5 + math.sin(t * k * 2.3) * 0.25def pack_state(t): """The simulated 13S NMC, 50 Ah pack at cycle time t (s): CC 50 A to 54.6 V, CV to 2.5 A, rest, 75 A discharge with a current spike, rest.""" bleed = False if t < 18: x = t / 18 soc, i = _lerp(20, 78, x), 50 + _wob(t, 3) * 0.4 v, temp, delta = 46.2 + 8.4 * x ** 1.6, _lerp(24, 31, x), _lerp(8, 14, x) elif t < 28: x = (t - 18) / 10 soc, i = _lerp(78, 99, _ease(x)), 2.5 + 47.5 * math.exp(-3.2 * x) v, temp = 54.6, _lerp(31, 33, x) delta = _lerp(14, 26, _ease(x * 1.4)) - _lerp(0, 8, (x - 0.6) / 0.4) bleed = True elif t < 33: x = (t - 28) / 5 soc, i, v = 99, 0.0, _lerp(54.6, 54.0, _ease(x)) temp, delta, bleed = _lerp(33, 30, x), _lerp(18, 10, x), x < 0.6 elif t < 53: x = (t - 33) / 20 spike = -17 * math.sin(math.pi * (t - 38) / 2.5) if 38 < t < 40.5 else 0.0 soc, i = _lerp(99, 22, x), -75 + spike + _wob(t, 2.7) * 0.6 v = 53.4 - 5.2 * x - 1.6 * x ** 6 + spike * 0.03 temp, delta = _lerp(30, 50, x ** 0.9), _lerp(10, 58, x ** 2.2) else: x = (t - 53) / 7 soc, i, v = 22, 0.0, _lerp(46.6, 47.4, _ease(x)) temp, delta = _lerp(50, 47, x), _lerp(58, 44, x) step = next((name for name, a, b in STEPS if a <= t < b), "REST") temps = [temp + o * (0.4 + (temp - 24) / 30) + _wob(t + k, 1.1) * 0.15 for k, (_, o) in enumerate(SENSORS)] cells = [v / 13 + o * delta / 1000 for o in CELL_OFFSETS] balancing = [bleed and o > 0.15 for o in CELL_OFFSETS] acir = 9.6 * (1 - 0.006 * (temp - 25)) + 0.02 * math.sin(t * 2.3) return {"step": step, "soc": soc, "voltage": v, "current": i, "temperatures": temps, "cells": cells, "balancing": balancing, "acir_mohm": acir}class _Replay: def __init__(self): self.t = 0.0 def length(self): return int(CYCLE_S / DT) def _next(self): state = pack_state(self.t) self.t += DT return stateclass TemperatureScanner(_Replay): """Mock 8-channel type K thermocouple scanner. Replace it with your scanner's driver.""" def read(self): """[temperatures in °C by channel, whether the cycler is charging]""" s = self._next() return [s["temperatures"], s["current"] > 0.05]