updates to accomodate valve node
This commit is contained in:
@@ -83,6 +83,11 @@ class ChildRegistrationUtils {
|
||||
this.connectValve(child);
|
||||
break;
|
||||
|
||||
case "machineGroup":
|
||||
this.logger.debug(`Registering complete machineGroup child: ${id}`);
|
||||
this.connectMachineGroup(child);
|
||||
break;
|
||||
|
||||
case "actuator":
|
||||
this.logger.debug(`Registering linear actuator child: ${id}`);
|
||||
this.connectActuator(child,positionVsParent);
|
||||
@@ -184,6 +189,26 @@ class ChildRegistrationUtils {
|
||||
this.logger.info(`Valve ${valveId} registered successfully.`);
|
||||
}
|
||||
|
||||
connectMachineGroup(machineGroup) {
|
||||
if (!machineGroup) {
|
||||
this.logger.warn("Invalid machineGroup provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const machineGroupId = Object.keys(this.mainClass.machineGroups).length + 1;
|
||||
this.mainClass.machineGroups[machineGroupId] = machineGroup;
|
||||
} catch (error) {
|
||||
this.logger.warn(`Skip machinegroup connnection: ${error.message}`);
|
||||
}
|
||||
|
||||
machineGroup.emitter.on("totalFlowChange", (data) => {
|
||||
this.mainClass.logger.debug('Total flow change of machineGroup detected');
|
||||
this.mainClass.handleInput("parent", "totalFlowChange", data)}); //Geef nieuwe totale flow door aan valveGrouControl
|
||||
|
||||
this.logger.info(`MachineGroup ${machineGroup.config.general.name} registered successfully.`);
|
||||
}
|
||||
|
||||
connectActuator(actuator, positionVsParent) {
|
||||
if (!actuator) {
|
||||
this.logger.warn("Invalid actuator provided.");
|
||||
|
||||
Reference in New Issue
Block a user