Added loggin to advanced-reactor. Currently broken for some reason?
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
<script src="/advanced-reactor/menu.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType("advanced-reactor", {
|
||||
category: "WWTP",
|
||||
@@ -34,6 +36,16 @@
|
||||
return this.name || "advanced-reactor";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
// wait for the menu scripts to load
|
||||
const waitForMenuData = () => {
|
||||
if (window.EVOLV?.nodes?.['advanced-reactor']?.initEditor) {
|
||||
window.EVOLV.nodes['advanced-reactor'].initEditor(this);
|
||||
} else {
|
||||
setTimeout(waitForMenuData, 50);
|
||||
}
|
||||
};
|
||||
waitForMenuData();
|
||||
|
||||
$("#node-input-volume").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
@@ -90,6 +102,11 @@
|
||||
}
|
||||
},
|
||||
oneditsave: function() {
|
||||
// save logger fields
|
||||
if (window.EVOLV?.nodes?.['advanced-reactor']?.loggerMenu?.saveEditor) {
|
||||
window.EVOLV.nodes['advanced-reactor'].loggerMenu.saveEditor(this);
|
||||
}
|
||||
|
||||
let volume = parseFloat($("#node-input-volume").typedInput("value"));
|
||||
if (isNaN(volume) || volume <= 0) {
|
||||
RED.notify("Fluid volume not set correctly", {type: "error"});
|
||||
@@ -194,6 +211,10 @@
|
||||
<label for="node-input-X_TS_init"><i class="fa fa-tag"></i> Initial total suspended solids [g TSS m-3]</label>
|
||||
<input type="text" id="node-input-X_TS_init" class="concentrations">
|
||||
</div>
|
||||
|
||||
<!-- Logger fields injected here -->
|
||||
<div id="logger-fields-placeholder"></div>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="advanced-reactor">
|
||||
|
||||
Reference in New Issue
Block a user