forked from RnD/rotatingMachine
Refactor flow handling: rename reactor references to source and sink and fix config minor bug
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
warmup: { value: 0 },
|
||||
shutdown: { value: 0 },
|
||||
cooldown: { value: 0 },
|
||||
machineCurve : { value: {}},
|
||||
flowNumber : { value: 1, required: true },
|
||||
machineCurve: { value: {}},
|
||||
flowNumber: { value: 1, required: true },
|
||||
|
||||
//define asset properties
|
||||
uuid: { value: "" },
|
||||
|
||||
@@ -63,7 +63,8 @@ class nodeClass {
|
||||
},
|
||||
functionality: {
|
||||
positionVsParent: uiConfig.positionVsParent
|
||||
}
|
||||
},
|
||||
flowNumber: uiConfig.flowNumber
|
||||
};
|
||||
|
||||
// Utility for formatting outputs
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user