Compare commits
7 Commits
48a227d519
...
efe4a5f97d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efe4a5f97d | ||
|
|
e5c98b7d30 | ||
|
|
4a489acd89 | ||
|
|
98cd44d3ae | ||
|
|
44adfdece6 | ||
|
|
9ada6e2acd | ||
|
|
9610e7138d |
@@ -83,7 +83,13 @@
|
|||||||
{
|
{
|
||||||
"id": "hidrostal-pump-001",
|
"id": "hidrostal-pump-001",
|
||||||
"name": "hidrostal-H05K-S03R",
|
"name": "hidrostal-H05K-S03R",
|
||||||
"units": ["m³/h", "gpm", "l/min"]
|
|
||||||
|
"units": ["l/s"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "hidrostal-pump-002",
|
||||||
|
"name": "hidrostal-C5-D03R-SHN1",
|
||||||
|
"units": ["l/s"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
838
datasets/assetData/curves/hidrostal-C5-D03R-SHN1.json
Normal file
838
datasets/assetData/curves/hidrostal-C5-D03R-SHN1.json
Normal file
@@ -0,0 +1,838 @@
|
|||||||
|
{
|
||||||
|
"np": {
|
||||||
|
"400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5953611390998625,
|
||||||
|
1.6935085477165994,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.8497068236812997,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.7497197821018213,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.788320579602724,
|
||||||
|
3.9982668237045984,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.7824519364844427,
|
||||||
|
3.9885060367793064,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6934482683506376,
|
||||||
|
3.9879559558537054,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6954385513069579,
|
||||||
|
4.0743508382926795,
|
||||||
|
7.422392692482345,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.160745720731654,
|
||||||
|
7.596626714476177,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.302551231007837,
|
||||||
|
7.637247864947884,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.37557913990704,
|
||||||
|
7.773442147000839,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.334434337766139,
|
||||||
|
7.940911352646818,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.2327206586037995,
|
||||||
|
8.005238800611183,
|
||||||
|
12.254836577088351
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.195405588464695,
|
||||||
|
7.991827302945298,
|
||||||
|
12.423663269044452
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
14.255458319309813,
|
||||||
|
8.096768422220196,
|
||||||
|
12.584668380908582
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
31.54620347513727,
|
||||||
|
12.637080520201405
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.148423429611098,
|
||||||
|
12.74916725120127
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.146439484120116,
|
||||||
|
12.905178964345618
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.149576025637684,
|
||||||
|
13.006940917309247
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.126246430368305,
|
||||||
|
13.107503837410825
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.104379361635342,
|
||||||
|
13.223235973280122
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.135190080423746,
|
||||||
|
13.36128347785936
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.981219508598527,
|
||||||
|
13.473697427231842
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.863899404441271,
|
||||||
|
13.50303289156837
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.658860522528131,
|
||||||
|
13.485230880073107
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.44407948309266,
|
||||||
|
13.446135725634615
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.44407948309266,
|
||||||
|
13.413693596332184
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nq": {
|
||||||
|
"400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
7.6803204433986965,
|
||||||
|
25.506609120436963,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
22.622804921188227,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
19.966301579194372,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
17.430763940163832,
|
||||||
|
33.79508340848005,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
14.752921911234477,
|
||||||
|
31.71885034449889,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
11.854693031181021,
|
||||||
|
29.923046639543475,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.549433913822687,
|
||||||
|
26.734189128096668,
|
||||||
|
43.96760750800311,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
26.26933164936586,
|
||||||
|
42.23523193272671,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
24.443114637042832,
|
||||||
|
40.57167959798151,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
22.41596168949836,
|
||||||
|
39.04561852479495,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
20.276864821170303,
|
||||||
|
37.557663261443224,
|
||||||
|
52.252852231224054
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
18.252772588147742,
|
||||||
|
35.9974418607538,
|
||||||
|
50.68604059588987
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
16.31441663648616,
|
||||||
|
34.51170378091407,
|
||||||
|
49.20153034100798
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
14.255458319309813,
|
||||||
|
33.043410795291045,
|
||||||
|
47.820213744181245
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
31.54620347513727,
|
||||||
|
46.51705619739449
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
29.986013742375484,
|
||||||
|
45.29506741639918
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
28.432646044605782,
|
||||||
|
44.107822395271945
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
26.892634464336055,
|
||||||
|
42.758175515158776
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
25.270679127870263,
|
||||||
|
41.467063889795895
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
23.531132157718837,
|
||||||
|
40.293041104955826
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
21.815645106750623,
|
||||||
|
39.03109248860755
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
20.34997949463564,
|
||||||
|
37.71320701654063
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
18.81710568651804,
|
||||||
|
36.35563657017404
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
17.259072160217805,
|
||||||
|
35.02979557646653
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
16,
|
||||||
|
33.74372254979665
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
16,
|
||||||
|
32.54934541379723
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -47,30 +47,30 @@ class ConfigManager {
|
|||||||
return fs.existsSync(configPath);
|
return fs.existsSync(configPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
createEndpoint(nodeName) {
|
createEndpoint(nodeName) {
|
||||||
try {
|
try {
|
||||||
// Load the config for this node
|
// Load the config for this node
|
||||||
const config = this.getConfig(nodeName);
|
const config = this.getConfig(nodeName);
|
||||||
|
|
||||||
// Convert config to JSON
|
|
||||||
const configJSON = JSON.stringify(config, null, 2);
|
|
||||||
|
|
||||||
// Assemble the complete script
|
// Convert config to JSON
|
||||||
return `
|
const configJSON = JSON.stringify(config, null, 2);
|
||||||
// Create the namespace structure
|
|
||||||
window.EVOLV = window.EVOLV || {};
|
|
||||||
window.EVOLV.nodes = window.EVOLV.nodes || {};
|
|
||||||
window.EVOLV.nodes.${nodeName} = window.EVOLV.nodes.${nodeName} || {};
|
|
||||||
|
|
||||||
// Inject the pre-loaded config data directly into the namespace
|
// Assemble the complete script
|
||||||
window.EVOLV.nodes.${nodeName}.config = ${configJSON};
|
return `
|
||||||
|
// Create the namespace structure
|
||||||
|
window.EVOLV = window.EVOLV || {};
|
||||||
|
window.EVOLV.nodes = window.EVOLV.nodes || {};
|
||||||
|
window.EVOLV.nodes.${nodeName} = window.EVOLV.nodes.${nodeName} || {};
|
||||||
|
|
||||||
console.log('${nodeName} config loaded and endpoint created');
|
// Inject the pre-loaded config data directly into the namespace
|
||||||
`;
|
window.EVOLV.nodes.${nodeName}.config = ${configJSON};
|
||||||
} catch (error) {
|
|
||||||
throw new Error(`Failed to create endpoint for '${nodeName}': ${error.message}`);
|
console.log('${nodeName} config loaded and endpoint created');
|
||||||
}
|
`;
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Failed to create endpoint for '${nodeName}': ${error.message}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ConfigManager;
|
module.exports = ConfigManager;
|
||||||
@@ -478,6 +478,30 @@
|
|||||||
"min": 0,
|
"min": 0,
|
||||||
"description": "Allowable error between inflow and outflow before adjustments are triggered (m3/h)."
|
"description": "Allowable error between inflow and outflow before adjustments are triggered (m3/h)."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"thresholdLowVolume": {
|
||||||
|
"default": 10,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Volume threshold (%) below which the station will shut down pumps to prevent dry running."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"thresholdHighVolume": {
|
||||||
|
"default": 90,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Volume threshold (%) above which the station will trigger high level alarms."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"timeThreshholdSeconds": {
|
||||||
|
"default": 120,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Time threshold (seconds) used in volume-based safety checks."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"alarms": {
|
"alarms": {
|
||||||
|
|||||||
@@ -245,10 +245,6 @@
|
|||||||
{
|
{
|
||||||
"value": "fysicalControl",
|
"value": "fysicalControl",
|
||||||
"description": "Controlled via physical buttons or switches; ignores external automated commands."
|
"description": "Controlled via physical buttons or switches; ignores external automated commands."
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": "maintenance",
|
|
||||||
"description": "No active control from auto, virtual, or fysical sources."
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The operational mode of the machine."
|
"description": "The operational mode of the machine."
|
||||||
@@ -260,7 +256,13 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"schema":{
|
"schema":{
|
||||||
"auto": {
|
"auto": {
|
||||||
"default": ["statusCheck", "execMovement", "execSequence", "emergencyStop"],
|
"default": [
|
||||||
|
"statuscheck",
|
||||||
|
"execmovement",
|
||||||
|
"execsequence",
|
||||||
|
"emergencystop",
|
||||||
|
"entermaintenance"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
@@ -268,7 +270,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"virtualControl": {
|
"virtualControl": {
|
||||||
"default": ["statusCheck", "execMovement", "execSequence", "emergencyStop"],
|
"default": [
|
||||||
|
"statuscheck",
|
||||||
|
"execmovement",
|
||||||
|
"execsequence",
|
||||||
|
"emergencystop",
|
||||||
|
"exitmaintenance"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
@@ -276,25 +284,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fysicalControl": {
|
"fysicalControl": {
|
||||||
"default": ["statusCheck", "emergencyStop"],
|
"default": [
|
||||||
|
"statuscheck",
|
||||||
|
"emergencystop",
|
||||||
|
"entermaintenance",
|
||||||
|
"exitmaintenance"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
"description": "Actions allowed in fysicalControl mode."
|
"description": "Actions allowed in fysicalControl mode."
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"maintenance": {
|
|
||||||
"default": ["statusCheck"],
|
|
||||||
"rules": {
|
|
||||||
"type": "set",
|
|
||||||
"itemType": "string",
|
|
||||||
"description": "Actions allowed in maintenance mode."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "Information about valid command sources recognized by the machine."
|
"description": "Information about valid command sources recognized by the machine."
|
||||||
}
|
},
|
||||||
},
|
|
||||||
"allowedSources":{
|
"allowedSources":{
|
||||||
"default": {},
|
"default": {},
|
||||||
"rules": {
|
"rules": {
|
||||||
@@ -386,6 +391,22 @@
|
|||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
"description": "Sequence of states for booting up the machine."
|
"description": "Sequence of states for booting up the machine."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"entermaintenance":{
|
||||||
|
"default": ["stopping","coolingdown","idle","maintenance"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states if the machine is running to put it in maintenance state"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exitmaintenance":{
|
||||||
|
"default": ["off","idle"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states if the machine is running to put it in maintenance state"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ async apiCall(node) {
|
|||||||
// Only add tagCode to URL if it exists
|
// Only add tagCode to URL if it exists
|
||||||
if (tagCode) {
|
if (tagCode) {
|
||||||
apiUrl += `&asset_tag_number=${tagCode}`;
|
apiUrl += `&asset_tag_number=${tagCode}`;
|
||||||
console.log('hello there');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assetregisterAPI += apiUrl;
|
assetregisterAPI += apiUrl;
|
||||||
@@ -461,10 +460,6 @@ populateModels(
|
|||||||
// Store only the metadata for the selected model
|
// Store only the metadata for the selected model
|
||||||
node["modelMetadata"] = modelData.find((model) => model.name === selectedModel);
|
node["modelMetadata"] = modelData.find((model) => model.name === selectedModel);
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
console.log('hello here I am:');
|
|
||||||
console.log(node["modelMetadata"]);
|
|
||||||
*/
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ async apiCall(node) {
|
|||||||
// Only add tagCode to URL if it exists
|
// Only add tagCode to URL if it exists
|
||||||
if (tagCode) {
|
if (tagCode) {
|
||||||
apiUrl += `&asset_tag_number=${tagCode}`;
|
apiUrl += `&asset_tag_number=${tagCode}`;
|
||||||
console.log('hello there');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assetregisterAPI += apiUrl;
|
assetregisterAPI += apiUrl;
|
||||||
@@ -461,10 +460,7 @@ populateModels(
|
|||||||
// Store only the metadata for the selected model
|
// Store only the metadata for the selected model
|
||||||
node["modelMetadata"] = modelData.find((model) => model.name === selectedModel);
|
node["modelMetadata"] = modelData.find((model) => model.name === selectedModel);
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
console.log('hello here I am:');
|
|
||||||
console.log(node["modelMetadata"]);
|
|
||||||
*/
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class OutputUtils {
|
|||||||
|
|
||||||
influxDBFormat(changedFields, config , flatTags) {
|
influxDBFormat(changedFields, config , flatTags) {
|
||||||
// Create the measurement and topic using softwareType and name config.functionality.softwareType + .
|
// Create the measurement and topic using softwareType and name config.functionality.softwareType + .
|
||||||
const measurement = config.general.name;
|
const measurement = `${config.functionality?.softwareType}_${config.general?.id}`;
|
||||||
const payload = {
|
const payload = {
|
||||||
measurement: measurement,
|
measurement: measurement,
|
||||||
fields: changedFields,
|
fields: changedFields,
|
||||||
@@ -104,24 +104,23 @@ class OutputUtils {
|
|||||||
return {
|
return {
|
||||||
// general properties
|
// general properties
|
||||||
id: config.general?.id,
|
id: config.general?.id,
|
||||||
name: config.general?.name,
|
|
||||||
unit: config.general?.unit,
|
|
||||||
// functionality properties
|
// functionality properties
|
||||||
softwareType: config.functionality?.softwareType,
|
softwareType: config.functionality?.softwareType,
|
||||||
role: config.functionality?.role,
|
role: config.functionality?.role,
|
||||||
// asset properties (exclude machineCurve)
|
// asset properties (exclude machineCurve)
|
||||||
uuid: config.asset?.uuid,
|
uuid: config.asset?.uuid,
|
||||||
|
tagcode: config.asset?.tagcode,
|
||||||
geoLocation: config.asset?.geoLocation,
|
geoLocation: config.asset?.geoLocation,
|
||||||
supplier: config.asset?.supplier,
|
category: config.asset?.category,
|
||||||
type: config.asset?.type,
|
type: config.asset?.type,
|
||||||
subType: config.asset?.subType,
|
|
||||||
model: config.asset?.model,
|
model: config.asset?.model,
|
||||||
|
unit: config.general?.unit,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
processFormat(changedFields,config) {
|
processFormat(changedFields,config) {
|
||||||
// Create the measurement and topic using softwareType and name config.functionality.softwareType + .
|
// Create the measurement and topic using softwareType and name config.functionality.softwareType + .
|
||||||
const measurement = config.general.name;
|
const measurement = `${config.functionality?.softwareType}_${config.general?.id}`;
|
||||||
const payload = changedFields;
|
const payload = changedFields;
|
||||||
const topic = measurement;
|
const topic = measurement;
|
||||||
const msg = { topic: topic, payload: payload };
|
const msg = { topic: topic, payload: payload };
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class Measurement {
|
|||||||
|
|
||||||
// Create a new measurement that is the difference between two positions
|
// Create a new measurement that is the difference between two positions
|
||||||
static createDifference(upstreamMeasurement, downstreamMeasurement) {
|
static createDifference(upstreamMeasurement, downstreamMeasurement) {
|
||||||
console.log('hello:');
|
|
||||||
if (upstreamMeasurement.type !== downstreamMeasurement.type ||
|
if (upstreamMeasurement.type !== downstreamMeasurement.type ||
|
||||||
upstreamMeasurement.variant !== downstreamMeasurement.variant) {
|
upstreamMeasurement.variant !== downstreamMeasurement.variant) {
|
||||||
throw new Error('Cannot calculate difference between different measurement types or variants');
|
throw new Error('Cannot calculate difference between different measurement types or variants');
|
||||||
|
|||||||
@@ -325,6 +325,38 @@ class MeasurementContainer {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLaggedSample(lag = 1,requestedUnit = null ){
|
||||||
|
const measurement = this.get();
|
||||||
|
if (!measurement) return null;
|
||||||
|
|
||||||
|
let sample = measurement.getLaggedSample(lag);
|
||||||
|
if (sample === null) return null;
|
||||||
|
|
||||||
|
// Return as-is if no unit conversion requested
|
||||||
|
if (!requestedUnit) {
|
||||||
|
return sample;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert if needed
|
||||||
|
if (measurement.unit && requestedUnit !== measurement.unit) {
|
||||||
|
try {
|
||||||
|
const convertedValue = convertModule(value).from(measurement.unit).to(requestedUnit);
|
||||||
|
//replace old value in sample and return obj
|
||||||
|
sample.value = convertedValue ;
|
||||||
|
sample.unit = requestedUnit;
|
||||||
|
return sample;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
if (this.logger) {
|
||||||
|
this.logger.error(`Unit conversion failed: ${error.message}`);
|
||||||
|
}
|
||||||
|
return sample; // Return original value if conversion fails
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sample;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Difference calculations between positions
|
// Difference calculations between positions
|
||||||
difference({ from = "downstream", to = "upstream", unit: requestedUnit } = {}) {
|
difference({ from = "downstream", to = "upstream", unit: requestedUnit } = {}) {
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ autoContainer
|
|||||||
.distance(0.5)
|
.distance(0.5)
|
||||||
.value(1.5, Date.now(), 'bar'); // Input: 1.5 bar → Auto-stored as ~21.76 psi
|
.value(1.5, Date.now(), 'bar'); // Input: 1.5 bar → Auto-stored as ~21.76 psi
|
||||||
|
|
||||||
|
|
||||||
const converted = autoContainer
|
const converted = autoContainer
|
||||||
.type('pressure')
|
.type('pressure')
|
||||||
.variant('measured')
|
.variant('measured')
|
||||||
@@ -274,8 +275,8 @@ console.log(` History: [${allValues.values.join(', ')}]\n`);
|
|||||||
console.log('--- Lagged sample comparison ---');
|
console.log('--- Lagged sample comparison ---');
|
||||||
|
|
||||||
const latest = stats.getCurrentValue(); // existing helper
|
const latest = stats.getCurrentValue(); // existing helper
|
||||||
const prevSample = stats.getLaggedValue(2); // new helper
|
const prevSample = stats.getLaggedValue(1); // new helper
|
||||||
const prevPrevSample = stats.getLaggedValue(3); // optional
|
const prevPrevSample = stats.getLaggedValue(2); // optional
|
||||||
|
|
||||||
if (prevSample) {
|
if (prevSample) {
|
||||||
const delta = latest - prevSample.value;
|
const delta = latest - prevSample.value;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ class PhysicalPositionMenu {
|
|||||||
return {
|
return {
|
||||||
positionGroups: [
|
positionGroups: [
|
||||||
{ group: 'Positional', options: [
|
{ group: 'Positional', options: [
|
||||||
{ value: 'upstream', label: '← Upstream', icon: '←'},
|
{ value: 'upstream', label: '→ Upstream', icon: '←'}, //flow is then typically left to right
|
||||||
{ value: 'atEquipment', label: '⊥ in place' , icon: '⊥' },
|
{ value: 'atEquipment', label: '⊥ in place' , icon: '⊥' },
|
||||||
{ value: 'downstream', label: '→ Downstream' , icon: '→' }
|
{ value: 'downstream', label: '← Downstream' , icon: '→' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ class Predict {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildAllFxyCurves(curve) {
|
buildAllFxyCurves(curve) {
|
||||||
|
|
||||||
let globalMinY = Infinity;
|
let globalMinY = Infinity;
|
||||||
let globalMaxY = -Infinity;
|
let globalMaxY = -Infinity;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ class state{
|
|||||||
return this.stateManager.getRunTimeHours();
|
return this.stateManager.getRunTimeHours();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMaintenanceTimeHours(){
|
||||||
|
return this.stateManager.getMaintenanceTimeHours();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async moveTo(targetPosition) {
|
async moveTo(targetPosition) {
|
||||||
|
|
||||||
// Check for invalid conditions and throw errors
|
// Check for invalid conditions and throw errors
|
||||||
|
|||||||
@@ -205,6 +205,10 @@
|
|||||||
{
|
{
|
||||||
"value": "off",
|
"value": "off",
|
||||||
"description": "Machine is off."
|
"description": "Machine is off."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "maintenance",
|
||||||
|
"description": "Machine locked for inspection or repair; automatic control disabled."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Current state of the machine."
|
"description": "Current state of the machine."
|
||||||
@@ -216,7 +220,7 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"schema": {
|
"schema": {
|
||||||
"idle": {
|
"idle": {
|
||||||
"default": ["starting", "off","emergencystop"],
|
"default": ["starting", "off","emergencystop","maintenance"],
|
||||||
"rules":{
|
"rules":{
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
@@ -280,7 +284,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"off": {
|
"off": {
|
||||||
"default": ["idle","emergencystop"],
|
"default": ["idle","emergencystop","maintenance"],
|
||||||
"rules":{
|
"rules":{
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
@@ -288,12 +292,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"emergencystop": {
|
"emergencystop": {
|
||||||
"default": ["idle","off"],
|
"default": ["idle","off","maintenance"],
|
||||||
"rules":{
|
"rules":{
|
||||||
"type": "set",
|
"type": "set",
|
||||||
"itemType": "string",
|
"itemType": "string",
|
||||||
"description": "Allowed transitions from emergency stop state."
|
"description": "Allowed transitions from emergency stop state."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"maintenance": {
|
||||||
|
"default": ["maintenance","idle","off"],
|
||||||
|
"rules":{
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Allowed transitions for maintenance mode"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "Allowed transitions between states."
|
"description": "Allowed transitions between states."
|
||||||
|
|||||||
@@ -48,10 +48,14 @@ class stateManager {
|
|||||||
// Define valid transitions (can be extended dynamically if needed)
|
// Define valid transitions (can be extended dynamically if needed)
|
||||||
this.validTransitions = config.state.allowedTransitions;
|
this.validTransitions = config.state.allowedTransitions;
|
||||||
|
|
||||||
// NEW: Initialize runtime tracking
|
//runtime tracking
|
||||||
this.runTimeHours = 0; // cumulative runtime in hours
|
this.runTimeHours = 0; // cumulative runtime in hours
|
||||||
this.runTimeStart = null; // timestamp when active state began
|
this.runTimeStart = null; // timestamp when active state began
|
||||||
|
|
||||||
|
//maintenance tracking
|
||||||
|
this.maintenanceTimeStart = null; //timestamp when active state began
|
||||||
|
this.maintenanceTimeHours = 0; //cumulative
|
||||||
|
|
||||||
// Define active states (runtime counts only in these states)
|
// Define active states (runtime counts only in these states)
|
||||||
this.activeStates = config.state.activeStates;
|
this.activeStates = config.state.activeStates;
|
||||||
}
|
}
|
||||||
@@ -59,7 +63,7 @@ class stateManager {
|
|||||||
getCurrentState() {
|
getCurrentState() {
|
||||||
return this.currentState;
|
return this.currentState;
|
||||||
}
|
}
|
||||||
|
|
||||||
transitionTo(newState,signal) {
|
transitionTo(newState,signal) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (signal && signal.aborted) {
|
if (signal && signal.aborted) {
|
||||||
@@ -73,8 +77,9 @@ class stateManager {
|
|||||||
); //go back early and reject promise
|
); //go back early and reject promise
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEW: Handle runtime tracking based on active states
|
//Time tracking based on active states
|
||||||
this.handleRuntimeTracking(newState);
|
this.handleRuntimeTracking(newState);
|
||||||
|
this.handleMaintenancetimeTracking(newState);
|
||||||
|
|
||||||
const transitionDuration = this.transitionTimes[this.currentState] || 0; // Default to 0 if no transition time
|
const transitionDuration = this.transitionTimes[this.currentState] || 0; // Default to 0 if no transition time
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
@@ -100,7 +105,7 @@ class stateManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleRuntimeTracking(newState) {
|
handleRuntimeTracking(newState) {
|
||||||
// NEW: Handle runtime tracking based on active states
|
//Handle runtime tracking based on active states
|
||||||
const wasActive = this.activeStates.has(this.currentState);
|
const wasActive = this.activeStates.has(this.currentState);
|
||||||
const willBeActive = this.activeStates.has(newState);
|
const willBeActive = this.activeStates.has(newState);
|
||||||
if (wasActive && !willBeActive && this.runTimeStart) {
|
if (wasActive && !willBeActive && this.runTimeStart) {
|
||||||
@@ -120,6 +125,28 @@ class stateManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleMaintenancetimeTracking(newState) {
|
||||||
|
//is this maintenance time ?
|
||||||
|
const wasActive = (this.currentState == "maintenance"? true:false);
|
||||||
|
const willBeActive = ( newState == "maintenance" ? true:false );
|
||||||
|
|
||||||
|
if (wasActive && this.maintenanceTimeStart) {
|
||||||
|
// stop runtime timer and accumulate elapsed time
|
||||||
|
const elapsed = (Date.now() - this.maintenanceTimeStart) / 3600000; // hours
|
||||||
|
this.maintenanceTimeHours += elapsed;
|
||||||
|
this.maintenanceTimeStart = null;
|
||||||
|
this.logger.debug(
|
||||||
|
`Maintenance timer stopped; elapsed=${elapsed.toFixed(
|
||||||
|
3
|
||||||
|
)}h, total=${this.maintenanceTimeHours.toFixed(3)}h.`
|
||||||
|
);
|
||||||
|
} else if (willBeActive && !this.runTimeStart) {
|
||||||
|
// starting new runtime
|
||||||
|
this.maintenanceTimeStart = Date.now();
|
||||||
|
this.logger.debug("Runtime timer started.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isValidTransition(newState) {
|
isValidTransition(newState) {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`Check 1 Transition valid ? From ${
|
`Check 1 Transition valid ? From ${
|
||||||
@@ -150,7 +177,6 @@ class stateManager {
|
|||||||
return this.descriptions[state] || "No description available.";
|
return this.descriptions[state] || "No description available.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEW: Getter to retrieve current cumulative runtime (active time) in hours.
|
|
||||||
getRunTimeHours() {
|
getRunTimeHours() {
|
||||||
// If currently active add the ongoing duration.
|
// If currently active add the ongoing duration.
|
||||||
let currentElapsed = 0;
|
let currentElapsed = 0;
|
||||||
@@ -159,6 +185,15 @@ class stateManager {
|
|||||||
}
|
}
|
||||||
return this.runTimeHours + currentElapsed;
|
return this.runTimeHours + currentElapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMaintenanceTimeHours() {
|
||||||
|
// If currently active add the ongoing duration.
|
||||||
|
let currentElapsed = 0;
|
||||||
|
if (this.maintenanceTimeStart) {
|
||||||
|
currentElapsed = (Date.now() - this.maintenanceTimeStart) / 3600000;
|
||||||
|
}
|
||||||
|
return this.maintenanceTimeHours + currentElapsed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = stateManager;
|
module.exports = stateManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user