Added handles for influent change emitter
This commit is contained in:
@@ -32,12 +32,11 @@ class nodeClass {
|
||||
switch (msg.topic) {
|
||||
case "clock":
|
||||
toggleUpdate = true;
|
||||
this.reactor.updateState(msg.timestamp);
|
||||
send([this.reactor.getEffluent, null, null]);
|
||||
break;
|
||||
case "Fluent":
|
||||
this.reactor.setInfluent = msg;
|
||||
if (msg.payload.inlet == 0) {
|
||||
toggleUpdate = true;
|
||||
}
|
||||
break;
|
||||
case "OTR":
|
||||
this.reactor.setOTR = msg;
|
||||
@@ -58,11 +57,6 @@ class nodeClass {
|
||||
console.log("Unknown topic: " + msg.topic);
|
||||
}
|
||||
|
||||
if (toggleUpdate) {
|
||||
this.reactor.updateState(msg.timestamp);
|
||||
send([this.reactor.getEffluent, null, null]);
|
||||
}
|
||||
|
||||
if (done) {
|
||||
done();
|
||||
}
|
||||
@@ -75,6 +69,14 @@ class nodeClass {
|
||||
*/
|
||||
_loadConfig(uiConfig) {
|
||||
this.config = {
|
||||
general: {
|
||||
name: uiConfig.name || this.name,
|
||||
id: this.node.id,
|
||||
unit: null
|
||||
},
|
||||
functionality: {
|
||||
softwareType: null // should be set in config manager
|
||||
},
|
||||
reactor_type: uiConfig.reactor_type,
|
||||
volume: parseFloat(uiConfig.volume),
|
||||
length: parseFloat(uiConfig.length),
|
||||
@@ -109,7 +111,7 @@ class nodeClass {
|
||||
this.node.send([
|
||||
null,
|
||||
null,
|
||||
{ topic: 'registerChild', payload: this.node.id , positionVsParent: this.config?.functionality?.positionVsParent || 'atEquipment' },
|
||||
{ topic: 'registerChild', payload: this.node.id, positionVsParent: this.config?.functionality?.positionVsParent || 'atEquipment' },
|
||||
]);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user