Add number of inlets input handling to advanced-reactor node

This commit is contained in:
2025-06-16 14:01:19 +02:00
parent ded9c55dc4
commit d0f8ada144
3 changed files with 32 additions and 19 deletions

View File

@@ -5,6 +5,7 @@
defaults: {
name: { value: "" },
volume: { value: 0., required: true},
n_inlets: { value: 1, required: true},
S_O_init: { value: 0., required: true },
S_I_init: { value: 30., required: true },
S_S_init: { value: 100., required: true },
@@ -31,6 +32,10 @@
type:"num",
types:["num"]
});
$("#node-input-n_inlets").typedInput({
type:"num",
types:["num"]
});
$(".concentrations").typedInput({
type:"num",
types:["num"]
@@ -41,6 +46,10 @@
if (isNaN(volume) || volume <= 0) {
RED.notify("Fluid volume not set correctly", {type: "error"});
}
let n_inlets = parseInt($("#node-input-n_inlets").typedInput("value"));
if (isNaN(n_inlets) || n_inlets < 1) {
RED.notify("Number of inlets not set correctly", {type: "error"});
}
}
});
</script>
@@ -55,6 +64,10 @@
<label for="node-input-volume"><i class="fa fa-tag"></i> Fluid volume [m3]</label>
<input type="text" id="node-input-volume" placeholder="m3">
</div>
<div class="form-row">
<label for="node-input-n_inlets"><i class="fa fa-tag"></i> Number of inlets</label>
<input type="text" id="node-input-n_inlets" placeholder="#">
</div>
<h2> Dissolved components </h2>
<div class="form-row">
<label for="node-input-S_O_init"><i class="fa fa-tag"></i> Initial dissolved oxygen [g O2 m-3]</label>