test
This commit is contained in:
@@ -115,7 +115,7 @@ class nodeClass {
|
||||
const mode = m.currentMode;
|
||||
const state = m.state.getCurrentState();
|
||||
const flow = Math.round(m.measurements.type("flow").variant("predicted").position('downstream').getCurrentValue());
|
||||
const power = Math.round(m.measurements.type("power").variant("predicted").position('upstream').getCurrentValue());
|
||||
const power = Math.round(m.measurements.type("power").variant("predicted").position('atEquipment').getCurrentValue());
|
||||
let symbolState;
|
||||
switch(state){
|
||||
case "off":
|
||||
|
||||
@@ -771,9 +771,9 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
||||
module.exports = Machine;
|
||||
|
||||
/*------------------- Testing -------------------*/
|
||||
/*
|
||||
|
||||
curve = require('C:/Users/zn375/.node-red/public/fallbackData.json');
|
||||
/*
|
||||
//curve = require('C:/Users/zn375/.node-red/public/fallbackData.json');
|
||||
|
||||
//import a child
|
||||
const Child = require('../../measurement/src/specificClass');
|
||||
@@ -789,7 +789,6 @@ const PT1 = new Child(config={
|
||||
},
|
||||
functionality:{
|
||||
softwareType:"measurement",
|
||||
positionVsParent:"upstream",
|
||||
},
|
||||
asset:{
|
||||
supplier:"Vega",
|
||||
@@ -811,7 +810,6 @@ const PT2 = new Child(config={
|
||||
},
|
||||
functionality:{
|
||||
softwareType:"measurement",
|
||||
positionVsParent:"upstream",
|
||||
},
|
||||
asset:{
|
||||
supplier:"Vega",
|
||||
@@ -827,18 +825,17 @@ console.log(`Creating machine...`);
|
||||
|
||||
const machineConfig = {
|
||||
general: {
|
||||
name: "Hydrostal",
|
||||
name: "Hidrostal",
|
||||
logging: {
|
||||
enabled: true,
|
||||
logLevel: "debug",
|
||||
}
|
||||
},
|
||||
asset: {
|
||||
supplier: "Hydrostal",
|
||||
supplier: "Hidrostal",
|
||||
type: "pump",
|
||||
category: "centrifugal",
|
||||
model: "H05K-S03R+HGM1X-X280KO", // Ensure this field is present.
|
||||
machineCurve: curve["machineCurves"]["Hydrostal"]["H05K-S03R+HGM1X-X280KO"],
|
||||
model: "hidrostal-H05K-S03R", // Ensure this field is present.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -867,18 +864,17 @@ const machine = new Machine(machineConfig, stateConfig);
|
||||
machine.logger.info(`Registering child...`);
|
||||
machine.childRegistrationUtils.registerChild(PT1, "upstream");
|
||||
machine.childRegistrationUtils.registerChild(PT2, "downstream");
|
||||
|
||||
//feed curve to the machine class
|
||||
//machine.updateCurve(curve["machineCurves"]["Hydrostal"]["H05K-S03R+HGM1X-X280KO"]);
|
||||
|
||||
/*
|
||||
PT1.logger.info(`Enable sim...`);
|
||||
PT1.toggleSimulation();
|
||||
PT2.logger.info(`Enable sim...`);
|
||||
PT2.toggleSimulation();
|
||||
machine.getOutput();
|
||||
*/
|
||||
|
||||
|
||||
//manual test
|
||||
//machine.handleInput("parent", "execSequence", "startup");
|
||||
|
||||
/*
|
||||
machine.measurements.type("pressure").variant("measured").position('upstream').value(-200);
|
||||
machine.measurements.type("pressure").variant("measured").position('downstream').value(1000);
|
||||
|
||||
@@ -888,8 +884,8 @@ const tickLoop = setInterval(changeInput,1000);
|
||||
|
||||
function changeInput(){
|
||||
PT1.logger.info(`tick...`);
|
||||
PT1.tick();
|
||||
PT2.tick();
|
||||
//PT1.tick();
|
||||
//PT2.tick();
|
||||
}
|
||||
|
||||
async function testingSequences(){
|
||||
|
||||
Reference in New Issue
Block a user