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