forked from RnD/rotatingMachine
updates
This commit is contained in:
@@ -63,7 +63,7 @@ class Machine {
|
||||
this.model = machineConfig.asset.model; // Get the model from the machineConfig
|
||||
this.curve = this.model ? loadCurve(this.model) : null;
|
||||
|
||||
//Always initialize config first
|
||||
//Init config and check if it is valid
|
||||
this.config = this.configUtils.initConfig(machineConfig);
|
||||
|
||||
if (!this.model || !this.curve) {
|
||||
@@ -85,8 +85,6 @@ class Machine {
|
||||
this.predictCtrl = new predict({ curve: this.reverseCurve(this.config.asset.machineCurve.nq) }); // load reversed nq (x: flow, y: ctrl relationship)
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.state = new state(stateConfig, this.logger); // Init State manager and pass logger
|
||||
this.errorMetrics = new nrmse(errorMetricsConfig, this.logger);
|
||||
|
||||
@@ -111,8 +109,6 @@ class Machine {
|
||||
this.updatePosition();
|
||||
});
|
||||
|
||||
//this.calcCog();
|
||||
|
||||
this.childRegistrationUtils = new childRegistrationUtils(this); // Child registration utility
|
||||
|
||||
}
|
||||
@@ -204,7 +200,7 @@ class Machine {
|
||||
}
|
||||
|
||||
setMode(newMode) {
|
||||
const availableModes = defaultConfig.mode.current.rules.values.map(v => v.value);
|
||||
const availableModes = this.defaultConfig.mode.current.rules.values.map(v => v.value);
|
||||
if (!availableModes.includes(newMode)) {
|
||||
this.logger.warn(`Invalid mode '${newMode}'. Allowed modes are: ${availableModes.join(', ')}`);
|
||||
return;
|
||||
@@ -549,6 +545,23 @@ class Machine {
|
||||
return distance;
|
||||
}
|
||||
|
||||
showWorkingCurves() {
|
||||
// Show the current curves for debugging
|
||||
const { powerCurve, flowCurve } = this.getCurrentCurves();
|
||||
return {
|
||||
powerCurve: powerCurve,
|
||||
flowCurve: flowCurve,
|
||||
cog: this.cog,
|
||||
cogIndex: this.cogIndex,
|
||||
NCog: this.NCog,
|
||||
minEfficiency: this.minEfficiency,
|
||||
currentEfficiencyCurve: this.currentEfficiencyCurve,
|
||||
absDistFromPeak: this.absDistFromPeak,
|
||||
relDistFromPeak: this.relDistFromPeak
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Calculate the center of gravity for current pressure
|
||||
calcCog() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user