update
This commit is contained in:
@@ -77,8 +77,6 @@ class nodeClass {
|
|||||||
_setupSpecificClass(uiConfig) {
|
_setupSpecificClass(uiConfig) {
|
||||||
const machineConfig = this.config;
|
const machineConfig = this.config;
|
||||||
|
|
||||||
console.log(`----------------> Loaded movementMode in nodeClass: ${uiConfig.movementMode}`);
|
|
||||||
|
|
||||||
// need extra state for this
|
// need extra state for this
|
||||||
const stateConfig = {
|
const stateConfig = {
|
||||||
general: {
|
general: {
|
||||||
@@ -358,7 +356,7 @@ class nodeClass {
|
|||||||
this.node.on('close', (done) => {
|
this.node.on('close', (done) => {
|
||||||
clearInterval(this._tickInterval);
|
clearInterval(this._tickInterval);
|
||||||
clearInterval(this._statusInterval);
|
clearInterval(this._statusInterval);
|
||||||
done();
|
if (typeof done === 'function') done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
const EventEmitter = require('events');
|
const EventEmitter = require('events');
|
||||||
const {loadCurve,gravity,logger,configUtils,configManager,state, nrmse, MeasurementContainer, predict, interpolation , childRegistrationUtils,coolprop} = require('generalFunctions');
|
const {loadCurve,gravity,logger,configUtils,configManager,state, nrmse, MeasurementContainer, predict, interpolation , childRegistrationUtils,coolprop} = require('generalFunctions');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotating machine domain model.
|
||||||
|
* Combines machine curves, state transitions and measurement reconciliation
|
||||||
|
* to produce flow/power/efficiency behavior for pumps and similar assets.
|
||||||
|
*/
|
||||||
class Machine {
|
class Machine {
|
||||||
|
|
||||||
/*------------------- Construct and set vars -------------------*/
|
/*------------------- Construct and set vars -------------------*/
|
||||||
@@ -853,12 +858,15 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
|||||||
|
|
||||||
calcEfficiency(power,flow,variant) {
|
calcEfficiency(power,flow,variant) {
|
||||||
|
|
||||||
const pressureDiff = this.measurements.type('pressure').variant('measured').difference('Pa');
|
// Request a pressure differential explicitly in Pascal for hydraulic efficiency.
|
||||||
|
const pressureDiff = this.measurements
|
||||||
|
.type('pressure')
|
||||||
|
.variant('measured')
|
||||||
|
.difference({ unit: 'Pa' });
|
||||||
const g = gravity.getStandardGravity();
|
const g = gravity.getStandardGravity();
|
||||||
const temp = this.measurements.type('temperature').variant('measured').position('atEquipment').getCurrentValue('K');
|
const temp = this.measurements.type('temperature').variant('measured').position('atEquipment').getCurrentValue('K');
|
||||||
const atmPressure = this.measurements.type('atmPressure').variant('measured').position('atEquipment').getCurrentValue('Pa');
|
const atmPressure = this.measurements.type('atmPressure').variant('measured').position('atEquipment').getCurrentValue('Pa');
|
||||||
|
|
||||||
console.log(`--------------------calc efficiency : Pressure diff:${pressureDiff},${temp}, ${g} `);
|
|
||||||
let rho = null;
|
let rho = null;
|
||||||
try {
|
try {
|
||||||
rho = coolprop.PropsSI('D', 'T', temp, 'P', atmPressure, 'WasteWater');
|
rho = coolprop.PropsSI('D', 'T', temp, 'P', atmPressure, 'WasteWater');
|
||||||
|
|||||||
Reference in New Issue
Block a user