Merge branch 'release/UpdateProdSim'

This commit is contained in:
2022-09-21 16:19:18 +02:00
87 changed files with 3545 additions and 1407 deletions
+9
View File
@@ -0,0 +1,9 @@
Gestione veto registrazione intervento
Manutenzione: impostare il valore come % della vita residua MINIMO, es 95% --> significa che anche se resta 95% del tempo --> permetto di fare manutenzione
nuovi stati da aggiungere...
Serve una gestione dal plc x indicare carico vuoto oppure scarico pieno, questo deve dare un segnale di stato/modo che si possa interpretare sul decoder e riportare. Va fatto forse no su impulso ma su un segnale che duri ALMENO 5-10 secondi
+170 -2
View File
@@ -1,7 +1,7 @@
[
{
"Order": 1,
"ExtCode": "ns=5;i=1274",
"ExtCode": "ns=1;s=3_1_ALARM NC",
"Type": "ALARM",
"Title": "ALARM NC",
"Value": "",
@@ -13,7 +13,7 @@
},
{
"Order": 2,
"ExtCode": "ns=5;i=1259",
"ExtCode": "ns=1;s=3_2_ALARM PLC 1",
"Type": "ALARM",
"Title": "ALARM PLC 01",
"Value": "",
@@ -22,5 +22,173 @@
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 3,
"ExtCode": "ns=1;s=3_3_ALARM PLC 2",
"Type": "ALARM",
"Title": "ALARM PLC 02",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 4,
"ExtCode": "ns=1;s=3_4_ALARM PLC 3",
"Type": "ALARM",
"Title": "ALARM PLC 03",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 5,
"ExtCode": "ns=1;s=3_5_ALARM PLC 4",
"Type": "ALARM",
"Title": "ALARM PLC 04",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 6,
"ExtCode": "ns=1;s=3_6_ALARM PLC 5",
"Type": "ALARM",
"Title": "ALARM PLC 05",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 7,
"ExtCode": "ns=1;s=3_7_ALARM PLC 6",
"Type": "ALARM",
"Title": "ALARM PLC 06",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 8,
"ExtCode": "ns=1;s=3_8_ALARM PLC 7",
"Type": "ALARM",
"Title": "ALARM PLC 07",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 9,
"ExtCode": "ns=1;s=3_9_ALARM PLC 8",
"Type": "ALARM",
"Title": "ALARM PLC 08",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 10,
"ExtCode": "ns=1;s=3_10_ALARM PLC 9",
"Type": "ALARM",
"Title": "ALARM PLC 09",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 11,
"ExtCode": "ns=1;s=3_11_ALARM PLC 10",
"Type": "ALARM",
"Title": "ALARM PLC 10",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 12,
"ExtCode": "ns=1;s=3_12_ALARM PLC 11",
"Type": "ALARM",
"Title": "ALARM PLC 11",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 13,
"ExtCode": "ns=1;s=3_13_ALARM PLC 12",
"Type": "ALARM",
"Title": "ALARM PLC 12",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 14,
"ExtCode": "ns=1;s=3_14_ALARM PLC 13",
"Type": "ALARM",
"Title": "ALARM PLC 13",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 15,
"ExtCode": "ns=1;s=3_15_ALARM PLC 14",
"Type": "ALARM",
"Title": "ALARM PLC 14",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 16,
"ExtCode": "ns=1;s=3_16_ALARM PLC 15",
"Type": "ALARM",
"Title": "ALARM PLC 15",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
}
]
@@ -130,5 +130,65 @@
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 12,
"ExtCode": "ns=1;s=3_12_ALARM PLC 11",
"Type": "ALARM",
"Title": "ALARM PLC 11",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 13,
"ExtCode": "ns=1;s=3_13_ALARM PLC 12",
"Type": "ALARM",
"Title": "ALARM PLC 12",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 14,
"ExtCode": "ns=1;s=3_14_ALARM PLC 13",
"Type": "ALARM",
"Title": "ALARM PLC 13",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 15,
"ExtCode": "ns=1;s=3_15_ALARM PLC 14",
"Type": "ALARM",
"Title": "ALARM PLC 14",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 16,
"ExtCode": "ns=1;s=3_16_ALARM PLC 15",
"Type": "ALARM",
"Title": "ALARM PLC 15",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
}
]
+12
View File
@@ -98,5 +98,17 @@
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 7,
"ExtCode": "ns=1;s=502_1_RECIPE NAME",
"Type": "PROGRAM",
"Title": "RECIPE NAME",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
}
]
+27 -12
View File
@@ -1,26 +1,41 @@
[
{
"Order": 1,
"ExtCode": "ns=5;i=1274",
"Type": "ALARM",
"Title": "ALARM NC",
"ExtCode": "ns=3;i=11176",
"Type": "STATUS",
"Title": "MACHINE STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
"MaxVal": 10,
"ScaleFactor": 0.1,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=5;i=1259",
"Type": "ALARM",
"Title": "ALARM PLC 01",
"ExtCode": "ns=3;i=11230",
"Type": "STATUS",
"Title": "PROCESS STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
"MaxVal": 20,
"ScaleFactor": 0.1,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 3,
"ExtCode": "ns=3;i=11236",
"Type": "MODE",
"Title": "PROCESS MODE",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"ScaleFactor": 0.1,
"DisplFormat": "N0",
"IsNumeric": true
}
]
+60
View File
@@ -34,5 +34,65 @@
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=502_1_RECIPE NAME",
"Type": "PROGRAM",
"Title": "RECIPE NAME",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 5,
"ExtCode": "ns=1;s=51_P2 PALLET STATUS",
"Type": "STATUS",
"Title": "P2 PALLET STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 6,
"ExtCode": "ns=1;s=52_P3 PALLET STATUS",
"Type": "STATUS",
"Title": "P3 PALLET STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 7,
"ExtCode": "ns=1;s=53_P2 EXTERNAL PALLET STATUS",
"Type": "STATUS",
"Title": "P2 EXTERNAL PALLET STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 8,
"ExtCode": "ns=1;s=54_P3 EXTERNAL PALLET STATUS",
"Type": "STATUS",
"Title": "P3 EXTERNAL PALLET STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
}
]
@@ -34,5 +34,17 @@
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=502_1_RECIPE NAME",
"Type": "PROGRAM",
"Title": "RECIPE NAME",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
}
]
+9
View File
@@ -121,6 +121,11 @@
"ns=1;s=3_9_ALARM PLC 8",
"ns=1;s=3_10_ALARM PLC 9",
"ns=1;s=3_11_ALARM PLC 10",
"ns=1;s=3_12_ALARM PLC 11",
"ns=1;s=3_13_ALARM PLC 12",
"ns=1;s=3_14_ALARM PLC 13",
"ns=1;s=3_15_ALARM PLC 14",
"ns=1;s=3_16_ALARM PLC 15",
"ns=1;s=4_1_AXIS 1 LOAD PC",
"ns=1;s=4_2_AXIS 2 LOAD PC",
"ns=1;s=4_3_AXIS 3 LOAD PC",
@@ -152,6 +157,10 @@
"ns=1;s=5_14_TOOL 32 CURRENT LIFE PC",
"ns=1;s=5_15_TOOL 33 CURRENT LIFE PC",
"ns=1;s=5_16_TOOL 34 CURRENT LIFE PC",
"ns=1;s=51_P2 PALLET STATUS",
"ns=1;s=52_P3 PALLET STATUS",
"ns=1;s=53_P2 EXTERNAL PALLET STATUS",
"ns=1;s=54_P3 EXTERNAL PALLET STATUS",
"ns=1;s=500_1_STATUS",
"ns=1;s=501_1_MODE",
"ns=1;s=502_1_RECIPE NAME",
-128
View File
@@ -1,128 +0,0 @@
[
{
"Order": 3,
"HLShow": true,
"Type": "SPEED-5000-10000",
"Title": "SPEED",
"Value": "4000",
"ValueNum": 4000,
"MinVal": 1000,
"MaxVal": 10000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 2,
"HLShow": true,
"Type": "FEED-3000-5000",
"Title": "FEED",
"Value": "2500",
"ValueNum": 2500,
"MinVal": 1000,
"MaxVal": 5000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE LOAD",
"Value": "30",
"ValueNum": 30,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 4,
"Type": "POS",
"Title": "X POS",
"Value": "1500",
"ValueNum": 1500,
"MinVal": 0,
"MaxVal": 5000,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 5,
"Type": "POS",
"Title": "Y POS",
"Value": "5000",
"ValueNum": 5000,
"MinVal": 0,
"MaxVal": 10000,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 6,
"Type": "POS",
"Title": "Z POS",
"Value": "-1500",
"ValueNum": -1500,
"MinVal": -3000,
"MaxVal": 0,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 7,
"Type": "POS",
"Title": "A POS",
"Value": "150",
"ValueNum": 150,
"MinVal": 0,
"MaxVal": 360,
"DisplFormat": "N3",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 8,
"Type": "POS",
"Title": "B POS",
"Value": "150",
"ValueNum": 150,
"MinVal": 0,
"MaxVal": 360,
"DisplFormat": "N3",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
}
]
+16 -16
View File
@@ -3,7 +3,7 @@
"Order": 0,
"ExtCode": "ns=1;s=5_1_TOOL 1 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 01",
"Title": "SPINDLE 1 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -15,7 +15,7 @@
"Order": 1,
"ExtCode": "ns=1;s=5_2_TOOL 2 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 02",
"Title": "SPINDLE 1 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -27,7 +27,7 @@
"Order": 2,
"ExtCode": "ns=1;s=5_3_TOOL 3 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 03",
"Title": "SPINDLE 1 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -39,7 +39,7 @@
"Order": 3,
"ExtCode": "ns=1;s=5_4_TOOL 4 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 04",
"Title": "SPINDLE 1 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -51,7 +51,7 @@
"Order": 4,
"ExtCode": "ns=1;s=5_5_TOOL 11 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 05",
"Title": "SPINDLE 2 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -63,7 +63,7 @@
"Order": 5,
"ExtCode": "ns=1;s=5_6_TOOL 12 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 06",
"Title": "SPINDLE 2 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -75,7 +75,7 @@
"Order": 6,
"ExtCode": "ns=1;s=5_7_TOOL 13 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 07",
"Title": "SPINDLE 2 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -87,7 +87,7 @@
"Order": 7,
"ExtCode": "ns=1;s=5_8_TOOL 14 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 08",
"Title": "SPINDLE 2 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -99,7 +99,7 @@
"Order": 8,
"ExtCode": "ns=1;s=5_9_TOOL 21 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 09",
"Title": "SPINDLE 3 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -111,7 +111,7 @@
"Order": 9,
"ExtCode": "ns=1;s=5_10_TOOL 22 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 10",
"Title": "SPINDLE 3 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -123,7 +123,7 @@
"Order": 10,
"ExtCode": "ns=1;s=5_11_TOOL 23 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 11",
"Title": "SPINDLE 3 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -135,7 +135,7 @@
"Order": 11,
"ExtCode": "ns=1;s=5_12_TOOL 24 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 12",
"Title": "SPINDLE 3 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -147,7 +147,7 @@
"Order": 12,
"ExtCode": "ns=1;s=5_13_TOOL 31 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 13",
"Title": "SPINDLE 4 TOOL 1",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -159,7 +159,7 @@
"Order": 13,
"ExtCode": "ns=1;s=5_14_TOOL 32 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 14",
"Title": "SPINDLE 4 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -171,7 +171,7 @@
"Order": 14,
"ExtCode": "ns=1;s=5_15_TOOL 33 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 15",
"Title": "SPINDLE 4 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
@@ -183,7 +183,7 @@
"Order": 15,
"ExtCode": "ns=1;s=5_16_TOOL 34 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 16",
"Title": "SPINDLE 4 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
+32 -32
View File
@@ -3,192 +3,192 @@
"Order": 0,
"ExtCode": "ns=1;s=5_1_TOOL 1 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 01",
"Title": "SPINDLE 1 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 1,
"ExtCode": "ns=1;s=5_2_TOOL 2 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 02",
"Title": "SPINDLE 1 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=1;s=5_3_TOOL 3 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 03",
"Title": "SPINDLE 1 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 3,
"ExtCode": "ns=1;s=5_4_TOOL 4 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 04",
"Title": "SPINDLE 1 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=5_5_TOOL 11 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 05",
"Title": "SPINDLE 2 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 5,
"ExtCode": "ns=1;s=5_6_TOOL 12 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 06",
"Title": "SPINDLE 2 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 6,
"ExtCode": "ns=1;s=5_7_TOOL 13 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 07",
"Title": "SPINDLE 2 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 7,
"ExtCode": "ns=1;s=5_8_TOOL 14 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 08",
"Title": "SPINDLE 2 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 8,
"ExtCode": "ns=1;s=5_9_TOOL 21 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 09",
"Title": "SPINDLE 3 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 9,
"ExtCode": "ns=1;s=5_10_TOOL 22 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 10",
"Title": "SPINDLE 3 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 10,
"ExtCode": "ns=1;s=5_11_TOOL 23 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 11",
"Title": "SPINDLE 3 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 11,
"ExtCode": "ns=1;s=5_12_TOOL 24 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 12",
"Title": "SPINDLE 3 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 12,
"ExtCode": "ns=1;s=5_13_TOOL 31 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 13",
"Title": "SPINDLE 4 TOOL 1",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 13,
"ExtCode": "ns=1;s=5_14_TOOL 32 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 14",
"Title": "SPINDLE 4 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 14,
"ExtCode": "ns=1;s=5_15_TOOL 33 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 15",
"Title": "SPINDLE 4 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 15,
"ExtCode": "ns=1;s=5_16_TOOL 34 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "TOOL 16",
"Title": "SPINDLE 4 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N2",
"DisplFormat": "N1",
"IsNumeric": true
}
]
-2
View File
@@ -284,13 +284,11 @@ namespace MP.MONO.ADAPTER.OPC
restrictedToMinimumLevel: (LogEventLevel)consoleLogLevel
);
}
#if DEBUG
else
{
loggerConfiguration
.WriteTo.Debug(restrictedToMinimumLevel: (LogEventLevel)consoleLogLevel);
}
#endif
LogLevel fileLevel = LogLevel.Information;
// switch for Trace/Verbose output
+1 -1
View File
@@ -59,7 +59,7 @@ namespace MP.MONO.ADAPTER.OPC
CleanupRegexpPre = optPar.GetValue<string>("CleanupRegexpPre");
if (optPar.GetValue<bool>("FiltCrLf"))
{
FiltSplitChar = new char[] { '\n', '\r' };
FiltSplitChar = new char[] { '\n', '\r', '\0' };
}
else
{
+68 -343
View File
@@ -23,6 +23,8 @@ namespace MP.MONO.ADAPTER.OPC
/// </summary>
public class IobOpcUa : IobGeneric
{
private ConfigManager confManager { get; set; }
#region Public Constructors
/// <summary>
@@ -40,10 +42,15 @@ namespace MP.MONO.ADAPTER.OPC
sub = redis.GetSubscriber();
redisDb = redis.GetDatabase();
confManager = new ConfigManager(redisConf, confPath);
msVetoRedCache = config.GetValue<int>("OptPar:VetoSendCache");
MinWait = config.GetValue<int>("OptPar:MinWait");
MaxWait = config.GetValue<int>("OptPar:MaxWait");
logInfo($"VetoSendCache: {msVetoRedCache}s | MinWait: {MinWait} | MaxWait: {MaxWait}");
AlarmCleanPre = config.GetValue<string>("OptPar:AlarmCleanPre");
AlarmCleanPost= config.GetValue<string>("OptPar:AlarmCleanPost");
AlarmTrimWSpace = config.GetValue<bool>("OptPar:AlarmTrimWSpace");
logInfo($"VetoSendCache: {msVetoRedCache}s | MinWait: {MinWait} | MaxWait: {MaxWait} | AlarmCleanPre: {AlarmCleanPre} | AlarmCleanPost: {AlarmCleanPost}");
// gestione data filtering...
if (!string.IsNullOrEmpty(config.GetValue<string>("ENABLE_DATA_FILTER")))
@@ -397,7 +404,7 @@ namespace MP.MONO.ADAPTER.OPC
bool doSend = true;
if (LastSend.ContainsKey(memKey))
{
if (DateTime.Now.Subtract(LastSend[memKey]).TotalSeconds < msVetoRedCache)
if (DateTime.Now.Subtract(LastSend[memKey]).TotalMilliseconds < msVetoRedCache)
{
doSend = false;
}
@@ -629,12 +636,6 @@ namespace MP.MONO.ADAPTER.OPC
return rawByte;
}
// // log opzionale!
// if (verboseLog)
// {
// logDebug($"Trasformazione checkPing: {checkPing} | hasPowerOn: {hasPowerOn} | B_input: {B_input} | currRun = {currRun}");
// }
//}
/// <summary>
/// Effettua traduzione ITEM da LUT parametrica (key: tipo+id) del file di conf, se non
/// trovo uso key
@@ -663,10 +664,6 @@ namespace MP.MONO.ADAPTER.OPC
return answ;
}
// List<WriteValue> nodes2Write = new List<WriteValue>(); nodes2Write.Add(commWriteVal);
// UA_ref.WriteNodes(nodes2Write); logTrace("Effettuata scrittura WatchDog"); } catch
// (Exception exc) { logError($"Eccezione in gestione WatchDog, valore attuale
// {WatchDog}{Environment.NewLine}{exc}"); } } } else { logTrace("WatchDog disabilitato"); }
/// <summary>
/// Effettua lettura file di conf specifico OPC-UA da oggetto serializzato json <paramref
/// name="fileName">Nome file da cui leggere i parametri json</paramref>
@@ -757,7 +754,7 @@ namespace MP.MONO.ADAPTER.OPC
numOk = double.TryParse(rawDataVal, out updVal);
// aggiorno nella lista dei valori quello cambiato...
var currItem = ToolStatus.FirstOrDefault(x => x.ExtCode == uuid);
if (numOk && currItem.IsNumeric)
if (numOk && currItem!=null && currItem.IsNumeric)
{
currItem.ValueNum = updVal;
currItem.Value = updVal.ToString(currItem.DisplFormat);
@@ -792,23 +789,47 @@ namespace MP.MONO.ADAPTER.OPC
currItem.Value = rawDataVal;
}
logTrace($"R&S | ParamKList | {uuid} | {currItem.Value}");
// genero un dictionary di valori stringa / double e lo serializzo...
var dataDict = ParamStatus.ToDictionary(x => x.Title, x => x.Value);
string payloadParams = JsonConvert.SerializeObject(dataDict);
// invio
saveAndSendMessage(Constants.PARAMS_CURR_KEY, Constants.PARAMS_RAW_QUEUE, payloadParams);
saveAndSendMessage(Constants.PARAMS_ACT_KEY, Constants.PARAMS_RAW_QUEUE, payloadParams);
#if false
// parametri: inviati come DTO
string payloadParams = JsonConvert.SerializeObject(ParamStatus);
// invio
saveAndSendMessage(Constants.PARAMS_CURR_KEY, Constants.PARAMS_M_QUEUE, payloadParams);
#endif
}
// Allarmi
if (AlarmsKList.Contains(uuid))
{
// allarmi: effettuo PRE processing x filtrare pre/post { }
if (!string.IsNullOrEmpty(AlarmCleanPre))
{
rawDataVal = rawDataVal.Replace(AlarmCleanPre, "");
}
if (!string.IsNullOrEmpty(AlarmCleanPost))
{
rawDataVal = rawDataVal.Replace(AlarmCleanPost, "");
}
if (AlarmTrimWSpace && string.IsNullOrWhiteSpace(rawDataVal))
{
rawDataVal = rawDataVal.Trim();
}
// aggiorno nella lista dei valori quello cambiato...
var currItem = AlarmsStatus.FirstOrDefault(x => x.ExtCode == uuid);
currItem.Value = rawDataVal;
// salvo in redis!
redisDb.StringSet(Constants.ALARMS_ADAP_CONF_KEY, JsonConvert.SerializeObject(AlarmsStatus));
// genero elenco allarmi attivi
List<string> adpActiveAlarm = AlarmsStatus.Select(x => x.Value).Where(x => !string.IsNullOrEmpty(x)).OrderBy(x => x).ToList();
List<string> adpActiveAlarm = AlarmsStatus
.Select(x => x.Value)
.Where(x => !string.IsNullOrEmpty(x))
.OrderBy(x => x)
.ToList();
logTrace($"R&S | AlarmsKList | {uuid} | {currItem.Value}");
var payloadAlarms = JsonConvert.SerializeObject(adpActiveAlarm);
@@ -935,6 +956,20 @@ namespace MP.MONO.ADAPTER.OPC
/// </summary>
private List<string> AlarmsKList { get; set; } = new List<string>();
/// <summary>
/// Char x bonifica stringa allarmi - PRE
/// </summary>
private string AlarmCleanPre = "";
/// <summary>
/// Char x bonifica stringa allarmi - POST
/// </summary>
private string AlarmCleanPost = "";
/// <summary>
/// Indica se forzare trim dei whitespace da allarmi
/// </summary>
private bool AlarmTrimWSpace = false;
/// <summary>
/// Elenco oggetti DisplayDTO da gestire come Allarmi
/// </summary>
@@ -1007,259 +1042,14 @@ namespace MP.MONO.ADAPTER.OPC
#endregion Private Properties
///// <summary>
///// Veto controllo status x log...
///// </summary>
//protected DateTime vetoCheckStatus = DateTime.Now;
//protected int WatchDog = 0;
//#endregion Protected Fields
///// <summary>
///// Verifico se abbia ALMENO un errore...
///// </summary>
//protected bool hasError
//{
// get
// {
// return checkMultiCondition(opcUaParams.condError);
// }
//}
///// <summary>
///// Indica se abbia emergenza ARMATA (cond normale)
///// </summary>
//protected bool hasEStopArmed
//{
// get
// {
// return checkMultiCondition(opcUaParams.condEStop);
// }
//}
///// <summary>
///// Indica se abbia stato POWER ON (multicondizione)
///// </summary>
//protected virtual bool hasPowerOn
//{
// get
// {
// return checkMultiCondition(opcUaParams.condPowerOn);
// }
//}
///// <summary>
///// Indica se abbia stato MANUAL (condizioni varie, es stopped)
///// </summary>
//protected virtual bool isManual
//{
// get
// {
// return checkMultiCondition(opcUaParams.condManual);
// }
//}
///// <summary>
///// Indica se abbia stato READY (condizioni varie, es ausiliari OK)
///// </summary>
//protected virtual bool isReady
//{
// get
// {
// return checkMultiCondition(opcUaParams.condReady);
// }
//}
///// <summary>
///// Indica se sia in stato Ssetup
///// </summary>
//protected bool isSetup
//{
// get
// {
// return checkMultiCondition(opcUaParams.condSetup);
// }
//}
///// <summary>
///// Indica se sia in stato WarmUp / CoolDown (riscaldamento/raffreddamento)
///// </summary>
//protected bool isWarmUpCoolDown
//{
// get
// {
// return checkMultiCondition(opcUaParams.condWarmUpCoolDown);
// }
//}
///// <summary>
///// Indica se sia in stato Warning
///// </summary>
//protected bool isWarning
//{
// get
// {
// return checkMultiCondition(opcUaParams.condWarning);
// }
//}
///// <summary>
///// Indica se abbia stato READY (condizioni varie, es ausiliari OK)
///// </summary>
//protected bool isWorking
//{
// get
// {
// // cerco SE HO cond OPC Ua o classica... nel caso creo e salvo
// if (opcUaParams.condWorkOpc.checkList == null || opcUaParams.condWorkOpc.checkList.Count == 0)
// {
// opcUaParams.condWorkOpc = new diCheckCondSetup()
// {
// checkList = opcUaParams.condWork,
// checkMode = boolCheckMode.AND,
// negateValue = false
// };
// }
// return checkMultiCondition(opcUaParams.condWorkOpc);
// }
//}
///// <summary>
///// Periodo massimo (in sec) per letture dati RAW in mancanza di eventi
///// </summary>
//protected int lastCurrentMaxElapsed { get; set; } = 120;
///// <summary>
///// URL x salvataggio elenco dataItems OpcUa
///// </summary>
//protected string urlSaveDataItems
//{
// get
// {
// string answ = "";
// try
// {
// string machineName = Environment.MachineName;
// answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/saveDataItems/{cIobConf.codIOB}";
// }
// catch (Exception exc)
// {
// logError(exc, "Errore in composizione urlSaveDataItems");
// }
// return answ;
// }
//}
//#endregion Protected Properties
//#region Protected Methods
///// <summary>
///// Verifica un DataItem e se il valore corrisponde a quello indicato come "true value"
///// restituisce true
///// </summary>
///// <param name="itemName"></param>
///// <param name="trueVal"></param>
///// <returns></returns>
//protected bool checkDataItem(string itemName, string trueVal)
//{
// bool answ = false;
// OpcUaDataItemExt currValue = null;
// try
// {
// currValue = dataItemMem[itemName];
// answ = (currValue.value.Equals(trueVal));
// }
// catch
// {
// logError($"Errore in decodifica valore per {itemName} rispetto a {trueVal} | recuperato {currValue} / {currValue.value}");
// }
// return answ;
//}
///// <summary>
///// Verifica condizione "multipla" secondo setup json
///// </summary>
///// <param name="reqCondition">Set condizioni da validare</param>
///// <returns></returns>
//protected bool checkMultiCondition(diCheckCondSetup reqCondition)
//{
// bool answ = false;
// int numCondOk = 0;
// int numCond = 0;
// if (reqCondition.checkList != null && reqCondition.checkList.Count > 0)
// {
// numCond = reqCondition.checkList.Count;
// // cerco nell'elenco delle condizioni che indicano lavora se sono ok faccio +1 conteggio......
// foreach (var item in reqCondition.checkList)
// {
// if (string.IsNullOrEmpty(item.keyName))
// {
// logError($"Attenzione: item vuoto in checkMultiCondition{Environment.NewLine}StackTrace: {Environment.StackTrace}");
// }
// else
// {
// if (getDataItemValue(item.keyName) == item.targetValue)
// {
// numCondOk++;
// }
// }
// }
// if (reqCondition.checkMode == boolCheckMode.AND)
// {
// answ = (numCond == numCondOk);
// }
// else if (reqCondition.checkMode == boolCheckMode.OR)
// {
// answ = numCondOk > 0;
// }
// }
// else
// {
// answ = true;
// }
// // verifico se devo negare il valore...
// answ = reqCondition.negateValue ? !answ : answ;
// // restituisco
// return answ;
//}
///// <summary>
///// Effettua decodifica aree memoria alla bitmap usata x MAPO
///// </summary>
//protected virtual void decodeToBaseBitmap()
//{
// DateTime adesso = DateTime.Now;
// // init a zero...
// B_input = 0;
// /* -----------------------------------------------------
// * STATE MACHINE 60 STD / SIMULA *------------------------------------------------------
// * bitmap MAPO
// * B0: POWER_ON
// * B1: RUN
// * B2: pzCount
// * B3: allarme
// * B4: manuale
// * B5: SlowTC (NON gestito qui)
// * B6: warm-up / cool-down
// * B7: emergenza
// ---------------------------------------------------- */
// // se valido il check ping lo eseguo... altrimenti lo do x buono bool checkPing =
// !opcUaParams.pingAsPowerOn; string currRun = ""; if (!checkPing) { checkPing =
// (testPingMachine == IPStatus.Success); } // bit 0 (poweron) imposto a 1 SE pingo +
// PowerOn=="ON"... bool powerOnOk = checkPing && hasPowerOn;
// // controllo se sono poweroff e se non ho dati buoni da > lastCurrentMaxElapsed -->
// disconnetto if (!powerOnOk && adesso.Subtract(lastCurrent).TotalSeconds >
// lastCurrentMaxElapsed) { tryDisconnect(); }
// // solo se non ho veto check int vFactor = 2; if (vetoCheckStatus < adesso) {
// logTrace($"Stato variabili checkPing: {testPingMachine}"); // imposto veto per
// vetoSeconds... vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor); }
// // se abilitato watchdog... if (opcUaParams.WatchDog.IsEnabled) { logTrace("WatchDog
// 01"); if (adesso.Subtract(lastWatchDogPLC).TotalSeconds > 2) { lastWatchDogPLC = adesso;
// WatchDog++; WatchDog = WatchDog > opcUaParams.WatchDog.MaxVal ? 0 : WatchDog;
#region Private Methods
@@ -1403,7 +1193,8 @@ namespace MP.MONO.ADAPTER.OPC
else
{
currVal = UA_ref.ReadNode(item.StartNodeId);
changed = checkAndSend(item, stringCleanup(currVal), true);
var fixString = stringCleanup(currVal);
changed = checkAndSend(item, fixString, true);
}
}
// attesa x evitare problemi
@@ -1481,92 +1272,26 @@ namespace MP.MONO.ADAPTER.OPC
/// </summary>
private void setupGroupConf()
{
// leggo e salvo conf varie...
// leggo e salvo conf varie (dati x decodifica e gestione)
// ActLog
string fullPath = Path.Combine(configPath, "ActLog.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
ActLogStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.ACTLOG_CONF_KEY, JsonConvert.SerializeObject(ActLogStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
ActLogKList = ActLogStatus.Select(x => x.ExtCode).ToList();
}
}
ActLogStatus = confManager.getActLog();
ActLogKList = ActLogStatus.Select(x => x.ExtCode).ToList();
fullPath = Path.Combine(configPath, "Tools.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
ToolStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.TOOLS_CONF_KEY, JsonConvert.SerializeObject(ToolStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
ToolKList = ToolStatus.Select(x => x.ExtCode).ToList();
}
}
ToolStatus = confManager.getTools();
ToolKList = ActLogStatus.Select(x => x.ExtCode).ToList();
fullPath = Path.Combine(configPath, "Parameters.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
ParamStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.PARAMS_CONF_KEY, JsonConvert.SerializeObject(ParamStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
ParamKList = ParamStatus.Select(x => x.ExtCode).ToList();
}
}
ParamStatus = confManager.getParamsConf();
ParamKList = ParamStatus.Select(x => x.ExtCode).ToList();
fullPath = Path.Combine(configPath, "Alarms.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
AlarmsStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.ALARMS_ADAP_CONF_KEY, JsonConvert.SerializeObject(AlarmsStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
AlarmsKList = AlarmsStatus.Select(x => x.ExtCode).ToList();
}
}
AlarmsStatus = confManager.getAlarmsConf();
AlarmsKList = AlarmsStatus.Select(x => x.ExtCode).ToList();
fullPath = Path.Combine(configPath, "MPStatus.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
MPStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.MP_STATUS_CONF_KEY, JsonConvert.SerializeObject(MPStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
MPKList = MPStatus.Select(x => x.ExtCode).ToList();
}
}
MPStatus = confManager.getMPStatusConf();
MPKList = MPStatus.Select(x => x.ExtCode).ToList();
CountStatus = confManager.getCountersConf();
CountKList = CountStatus.Select(x => x.ExtCode).ToList();
fullPath = Path.Combine(configPath, "Counters.json");
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
CountStatus = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.CNT_STATUS_CONF_KEY, JsonConvert.SerializeObject(CountStatus));
// calcolo l'elenco dei cod univoci da gestire e lo salvo...
CountKList = CountStatus.Select(x => x.ExtCode).ToList();
}
}
}
#endregion Private Methods
@@ -42,6 +42,12 @@
<ProjectReference Include="..\MP.MONO.Core\MP.MONO.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.multiax.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings.office.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -84,9 +90,6 @@
<None Update="CONF\Parameters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="CONF\ParamList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="CONF\Tools.multiax.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+20 -28
View File
@@ -6,19 +6,12 @@
}
},
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=nkc.password",
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
//"ConnectionStrings": {
// "Redis": "localhost:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
// "AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
// "DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
// "AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
// "MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
//},
"DbConfig": {
"Server": "10.74.82.230",
"nKey": "MONO",
@@ -40,35 +33,34 @@
},
"Endpoint": {
"ConfFile": "Demo.json",
"FullUrl": "opc.tcp://localhost:62541/Quickstarts/ReferenceServer",
"FullUrl": "opc.tcp://wrkst-r9-sam:62541/Quickstarts/ReferenceServer",
"PingMsTimeout": 1500
},
//"Endpoint": {
// "ConfFile": "Multiax.json",
// "FullUrl": "opc.tcp://192.168.0.2:4840",
//// "IpAddress": "192.168.0.2",
//// "Port": "4840",
// "PingMsTimeout": 1500
//},
"OptPar": {
"AlarmMode": "RawList",
"Log2Console": true,
"Log2File": true,
"ForceSplit": true,
"CleanupRegexpPre": "[^a-zA-Z0-9 %/,.\\-\\+\\r\\n]",
"CleanupRegexpPost": "[^a-zA-Z0-9 %/,.\\-\\+]",
"AlarmRegexp": "^{[\\d\\w\\:\\ \\.\\/\\(\\)]*}",
//"AlarmRegexp": "^{.*}",
"AlarmCleanPre": "{",
"AlarmCleanPost": "}",
"AlarmTrimWSpace": true,
"CleanupRegexpPre": "",
//"CleanupRegexpPre": "[^a-zA-Z0-9 %/,.\\-\\+\\r\\n]",
"CleanupRegexpPost": "[^a-zA-Z0-9 %\\{\\},.\\-\\+]",
"FiltCrLf": true,
"FiltSplitChar": [],
"VetoSendCache": 200,
"ForceSplit": true,
"Log2Console": true,
"Log2File": true,
"MinWait": 50,
"MaxWait": 150
"MaxWait": 150,
"VetoSendCache": 50
},
"Machine": {
"Manufacturer": "Multiax",
"Model": "M-D5",
"Name": "D5,
"SerialNumber": "03216549870"
}
"Model": "Model-D",
"Name": "D1521",
"SerialNumber": "1521"
},
"ENABLE_DATA_FILTER": true,
"ENABLE_CLI_RESTART": true,
"logEvery": 10,
@@ -78,4 +70,4 @@
"disconMaxSec": 30,
"verboseLogTOut": 60,
"waitRecMSec": 60000
}
}
@@ -0,0 +1,72 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"Redis": "localhost:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "localhost",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"MachineId": 1,
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"Endpoint": {
"ConfFile": "Multiax.json",
"FullUrl": "opc.tcp://192.168.0.2:4840",
"PingMsTimeout": 1500
},
"OptPar": {
"AlarmMode": "RawList",
"AlarmRegexp": "^{[\\d\\w\\:\\ \\.\\/\\(\\)]*}",
//"AlarmRegexp": "^{.*}",
"AlarmCleanPre": "{",
"AlarmCleanPost": "}",
"CleanupRegexpPre": "",
//"CleanupRegexpPre": "[^a-zA-Z0-9 %/,.\\-\\+\\r\\n]",
"CleanupRegexpPost": "[^a-zA-Z0-9 %/,.\\-\\+]",
"FiltCrLf": true,
"FiltSplitChar": [],
"ForceSplit": true,
"Log2Console": true,
"Log2File": true,
"MinWait": 50,
"MaxWait": 150,
"VetoSendCache": 50
},
"Machine": {
"Manufacturer": "Multiax",
"Model": "Model-D",
"Name": "D1521",
"SerialNumber": "1521"
},
"ENABLE_DATA_FILTER": true,
"ENABLE_CLI_RESTART": true,
"logEvery": 10,
"OPC_PARAM_CONF": "Multiax.json",
"pingTestSec": 5,
"verbose": false,
"disconMaxSec": 30,
"verboseLogTOut": 60,
"waitRecMSec": 60000
}
@@ -0,0 +1,72 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "10.74.82.230",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"MachineId": 1,
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"Endpoint": {
"ConfFile": "Demo.json",
"FullUrl": "opc.tcp://wrkst-r9-sam:62541/Quickstarts/ReferenceServer",
"PingMsTimeout": 1500
},
"OptPar": {
"AlarmMode": "RawList",
"AlarmRegexp": "^{[\\d\\w\\:\\ \\.\\/\\(\\)]*}",
//"AlarmRegexp": "^{.*}",
"AlarmCleanPre": "{",
"AlarmCleanPost": "}",
"CleanupRegexpPre": "",
//"CleanupRegexpPre": "[^a-zA-Z0-9 %/,.\\-\\+\\r\\n]",
"CleanupRegexpPost": "[^a-zA-Z0-9 %/,.\\-\\+]",
"FiltCrLf": true,
"FiltSplitChar": [],
"ForceSplit": true,
"Log2Console": true,
"Log2File": true,
"MinWait": 50,
"MaxWait": 150,
"VetoSendCache": 50
},
"Machine": {
"Manufacturer": "Multiax",
"Model": "Model-D",
"Name": "D1521",
"SerialNumber": "1521"
},
"ENABLE_DATA_FILTER": true,
"ENABLE_CLI_RESTART": true,
"logEvery": 10,
"OPC_PARAM_CONF": "Multiax.json",
"pingTestSec": 5,
"verbose": false,
"disconMaxSec": 30,
"verboseLogTOut": 60,
"waitRecMSec": 60000
}
+2 -2
View File
@@ -6,13 +6,13 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2206.2217</Version>
<Version>1.2.2209.2116</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
</ItemGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2206.2217</h4>
<h4>Version: 1.2.2209.2116</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2206.2217
1.2.2209.2116
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2206.2217</version>
<version>1.2.2209.2116</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+134 -28
View File
@@ -8,18 +8,6 @@ namespace MP.MONO.Core
{
public class ConfigManager
{
#region Private Fields
private Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Protected Fields
protected string confPath = "";
#endregion Protected Fields
#region Public Constructors
public ConfigManager(string redisConf, string confDirPath)
@@ -32,19 +20,34 @@ namespace MP.MONO.Core
#endregion Public Constructors
#region Protected Properties
protected IDatabase redisDb { get; set; } = null!;
#endregion Protected Properties
#region Public Methods
public List<BaseAlarmBankConf> getAlarmsBankConf()
public List<DisplayDataDTO> getActLog(string fileName = "ActLog.json")
{
List<DisplayDataDTO>? currConf = null;
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
currConf = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.ACTLOG_CONF_KEY, JsonConvert.SerializeObject(currConf));
}
}
if (currConf == null)
{
currConf = new List<DisplayDataDTO>();
}
return currConf;
}
public List<BaseAlarmBankConf> getAlarmsBankConf(string fileName = "AlarmBankList.json")
{
List<BaseAlarmBankConf>? currConf = null;
// leggo e salvo conf stati
string fullPath = Path.Combine(confPath, "AlarmBankList.json");
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -71,11 +74,33 @@ namespace MP.MONO.Core
}
return currConf;
}
public List<BaseAlarmRawConf> getAlarmsRawConf()
public List<DisplayDataDTO> getAlarmsConf(string fileName = "Alarms.json")
{
List<DisplayDataDTO>? currConf = null;
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
currConf = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSet(Constants.ALARMS_ADAP_CONF_KEY, JsonConvert.SerializeObject(currConf));
}
}
if (currConf == null)
{
currConf = new List<DisplayDataDTO>();
}
return currConf;
}
public List<BaseAlarmRawConf> getAlarmsRawConf(string fileName = "AlarmRawList.json")
{
List<BaseAlarmRawConf>? currConf = null;
// leggo e salvo conf stati
string fullPath = Path.Combine(confPath, "AlarmRawList.json");
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -102,11 +127,32 @@ namespace MP.MONO.Core
return currConf;
}
public List<MachineMode> getMachineModeConf()
public List<DisplayDataDTO> getCountersConf(string fileName = "Counters.json")
{
List<DisplayDataDTO>? currConf = null;
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
currConf = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.CNT_STATUS_CONF_KEY, JsonConvert.SerializeObject(currConf));
}
}
if (currConf == null)
{
currConf = new List<DisplayDataDTO>();
}
return currConf;
}
public List<MachineMode> getMachineModeConf(string fileName = "ModeList.json")
{
List<MachineMode>? currConf = null;
// leggo e salvo conf stati
string fullPath = Path.Combine(confPath, "ModeList.json");
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -124,11 +170,11 @@ namespace MP.MONO.Core
return currConf;
}
public List<MachineStatus> getMachineStatusConf()
public List<MachineStatus> getMachineStatusConf(string fileName = "StatusList.json")
{
List<MachineStatus>? currConf = null;
// leggo e salvo conf stati
string fullPath = Path.Combine(confPath, "StatusList.json");
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -146,11 +192,32 @@ namespace MP.MONO.Core
return currConf;
}
public List<DisplayDataDTO> getParamsConf()
public List<DisplayDataDTO> getMPStatusConf(string fileName = "MPStatus.json")
{
List<DisplayDataDTO>? currConf = null;
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
currConf = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.MP_STATUS_CONF_KEY, JsonConvert.SerializeObject(currConf));
}
}
if (currConf == null)
{
currConf = new List<DisplayDataDTO>();
}
return currConf;
}
public List<DisplayDataDTO> getParamsConf(string fileName = "Parameters.json")
{
List<DisplayDataDTO>? currConf = null;
// leggo e salvo conf stati
string fullPath = Path.Combine(confPath, "ParamList.json");
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -168,6 +235,45 @@ namespace MP.MONO.Core
return currConf;
}
public List<DisplayDataDTO> getTools(string fileName = "Tools.json")
{
List<DisplayDataDTO>? currConf = null;
string fullPath = Path.Combine(confPath, fileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
currConf = JsonConvert.DeserializeObject<List<DisplayDataDTO>>(rawData);
// salvo in redis!
redisDb.StringSetAsync(Constants.TOOLS_CONF_KEY, JsonConvert.SerializeObject(currConf));
}
}
if (currConf == null)
{
currConf = new List<DisplayDataDTO>();
}
return currConf;
}
#endregion Public Methods
#region Protected Fields
protected string confPath = "";
#endregion Protected Fields
#region Protected Properties
protected IDatabase redisDb { get; set; } = null!;
#endregion Protected Properties
#region Private Fields
private Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
+1
View File
@@ -43,6 +43,7 @@ namespace MP.MONO.Core
public static readonly string ALARM_ADAPTER_ACT_KEY = $"{BASE_HASH}:Current:AdapterAlarm";
public static readonly string ALARM_ACT_KEY = $"{BASE_HASH}:Current:AlarmsVal";
public static readonly string ALARM_CURR_KEY = $"{BASE_HASH}:Current:Alarms";
public static readonly string ALARM_BLINK_CURR_KEY = $"{BASE_HASH}:Current:AlarmsBlink";
public static readonly string EVENT_LOG_CURR_KEY = $"{BASE_HASH}:Current:EventsLog";
public static readonly string MACH_STATS_CURR_KEY = $"{BASE_HASH}:Current:MachStats";
public static readonly string MAINT_STATS_CURR_KEY = $"{BASE_HASH}:Current:Maintenance";
+4
View File
@@ -37,6 +37,10 @@ namespace MP.MONO.Core.DTO
/// </summary>
public double ValueNum { get; set; } = 0;
/// <summary>
/// Valore scala (da moltiplicare, > 1 aumenta, 0>x>1 riduce)
/// </summary>
public double ScaleFactor { get; set; } = 1;
/// <summary>
/// Display format
/// </summary>
public string DisplFormat { get; set; } = "N0";
+1 -1
View File
@@ -11,7 +11,7 @@
<PackageReference Include="MathNet.Numerics" Version="4.15.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.Management" Version="6.0.0" />
</ItemGroup>
+29 -8
View File
@@ -17,7 +17,10 @@ namespace MP.MONO.Core
public MachineDataValidator()
{
// inizializzo info di base
machTestData = setupData().Result;
if (machTestData == null || machTestData.Count == 0)
{
machTestData = setupData().Result;
}
}
#endregion Public Constructors
@@ -37,6 +40,17 @@ namespace MP.MONO.Core
#region Public Methods
#if false
/// <summary>
/// Verifica validità info correnti
/// </summary>
/// <returns></returns>
public async Task<bool> testCurrInfo()
{
return await testInfo();
}
#endif
/// <summary>
/// Verifica validità info correnti
/// </summary>
@@ -54,7 +68,7 @@ namespace MP.MONO.Core
/// <summary>
/// Dati rispetto cui fare i calcoli di validazione
/// </summary>
private Dictionary<string, string> machTestData = new Dictionary<string, string>();
private static Dictionary<string, string> machTestData = new Dictionary<string, string>();
#endregion Private Fields
@@ -145,18 +159,25 @@ namespace MP.MONO.Core
return answ;
}
public static Dictionary<string, string> biosInfo = new Dictionary<string, string>();
public static Dictionary<string, string> cpuInfo = new Dictionary<string, string>();
public static Dictionary<string, string> netInfo = new Dictionary<string, string>();
public static Dictionary<string, string> osInfo = new Dictionary<string, string>();
public static Dictionary<string, string> ramInfo = new Dictionary<string, string>();
/// <summary>
/// Predispone elenco dati di test
/// </summary>
/// <returns></returns>
private async Task<Dictionary<string, string>> setupData()
{ // creo un unico array di info
{
// creo un unico array di info
Dictionary<string, string> testData = new Dictionary<string, string>();
var biosInfo = await MachineInfo.GetInfo("BIOS");
var cpuInfo = await MachineInfo.GetInfo("CPU");
var netInfo = await MachineInfo.GetInfo("NET");
var osInfo = await MachineInfo.GetInfo("OS");
var ramInfo = await MachineInfo.GetInfo("RAM");
biosInfo = await MachineInfo.GetInfo("BIOS");
cpuInfo = await MachineInfo.GetInfo("CPU");
netInfo = await MachineInfo.GetInfo("NET");
osInfo = await MachineInfo.GetInfo("OS");
ramInfo = await MachineInfo.GetInfo("RAM");
testData = biosInfo.Concat(cpuInfo).Concat(netInfo).Concat(osInfo).Concat(ramInfo).GroupBy(ele => ele.Key).ToDictionary(ele => ele.Key, ele => ele.First().Value);
return testData;
}
+7 -7
View File
@@ -91,7 +91,7 @@ namespace MP.MONO.Core
searchWmiParam(Processor, obj, "SystemBiosMinorVersion", "SystemBiosMinorVersion");
searchWmiParam(Processor, obj, "BiosVersion", "Version");
}
await Task.Delay(1);
return Processor;
}
@@ -157,9 +157,9 @@ namespace MP.MONO.Core
searchWmiParam(Processor, obj, "SocketDesignation", "SocketDesignation");
searchWmiParam(Processor, obj, "SystemName", "SystemName");
searchWmiParam(Processor, obj, "CpuVersion", "Version");
}
}
await Task.Delay(1);
return Processor;
}
@@ -194,9 +194,9 @@ namespace MP.MONO.Core
searchWmiParam(Processor, obj, "PhysicalAdapter", "PhysicalAdapter");
searchWmiParam(Processor, obj, "ProductName", "ProductName");
searchWmiParam(Processor, obj, "ServiceName", "ServiceName");
}
}
await Task.Delay(1);
return Processor;
}
@@ -230,7 +230,7 @@ namespace MP.MONO.Core
searchWmiParam(Processor, obj, "BuildNumber", "BuildNumber");
}
await Task.Delay(1);
return Processor;
}
@@ -267,7 +267,7 @@ namespace MP.MONO.Core
searchWmiParam(Processor, obj, "PartNumber", "PartNumber");
}
await Task.Delay(1);
return Processor;
}
+23 -21
View File
@@ -8,6 +8,26 @@ namespace MP.MONO.DECODER
{
public class CounterManager
{
#region Public Fields
public static string alarmStatus = "";
public static bool valueChanged = false;
#endregion Public Fields
#region Protected Fields
protected static Logger Log = LogManager.GetCurrentClassLogger();
protected static string luaPath = "";
protected static Lua state = new Lua();
protected List<string> AlarmList = new List<string>();
#endregion Protected Fields
#region Private Fields
/// <summary>
@@ -17,22 +37,6 @@ namespace MP.MONO.DECODER
#endregion Private Fields
#region Protected Fields
protected static Logger Log = LogManager.GetCurrentClassLogger();
protected static string luaPath = "";
protected static Lua state = new Lua();
protected List<string> AlarmList = new List<string>();
#endregion Protected Fields
#region Public Fields
public static string alarmStatus = "";
public static bool valueChanged = false;
#endregion Public Fields
#region Public Constructors
public CounterManager()
@@ -45,8 +49,8 @@ namespace MP.MONO.DECODER
luaPath = Path.Combine(Directory.GetCurrentDirectory(), "lua", "ParamsDecoder.lua");
state.DoFile(luaPath);
Log.Info("ParamsManager OK");
Console.WriteLine("ParamsManager OK");
Log.Info("CounterManager OK");
Console.WriteLine("CounterManager OK");
}
#endregion Public Constructors
@@ -121,7 +125,7 @@ namespace MP.MONO.DECODER
Log.Trace($"calcVal: {calcVal}");
}
}
catch(Exception exc)
catch (Exception exc)
{
Log.Error($"exception during processData for {item.Key}{Environment.NewLine}{exc}");
}
@@ -135,7 +139,6 @@ namespace MP.MONO.DECODER
MachineId = 1,
ValNum = calcVal,
ValStr = $"{calcVal:N3}"
};
answ.Add(dbRecord);
@@ -145,7 +148,6 @@ namespace MP.MONO.DECODER
}
}
return answ;
}
+20 -2
View File
@@ -6,14 +6,26 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2206.2217</Version>
<Version>1.2.2209.2116</Version>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
<None Remove="appsettings.multiax.json" />
<None Remove="appsettings.office.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.multiax.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="appsettings.office.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
@@ -25,7 +37,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="NLua" Version="1.6.0" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
</ItemGroup>
<ItemGroup>
@@ -45,6 +57,12 @@
<None Update="logs\stdout.log">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="lua\CountersDecoder.lua">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="lua\StatusDecoder.lua">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="lua\ParamsDecoder.lua">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+59 -96
View File
@@ -8,30 +8,27 @@ namespace MP.MONO.DECODER
{
public class MPStatusManager
{
#region Private Fields
#region Public Fields
/// <summary>
/// Dizionario dei valori accumulati sulle variabili
/// </summary>
private Dictionary<string, VCData> ParamsAccumulator = new Dictionary<string, VCData>();
public static bool valueChanged = false;
#endregion Private Fields
#endregion Public Fields
#region Protected Fields
protected static Logger Log = LogManager.GetCurrentClassLogger();
protected static string luaPath = "";
protected static Lua state = new Lua();
protected List<string> AlarmList = new List<string>();
#endregion Protected Fields
#region Public Fields
#region Private Fields
public static string alarmStatus = "";
public static bool valueChanged = false;
#endregion Public Fields
#endregion Private Fields
#region Public Constructors
@@ -39,14 +36,13 @@ namespace MP.MONO.DECODER
{
// preparo variabile x avvisare script che il modo è da NLua
state["callMode"] = "NLua";
state["vcFunct"] = "AVG";
// carico il file
luaPath = Path.Combine(Directory.GetCurrentDirectory(), "lua", "ParamsDecoder.lua");
luaPath = Path.Combine(Directory.GetCurrentDirectory(), "lua", "StatusDecoder.lua");
state.DoFile(luaPath);
Log.Info("ParamsManager OK");
Console.WriteLine("ParamsManager OK");
Log.Info("MPStatusManager OK");
Console.WriteLine("MPStatusManager OK");
}
#endregion Public Constructors
@@ -54,99 +50,66 @@ namespace MP.MONO.DECODER
#region Public Methods
/// <summary>
/// Funzione chiamata LUA x calcolo degli eventuali parametri con periodi "scaduti"
/// Funzione chiamata LUA x calcolo dati PLATE (stato macchina e processo)
/// </summary>
/// <param name="paramsList"></param>
/// <param name="redisParamConf"></param>
/// <param name="MachinePlate"></param>
/// <returns></returns>
public List<DataLogModel> processData(Dictionary<string, double> paramsList, List<DisplayDataDTO> redisParamConf)
public bool processData(Dictionary<string, int> paramsList, ref MachineDTO? MachinePlate)
{
List<DataLogModel> answ = new List<DataLogModel>();
bool calcOk = false;
if (MachinePlate == null)
{
MachinePlate = new MachineDTO();
}
DateTime adesso = DateTime.Now;
// vado ad "accumulare i dati" a quelli presenti...
state.NewTable("dataList");
var currTable = state.GetTable("dataList");
foreach (var item in paramsList)
{
var currParam = redisParamConf.FirstOrDefault(x => x.Title == item.Key);
// cerco nelle variabili accomulatori...
if (!ParamsAccumulator.ContainsKey(item.Key))
{
if (currParam != null)
{
var dataList = new List<double>();
dataList.Add(item.Value);
VCData newSet = new VCData()
{
dataArray = dataList,
DTStart = adesso,
Funzione = currParam.VcFunc,
Period = currParam.SamplePeriod
};
// se non ci fosse creo
ParamsAccumulator.Add(item.Key, newSet);
}
}
else
{
// altrimenti aggiungo
ParamsAccumulator[item.Key].dataArray.Add(item.Value);
}
currTable[item.Key] = item.Value;
}
// ripasso table
state["dataList"] = currTable;
state["numRec"] = paramsList.Count;
// effettuo verifiche scadenza
bool calcOk = false;
double calcVal = 0;
if (ParamsAccumulator.ContainsKey(item.Key))
{
if (ParamsAccumulator[item.Key].isElapsed)
{
string funcMode = $"{ParamsAccumulator[item.Key].Funzione}";
// se scaduto --> mando a LUA x calcolo
state["valList"] = ParamsAccumulator[item.Key].dataArray;
state["numRec"] = ParamsAccumulator[item.Key].dataArray.Count;
state["vcFunct"] = funcMode;
// effettuo calcolo
state.DoString("doProcess()");
// recupero valore calcolato
bool.TryParse(state.GetString("calcOk"), out calcOk);
if (calcOk)
{
try
{
var stringVal = state.GetString("calcVal");
if (!string.IsNullOrEmpty(stringVal))
{
calcVal = state.GetNumber("calcVal");
Log.Trace($"calcVal: {calcVal}");
}
}
catch(Exception exc)
{
Log.Error($"exception during processData for {item.Key}{Environment.NewLine}{exc}");
}
}
// aggiungo alla lista finale...
var dbRecord = new DataLogModel()
{
DtRif = adesso,
FluxType = item.Key,
MachineId = 1,
ValNum = calcVal,
ValStr = $"{calcVal:N3}"
};
answ.Add(dbRecord);
// elimino dai valori accumulati...
ParamsAccumulator.Remove(item.Key);
}
}
try
{
// effettuo calcolo
state.DoString("doProcess()");
}
catch (Exception exc)
{
Log.Error($"exception during doProcess{Environment.NewLine}{exc}");
}
// recupero valore calcolato
bool.TryParse(state.GetString("calcOk"), out calcOk);
if (calcOk)
{
try
{
var stringVal = state.GetString("statusId");
if (!string.IsNullOrEmpty(stringVal))
{
MachinePlate.StatusId = state.GetInteger("statusId");
}
stringVal = state.GetString("modeId");
if (!string.IsNullOrEmpty(stringVal))
{
MachinePlate.ModeId = state.GetInteger("modeId");
}
}
catch (Exception exc)
{
Log.Error($"exception during processData{Environment.NewLine}{exc}");
}
}
else
{ }
return answ;
return calcOk;
}
#endregion Public Methods
-24
View File
@@ -1,24 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.MONO.DECODER
{
public class MyClass
{
public int IntegerProperty { get; set; }
public void DoSomething(string p)
{
Console.WriteLine($"Doing something: {p}");
}
public void SaveData(string key, object objVal)
{
string rawData = JsonConvert.SerializeObject(objVal);
Console.WriteLine($"Request save | key: {key} | value: {rawData}");
}
}
}
+367 -89
View File
@@ -10,6 +10,7 @@ using Newtonsoft.Json;
using NLog;
using NLua;
using StackExchange.Redis;
using System.Diagnostics;
using System.Reflection;
using static MP.MONO.Core.Enums;
@@ -83,6 +84,10 @@ List<MachineStatus>? machineStatusConf = new List<MachineStatus>();
MachineDTO machinePlate = new MachineDTO();
// gestione configurazioni da redis
int BlinkCount = 1;
bool AlarmIgnoreEmpty = true;
string AlarmCleanPre = "";
string AlarmCleanPost = "";
setupConf();
/* --------------------------------
@@ -122,8 +127,6 @@ DateTime lastExecStatus = DateTime.Now.AddHours(-1);
// registro gestione eventi
mpStatusRecvPipe.EA_NewMessage += MpStatusRecvPipe_EA_NewMessage;
/* --------------------------------
* Setup Gestione Counters
* --------------------------------*/
@@ -136,7 +139,6 @@ DateTime lastExecCounters = DateTime.Now.AddHours(-1);
// registro gestione eventi
counterRecvPipe.EA_NewMessage += CounterRecvPipe_EA_NewMessage;
/* --------------------------------
* Funzioni / metodi accessori
* --------------------------------*/
@@ -145,6 +147,14 @@ counterRecvPipe.EA_NewMessage += CounterRecvPipe_EA_NewMessage;
/// </summary>
void setupConf()
{
// imposto blinkCount da conf...
string rConf = config["OptPar:BlinkCount"];
int.TryParse(rConf, out BlinkCount);
// imposto parametri x Alarms
rConf = config["OptPar:AlarmIgnoreEmpty"];
bool.TryParse(rConf, out AlarmIgnoreEmpty);
AlarmCleanPre = config["OptPar:AlarmCleanPre"];
AlarmCleanPost = config["OptPar:AlarmCleanPost"];
// recupero valori e deserializzo
string rawData = "";
@@ -153,7 +163,7 @@ void setupConf()
if (!string.IsNullOrEmpty(rawData))
{
var currData = JsonConvert.DeserializeObject<MachineDTO>(rawData);
machinePlate = currData != null ? currData: new MachineDTO();
machinePlate = currData != null ? currData : new MachineDTO();
}
// machine status (display) conf
@@ -211,11 +221,21 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e)
try
{
// decodifico allarmi ricevuti
var alarmList = JsonConvert.DeserializeObject<List<string>>(currArgs.newMessage);
var alarmListRaw = JsonConvert.DeserializeObject<List<string>>(currArgs.newMessage);
// effettuo selezione dei SOLI allarmi distinct (in caso di cambio posizione...)
List<string> alarmList = new List<string>();
if (alarmListRaw != null && alarmListRaw.Count > 0)
{
alarmList = alarmListRaw
.GroupBy(x => x)
.Select(grp => grp.First())
.ToList();
}
List<AlarmRecModel> alarmRecList = new List<AlarmRecModel>();
List<AlarmLogModel> alarmLogList = new List<AlarmLogModel>();
// gestione allarmi muted
List<AlarmListModel>? mutedAlarmsList = new List<AlarmListModel>();
string rawData = redisDb.StringGet(Constants.ALARMS_SETT_RLIST_KEY);
if (!string.IsNullOrEmpty(rawData))
@@ -228,72 +248,120 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e)
}
// rileggo da REDIS la conf attuale allarmi già attivi da area ALARM_CURR_KEY
List<string>? lastAlarms = new List<string>();
List<string> lastAlarms = new List<string>();
rawData = redisDb.StringGet(Constants.ALARM_CURR_KEY);
// se trovati uso questi...
if (!string.IsNullOrEmpty(rawData))
{
lastAlarms = JsonConvert.DeserializeObject<List<string>>(rawData);
var rawLastAlarms = JsonConvert.DeserializeObject<List<string>>(rawData);
lastAlarms = rawLastAlarms != null ? rawLastAlarms : new List<string>();
}
// altrimenti parto da vuoto
else
// recupero DICT dei blink allarmi (per filtrare fronte discesa in caso di allarmi che cessano e tornano attivi)
Dictionary<string, int> blinkStatus = new Dictionary<string, int>();
rawData = redisDb.StringGet(Constants.ALARM_BLINK_CURR_KEY);
// se trovati uso questi...
if (!string.IsNullOrEmpty(rawData))
{
lastAlarms = new List<string>();
var rawBlink = JsonConvert.DeserializeObject<Dictionary<string, int>>(rawData);
blinkStatus = rawBlink != null ? rawBlink : new Dictionary<string, int>();
}
// ciclo x ogni allarme ricevuto x vedere se sia INIZIATO
if (alarmList != null)
{
// ciclo x ogni allarme attivo x verificare se si sia CHIUSO
foreach (var newAlarm in alarmList)
{
// in primis... se è muted --> lo escludo...
bool isMuted = false;
var maybeMuted = mutedAlarmsList.Where(x => x.FullValue == newAlarm).FirstOrDefault();
if (maybeMuted != null)
var currNewAlarm = newAlarm;
// se ho valori trim pre/post li applica...
if (!string.IsNullOrEmpty(AlarmCleanPre))
{
isMuted = maybeMuted.Muted;
currNewAlarm = currNewAlarm.Replace(AlarmCleanPre, "");
}
// cerco l'allarme nell'elenco degli allarmi dal DB
var foundAlarm = alarmsRecorded
.Where(x => x.FullValue == newAlarm)
.FirstOrDefault();
// se non lo trovo --> chiamo procedura che verifica su DB, eventualmente inserisce, restituisce nuovo elenco
if (foundAlarm == null)
if (!string.IsNullOrEmpty(AlarmCleanPost))
{
// salvo sul DB
foundAlarm = dbController.AlarmListInsert(newAlarm);
// ora rileggo ed aggiorno redis e cerco di nuovo record...
alarmsRecorded = dbController.AlarmListGetAll();
redisDb.StringSet(Constants.ALARMS_SETT_RLIST_KEY, JsonConvert.SerializeObject(alarmsRecorded));
currNewAlarm = currNewAlarm.Replace(AlarmCleanPost, "");
}
if (!isMuted && lastAlarms != null)
// se AlarmIgnoreEmpty=true + vuoto --> salto
if (AlarmIgnoreEmpty && string.IsNullOrWhiteSpace(currNewAlarm))
{
if (!lastAlarms.Contains(newAlarm))
{
if (foundAlarm != null)
{
// segno come iniziato...
AlarmRecModel newAlarmRec = new AlarmRecModel()
{
MachineId = MachineId,
DtStart = adesso,
DtEnd = adesso,
AlarmId = foundAlarm.AlarmId
};
alarmRecList.Add(newAlarmRec);
}
}
alarmList.Remove(currNewAlarm);
alarmList.Remove(newAlarm);
}
else
{
// rimuovo da alarmList
alarmList.Remove(newAlarm);
// in primis... se è muted --> lo escludo...
bool isMuted = false;
var maybeMuted = mutedAlarmsList.Where(x => x.FullValue == currNewAlarm).FirstOrDefault();
if (maybeMuted != null)
{
isMuted = maybeMuted.Muted;
}
// cerco l'allarme nell'elenco degli allarmi dal DB
var foundAlarm = alarmsRecorded
.Where(x => x.FullValue == currNewAlarm)
.FirstOrDefault();
// se non lo trovo --> chiamo procedura che verifica su DB, eventualmente inserisce, restituisce nuovo elenco
if (foundAlarm == null)
{
// salvo sul DB
foundAlarm = dbController.AlarmListInsert(currNewAlarm);
// ora rileggo ed aggiorno redis e cerco di nuovo record...
alarmsRecorded = dbController.AlarmListGetAll();
redisDb.StringSet(Constants.ALARMS_SETT_RLIST_KEY, JsonConvert.SerializeObject(alarmsRecorded));
}
if (!isMuted)
{
if (!lastAlarms.Contains(currNewAlarm))
{
if (foundAlarm != null)
{
// segno come iniziato...
AlarmRecModel newAlarmRec = new AlarmRecModel()
{
MachineId = MachineId,
DtStart = adesso,
DtEnd = adesso,
AlarmId = foundAlarm.AlarmId
};
alarmRecList.Add(newAlarmRec);
}
// gestione blink allarmi
if (blinkStatus.ContainsKey(currNewAlarm))
{
blinkStatus[currNewAlarm] = BlinkCount;
Log.Info($"Alarm: {currNewAlarm} | BlinkCount: {BlinkCount}");
}
else
{
blinkStatus.Add(currNewAlarm, BlinkCount);
Log.Info($"NEW Alarm: {currNewAlarm} | BlinkCount: {BlinkCount}");
}
}
}
else
{
// rimuovo da alarmList perché muted...
alarmList.Remove(currNewAlarm);
alarmList.Remove(newAlarm);
}
}
}
}
// recupero elenco valori blink
List<string> chiavi = blinkStatus.Select(x => x.Key).ToList();
// decremento i blink
foreach (var item in chiavi)
{
if (blinkStatus[item] > 0)
{
blinkStatus[item]--;
}
}
// salvo blink status counter...
redisDb.StringSet(Constants.ALARM_BLINK_CURR_KEY, JsonConvert.SerializeObject(blinkStatus));
// processo elenco allarmi già presenti
if (lastAlarms != null)
@@ -301,8 +369,18 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e)
// ciclo x ogni allarme attivo x verificare se si sia CHIUSO
foreach (var oldData in lastAlarms)
{
var trovato = alarmList.Contains(oldData);
if (!trovato)
bool trovato = false;
if (alarmList != null)
{
trovato = alarmList.Contains(oldData);
}
bool isBlinking = false;
if (blinkStatus.ContainsKey(oldData))
{
isBlinking = blinkStatus[oldData] > 0;
}
if (!trovato && !isBlinking)
{
// se non lo trovo
var foundAlarm = alarmsRecorded
@@ -318,27 +396,30 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e)
}
// verifico se devo scrivere
bool wALog = lastAlarms.Count != alarmList.Count;
if (!wALog)
if (lastAlarms != null && alarmList != null)
{
// verifico se ci siano differenze...
wALog = alarmList.Union(lastAlarms).Count() != lastAlarms.Count;
}
// salvo se c'è stata variazione...
if (wALog)
{
// preparo dati x alarmLog
AlarmLogModel newAlarmLog = new AlarmLogModel()
bool wALog = lastAlarms.Count != alarmList.Count;
if (!wALog)
{
MachineId = MachineId,
DtRif = adesso,
MemAddress = "ND",
Index = 0,
Status = (uint)alarmList.Count,
ValDecoded = alarmList.Count > 0 ? string.Join(", ", alarmList) : "All OK"
};
alarmLogList.Add(newAlarmLog);
// verifico se ci siano differenze...
wALog = alarmList.Union(lastAlarms).Count() != lastAlarms.Count;
}
// salvo se c'è stata variazione...
if (wALog)
{
// preparo dati x alarmLog
AlarmLogModel newAlarmLog = new AlarmLogModel()
{
MachineId = MachineId,
DtRif = adesso,
MemAddress = "ND",
Index = 0,
Status = (uint)alarmList.Count,
ValDecoded = alarmList.Count > 0 ? string.Join(", ", alarmList) : "All OK"
};
alarmLogList.Add(newAlarmLog);
}
}
// serializzo l'elenco allarmi...
@@ -353,7 +434,6 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e)
// salvo nuovo elenco allarmi
lastAlarms = alarmList;
}
catch
{ }
@@ -524,21 +604,21 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
try
{
// verifico codici ricevuti
var dataList = JsonConvert.DeserializeObject<Dictionary<string, int>>(currArgs.newMessage);
var dataList = JsonConvert.DeserializeObject<Dictionary<string, string>>(currArgs.newMessage);
if (dataList != null)
{
/************************************************************************
*
*
* <BROADCAST_EVENT DESCRIPTION = "MACHINE STATUS" IDENTIFIER = "1" >
* <!--
* DESCRIPTION:
* DESCRIPTION:
* 0: MACHINE OFF
* 1: MACHINE ON
* -->
*
*
* <BROADCAST_EVENT DESCRIPTION = "PROC 1 STATUS" IDENTIFIER = "500" >
* <!--
* DESCRIPTION:
* DESCRIPTION:
* 1: IDLE
* 2: CYCLE (RUN)
* 3: HOLD (HOLD, RUNH, HRUN)
@@ -546,10 +626,10 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
* 8: RESET
* 11: PAUSE (WAIT, INPUT)
* -->
*
*
* <BROADCAST_EVENT DESCRIPTION = "PROC 1 MODE" IDENTIFIER = "501" >
* <!--
* DESCRIPTION:
* DESCRIPTION:
* 1: MDI
* 2: AUTO
* 3: STEP (BLK-BLK)
@@ -559,18 +639,17 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
* 7: HOME
* 8: HPG (HANDWHEEL)
* -->
*
*
*
*
*************************************************************************/
// recupero elenco parametri salvati in redis...
MachineDTO? machinePlate = new MachineDTO();
Dictionary<string, int> parList = new Dictionary<string, int>();
string rawData = redisDb.StringGet(Constants.MACHINE_CONF_PLATE);
if (!string.IsNullOrEmpty(rawData))
{
machinePlate = JsonConvert.DeserializeObject<MachineDTO>(rawData);
}
int machStatus = 0;
@@ -578,84 +657,118 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
int procMode = 0;
string currKey = "";
// ora processo il messaggio ricevuto x stati e modi vari
currKey = "MACHINE STATUS";
if (dataList.ContainsKey(currKey))
{
int.TryParse(currKey, out machStatus);
int.TryParse(dataList[currKey], out machStatus);
parList.Add(currKey, machStatus);
}
currKey = "PROCESS STATUS";
if (dataList.ContainsKey(currKey))
{
int.TryParse(currKey, out procStatus);
int.TryParse(dataList[currKey], out procStatus);
parList.Add(currKey, procStatus);
}
currKey = "PROCESS MODE";
if (dataList.ContainsKey(currKey))
{
int.TryParse(currKey, out procMode);
int.TryParse(dataList[currKey], out procMode);
parList.Add(currKey, procMode);
}
// fix me todo inserire gestione program name!!!
Stopwatch sw = new Stopwatch();
sw.Start();
#if false
// calcolo status
if (machStatus == 0)
{
machinePlate.StatusId = 7;
}
else {
else
{
switch (procMode)
{
case 1:
machinePlate.StatusId = 8;
break;
case 2:
machinePlate.StatusId = 2;
break;
case 3:
machinePlate.StatusId = 9;
break;
case 4:
machinePlate.StatusId = 5;
break;
case 5:
machinePlate.StatusId = 10;
break;
case 6:
machinePlate.StatusId = 11;
break;
case 7:
machinePlate.StatusId = 12;
break;
case 8:
machinePlate.StatusId = 13;
break;
default:
break;
}
}
// eseguo cablata la gestione x ora... rispetto a MachineStatus + MachineMode invierò un machineDTO
switch (procStatus)
{
case 1:
machinePlate.ModeId = 2;
break;
case 2:
machinePlate.ModeId = 1;
break;
case 3:
machinePlate.ModeId = 3;
break;
case 6:
machinePlate.ModeId = 8;
break;
case 8:
machinePlate.ModeId = 9;
break;
case 11:
machinePlate.ModeId = 10;
break;
default:
break;
}
sw.Stop();
Log.Info($"Calcolo C# | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(machinePlate)}");
Log.Info("-------------");
#endif
// calcolo con LUA e vedo se cambia...
sw.Restart();
bool done = mpStatusMan.processData(parList, ref machinePlate);
sw.Stop();
//Log.Info("-------------");
Log.Info($"Calcolo LUA | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(machinePlate)}");
//Log.Info("-------------");
// invio sulla message pipeline corretta TUTTI i parametri aggiornati serializzati
string updRawVal = JsonConvert.SerializeObject(machinePlate);
@@ -674,9 +787,174 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
/// </summary>
void CounterRecvPipe_EA_NewMessage(object? sender, EventArgs e)
{
throw new NotImplementedException();
}
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly Dictionary<string,int> --> parametri valorizzati (tra quelli configurati)
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
#if false
DateTime adesso = DateTime.Now;
try
{
// verifico codici ricevuti
var dataList = JsonConvert.DeserializeObject<Dictionary<string, string>>(currArgs.newMessage);
if (dataList != null)
{
/************************************************************************
*
* <BROADCAST_EVENT DESCRIPTION = "MACHINE STATUS" IDENTIFIER = "1" >
* <!--
* DESCRIPTION:
* 0: MACHINE OFF
* 1: MACHINE ON
* -->
*
* <BROADCAST_EVENT DESCRIPTION = "PROC 1 STATUS" IDENTIFIER = "500" >
* <!--
* DESCRIPTION:
* 1: IDLE
* 2: CYCLE (RUN)
* 3: HOLD (HOLD, RUNH, HRUN)
* 6: ERROR
* 8: RESET
* 11: PAUSE (WAIT, INPUT)
* -->
*
* <BROADCAST_EVENT DESCRIPTION = "PROC 1 MODE" IDENTIFIER = "501" >
* <!--
* DESCRIPTION:
* 1: MDI
* 2: AUTO
* 3: STEP (BLK-BLK)
* 4: MANU (MANJOG)
* 5: MANJ (INCJOG)
* 6: RETPROF (PROFILE)
* 7: HOME
* 8: HPG (HANDWHEEL)
* -->
*
*
*************************************************************************/
// recupero elenco parametri salvati in redis...
MachineDTO? machinePlate = new MachineDTO();
string rawData = redisDb.StringGet(Constants.MACHINE_CONF_PLATE);
if (!string.IsNullOrEmpty(rawData))
{
machinePlate = JsonConvert.DeserializeObject<MachineDTO>(rawData);
}
int machStatus = 0;
int procStatus = 0;
int procMode = 0;
string currKey = "";
// ora processo il messaggio ricevuto x stati e modi vari
currKey = "MACHINE STATUS";
if (dataList.ContainsKey(currKey))
{
int.TryParse(dataList[currKey], out machStatus);
}
currKey = "PROCESS STATUS";
if (dataList.ContainsKey(currKey))
{
int.TryParse(dataList[currKey], out procStatus);
}
currKey = "PROCESS MODE";
if (dataList.ContainsKey(currKey))
{
int.TryParse(dataList[currKey], out procMode);
}
// fix me todo inserire gestione program name!!!
if (machStatus == 0)
{
machinePlate.StatusId = 7;
}
else
{
switch (procMode)
{
case 1:
machinePlate.StatusId = 8;
break;
case 2:
machinePlate.StatusId = 2;
break;
case 3:
machinePlate.StatusId = 9;
break;
case 4:
machinePlate.StatusId = 5;
break;
case 5:
machinePlate.StatusId = 10;
break;
case 6:
machinePlate.StatusId = 11;
break;
case 7:
machinePlate.StatusId = 12;
break;
case 8:
machinePlate.StatusId = 13;
break;
default:
break;
}
}
// eseguo cablata la gestione x ora... rispetto a MachineStatus + MachineMode invierò un machineDTO
switch (procStatus)
{
case 1:
machinePlate.ModeId = 2;
break;
case 2:
machinePlate.ModeId = 1;
break;
case 3:
machinePlate.ModeId = 3;
break;
case 6:
machinePlate.ModeId = 8;
break;
case 8:
machinePlate.ModeId = 9;
break;
case 11:
machinePlate.ModeId = 10;
break;
default:
break;
}
// invio sulla message pipeline corretta TUTTI i parametri aggiornati serializzati
string updRawVal = JsonConvert.SerializeObject(machinePlate);
paramsSendPipe.saveAndSendMessage(Constants.STATUS_CURR_KEY, updRawVal);
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in MpStatusRecvPipe_EA_NewMessage:{Environment.NewLine}{exc}");
}
#endif
}
}
/* --------------------------------
* MAIN
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2206.2217</h4>
<h4>Version: 1.2.2209.2116</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2206.2217
1.2.2209.2116
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2206.2217</version>
<version>1.2.2209.2116</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+9 -3
View File
@@ -7,8 +7,8 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=nkc.password",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
@@ -33,6 +33,12 @@
}
},
"OptPar": {
"AlarmMode": "RawList"
"AlarmCleanPre": "",
"AlarmCleanPost": "",
"AlarmIgnoreEmpty": true,
"AlarmMode": "RawList",
"AlarmRegexp": "^{[\\d\\w\\:\\ \\.\\/\\(\\)]*}",
//"AlarmRegexp": "^{.*}",
"BlinkCount": 0
}
}
+38
View File
@@ -0,0 +1,38 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "localhost:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=pwd-MAPO!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "localhost",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"MachineId": 1,
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"OptPar": {
"AlarmMode": "RawList"
}
}
+38
View File
@@ -0,0 +1,38 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "10.74.82.230",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"MachineId": 1,
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"OptPar": {
"AlarmMode": "RawList"
}
}
+105
View File
@@ -0,0 +1,105 @@
--[[---------------------------------------------------
Procedura calcolo statistiche parametri:
Variabili IN:
- vcFunct(string): tipo di processing da effettuare tra [POINT/AVG/MEDIAN/MIN/MAX]
- valList(<double>): elenco VALORI double da processare
- numRec(int): conteggio numero recorda da processare
Variabili OUT:
- calcVal(double): valore calcolato finale
-----------------------------------------------------]]
-- Per eventuale debug
local ZBS = "c:/ZeroBraneStudio"
if not package.path:find(ZBS,1,true) then
package.path = ZBS .. "/lualibs/?/?.lua;" .. ZBS .. "/lualibs/?.lua;" .. package.path
package.cpath = ZBS .. "/bin/?.dll;" .. ZBS .. "/bin/clibs53/?.dll;" .. package.cpath
end
-- se non è da NLua inizializzo variabili accessorie
local function checkInit()
if (callMode ~= 'NLua') then
-- imposto valori test
valList = { 4467, 4468, 4467, 4467, 4467, 4467 }
numRec = #valList
--valList = { 4.0, 5.0, 3.0, 6.0, 1.0, 2.0 }
vcFunct = 'AVG'
--POINT AVG MEDIAN MIN MAX
end
end
local function setupTable()
if numRec > 0 and valList[0] ~= nil then
for i = numRec, 1, -1 do
valListTable[i] = valList[i-1]
end
else
valListTable = valList
end
end
local function doCalc()
if(numRec > 0) then
-- verifica il tipo di richiesta
if(vcFunct == 'AVG') then
s = 0
for i,v in ipairs(valListTable) do
s = s + v
end
calcVal = s / numRec
elseif(vcFunct == 'POINT') then
calcVal = valListTable[numRec]
elseif(vcFunct == 'MEDIAN') then
table.sort(valListTable)
calcVal = valListTable[numRec/2]
elseif(vcFunct == 'MIN') then
table.sort(valListTable)
calcVal = valListTable[1]
elseif(vcFunct == 'MAX') then
table.sort(valListTable)
calcVal = valListTable[numRec]
end
calcOk = true
else
calcVal = -999999
numRec = 1
calcOk = false
end
end
local function displayTestInfo()
if (callMode ~= 'NLua') then
print('------------------------------')
print('calcOk: ' .. tostring(calcOk) .. ' | vcFunct: ' .. vcFunct)
for i,val in pairs(valList) do
print("v_"..i.." | "..val)
end
print('calcVal: ' .. calcVal)
print('------------------------------')
end
end
-- MAIN
function doProcess()
-- variabile semaforo callMode (locali o remote da NLua)
callMode = callMode or ''
calcVal = -999
vcFunct = vcFunct or ''
valList = valList or {}
numRec = numRec or 1
calcOk = false
valListTable = {}
checkInit()
setupTable()
doCalc()
displayTestInfo()
end
if (callMode ~= 'NLua') then
doProcess()
end
+159
View File
@@ -0,0 +1,159 @@
--[[---------------------------------------------------
Procedura calcolo statistiche parametri:
Variabili IN:
- lastMode
- valList(<double>): elenco VALORI double da processare
- numRec(int): conteggio numero recorda da processare
Variabili OUT:
- calcVal(double): valore calcolato finale
-----------------------------------------------------]]
-- Per eventuale debug
local ZBS = "c:/ZeroBraneStudio"
if not package.path:find(ZBS,1,true) then
package.path = ZBS .. "/lualibs/?/?.lua;" .. ZBS .. "/lualibs/?.lua;" .. package.path
package.cpath = ZBS .. "/bin/?.dll;" .. ZBS .. "/bin/clibs53/?.dll;" .. package.cpath
end
-- se non è da NLua inizializzo variabili accessorie
local function checkInit()
if (callMode ~= 'NLua') then
-- imposto valori test
dataList = {}
dataList["MACHINE STATUS"] = 1
dataList["PROCESS STATUS"] = 2
dataList["PROCESS MODE"] = 2
end
numRec = tablelength(dataList)
end
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
-- Main function: effettua calcolo stato secondo i parametri ricevuti
local function doCalc()
-- se ho dati processo
if(numRec > 0) then
-- /************************************************************************
-- *
-- * <BROADCAST_EVENT DESCRIPTION = "MACHINE STATUS" IDENTIFIER = "1" >
-- * <!--
-- * DESCRIPTION:
-- * 0: MACHINE OFF
-- * 1: MACHINE ON
-- * -->
-- *
-- * <BROADCAST_EVENT DESCRIPTION = "PROC 1 STATUS" IDENTIFIER = "500" >
-- * <!--
-- * DESCRIPTION:
-- * 1: IDLE
-- * 2: CYCLE (RUN)
-- * 3: HOLD (HOLD, RUNH, HRUN)
-- * 6: ERROR
-- * 8: RESET
-- * 11: PAUSE (WAIT, INPUT)
-- * -->
-- *
-- * <BROADCAST_EVENT DESCRIPTION = "PROC 1 MODE" IDENTIFIER = "501" >
-- * <!--
-- * DESCRIPTION:
-- * 1: MDI
-- * 2: AUTO
-- * 3: STEP (BLK-BLK)
-- * 4: MANU (MANJOG)
-- * 5: MANJ (INCJOG)
-- * 6: RETPROF (PROFILE)
-- * 7: HOME
-- * 8: HPG (HANDWHEEL)
-- * -->
-- *
-- *
-- *************************************************************************/
-- calcolo dello statusId
if(dataList["MACHINE STATUS"] == 0) then
statusId = 7
else
if(dataList["PROCESS MODE"] == 1) then
statusId = 8
elseif(dataList["PROCESS MODE"] == 2) then
statusId = 2
elseif(dataList["PROCESS MODE"] == 3) then
statusId = 9
elseif(dataList["PROCESS MODE"] == 4) then
statusId = 5
elseif(dataList["PROCESS MODE"] == 5) then
statusId = 10
elseif(dataList["PROCESS MODE"] == 6) then
statusId = 11
elseif(dataList["PROCESS MODE"] == 7) then
statusId = 12
elseif(dataList["PROCESS MODE"] == 8) then
statusId = 13
end
end
-- calcolo del processId
if(dataList["PROCESS STATUS"] == 1) then
modeId = 2
elseif(dataList["PROCESS STATUS"] == 2) then
modeId = 1
elseif(dataList["PROCESS STATUS"] == 3) then
modeId = 3
elseif(dataList["PROCESS STATUS"] == 6) then
modeId = 8
elseif(dataList["PROCESS STATUS"] == 8) then
modeId = 9
elseif(dataList["PROCESS STATUS"] == 11) then
modeId = 10
end
calcOk = true
-- altrimenti errore
else
numRec = 1
calcOk = false
end
end
local function displayTestInfo()
if (callMode ~= 'NLua') then
print('------------------------------')
print('calcOk: ' .. tostring(calcOk))
for i,val in pairs(dataList) do
print(""..i.." | "..val)
end
print('statusId: ' .. statusId)
print('modeId: ' .. modeId)
print('------------------------------')
end
end
-- MAIN
function doProcess()
-- variabile semaforo callMode (locali o remote da NLua)
callMode = callMode or ''
numRec = 0
statusId = 0
modeId = 0
dataList = dataList or {}
calcOk = false
--vero task da eseguire
checkInit()
doCalc()
displayTestInfo()
end
if (callMode ~= 'NLua') then
doProcess()
end
@@ -62,6 +62,20 @@ namespace MP.MONO.Data.DbModels
return answ;
}
}
/// <summary>
/// Valore remaining come % ore rimanenti alla scadenza, range 0..100
/// (valore expiry - valore attuale del counter) / ExpiryVal
/// </summary>
public double CountRemainPerc
{
get
{
double num = this.CountRemainVal;
double den = this.ExpiryVal > 0 ? this.ExpiryVal : 1;
double answ = num / den;
return answ;
}
}
/// <summary>
/// Contatore associato al task
+1 -1
View File
@@ -27,7 +27,7 @@
</PackageReference>
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
</ItemGroup>
</Project>
+38 -23
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2206.2217</Version>
<Version>1.2.2209.2116</Version>
</PropertyGroup>
<ItemGroup>
@@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="StackExchange.Redis" Version="2.5.43" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
</ItemGroup>
@@ -45,47 +45,62 @@
</ItemGroup>
<ItemGroup>
<None Update="conf\ActLog.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\Alarms.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\Counters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\MPStatus.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\Parameters.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimAlarmRawList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\AlarmRawList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\AlarmBankList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\ModeList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\ParamList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="conf\SimActLog2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimActLog.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="conf\SimCountersRaw2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimMachStat.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimEvHist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="conf\SimStatus.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="conf\SimEvHist2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimTools.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimMaint.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="conf\SimMaint2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\StatusList.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimProd.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="conf\SimProd2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\SimParams.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="conf\Tools.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="logs\.placeholder.file">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+73 -22
View File
@@ -31,10 +31,11 @@ List<MachineMode>? modeList = new List<MachineMode>();
ThreadPool.SetMinThreads(10, 10);
Dictionary<string, int> LogSimulator = new Dictionary<string, int>();
Dictionary<string, DateTime> LastSend = new Dictionary<string, DateTime>();
Dictionary<string, DateTime> LastKeySave = new Dictionary<string, DateTime>();
DateTime lastLog = DateTime.Now.AddMinutes(-1);
bool verboseLog = false;
bool logWriting = false;
int MinSaveIntSec = 15;
logInfo(lineSep, true, true);
logInfo($"Starting Machine SIM", true, true);
@@ -61,7 +62,7 @@ List<MachineStatus>? machineStatusConf = new List<MachineStatus>();
// salvo configurazioni in redis
setupConf();
var currSimGen = new Simulator(confPath, modeList.Count, statusList.Count);
var currSimGen = new Simulator(confPath, modeList.Count, statusList.Count, redisDb, config);
// preparo la lista dei contatori invio...
LogSimulator.Add(Constants.ACT_LOG_M_QUEUE, 0);
@@ -74,11 +75,12 @@ LogSimulator.Add(Constants.MAINT_STATS_M_QUEUE, 0);
LogSimulator.Add(Constants.TOOLS_M_QUEUE, 0);
// avvio tutti i thread...
Thread threadStatus = new Thread(simStatus);
Thread threadStatus = new Thread(simMPStatus);
Thread threadCount = new Thread(simCountersRaw);
Thread threadAlarms = new Thread(simAlarms);
Thread threadParams = new Thread(simParameters);
Thread threadProd = new Thread(simProd);
Thread threadMachStat = new Thread(simMachStat);
Thread threadMacStats = new Thread(simMacStats);
Thread threadMaint = new Thread(simMaint);
Thread threadTools = new Thread(simTools);
Thread threadEvHistory = new Thread(simEvents);
@@ -88,7 +90,8 @@ threadStatus.Start();
threadAlarms.Start();
threadParams.Start();
threadProd.Start();
threadMachStat.Start();
threadCount.Start();
threadMacStats.Start();
threadMaint.Start();
threadTools.Start();
threadEvHistory.Start();
@@ -111,12 +114,31 @@ void checkFilePresent(string filePath)
/// </summary>
void setupConf()
{
alarmMode = config.GetValue<AlarmReportingMode>("SimPar:AlarmMode");
// intervallo minimo x salvataggio in redis cache
MinSaveIntSec = config.GetValue<int>("SimPar:MinSaveIntSec");
// fix configurazioni di base
MachineDTO currMach = new MachineDTO()
{
Manufacturer = config.GetValue<string>("Machine:Manufacturer"),
Model = config.GetValue<string>("Machine:Model"),
SerNumber = config.GetValue<string>("Machine:SerialNumber"),
Name = config.GetValue<string>("Machine:Name"),
ModeId = 0,
StatusId = 0
};
redisDb.StringSet(Constants.MACHINE_CONF_PLATE, JsonConvert.SerializeObject(currMach));
// allarmi
alarmMode = config.GetValue<AlarmReportingMode>("OptPar:AlarmMode");
redisDb.StringSetAsync(Constants.ALARMS_MODE_KEY, JsonConvert.SerializeObject(alarmMode));
ConfigManager configManager = new ConfigManager(redisConf, confPath);
if (alarmMode == AlarmReportingMode.RawList)
{
alarmsRawConf = configManager.getAlarmsRawConf();
alarmsRawConf = configManager.getAlarmsRawConf("SimAlarmRawList.json");
}
else
{
@@ -124,7 +146,14 @@ void setupConf()
}
machineModeConf = configManager.getMachineModeConf();
machineStatusConf = configManager.getMachineStatusConf();
_ = configManager.getParamsConf();
// altre conf x cui fare setup
var ActLogStatus = configManager.getActLog();
var ToolStatus = configManager.getTools();
var ParamStatus = configManager.getParamsConf();
var AlarmsStatus = configManager.getAlarmsConf();
var MPStatus = configManager.getMPStatusConf();
var CountStatus = configManager.getCountersConf();
}
/// <summary>
@@ -159,22 +188,22 @@ void logError(string msg, bool log2file = true, bool log2console = false)
void saveAndSendMessage(string memKey, string notifyChannel, string message)
{
// effettuo la scrittura nell'area di memoria indicata SE passato intervallo minimo
bool doSend = true;
if (LastSend.ContainsKey(memKey))
bool doSave = true;
if (LastKeySave.ContainsKey(memKey))
{
if (DateTime.Now.Subtract(LastSend[memKey]).TotalSeconds < 60)
if (DateTime.Now.Subtract(LastKeySave[memKey]).TotalSeconds < MinSaveIntSec)
{
doSend = false;
doSave = false;
}
}
else
{
LastSend.Add(memKey, DateTime.Now);
LastKeySave.Add(memKey, DateTime.Now);
}
if (doSend)
if (doSave)
{
redisDb.StringSetAsync(memKey, message);
LastSend[memKey] = DateTime.Now;
LastKeySave[memKey] = DateTime.Now;
logInfo($"Redis Cache Key: {memKey}");
}
@@ -346,20 +375,41 @@ void simParameters()
}
}
void simStatus()
void simMPStatus()
{
int minPeriod = 1000;
int maxPeriod = 5000;
// controllo se devo fare (se ho valori da simulare...)
if (currSimGen.currSimStatus.Count > 0)
if (currSimGen.currSimMachStat.Count > 0)
{
do
{
// recupero uno stato simulato
var newStatus = currSimGen.getStatus();
string rawData = JsonConvert.SerializeObject(newStatus);
saveAndSendMessage(Constants.STATUS_CURR_KEY, Constants.STATUS_M_QUEUE, rawData);
saveAndSendMessage(Constants.STATUS_ACT_KEY, Constants.STATUS_RAW_QUEUE, rawData);
// attesa random
Thread.Sleep(rand.Next(minPeriod, maxPeriod));
} while (true);
}
}
void simCountersRaw()
{
int minPeriod = 1000;
int maxPeriod = 5000;
// controllo se devo fare (se ho valori da simulare...)
if (currSimGen.currSimMachStat.Count > 0)
{
do
{
// recupero uno stato simulato
var newStatus = currSimGen.getCountersRaw();
string rawData = JsonConvert.SerializeObject(newStatus);
saveAndSendMessage(Constants.COUNT_CURR_KEY, Constants.COUNT_RAW_QUEUE, rawData);
// attesa random
Thread.Sleep(rand.Next(minPeriod, maxPeriod));
@@ -388,10 +438,11 @@ void simProd()
}
}
void simMachStat()
void simMacStats()
{
int minPeriod = 5000;
int maxPeriod = 15000;
int minPeriod = 3000;
int maxPeriod = 5000;
// controllo se devo fare (se ho valori da simulare...)
@@ -400,7 +451,7 @@ void simMachStat()
do
{
// recupero uno stato simulato
var newVal = currSimGen.getProdStats();
var newVal = currSimGen.getMacStats();
string rawData = JsonConvert.SerializeObject(newVal);
saveAndSendMessage(Constants.MACH_STATS_CURR_KEY, Constants.MACH_STATS_M_QUEUE, rawData);
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2206.2217</h4>
<h4>Version: 1.2.2209.2116</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2206.2217
1.2.2209.2116
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2206.2217</version>
<version>1.2.2209.2116</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+230 -74
View File
@@ -1,6 +1,8 @@
using MathNet.Numerics.Distributions;
using Microsoft.Extensions.Configuration;
using MP.MONO.Core.DTO;
using Newtonsoft.Json;
using StackExchange.Redis;
namespace MachineSim
{
@@ -11,24 +13,27 @@ namespace MachineSim
{
#region Public Fields
public List<string> currCountersRaw = new List<string>();
public List<SimDisplayDataDTO> currSimActLog = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimEvHist = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimMachStat = new List<SimDisplayDataDTO>();
public List<string> currSimMachStat = new List<string>();
public List<SimDisplayDataDTO> currSimMaint = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimPar = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimProd = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimStatus = new List<SimDisplayDataDTO>();
public List<SimDisplayDataDTO> currSimTools = new List<SimDisplayDataDTO>();
#endregion Public Fields
#region Public Constructors
public Simulator(string _basePath, int nMode, int nStatus)
public Simulator(string _confPath, int nMode, int nStatus, IDatabase? currRedisDb, IConfigurationRoot currAppConf)
{
basePath = _basePath;
confPath = _confPath;
numMode = nMode;
numStatus = nStatus;
redisDb = currRedisDb;
appConf = currAppConf;
setupConfig();
}
@@ -49,7 +54,7 @@ namespace MachineSim
Order = i.Order,
Title = i.Title,
Type = i.Type,
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd),
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, 1),
DisplFormat = i.DisplFormat
}).ToList();
@@ -78,6 +83,70 @@ namespace MachineSim
return activeAlarms;
}
/// <summary>
/// Restituisce elenco info dati x contatori come lista da adapter
/// </summary>
/// <returns></returns>
public Dictionary<string, string> getCountersRaw()
{
Dictionary<string, string> answ = new Dictionary<string, string>();
// simulo stato macchina ad 1 nel 99.5% (0 nel 0.5% dei casi
if (rand.Next(0, 1000) < 995)
{
answ.Add("MACHINE STATUS", "1");
}
else
{
answ.Add("MACHINE STATUS", "1");
}
// simulo stato processo in ciclo 90% dei casi, resto HOLD
if (rand.Next(0, 1000) < 900)
{
answ.Add("PROCESS STATUS", "2");
// simulo modo auto 90% dei casi
if (rand.Next(0, 1000) < 900)
{
answ.Add("PROCESS MODE", "2");
// aggiungo spindle load che sono attivi 50% del tempo ogni coppia, random
if (rand.Next(0, 1000) < 500)
{
answ.Add("SPINDLE 1 LOAD", $"{rand.Next(5, 80)}");
answ.Add("SPINDLE 2 LOAD", $"{rand.Next(5, 80)}");
answ.Add("SPINDLE 3 LOAD", $"{rand.Next(5, 80)}");
answ.Add("SPINDLE 4 LOAD", $"{rand.Next(5, 80)}");
}
else
{
answ.Add("SPINDLE 1 LOAD", "0");
answ.Add("SPINDLE 2 LOAD", "0");
answ.Add("SPINDLE 3 LOAD", "0");
answ.Add("SPINDLE 4 LOAD", "0");
}
}
else
{
answ.Add("PROCESS MODE", "1");
answ.Add("SPINDLE 1 LOAD", "0");
answ.Add("SPINDLE 2 LOAD", "0");
answ.Add("SPINDLE 3 LOAD", "0");
answ.Add("SPINDLE 4 LOAD", "0");
}
}
else
{
answ.Add("PROCESS STATUS", "3");
answ.Add("PROCESS MODE", "7");
answ.Add("SPINDLE 1 LOAD", "0");
answ.Add("SPINDLE 2 LOAD", "0");
answ.Add("SPINDLE 3 LOAD", "0");
answ.Add("SPINDLE 4 LOAD", "0");
}
return answ;
}
public List<DisplayDataDTO> getEvents()
{
List<DisplayDataDTO> answ = new List<DisplayDataDTO>();
@@ -91,9 +160,8 @@ namespace MachineSim
Order = i.Order,
Title = i.Title,
Type = i.Type,
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd),
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, 1),
DisplFormat = i.DisplFormat
//Value = $"{getNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd):N3}",
}).ToList();
foreach (var item in answ)
@@ -104,6 +172,31 @@ namespace MachineSim
return answ;
}
public List<DisplayDataDTO> getMacStats()
{
List<DisplayDataDTO> answ = new List<DisplayDataDTO>();
var oee = new DisplayDataDTO()
{
IsNumeric = true,
MaxVal = 1,
MinVal = 0.50,
Order = 1,
Title = "OEE",
Type = "OEE",
ValueNum = simNext(.75, .50, 1, .1, .2, 1, 0.5),
DisplFormat = "P1"
};
answ.Add(oee);
foreach (var item in answ)
{
item.Value = $"{item.ValueNum.ToString(item.DisplFormat)}";
}
return answ;
}
public List<DisplayDataDTO> getMaint()
{
List<DisplayDataDTO> answ = new List<DisplayDataDTO>();
@@ -117,9 +210,8 @@ namespace MachineSim
Order = i.Order,
Title = i.Title,
Type = i.Type,
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, i.IsBoolean, i.TrueRatio),
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, i.IsBoolean ? 2 : 1, i.TrueRatio),
DisplFormat = i.DisplFormat
//Value = $"{getNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd):N3}",
}).ToList();
foreach (var item in answ)
@@ -143,7 +235,7 @@ namespace MachineSim
Order = i.Order,
Title = i.Title,
Type = i.Type,
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd),
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, 1),
DisplFormat = i.DisplFormat,
CssIcon = i.CssIcon,
EnablePlot = i.EnablePlot,
@@ -162,7 +254,7 @@ namespace MachineSim
{
Dictionary<string, double> answ = new Dictionary<string, double>();
// genero a partire dall'elenco configurato da simulare...
answ = currSimPar.ToDictionary(i => i.Title, i => simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd));
answ = currSimPar.ToDictionary(i => i.Title, i => simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, 1));
return answ;
}
@@ -183,6 +275,7 @@ namespace MachineSim
return currMachDto;
}
#if false
public List<DisplayDataDTO> getProdStats()
{
List<DisplayDataDTO> answ = new List<DisplayDataDTO>();
@@ -208,29 +301,47 @@ namespace MachineSim
return answ;
}
#endif
/// <summary>
/// Restituisce stato Macchina simulato come DTO
/// Restituisce elenco info stato Macchina simulato come lista da adapter
/// </summary>
/// <returns></returns>
public MachineDTO getStatus()
public Dictionary<string, string> getStatus()
{
int maxRun = 7;
int maxExe = 7;
MachineDTO currMachDto = new MachineDTO()
Dictionary<string, string> answ = new Dictionary<string, string>();
// simulo stato macchina ad 1 nel 99.5% (0 nel 0.5% dei casi
if (rand.Next(0, 1000) < 995)
{
Manufacturer = "Egalware",
Model = "SIM Machine",
Name = "DEMO 01",
SerNumber = "2022-0001",
ModeId = rand.Next(0, maxRun),
StatusId = rand.Next(0, maxExe)
//Mode = $"{(Enums.MachRunMode)rand.Next(0, maxRun)}",
//Status = $"{(Enums.MachExeStatus)rand.Next(0, maxExe)}"
};
answ.Add("MACHINE STATUS", "1");
}
else
{
answ.Add("MACHINE STATUS", "1");
}
return currMachDto;
// simulo stato processo in ciclo 90% dei casi, resto HOLD
if (rand.Next(0, 1000) < 900)
{
answ.Add("PROCESS STATUS", "2");
// simulo modo auto 90% dei casi
if (rand.Next(0, 1000) < 900)
{
answ.Add("PROCESS MODE", "2");
}
else
{
answ.Add("PROCESS MODE", "1");
}
}
else
{
answ.Add("PROCESS STATUS", "3");
answ.Add("PROCESS MODE", "7");
}
// aggiunta part program che cambia ogni minuto...
answ.Add("RECIPE NAME", $"{DateTime.Now:yyMMdd-HHmm}.prg");
return answ;
}
public List<DisplayDataDTO> getTools()
@@ -246,14 +357,19 @@ namespace MachineSim
Order = i.Order,
Title = i.Title,
Type = i.Type,
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd),
ValueNum = simNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd, 3),
DisplFormat = i.DisplFormat
//Value = $"{getNext(i.ValueNum, i.MinVal, i.MaxVal, i.SimMean, i.SimStd):N3}",
}).ToList();
foreach (var item in answ)
{
item.Value = $"{item.ValueNum.ToString(item.DisplFormat)}";
// aggiorno con ultimo valore simulato...
var simItem = currSimTools.FirstOrDefault(x => x.Title == item.Title);
if (simItem != null)
{
simItem.ValueNum = item.ValueNum;
}
}
return answ;
@@ -273,46 +389,67 @@ namespace MachineSim
/// <param name="MaxVal"></param>
/// <param name="sMean"></param>
/// <param name="sStd"></param>
/// <param name="isBoolean"></param>
/// <param name="trueRatio"></param>
/// <param name="simMode">Modalità simulazione
/// 1 = std, RandomWalk + trend periodico con memoria
/// 2 = boolean
/// 3 = trend secondo valore mean (crescente se >0, decrescente se <0)
/// </param>
/// <returns></returns>
public double simNext(double CurrVal, double MinVal, double MaxVal, double sMean, double sStd, bool isBoolean = false, double trueRatio = 0.5)
public double simNext(double CurrVal, double MinVal, double MaxVal, double sMean, double sStd, int simMode = 1, double trueRatio = 0.5)
{
double innov = 0;
double trend = 0;
// se è boolean --> simulazione 0/1 rapida con % ratio indicata
if (isBoolean)
switch (simMode)
{
CurrVal = rand.Next(10000) <= trueRatio * 10000 ? 1 : 0;
}
// simulazione complessa con memoria
else
{
// innovazione stocastica di base
double innov = Normal.Sample(sMean, sStd);
// innovazione deterministica:
int resto = (DateTime.Now.Second % 10);
double trend = 0;
switch (resto)
{
case 0:
case 1:
case 2:
trend = sMean + 15 * sStd;
break;
case 2:
CurrVal = rand.Next(10000) <= trueRatio * 10000 ? 1 : 0;
break;
case 3:
innov = Normal.Sample(sMean, sStd);
trend = rand.NextDouble() * 2 * sMean;
double delta = innov + trend;
// il delta deve essere dello stesso segno della media...
if (delta * sMean < 0)
{
delta = delta * -1;
}
CurrVal += delta;
// verifico estremi...
CurrVal = CurrVal > MaxVal ? MinVal : CurrVal;
CurrVal = CurrVal < MinVal ? MaxVal : CurrVal;
break;
case 1:
default:
// innovazione stocastica di base
innov = Normal.Sample(sMean, sStd);
int multFact = rand.Next(1, 6);
// innovazione deterministica:
int resto = (DateTime.Now.Second % 10);
trend = 0;
switch (resto)
{
case 0:
case 1:
case 7:
trend = sMean + multFact * sStd;
break;
case 5:
case 6:
case 7:
trend = -(sMean + 15 * sStd);
break;
case 2:
case 5:
case 6:
trend = -(sMean + multFact * sStd);
break;
default:
break;
}
CurrVal += innov + trend;
// verifico estremi...
CurrVal = CurrVal > MaxVal ? MaxVal : CurrVal;
CurrVal = CurrVal < MinVal ? MinVal : CurrVal;
default:
break;
}
CurrVal += innov + trend;
// verifico estremi...
CurrVal = CurrVal > MaxVal ? MaxVal : CurrVal;
CurrVal = CurrVal < MinVal ? MinVal : CurrVal;
break;
}
return CurrVal;
}
@@ -321,23 +458,25 @@ namespace MachineSim
#region Protected Fields
protected string basePath = "";
protected string confPath = "";
protected Random rand = new Random();
#endregion Protected Fields
#region Protected Properties
protected IConfigurationRoot appConf { get; set; } = null!;
protected int numMode { get; set; } = 1;
protected int numStatus { get; set; } = 1;
protected IDatabase redisDb { get; set; } = null!;
#endregion Protected Properties
#region Private Methods
private void setupConf(string paramFileName, ref List<SimDisplayDataDTO> localObj)
private void setupConfDTO(string paramFileName, ref List<SimDisplayDataDTO> localObj)
{
string fullPath = Path.Combine(basePath, paramFileName);
string fullPath = Path.Combine(confPath, paramFileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
@@ -355,21 +494,38 @@ namespace MachineSim
private void setupConfig()
{
// setup conf Parametri
setupConf("SimParams.json", ref currSimPar);
// setup conf MachStat
setupConf("SimMachStat.json", ref currSimMachStat);
setupConfDTO("SimParams.json", ref currSimPar);
// setup conf Maintenance
setupConf("SimMaint.json", ref currSimMaint);
setupConfDTO("SimMaint.json", ref currSimMaint);
// setup conf Tools
setupConf("SimTools.json", ref currSimTools);
setupConfDTO("SimTools.json", ref currSimTools);
// setup conf Event History
setupConf("SimEvHist.json", ref currSimEvHist);
setupConfDTO("SimEvHist.json", ref currSimEvHist);
// setup conf Activity Log
setupConf("SimActLog.json", ref currSimActLog);
setupConfDTO("SimActLog.json", ref currSimActLog);
// setup conf Prod
setupConf("SimProd.json", ref currSimProd);
setupConfDTO("SimProd.json", ref currSimProd);
// setup conf MachStat
setupConfList("SimMachStat.json", ref currSimMachStat);
// setup conf Prod
setupConf("SimStatus.json", ref currSimStatus);
setupConfList("SimStatus.json", ref currCountersRaw);
}
private void setupConfList(string paramFileName, ref List<string> localObj)
{
string fullPath = Path.Combine(confPath, paramFileName);
if (File.Exists(fullPath))
{
var rawData = File.ReadAllText(fullPath);
if (!string.IsNullOrEmpty(rawData))
{
var deserObj = JsonConvert.DeserializeObject<List<String>>(rawData);
if (deserObj != null)
{
localObj = deserObj;
}
}
}
}
#endregion Private Methods
+13 -3
View File
@@ -7,14 +7,15 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=30000,syncTimeout=30000,asyncTimeout=30000,abortConnect=false,ssl=false,password=nkc.password",
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=30000,syncTimeout=30000,asyncTimeout=30000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "localhost",
"Server": "10.74.82.230",
//"Server": "localhost",
"nKey": "MONO",
"sKey": "M3T@n0-CH4"
},
@@ -31,8 +32,17 @@
}
}
},
"Machine": {
"Manufacturer": "Multiax",
"Model": "Model-D",
"Name": "D1521",
"SerialNumber": "1521"
},
"OptPar": {
"AlarmMode": "RawList"
},
"SimPar": {
"AlarmMode": "RawList",
"MinSaveIntSec": 5,
"PercAllarmi": 10,
"MaxAddAllarmi": 3,
"MaxDurationAllarmi": 10
+38
View File
@@ -0,0 +1,38 @@
[
{
"Order": 0,
"ExtCode": "ns=5;i=1278",
"Type": "ACTLOG",
"Title": "User LC001",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N3",
"IsNumeric": true
},
{
"Order": 1,
"ExtCode": "ns=5;i=1279",
"Type": "ACTLOG",
"Title": "User LC001 SetPoint",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N3",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=5;i=1280",
"Type": "ACTLOG",
"Title": "User LC001 Ctrl OUT",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N3",
"IsNumeric": true
}
]
+134
View File
@@ -0,0 +1,134 @@
[
{
"Order": 1,
"ExtCode": "ns=1;s=3_1_ALARM NC",
"Type": "ALARM",
"Title": "ALARM NC",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 2,
"ExtCode": "ns=1;s=3_2_ALARM PLC 1",
"Type": "ALARM",
"Title": "ALARM PLC 01",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 3,
"ExtCode": "ns=1;s=3_3_ALARM PLC 2",
"Type": "ALARM",
"Title": "ALARM PLC 02",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 4,
"ExtCode": "ns=1;s=3_4_ALARM PLC 3",
"Type": "ALARM",
"Title": "ALARM PLC 03",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 5,
"ExtCode": "ns=1;s=3_5_ALARM PLC 4",
"Type": "ALARM",
"Title": "ALARM PLC 04",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 6,
"ExtCode": "ns=1;s=3_6_ALARM PLC 5",
"Type": "ALARM",
"Title": "ALARM PLC 05",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 7,
"ExtCode": "ns=1;s=3_7_ALARM PLC 6",
"Type": "ALARM",
"Title": "ALARM PLC 06",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 8,
"ExtCode": "ns=1;s=3_8_ALARM PLC 7",
"Type": "ALARM",
"Title": "ALARM PLC 07",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 9,
"ExtCode": "ns=1;s=3_9_ALARM PLC 8",
"Type": "ALARM",
"Title": "ALARM PLC 08",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 10,
"ExtCode": "ns=1;s=3_10_ALARM PLC 9",
"Type": "ALARM",
"Title": "ALARM PLC 09",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
},
{
"Order": 11,
"ExtCode": "ns=1;s=3_11_ALARM PLC 10",
"Type": "ALARM",
"Title": "ALARM PLC 10",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 0,
"DisplFormat": "",
"IsNumeric": false
}
]
+114
View File
@@ -0,0 +1,114 @@
[
{
"Order": 1,
"ExtCode": "ns=1;s=1_1_MACHINE STATUS",
"Type": "STATUS",
"Title": "MACHINE STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=1;s=500_1_STATUS",
"Type": "STATUS",
"Title": "PROCESS STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 3,
"ExtCode": "ns=1;s=501_1_MODE",
"Type": "MODE",
"Title": "PROCESS MODE",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=516_PROC 1 SPINDLE 1 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 1 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 5,
"ExtCode": "ns=1;s=517_PROC 1 SPINDLE 2 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 2 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 6,
"ExtCode": "ns=1;s=518_PROC 1 SPINDLE 3 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 3 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 7,
"ExtCode": "ns=1;s=519_PROC 1 SPINDLE 4 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 4 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 7,
"ExtCode": "ns=1;s=502_1_RECIPE NAME",
"Type": "PROGRAM",
"Title": "RECIPE NAME",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
}
]
+50
View File
@@ -0,0 +1,50 @@
[
{
"Order": 1,
"ExtCode": "ns=1;s=1_1_MACHINE STATUS",
"Type": "STATUS",
"Title": "MACHINE STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=1;s=500_1_STATUS",
"Type": "STATUS",
"Title": "PROCESS STATUS",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 3,
"ExtCode": "ns=1;s=501_1_MODE",
"Type": "MODE",
"Title": "PROCESS MODE",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=502_1_RECIPE NAME",
"Type": "PROGRAM",
"Title": "RECIPE NAME",
"Value": "",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 10,
"DisplFormat": "N0",
"IsNumeric": true
}
]
-128
View File
@@ -1,128 +0,0 @@
[
{
"Order": 3,
"HLShow": true,
"Type": "SPEED-5000-10000",
"Title": "SPEED",
"Value": "4000",
"ValueNum": 4000,
"MinVal": 1000,
"MaxVal": 10000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 2,
"HLShow": true,
"Type": "FEED-3000-5000",
"Title": "FEED",
"Value": "2500",
"ValueNum": 2500,
"MinVal": 1000,
"MaxVal": 5000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE LOAD",
"Value": "30",
"ValueNum": 30,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 4,
"Type": "POS",
"Title": "X POS",
"Value": "1500",
"ValueNum": 1500,
"MinVal": 0,
"MaxVal": 5000,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 5,
"Type": "POS",
"Title": "Y POS",
"Value": "5000",
"ValueNum": 5000,
"MinVal": 0,
"MaxVal": 10000,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 6,
"Type": "POS",
"Title": "Z POS",
"Value": "-1500",
"ValueNum": -1500,
"MinVal": -3000,
"MaxVal": 0,
"DisplFormat": "N2",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 7,
"Type": "POS",
"Title": "A POS",
"Value": "150",
"ValueNum": 150,
"MinVal": 0,
"MaxVal": 360,
"DisplFormat": "N3",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
},
{
"Order": 8,
"Type": "POS",
"Title": "B POS",
"Value": "150",
"ValueNum": 150,
"MinVal": 0,
"MaxVal": 360,
"DisplFormat": "N3",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right",
"SamplePeriod": 180,
"VcFunc": "MEDIAN"
}
]
+387
View File
@@ -0,0 +1,387 @@
[
{
"Order": 1,
"ExtCode": "ns=1;s=515_PROC 1 FEED OVERRIDE",
"HLShow": true,
"Type": "FEED",
"Title": "FEED OVER",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 130,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 2,
"ExtCode": "ns=1;s=518_PROC 1 SPEED OVERRIDE",
"HLShow": true,
"Type": "SPEED",
"Title": "SPEED OVER",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 130,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 3,
"ExtCode": "ns=1;s=521_PROC 1 SPINDLE 1 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 1 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 4,
"ExtCode": "ns=1;s=522_PROC 1 SPINDLE 2 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 2 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 5,
"ExtCode": "ns=1;s=523_PROC 1 SPINDLE 3 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 3 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 6,
"ExtCode": "ns=1;s=524_PROC 1 SPINDLE 4 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 4 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 31,
"ExtCode": "ns=1;s=4_1_AXIS 1 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "AXIS 1 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 32,
"ExtCode": "ns=1;s=4_2_AXIS 2 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "AXIS 2 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 33,
"ExtCode": "ns=1;s=4_3_AXIS 3 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "AXIS 3 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 34,
"ExtCode": "ns=1;s=4_4_AXIS 4 LOAD PC",
"HLShow": true,
"Type": "LOAD",
"Title": "AXIS 4 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 51,
"ExtCode": "ns=1;s=516_PROC 1 FEED PROGRAMMED",
"Type": "FEED",
"Title": "FEED PROG",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 52,
"ExtCode": "ns=1;s=517_PROC 1 FEED ACTUAL",
"Type": "FEED",
"Title": "FEED ACT",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20000,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 53,
"ExtCode": "ns=1;s=519_PROC 1 SPEED PROGRAMMED",
"Type": "SPEED",
"Title": "SPEED PROG",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20000,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 54,
"ExtCode": "ns=1;s=520_PROC 1 SPEED ACTUAL",
"Type": "SPEED",
"Title": "SPEED ACT",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 20000,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 105,
"ExtCode": "ns=1;s=4_5_AXIS 5 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 5 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 106,
"ExtCode": "ns=1;s=4_6_AXIS 6 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 6 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 107,
"ExtCode": "ns=1;s=4_7_AXIS 7 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 7 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 108,
"ExtCode": "ns=1;s=4_8_AXIS 8 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 8 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 109,
"ExtCode": "ns=1;s=4_9_AXIS 9 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 9 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 110,
"ExtCode": "ns=1;s=4_10_AXIS 10 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 10 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 111,
"ExtCode": "ns=1;s=4_11_AXIS 11 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 11 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 112,
"ExtCode": "ns=1;s=4_12_AXIS 12 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 12 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 113,
"ExtCode": "ns=1;s=4_13_AXIS 13 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 13 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 114,
"ExtCode": "ns=1;s=4_14_AXIS 14 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 14 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 115,
"ExtCode": "ns=1;s=4_15_AXIS 15 LOAD PC",
"Type": "LOAD",
"Title": "AXIS 15 LOAD",
"Value": "0",
"ValueNum": 0,
"MinVal": 0,
"MaxVal": 100,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
}
]
+9
View File
@@ -0,0 +1,9 @@
[
"MACHINE STATUS",
"PROCESS STATUS",
"PROCESS MODE",
"SPINDLE 1 LOAD",
"SPINDLE 2 LOAD",
"SPINDLE 3 LOAD",
"SPINDLE 4 LOAD"
]
+4 -12
View File
@@ -1,14 +1,6 @@
[
{
"Order": 0,
"Type": "OEE-75-90",
"Title": "OEE",
"Value": "0.5",
"ValueNum": 0.5,
"MinVal": 0.4,
"MaxVal": 1,
"SimMean": 0.2,
"SimStd": 0.2,
"DisplFormat": "P1"
}
"MACHINE STATUS",
"PROCESS STATUS",
"PROCESS MODE",
"RECIPE NAME"
]
+162 -56
View File
@@ -3,12 +3,47 @@
"Order": 3,
"HLShow": true,
"Type": "SPEED-5000-10000",
"Title": "SPEED",
"Title": "SPEED PROG",
"Value": "4000",
"ValueNum": 4000,
"MinVal": 1000,
"MaxVal": 10000,
"SimMean": 100,
"SimMean": 300,
"SimStd": 100,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 2,
"HLShow": true,
"Type": "FEED-3000-5000",
"Title": "FEED PROG",
"Value": "2500",
"ValueNum": 2500,
"MinVal": 1000,
"MaxVal": 5000,
"SimMean": 450,
"SimStd": 150,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 3,
"HLShow": true,
"Type": "SPEED-5000-10000",
"Title": "SPEED ACT",
"Value": "4000",
"ValueNum": 4000,
"MinVal": 1000,
"MaxVal": 10000,
"SimMean": 200,
"SimStd": 50,
"DisplFormat": "N0",
"IsNumeric": true,
@@ -21,29 +56,81 @@
"Order": 2,
"HLShow": true,
"Type": "FEED-3000-5000",
"Title": "FEED",
"Title": "FEED ACT",
"Value": "2500",
"ValueNum": 2500,
"MinVal": 1000,
"MaxVal": 5000,
"SimMean": 50,
"SimStd": 5,
"SimMean": 200,
"SimStd": 100,
"DisplFormat": "N0",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 3,
"HLShow": true,
"Type": "SPEED-5000-10000",
"Title": "SPEED OVER",
"Value": "75",
"ValueNum": 75,
"MinVal": 0,
"MaxVal": 170,
"SimMean": 6,
"SimStd": 3,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 2,
"HLShow": true,
"Type": "FEED-3000-5000",
"Title": "FEED OVER",
"Value": "50",
"ValueNum": 50,
"MinVal": 0,
"MaxVal": 120,
"SimMean": 8,
"SimStd": 3,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-gauge-high"
},
{
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE LOAD",
"Title": "SPINDLE 1 LOAD",
"Value": "50",
"ValueNum": 50,
"MinVal": 0,
"MaxVal": 100,
"SimMean": 5,
"SimStd": 3,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 2 LOAD",
"Value": "30",
"ValueNum": 30,
"MinVal": 0,
"MaxVal": 100,
"SimMean": 5,
"SimMean": 6,
"SimStd": 2,
"DisplFormat": "N1",
"IsNumeric": true,
@@ -52,76 +139,95 @@
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 4,
"Type": "POS",
"Title": "X POS",
"Value": "1500",
"ValueNum": 1500,
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 3 LOAD",
"Value": "20",
"ValueNum": 20,
"MinVal": 0,
"MaxVal": 5000,
"SimMean": 100,
"SimStd": 20,
"DisplFormat": "N2",
"MaxVal": 100,
"SimMean": 9,
"SimStd": 2,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 1,
"HLShow": true,
"Type": "LOAD",
"Title": "SPINDLE 4 LOAD",
"Value": "20",
"ValueNum": 20,
"MinVal": 0,
"MaxVal": 100,
"SimMean": 5,
"SimStd": 4,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"ShowBar": true,
"CssIcon": "fa-solid fa-bolt"
},
{
"Order": 4,
"Type": "AXIS",
"Title": "AXIS 1 LOAD",
"Value": "10",
"ValueNum": 10,
"MinVal": 0,
"MaxVal": 100,
"SimMean": 15,
"SimStd": 2,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal"
},
{
"Order": 5,
"Type": "POS",
"Title": "Y POS",
"Value": "5000",
"ValueNum": 5000,
"Type": "AXIS",
"Title": "AXIS 2 LOAD",
"Value": "30",
"ValueNum": 30,
"MinVal": 0,
"MaxVal": 10000,
"SimMean": 100,
"SimStd": 10,
"DisplFormat": "N2",
"MaxVal": 100,
"SimMean": 25,
"SimStd": 5,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal"
},
{
"Order": 6,
"Type": "POS",
"Title": "Z POS",
"Value": "-1500",
"ValueNum": -1500,
"MinVal": -3000,
"MaxVal": 0,
"SimMean": 50,
"SimStd": 5,
"DisplFormat": "N2",
"Type": "AXIS",
"Title": "AXIS 3 LOAD",
"Value": "50",
"ValueNum": 50,
"MinVal": 0,
"MaxVal": 100,
"SimMean": 25,
"SimStd": 10,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-ruler-horizontal"
},
{
"Order": 7,
"Type": "POS",
"Title": "A POS",
"Value": "150",
"ValueNum": 150,
"Type": "AXIS",
"Title": "AXIS 4 LOAD",
"Value": "40",
"ValueNum": 40,
"MinVal": 0,
"MaxVal": 360,
"SimMean": 5,
"SimStd": 1,
"DisplFormat": "N3",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right"
},
{
"Order": 8,
"Type": "POS",
"Title": "B POS",
"Value": "150",
"ValueNum": 150,
"MinVal": 0,
"MaxVal": 360,
"SimMean": 5,
"SimStd": 2,
"DisplFormat": "N3",
"MaxVal": 100,
"SimMean": 30,
"SimStd": 10,
"DisplFormat": "N1",
"IsNumeric": true,
"EnablePlot": true,
"CssIcon": "fa-solid fa-rotate-right"
-14
View File
@@ -1,14 +0,0 @@
[
{
"Order": 0,
"Type": "POS",
"Title": "Z POS",
"Value": "-500",
"ValueNum": -500,
"MinVal": -3000,
"MaxVal": 0,
"SimMean": 50,
"SimStd": 5,
"DisplFormat": "N2"
}
]
+13 -13
View File
@@ -3,22 +3,22 @@
"Order": 0,
"Type": "TOOL",
"Title": "Tool 01 life",
"Value": "1000",
"ValueNum": 1000,
"Value": "99",
"ValueNum": 99,
"MinVal": 0,
"MaxVal": 2000,
"SimMean": -1,
"SimStd": 1,
"MaxVal": 100,
"SimMean": -1.5,
"SimStd": 0.5,
"DisplFormat": "N1"
},
{
"Order": 1,
"Type": "TOOL",
"Title": "Tool 02 life",
"Value": "800",
"ValueNum": 800,
"Value": "85",
"ValueNum": 85,
"MinVal": 0,
"MaxVal": 2000,
"MaxVal": 100,
"SimMean": -1,
"SimStd": 1,
"DisplFormat": "N1"
@@ -27,12 +27,12 @@
"Order": 2,
"Type": "TOOL",
"Title": "Tool 03 life",
"Value": "700",
"ValueNum": 700,
"Value": "70",
"ValueNum": 70,
"MinVal": 0,
"MaxVal": 2000,
"SimMean": -1,
"SimStd": 1,
"MaxVal": 100,
"SimMean": -2.5,
"SimStd": 2,
"DisplFormat": "N1"
}
]
+194
View File
@@ -0,0 +1,194 @@
[
{
"Order": 0,
"ExtCode": "ns=1;s=5_1_TOOL 1 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 1 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 1,
"ExtCode": "ns=1;s=5_2_TOOL 2 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 1 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 2,
"ExtCode": "ns=1;s=5_3_TOOL 3 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 1 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 3,
"ExtCode": "ns=1;s=5_4_TOOL 4 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 1 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 4,
"ExtCode": "ns=1;s=5_5_TOOL 11 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 2 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 5,
"ExtCode": "ns=1;s=5_6_TOOL 12 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 2 TOOL 02",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 6,
"ExtCode": "ns=1;s=5_7_TOOL 13 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 2 TOOL 03",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 7,
"ExtCode": "ns=1;s=5_8_TOOL 14 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 2 TOOL 04",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 8,
"ExtCode": "ns=1;s=5_9_TOOL 21 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 3 TOOL 01",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 9,
"ExtCode": "ns=1;s=5_10_TOOL 22 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 3 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 10,
"ExtCode": "ns=1;s=5_11_TOOL 23 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 3 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 11,
"ExtCode": "ns=1;s=5_12_TOOL 24 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 3 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 12,
"ExtCode": "ns=1;s=5_13_TOOL 31 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 4 TOOL 1",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 13,
"ExtCode": "ns=1;s=5_14_TOOL 32 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 4 TOOL 2",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 14,
"ExtCode": "ns=1;s=5_15_TOOL 33 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 4 TOOL 3",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
},
{
"Order": 15,
"ExtCode": "ns=1;s=5_16_TOOL 34 CURRENT LIFE PC",
"Type": "TOOL",
"Title": "SPINDLE 4 TOOL 4",
"Value": "0",
"ValueNum": 0,
"MinVal": -9999,
"MaxVal": 9999,
"DisplFormat": "N1",
"IsNumeric": true
}
]
-25
View File
@@ -23,28 +23,3 @@
</div>
}
@code {
[Parameter]
public string ParamName { get; set; } = "ND";
[Parameter]
public string btnType { get; set; } = "btn-primary";
[Parameter]
public Dictionary<string, string> currInfo { get; set; } = new Dictionary<string, string>();
[Parameter]
public bool showSection { get; set; } = false;
protected void toggleDisplay()
{
showSection = !showSection;
}
protected string caretIcon
{
get => showSection ? "bi bi-caret-up-square-fill" : "bi bi-caret-down-square-fill";
}
}
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.MONO.UI;
using MP.MONO.UI.Shared;
using MP.MONO.UI.Components;
using MP.MONO.Core;
namespace MP.MONO.UI.Components
{
public partial class DisplayInfo
{
[Parameter]
public string ParamName { get; set; } = "ND";
[Parameter]
public string btnType { get; set; } = "btn-primary";
[Parameter]
public Dictionary<string, string> currInfo { get; set; } = new Dictionary<string, string>();
[Parameter]
public bool showSection { get; set; } = false;
protected void toggleDisplay()
{
showSection = !showSection;
}
protected string caretIcon { get => showSection ? "bi bi-caret-up-square-fill" : "bi bi-caret-down-square-fill"; }
}
}
+1 -1
View File
@@ -129,7 +129,7 @@
@if (!compMode)
{
<td>
@if (record.CountRemainVal <= hourLim)
@if (record.CountRemainPerc <= PercLim)
{
<button class="btn btn-success btn-sm text-nowrap" @onclick="() => ShowConfirm(record.SMTaskId)" title="Show Activity Record Panel"><i class="bi bi-check-square"></i></button>
}
+62 -61
View File
@@ -8,6 +8,38 @@ namespace MP.MONO.UI.Components
{
public partial class MaintTaskPending
{
#region Private Fields
private int _MaxRecord = 1000;
private DateTime LastUpdate = DateTime.Now.AddHours(-12);
private List<PendingMaintModel>? ListRecords = null;
// FARE!!! filtro macchina
private int MachineId = 1;
private int MaintPendingRefreshVetoMin = 10;
/// <summary>
/// Valore limite (in %) per permettere di chiudere un intervento
/// </summary>
private int PercLim = 50;
/// <summary>
/// Valore limite (in %) per indicare come rosso una scadenza
/// </summary>
private int redLim = 10;
private List<PendingMaintModel>? SearchRecords = null;
/// <summary>
/// Valore limite (in %) per indicare come giallo una scadenza
/// </summary>
private int yelLim = 20;
#endregion Private Fields
#region Public Properties
/// <summary>
@@ -24,67 +56,6 @@ namespace MP.MONO.UI.Components
#endregion Public Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await ReloadData();
MaintPendingRefreshVetoMin = Configuration.GetValue<int>("OptPar:MaintPendingRefreshVetoMin");
MMDataService.maintPipe.EA_NewMessage += MaintPipe_EA_NewMessage;
}
private int MaintPendingRefreshVetoMin = 10;
private DateTime LastUpdate = DateTime.Now.AddHours(-12);
private async void MaintPipe_EA_NewMessage(object? sender, EventArgs e)
{
PubSubEventArgs currArgs = (PubSubEventArgs)e;
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
// faccio un update al massimo ogni tot minuti (da config)
if (DateTime.Now.Subtract(LastUpdate).TotalMinutes > MaintPendingRefreshVetoMin)
{
LastUpdate = DateTime.Now;
await ReloadData();
await InvokeAsync(() =>
{
StateHasChanged();
});
}
}
}
#endregion Protected Methods
#region Private Fields
private int _MaxRecord = 1000;
/// <summary>
/// Valore limite (in ore) per permettere di chiudere un intervento
/// </summary>
private int hourLim = 24 * 1;
private List<PendingMaintModel>? ListRecords = null;
// FARE!!! filtro macchina
private int MachineId = 1;
/// <summary>
/// Valore limite (in %) per indicare come rosso una scadenza
/// </summary>
private int redLim = 10;
private List<PendingMaintModel>? SearchRecords = null;
/// <summary>
/// Valore limite (in %) per indicare come giallo una scadenza
/// </summary>
private int yelLim = 20;
#endregion Private Fields
#region Private Properties
private int _currPage { get; set; } = 1;
@@ -188,6 +159,18 @@ namespace MP.MONO.UI.Components
#endregion Private Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await ReloadData();
MaintPendingRefreshVetoMin = Configuration.GetValue<int>("OptPar:MaintPendingRefreshVetoMin");
PercLim = Configuration.GetValue<int>("OptPar:MaintLimitPerc");
MMDataService.maintPipe.EA_NewMessage += MaintPipe_EA_NewMessage;
}
#endregion Protected Methods
#region Private Methods
/// <summary>
@@ -224,6 +207,24 @@ namespace MP.MONO.UI.Components
currPage = newNum;
}
private async void MaintPipe_EA_NewMessage(object? sender, EventArgs e)
{
PubSubEventArgs currArgs = (PubSubEventArgs)e;
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
// faccio un update al massimo ogni tot minuti (da config)
if (DateTime.Now.Subtract(LastUpdate).TotalMinutes > MaintPendingRefreshVetoMin)
{
LastUpdate = DateTime.Now;
await ReloadData();
await InvokeAsync(() =>
{
StateHasChanged();
});
}
}
}
private async Task RegenTask()
{
await MMDataService.SchedMaintTaskCreateMissing(MachineId);
+1
View File
@@ -0,0 +1 @@
7846c819c695edbad32f74f84430d98a82e57cc6a99ec55a4dce6c9c5eb62bec560dbfe8feca34eef826fadb81c4884b9b215fda89cf4dcee5eb46f52287e722
+1 -1
View File
@@ -1 +1 @@
31e9cc1c2e8f30a1b4098cb157d712f11f3f2e60fb74169a354c3fa646d6d0e28518b4e3139f844b25824fbcc4340051fc507d22c1c2d2786d3786c777c31cc3
467e4b24bc3fe9d237169aa274ae589b64f072fb1cd91f4d79aaee76c64afbfced7fb51536b62cf612dedfb304202a1e653778b7cc8c758f83bb058984460301
+1
View File
@@ -0,0 +1 @@
ba277b1767d831427d18b76b0d65189aeac888948dd616d77bde620356de20d7143b2d8b82a2c02d08b2b6ef123f98758027f0cf39ca1243711cfa3066a7216d
+19 -4
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2206.2217</Version>
<Version>1.2.2209.2116</Version>
</PropertyGroup>
<ItemGroup>
@@ -31,21 +31,36 @@
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.multiax.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.ufficio.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="Conf\lic.multiax.demo.file">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="Conf\lic.NB-SAM.file">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="Conf\lic.WKS-R9-SAM.file">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="Conf\lic.file">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="logs\.placeholder.file">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="temp\OUT.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\obfuscate.ps1 -CurrConfig $(ConfigurationName)" />
<!--<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\obfuscate.ps1 -CurrConfig $(ConfigurationName)" />-->
</Target>
</Project>
+20 -1
View File
@@ -74,7 +74,26 @@
{
<div class="card">
<div class="card-header">
<h5>Alarm History</h5>
<div class="d-flex justify-content-between">
<div class="px-2">
<h5>Alarm History</h5>
</div>
<div class="px-2">
@if (!liveUpdate)
{
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()">
<small>@lastUpdate</small>
</button>
}
else
{
<button class="btn btn-primary" type="button" @onclick="() => toggleUpdate()">
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
Valori live
</button>
}
</div>
</div>
</div>
<div class="card-body">
@if (ListRecords == null)
+57 -1
View File
@@ -1,4 +1,5 @@
using MP.MONO.Data.DbModels;
using System.Diagnostics;
namespace MP.MONO.UI.Pages
{
@@ -13,6 +14,47 @@ namespace MP.MONO.UI.Pages
#region Protected Properties
public bool liveUpdate { get; set; } = true;
public string lastUpdate { get; set; } = "-";
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
if (!isLoading && liveUpdate)
{
aTimer.Stop();
// inizio misura esecuzione
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(() => ReloadData());
});
pUpd.Wait();
// misuro tempo esecuzione
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
int deltaTime = RefreshPeriod - (int)ts.TotalMilliseconds;
aTimer.Interval = deltaTime > 100 ? deltaTime : 100;
aTimer.Start();
}
}
public void StartTimer()
{
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(RefreshPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
//aTimer.AutoReset = true;
aTimer.Start();
}
private int MaxRecord
{
get
@@ -29,7 +71,7 @@ namespace MP.MONO.UI.Pages
}
}
}
protected int RefreshPeriod { get; set; } = 2000;
private int totalCount
{
get
@@ -59,6 +101,10 @@ namespace MP.MONO.UI.Pages
protected override async Task OnInitializedAsync()
{
if (liveUpdate)
{
StartTimer();
}
await ReloadData();
}
@@ -111,6 +157,15 @@ namespace MP.MONO.UI.Pages
doSetup = false;
await Task.Delay(1);
}
protected async Task toggleUpdate()
{
liveUpdate = !liveUpdate;
await Task.Delay(1);
if (!liveUpdate)
{
lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
}
}
#endregion Protected Methods
@@ -123,6 +178,7 @@ namespace MP.MONO.UI.Pages
private int MachineId = 1;
private List<AlarmLogModel>? SearchRecords = null;
private static System.Timers.Timer aTimer = null!;
#endregion Private Fields
-74
View File
@@ -55,78 +55,4 @@
</div>
</div>
@code {
private Dictionary<string, string> biosInfo = new Dictionary<string, string>();
private Dictionary<string, string> cpuInfo = new Dictionary<string, string>();
private Dictionary<string, string> netInfo = new Dictionary<string, string>();
private Dictionary<string, string> osInfo = new Dictionary<string, string>();
private Dictionary<string, string> ramInfo = new Dictionary<string, string>();
private bool showBios = false;
private bool showCpu = false;
private bool showNet = false;
private bool showOs = false;
private bool showRam = false;
private bool showKeyMan = false;
private bool licOk = false;
private string licVal { get; set; } = "";
private string fileName { get; set; } = "InfoData.json";
protected override async Task OnInitializedAsync()
{
biosInfo = await MachineInfo.GetInfo("BIOS");
cpuInfo = await MachineInfo.GetInfo("CPU");
netInfo = await MachineInfo.GetInfo("NET");
osInfo = await MachineInfo.GetInfo("OS");
ramInfo = await MachineInfo.GetInfo("RAM");
// check licenze
licOk = await MachineDataValidator.testCurrInfo();
}
private void ShowAll()
{
showBios = true;
showCpu = true;
showNet = true;
showOs = true;
showRam = true;
}
private void ToggleKeyMan()
{
showKeyMan = !showKeyMan;
// salvo su disco...
saveInfoData();
}
private void saveInfoData()
{
var fullData = biosInfo.Concat(cpuInfo).Concat(netInfo).Concat(osInfo).Concat(ramInfo).GroupBy(ele => ele.Key).OrderBy(x => x.Key).ToDictionary(ele => ele.Key, ele => ele.First().Value);
string filePath = Path.Combine(baseDir, "temp", "InfoData.json");
File.WriteAllText(filePath, JsonConvert.SerializeObject(fullData, Formatting.Indented));
}
private string baseDir = $"{Directory.GetCurrentDirectory()}";
private async Task SaveLic()
{
//se ho un valore x la licenza...
if (!string.IsNullOrEmpty(licVal))
{
string filePath = Path.Combine(baseDir, "Conf", "lic.file");
File.WriteAllText(filePath, licVal);
}
// check licenze
licOk = await MachineDataValidator.testCurrInfo();
// se ok --> rivado ad home!
if (licOk)
{
await Task.Delay(1);
// rimando alla home
NavManager.NavigateTo("/", true);
}
}
}
+98
View File
@@ -0,0 +1,98 @@
using MP.MONO.Core;
using Newtonsoft.Json;
namespace MP.MONO.UI.Pages
{
public partial class Info
{
#region Protected Methods
protected override async Task OnInitializedAsync()
{
// validatore
var mDV = new MachineDataValidator();
// dati macchina
biosInfo = MachineDataValidator.biosInfo;
cpuInfo = MachineDataValidator.cpuInfo;
netInfo = MachineDataValidator.netInfo;
osInfo = MachineDataValidator.osInfo;
ramInfo = MachineDataValidator.ramInfo;
// check licenze
licOk = await MachineDataValidator.testCurrInfo();
}
#endregion Protected Methods
#region Private Fields
private string baseDir = $"{Directory.GetCurrentDirectory()}";
private Dictionary<string, string> biosInfo = new Dictionary<string, string>();
private Dictionary<string, string> cpuInfo = new Dictionary<string, string>();
private bool licOk = false;
private Dictionary<string, string> netInfo = new Dictionary<string, string>();
private Dictionary<string, string> osInfo = new Dictionary<string, string>();
private Dictionary<string, string> ramInfo = new Dictionary<string, string>();
private bool showBios = false;
private bool showCpu = false;
private bool showKeyMan = false;
private bool showNet = false;
private bool showOs = false;
private bool showRam = false;
#endregion Private Fields
#region Private Properties
private string fileName { get; set; } = "InfoData.json";
private string licVal { get; set; } = "";
#endregion Private Properties
#region Private Methods
private void saveInfoData()
{
var fullData = biosInfo.Concat(cpuInfo).Concat(netInfo).Concat(osInfo).Concat(ramInfo).GroupBy(ele => ele.Key).OrderBy(x => x.Key).ToDictionary(ele => ele.Key, ele => ele.First().Value);
string filePath = Path.Combine(baseDir, "temp", "InfoData.json");
File.WriteAllText(filePath, JsonConvert.SerializeObject(fullData, Formatting.Indented));
}
private async Task SaveLic()
{
//se ho un valore x la licenza...
if (!string.IsNullOrEmpty(licVal))
{
string filePath = Path.Combine(baseDir, "Conf", "lic.file");
File.WriteAllText(filePath, licVal);
}
// check licenze
licOk = await MachineDataValidator.testCurrInfo();
// se ok --> rivado ad home!
if (licOk)
{
await Task.Delay(1);
// rimando alla home
NavManager.NavigateTo("/", true);
}
}
private void ShowAll()
{
showBios = true;
showCpu = true;
showNet = true;
showOs = true;
showRam = true;
}
private void ToggleKeyMan()
{
showKeyMan = !showKeyMan;
// salvo su disco...
saveInfoData();
}
#endregion Private Methods
}
}
+9 -1
View File
@@ -78,7 +78,15 @@ namespace MP.MONO.UI.Pages
protected string lastParam
{
get => selParams == null || selParams.Count == 0 ? "" : selParams.LastOrDefault();
get
{
string answ = "";
if (selParams.Count > 0)
{
answ = $"{selParams.LastOrDefault()}";
}
return answ;
}
}
protected void paramRemoved(string paramName)
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2206.2217</h4>
<h4>Version: 1.2.2209.2116</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2206.2217
1.2.2209.2116
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2206.2217</version>
<version>1.2.2209.2116</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+3 -2
View File
@@ -7,7 +7,7 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=nkc.password",
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
@@ -32,7 +32,8 @@
}
},
"OptPar": {
"MaintPendingRefreshVetoMin": 5,
"MaintLimitPerc": 50,
"MaintPendingRefreshVetoMin": 50,
"AuthCode": "MultiaxD5"
}
}
+39
View File
@@ -0,0 +1,39 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "localhost:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=user_MONO!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "localhost",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"OptPar": {
"MaintPendingRefreshVetoMin": 5,
"MaintLimitPerc": 90,
"AuthCode": "MultiaxD5"
}
}
+38
View File
@@ -0,0 +1,38 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "nkcredis.steamware.net:6379,DefaultDatabase=7,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG",
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"DefaultConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
"AdminConnection": "Server=localhost;port=3306;database=MAPO.MONO;user=root;pwd=Egalware_24068!;sslmode=None;",
"MP.MONO.Data": "Server=localhost;port=3306;database=MAPO.MONO;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
},
"DbConfig": {
"Server": "10.74.82.230",
"nKey": "MONO",
"sKey": "Calcium0xide-CaO"
},
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"SenderName": "Steamware Email BOT"
}
}
},
"OptPar": {
"MaintPendingRefreshVetoMin": 5,
"AuthCode": "MultiaxD5"
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value=".\bin\Debug\net6.0\" />
<Var name="OutPath" value=".\bin\Debug\net6.0_obf\" />
<Var name="InPath" value=".\bin\Release\net6.0\" />
<Var name="OutPath" value=".\bin\Release\net6.0_obf\" />
<Var name="KeepPublicApi" value="true" />
<Var name="HidePrivateApi" value="true" />
<Var name="RenameProperties" value="true" />
+28 -28
View File
@@ -3,54 +3,54 @@
"AddressWidth": "64",
"Architecture": "9",
"BiosVersion": "_ASUS_ - 1072009",
"BuildNumber": "19044",
"BuildNumber": "19043",
"Caption": "Microsoft Windows 10 Pro",
"ConfiguredClockSpeed": "2400",
"ConfiguredVoltage": "1200",
"CpuVersion": "",
"CurrentClockSpeed": "2208",
"CurrentVoltage": "8",
"CpuVersion": "Modello 1, Stepping 0",
"CurrentClockSpeed": "2200",
"CurrentVoltage": "12",
"DataWidth": "64",
"Description": "Intel64 Family 6 Model 158 Stepping 10",
"Description": "AMD64 Family 23 Model 17 Stepping 0",
"DeviceLocator": "ChannelA-DIMM0",
"ExtClock": "100",
"Family": "198",
"Family": "107",
"FormFactor": "12",
"GUID": "{FF6A79F6-DE60-4968-B567-738287074E64}",
"L2CacheSize": "1536",
"L3CacheSize": "9216",
"Level": "6",
"GUID": "{7F313732-DBA3-46E5-9FA7-BEF235B0682E}",
"L2CacheSize": "2048",
"L3CacheSize": "4096",
"Level": "23",
"LoadPercentage": "13",
"MACAddress": "04:EA:56:B5:33:EE",
"MACAddress": "4C:ED:FB:D9:78:83",
"Manufacturer": "American Megatrends Inc.",
"MaxNumberOfProcesses": "4294967295",
"MaxProcessMemorySize": "137438953344",
"MaxVoltage": "1200",
"MinVoltage": "1200",
"Name": "Intel(R) Wireless-AC 9560 160MHz",
"NumberOfCores": "6",
"NumberOfLogicalProcessors": "12",
"Name": "Realtek PCIe GbE Family Controller",
"NumberOfCores": "4",
"NumberOfLogicalProcessors": "8",
"OSArchitecture": "64 bit",
"PartNumber": "CT16G4SFD8266.C16FE ",
"PartNumber": "8ATF1G64HZ-2G3E1 ",
"PhysicalAdapter": "True",
"ProcessorId": "BFEBFBFF000906EA",
"ProcessorId": "178BFBFF00810F10",
"ProcessorType": "3",
"ProductName": "Intel(R) Wireless-AC 9560 160MHz",
"ReleaseDate": "20210127000000.000000+000",
"Revision": "",
"ProductName": "Realtek PCIe GbE Family Controller",
"ReleaseDate": "20190521000000.000000+000",
"Revision": "4352",
"Role": "CPU",
"SerialNumber": "00330-80100-10002-AA618",
"ServiceName": "Netwtw08",
"SMBIOSBIOSVersion": "X580GD.324",
"SerialNumber": "00330-80951-85780-AA242",
"ServiceName": "rt640x64",
"SMBIOSBIOSVersion": "X505ZA.311",
"SMBIOSMajorVersion": "3",
"SMBIOSMemoryType": "26",
"SMBIOSMinorVersion": "2",
"SocketDesignation": "U3E1",
"SoftwareElementID": "X580GD.324",
"SMBIOSMinorVersion": "1",
"SocketDesignation": "FP5",
"SoftwareElementID": "X505ZA.311",
"SoftwareElementState": "3",
"Speed": "2667",
"Speed": "2400",
"SystemBiosMajorVersion": "5",
"SystemBiosMinorVersion": "13",
"SystemName": "W10-DEV-NB01",
"Version": "10.0.19044"
"SystemName": "EGALW-NB-004",
"Version": "10.0.19043"
}