forked from RnD/machineGroupControl
88 lines
2.9 KiB
HTML
88 lines
2.9 KiB
HTML
<!--
|
|
| 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="/machineGroupControl/menu.js"></script> <!-- Load the menu script for dynamic dropdowns -->
|
|
<script src="/machineGroupControl/configData.js"></script> <!-- Load the config script for node information -->
|
|
|
|
<script>
|
|
RED.nodes.registerType('machineGroupControl',{
|
|
category: "EVOLV",
|
|
color: "#50a8d9",
|
|
defaults: {
|
|
// Define default properties
|
|
name: { value: "" },
|
|
|
|
// Logger properties
|
|
enableLog: { value: false },
|
|
logLevel: { value: "error" },
|
|
|
|
//physicalAspect
|
|
positionVsParent: { value: "" },
|
|
positionIcon: { value: "" },
|
|
hasDistance: { value: false },
|
|
distance: { value: 0 },
|
|
distanceUnit: { value: "m" },
|
|
distanceDescription: { value: "" }
|
|
|
|
},
|
|
inputs:1,
|
|
outputs:3,
|
|
inputLabels: ["Input"],
|
|
outputLabels: ["process", "dbase", "parent"],
|
|
icon: "font-awesome/fa-cogs",
|
|
|
|
label: function () {
|
|
return this.positionIcon + " " + "machineGroup";
|
|
},
|
|
oneditprepare: function() {
|
|
// Initialize the menu data for the node
|
|
const waitForMenuData = () => {
|
|
if (window.EVOLV?.nodes?.machineGroupControl?.initEditor) {
|
|
window.EVOLV.nodes.machineGroupControl.initEditor(this);
|
|
} else {
|
|
setTimeout(waitForMenuData, 50);
|
|
}
|
|
};
|
|
// Wait for the menu data to be ready before initializing the editor
|
|
waitForMenuData();
|
|
|
|
},
|
|
oneditsave: function(){
|
|
const node = this;
|
|
|
|
// Validate logger properties using the logger menu
|
|
if (window.EVOLV?.nodes?.machineGroupControl?.loggerMenu?.saveEditor) {
|
|
success = window.EVOLV.nodes.machineGroupControl.loggerMenu.saveEditor(node);
|
|
}
|
|
|
|
// save position field
|
|
if (window.EVOLV?.nodes?.machineGroupControl?.positionMenu?.saveEditor) {
|
|
window.EVOLV.nodes.machineGroupControl.positionMenu.saveEditor(this);
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="machineGroupControl">
|
|
|
|
<!-- Logger fields injected here -->
|
|
<div id="logger-fields-placeholder"></div>
|
|
|
|
<!-- Position fields injected here -->
|
|
<div id="position-fields-placeholder"></div>
|
|
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="machineGroupControl">
|
|
<p>A machineGroupControl node</p>
|
|
</script>
|