forked from RnD/pumpingStation
updated pumping station to match stack
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "pumpingStation",
|
||||
"name": "pumpingstation",
|
||||
"version": "1.0.0",
|
||||
"description": "Control module",
|
||||
"main": "pumpingStation.js",
|
||||
@@ -11,7 +11,7 @@
|
||||
"url": "https://gitea.centraal.wbd-rd.nl/RnD/pumpingStation.git"
|
||||
},
|
||||
"keywords": [
|
||||
"pumpingStation",
|
||||
"pumpingstation",
|
||||
"node-red",
|
||||
"recipient",
|
||||
"water"
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"node-red": {
|
||||
"nodes": {
|
||||
"pumpingStation": "pumpingStation.js"
|
||||
"pumpingstation": "pumpingStation.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/configData.js"></script> <!-- Load the config script for node information -->
|
||||
|
||||
<script>//test
|
||||
RED.nodes.registerType("pumpingStation", {
|
||||
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: {
|
||||
|
||||
// Define specific properties
|
||||
@@ -45,16 +54,16 @@
|
||||
outputs: 3,
|
||||
inputLabels: ["Input"],
|
||||
outputLabels: ["process", "dbase", "parent"],
|
||||
icon: "font-awesome/fa-tachometer",
|
||||
icon: "font-awesome/fa-tint",
|
||||
|
||||
label: function () {
|
||||
return this.positionIcon + " " + this.assetType || "Measurement";
|
||||
return this.positionIcon + " " + this.assetType || "pumpingStation";
|
||||
},
|
||||
|
||||
oneditprepare: function() {
|
||||
const waitForMenuData = () => {
|
||||
if (window.EVOLV?.nodes?.measurement?.initEditor) {
|
||||
window.EVOLV.nodes.measurement.initEditor(this);
|
||||
if (window.EVOLV?.nodes?.pumpingStation?.initEditor) {
|
||||
window.EVOLV.nodes.pumpingStation.initEditor(this);
|
||||
} else {
|
||||
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)
|
||||
// Populate smoothing methods dropdown
|
||||
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
|
||||
smoothMethodSelect.innerHTML = '';
|
||||
@@ -111,18 +120,18 @@
|
||||
const node = this;
|
||||
|
||||
// Validate asset properties using the asset menu
|
||||
if (window.EVOLV?.nodes?.measurement?.assetMenu?.saveEditor) {
|
||||
success = window.EVOLV.nodes.measurement.assetMenu.saveEditor(this);
|
||||
if (window.EVOLV?.nodes?.pumpingStation?.assetMenu?.saveEditor) {
|
||||
success = window.EVOLV.nodes.pumpingStation.assetMenu.saveEditor(this);
|
||||
}
|
||||
|
||||
// Validate logger properties using the logger menu
|
||||
if (window.EVOLV?.nodes?.measurement?.loggerMenu?.saveEditor) {
|
||||
success = window.EVOLV.nodes.measurement.loggerMenu.saveEditor(node);
|
||||
if (window.EVOLV?.nodes?.pumpingStation?.loggerMenu?.saveEditor) {
|
||||
success = window.EVOLV.nodes.pumpingStation.loggerMenu.saveEditor(node);
|
||||
}
|
||||
|
||||
// save position field
|
||||
if (window.EVOLV?.nodes?.measurement?.positionMenu?.saveEditor) {
|
||||
window.EVOLV.nodes.measurement.positionMenu.saveEditor(this);
|
||||
if (window.EVOLV?.nodes?.pumpingStation?.positionMenu?.saveEditor) {
|
||||
window.EVOLV.nodes.pumpingStation.positionMenu.saveEditor(this);
|
||||
}
|
||||
|
||||
// Save basic properties
|
||||
@@ -150,7 +159,7 @@
|
||||
|
||||
<!-- Main UI -->
|
||||
|
||||
<script type="text/html" data-template-name="measurement">
|
||||
<script type="text/html" data-template-name="pumpingStation">
|
||||
|
||||
<!-- Scaling Checkbox -->
|
||||
<div class="form-row">
|
||||
@@ -221,21 +230,7 @@
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/html" data-help-name="measurement">
|
||||
<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 type="text/html" data-help-name="pumpingStation">
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -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 Specific = require("./specificClass");
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class pumpingStation {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Basin;
|
||||
module.exports = pumpingStation;
|
||||
|
||||
/*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user