forked from p.vanderwilt/settler
Minor improvements and updates to fix changes due to fork
This commit is contained in:
@@ -60,6 +60,11 @@ class Settler {
|
||||
}
|
||||
|
||||
registerChild(child, softwareType) {
|
||||
if(!child) {
|
||||
this.logger.error(`Invalid ${softwareType} child provided.`);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (softwareType) {
|
||||
case "measurement":
|
||||
this.logger.debug(`Registering measurement child...`);
|
||||
@@ -80,11 +85,6 @@ class Settler {
|
||||
}
|
||||
|
||||
_connectMeasurement(measurementChild) {
|
||||
if (!measurementChild) {
|
||||
this.logger.error("Invalid measurement provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
const position = measurementChild.config.functionality.positionVsParent;
|
||||
const measurementType = measurementChild.config.asset.type;
|
||||
const eventName = `${measurementType}.measured.${position}`;
|
||||
@@ -105,11 +105,6 @@ class Settler {
|
||||
}
|
||||
|
||||
_connectReactor(reactorChild) {
|
||||
if (!reactorChild) {
|
||||
this.logger.error("Invalid reactor provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (reactorChild.config.functionality.positionVsParent != "upstream") {
|
||||
this.logger.warn("Reactor children of settlers should be upstream.");
|
||||
}
|
||||
@@ -125,11 +120,6 @@ class Settler {
|
||||
}
|
||||
|
||||
_connectMachine(machineChild) {
|
||||
if (!machineChild) {
|
||||
this.logger.error("Invalid rotating machine provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (machineChild.config.functionality.positionVsParent == "downstream") {
|
||||
machineChild.upstreamReactor = this;
|
||||
this.returnPump = machineChild;
|
||||
@@ -138,7 +128,7 @@ class Settler {
|
||||
|
||||
_updateMeasurement(measurementType, value, position, context) {
|
||||
switch(measurementType) {
|
||||
case "quantity (TSS)":
|
||||
case "quantity (tss)":
|
||||
this.C_TS = value;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user