Refactor measurement position assignment and update grid position calculation in Reactor classes to align with new generalFunctions
This commit is contained in:
@@ -124,12 +124,7 @@ class Reactor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let position;
|
const position = measurementChild.config.functionality.positionVsParent;
|
||||||
if (measurementChild.config.functionality.distance !== 'undefined') {
|
|
||||||
position = measurementChild.config.functionality.distance;
|
|
||||||
} else {
|
|
||||||
position = measurementChild.config.functionality.positionVsParent;
|
|
||||||
}
|
|
||||||
const measurementType = measurementChild.config.asset.type;
|
const measurementType = measurementChild.config.asset.type;
|
||||||
const eventName = `${measurementType}.measured.${position}`;
|
const eventName = `${measurementType}.measured.${position}`;
|
||||||
|
|
||||||
@@ -334,7 +329,7 @@ class Reactor_PFR extends Reactor {
|
|||||||
_updateMeasurement(measurementType, value, position, context) {
|
_updateMeasurement(measurementType, value, position, context) {
|
||||||
switch(measurementType) {
|
switch(measurementType) {
|
||||||
case "quantity (oxygen)":
|
case "quantity (oxygen)":
|
||||||
let grid_pos = Math.round(position / this.config.length * this.n_x);
|
let grid_pos = Math.round(context.distance / this.config.length * this.n_x);
|
||||||
this.state[grid_pos][S_O_INDEX] = value; // naive approach for reconciling measurements and simulation
|
this.state[grid_pos][S_O_INDEX] = value; // naive approach for reconciling measurements and simulation
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user