diff --git a/templates/common.css b/templates/common.css index 3c0b31e..246c600 100644 --- a/templates/common.css +++ b/templates/common.css @@ -27,7 +27,7 @@ box-sizing: border-box; } - .top { + .access { padding: 0.75rem 1rem; text-align: center; } diff --git a/templates/common.html b/templates/common.html index 14df7bd..079675f 100644 --- a/templates/common.html +++ b/templates/common.html @@ -12,19 +12,20 @@
-
- view only - ACTIVE -
{% include svg %}
-
- +
+ view only + ACTIVE +
+
+ +
+
+
+
-
-
-
diff --git a/templates/dil5.svg b/templates/dil5.svg index a0cb0bc..3002c4b 100644 --- a/templates/dil5.svg +++ b/templates/dil5.svg @@ -1,1353 +1,1118 @@ + + - - - - - - - - - image/svg+xml - - - - - - + id="dil5" + inkscape:version="1.4.3 (0d15f75, 2025-12-25)" + sodipodi:docname="dil5.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + - - - - DU - - - - P1 - - - - P2 - - - - P4 - - - - P5 - - - - LN2Trap - - - - - dump - - + inkscape:groupmode="layer" + id="layer_pipes" + inkscape:label="Pipes" + inkscape:highlight-color="#f3ca21" /> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:#ffffff;fill-opacity:0;stroke:#cccccc;stroke-width:0.5;stroke-dasharray:none" + d="M 171.76267,75.730569 V 35.253622 H 32.262716 v 41.221922" + id="path2" /> - - - - + style="fill:#ffffff;fill-opacity:0;stroke:#cccccc;stroke-width:0.5;stroke-dasharray:none" + d="M 141.76266,35.275544 V 60.891486 H 62.262726 V 35.021922" + id="path3" /> + + + + + + + + + + + + + + + + * mbar + * mbar + * mbar + * mbar + * mbar + V4 - - P3 - - MV8 - MV12 - MV10 - MV11 - MV9 - MV13 - MV14 - MV1 - MV2 - MV3a - MV3b - MVB - GV1 - GV2 - V9 - V2 - V5 - V4 - V1 - - - - - - - - - - + id="V4:-click"> + + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.299;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 49.658108,216.07787 a 5.9181489,5.9068489 0 0 0 4.073313,-1.65826 l -1.26311,-1.27566 -2.92562,-2.95427 -2.903686,2.9865 -1.171002,1.20432 a 5.9181489,5.9068489 0 0 0 4.190105,1.69737 z m -0.115417,-5.88819 2.908682,-2.98117 1.266698,-1.29817 a 5.9181489,5.9068489 0 0 0 -4.136452,-1.64573 5.9181489,5.9068489 0 0 0 -4.166954,1.75045 l 1.206955,1.22074 z" + inkscape:label="V4:-state" /> - + id="MV3b" + transform="translate(-55.46875)"> - - - - - - - - - - - - - + id="MV3b:-click-state" + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.340699;stroke-dasharray:none;stroke-opacity:1" + d="m 123.97312,39.720524 0.008,-4.28929 0.008,-4.28923 2.81653,2.15368 2.81653,2.15369 -2.82462,2.13556 z m 11.29849,-8.54878 -0.005,4.28922 -0.005,4.28925 -2.81952,-2.15043 -2.81952,-2.15041 2.82462,-2.13882 z" + inkscape:label="MV3b" /> C + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#ebebeb;fill-opacity:0;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="122.76003" + y="28.58783" + id="text24-0-9">MV3b - + id="MVB" + transform="translate(0.85625623,-1.2571558)"> + id="MVB:-click-state" + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.340699;stroke-dasharray:none;stroke-opacity:1" + d="m 95.156407,66.072733 0.008,-4.28929 0.008,-4.28923 2.81653,2.15368 2.816533,2.15369 -2.824623,2.13556 z m 11.298493,-8.54878 -0.005,4.28922 -0.005,4.28925 -2.81952,-2.15043 -2.81952,-2.15041 2.82462,-2.13882 z" + inkscape:label="MVB" /> F + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#ebebeb;fill-opacity:0;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="170.56555" + y="47.927483" + id="text24-0-28" + transform="translate(-75.727732,7.3442224)">MVB + + + + MV3a + + + + GV1 + + + + GV2 + + + + MV8 + + + + MV10 + + + + MV9 + + + + MV2 - - - - - - - - - - - - - + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.340699;stroke-dasharray:none;stroke-opacity:1" + d="m 36.576876,94.042494 -4.28929,0.008 -4.28923,0.008 2.15368,2.81653 2.15369,2.81653 2.13556,-2.82462 z m -8.54878,11.298486 4.28922,-0.005 4.28925,-0.005 -2.15043,-2.81952 -2.15041,-2.819516 -2.13882,2.824616 z" + inkscape:label="MV1" /> * mbar + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#ebebeb;fill-opacity:0;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="15.473927" + y="102.02316" + id="text24-0-00">MV1 + * mbar - * mbar - * mbar - * mbar - speed: * Hz - current: * % - - - + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#ebebeb;fill-opacity:0;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="151.25467" + y="125.9547" + id="text24-0-00-8">MV12 + + reset - + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="60.767754" + y="67.112854" + id="text42">LN2trap + + + + dilutionunit + + + + dump + + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.354104;stroke-miterlimit:4;stroke-dasharray:none" + id="path8389-7-2-3" + cx="87.197624" + cy="225.67656" + r="5.822948" /> + compressed + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#ebebeb;fill-opacity:0;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="73.142174" + y="227.15105" + id="text24-6">P1 + + + + P2 + + + + + P3 + + + + + P4 + + + + + P5 + air + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;font-family:Arial;-inkscape-font-specification:Arial;writing-mode:lr-tb;direction:ltr;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + x="69.529228" + y="255.2404" + id="text31-3-6">V5 + + + + + speed: * Hz + current: * % + + + + turbo + + + forepump + + compressor + + + + V9 + + + + + + MV11 + + + + + V1 + + + + + V2 + + MV13 + + MV14 + + compressedair + + + + + + + + + + reset + + + + + + + + + + + + + + + + + + + diff --git a/templates/secop.js b/templates/secop.js index 3ed2957..d105cc9 100644 --- a/templates/secop.js +++ b/templates/secop.js @@ -9,7 +9,10 @@ var changeFuncs = {}; var updateValues = {}; function formatValue(value, prec) { - return Number(value.toPrecision(prec)).toString(); + if (Math.abs(value) >= 0.1 || value == 0) { + return Number(value.toPrecision(prec)).toString(); + } + return Number(value.toPrecision(prec)).toExponential(); } function handle_describing(action, modpar, data) { @@ -23,13 +26,13 @@ function handle_describing(action, modpar, data) { const elems = document.querySelectorAll("[id^='" + mod + ":']"); let stateElement = null; let clickElement = null; + console.log('LOOK', mod); elems.forEach(elem => { let [parmod, ...func] = elem.id.split('-'); const [mod, param] = parmod.split(':'); - // console.log(mod, param, func); if (func.includes("click")) { clickElement = elem; - console.log(mod, param, func, elem); + // console.log(mod, param, func, elem); addClickListener(elem, mod, toggleTarget); } if (func.includes("fault")) { @@ -39,13 +42,13 @@ function handle_describing(action, modpar, data) { } if (func.includes("state")) { stateElement = elem; + console.log(mod, param, func, elem); changeFuncs[mod + ":" + (param || 'value')] = function (value) { changeFill(elem, value); } } if (func.includes("text")) { const pat = elem.textContent; - console.log('X', elem) changeFuncs[mod + ":" + (param || 'value')] = function (value) { let [repl, dot, fix] = pat.match(/\*(\.)?(\d)?/); if (dot) { @@ -54,11 +57,11 @@ function handle_describing(action, modpar, data) { formatted = formatValue(value, fix || 5); } elem.textContent = pat.replace(repl, formatted); - console.log('Y', elem) + // console.log('Y', mod, param, elem.textContent) } } if (func.includes("command")) { - console.log(func, mod, param); + // console.log(func, mod, param); addClickListener(elem, mod + ":" + param, sendCommand); } }) @@ -126,6 +129,7 @@ function updateState(state) { function changeFill(element, state) { // stateElement = element.stateElement || element; element.state = state; + console.log(state, element.id); if (state in colors) { element.style.fill = colors[state]; } else {