Update measurement handling in Reactor class and rename oxygen measurement type

This commit is contained in:
2025-09-26 10:17:00 +02:00
parent 905674ce58
commit bf5f265a76

View File

@@ -119,7 +119,11 @@ class Reactor {
return;
}
if (measurement.config.functionality.distance !== 'undefined') {
const position = measurement.config.functionality.distance;
} else {
const position = measurement.config.functionality.positionVsParent;
}
const measurementType = measurement.config.asset.type;
const key = `${measurementType}_${position}`;
const eventName = `${measurementType}.measured.${position}`;
@@ -317,8 +321,8 @@ class Reactor_PFR extends Reactor {
_updateMeasurement(measurementType, value, position, context) {
switch(measurementType) {
case "oxygen":
grid_pos = Math.round(position * this.n_x);
case "Quantity (oxygen)":
grid_pos = Math.round(position / this.config.length * this.n_x);
this.state[grid_pos][S_O_INDEX] = value; // naive approach for reconciling measurements and simulation
break;
}