|
|
|
|
@@ -69,8 +69,8 @@ class Machine {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// used for holding the source and sink unit operations or other object with setInfluent / getEffluent method for e.g. recirculation.
|
|
|
|
|
this.upstreamReactor = null;
|
|
|
|
|
this.downstreamReactor = null;
|
|
|
|
|
this.upstreamSource = null;
|
|
|
|
|
this.downstreamSink = null;
|
|
|
|
|
|
|
|
|
|
this.child = {}; // object to hold child information so we know on what to subscribe
|
|
|
|
|
this.childRegistrationUtils = new childRegistrationUtils(this); // Child registration utility
|
|
|
|
|
@@ -93,7 +93,6 @@ class Machine {
|
|
|
|
|
this.logger.debug(`Registering reactor child...`);
|
|
|
|
|
this._connectReactor(child);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
this.logger.error(`Unrecognized softwareType: ${softwareType}`);
|
|
|
|
|
}
|
|
|
|
|
@@ -137,7 +136,7 @@ class Machine {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_connectReactor(reactorChild) {
|
|
|
|
|
this.downstreamReactor = reactorChild; // downstream from the pumps perpective
|
|
|
|
|
this.downstreamSink = reactorChild; // downstream from the pumps perpective
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------- END child stuff -------------//
|
|
|
|
|
@@ -509,8 +508,8 @@ class Machine {
|
|
|
|
|
|
|
|
|
|
this.logger.debug(`Flow update: ${value} at ${position} from ${context.childName || 'child'}`);
|
|
|
|
|
|
|
|
|
|
if (this.upstreamReactor && this.downstreamReactor){
|
|
|
|
|
this._updateConnectedReactor();
|
|
|
|
|
if (this.upstreamSource && this.downstreamSink) {
|
|
|
|
|
this._updateSourceSink();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Store in parent's measurement container
|
|
|
|
|
@@ -522,9 +521,10 @@ class Machine {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_updateConnectedReactor() {
|
|
|
|
|
_updateSourceSink() {
|
|
|
|
|
// Handles flow according to the configured "flow number"
|
|
|
|
|
this.downstreamReactor.setInfluent = this.upstreamReactor.getEffluent[this.config.flowNumber];
|
|
|
|
|
this.logger.debug(`Updating source-sink pair: ${this.upstreamSource.config.functionality.softwareType} - ${this.downstreamSink.config.functionality.softwareType}`);
|
|
|
|
|
this.downstreamSink.setInfluent = this.upstreamSource.getEffluent[this.config.flowNumber];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Helper method for operational state check
|
|
|
|
|
|