forked from RnD/machineGroupControl
94 lines
2.8 KiB
HTML
94 lines
2.8 KiB
HTML
<!--
|
|
brabantse delta kleuren:
|
|
#eaf4f1
|
|
#86bbdd
|
|
#bad33b
|
|
#0c99d9
|
|
#a9daee
|
|
#0f52a5
|
|
#50a8d9
|
|
#cade63
|
|
#4f8582
|
|
#c4cce0
|
|
-->
|
|
<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: "#eaf4f1",
|
|
defaults: {
|
|
// Define default properties
|
|
name: { value: "" },
|
|
|
|
// Logger properties
|
|
enableLog: { value: false },
|
|
logLevel: { value: "error" },
|
|
|
|
// Physical aspect
|
|
positionVsParent: { value: "" },
|
|
positionLabel: { value: "" },
|
|
positionIcon: { value: "" },
|
|
},
|
|
inputs:1,
|
|
outputs:3,
|
|
inputLabels: ["Input"],
|
|
outputLabels: ["process", "dbase", "parent"],
|
|
icon: "font-awesome/fa-tachometer",
|
|
|
|
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?.measurement?.loggerMenu?.saveEditor) {
|
|
success = window.EVOLV.nodes.measurement.loggerMenu.saveEditor(node);
|
|
}
|
|
|
|
// save position field
|
|
if (window.EVOLV?.nodes?.rotatingMachine?.positionMenu?.saveEditor) {
|
|
window.EVOLV.nodes.rotatingMachine.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>
|
|
|
|
|
|
<div class="form-tips"></div>
|
|
<b>Tip:</b> Ensure that the "Name" field is unique to easily identify the node.
|
|
Enable logging if you need detailed information for debugging purposes.
|
|
Choose the appropriate log level based on the verbosity required.
|
|
</div>
|
|
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="machineGroupControl">
|
|
<p>A machineGroupControl node</p>
|
|
</script>
|