From c067c047bedb4aa9142e5050f62d3d7cc83bfafd Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 9 Dec 2020 16:27:55 +0100 Subject: [PATCH 1/3] update conf x SIM x forcePzCount --- IOB-WIN/DATA/CONF/SIMUL_01.json | 158 +++++++++++++++++--------------- IOB-WIN/DATA/CONF/SIMUL_02.json | 158 +++++++++++++++++--------------- IOB-WIN/DATA/CONF/SIMUL_03.json | 158 +++++++++++++++++--------------- IOB-WIN/DATA/CONF/SIMUL_04.json | 8 ++ IOB-WIN/DATA/CONF/SIMUL_05.json | 158 +++++++++++++++++--------------- IOB-WIN/DATA/CONF/SIMUL_06.json | 158 +++++++++++++++++--------------- IOB-WIN/DATA/CONF/SIMUL_07.json | 8 ++ IOB-WIN/DATA/CONF/SIMUL_08.json | 8 ++ 8 files changed, 439 insertions(+), 375 deletions(-) diff --git a/IOB-WIN/DATA/CONF/SIMUL_01.json b/IOB-WIN/DATA/CONF/SIMUL_01.json index bb10aa12..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_01.json +++ b/IOB-WIN/DATA/CONF/SIMUL_01.json @@ -1,79 +1,87 @@ { - "mMapWrite": { - "setArt": { - "name": "setArt", - "description": "Articolo", - "memAddr": "DB150.DBB12", - "tipoMem": "String", - "index": 12, - "size": 20 + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + } }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "memAddr": "DB150.DBB32", - "tipoMem": "String", - "index": 32, - "size": 20 - }, - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 + "mMapRead": { + "TEMP_01": { + "name": "TEMP_01", + "description": "Temperatura 01", + "tipoMem": "Real", + "minVal": 18, + "maxVal": 24 + }, + "POWER_01": { + "name": "POWER_01", + "description": "Potenza impianto", + "tipoMem": "Int", + "minVal": 40, + "maxVal": 80 + }, + "FEED_OVER": { + "name": "FEED_OVER", + "description": "FEED override", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 100 + }, + "RAPID_OVER": { + "name": "RAPID_OVER", + "description": "RAPID override", + "tipoMem": "Int", + "minVal": 50, + "maxVal": 120 + }, + "POS_X": { + "name": "POS_X", + "description": "Asse X", + "tipoMem": "Int", + "minVal": -2000, + "maxVal": 2000 + }, + "POS_Y": { + "name": "POS_Y", + "description": "Asse Y", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 2000 + }, + "POS_Z": { + "name": "POS_Z", + "description": "Asse Z", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 1500 + } } - }, - "mMapRead": { - "TEMP_01": { - "name": "TEMP_01", - "description": "Temperatura 01", - "tipoMem": "Real", - "minVal": 18, - "maxVal": 24 - }, - "POWER_01": { - "name": "POWER_01", - "description": "Potenza impianto", - "tipoMem": "Int", - "minVal": 40, - "maxVal": 80 - }, - "FEED_OVER": { - "name": "FEED_OVER", - "description": "FEED override", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 100 - }, - "RAPID_OVER": { - "name": "RAPID_OVER", - "description": "RAPID override", - "tipoMem": "Int", - "minVal": 50, - "maxVal": 120 - }, - "POS_X": { - "name": "POS_X", - "description": "Asse X", - "tipoMem": "Int", - "minVal": -2000, - "maxVal": 2000 - }, - "POS_Y": { - "name": "POS_Y", - "description": "Asse Y", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 2000 - }, - "POS_Z": { - "name": "POS_Z", - "description": "Asse Z", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 1500 - } - } } \ No newline at end of file diff --git a/IOB-WIN/DATA/CONF/SIMUL_02.json b/IOB-WIN/DATA/CONF/SIMUL_02.json index bb10aa12..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_02.json +++ b/IOB-WIN/DATA/CONF/SIMUL_02.json @@ -1,79 +1,87 @@ { - "mMapWrite": { - "setArt": { - "name": "setArt", - "description": "Articolo", - "memAddr": "DB150.DBB12", - "tipoMem": "String", - "index": 12, - "size": 20 + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + } }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "memAddr": "DB150.DBB32", - "tipoMem": "String", - "index": 32, - "size": 20 - }, - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 + "mMapRead": { + "TEMP_01": { + "name": "TEMP_01", + "description": "Temperatura 01", + "tipoMem": "Real", + "minVal": 18, + "maxVal": 24 + }, + "POWER_01": { + "name": "POWER_01", + "description": "Potenza impianto", + "tipoMem": "Int", + "minVal": 40, + "maxVal": 80 + }, + "FEED_OVER": { + "name": "FEED_OVER", + "description": "FEED override", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 100 + }, + "RAPID_OVER": { + "name": "RAPID_OVER", + "description": "RAPID override", + "tipoMem": "Int", + "minVal": 50, + "maxVal": 120 + }, + "POS_X": { + "name": "POS_X", + "description": "Asse X", + "tipoMem": "Int", + "minVal": -2000, + "maxVal": 2000 + }, + "POS_Y": { + "name": "POS_Y", + "description": "Asse Y", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 2000 + }, + "POS_Z": { + "name": "POS_Z", + "description": "Asse Z", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 1500 + } } - }, - "mMapRead": { - "TEMP_01": { - "name": "TEMP_01", - "description": "Temperatura 01", - "tipoMem": "Real", - "minVal": 18, - "maxVal": 24 - }, - "POWER_01": { - "name": "POWER_01", - "description": "Potenza impianto", - "tipoMem": "Int", - "minVal": 40, - "maxVal": 80 - }, - "FEED_OVER": { - "name": "FEED_OVER", - "description": "FEED override", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 100 - }, - "RAPID_OVER": { - "name": "RAPID_OVER", - "description": "RAPID override", - "tipoMem": "Int", - "minVal": 50, - "maxVal": 120 - }, - "POS_X": { - "name": "POS_X", - "description": "Asse X", - "tipoMem": "Int", - "minVal": -2000, - "maxVal": 2000 - }, - "POS_Y": { - "name": "POS_Y", - "description": "Asse Y", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 2000 - }, - "POS_Z": { - "name": "POS_Z", - "description": "Asse Z", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 1500 - } - } } \ No newline at end of file diff --git a/IOB-WIN/DATA/CONF/SIMUL_03.json b/IOB-WIN/DATA/CONF/SIMUL_03.json index bb10aa12..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_03.json +++ b/IOB-WIN/DATA/CONF/SIMUL_03.json @@ -1,79 +1,87 @@ { - "mMapWrite": { - "setArt": { - "name": "setArt", - "description": "Articolo", - "memAddr": "DB150.DBB12", - "tipoMem": "String", - "index": 12, - "size": 20 + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + } }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "memAddr": "DB150.DBB32", - "tipoMem": "String", - "index": 32, - "size": 20 - }, - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 + "mMapRead": { + "TEMP_01": { + "name": "TEMP_01", + "description": "Temperatura 01", + "tipoMem": "Real", + "minVal": 18, + "maxVal": 24 + }, + "POWER_01": { + "name": "POWER_01", + "description": "Potenza impianto", + "tipoMem": "Int", + "minVal": 40, + "maxVal": 80 + }, + "FEED_OVER": { + "name": "FEED_OVER", + "description": "FEED override", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 100 + }, + "RAPID_OVER": { + "name": "RAPID_OVER", + "description": "RAPID override", + "tipoMem": "Int", + "minVal": 50, + "maxVal": 120 + }, + "POS_X": { + "name": "POS_X", + "description": "Asse X", + "tipoMem": "Int", + "minVal": -2000, + "maxVal": 2000 + }, + "POS_Y": { + "name": "POS_Y", + "description": "Asse Y", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 2000 + }, + "POS_Z": { + "name": "POS_Z", + "description": "Asse Z", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 1500 + } } - }, - "mMapRead": { - "TEMP_01": { - "name": "TEMP_01", - "description": "Temperatura 01", - "tipoMem": "Real", - "minVal": 18, - "maxVal": 24 - }, - "POWER_01": { - "name": "POWER_01", - "description": "Potenza impianto", - "tipoMem": "Int", - "minVal": 40, - "maxVal": 80 - }, - "FEED_OVER": { - "name": "FEED_OVER", - "description": "FEED override", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 100 - }, - "RAPID_OVER": { - "name": "RAPID_OVER", - "description": "RAPID override", - "tipoMem": "Int", - "minVal": 50, - "maxVal": 120 - }, - "POS_X": { - "name": "POS_X", - "description": "Asse X", - "tipoMem": "Int", - "minVal": -2000, - "maxVal": 2000 - }, - "POS_Y": { - "name": "POS_Y", - "description": "Asse Y", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 2000 - }, - "POS_Z": { - "name": "POS_Z", - "description": "Asse Z", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 1500 - } - } } \ No newline at end of file diff --git a/IOB-WIN/DATA/CONF/SIMUL_04.json b/IOB-WIN/DATA/CONF/SIMUL_04.json index 049835e0..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_04.json +++ b/IOB-WIN/DATA/CONF/SIMUL_04.json @@ -23,6 +23,14 @@ "tipoMem": "Int", "index": 8, "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 } }, "mMapRead": { diff --git a/IOB-WIN/DATA/CONF/SIMUL_05.json b/IOB-WIN/DATA/CONF/SIMUL_05.json index bb10aa12..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_05.json +++ b/IOB-WIN/DATA/CONF/SIMUL_05.json @@ -1,79 +1,87 @@ { - "mMapWrite": { - "setArt": { - "name": "setArt", - "description": "Articolo", - "memAddr": "DB150.DBB12", - "tipoMem": "String", - "index": 12, - "size": 20 + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + } }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "memAddr": "DB150.DBB32", - "tipoMem": "String", - "index": 32, - "size": 20 - }, - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 + "mMapRead": { + "TEMP_01": { + "name": "TEMP_01", + "description": "Temperatura 01", + "tipoMem": "Real", + "minVal": 18, + "maxVal": 24 + }, + "POWER_01": { + "name": "POWER_01", + "description": "Potenza impianto", + "tipoMem": "Int", + "minVal": 40, + "maxVal": 80 + }, + "FEED_OVER": { + "name": "FEED_OVER", + "description": "FEED override", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 100 + }, + "RAPID_OVER": { + "name": "RAPID_OVER", + "description": "RAPID override", + "tipoMem": "Int", + "minVal": 50, + "maxVal": 120 + }, + "POS_X": { + "name": "POS_X", + "description": "Asse X", + "tipoMem": "Int", + "minVal": -2000, + "maxVal": 2000 + }, + "POS_Y": { + "name": "POS_Y", + "description": "Asse Y", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 2000 + }, + "POS_Z": { + "name": "POS_Z", + "description": "Asse Z", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 1500 + } } - }, - "mMapRead": { - "TEMP_01": { - "name": "TEMP_01", - "description": "Temperatura 01", - "tipoMem": "Real", - "minVal": 18, - "maxVal": 24 - }, - "POWER_01": { - "name": "POWER_01", - "description": "Potenza impianto", - "tipoMem": "Int", - "minVal": 40, - "maxVal": 80 - }, - "FEED_OVER": { - "name": "FEED_OVER", - "description": "FEED override", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 100 - }, - "RAPID_OVER": { - "name": "RAPID_OVER", - "description": "RAPID override", - "tipoMem": "Int", - "minVal": 50, - "maxVal": 120 - }, - "POS_X": { - "name": "POS_X", - "description": "Asse X", - "tipoMem": "Int", - "minVal": -2000, - "maxVal": 2000 - }, - "POS_Y": { - "name": "POS_Y", - "description": "Asse Y", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 2000 - }, - "POS_Z": { - "name": "POS_Z", - "description": "Asse Z", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 1500 - } - } } \ No newline at end of file diff --git a/IOB-WIN/DATA/CONF/SIMUL_06.json b/IOB-WIN/DATA/CONF/SIMUL_06.json index bb10aa12..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_06.json +++ b/IOB-WIN/DATA/CONF/SIMUL_06.json @@ -1,79 +1,87 @@ { - "mMapWrite": { - "setArt": { - "name": "setArt", - "description": "Articolo", - "memAddr": "DB150.DBB12", - "tipoMem": "String", - "index": 12, - "size": 20 + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + } }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "memAddr": "DB150.DBB32", - "tipoMem": "String", - "index": 32, - "size": 20 - }, - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 + "mMapRead": { + "TEMP_01": { + "name": "TEMP_01", + "description": "Temperatura 01", + "tipoMem": "Real", + "minVal": 18, + "maxVal": 24 + }, + "POWER_01": { + "name": "POWER_01", + "description": "Potenza impianto", + "tipoMem": "Int", + "minVal": 40, + "maxVal": 80 + }, + "FEED_OVER": { + "name": "FEED_OVER", + "description": "FEED override", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 100 + }, + "RAPID_OVER": { + "name": "RAPID_OVER", + "description": "RAPID override", + "tipoMem": "Int", + "minVal": 50, + "maxVal": 120 + }, + "POS_X": { + "name": "POS_X", + "description": "Asse X", + "tipoMem": "Int", + "minVal": -2000, + "maxVal": 2000 + }, + "POS_Y": { + "name": "POS_Y", + "description": "Asse Y", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 2000 + }, + "POS_Z": { + "name": "POS_Z", + "description": "Asse Z", + "tipoMem": "Int", + "minVal": 0, + "maxVal": 1500 + } } - }, - "mMapRead": { - "TEMP_01": { - "name": "TEMP_01", - "description": "Temperatura 01", - "tipoMem": "Real", - "minVal": 18, - "maxVal": 24 - }, - "POWER_01": { - "name": "POWER_01", - "description": "Potenza impianto", - "tipoMem": "Int", - "minVal": 40, - "maxVal": 80 - }, - "FEED_OVER": { - "name": "FEED_OVER", - "description": "FEED override", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 100 - }, - "RAPID_OVER": { - "name": "RAPID_OVER", - "description": "RAPID override", - "tipoMem": "Int", - "minVal": 50, - "maxVal": 120 - }, - "POS_X": { - "name": "POS_X", - "description": "Asse X", - "tipoMem": "Int", - "minVal": -2000, - "maxVal": 2000 - }, - "POS_Y": { - "name": "POS_Y", - "description": "Asse Y", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 2000 - }, - "POS_Z": { - "name": "POS_Z", - "description": "Asse Z", - "tipoMem": "Int", - "minVal": 0, - "maxVal": 1500 - } - } } \ No newline at end of file diff --git a/IOB-WIN/DATA/CONF/SIMUL_07.json b/IOB-WIN/DATA/CONF/SIMUL_07.json index 049835e0..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_07.json +++ b/IOB-WIN/DATA/CONF/SIMUL_07.json @@ -23,6 +23,14 @@ "tipoMem": "Int", "index": 8, "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 } }, "mMapRead": { diff --git a/IOB-WIN/DATA/CONF/SIMUL_08.json b/IOB-WIN/DATA/CONF/SIMUL_08.json index 049835e0..ba3b8753 100644 --- a/IOB-WIN/DATA/CONF/SIMUL_08.json +++ b/IOB-WIN/DATA/CONF/SIMUL_08.json @@ -23,6 +23,14 @@ "tipoMem": "Int", "index": 8, "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Qty", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 } }, "mMapRead": { From c8564b87885e7876b98d322431d19d902e095663 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 9 Dec 2020 16:28:06 +0100 Subject: [PATCH 2/3] aggiunto gest forcePzCOunt x SIM --- IOB-WIN/IobSimula.cs | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/IOB-WIN/IobSimula.cs b/IOB-WIN/IobSimula.cs index 9b7eacdd..59feb936 100644 --- a/IOB-WIN/IobSimula.cs +++ b/IOB-WIN/IobSimula.cs @@ -520,6 +520,65 @@ namespace IOB_WIN #region Public Methods + /// + /// Processo i task richiesti e li elimino dalla coda 1:1 (in realtà SOLO forceSetPzCount x ora) + /// + /// + public override Dictionary executeTasks(Dictionary task2exe) + { + // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... + Dictionary taskDone = new Dictionary(); + string taskVal = ""; + // verifico non sia null + if (task2exe != null) + { + // cerco task specifici + foreach (var item in task2exe) + { + taskVal = ""; + // converto richiesta in enum... + taskType tName = taskType.nihil; + Enum.TryParse(item.Key, out tName); + // controllo sulla KEY + switch (tName) + { + case taskType.setArt: + case taskType.nihil: + case taskType.fixStopSetup: + case taskType.forceResetPzCount: + case taskType.sendWatchDogMes2Plc: + case taskType.setComm: + case taskType.setParameter: + case taskType.setProg: + case taskType.setPzComm: + case taskType.startSetup: + case taskType.stopSetup: + taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC"; + break; + + case taskType.forceSetPzCount: + // forzo sul SIM il valore pzCOunt dell'IOB... + int newPzCount = contapezziPLC; + bool fatto = int.TryParse(item.Value, out newPzCount); + if (fatto) + { + contapezziPLC = newPzCount; + taskVal = $"Set new contapezziPLC: {contapezziPLC}"; + } + break; + + default: + taskVal = "SKIPPED | NO EXEC"; + break; + } + // aggiungo task! + taskDone.Add(item.Key, taskVal); + } + } + + return taskDone; + } + /// /// Recupera e processa allarmi CNC... /// From 52548edae40b9badd9b33940f5f76d631e4c6784 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 9 Dec 2020 16:42:55 +0100 Subject: [PATCH 3/3] Fix SIM x inviare dati --- IOB-WIN/AdapterForm.cs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/IOB-WIN/AdapterForm.cs b/IOB-WIN/AdapterForm.cs index 23bf1efd..20c971ed 100644 --- a/IOB-WIN/AdapterForm.cs +++ b/IOB-WIN/AdapterForm.cs @@ -760,27 +760,13 @@ namespace IOB_WIN // invia a MES il parametro selezionato (es ART / ODL / PRG NAME, come task2exe..) Dictionary forcedTask = new Dictionary(); // guardo i parametri... - if (txtValue.Text != "") + if (!string.IsNullOrEmpty(txtValue.Text)) { forcedTask.Add(cmbParamValues.SelectedValue.ToString(), txtValue.Text); } -#if false - // accodo SE !="" - if (currItemCode != "") - { - forcedTask.Add("setArt", currItemCode); - } - if (currOrdCode != "") - { - forcedTask.Add("setComm", currOrdCode); - } - if (currPrgName != "") - { - forcedTask.Add("setProg", currPrgName); - } -#endif // chiedo esecuzione task! iobObj.processTask(forcedTask); + chkEdit.Checked = false; toggleEditMes2Plc(); } @@ -924,12 +910,17 @@ namespace IOB_WIN { if (iobObj.memMap.mMapWrite.Count > 0) { + var oldParams = cmbParamValues.DataSource; List parametri = new List(); foreach (var item in iobObj.memMap.mMapWrite) { parametri.Add(item.Key); } + // salvo selezione + int oldIdx = cmbParamValues.SelectedIndex; + // riassegno e ri-seleziono cmbParamValues.DataSource = parametri; + cmbParamValues.SelectedIndex = oldIdx >= 0 ? oldIdx : 0; ; } } }