58 lines
2.0 KiB
HTML
58 lines
2.0 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType("recirculation-pump", {
|
|
category: "WWTP",
|
|
color: "#e4a363",
|
|
defaults: {
|
|
name: { value: "" },
|
|
F2: { value: 0, required: true },
|
|
inlet: { value: 1, required: true }
|
|
},
|
|
inputs: 1,
|
|
outputs: 2,
|
|
outputLabels: ["Main effluent", "Recirculation effluent"],
|
|
icon: "font-awesome/fa-random",
|
|
label: function() {
|
|
return this.name || "Recirculation pump";
|
|
},
|
|
oneditprepare: function() {
|
|
$("#node-input-F2").typedInput({
|
|
type:"num",
|
|
types:["num"]
|
|
});
|
|
$("#node-input-inlet").typedInput({
|
|
type:"num",
|
|
types:["num"]
|
|
});
|
|
},
|
|
oneditsave: function() {
|
|
let debit = parseFloat($("#node-input-F2").typedInput("value"));
|
|
if (isNaN(debit) || debit < 0) {
|
|
RED.notify("Debit is not set correctly", {type: "error"});
|
|
}
|
|
let inlet = parseInt($("#node-input-n_inlets").typedInput("value"));
|
|
if (inlet < 1) {
|
|
RED.notify("Number of inlets not set correctly", {type: "error"});
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="recirculation-pump">
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-F2"><i class="fa fa-tag"></i> Recirculation debit [m3 s-1]</label>
|
|
<input type="text" id="node-input-F2" placeholder="m3 s-1">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-inlet"><i class="fa fa-tag"></i> Assigned inlet recirculation</label>
|
|
<input type="text" id="node-input-inlet" placeholder="#">
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="recirculation-pump">
|
|
<p>Recirculation-pump for splitting streams</p>
|
|
</script>
|