updated pumping station to match stack

This commit is contained in:
znetsixe
2025-10-14 13:51:32 +02:00
parent fa30be5e2d
commit d94d5874bc
4 changed files with 29 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
{ {
"name": "pumpingStation", "name": "pumpingstation",
"version": "1.0.0", "version": "1.0.0",
"description": "Control module", "description": "Control module",
"main": "pumpingStation.js", "main": "pumpingStation.js",
@@ -11,7 +11,7 @@
"url": "https://gitea.centraal.wbd-rd.nl/RnD/pumpingStation.git" "url": "https://gitea.centraal.wbd-rd.nl/RnD/pumpingStation.git"
}, },
"keywords": [ "keywords": [
"pumpingStation", "pumpingstation",
"node-red", "node-red",
"recipient", "recipient",
"water" "water"
@@ -23,7 +23,7 @@
}, },
"node-red": { "node-red": {
"nodes": { "nodes": {
"pumpingStation": "pumpingStation.js" "pumpingstation": "pumpingStation.js"
} }
} }
} }

View File

@@ -1,11 +1,20 @@
<!--
| S88-niveau | Primair (blokkleur) | Tekstkleur |
| ---------------------- | ------------------- | ---------- |
| **Area** | `#0f52a5` | wit |
| **Process Cell** | `#0c99d9` | wit |
| **Unit** | `#50a8d9` | zwart |
| **Equipment (Module)** | `#86bbdd` | zwart |
| **Control Module** | `#a9daee` | zwart |
-->
<script src="/pumpingStation/menu.js"></script> <!-- Load the menu script for dynamic dropdowns --> <script src="/pumpingStation/menu.js"></script> <!-- Load the menu script for dynamic dropdowns -->
<script src="/pumpingStation/configData.js"></script> <!-- Load the config script for node information --> <script src="/pumpingStation/configData.js"></script> <!-- Load the config script for node information -->
<script>//test <script>//test
RED.nodes.registerType("pumpingStation", { RED.nodes.registerType("pumpingStation", {
category: "EVOLV", category: "EVOLV",
color: "#e4a363", // color for the node based on the S88 schema color: "#0c99d9", // color for the node based on the S88 schema
defaults: { defaults: {
// Define specific properties // Define specific properties
@@ -45,16 +54,16 @@
outputs: 3, outputs: 3,
inputLabels: ["Input"], inputLabels: ["Input"],
outputLabels: ["process", "dbase", "parent"], outputLabels: ["process", "dbase", "parent"],
icon: "font-awesome/fa-tachometer", icon: "font-awesome/fa-tint",
label: function () { label: function () {
return this.positionIcon + " " + this.assetType || "Measurement"; return this.positionIcon + " " + this.assetType || "pumpingStation";
}, },
oneditprepare: function() { oneditprepare: function() {
const waitForMenuData = () => { const waitForMenuData = () => {
if (window.EVOLV?.nodes?.measurement?.initEditor) { if (window.EVOLV?.nodes?.pumpingStation?.initEditor) {
window.EVOLV.nodes.measurement.initEditor(this); window.EVOLV.nodes.pumpingStation.initEditor(this);
} else { } else {
setTimeout(waitForMenuData, 50); setTimeout(waitForMenuData, 50);
} }
@@ -65,7 +74,7 @@
// THIS IS NODE SPECIFIC --------------- Initialize the dropdowns and other specific UI elements -------------- this should be derived from the config in the future (make config based menu) // THIS IS NODE SPECIFIC --------------- Initialize the dropdowns and other specific UI elements -------------- this should be derived from the config in the future (make config based menu)
// Populate smoothing methods dropdown // Populate smoothing methods dropdown
const smoothMethodSelect = document.getElementById('node-input-smooth_method'); const smoothMethodSelect = document.getElementById('node-input-smooth_method');
const options = window.EVOLV?.nodes?.measurement?.config?.smoothing?.smoothMethod?.rules?.values || []; const options = window.EVOLV?.nodes?.pumpingStation?.config?.smoothing?.smoothMethod?.rules?.values || [];
// Clear existing options // Clear existing options
smoothMethodSelect.innerHTML = ''; smoothMethodSelect.innerHTML = '';
@@ -111,18 +120,18 @@
const node = this; const node = this;
// Validate asset properties using the asset menu // Validate asset properties using the asset menu
if (window.EVOLV?.nodes?.measurement?.assetMenu?.saveEditor) { if (window.EVOLV?.nodes?.pumpingStation?.assetMenu?.saveEditor) {
success = window.EVOLV.nodes.measurement.assetMenu.saveEditor(this); success = window.EVOLV.nodes.pumpingStation.assetMenu.saveEditor(this);
} }
// Validate logger properties using the logger menu // Validate logger properties using the logger menu
if (window.EVOLV?.nodes?.measurement?.loggerMenu?.saveEditor) { if (window.EVOLV?.nodes?.pumpingStation?.loggerMenu?.saveEditor) {
success = window.EVOLV.nodes.measurement.loggerMenu.saveEditor(node); success = window.EVOLV.nodes.pumpingStation.loggerMenu.saveEditor(node);
} }
// save position field // save position field
if (window.EVOLV?.nodes?.measurement?.positionMenu?.saveEditor) { if (window.EVOLV?.nodes?.pumpingStation?.positionMenu?.saveEditor) {
window.EVOLV.nodes.measurement.positionMenu.saveEditor(this); window.EVOLV.nodes.pumpingStation.positionMenu.saveEditor(this);
} }
// Save basic properties // Save basic properties
@@ -150,7 +159,7 @@
<!-- Main UI --> <!-- Main UI -->
<script type="text/html" data-template-name="measurement"> <script type="text/html" data-template-name="pumpingStation">
<!-- Scaling Checkbox --> <!-- Scaling Checkbox -->
<div class="form-row"> <div class="form-row">
@@ -221,21 +230,7 @@
</script> </script>
<script type="text/html" data-help-name="measurement"> <script type="text/html" data-help-name="pumpingStation">
<p><b>Measurement Node</b>: Scales, smooths, and simulates measurement data.</p>
<p>Use this node to scale, smooth, and simulate measurement data. The node can be configured to scale input data to a specified range, smooth the data using a variety of methods, and simulate data for testing purposes.</p>
<li><b>Supplier:</b> Select a supplier to populate machine options.</li>
<li><b>SubType:</b> Select a subtype if applicable to further categorize the asset.</li>
<li><b>Model:</b> Define the specific model for more granular asset configuration.</li>
<li><b>Unit:</b> Assign a unit to standardize measurements or operations.</li>
<li><b>Scaling:</b> Enable or disable input scaling. When enabled, you must provide the source min and max values.</li>
<li><b>Source Min/Max:</b> Define the minimum and maximum values for the input range when scaling is enabled.</li>
<li><b>Input Offset:</b> Specify an offset value to be added to the input measurement.</li>
<li><b>Process Min/Max:</b> Define the minimum and maximum values for the output range after processing.</li>
<li><b>Simulator:</b> Activate internal simulation for testing purposes.</li>
<li><b>Smoothing:</b> Select a smoothing method to apply to the measurement data.</li>
<li><b>Window:</b> Define the number of samples to use for smoothing.</li>
<li><b>Enable Log:</b> Enable or disable logging for this node.</li>
<li><b>Log Level:</b> Select the log level (Info, Debug, Warn, Error) for logging messages.</li>
</script> </script>

View File

@@ -1,9 +1,4 @@
/**
* basin.class.js
*
* Encapsulates all node logic in a reusable class. In future updates we can split this into multiple generic classes and use the config to specifiy which ones to use.
* This allows us to keep the Node-RED node clean and focused on wiring up the UI and event handlers.
*/
const { outputUtils, configManager } = require('generalFunctions'); const { outputUtils, configManager } = require('generalFunctions');
const Specific = require("./specificClass"); const Specific = require("./specificClass");

View File

@@ -139,7 +139,7 @@ class pumpingStation {
} }
} }
module.exports = Basin; module.exports = pumpingStation;
/* /*