From 597597ef5b483972c119f83eb6fa8de72d129e20 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 6 Jun 2023 20:02:22 +0200 Subject: [PATCH 01/38] SqlDB: - Update gestione Lantek x DB (ritorno PODL) - Update PAMA x invio cod PODL --- IOB-WIN-NEXT/DATA/CONF/IMI_PAMA_392.ini | 1 + .../DATA/CONF/IMI_SOITAAB_Z2342_01.ini | 1 + IOB-WIN-NEXT/Iob/Generic.cs | 57 +++++++++++++++++-- IOB-WIN-NEXT/IobSql/SqlServLantek.cs | 40 ++++++++++--- IOB-WIN-NEXT/IobSql/SqlServPama.cs | 48 ++++++++++------ 5 files changed, 117 insertions(+), 30 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/IMI_PAMA_392.ini b/IOB-WIN-NEXT/DATA/CONF/IMI_PAMA_392.ini index a37620f4..e24c4d98 100644 --- a/IOB-WIN-NEXT/DATA/CONF/IMI_PAMA_392.ini +++ b/IOB-WIN-NEXT/DATA/CONF/IMI_PAMA_392.ini @@ -73,6 +73,7 @@ SyncStatePwd=viadante16 SyncStateCTout= VetoReadSec=2 VetoSyncSec=10 +;FullPodlUrl=true ; clock base (da 10ms) timerIntMs=20 diff --git a/IOB-WIN-NEXT/DATA/CONF/IMI_SOITAAB_Z2342_01.ini b/IOB-WIN-NEXT/DATA/CONF/IMI_SOITAAB_Z2342_01.ini index b5b8266a..3c53fb69 100644 --- a/IOB-WIN-NEXT/DATA/CONF/IMI_SOITAAB_Z2342_01.ini +++ b/IOB-WIN-NEXT/DATA/CONF/IMI_SOITAAB_Z2342_01.ini @@ -77,6 +77,7 @@ SyncStatePwd=viadante16 SyncStateCTout= VetoReadSec=2 VetoSyncSec=10 +FullPodlUrl=true ; clock base (da 10ms) timerIntMs=20 diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 5c62a04e..3bba59e3 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -7027,12 +7027,12 @@ namespace IOB_WIN_NEXT.Iob /// /// Effettua chiamata MP-IO per tentare chiusura PODL --> ODL specifico /// - /// + /// /// - protected bool tryClosePODL(int IdxPOdl) + protected bool tryClosePODL(int idxPODL) { bool fatto = false; - string fullUrl = $"{urlPODLClose}{IdxPOdl}"; + string fullUrl = $"{urlPODLClose}{idxPODL}"; try { // invio chiamata URL x chiusura ODL su macchina @@ -7041,7 +7041,30 @@ namespace IOB_WIN_NEXT.Iob } catch { } - lgInfo($"Eseguito tryClosePODL per {IdxPOdl} | url: {fullUrl} | esito: {fatto}"); + lgInfo($"Eseguito tryClosePODL per {idxPODL} | url: {fullUrl} | esito: {fatto}"); + return fatto; + } + /// + /// Effettua chiamata MP-IO per tentare chiusura PODL --> ODL specifico + /// + /// + /// + /// + /// + /// + protected bool tryClosePODL(int idxPODL, DateTime dtEve, DateTime dtCurr) + { + bool fatto = false; + string fullUrl = $"{urlPODLClose}{idxPODL}&dtEve={dtEve:yyyyMMddHHmmssfff}&dtCurr={dtCurr:yyyyMMddHHmmssfff}"; + try + { + // invio chiamata URL x chiusura ODL su macchina + string callResp = callUrl(fullUrl, false); + fatto = (callResp != "KO") ? true : false; + } + catch + { } + lgInfo($"Eseguito tryClosePODL per {idxPODL} | url: {fullUrl} | esito: {fatto}"); return fatto; } @@ -7138,10 +7161,34 @@ namespace IOB_WIN_NEXT.Iob protected bool trySetupPODL(int idxPODL) { bool fatto = false; + string fullUrl = $"{urlOLDStartFromPODL}{idxPODL}"; try { // invio chiamata URL x avvio PODL su macchina - string rawSplit = callUrl($"{urlOLDStartFromPODL}{idxPODL}", false); + string rawSplit = callUrl(fullUrl, false); + fatto = (rawSplit != "KO") ? true : false; + } + catch + { } + return fatto; + } + /// + /// Effettua chiamata MP-IO per tentare setup del PODL indicato con indicazioni estese (confirm pezzi, dtEvento, dtCorrente) + /// + /// + /// + /// + /// + /// + protected bool trySetupPODL(int idxPODL, bool doConfirm, DateTime dtEve, DateTime dtCurr) + { + bool fatto = false; + //string format = "yyyyMMddHHmmssfff"; + string fullUrl = $"{urlOLDStartFromPODL}{idxPODL}&doConfirm={doConfirm}&dtEve={dtEve:yyyyMMddHHmmssfff}&dtCurr={dtCurr:yyyyMMddHHmmssfff}"; + try + { + // invio chiamata URL x avvio PODL su macchina + string rawSplit = callUrl(fullUrl, false); fatto = (rawSplit != "KO") ? true : false; } catch diff --git a/IOB-WIN-NEXT/IobSql/SqlServLantek.cs b/IOB-WIN-NEXT/IobSql/SqlServLantek.cs index 0d052fa3..1649f9f4 100644 --- a/IOB-WIN-NEXT/IobSql/SqlServLantek.cs +++ b/IOB-WIN-NEXT/IobSql/SqlServLantek.cs @@ -14,7 +14,7 @@ namespace IOB_WIN_NEXT.IobSql { /// /// Adapter specializzato per LANTEK e le chiamate tramite DB per i dati - /// - PODL (ordini MES --> MACCHINA) + /// - PODL (ordini MES --> MACCHINA) /// - ProdLog (da NestingDaLantek + RigheNestingDaLantek) /// @@ -37,6 +37,7 @@ namespace IOB_WIN_NEXT.IobSql string SyncStateCTout = getOptPar("SyncStateCTout"); string VetoReadSec = getOptPar("VetoReadSec"); string VetoSyncSec = getOptPar("VetoSyncSec"); + string sFullPodlUrl = getOptPar("FullPodlUrl"); setupSpecialParams(); @@ -55,6 +56,10 @@ namespace IOB_WIN_NEXT.IobSql { int.TryParse(VetoSyncSec, out VetoSyncDbSec); } + if (!string.IsNullOrEmpty(sFullPodlUrl)) + { + bool.TryParse(sFullPodlUrl, out FullPodlUrl); + } // avvio DB controller dbProxy = new DbController(connSyncState); @@ -336,6 +341,7 @@ namespace IOB_WIN_NEXT.IobSql #region Protected Fields + protected bool FullPodlUrl = false; protected int vetoReadDbSec = 3; protected int VetoSyncDbSec = 20; @@ -469,13 +475,31 @@ namespace IOB_WIN_NEXT.IobSql { foreach (var sLog2send in data2send) { - // se il record è apertura PODL chiamo apertura - - trySetupPODL(0); - - // se il record è chiusura PODL chiamo chiusura... DOPO aver cercato PODL - // --> ODL - tryClosePODL(0); + if (sLog2send.Action == "StartOrd") + { + if (FullPodlUrl) + { + // se il record è apertura PODL chiamo apertura + trySetupPODL(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + } + else + { + trySetupPODL(0); + } + } + else if (sLog2send.Action == "EndOrd") + { + // se il record è chiusura PODL chiamo chiusura... DOPO aver cercato + // PODL --> ODL + if (FullPodlUrl) + { + tryClosePODL(sLog2send.IdxPodl, sLog2send.DtEve, DateTime.Now); + } + else + { + tryClosePODL(0); + } + } } } diff --git a/IOB-WIN-NEXT/IobSql/SqlServPama.cs b/IOB-WIN-NEXT/IobSql/SqlServPama.cs index 82f9163c..fbd754a3 100644 --- a/IOB-WIN-NEXT/IobSql/SqlServPama.cs +++ b/IOB-WIN-NEXT/IobSql/SqlServPama.cs @@ -37,6 +37,7 @@ namespace IOB_WIN_NEXT.IobSql string SyncStateCTout = getOptPar("SyncStateCTout"); string VetoReadSec = getOptPar("VetoReadSec"); string VetoSyncSec = getOptPar("VetoSyncSec"); + string sFullPodlUrl = getOptPar("FullPodlUrl"); string connSyncState = $"data source={SyncStateServ};initial catalog={SyncStateDb};persist security info=True;user id={SyncStateUser};password={SyncStatePwd};MultipleActiveResultSets=True;App=IOB-WIN-NEXT"; @@ -53,6 +54,10 @@ namespace IOB_WIN_NEXT.IobSql { int.TryParse(VetoSyncSec, out VetoSyncDbSec); } + if (!string.IsNullOrEmpty(sFullPodlUrl)) + { + bool.TryParse(sFullPodlUrl, out FullPodlUrl); + } // eccezione: NON TROVA EntityFramework 6.0.0 o successivo... why?!? dbProxy = new DbController(connSyncState); @@ -338,6 +343,7 @@ namespace IOB_WIN_NEXT.IobSql #region Protected Fields + protected bool FullPodlUrl = false; protected int vetoReadDbSec = 3; protected int VetoSyncDbSec = 20; @@ -536,25 +542,33 @@ namespace IOB_WIN_NEXT.IobSql { foreach (var sLog2send in data2send) { - // se il record è apertura PODL chiamo apertura - - trySetupPODL(0); - - // se il record è chiusura PODL chiamo chiusura... - // DOPO aver cercato PODL --> ODL - tryClosePODL(0); -#if false - string currVal = getEncodSigLog(sLog2send.DtEve, sLog2send.ValInt, counterSigIN); - // --> accodo (valore già formattato)! - QueueIN.Enqueue(currVal); - // loggo! - lgTrace(string.Format("[QUEUE-IN] {0}", currVal)); - counterSigIN++; - if (counterSigIN > 9999) + if (sLog2send.Action == "StartOrd") { - counterSigIN = 0; + if (FullPodlUrl) + { + // se il record è apertura PODL chiamo apertura + trySetupPODL(sLog2send.IdxPodl); + //trySetupPODL(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + } + else + { + trySetupPODL(0); + } + } + else if (sLog2send.Action == "EndOrd") + { + // se il record è chiusura PODL chiamo chiusura... DOPO aver cercato + // PODL --> ODL + if (FullPodlUrl) + { + tryClosePODL(sLog2send.IdxPodl); + //tryClosePODL(sLog2send.IdxPodl, sLog2send.DtEve, DateTime.Now); + } + else + { + tryClosePODL(0); + } } -#endif } } From 03e2d68477584ff501519ed6e0e57df1d79be629 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Jul 2023 10:25:35 +0200 Subject: [PATCH 02/38] Refresh Stel --- IOB-WIN-NEXT/DATA/CONF/MAIN.ini | 2 +- IOB-WIN-NEXT/DATA/CONF/STEL_200.json | 315 ++++++++++++++------------- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 8 +- 3 files changed, 172 insertions(+), 153 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini index 0bb02ea1..525743fd 100644 --- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini +++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini @@ -57,6 +57,6 @@ CLI_INST=SteamWareSim ;STARTLIST=SIMUL_02 ;NB: mettere copy always ai file di conf x fare test... -STARTLIST=BAGLIETTO_CIMOLAI_01 +STARTLIST=SIMUL_01 MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/STEL_200.json b/IOB-WIN-NEXT/DATA/CONF/STEL_200.json index ed501c75..7e751010 100644 --- a/IOB-WIN-NEXT/DATA/CONF/STEL_200.json +++ b/IOB-WIN-NEXT/DATA/CONF/STEL_200.json @@ -1,153 +1,168 @@ { - "BrowseFullVal": "ns=4;i=5001", - "BrowseNSIndex": 4, - "BrowseValue": 5001, - "keyPartCount": "tomes_17_partial_prod", - "keyPartReq": "tomach_6_quantity", - "keyPartId": "", - "keyProgName": "", - "keyRunMode": "", - "pingAsPowerOn": false, - "condWork": [{ - "keyName": "tomes_5_autom", - "targetValue": "True" - }], - "condPowerOn": { - "checkMode": "AND", - "checkList": [{ - "keyName": "tomes_2_mach_on", - "targetValue": "True" - }] - }, - "condReady": { - "checkMode": "AND", - "checkList": [] - }, - "condManual": { - "checkMode": "AND", - "checkList": [{ - "keyName": "tomes_6_manual", - "targetValue": "True" - }] - }, - "condEStop": { - "checkMode": "AND", - "checkList": [] - }, - "condError": { - "checkMode": "AND", - "checkList": [{ - "keyName": "tomes_7_alarm", - "targetValue": "True" - }] - }, - "condCountEnabled": { - "checkMode": "AND", - "checkList": [] - }, - "condWarmUpCoolDown": { - "checkMode": "OR", - "checkList": [] - }, - "condWarning": { - "checkMode": "AND", - "checkList": [{ - "keyName": "tomes_8_warning", - "targetValue": "True" - }] - }, - "condSetup": { - "checkMode": "AND", - "checkList": [{ - "keyName": "tomes_3_setup", - "targetValue": "True" - }] - }, - "fluxLogVeto": [ - "tomes_1_Watchdog" - ], - "itemTranslation": { - "avail": "Machine Available", - "rstat": "Execution Mode", - "mode": "Controller Mode", - "ncprog": "Program Name", - "tomes_13_good_prod": "Pezzi Prodotta", - "tomach_6_quantity": "Qta Richiesta", - "fdovrd": "PATH FEED OVERRIDE", - "rovrd": "PATH RAPID OVERRIDE" - }, - "paramsEndThresh": { - "InvDDone": 50 - }, - "mMapWrite": { - "setPzComm": { - "name": "setPzComm", - "description": "Qty", - "tipoMem": "Int", - "memAddr": "ns=4;s=tomach_6_quantity", - "index": 0, - "size": 4 - }, - "setComm": { - "name": "setComm", - "description": "Commessa", - "tipoMem": "String", - "memAddr": "ns=4;s=tomach_4_prod_order", - "index": 0, - "size": 24 - }, - "setArt": { - "name": "setArt", - "description": "Articolo", - "tipoMem": "String", - "memAddr": "ns=4;s=tomach_3_code_die", - "index": 0, - "size": 24 - } - }, - "subscribedItems": [ - "ns=4;s=tomes_1_Watchdog", - "ns=4;s=tomes_2_mach_on", - "ns=4;s=tomes_3_setup", - "ns=4;s=tomes_4_impulse", - "ns=4;s=tomes_5_autom", - "ns=4;s=tomes_6_manual", - "ns=4;s=tomes_7_alarm", - "ns=4;s=tomes_8_warning", - "ns=4;s=tomes_10_cycle_life", - "ns=4;s=tomes_11_ack_new_order", - "ns=4;s=tomes_13_good_prod", - "ns=4;s=tomes_14_bad_prod_calipso", - "ns=4;s=tomes_15_bad_prod_startup", - "ns=4;s=tomes_16_bad_prod_stop", - "ns=4;s=tomes_17_partial_prod", - "ns=4;s=tomes_18_total_prod", - "ns=4;s=tomes_20_code_die", - "ns=4;s=tomes_21_order", - "ns=4;s=tomach_1_watchdog", - "ns=4;s=tomach_2_new_prod", - "ns=4;s=tomach_3_code_die", - "ns=4;s=tomach_4_prod_order", - "ns=4;s=tomach_6_quantity" - ], - "WatchDog": { - "IsEnabled": true, - "MemConfRead": "ns=4;s=tomes_1_Watchdog", - "MemConfWrite": "ns=4;s=tomach_1_watchdog", - "MaxVal": 9999 - }, - "SetupConf": { - "SetupMode": "MECOLPRESS", - "EnableAdvSetup": false, - "checkParList": { - "tomach_3_code_die": "tomes_20_code_die", - "tomach_4_prod_order": "tomes_21_order" - }, - "writeParAction": [{ - "TargetParam": "ns=4;s=tomach_2_new_prod", - "TargetValEqual": 0, - "TargetValNotEqual": 1, - "DisablePzCountNotEqual": true - }] + "BrowseFullVal": "ns=4;i=5001", + "BrowseNSIndex": 4, + "BrowseValue": 5001, + "keyPartCount": "tomes_17_partial_prod", + "keyPartReq": "tomach_6_quantity", + "keyPartId": "", + "keyProgName": "", + "keyRunMode": "", + "pingAsPowerOn": false, + "condWork": [ + { + "keyName": "tomes_5_autom", + "targetValue": "True" } + ], + "condPowerOn": { + "checkMode": "AND", + "checkList": [ + { + "keyName": "tomes_2_mach_on", + "targetValue": "True" + } + ] + }, + "condReady": { + "checkMode": "AND", + "checkList": [] + }, + "condManual": { + "checkMode": "AND", + "checkList": [ + { + "keyName": "tomes_6_manual", + "targetValue": "True" + } + ] + }, + "condEStop": { + "checkMode": "AND", + "checkList": [] + }, + "condError": { + "checkMode": "AND", + "checkList": [ + { + "keyName": "tomes_7_alarm", + "targetValue": "True" + } + ] + }, + "condCountEnabled": { + "checkMode": "AND", + "checkList": [] + }, + "condWarmUpCoolDown": { + "checkMode": "OR", + "checkList": [], + "negateValue": true + }, + "condWarning": { + "checkMode": "AND", + "checkList": [ + { + "keyName": "tomes_8_warning", + "targetValue": "True" + } + ] + }, + "condSetup": { + "checkMode": "AND", + "checkList": [ + { + "keyName": "tomes_3_setup", + "targetValue": "True" + } + ] + }, + "fluxLogVeto": [ + "tomes_1_Watchdog" + ], + "itemTranslation": { + "avail": "Machine Available", + "rstat": "Execution Mode", + "mode": "Controller Mode", + "ncprog": "Program Name", + "tomes_13_good_prod": "Pezzi Prodotta", + "tomach_6_quantity": "Qta Richiesta", + "fdovrd": "PATH FEED OVERRIDE", + "rovrd": "PATH RAPID OVERRIDE" + }, + "paramsEndThresh": { + "InvDDone": 50 + }, + "mMapWrite": { + "setPzComm": { + "name": "setPzComm", + "description": "Qty", + "tipoMem": "Int", + "memAddr": "ns=4;s=tomach_6_quantity", + "index": 0, + "size": 4 + }, + "setComm": { + "name": "setComm", + "description": "Commessa", + "tipoMem": "String", + "memAddr": "ns=4;s=tomach_4_prod_order", + "index": 0, + "size": 24 + }, + "setArt": { + "name": "setArt", + "description": "Articolo", + "tipoMem": "String", + "memAddr": "ns=4;s=tomach_3_code_die", + "index": 0, + "size": 24 + } + }, + "subscribedItems": [ + "ns=4;s=tomes_1_Watchdog", + "ns=4;s=tomes_2_mach_on", + "ns=4;s=tomes_3_setup", + "ns=4;s=tomes_4_impulse", + "ns=4;s=tomes_5_autom", + "ns=4;s=tomes_6_manual", + "ns=4;s=tomes_7_alarm", + "ns=4;s=tomes_8_warning", + "ns=4;s=tomes_10_cycle_life", + "ns=4;s=tomes_11_ack_new_order", + "ns=4;s=tomes_13_good_prod", + "ns=4;s=tomes_14_bad_prod_calipso", + "ns=4;s=tomes_15_bad_prod_startup", + "ns=4;s=tomes_16_bad_prod_stop", + "ns=4;s=tomes_17_partial_prod", + "ns=4;s=tomes_18_total_prod", + "ns=4;s=tomes_20_code_die", + "ns=4;s=tomes_21_order", + "ns=4;s=tomach_1_watchdog", + "ns=4;s=tomach_2_new_prod", + "ns=4;s=tomach_3_code_die", + "ns=4;s=tomach_4_prod_order", + "ns=4;s=tomach_6_quantity" + ], + "WatchDog": { + "IsEnabled": true, + "MemConfRead": "ns=4;s=tomes_1_Watchdog", + "MemConfWrite": "ns=4;s=tomach_1_watchdog", + "MaxVal": 9999 + }, + "SetupConf": { + "SetupMode": "MECOLPRESS", + "EnableAdvSetup": false, + "checkParList": { + "tomach_3_code_die": "tomes_20_code_die", + "tomach_4_prod_order": "tomes_21_order" + }, + "writeParAction": [ + { + "TargetParam": "ns=4;s=tomach_2_new_prod", + "TargetValEqual": 0, + "TargetValNotEqual": 1, + "DisablePzCountNotEqual": true + } + ] + } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 1f3ce04f..2a414c4e 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -588,7 +588,9 @@ - + + Always + @@ -612,7 +614,9 @@ - + + Always + From 88d65ae8065ab0d1907f4e567aa88c588d0ea3b1 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Jul 2023 14:09:24 +0200 Subject: [PATCH 03/38] Update x gestione code REDIS/Memoria --- IOB-UT-NEXT/DataQueue.cs | 135 +++++++++++++++++++ IOB-UT-NEXT/IOB-UT-NEXT.csproj | 1 + IOB-UT-NEXT/RedisMan.cs | 107 ++++++++++++---- IOB-WIN-NEXT/AdapterForm.cs | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini | 15 ++- IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json | 178 ++++++++++++-------------- IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini | 10 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_02.json | 30 ----- IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini | 11 +- IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini | 19 ++- IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.json | 178 ++++++++++++-------------- IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini | 25 +++- IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.json | 178 ++++++++++++-------------- IOB-WIN-NEXT/DATA/CONF/SIM_PIZ03.ini | 9 +- IOB-WIN-NEXT/DATA/CONF/SIM_PIZ04.ini | 9 +- IOB-WIN-NEXT/DATA/CONF/SIM_PIZ05.ini | 9 +- IOB-WIN-NEXT/DATA/CONF/SIM_PIZ08.ini | 9 +- IOB-WIN-NEXT/Iob/Generic.cs | 57 ++++++--- IOB-WIN-NEXT/IobConfiguration.cs | 5 + 24 files changed, 657 insertions(+), 384 deletions(-) create mode 100644 IOB-UT-NEXT/DataQueue.cs diff --git a/IOB-UT-NEXT/DataQueue.cs b/IOB-UT-NEXT/DataQueue.cs new file mode 100644 index 00000000..8eb40c24 --- /dev/null +++ b/IOB-UT-NEXT/DataQueue.cs @@ -0,0 +1,135 @@ +using StackExchange.Redis; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; + +namespace IOB_UT_NEXT +{ + /// + /// Classe gestione code, a seconda della conf come LIST redis o come concurrent queue in memoria + /// + public class DataQueue + { + #region Public Constructors + + public DataQueue(string codIOB, string qName, bool useRedis) + { + UseRedis = useRedis; + CodIOB = codIOB; + QueueName = qName; + //redisMan = new RedisIobCache(); + KeyName = redisMan.redHash($"IOB:QUEUE:{CodIOB}:{QueueName}"); + } + + #endregion Public Constructors + + #region Public Methods + + public int Count + { + get + { + int answ = 0; + if (UseRedis) + { + answ = (int)redisMan.redQueueCount(KeyName); + } + else + { + answ = MemQueue.Count; + } + return answ; + } + } + + /// + /// Accodamento elemento + /// + /// + public void Enqueue(string item) + { + if (UseRedis) + { + redisMan.redQueuePush(KeyName, item); + } + else + { + MemQueue.Enqueue(item); + } + } + + /// + /// Lista string degli elementi in coda + /// + /// + public List ToList() + { + List answ = new List(); + if (UseRedis) + { + // ciclo x prendere tutti... + while (redisMan.redQueueCount(KeyName) > 0) + { + answ.Add(redisMan.redQueuePop(KeyName)); + } + } + else + { + answ = MemQueue.ToList(); + } + + return answ; + } + + /// + /// Recupera 1 record dalla coda... + /// + /// + /// + public bool TryDequeue(out string result) + { + bool fatto = false; + if (UseRedis) + { + result = redisMan.redQueuePop(KeyName); + fatto = true; + } + else + { + fatto = MemQueue.TryDequeue(out result); + } + return fatto; + } + + #endregion Public Methods + + #region Private Fields + + private string CodIOB = "NA"; + + private RedisKey KeyName = "NA"; + + /// + /// Coda modalità memoria locale + /// + private ConcurrentQueue MemQueue = new ConcurrentQueue(); + + private string QueueName = "NA"; + + /// + /// Indica se usare redis come datastore vs memoria + /// + private bool UseRedis = false; + + #endregion Private Fields + + #region Private Properties + + /// + /// Oggetto connessione REDIS + /// + private RedisIobCache redisMan { get; set; } = new RedisIobCache(); + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index 2572969c..22497f22 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -143,6 +143,7 @@ + diff --git a/IOB-UT-NEXT/RedisMan.cs b/IOB-UT-NEXT/RedisMan.cs index c449f531..306d6165 100644 --- a/IOB-UT-NEXT/RedisMan.cs +++ b/IOB-UT-NEXT/RedisMan.cs @@ -629,29 +629,6 @@ namespace IOB_UT_NEXT } return answ; } - /// - /// RIMUOVE un singolo valore (riga) dalla hash - /// - /// - /// - /// - public string redRemoveHashField(string hashKey, string hashField) - { - string answ = ""; - // cerco se ci sia valore in redis... - try - { - RedisKey chiave = hashKey; - RedisValue campo = hashField; - RedisValue valOut = cache.HashDelete(chiave, campo); - answ = valOut.ToString(); - } - catch (Exception exc) - { - Logging.Instance.Error($"redRemoveHashField{Environment.NewLine}{exc}"); - } - return answ; - } /// /// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da @@ -752,6 +729,60 @@ namespace IOB_UT_NEXT return answ; } + /// + /// Conteggio elementi in QUEUE (FIFO) + /// + /// + /// + public long redQueueCount(RedisKey queueName) + { + return cache.ListLength(queueName); + } + + /// + /// Recupero valore in QUEUE (FIFO) + /// + /// + /// + public RedisValue redQueuePop(RedisKey queueName) + { + return cache.ListLeftPop(queueName); + } + + /// + /// Scrittura valore in QUEUE (FIFO) + /// + /// + /// + public void redQueuePush(RedisKey queueName, RedisValue value) + { + cache.ListRightPush(queueName, value); + } + + /// + /// RIMUOVE un singolo valore (riga) dalla hash + /// + /// + /// + /// + public string redRemoveHashField(string hashKey, string hashField) + { + string answ = ""; + // cerco se ci sia valore in redis... + try + { + RedisKey chiave = hashKey; + RedisValue campo = hashField; + RedisValue valOut = cache.HashDelete(chiave, campo); + answ = valOut.ToString(); + } + catch (Exception exc) + { + Logging.Instance.Error($"redRemoveHashField{Environment.NewLine}{exc}"); + } + return answ; + } + /// /// Salvataggio di una hash di valori /// @@ -930,6 +961,36 @@ namespace IOB_UT_NEXT return answ; } + /// + /// Conteggio elementi in QUEUE (LIFO) + /// + /// + /// + public long redStackCount(RedisKey queueName) + { + return cache.ListLength(queueName); + } + + /// + /// Recupero valore in STACK (LIFO) + /// + /// + /// + public RedisValue redStackPop(RedisKey stackName) + { + return cache.ListRightPop(stackName); + } + + /// + /// Scrittura valore in STACK (LIFO) + /// + /// + /// + public void redStackPush(RedisKey stackName, RedisValue value) + { + cache.ListRightPush(stackName, value); + } + /// /// Resetta (elimina) un contatore in Redis /// diff --git a/IOB-WIN-NEXT/AdapterForm.cs b/IOB-WIN-NEXT/AdapterForm.cs index f579b1be..349db428 100644 --- a/IOB-WIN-NEXT/AdapterForm.cs +++ b/IOB-WIN-NEXT/AdapterForm.cs @@ -1576,6 +1576,7 @@ namespace IOB_WIN_NEXT optPar = optParRead, versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), codIOB = fIni.ReadString("IOB", "IOB_NAME", CurrIOB), + EnableRedisQueue = bool.Parse(fIni.ReadString("IOB", "EnableRedisQueue", "false")), disableExeTask = bool.Parse(fIni.ReadString("IOB", "DIS_EXE_TASK", "false")), disableStateCh = bool.Parse(fIni.ReadString("IOB", "DIS_STATE_CH", "false")), filenameIOB = CurrIOB, diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini index 34da0ae4..1980a398 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE @@ -91,10 +92,12 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= CSV_ADD_HEADER=true -; conf file import -FILE_IMPORT_FOLDER=c:\temp\import -FILE_IMPORT_TYPE=*.xlsx -FILE_ARCHIVE_FOLDER=c:\temp\import\archive - [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json index 06269024..c3f23224 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json @@ -1,99 +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": "Qta Richiesta", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Imposta Qta", + "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": "Qta Richiesta", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 - }, - "forceSetPzCount": { - "name": "forceSetPzCount", - "description": "Imposta Qta", - "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 - } - }, - "fileDecod": { - "Product": 3, - "Variety": 9, - "Supplier": 8, - "ExtDoc": 2, - "DateRif": 14, - "QtyTot": 22, - "NumPack": 21, - "NumPed": 17, - "PackPed": 18, - "PesoPack": 20 - } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini index 8a671de6..5e9f172d 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini @@ -80,6 +80,7 @@ TC_MAX_INCR=5 MAX_PZ_INCR_PERC=1000 ; conf parametri memoria READ/WRITE PARAM_CONF=SIMUL_02.json + ;conf test FTP FTP_SERVER=ftp.steamware.net FTP_USER=testftpuser @@ -90,4 +91,11 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.json b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.json index 90281f1d..dbb74d4d 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.json +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.json @@ -83,35 +83,5 @@ "minVal": 0, "maxVal": 1500 } - }, - "fileDecod": { - "Product": 2, - "Variety": 3, - "Supplier": 4, - "ExtDoc": 0, - "DateRif": 1, - "QtyTot": 15, - "NumPack": 14, - "NumPed": 11, - "PackPed": 12, - "PesoPack": 13 - }, - "optKVP": { - "hasRecipe": true, - "maxPodlQty": 530, - "useLocalRecipe": true, - "path-locBase": "C:\\MesData\\Local", - "path-remBase": "C:\\MesData\\Remote", - "path-00-Arch": "ArchivioRicette\\FIMAT", - "path-01-Temp": "01-Temp\\FIMAT", - "path-02-Sent": "02-Inviate\\FIMAT", - "path-03-Recv": "03-Ricevute\\FIMAT", - "path-04-remReq": "C:\\MesData\\Remote\\Queue2", - "path-05-remExe": "C:\\MesData\\Remote\\Dosed", - "path-06-remRec": "C:\\MesData\\Remote\\Recipes", - "path-outReport": "C:\\MesData\\Report", - "path-confSetup": "C:\\MesData\\Setup\\setupConsumi.json", - "replace-": "{{PODL}}", - "replace-": "Kg{{Qty}} | {{Note}}" } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini index 0765968a..eae8293d 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini @@ -34,7 +34,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=true -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=24 CHANGE_ODL_IDLE_MIN=0 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -92,4 +92,11 @@ FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini index 5d7221d0..b65fa4bf 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini @@ -33,7 +33,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=true -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=24 CHANGE_ODL_IDLE_MIN=0 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -90,4 +90,11 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini index 93377cfc..e3aa4335 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini @@ -33,7 +33,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=true -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=24 CHANGE_ODL_IDLE_MIN=0 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -90,4 +90,11 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini index 20df0ebb..b47b3453 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini @@ -33,7 +33,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=true -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=24 CHANGE_ODL_IDLE_MIN=0 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -90,4 +90,11 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini index fd7a8f3b..06bff735 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini @@ -33,7 +33,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=true -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=24 CHANGE_ODL_IDLE_MIN=0 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -91,4 +91,11 @@ FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini index d5a25c56..639ac427 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini @@ -33,7 +33,7 @@ BLINK_FILT=0 [OPTPAR] AUTO_CHANGE_ODL=false -AUTO_SNAPSHOT_DOSSIER=true +AUTO_SNAPSHOT_DOSSIER=false CHANGE_ODL_HOURS=48 CHANGE_ODL_IDLE_MIN=10 ;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice @@ -90,4 +90,11 @@ FTP_LOC_DIR=temp\csv FTP_REM_DIR= [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini index 4b87c12f..e0cfcc47 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini @@ -74,5 +74,22 @@ SIM_MATR_OPR=1 ; conf parametri memoria READ/WRITE PARAM_CONF=SIM_DP_01.json +;conf test FTP +FTP_SERVER=ftp.steamware.net +FTP_USER=testftpuser +FTP_PWD=we4reFromB3rghem! +FTP_CERT= +FTP_SKIP=TRUE +FTP_LOC_DIR=temp\csv +FTP_REM_DIR= +CSV_ADD_HEADER=true + [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.json b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.json index 482f00ef..c3f23224 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.json +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.json @@ -1,99 +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": "Qta Richiesta", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Imposta Qta", + "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": "Qta Richiesta", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 - }, - "forceSetPzCount": { - "name": "forceSetPzCount", - "description": "Imposta Qta", - "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 - } - }, - "fileDecod": { - "Product": 2, - "Variety": 3, - "Supplier": 4, - "ExtDoc": 0, - "DateRif": 1, - "QtyTot": 15, - "NumPack": 14, - "NumPed": 11, - "PackPed": 12, - "PesoPack": 13 - } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini index 265e84b4..797c6f17 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini @@ -50,7 +50,7 @@ PER_BASE=10400 SIM_PZCNT=10|2 SIM_ALARM=1000|20 SIM_MANU=50|6 -; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi +; 1 = indica che la macchina � multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi IS_MULTI=1 ; indica gestione e simulazione bit 5 --> slow/emergenza SIM_SLOW=6500|20 @@ -58,7 +58,7 @@ SIM_SLOW=6500|20 SIM_WUCD=8000|20 ; indica gestione e simulazione bit 7 --> emergenza SIM_EMRG=4000|10 -; indica simulazione delle funzionalità power ON/ OFF +; indica simulazione delle funzionalit� power ON/ OFF SIM_POW_ON_OFF=false T_ON=6 T_OFF=22 @@ -72,7 +72,24 @@ SIM_DICH=262|1 SIM_MATR_OPR=1 ; conf parametri memoria READ/WRITE -PARAM_CONF=SIM_DP_01.json +PARAM_CONF=SIM_DP_02.json + +;conf test FTP +FTP_SERVER=ftp.steamware.net +FTP_USER=testftpuser +FTP_PWD=we4reFromB3rghem! +FTP_CERT= +FTP_SKIP=TRUE +FTP_LOC_DIR=temp\csv +FTP_REM_DIR= +CSV_ADD_HEADER=true [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.json b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.json index 482f00ef..c3f23224 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.json +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.json @@ -1,99 +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": "Qta Richiesta", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Imposta Qta", + "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": "Qta Richiesta", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 - }, - "forceSetPzCount": { - "name": "forceSetPzCount", - "description": "Imposta Qta", - "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 - } - }, - "fileDecod": { - "Product": 2, - "Variety": 3, - "Supplier": 4, - "ExtDoc": 0, - "DateRif": 1, - "QtyTot": 15, - "NumPack": 14, - "NumPed": 11, - "PackPed": 12, - "PesoPack": 13 - } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ03.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ03.ini index 5770f716..929fef01 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ03.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ03.ini @@ -72,4 +72,11 @@ MAX_PZ_INCR_PERC=1000 PARAM_CONF=SIM_PIZ00.json [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ04.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ04.ini index 5770f716..929fef01 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ04.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ04.ini @@ -72,4 +72,11 @@ MAX_PZ_INCR_PERC=1000 PARAM_CONF=SIM_PIZ00.json [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ05.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ05.ini index 5770f716..929fef01 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ05.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ05.ini @@ -72,4 +72,11 @@ MAX_PZ_INCR_PERC=1000 PARAM_CONF=SIM_PIZ00.json [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ08.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ08.ini index 5770f716..929fef01 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ08.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_PIZ08.ini @@ -72,4 +72,11 @@ MAX_PZ_INCR_PERC=1000 PARAM_CONF=SIM_PIZ00.json [BRANCH] -NAME=master \ No newline at end of file +NAME=master + +; Tags manuali +[TAGS] +Customer=Steamware +HostOS=WIN +HostName=IOB-WIN-SIMULA +HostAddr=10.74.82.76 diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 3bba59e3..bac4159f 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -209,33 +209,39 @@ namespace IOB_WIN_NEXT.Iob /// /// Coda valori ALLARMI ove gestiti... /// - public ConcurrentQueue QueueAlarm = new ConcurrentQueue(); + public DataQueue QueueAlarm = new DataQueue("000", "QueueAlarm", false); + //public ConcurrentQueue QueueAlarm = new ConcurrentQueue(); /// /// Oggetto della coda degli elementi letti di tipo FluxLog (e non ancora trasmessi) /// - public ConcurrentQueue QueueFLog = new ConcurrentQueue(); + public DataQueue QueueFLog = new DataQueue("000", "QueueFLog", false); + //public ConcurrentQueue QueueFLog = new ConcurrentQueue(); /// /// Oggetto della coda degli elementi letti (e non ancora trasmessi) /// - public ConcurrentQueue QueueIN = new ConcurrentQueue(); + public DataQueue QueueIN = new DataQueue("000", "QueueIN", false); + //public ConcurrentQueue QueueIN = new ConcurrentQueue(); /// /// Coda valori MESSAGGI/EVENTI (da non sottocampionare come samples)... /// - public ConcurrentQueue QueueMessages = new ConcurrentQueue(); + public DataQueue QueueMessages = new DataQueue("000", "QueueMessages", false); + //public ConcurrentQueue QueueMessages = new ConcurrentQueue(); /// /// Oggetto della coda degli elementi di tipo RawTransf (e non ancora trasmessi) /// NB: sono salvati serializzati come stringhe /// - public ConcurrentQueue QueueRawTransf = new ConcurrentQueue(); + public DataQueue QueueRawTransf = new DataQueue("000", "QueueRawTransf", false); + //public ConcurrentQueue QueueRawTransf = new ConcurrentQueue(); /// /// Coda valori LOG UTENTE (da non sottocampionare come samples)... /// - public ConcurrentQueue QueueULog = new ConcurrentQueue(); + public DataQueue QueueULog = new DataQueue("000", "QueueULog", false); + //public ConcurrentQueue QueueULog = new ConcurrentQueue(); /// /// alias booleano false = R @@ -312,6 +318,9 @@ namespace IOB_WIN_NEXT.Iob // configurazione... cIobConf = IOBConf; + // imposto le code! + QueueIN= new DataQueue(cIobConf.codIOB, "QueueIN", cIobConf.EnableRedisQueue); + lastConnectTry = DateTime.Now; // aggiungo nel logger IDX Macchina @@ -3887,7 +3896,8 @@ namespace IOB_WIN_NEXT.Iob // invio sendDataBlock(urlType.FLog, listaValori); // svuoto! - QueueFLog = new ConcurrentQueue(); + QueueFLog = new DataQueue(cIobConf.codIOB, "QueueFLog", cIobConf.EnableRedisQueue); + //QueueFLog = new ConcurrentQueue(); } } // HO FINITO invio di FLog... @@ -3926,7 +3936,8 @@ namespace IOB_WIN_NEXT.Iob // invio sendDataBlock(urlType.ULog, listaValori); // svuoto! - QueueULog = new ConcurrentQueue(); + QueueULog = new DataQueue(cIobConf.codIOB, "QueueULog", cIobConf.EnableRedisQueue); + //QueueULog = new ConcurrentQueue(); } } } @@ -3989,7 +4000,8 @@ namespace IOB_WIN_NEXT.Iob // invio sendDataBlock(urlType.SignIN, listaValori); // svuoto! - QueueIN = new ConcurrentQueue(); + QueueIN = new DataQueue(cIobConf.codIOB, "QueueIN", cIobConf.EnableRedisQueue); + //QueueIN = new ConcurrentQueue(); } } else @@ -8102,12 +8114,18 @@ namespace IOB_WIN_NEXT.Iob // svuoto code se richiesto if (resetQueue) { - QueueAlarm = new ConcurrentQueue(); - QueueIN = new ConcurrentQueue(); - QueueFLog = new ConcurrentQueue(); - QueueMessages = new ConcurrentQueue(); - QueueRawTransf = new ConcurrentQueue(); - QueueULog = new ConcurrentQueue(); + QueueAlarm = new DataQueue(cIobConf.codIOB, "QueueAlarm", cIobConf.EnableRedisQueue); + //QueueAlarm = new ConcurrentQueue(); + QueueIN = new DataQueue(cIobConf.codIOB, "QueueIN", cIobConf.EnableRedisQueue); + //QueueIN = new ConcurrentQueue(); + QueueFLog = new DataQueue(cIobConf.codIOB, "QueueFLog", cIobConf.EnableRedisQueue); + //QueueFLog = new ConcurrentQueue(); + QueueMessages = new DataQueue(cIobConf.codIOB, "QueueMessages", cIobConf.EnableRedisQueue); + //QueueMessages = new ConcurrentQueue(); + QueueRawTransf = new DataQueue(cIobConf.codIOB, "QueueRawTransf", cIobConf.EnableRedisQueue); + //QueueRawTransf = new ConcurrentQueue(); + QueueULog = new DataQueue(cIobConf.codIOB, "QueueULog", cIobConf.EnableRedisQueue); + //QueueULog = new ConcurrentQueue(); } // imposto contatori blink a zero... i_counters = new int[32]; @@ -8205,7 +8223,8 @@ namespace IOB_WIN_NEXT.Iob // invio sendDataBlock(urlType.FLog, listaValori); // svuoto! - QueueFLog = new ConcurrentQueue(); + QueueFLog = new DataQueue(cIobConf.codIOB, "QueueFLog", cIobConf.EnableRedisQueue); + //QueueFLog = new ConcurrentQueue(); lastWatchDog = DateTime.Now; } } @@ -8276,7 +8295,8 @@ namespace IOB_WIN_NEXT.Iob if (fatto) { // svuoto se ha okReport! - QueueRawTransf = new ConcurrentQueue(); + QueueRawTransf = new DataQueue(cIobConf.codIOB, "QueueRawTransf", cIobConf.EnableRedisQueue); + //QueueRawTransf = new ConcurrentQueue(); } } } @@ -8337,7 +8357,8 @@ namespace IOB_WIN_NEXT.Iob // invio sendDataBlock(urlType.ULog, listaValori); // svuoto! - QueueULog = new ConcurrentQueue(); + QueueULog = new DataQueue(cIobConf.codIOB, "QueueULog", cIobConf.EnableRedisQueue); + //QueueULog = new ConcurrentQueue(); } } else diff --git a/IOB-WIN-NEXT/IobConfiguration.cs b/IOB-WIN-NEXT/IobConfiguration.cs index a5f406a6..84fbabca 100644 --- a/IOB-WIN-NEXT/IobConfiguration.cs +++ b/IOB-WIN-NEXT/IobConfiguration.cs @@ -60,6 +60,11 @@ namespace IOB_WIN_NEXT /// public bool disableExeTask { get; set; } = false; + /// + /// Indica se le code vadano gestite su redis o meno + /// + public bool EnableRedisQueue { get; set; } = false; + /// /// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti /// con PLC "suddivisi", PLC + HMI) From 27d76311a0fdc22e69fdbf1728daed3840ffe7b3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Jul 2023 14:10:30 +0200 Subject: [PATCH 04/38] Update conf x redis queue in SIM --- IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini | 1 + IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini | 5 +++-- IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini | 1 + 9 files changed, 11 insertions(+), 2 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini index 5e9f172d..b3048dce 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_02.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini index eae8293d..71b21636 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_03.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini index b65fa4bf..ef546d14 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_04.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini index e3aa4335..c56a41e7 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_05.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini index b47b3453..20fdb9ba 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_06.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini index 06bff735..5b79c55a 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_07.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini index 639ac427..0903fd79 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_08.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini index e0cfcc47..743cc9cf 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_01.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE @@ -50,7 +51,7 @@ PER_BASE=10500 SIM_PZCNT=10|3 SIM_ALARM=1000|20 SIM_MANU=50|6 -; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi +; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi IS_MULTI=1 ; indica gestione e simulazione bit 5 --> slow/emergenza SIM_SLOW=3500|20 @@ -58,7 +59,7 @@ SIM_SLOW=3500|20 SIM_WUCD=8000|20 ; indica gestione e simulazione bit 7 --> emergenza SIM_EMRG=4000|10 -; indica simulazione delle funzionalità power ON/ OFF +; indica simulazione delle funzionalità power ON/ OFF SIM_POW_ON_OFF=true T_ON=6 T_OFF=22 diff --git a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini index 797c6f17..de87997b 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIM_DP_02.ini @@ -3,6 +3,7 @@ CNCTYPE=SIMULA PING_MS_TIMEOUT=500 MinDeltaSec=5 +EnableRedisQueue=true [MACHINE] VENDOR=STEAMWARE From 96be4bdf64390269c029e520b2848517e241a134 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 5 Jul 2023 14:51:59 +0200 Subject: [PATCH 05/38] Update gestione Count x DataQueue --- IOB-UT-NEXT/DataQueue.cs | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/IOB-UT-NEXT/DataQueue.cs b/IOB-UT-NEXT/DataQueue.cs index 8eb40c24..b8b698f1 100644 --- a/IOB-UT-NEXT/DataQueue.cs +++ b/IOB-UT-NEXT/DataQueue.cs @@ -10,6 +10,12 @@ namespace IOB_UT_NEXT /// public class DataQueue { + #region Public Fields + + public int Count = 0; + + #endregion Public Fields + #region Public Constructors public DataQueue(string codIOB, string qName, bool useRedis) @@ -17,7 +23,6 @@ namespace IOB_UT_NEXT UseRedis = useRedis; CodIOB = codIOB; QueueName = qName; - //redisMan = new RedisIobCache(); KeyName = redisMan.redHash($"IOB:QUEUE:{CodIOB}:{QueueName}"); } @@ -25,23 +30,6 @@ namespace IOB_UT_NEXT #region Public Methods - public int Count - { - get - { - int answ = 0; - if (UseRedis) - { - answ = (int)redisMan.redQueueCount(KeyName); - } - else - { - answ = MemQueue.Count; - } - return answ; - } - } - /// /// Accodamento elemento /// @@ -51,15 +39,17 @@ namespace IOB_UT_NEXT if (UseRedis) { redisMan.redQueuePush(KeyName, item); + Count = (int)redisMan.redQueueCount(KeyName); } else { MemQueue.Enqueue(item); + Count = MemQueue.Count; } } /// - /// Lista string degli elementi in coda + /// Lista string degli elementi in coda, svuotando la coda /// /// public List ToList() @@ -67,17 +57,19 @@ namespace IOB_UT_NEXT List answ = new List(); if (UseRedis) { + Count = (int)redisMan.redQueueCount(KeyName); // ciclo x prendere tutti... - while (redisMan.redQueueCount(KeyName) > 0) + while (Count > 0) { answ.Add(redisMan.redQueuePop(KeyName)); + Count = (int)redisMan.redQueueCount(KeyName); } } else { answ = MemQueue.ToList(); + Count = MemQueue.Count; } - return answ; } @@ -92,11 +84,13 @@ namespace IOB_UT_NEXT if (UseRedis) { result = redisMan.redQueuePop(KeyName); + Count = (int)redisMan.redQueueCount(KeyName); fatto = true; } else { fatto = MemQueue.TryDequeue(out result); + Count = MemQueue.Count; } return fatto; } From fe9543681a229559939f29704239024b8df29327 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 6 Jul 2023 12:36:26 +0200 Subject: [PATCH 06/38] Fix condizione uscita e send valori --- IOB-WIN-NEXT/Iob/Generic.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index bac4159f..3db87134 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -3859,7 +3859,8 @@ namespace IOB_WIN_NEXT.Iob /// indica se sia richeisto di SVUOTARE le code delle info public virtual void stopAdapter(bool tryRestart, bool forceDequeue) { - if (forceDequeue) + // controllo che non ci sia redis queue altrimenti NON forza svuotamento... + if (forceDequeue && !cIobConf.EnableRedisQueue) { // svuoto le code dei valori letti e non ancora trasmessi... parentForm.displayTaskAndLog("[CLOSING] Svuotamento FORZATO coda segnali...", true); @@ -8174,6 +8175,7 @@ namespace IOB_WIN_NEXT.Iob /// private void svuotaCodaFLog() { + bool sendOnMachineOff = false; // controllo se è passato oltre watchdog e non ho inviato nulla --> RE-INVIO (ultimo inviato)!!!! if (DateTime.Now.Subtract(lastWatchDog).TotalSeconds > utils.CRI("watchdogMaxSec")) { @@ -8185,6 +8187,8 @@ namespace IOB_WIN_NEXT.Iob accodaFLog(sVal, qEncodeFLog("WDST", wdStatus)); } lastWatchDog = DateTime.Now; + sendOnMachineOff = true; + lgInfo("Impostato sendOnMachineOff a true"); } // verifico SE la coda abbia dei valori... if (QueueFLog.Count > 0) @@ -8198,7 +8202,7 @@ namespace IOB_WIN_NEXT.Iob string currVal = ""; if (MPOnline) { - if (IobOnline) + if (IobOnline || sendOnMachineOff) { // se ho + di 2 elementi in coda --> uso invio JSON in blocco... if (QueueFLog.Count > 1) From af461e1cbf25748b96f8659c4d4038e17a4672d8 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 10 Jul 2023 13:36:33 +0200 Subject: [PATCH 07/38] =?UTF-8?q?Aggiunta=20PRELIMINARE=20funzionalit?= =?UTF-8?q?=C3=A0=20save=20fixedWidth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IOB-UT-NEXT/DataExport.cs | 39 +++- IOB-UT-NEXT/DataModel/Fimat.cs | 15 +- IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json | 183 ++++++++++-------- IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json | 25 +++ IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 1 + IOB-WIN-NEXT/Iob/Generic.cs | 25 ++- IOB-WIN-NEXT/Iob/Simula.cs | 22 ++- 7 files changed, 211 insertions(+), 99 deletions(-) create mode 100644 IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json diff --git a/IOB-UT-NEXT/DataExport.cs b/IOB-UT-NEXT/DataExport.cs index 42c6cb82..a82e88a4 100644 --- a/IOB-UT-NEXT/DataExport.cs +++ b/IOB-UT-NEXT/DataExport.cs @@ -14,8 +14,8 @@ namespace IOB_UT_NEXT /// Effettua salvataggio in file di un generico oggetto in formato CSV /// /// - /// - /// + /// Lista oggetti da esportare + /// Percorso file di output /// Indica se scrivere header ad inizio CSV /// Separatore da impiegare (default ";") /// @@ -34,7 +34,6 @@ namespace IOB_UT_NEXT lines.Add(header); } var valueLines = reportData.Select(row => string.Join($"{separator}", fieldList.Split(separator).Select(a => row.GetType().GetProperty(a).GetValue(row, null)))); - //var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null)))); lines.AddRange(valueLines); File.WriteAllLines(path, lines.ToArray()); answ = true; @@ -43,5 +42,39 @@ namespace IOB_UT_NEXT { } return answ; } + + /// + /// Effettua salvataggio in file di un generico oggetto in formato Fixed width + /// + /// + /// Lista oggetti da esportare + /// Percorso file di output + /// Vettore delle larghezze richieste + /// + public static bool SaveFixedWidth(List reportData, string path, Dictionary widthList) + { + bool answ = false; + var lines = new List(); + try + { + IEnumerable props = TypeDescriptor.GetProperties(typeof(T)).OfType(); + var elencoValori = props.ToList(); + foreach (var dataRow in reportData) + { + string currRow = ""; + // processo 1:1 x width... + foreach (var item in widthList) + { + currRow += string.Format($"{{0,{item.Value}}}", dataRow.GetType().GetProperty(item.Key).GetValue(dataRow, null)); + } + lines.Add(currRow); + } + File.WriteAllLines(path, lines.ToArray()); + answ = true; + } + catch + { } + return answ; + } } } diff --git a/IOB-UT-NEXT/DataModel/Fimat.cs b/IOB-UT-NEXT/DataModel/Fimat.cs index b8293102..14bd8303 100644 --- a/IOB-UT-NEXT/DataModel/Fimat.cs +++ b/IOB-UT-NEXT/DataModel/Fimat.cs @@ -122,11 +122,12 @@ namespace IOB_UT_NEXT.DataModel #region Public Properties public string CodMag { get; set; } = ""; - public string FileRef { get; set; } = ""; public string ColourCode { get; set; } = ""; public string Description { get; set; } = ""; - public DateTime DtRif { get; set; } = DateTime.Now; + public string UM { get; set; } = ""; public double WeightKgProc { get; set; } = 0; + public DateTime DtRif { get; set; } = DateTime.Now; + //public string FileRef { get; set; } = ""; #endregion Public Properties } @@ -164,10 +165,20 @@ namespace IOB_UT_NEXT.DataModel /// public string codMag { get; set; } = ""; + /// + /// Modalità export: + /// csv / FixWidth + /// + public string mode { get; set; } = ""; + /// /// Rapporti di conversione x gli item indicati /// public Dictionary convRatio { get; set; } = new Dictionary(); + /// + /// Rapporti di conversione x gli item indicati + /// + public Dictionary fieldLength { get; set; } = new Dictionary(); } [XmlRoot(ElementName = "DesData")] diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json index c3f23224..e6057ae6 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.json @@ -1,87 +1,104 @@ { - "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": "Qta Richiesta", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 - }, - "forceSetPzCount": { - "name": "forceSetPzCount", - "description": "Imposta Qta", - "memAddr": "DB150.DBB8", - "tipoMem": "Int", - "index": 8, - "size": 4 - } + "mMapWrite": { + "setArt": { + "name": "setArt", + "description": "Articolo", + "memAddr": "DB150.DBB12", + "tipoMem": "String", + "index": 12, + "size": 20 }, - "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 - } + "setComm": { + "name": "setComm", + "description": "Commessa", + "memAddr": "DB150.DBB32", + "tipoMem": "String", + "index": 32, + "size": 20 + }, + "setPzComm": { + "name": "setPzComm", + "description": "Qta Richiesta", + "memAddr": "DB150.DBB8", + "tipoMem": "Int", + "index": 8, + "size": 4 + }, + "forceSetPzCount": { + "name": "forceSetPzCount", + "description": "Imposta Qta", + "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 + } + }, + "optKVP": { + "hasRecipe": true, + "maxPodlQty": 530, + "useLocalRecipe": true, + "path-locBase": "C:\\MesData\\", + "path-00-Arch": "ArchivioRicette\\FIMAT", + "path-01-Temp": "01-Temp\\FIMAT", + "path-02-Sent": "02-Inviate\\FIMAT", + "path-03-Recv": "03-Ricevute\\FIMAT", + "path-04-remReq": "Y:\\", + "path-05-remExe": "C:\\MesData\\Remote\\Dosed", + "path-06-remRec": "R:\\", + "path-outReport": "C:\\MesData\\Report", + "path-confSetup": "C:\\MesData\\Setup\\setupConsumi.json", + "replace-": "{{PODL}}", + "replace-": "Kg{{Qty}} | {{Note}}" + } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json new file mode 100644 index 00000000..aeb77514 --- /dev/null +++ b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json @@ -0,0 +1,25 @@ +{ + "addHeader": false, + "numDec": 2, + "codMag": "CH5", + "mode": "FixWidth", + "convRatio": { + "PCW0215": 0.100, + "BLU": 0.100, + "NERO": 0.100, + "ROSSO": 0.100, + "ULTRAPHO": 0.100, + "PRINTWHI": 0.100, + "GIALLORO": 0.100, + "COLANVIO": 0.100, + "GARTIT": 0.100 + }, + "fieldLength": { + "CodMag": 3, + "ColourCode": 8, + "Description": 6, + "UM": 2, + "WeightKgProc": 8, + "DtRif": 10 + } +} \ No newline at end of file diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 2a414c4e..4157f70b 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -350,6 +350,7 @@ + Always diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 3db87134..543ee362 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -319,7 +319,7 @@ namespace IOB_WIN_NEXT.Iob cIobConf = IOBConf; // imposto le code! - QueueIN= new DataQueue(cIobConf.codIOB, "QueueIN", cIobConf.EnableRedisQueue); + QueueIN = new DataQueue(cIobConf.codIOB, "QueueIN", cIobConf.EnableRedisQueue); lastConnectTry = DateTime.Now; @@ -6029,7 +6029,7 @@ namespace IOB_WIN_NEXT.Iob baseUtils.checkDir(zipDir); string zipName = Path.Combine(zipDir, $"{keyReq}.zip"); // gestione report OUT - string reportPath = Path.Combine(reportBasePath, $"{keyReq}.csv"); + string reportPath = Path.Combine(reportBasePath, $"{keyReq}"); // verifico il tipo di attività e procedo switch (valReq) { @@ -7931,6 +7931,7 @@ namespace IOB_WIN_NEXT.Iob { // var di base bool fatto = false; + string expMode = "csv"; List ListConsDet = new List(); List ListConsSum = new List(); // file conf x conversioni... @@ -7950,6 +7951,7 @@ namespace IOB_WIN_NEXT.Iob addHeader = currConf.addHeader; numDec = currConf.numDec; codMag = currConf.codMag; + expMode = currConf.mode.ToLower(); } } } @@ -7992,17 +7994,26 @@ namespace IOB_WIN_NEXT.Iob ConsOut colTotal = new ConsOut() { CodMag = codMag, - FileRef = dirName, ColourCode = colore.ColourCode, Description = colore.Description, - DtRif = colore.DtRif, - WeightKgProc = Math.Round(totWeightKg, numDec) + UM = "Kg", + WeightKgProc = totWeightKg > 0.01 ? Math.Round(totWeightKg, numDec) : 0.01, + DtRif = colore.DtRif }; ListConsSum.Add(colTotal); } - // infine serializzo x output - fatto = DataExport.SaveToCsv(ListConsSum, reportPath, addHeader); + // infine serializzo x output in base alla modalità richiesta + switch (expMode) + { + case "fixwidth": + fatto = DataExport.SaveFixedWidth(ListConsSum, $"{reportPath}.txt", currConf.fieldLength); + break; + case "csv": + default: + fatto = DataExport.SaveToCsv(ListConsSum, $"{reportPath}.csv", addHeader); + break; + } } return fatto; } diff --git a/IOB-WIN-NEXT/Iob/Simula.cs b/IOB-WIN-NEXT/Iob/Simula.cs index 5e2ce135..c7d112c6 100644 --- a/IOB-WIN-NEXT/Iob/Simula.cs +++ b/IOB-WIN-NEXT/Iob/Simula.cs @@ -156,10 +156,24 @@ namespace IOB_WIN_NEXT.Iob } if (hasRecipe) { - // effettua process ritorno ricette - processRecipeFileRet(); - // eseguo verifica/lancio ricette - RecipeDoProcCons(); + try + { + // effettua process ritorno ricette + processRecipeFileRet(); + } + catch (Exception exc) + { + lgError($"Eccezione in TEST processRecipeFileRet{Environment.NewLine}{exc}"); + } + try + { + // eseguo verifica/lancio ricette + RecipeDoProcCons(); + } + catch (Exception exc) + { + lgError($"Eccezione in TEST RecipeDoProcCons{Environment.NewLine}{exc}"); + } } } From 604ab558fce9d5556d54650f87c07b5591b2ae56 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 10 Jul 2023 14:26:32 +0200 Subject: [PATCH 08/38] Completata review gestione output FixedWidth x Tenditalia --- IOB-UT-NEXT/DataExport.cs | 14 ++++++++++++-- IOB-UT-NEXT/DataModel/Fimat.cs | 6 +++++- IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json | 3 +++ IOB-WIN-NEXT/Iob/Generic.cs | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/IOB-UT-NEXT/DataExport.cs b/IOB-UT-NEXT/DataExport.cs index a82e88a4..a98460f7 100644 --- a/IOB-UT-NEXT/DataExport.cs +++ b/IOB-UT-NEXT/DataExport.cs @@ -51,7 +51,7 @@ namespace IOB_UT_NEXT /// Percorso file di output /// Vettore delle larghezze richieste /// - public static bool SaveFixedWidth(List reportData, string path, Dictionary widthList) + public static bool SaveFixedWidth(List reportData, string path, Dictionary widthList, Dictionary fieldLPad) { bool answ = false; var lines = new List(); @@ -65,7 +65,17 @@ namespace IOB_UT_NEXT // processo 1:1 x width... foreach (var item in widthList) { - currRow += string.Format($"{{0,{item.Value}}}", dataRow.GetType().GetProperty(item.Key).GetValue(dataRow, null)); + string currValue = dataRow.GetType().GetProperty(item.Key).GetValue(dataRow, null).ToString(); + if (currValue.Length > item.Value) + { + currValue = currValue.Substring(0, item.Value); + } + // se ha un LPad richiesto esegue... + if (fieldLPad.ContainsKey(item.Key)) + { + currValue = currValue.PadLeft(item.Value, fieldLPad[item.Key]); + } + currRow += string.Format($"{{0,-{item.Value}}}", currValue); } lines.Add(currRow); } diff --git a/IOB-UT-NEXT/DataModel/Fimat.cs b/IOB-UT-NEXT/DataModel/Fimat.cs index 14bd8303..4fd4d204 100644 --- a/IOB-UT-NEXT/DataModel/Fimat.cs +++ b/IOB-UT-NEXT/DataModel/Fimat.cs @@ -176,9 +176,13 @@ namespace IOB_UT_NEXT.DataModel /// public Dictionary convRatio { get; set; } = new Dictionary(); /// - /// Rapporti di conversione x gli item indicati + /// Lunghezza fissa campi /// public Dictionary fieldLength { get; set; } = new Dictionary(); + /// + /// Padding left (OVE necessari) + /// + public Dictionary fieldLPad { get; set; } = new Dictionary(); } [XmlRoot(ElementName = "DesData")] diff --git a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json index aeb77514..8be48276 100644 --- a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json +++ b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json @@ -21,5 +21,8 @@ "UM": 2, "WeightKgProc": 8, "DtRif": 10 + }, + "fieldLPad": { + "WeightKgProc": "0" } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 543ee362..0be778cc 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -7996,7 +7996,7 @@ namespace IOB_WIN_NEXT.Iob CodMag = codMag, ColourCode = colore.ColourCode, Description = colore.Description, - UM = "Kg", + UM = "KG", WeightKgProc = totWeightKg > 0.01 ? Math.Round(totWeightKg, numDec) : 0.01, DtRif = colore.DtRif }; @@ -8007,7 +8007,7 @@ namespace IOB_WIN_NEXT.Iob switch (expMode) { case "fixwidth": - fatto = DataExport.SaveFixedWidth(ListConsSum, $"{reportPath}.txt", currConf.fieldLength); + fatto = DataExport.SaveFixedWidth(ListConsSum, $"{reportPath}.txt", currConf.fieldLength, currConf.fieldLPad); break; case "csv": default: From 86a7bdc912de08ecd8a975ca0cc4a20ead88c725 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 19 Jul 2023 15:21:46 +0200 Subject: [PATCH 09/38] Update conf x FIMAT Tenditalia effettivo --- IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json index 8be48276..22925dca 100644 --- a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json +++ b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json @@ -4,25 +4,22 @@ "codMag": "CH5", "mode": "FixWidth", "convRatio": { - "PCW0215": 0.100, - "BLU": 0.100, - "NERO": 0.100, - "ROSSO": 0.100, - "ULTRAPHO": 0.100, - "PRINTWHI": 0.100, - "GIALLORO": 0.100, - "COLANVIO": 0.100, - "GARTIT": 0.100 + "PCW0215": 0.455, + "BLU": 0.769, + "NERO": 0.714, + "ROSSO": 0.625, + "ULTRAPHO": 1.000, + "PRINTWHI": 0.571, + "GIALLORO": 0.645, + "COLANVIO": 1.000, + "GARTIT": 1.00 }, "fieldLength": { - "CodMag": 3, + "Mag": 3, "ColourCode": 8, "Description": 6, "UM": 2, - "WeightKgProc": 8, - "DtRif": 10 - }, - "fieldLPad": { - "WeightKgProc": "0" + "WeightKg": 8, + "Date": 10 } } \ No newline at end of file From d5f041756b32cfbb7902db26bed3b0c187099259 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 24 Jul 2023 16:14:04 +0200 Subject: [PATCH 10/38] Update conf consumi x Tenditalia (errore nome colonne) --- IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json index 22925dca..e161adc0 100644 --- a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json +++ b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json @@ -15,11 +15,11 @@ "GARTIT": 1.00 }, "fieldLength": { - "Mag": 3, + "CodMag": 3, "ColourCode": 8, "Description": 6, "UM": 2, - "WeightKg": 8, - "Date": 10 + "WeightKgProc": 8, + "DtRif": 10 } } \ No newline at end of file From 458d378c129c3ac20e475fffa3cfd1fc06428f2a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 26 Jul 2023 19:06:50 +0200 Subject: [PATCH 11/38] Update conf x export fixed-width AS400 --- IOB-UT-NEXT/DataExport.cs | 10 +++++++++- IOB-UT-NEXT/DataModel/Fimat.cs | 4 ++++ IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json | 6 ++++++ IOB-WIN-NEXT/Iob/Generic.cs | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/IOB-UT-NEXT/DataExport.cs b/IOB-UT-NEXT/DataExport.cs index a98460f7..c422549b 100644 --- a/IOB-UT-NEXT/DataExport.cs +++ b/IOB-UT-NEXT/DataExport.cs @@ -51,7 +51,7 @@ namespace IOB_UT_NEXT /// Percorso file di output /// Vettore delle larghezze richieste /// - public static bool SaveFixedWidth(List reportData, string path, Dictionary widthList, Dictionary fieldLPad) + public static bool SaveFixedWidth(List reportData, string path, Dictionary widthList, Dictionary fieldLPad, Dictionary numDecReq) { bool answ = false; var lines = new List(); @@ -66,6 +66,14 @@ namespace IOB_UT_NEXT foreach (var item in widthList) { string currValue = dataRow.GetType().GetProperty(item.Key).GetValue(dataRow, null).ToString(); + // se ha un num decimali specifico richiesto esegue... + if (numDecReq.ContainsKey(item.Key)) + { + string nDec = $"N{numDecReq[item.Key]}"; + decimal rawVal = 0; + decimal.TryParse(currValue, out rawVal); + currValue = rawVal.ToString(nDec); + } if (currValue.Length > item.Value) { currValue = currValue.Substring(0, item.Value); diff --git a/IOB-UT-NEXT/DataModel/Fimat.cs b/IOB-UT-NEXT/DataModel/Fimat.cs index 4fd4d204..8bb738a0 100644 --- a/IOB-UT-NEXT/DataModel/Fimat.cs +++ b/IOB-UT-NEXT/DataModel/Fimat.cs @@ -180,6 +180,10 @@ namespace IOB_UT_NEXT.DataModel /// public Dictionary fieldLength { get; set; } = new Dictionary(); /// + /// Numero decimali campo + /// + public Dictionary fieldNDec { get; set; } = new Dictionary(); + /// /// Padding left (OVE necessari) /// public Dictionary fieldLPad { get; set; } = new Dictionary(); diff --git a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json index e161adc0..4376eeaf 100644 --- a/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json +++ b/IOB-WIN-NEXT/DATA/MES_Setup/setupConsumi.json @@ -21,5 +21,11 @@ "UM": 2, "WeightKgProc": 8, "DtRif": 10 + }, + "fieldNDec": { + "WeightKgProc": "2" + }, + "fieldLPad": { + "WeightKgProc": "0" } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 0be778cc..9d75231a 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -8007,7 +8007,7 @@ namespace IOB_WIN_NEXT.Iob switch (expMode) { case "fixwidth": - fatto = DataExport.SaveFixedWidth(ListConsSum, $"{reportPath}.txt", currConf.fieldLength, currConf.fieldLPad); + fatto = DataExport.SaveFixedWidth(ListConsSum, $"{reportPath}.txt", currConf.fieldLength, currConf.fieldLPad, currConf.fieldNDec); break; case "csv": default: From 6ae0a594e64f10634d455b81e02cc355a2cdb710 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 31 Jul 2023 17:14:23 +0200 Subject: [PATCH 12/38] update nuget selenium IDE x MAPO --- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 16 +++++++++------- IOB-WIN-NEXT/packages.config | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 4157f70b..72f709eb 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -226,7 +226,7 @@ ..\ExtLibs\AdsApi\.NET\v4.0.30319\TwinCAT.Ads.dll - ..\packages\Selenium.WebDriver.4.5.1\lib\net46\WebDriver.dll + ..\packages\Selenium.WebDriver.4.10.0\lib\net46\WebDriver.dll @@ -805,14 +805,16 @@ - - - + + + + - - - + + + + \ No newline at end of file diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index 0b984b3f..7ed59704 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -26,10 +26,10 @@ - - - - + + + + From 7e819f39ad98ce063438ae0d52697574380ffee9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 5 Sep 2023 14:47:20 +0200 Subject: [PATCH 13/38] Update PING adapter - check errate disconnessioni immediate - check con/senza ODL --- IOB-WIN-NEXT/DATA/CONF/MAIN.ini | 1 + IOB-WIN-NEXT/DATA/CONF/PING.ini | 4 +++- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 4 +++- IOB-WIN-NEXT/IobNet/Ping.cs | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini index 525743fd..ef9caf4f 100644 --- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini +++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini @@ -58,5 +58,6 @@ CLI_INST=SteamWareSim ;STARTLIST=SIMUL_02 ;NB: mettere copy always ai file di conf x fare test... STARTLIST=SIMUL_01 +;STARTLIST=PING MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/PING.ini b/IOB-WIN-NEXT/DATA/CONF/PING.ini index 73cfa8b0..da24ac99 100644 --- a/IOB-WIN-NEXT/DATA/CONF/PING.ini +++ b/IOB-WIN-NEXT/DATA/CONF/PING.ini @@ -2,13 +2,15 @@ [IOB] CNCTYPE=PingWatchdog PING_MS_TIMEOUT=500 +IOB_NAME=SIMUL_09 [MACHINE] VENDOR=STEAMWARE MODEL=WATCHDOG [CNC] -IP=10.74.83.112 +;IP=10.74.83.112 +IP=10.74.82.253 PORT=0000 [SERVER] diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 72f709eb..659029f5 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -552,7 +552,9 @@ - + + Always + diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index 519606c9..3770b279 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -21,6 +21,9 @@ namespace IOB_WIN_NEXT.IobNet lastPzCountSend = adesso; lastWarnODL = adesso; vetoCheckStatus = adesso; + // 2023.09.05 imposto anche primo ping e check disconnected... + lastPING = adesso; + lastDisconnCheck = adesso; var POWEROFF_TIMEOUT_SEC = getOptPar("POWEROFF_TIMEOUT_SEC"); if (!string.IsNullOrEmpty(POWEROFF_TIMEOUT_SEC)) { @@ -29,6 +32,19 @@ namespace IOB_WIN_NEXT.IobNet lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {cIobConf.cncPingAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec"); } + public override void startAdapter(bool resetQueue) + { + base.startAdapter(resetQueue); + // 2023.09.05 imposto anche primo ping e check disconnected... + DateTime adesso = DateTime.Now; + lastWatchDog = adesso; + lastPING = adesso; + lastReadPLC = adesso; + lastDisconnCheck = adesso; + // faccio un primo check + tryConnect(); + } + #endregion Public Constructors #region Public Methods From bb14c275d559ec312f32df064bdcfa65a380b80d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 10:50:27 +0200 Subject: [PATCH 14/38] Update ping x aggiornamento variabile lastreadPLC --- IOB-WIN-NEXT/IobNet/Ping.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index 3770b279..f39ec612 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -88,6 +88,7 @@ namespace IOB_WIN_NEXT.IobNet if (testPingMachine == IPStatus.Success) { connectionOk = true; + lastReadPLC = DateTime.Now; } else { From f78c1422be428be13b2d589d122e1121c5d80b6f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 11:50:24 +0200 Subject: [PATCH 15/38] Ancora update ping x timeout primo ping --- IOB-WIN-NEXT/DATA/CONF/MAIN.ini | 4 ++-- IOB-WIN-NEXT/DATA/CONF/PING.ini | 3 ++- IOB-WIN-NEXT/IobNet/Ping.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini index ef9caf4f..bf64683c 100644 --- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini +++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini @@ -57,7 +57,7 @@ CLI_INST=SteamWareSim ;STARTLIST=SIMUL_02 ;NB: mettere copy always ai file di conf x fare test... -STARTLIST=SIMUL_01 -;STARTLIST=PING +;STARTLIST=SIMUL_01 +STARTLIST=PING MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-NEXT/DATA/CONF/PING.ini b/IOB-WIN-NEXT/DATA/CONF/PING.ini index da24ac99..454d25cf 100644 --- a/IOB-WIN-NEXT/DATA/CONF/PING.ini +++ b/IOB-WIN-NEXT/DATA/CONF/PING.ini @@ -2,7 +2,8 @@ [IOB] CNCTYPE=PingWatchdog PING_MS_TIMEOUT=500 -IOB_NAME=SIMUL_09 +;IOB_NAME=SIMUL_09 +IOB_NAME=SIMUL_01 [MACHINE] VENDOR=STEAMWARE diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index f39ec612..90be9780 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -38,7 +38,7 @@ namespace IOB_WIN_NEXT.IobNet // 2023.09.05 imposto anche primo ping e check disconnected... DateTime adesso = DateTime.Now; lastWatchDog = adesso; - lastPING = adesso; + //lastPING = adesso; lastReadPLC = adesso; lastDisconnCheck = adesso; // faccio un primo check From 13c10dc0dc03507a51cdb38d76bad10e75fea467 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 15:35:12 +0200 Subject: [PATCH 16/38] Ancor amodifica ocmportamento PING --- IOB-WIN-NEXT/DATA/CONF/PING.ini | 4 ++-- IOB-WIN-NEXT/IobNet/Ping.cs | 36 +++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/PING.ini b/IOB-WIN-NEXT/DATA/CONF/PING.ini index 454d25cf..de8135e3 100644 --- a/IOB-WIN-NEXT/DATA/CONF/PING.ini +++ b/IOB-WIN-NEXT/DATA/CONF/PING.ini @@ -10,8 +10,8 @@ VENDOR=STEAMWARE MODEL=WATCHDOG [CNC] -;IP=10.74.83.112 -IP=10.74.82.253 +IP=10.74.83.183 +;IP=10.74.82.253 PORT=0000 [SERVER] diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index 90be9780..322519c3 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -2,6 +2,7 @@ using MapoSDK; using System; using System.Net.NetworkInformation; +using System.Threading; namespace IOB_WIN_NEXT.IobNet { @@ -41,7 +42,7 @@ namespace IOB_WIN_NEXT.IobNet //lastPING = adesso; lastReadPLC = adesso; lastDisconnCheck = adesso; - // faccio un primo check + // faccio un primo check POST ritardo tryConnect(); } @@ -89,15 +90,18 @@ namespace IOB_WIN_NEXT.IobNet { connectionOk = true; lastReadPLC = DateTime.Now; + lastWatchDog = DateTime.Now; } else { - connectionOk = false; + numFailMax = 10; + checkMaxPingFail(); } if (connectionOk) { B_input = 1; + //numFailCurr = 0; } else { @@ -111,15 +115,38 @@ namespace IOB_WIN_NEXT.IobNet { currDispData.semIn = Semaforo.SR; } + // attesa extra di 1 sec... + Thread.Sleep(1000); } + private void checkMaxPingFail() + { + numFailCurr++; + if (numFailCurr >= numFailMax) + { + lgInfo($"PING: Reached numFailMax: {numFailMax}"); + connectionOk = false; + numFailCurr = 0; + } + } + + /// + /// Max num ping falliti prima di demordere + /// + protected int numFailMax = 3; + /// + /// Num ping falliti corrente + /// + protected int numFailCurr = 0; + + /// /// Override connessione /// public override void tryConnect() { bool doLog = (verboseLog || periodicLog); - lgDebug("PING: tryConnect step 01"); + lgDebug($"PING: tryConnect step 01 | connectionOk: {connectionOk}"); if (!connectionOk) { // controllo che il ping sia stato tentato almeno pingTestSec fa... @@ -142,8 +169,9 @@ namespace IOB_WIN_NEXT.IobNet else { // loggo no risposta ping ... - connectionOk = false; lgError("PING KO"); + numFailMax = 2; + checkMaxPingFail(); } } } From 4f21fc3b9421430ea88efcd955d55eca95ff9cdd Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 18:07:45 +0200 Subject: [PATCH 17/38] Ancora update PING x ritorno online --- IOB-WIN-NEXT/Iob/Generic.cs | 2 +- IOB-WIN-NEXT/IobNet/Ping.cs | 131 +++++++++++++++++++++++------------- 2 files changed, 85 insertions(+), 48 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 9d75231a..d11fb461 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -1709,7 +1709,7 @@ namespace IOB_WIN_NEXT.Iob // --> accodo (valore già formattato)! QueueIN.Enqueue(qEncodeIN); // loggo! - lgTrace(string.Format("[QUEUE-IN] {0}", qEncodeIN)); + lgDebug($"[QUEUE-IN] {qEncodeIN}"); } // aggiorno counters ed eventuale reset nReadFilt++; diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index 322519c3..55a615a1 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -1,8 +1,8 @@ using IOB_UT_NEXT; using MapoSDK; using System; +using System.Linq; using System.Net.NetworkInformation; -using System.Threading; namespace IOB_WIN_NEXT.IobNet { @@ -10,10 +10,7 @@ namespace IOB_WIN_NEXT.IobNet { #region Public Constructors - /// - /// Estende l'init della classe base - /// - /// + /// Estende l'init della classe base public Ping(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) { lgInfo("NEW IobPing (WatchDog)"); @@ -30,22 +27,11 @@ namespace IOB_WIN_NEXT.IobNet { int.TryParse(POWEROFF_TIMEOUT_SEC, out PoweroffTimeoutSec); } + // fix coda ping + PingQueue = new DataQueue("000", "PingQueue", false); lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {cIobConf.cncPingAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec"); } - public override void startAdapter(bool resetQueue) - { - base.startAdapter(resetQueue); - // 2023.09.05 imposto anche primo ping e check disconnected... - DateTime adesso = DateTime.Now; - lastWatchDog = adesso; - //lastPING = adesso; - lastReadPLC = adesso; - lastDisconnCheck = adesso; - // faccio un primo check POST ritardo - tryConnect(); - } - #endregion Public Constructors #region Public Methods @@ -73,8 +59,8 @@ namespace IOB_WIN_NEXT.IobNet } /// - /// Effettua lettura semafori principale - /// Parametri da aggiornare x display in form + /// Effettua lettura semafori principale Parametri da + /// aggiornare x display in form /// public override void readSemafori(ref newDisplayData currDispData) { @@ -85,8 +71,12 @@ namespace IOB_WIN_NEXT.IobNet // in primis salvo data ping comunque... lastPING = DateTime.Now; + // salvo esito ping + bool pingOK = testPingMachine == IPStatus.Success; + addTest(pingOK); + // se passa il ping faccio il resto... - if (testPingMachine == IPStatus.Success) + if (pingStatusOk()) { connectionOk = true; lastReadPLC = DateTime.Now; @@ -94,14 +84,12 @@ namespace IOB_WIN_NEXT.IobNet } else { - numFailMax = 10; - checkMaxPingFail(); + connectionOk = false; } if (connectionOk) { B_input = 1; - //numFailCurr = 0; } else { @@ -115,31 +103,21 @@ namespace IOB_WIN_NEXT.IobNet { currDispData.semIn = Semaforo.SR; } - // attesa extra di 1 sec... - Thread.Sleep(1000); } - private void checkMaxPingFail() + public override void startAdapter(bool resetQueue) { - numFailCurr++; - if (numFailCurr >= numFailMax) - { - lgInfo($"PING: Reached numFailMax: {numFailMax}"); - connectionOk = false; - numFailCurr = 0; - } + base.startAdapter(resetQueue); + // 2023.09.05 imposto anche primo ping e check disconnected... + DateTime adesso = DateTime.Now; + lastWatchDog = adesso; + //lastPING = adesso; + lastReadPLC = adesso; + lastDisconnCheck = adesso; + // faccio un primo check POST ritardo + tryConnect(); } - /// - /// Max num ping falliti prima di demordere - /// - protected int numFailMax = 3; - /// - /// Num ping falliti corrente - /// - protected int numFailCurr = 0; - - /// /// Override connessione /// @@ -149,6 +127,8 @@ namespace IOB_WIN_NEXT.IobNet lgDebug($"PING: tryConnect step 01 | connectionOk: {connectionOk}"); if (!connectionOk) { + //// resetto coda... + //PingQueue = new DataQueue("000", "PingQueue", false); // controllo che il ping sia stato tentato almeno pingTestSec fa... if (DateTime.Now.Subtract(lastPING).TotalSeconds > utils.CRI("pingTestSec")) { @@ -158,8 +138,13 @@ namespace IOB_WIN_NEXT.IobNet } lgDebug("PING: tryConnect step 04"); + lgDebug("PING: Reset PingQueue"); + + bool pingOK = testPingMachine == IPStatus.Success; + addTest(pingOK); + // se passa il ping faccio il resto... - if (testPingMachine == IPStatus.Success) + if (pingStatusOk()) { // in primis salvo data ping... lastPING = DateTime.Now; @@ -170,8 +155,6 @@ namespace IOB_WIN_NEXT.IobNet { // loggo no risposta ping ... lgError("PING KO"); - numFailMax = 2; - checkMaxPingFail(); } } } @@ -190,6 +173,16 @@ namespace IOB_WIN_NEXT.IobNet #region Protected Fields + /// + /// Dimensione coda di ping x valutazione + /// + protected int maxQueuePing = 11; + + /// + /// Coda degli esiti di ping x calcolo stato macchina + /// + protected DataQueue PingQueue = new DataQueue("000", "PingQueue", false); + protected int PoweroffTimeoutSec = 100; /// @@ -198,5 +191,49 @@ namespace IOB_WIN_NEXT.IobNet protected DateTime vetoCheckStatus = DateTime.Now; #endregion Protected Fields + + #region Protected Methods + + protected void addTest(bool pingOk) + { + int score = pingOk ? 1 : 0; + // controllo: se era spenta e risulta ping ok --> reset coda! + if (B_input == 0 && pingOk) + { + B_input = 1; + PingQueue = new DataQueue("000", "PingQueue", false); + lgTrace($"PingQueue resetted on addTest"); + } + PingQueue.Enqueue($"{score}"); + while (PingQueue.Count > maxQueuePing) + { + string res = ""; + PingQueue.TryDequeue(out res); + } + } + + /// calcola status ping: + /// - se ha < 50% coda richiesta --> true + /// - se ha > 50% del max coda --> true se èmaggior parte a 1 (true) + protected bool pingStatusOk() + { + bool answ = true; + int numVal = PingQueue.Count; + if (numVal > maxQueuePing / 2) + { + var listaValori = PingQueue.ToList(); + int numOk = listaValori.Where(x => x == "1").Count(); + int numKo = numVal - numOk; + answ = numOk >= numKo; + lgTrace($"PING ok per: {numOk} > {numKo}"); + } + else + { + lgTrace("PING ok per mancanza dati minimi test"); + } + return answ; + } + + #endregion Protected Methods } } \ No newline at end of file From eb4655edbd81c63521c975437d3f100092c671be Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 18:43:50 +0200 Subject: [PATCH 18/38] Inizio fix warning compilazione --- EgwProxy.Icoel.DataLayer/App.config | 2 +- EgwProxy.Icoel.Test/App.config | 2 +- EgwProxy.Icoel/App.config | 2 +- IOB-UT-NEXT/app.config | 20 ++++---------------- IOB-UT/app.config | 14 -------------- IOB-WIN-NEXT/App.config | 18 ++++++++---------- TestClientMan/IobManComm/app.config | 2 +- TestClientMan/TestClientMan/App.config | 2 +- TestClientMan/TestClientVB/App.config | 2 +- 9 files changed, 18 insertions(+), 46 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/App.config b/EgwProxy.Icoel.DataLayer/App.config index 3373bdc3..3da102af 100644 --- a/EgwProxy.Icoel.DataLayer/App.config +++ b/EgwProxy.Icoel.DataLayer/App.config @@ -39,7 +39,7 @@ - + diff --git a/EgwProxy.Icoel.Test/App.config b/EgwProxy.Icoel.Test/App.config index 1b10acd2..f361cdf6 100644 --- a/EgwProxy.Icoel.Test/App.config +++ b/EgwProxy.Icoel.Test/App.config @@ -70,7 +70,7 @@ - + diff --git a/EgwProxy.Icoel/App.config b/EgwProxy.Icoel/App.config index 99afcda5..95e146a1 100644 --- a/EgwProxy.Icoel/App.config +++ b/EgwProxy.Icoel/App.config @@ -56,7 +56,7 @@ - + diff --git a/IOB-UT-NEXT/app.config b/IOB-UT-NEXT/app.config index 1b1d33ee..6e0524b3 100644 --- a/IOB-UT-NEXT/app.config +++ b/IOB-UT-NEXT/app.config @@ -3,28 +3,16 @@ - - - - - - - - - - - - - - + + - - + + diff --git a/IOB-UT/app.config b/IOB-UT/app.config index 84887076..f3ed3d89 100644 --- a/IOB-UT/app.config +++ b/IOB-UT/app.config @@ -1,19 +1,5 @@  - - - - - - - - - - - - - - \ No newline at end of file diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 9f401684..65cb3382 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -111,8 +111,14 @@ - - + + + + + + + + @@ -129,14 +135,6 @@ - - - - - - - - diff --git a/TestClientMan/IobManComm/app.config b/TestClientMan/IobManComm/app.config index e69d1fcf..7bfe8a14 100644 --- a/TestClientMan/IobManComm/app.config +++ b/TestClientMan/IobManComm/app.config @@ -4,7 +4,7 @@ - + diff --git a/TestClientMan/TestClientMan/App.config b/TestClientMan/TestClientMan/App.config index 960744d0..3306ae92 100644 --- a/TestClientMan/TestClientMan/App.config +++ b/TestClientMan/TestClientMan/App.config @@ -8,7 +8,7 @@ - + diff --git a/TestClientMan/TestClientVB/App.config b/TestClientMan/TestClientVB/App.config index dd73f870..f938ae90 100644 --- a/TestClientMan/TestClientVB/App.config +++ b/TestClientMan/TestClientVB/App.config @@ -7,7 +7,7 @@ - + From 24ff59aeb8bbfc8be2d102df0e31136c0a6583dd Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 18:51:25 +0200 Subject: [PATCH 19/38] Update nuget EgwProxyIcoel --- .../EgwProxy.Icoel.DataLayer.csproj | 6 ++++-- EgwProxy.Icoel.DataLayer/packages.config | 2 +- EgwProxy.Icoel.Test/App.config | 2 +- EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj | 4 ++-- EgwProxy.Icoel.Test/packages.config | 2 +- EgwProxy.Icoel/App.config | 2 +- EgwProxy.Icoel/EgwProxy.Icoel.csproj | 4 ++-- EgwProxy.Icoel/packages.config | 2 +- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 2 +- IOB-UT-NEXT/app.config | 8 ++++++++ IOB-UT-NEXT/packages.config | 2 +- IOB-WIN-NEXT/App.config | 10 +++++++++- 12 files changed, 32 insertions(+), 14 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj index 7a71091f..2f14af0a 100644 --- a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj +++ b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj @@ -99,8 +99,10 @@ ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll - - ..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll diff --git a/EgwProxy.Icoel.DataLayer/packages.config b/EgwProxy.Icoel.DataLayer/packages.config index 67c12590..a4f9571d 100644 --- a/EgwProxy.Icoel.DataLayer/packages.config +++ b/EgwProxy.Icoel.DataLayer/packages.config @@ -19,7 +19,7 @@ - + diff --git a/EgwProxy.Icoel.Test/App.config b/EgwProxy.Icoel.Test/App.config index f361cdf6..d9f09f7c 100644 --- a/EgwProxy.Icoel.Test/App.config +++ b/EgwProxy.Icoel.Test/App.config @@ -70,7 +70,7 @@ - + diff --git a/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj b/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj index 68e1c233..5c753c7c 100644 --- a/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj +++ b/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj @@ -36,8 +36,8 @@ - - ..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll diff --git a/EgwProxy.Icoel.Test/packages.config b/EgwProxy.Icoel.Test/packages.config index 69ca852f..42c44888 100644 --- a/EgwProxy.Icoel.Test/packages.config +++ b/EgwProxy.Icoel.Test/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/EgwProxy.Icoel/App.config b/EgwProxy.Icoel/App.config index 95e146a1..6c042f56 100644 --- a/EgwProxy.Icoel/App.config +++ b/EgwProxy.Icoel/App.config @@ -56,7 +56,7 @@ - + diff --git a/EgwProxy.Icoel/EgwProxy.Icoel.csproj b/EgwProxy.Icoel/EgwProxy.Icoel.csproj index 414507bc..6c5d6197 100644 --- a/EgwProxy.Icoel/EgwProxy.Icoel.csproj +++ b/EgwProxy.Icoel/EgwProxy.Icoel.csproj @@ -46,8 +46,8 @@ - - ..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll diff --git a/EgwProxy.Icoel/packages.config b/EgwProxy.Icoel/packages.config index 8b897446..2429b01a 100644 --- a/EgwProxy.Icoel/packages.config +++ b/EgwProxy.Icoel/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index 22497f22..1765c530 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -94,7 +94,7 @@ ..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll - ..\packages\StackExchange.Redis.2.6.80\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.1.30\lib\net461\StackExchange.Redis.dll diff --git a/IOB-UT-NEXT/app.config b/IOB-UT-NEXT/app.config index 6e0524b3..00a8647a 100644 --- a/IOB-UT-NEXT/app.config +++ b/IOB-UT-NEXT/app.config @@ -22,6 +22,14 @@ + + + + + + + + diff --git a/IOB-UT-NEXT/packages.config b/IOB-UT-NEXT/packages.config index 81fe0a2c..acbe3509 100644 --- a/IOB-UT-NEXT/packages.config +++ b/IOB-UT-NEXT/packages.config @@ -6,7 +6,7 @@ - + diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 65cb3382..8dce8d50 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -117,7 +117,7 @@ - + @@ -135,6 +135,14 @@ + + + + + + + + From 924519f157c1a519aba5203e3f666761384108ec Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 19:01:59 +0200 Subject: [PATCH 20/38] Ancora update nuget x ProxyIcoel --- .../EgwProxy.Icoel.DataLayer.csproj | 16 ++++++++-------- EgwProxy.Icoel.DataLayer/packages.config | 8 ++++---- EgwProxy.Icoel.Debug.nuspec | 2 +- EgwProxy.Icoel.Release.nuspec | 2 +- EgwProxy.Icoel/EgwProxy.Icoel.csproj | 4 ++-- EgwProxy.Icoel/packages.config | 2 +- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 4 ++-- IOB-WIN-NEXT/packages.config | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj index 2f14af0a..2f45415e 100644 --- a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj +++ b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj @@ -74,8 +74,8 @@ ..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll - - ..\packages\NLog.4.7.9\lib\net45\NLog.dll + + ..\packages\NLog.5.1.2\lib\net46\NLog.dll @@ -83,8 +83,8 @@ - - ..\packages\System.Configuration.ConfigurationManager.5.0.0\lib\net461\System.Configuration.ConfigurationManager.dll + + ..\packages\System.Configuration.ConfigurationManager.6.0.1\lib\net461\System.Configuration.ConfigurationManager.dll @@ -120,8 +120,8 @@ - - ..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll + + ..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll @@ -132,8 +132,8 @@ ..\packages\System.Security.Cryptography.ProtectedData.4.5.0\lib\net461\System.Security.Cryptography.ProtectedData.dll - - ..\packages\System.Security.Permissions.5.0.0\lib\net461\System.Security.Permissions.dll + + ..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll diff --git a/EgwProxy.Icoel.DataLayer/packages.config b/EgwProxy.Icoel.DataLayer/packages.config index a4f9571d..2132e8f0 100644 --- a/EgwProxy.Icoel.DataLayer/packages.config +++ b/EgwProxy.Icoel.DataLayer/packages.config @@ -13,9 +13,9 @@ - + - + @@ -24,11 +24,11 @@ - + - + diff --git a/EgwProxy.Icoel.Debug.nuspec b/EgwProxy.Icoel.Debug.nuspec index 578007e9..90dd7f6f 100644 --- a/EgwProxy.Icoel.Debug.nuspec +++ b/EgwProxy.Icoel.Debug.nuspec @@ -12,7 +12,7 @@ #copyright# EgwProxy.Icoel EgwProxy Icoel - + diff --git a/EgwProxy.Icoel.Release.nuspec b/EgwProxy.Icoel.Release.nuspec index 046d2cb6..980049e0 100644 --- a/EgwProxy.Icoel.Release.nuspec +++ b/EgwProxy.Icoel.Release.nuspec @@ -12,7 +12,7 @@ #copyright# EgwProxy.Icoel EgwProxy Icoel - + diff --git a/EgwProxy.Icoel/EgwProxy.Icoel.csproj b/EgwProxy.Icoel/EgwProxy.Icoel.csproj index 6c5d6197..bc185238 100644 --- a/EgwProxy.Icoel/EgwProxy.Icoel.csproj +++ b/EgwProxy.Icoel/EgwProxy.Icoel.csproj @@ -39,8 +39,8 @@ - - ..\packages\NLog.4.7.9\lib\net45\NLog.dll + + ..\packages\NLog.5.1.2\lib\net46\NLog.dll diff --git a/EgwProxy.Icoel/packages.config b/EgwProxy.Icoel/packages.config index 2429b01a..fa571ab6 100644 --- a/EgwProxy.Icoel/packages.config +++ b/EgwProxy.Icoel/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 659029f5..d73b8b08 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -110,10 +110,10 @@ ..\packages\EgwProxy.Ftp.3.6.2210.1815\lib\EgwProxy.Ftp.dll - ..\packages\EgwProxy.Icoel.3.6.2210.1815\lib\EgwProxy.Icoel.dll + ..\packages\EgwProxy.Icoel.3.6.2309.618\lib\EgwProxy.Icoel.dll - ..\packages\EgwProxy.Icoel.3.6.2210.1815\lib\EgwProxy.Icoel.DataLayer.dll + ..\packages\EgwProxy.Icoel.3.6.2309.618\lib\EgwProxy.Icoel.DataLayer.dll ..\packages\EgwProxy.MultiCncLib.3.6.2207.1211\lib\EgwProxy.MultiCncLib.dll diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index 7ed59704..3fdfad22 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -3,7 +3,7 @@ - + From 7e825d0e93a4ac3496690abe110469a748a47a53 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 19:21:55 +0200 Subject: [PATCH 21/38] Ancora update nuget --- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 22 +++++++++++----------- IOB-UT-NEXT/app.config | 12 ++++++++++-- IOB-UT-NEXT/packages.config | 14 +++++++------- IOB-WIN-NEXT/App.config | 10 +++++++++- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 10 +++++----- IOB-WIN-NEXT/packages.config | 6 +++--- 6 files changed, 45 insertions(+), 29 deletions(-) diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index 1765c530..eb8e72d2 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -75,8 +75,8 @@ MinimumRecommendedRules.ruleset - - ..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll + + ..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll ..\packages\MapoSDK.6.14.2304.1209\lib\MapoSDK.dll @@ -88,13 +88,13 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\NLog.5.1.2\lib\net46\NLog.dll + ..\packages\NLog.5.2.3\lib\net46\NLog.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll - ..\packages\StackExchange.Redis.2.1.30\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.6.122\lib\net461\StackExchange.Redis.dll @@ -102,17 +102,17 @@ - - ..\packages\System.Diagnostics.PerformanceCounter.6.0.0\lib\net461\System.Diagnostics.PerformanceCounter.dll + + ..\packages\System.Diagnostics.PerformanceCounter.6.0.1\lib\net461\System.Diagnostics.PerformanceCounter.dll ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - - ..\packages\System.IO.Pipelines.6.0.0\lib\net461\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.6.0.3\lib\net461\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll diff --git a/IOB-UT-NEXT/app.config b/IOB-UT-NEXT/app.config index 00a8647a..8d60e816 100644 --- a/IOB-UT-NEXT/app.config +++ b/IOB-UT-NEXT/app.config @@ -4,11 +4,11 @@ - + - + @@ -30,6 +30,14 @@ + + + + + + + + diff --git a/IOB-UT-NEXT/packages.config b/IOB-UT-NEXT/packages.config index acbe3509..f566da31 100644 --- a/IOB-UT-NEXT/packages.config +++ b/IOB-UT-NEXT/packages.config @@ -3,15 +3,15 @@ - - - - + + + + - + - - + + diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 8dce8d50..3215a716 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -125,7 +125,7 @@ - + @@ -143,6 +143,14 @@ + + + + + + + + diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index d73b8b08..0f2398c9 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -110,10 +110,10 @@ ..\packages\EgwProxy.Ftp.3.6.2210.1815\lib\EgwProxy.Ftp.dll - ..\packages\EgwProxy.Icoel.3.6.2309.618\lib\EgwProxy.Icoel.dll + ..\packages\EgwProxy.Icoel.3.6.2309.619\lib\EgwProxy.Icoel.dll - ..\packages\EgwProxy.Icoel.3.6.2309.618\lib\EgwProxy.Icoel.DataLayer.dll + ..\packages\EgwProxy.Icoel.3.6.2309.619\lib\EgwProxy.Icoel.DataLayer.dll ..\packages\EgwProxy.MultiCncLib.3.6.2207.1211\lib\EgwProxy.MultiCncLib.dll @@ -156,7 +156,7 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\NLog.5.1.2\lib\net46\NLog.dll + ..\packages\NLog.5.2.3\lib\net46\NLog.dll ..\packages\OmronFinsTCP.Net.3.0.0.0\lib\net40\OmronFinsTCP.Net.dll @@ -193,8 +193,8 @@ - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index 3fdfad22..d88c6072 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -32,7 +32,7 @@ - + From 4825b10e3596e8ad425c8f12f0940b99bf65b884 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 Sep 2023 19:24:14 +0200 Subject: [PATCH 22/38] code cleanup --- IOB-WIN-NEXT/Iob/Generic.cs | 1 - IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index d11fb461..d39ae9b1 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -2739,7 +2739,6 @@ namespace IOB_WIN_NEXT.Iob lgTrace("Richiesta processAutoDossier"); string IOB_MULTI_CNAME = ""; string[] elencoMulti = null; - string fullUrl = ""; if (isMulti) { // devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali... diff --git a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs index 8aee27e4..bfa3b5f0 100644 --- a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs +++ b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs @@ -2,6 +2,7 @@ using IOB_UT_NEXT; using MapoSDK; using Newtonsoft.Json; +using OpenQA.Selenium; using System; using System.Collections.Generic; using System.IO; @@ -57,7 +58,9 @@ namespace IOB_WIN_NEXT.IobFile } } catch (Exception exc) - { } + { + lgError($"Eccezione in IobFileSoitaab{Environment.NewLine}{exc}"); + } lastPING = DateTime.Now.AddHours(-1); } From e8812faad23b358f88f58b5ce04372ebd9c062b8 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 08:10:02 +0200 Subject: [PATCH 23/38] Update riferimenti x autobinding redirect --- EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj | 4 ++-- EgwProxy.Icoel.DataLayer/packages.config | 2 +- EgwProxy.Icoel.Test/App.config | 2 +- EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj | 2 +- EgwProxy.Icoel/App.config | 2 +- EgwProxy.Icoel/EgwProxy.Icoel.csproj | 5 +++-- EgwProxy.Icoel/packages.config | 2 +- IOB-MAN/IOB-MAN.csproj | 2 +- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 2 +- IOB-UT-NEXT/app.config | 2 +- IOB-WIN-NEXT/App.config | 2 +- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 2 +- TestClientMan/IobManComm/IobManComm.csproj | 2 +- TestClientMan/TestClientVB/TestClientVB.vbproj | 2 +- 14 files changed, 17 insertions(+), 16 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj index 2f45415e..75124c1c 100644 --- a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj +++ b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj @@ -75,7 +75,7 @@ ..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll - ..\packages\NLog.5.1.2\lib\net46\NLog.dll + ..\packages\NLog.5.2.3\lib\net46\NLog.dll @@ -99,7 +99,7 @@ ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll True True diff --git a/EgwProxy.Icoel.DataLayer/packages.config b/EgwProxy.Icoel.DataLayer/packages.config index 2132e8f0..8f76d200 100644 --- a/EgwProxy.Icoel.DataLayer/packages.config +++ b/EgwProxy.Icoel.DataLayer/packages.config @@ -13,7 +13,7 @@ - + diff --git a/EgwProxy.Icoel.Test/App.config b/EgwProxy.Icoel.Test/App.config index d9f09f7c..f361cdf6 100644 --- a/EgwProxy.Icoel.Test/App.config +++ b/EgwProxy.Icoel.Test/App.config @@ -70,7 +70,7 @@ - + diff --git a/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj b/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj index 5c753c7c..9375929a 100644 --- a/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj +++ b/EgwProxy.Icoel.Test/EgwProxy.Icoel.Test.csproj @@ -36,7 +36,7 @@ - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll diff --git a/EgwProxy.Icoel/App.config b/EgwProxy.Icoel/App.config index 6c042f56..95e146a1 100644 --- a/EgwProxy.Icoel/App.config +++ b/EgwProxy.Icoel/App.config @@ -56,7 +56,7 @@ - + diff --git a/EgwProxy.Icoel/EgwProxy.Icoel.csproj b/EgwProxy.Icoel/EgwProxy.Icoel.csproj index bc185238..dc643762 100644 --- a/EgwProxy.Icoel/EgwProxy.Icoel.csproj +++ b/EgwProxy.Icoel/EgwProxy.Icoel.csproj @@ -40,14 +40,15 @@ - ..\packages\NLog.5.1.2\lib\net46\NLog.dll + ..\packages\NLog.5.2.3\lib\net46\NLog.dll - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True diff --git a/EgwProxy.Icoel/packages.config b/EgwProxy.Icoel/packages.config index fa571ab6..21f93e4a 100644 --- a/EgwProxy.Icoel/packages.config +++ b/EgwProxy.Icoel/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/IOB-MAN/IOB-MAN.csproj b/IOB-MAN/IOB-MAN.csproj index f4c3cc5e..3c9cda44 100644 --- a/IOB-MAN/IOB-MAN.csproj +++ b/IOB-MAN/IOB-MAN.csproj @@ -101,7 +101,7 @@ ..\packages\System.Diagnostics.PerformanceCounter.6.0.1\lib\net461\System.Diagnostics.PerformanceCounter.dll - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll True True diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index eb8e72d2..ed214e40 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -105,7 +105,7 @@ ..\packages\System.Diagnostics.PerformanceCounter.6.0.1\lib\net461\System.Diagnostics.PerformanceCounter.dll - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll diff --git a/IOB-UT-NEXT/app.config b/IOB-UT-NEXT/app.config index 8d60e816..15273954 100644 --- a/IOB-UT-NEXT/app.config +++ b/IOB-UT-NEXT/app.config @@ -4,7 +4,7 @@ - + diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 3215a716..173116ec 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -117,7 +117,7 @@ - + diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 0f2398c9..1f57cb94 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -12,7 +12,7 @@ IOB-WIN-NEXT v4.6.2 512 - false + true false diff --git a/TestClientMan/IobManComm/IobManComm.csproj b/TestClientMan/IobManComm/IobManComm.csproj index b0fb1852..a1b3f7ca 100644 --- a/TestClientMan/IobManComm/IobManComm.csproj +++ b/TestClientMan/IobManComm/IobManComm.csproj @@ -55,7 +55,7 @@ ..\packages\System.Diagnostics.PerformanceCounter.5.0.0\lib\net461\System.Diagnostics.PerformanceCounter.dll - + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll diff --git a/TestClientMan/TestClientVB/TestClientVB.vbproj b/TestClientMan/TestClientVB/TestClientVB.vbproj index e4a654e3..b509f594 100644 --- a/TestClientMan/TestClientVB/TestClientVB.vbproj +++ b/TestClientMan/TestClientVB/TestClientVB.vbproj @@ -76,7 +76,7 @@ ..\packages\IobManComm.0.9.2210.2716\lib\System.Diagnostics.PerformanceCounter.dll - + ..\packages\IobManComm.0.9.2210.2716\lib\System.IO.Compression.dll From 68b819e430616ddcc6473f7e5e518e270e8535cd Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 08:16:09 +0200 Subject: [PATCH 24/38] Update conf x package icoel (rimozione massiva!!!) --- EgwProxy.Icoel.DataLayer/App.config | 4 +- .../EgwProxy.Icoel.DataLayer.csproj | 67 ++----------------- EgwProxy.Icoel.DataLayer/packages.config | 24 +------ EgwProxy.Icoel.Test/App.config | 4 +- EgwProxy.Icoel/App.config | 4 +- 5 files changed, 12 insertions(+), 91 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/App.config b/EgwProxy.Icoel.DataLayer/App.config index 3da102af..cd37fb59 100644 --- a/EgwProxy.Icoel.DataLayer/App.config +++ b/EgwProxy.Icoel.DataLayer/App.config @@ -19,11 +19,11 @@ - + - + diff --git a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj index 75124c1c..709043fa 100644 --- a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj +++ b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj @@ -35,45 +35,12 @@ 4 - - ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll - - - ..\packages\Azure.Identity.1.3.0\lib\netstandard2.0\Azure.Identity.dll - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - - ..\packages\Microsoft.Data.SqlClient.4.1.1\lib\net461\Microsoft.Data.SqlClient.dll - - - ..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll - - - ..\packages\Microsoft.Identity.Client.Extensions.Msal.2.16.5\lib\net45\Microsoft.Identity.Client.Extensions.Msal.dll - - - ..\packages\Microsoft.IdentityModel.JsonWebTokens.6.8.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll - - - ..\packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll - - - ..\packages\Microsoft.IdentityModel.Protocols.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.dll - - - ..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll - - - ..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll - ..\packages\NLog.5.2.3\lib\net46\NLog.dll @@ -83,19 +50,10 @@ - - ..\packages\System.Configuration.ConfigurationManager.6.0.1\lib\net461\System.Configuration.ConfigurationManager.dll - - - ..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - ..\packages\System.IdentityModel.Tokens.Jwt.6.8.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll - ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll @@ -104,16 +62,16 @@ True True - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll @@ -129,26 +87,11 @@ ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - ..\packages\System.Security.Cryptography.ProtectedData.4.5.0\lib\net461\System.Security.Cryptography.ProtectedData.dll - - - ..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll - ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll - - ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll - - - ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll @@ -188,7 +131,5 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - \ No newline at end of file diff --git a/EgwProxy.Icoel.DataLayer/packages.config b/EgwProxy.Icoel.DataLayer/packages.config index 8f76d200..eb9d5551 100644 --- a/EgwProxy.Icoel.DataLayer/packages.config +++ b/EgwProxy.Icoel.DataLayer/packages.config @@ -1,37 +1,17 @@  - - - - - - - - - - - - - - - - + - + - - - - - \ No newline at end of file diff --git a/EgwProxy.Icoel.Test/App.config b/EgwProxy.Icoel.Test/App.config index f361cdf6..3acc1c60 100644 --- a/EgwProxy.Icoel.Test/App.config +++ b/EgwProxy.Icoel.Test/App.config @@ -50,11 +50,11 @@ - + - + diff --git a/EgwProxy.Icoel/App.config b/EgwProxy.Icoel/App.config index 95e146a1..dbfff9ff 100644 --- a/EgwProxy.Icoel/App.config +++ b/EgwProxy.Icoel/App.config @@ -36,11 +36,11 @@ - + - + From f95f6d53861d70ff1a5e0891af928d93951e9b87 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 08:39:59 +0200 Subject: [PATCH 25/38] Update sintassi pub channel redis --- IOB-UT-NEXT/RedisMan.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IOB-UT-NEXT/RedisMan.cs b/IOB-UT-NEXT/RedisMan.cs index 306d6165..826a85f3 100644 --- a/IOB-UT-NEXT/RedisMan.cs +++ b/IOB-UT-NEXT/RedisMan.cs @@ -1041,7 +1041,8 @@ namespace IOB_UT_NEXT } // invio notifica tramite il canale richiesto - messageDisp.Publish(notifyChannel, message); + RedisChannel pubNotifyChannel = new RedisChannel(notifyChannel, RedisChannel.PatternMode.Literal); + messageDisp.Publish(pubNotifyChannel, message); fatto = true; // restituisco! return fatto; From e87e2ab0362b5be86793dcda7f95f0afe5fba8cf Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 08:40:12 +0200 Subject: [PATCH 26/38] Update nuget x selenium driver x WPS --- IOB-WIN-NEXT/App.config | 12 ++++++--- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 46 ++++++++++++++++++++++++-------- IOB-WIN-NEXT/packages.config | 15 +++++++---- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 173116ec..d1cb673f 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -139,10 +139,6 @@ - - - - @@ -151,6 +147,14 @@ + + + + + + + + diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 1f57cb94..3710b247 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -94,8 +94,8 @@ MinimumRecommendedRules.ruleset - - ..\packages\Autoupdater.NET.Official.1.7.0\lib\net45\AutoUpdater.NET.dll + + ..\packages\Autoupdater.NET.Official.1.8.4\lib\net45\AutoUpdater.NET.dll ..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll @@ -110,10 +110,10 @@ ..\packages\EgwProxy.Ftp.3.6.2210.1815\lib\EgwProxy.Ftp.dll - ..\packages\EgwProxy.Icoel.3.6.2309.619\lib\EgwProxy.Icoel.dll + ..\packages\EgwProxy.Icoel.3.6.2309.708\lib\EgwProxy.Icoel.dll - ..\packages\EgwProxy.Icoel.3.6.2309.619\lib\EgwProxy.Icoel.DataLayer.dll + ..\packages\EgwProxy.Icoel.3.6.2309.708\lib\EgwProxy.Icoel.DataLayer.dll ..\packages\EgwProxy.MultiCncLib.3.6.2207.1211\lib\EgwProxy.MultiCncLib.dll @@ -149,6 +149,24 @@ ..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + ..\packages\Microsoft.IdentityModel.Abstractions.6.19.0\lib\net461\Microsoft.IdentityModel.Abstractions.dll + + + ..\packages\Microsoft.IdentityModel.Logging.6.19.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + + ..\packages\Microsoft.IdentityModel.Tokens.6.19.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.1938.49\lib\net45\Microsoft.Web.WebView2.Core.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.1938.49\lib\net45\Microsoft.Web.WebView2.WinForms.dll + + + ..\packages\Microsoft.Web.WebView2.1.0.1938.49\lib\net45\Microsoft.Web.WebView2.Wpf.dll + ..\packages\MTConnect.NET.2.9.1.28314\lib\net40\MTConnect-NET.dll @@ -188,6 +206,9 @@ + + ..\packages\System.Drawing.Common.7.0.0\lib\net462\System.Drawing.Common.dll + ..\packages\System.Formats.Asn1.6.0.0\lib\net461\System.Formats.Asn1.dll @@ -197,6 +218,7 @@ ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll @@ -226,7 +248,7 @@ ..\ExtLibs\AdsApi\.NET\v4.0.30319\TwinCAT.Ads.dll - ..\packages\Selenium.WebDriver.4.10.0\lib\net46\WebDriver.dll + ..\packages\Selenium.WebDriver.4.12.4\lib\netstandard2.0\WebDriver.dll @@ -807,16 +829,18 @@ - - - + + + + - - - + + + + \ No newline at end of file diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index d88c6072..fdb8e768 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -1,9 +1,9 @@  - + - + @@ -13,7 +13,11 @@ + + + + @@ -26,11 +30,12 @@ - - + + - + + From cd7cdb73265b60177ce3149b1dbcf2dd916ad817 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 08:59:56 +0200 Subject: [PATCH 27/38] Update IOB-MAN --- IOB-MAN/App.config | 4 + IOB-MAN/IOB-MAN.csproj | 14 +- IOB-MAN/NLog.xsd | 3656 --------------------------------------- IOB-MAN/packages.config | 8 +- 4 files changed, 13 insertions(+), 3669 deletions(-) delete mode 100644 IOB-MAN/NLog.xsd diff --git a/IOB-MAN/App.config b/IOB-MAN/App.config index 73c38842..6d151e04 100644 --- a/IOB-MAN/App.config +++ b/IOB-MAN/App.config @@ -99,6 +99,10 @@ + + + + diff --git a/IOB-MAN/IOB-MAN.csproj b/IOB-MAN/IOB-MAN.csproj index 3c9cda44..cf0737db 100644 --- a/IOB-MAN/IOB-MAN.csproj +++ b/IOB-MAN/IOB-MAN.csproj @@ -44,8 +44,9 @@ ..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll - - ..\packages\MapoSDK.6.14.2204.2616\lib\MapoSDK.dll + + ..\packages\MapoSDK.6.14.2304.1209\lib\MapoSDK.dll + True ..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll @@ -63,10 +64,10 @@ ..\packages\MongoDB.Libmongocrypt.1.3.0\lib\netstandard2.0\MongoDB.Libmongocrypt.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\NLog.4.7.15\lib\net45\NLog.dll + + ..\packages\NLog.5.2.3\lib\net46\NLog.dll ..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll @@ -239,9 +240,6 @@ PreserveNewest - - Designer - SettingsSingleFileGenerator diff --git a/IOB-MAN/NLog.xsd b/IOB-MAN/NLog.xsd deleted file mode 100644 index eefeec81..00000000 --- a/IOB-MAN/NLog.xsd +++ /dev/null @@ -1,3656 +0,0 @@ - - - - - - - - - - - - - - - Watch config file for changes and reload automatically. - - - - - Print internal NLog messages to the console. Default value is: false - - - - - Print internal NLog messages to the console error output. Default value is: false - - - - - Write internal NLog messages to the specified file. - - - - - Log level threshold for internal log messages. Default value is: Info. - - - - - Global log level threshold for application log messages. Messages below this level won't be logged. - - - - - Throw an exception when there is an internal error. Default value is: false. Not recommend to set to true in production! - - - - - Throw an exception when there is a configuration error. If not set, determined by throwExceptions. - - - - - Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. - - - - - Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. - - - - - Write timestamps for internal NLog messages. Default value is: true. - - - - - Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. - - - - - Perform message template parsing and formatting of LogEvent messages (true = Always, false = Never, empty = Auto Detect). Default value is: empty. - - - - - - - - - - - - - - Make all targets within this section asynchronous (creates additional threads but the calling thread isn't blocked by any target writes). - - - - - - - - - - - - - - - - - Prefix for targets/layout renderers/filters/conditions loaded from this assembly. - - - - - Load NLog extensions from the specified file (*.dll) - - - - - Load NLog extensions from the specified assembly. Assembly name should be fully qualified. - - - - - - - - - - Filter on the name of the logger. May include wildcard characters ('*' or '?'). - - - - - Comma separated list of levels that this rule matches. - - - - - Minimum level that this rule matches. - - - - - Maximum level that this rule matches. - - - - - Level that this rule matches. - - - - - Comma separated list of target names. - - - - - Ignore further rules if this one matches. - - - - - Enable this rule. Note: disabled rules aren't available from the API. - - - - - Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName. - - - - - - - - - - - - - - - Default action if none of the filters match. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. - - - - - Ignore any errors in the include file. - - - - - - - - Variable value. Note, the 'value' attribute has precedence over this one. - - - - - - Variable name. - - - - - Variable value. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Number of log events that should be processed in a batch by the lazy writer thread. - - - - - Whether to use the locking queue, instead of a lock-free concurrent queue The locking queue is less concurrent when many logger threads, but reduces memory allocation - - - - - Limit of full s to write before yielding into Performance is better when writing many small batches, than writing a single large batch - - - - - Action to be taken when the lazy writer thread request queue count exceeds the set limit. - - - - - Limit on the number of requests in the lazy writer thread request queue. - - - - - Time in milliseconds to sleep between batches. (1 or less means trigger on new activity) - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - Delay the flush until the LogEvent has been confirmed as written - - - - - Condition expression. Log events who meet this condition will cause a flush on the wrapped target. - - - - - Only flush when LogEvent matches condition. Ignore explicit-flush, config-reload-flush and shutdown-flush - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Number of log events to be buffered. - - - - - Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes. - - - - - Action to take if the buffer overflows. - - - - - Indicates whether to use sliding timeout. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - End of line value if a newline is appended at the end of log message . - - - - - Maximum message size in bytes. - - - - - Indicates whether to append newline at the end of log message. - - - - - Get or set the SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - The number of seconds a connection will remain idle before the first keep-alive probe is sent - - - - - Maximum queue size. - - - - - Maximum current connections. 0 = no maximum. - - - - - Action that should be taken if the will be more connections than . - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Indicates whether to keep connection open whenever possible. - - - - - NDLC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - Renderer for log4j:event logger-xml-attribute (Default ${logger}) - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include contents of the stack. - - - - - Indicates whether to include stack contents. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - Option to include all properties from the log events - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - NDC item separator. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Layout that should be use to calculate the value for the parameter. - - - - - Viewer parameter name. - - - - - Whether an attribute with empty value should be included in the output - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) - - - - - Enables output using ANSI Color Codes - - - - - The encoding for writing messages to the . - - - - - Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). - - - - - Indicates whether to auto-flush after - - - - - Indicates whether to auto-check if the console has been redirected to file - Disables coloring logic when System.Console.IsOutputRedirected = true - - - - - Indicates whether to use default row highlighting rules. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Condition that must be met in order to set the specified foreground and background color. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - - - Compile the ? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. - - - - - Condition that must be met before scanning the row for highlight of words - - - - - Indicates whether to ignore case when comparing texts. - - - - - Regular expression to be matched. You must specify either text or regex. - - - - - Text to be matched. You must specify either text or regex. - - - - - Indicates whether to match whole words only. - - - - - Background color. - - - - - Foreground color. - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Indicates whether to auto-flush after - - - - - Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) - - - - - The encoding for writing messages to the . - - - - - Indicates whether to send the log messages to the standard error instead of the standard output. - - - - - Whether to enable batch writing using char[]-buffers, instead of using - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Obsolete - value will be ignored! The logging code always runs outside of transaction. Gets or sets a value indicating whether to use database transactions. Some data providers require this. - - - - - Indicates whether to keep the database connection open between the log events. - - - - - Name of the database provider. - - - - - Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. - - - - - Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. - - - - - Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. - - - - - Name of the connection string (as specified in <connectionStrings> configuration section. - - - - - Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. - - - - - Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. - - - - - Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. - - - - - Configures isolated transaction batch writing. If supported by the database, then it will improve insert performance. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Text of the SQL command to be run on each log level. - - - - - Type of the SQL command to be run on each log level. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Convert format of the property value - - - - - Culture used for parsing property string-value for type-conversion - - - - - Value to assign on the object-property - - - - - Name for the object-property - - - - - Type of the object-property - - - - - - - - - - - - - - Type of the command. - - - - - Connection string to run the command against. If not provided, connection string from the target is used. - - - - - Indicates whether to ignore failures. - - - - - Command text. - - - - - - - - - - - - - - - - - - - Database parameter name. - - - - - Layout that should be use to calculate the value for the parameter. - - - - - Database parameter DbType. - - - - - Database parameter size. - - - - - Database parameter precision. - - - - - Database parameter scale. - - - - - Type of the parameter. - - - - - Whether empty value should translate into DbNull. Requires database column to allow NULL values. - - - - - Convert format of the database parameter value. - - - - - Culture used for parsing parameter string-value for type-conversion - - - - - - - - - - - - - - - - Name of the target. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Layout that renders event Category. - - - - - Optional entry type. When not set, or when not convertible to then determined by - - - - - Layout that renders event ID. - - - - - Name of the Event Log to write to. This can be System, Application or any user-defined name. - - - - - Name of the machine on which Event Log service is running. - - - - - Maximum Event log size in kilobytes. - - - - - Message length limit to write to the Event Log. - - - - - Value to be used as the event Source. - - - - - Action to take if the message is larger than the option. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether to return to the first target after any successful write. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - File encoding. - - - - - Line ending mode. - - - - - Maximum days of archive files that should be kept. - - - - - Indicates whether to compress archive files into the zip archive format. - - - - - Way file archives are numbered. - - - - - Name of the file to be used for an archive. - - - - - Is the an absolute or relative path? - - - - - Indicates whether to automatically archive log files every time the specified time passes. - - - - - Size in bytes above which log files will be automatically archived. Warning: combining this with isn't supported. We cannot create multiple archive files, if they should have the same name. Choose: - - - - - Maximum number of archive files that should be kept. - - - - - Indicates whether the footer should be written only when the file is archived. - - - - - Maximum number of log file names that should be stored as existing. - - - - - Indicates whether to delete old log file on startup. - - - - - File attributes (Windows only). - - - - - Indicates whether to create directories if they do not exist. - - - - - Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. - - - - - Value of the file size threshold to archive old log file on startup. - - - - - Indicates whether to archive old log file on startup. - - - - - Value specifying the date format to use when archiving files. - - - - - Indicates whether to enable log file(s) to be deleted. - - - - - Indicates whether to write BOM (byte order mark) in created files - - - - - Indicates whether to replace file contents on each write instead of appending log message at the end. - - - - - Indicates whether file creation calls should be synchronized by a system global mutex. - - - - - Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. - - - - - Is the an absolute or relative path? - - - - - Name of the file to write to. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Indicates whether concurrent writes to the log file by multiple processes on different network hosts. - - - - - Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity. - - - - - Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). - - - - - Indicates whether to keep log file open instead of opening and closing it on each logging event. - - - - - Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write - - - - - Indicates whether concurrent writes to the log file by multiple processes on the same host. - - - - - Number of times the write is appended on the file before NLog discards the log message. - - - - - Delay in milliseconds to wait before attempting to write to the file again. - - - - - Log file buffer size in bytes. - - - - - Maximum number of seconds before open files are flushed. If this number is negative or zero the files are not flushed by timer. - - - - - Indicates whether to automatically flush the file buffers after each log message. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Condition expression. Log events who meet this condition will be forwarded to the wrapped target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Windows domain name to change context to. - - - - - Required impersonation level. - - - - - Type of the logon provider. - - - - - Logon Type. - - - - - User account password. - - - - - Indicates whether to revert to the credentials of the process instead of impersonating another user. - - - - - Username to change context to. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Interval in which messages will be written up to the number of messages. - - - - - Maximum allowed number of messages written per . - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Endpoint address. - - - - - Name of the endpoint configuration in WCF configuration file. - - - - - Indicates whether to use a WCF service contract that is one way (fire and forget) or two way (request-reply) - - - - - Client ID. - - - - - Indicates whether to include per-event properties in the payload sent to the server. - - - - - Indicates whether to use binary message encoding. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - Layout that should be use to calculate the value for the parameter. - - - - - Name of the parameter. - - - - - Type of the parameter. - - - - - Type of the parameter. Obsolete alias for - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Text to be rendered. - - - - - Header. - - - - - Footer. - - - - - Indicates whether NewLine characters in the body should be replaced with tags. - - - - - Priority used for sending mails. - - - - - Encoding to be used for sending e-mail. - - - - - BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - Indicates whether to add new lines between log entries. - - - - - Indicates whether to send message as HTML instead of plain text. - - - - - Sender's email address (e.g. joe@domain.com). - - - - - Mail message body (repeated for each log message send in one mail). - - - - - Mail subject. - - - - - Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Indicates the SMTP client timeout. - - - - - SMTP Server to be used for sending. - - - - - SMTP Authentication mode. - - - - - Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). - - - - - Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. - - - - - Port number that SMTP Server is listening on. - - - - - Indicates whether the default Settings from System.Net.MailSettings should be used. - - - - - Folder where applications save mail messages to be processed by the local SMTP server. - - - - - Specifies how outgoing email messages will be handled. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Max number of items to have in memory - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Class name. - - - - - Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Encoding to be used. - - - - - End of line value if a newline is appended at the end of log message . - - - - - Maximum message size in bytes. - - - - - Indicates whether to append newline at the end of log message. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - The number of seconds a connection will remain idle before the first keep-alive probe is sent - - - - - Indicates whether to keep connection open whenever possible. - - - - - Maximum current connections. 0 = no maximum. - - - - - Maximum queue size. - - - - - Action that should be taken if the will be more connections than . - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Get or set the SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Encoding to be used. - - - - - Instance of that is used to format log messages. - - - - - End of line value if a newline is appended at the end of log message . - - - - - Maximum message size in bytes. - - - - - Indicates whether to append newline at the end of log message. - - - - - Get or set the SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. - - - - - Network address. - - - - - Size of the connection cache (number of connections which are kept alive). - - - - - The number of seconds a connection will remain idle before the first keep-alive probe is sent - - - - - Maximum queue size. - - - - - Maximum current connections. 0 = no maximum. - - - - - Action that should be taken if the will be more connections than . - - - - - Action that should be taken if the message is larger than maxMessageSize. - - - - - Indicates whether to keep connection open whenever possible. - - - - - NDLC item separator. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - Renderer for log4j:event logger-xml-attribute (Default ${logger}) - - - - - Indicates whether to include NLog-specific extensions to log4j schema. - - - - - Indicates whether to include contents of the stack. - - - - - Indicates whether to include stack contents. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include dictionary contents. - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - Option to include all properties from the log events - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. - - - - - NDC item separator. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Indicates whether to perform layout calculation. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Indicates whether performance counter should be automatically created. - - - - - Name of the performance counter category. - - - - - Counter help text. - - - - - Name of the performance counter. - - - - - Performance counter type. - - - - - The value by which to increment the counter. - - - - - Performance counter instance name. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Default filter to be applied when no specific rule matches. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - Condition to be tested. - - - - - Resulting filter to be applied when the condition matches. - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Number of times to repeat each log message. - - - - - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Number of retries that should be attempted on the wrapped target in case of a failure. - - - - - Time to wait between retries in milliseconds. - - - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Forward to (Instead of ) - - - - - Always use independent of - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of the target. - - - - - Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit - - - - - Should we include the BOM (Byte-order-mark) for UTF? Influences the property. This will only work for UTF-8. - - - - - Web service method name. Only used with Soap. - - - - - Web service namespace. Only used with Soap. - - - - - Protocol to be used when calling web service. - - - - - Custom proxy address, include port separated by a colon - - - - - Encoding. - - - - - Web service URL. - - - - - Value of the User-agent HTTP header. - - - - - Value whether escaping be done according to the old NLog style (Very non-standard) - - - - - Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) - - - - - Indicates whether to pre-authenticate the HttpWebRequest (Requires 'Authorization' in parameters) - - - - - Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see and ). - - - - - (optional) root namespace of the XML document, if POST of XML document chosen. (see and ). - - - - - Proxy configuration when calling web service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Footer layout. - - - - - Header layout. - - - - - Body layout (can be repeated multiple times). - - - - - Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom'). - - - - - Column delimiter. - - - - - Quote Character. - - - - - Quoting mode. - - - - - Indicates whether CVS should include header. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Layout of the column. - - - - - Name of the column. - - - - - Override of Quoting mode - - - - - - - - - - - - - - - - - - - - - - Should forward slashes be escaped? If true, / will be converted to \/ - - - - - Option to render the empty object value {} - - - - - Option to suppress the extra spaces in the output json - - - - - Option to exclude null/empty properties from the log event (as JSON) - - - - - List of property names to exclude when is true - - - - - Option to include all properties from the log event (as JSON) - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the dictionary. - - - - - How far should the JSON serializer follow object references before backing off - - - - - - - - - - - - - - - - - Layout that will be rendered as the attribute's value. - - - - - Name of the attribute. - - - - - Determines whether or not this attribute will be Json encoded. - - - - - Should forward slashes be escaped? If true, / will be converted to \/ - - - - - Indicates whether to escape non-ascii characters - - - - - Whether an attribute with empty value should be included in the output - - - - - - - - - - - - - - Footer layout. - - - - - Header layout. - - - - - Body layout (can be repeated multiple times). - - - - - - - - - - - - - - - - - - - - - Option to include all properties from the log events - - - - - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the stack. - - - - - Indicates whether to include contents of the stack. - - - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - - - - - - - - - - Layout text. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - List of property names to exclude when is true - - - - - Option to include all properties from the log event (as XML) - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the dictionary. - - - - - How far should the XML serializer follow object references before backing off - - - - - XML element name to use for rendering IList-collections items - - - - - XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included - - - - - XML element name to use when rendering properties - - - - - XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value - - - - - Name of the root XML element - - - - - Value inside the root XML element - - - - - Whether a ElementValue with empty value should be included in the output - - - - - Auto indent and create new lines - - - - - Determines whether or not this attribute will be Xml encoded. - - - - - - - - - - - - - - - Layout that will be rendered as the attribute's value. - - - - - Name of the attribute. - - - - - Determines whether or not this attribute will be Xml encoded. - - - - - Whether an attribute with empty value should be included in the output - - - - - - - - - - - - - - - - - - - - - - - - - Determines whether or not this attribute will be Xml encoded. - - - - - Name of the element - - - - - Value inside the element - - - - - Whether a ElementValue with empty value should be included in the output - - - - - Auto indent and create new lines - - - - - List of property names to exclude when is true - - - - - Option to include all properties from the log event (as XML) - - - - - Indicates whether to include contents of the dictionary. - - - - - Indicates whether to include contents of the dictionary. - - - - - How far should the XML serializer follow object references before backing off - - - - - XML element name to use for rendering IList-collections items - - - - - XML attribute name to use when rendering property-key When null (or empty) then key-attribute is not included - - - - - XML element name to use when rendering properties - - - - - XML attribute name to use when rendering property-value When null (or empty) then value-attribute is not included and value is formatted as XML-element-value - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - Condition expression. - - - - - - - - - - - - - - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - Substring to be matched. - - - - - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - String to compare the layout to. - - - - - Indicates whether to ignore case when comparing strings. - - - - - Layout to be used to filter log messages. - - - - - - - - - - - - - - - - - - - - - - - - Action to be taken when filter matches. - - - - - Default number of unique filter values to expect, will automatically increase if needed - - - - - Applies the configured action to the initial logevent that starts the timeout period. Used to configure that it should ignore all events until timeout. - - - - - Layout to be used to filter log messages. - - - - - Max number of unique filter values to expect simultaneously - - - - - Max length of filter values, will truncate if above limit - - - - - How long before a filter expires, and logging is accepted again - - - - - Default buffer size for the internal buffers - - - - - Reuse internal buffers, and doesn't have to constantly allocate new buffers - - - - - Append FilterCount to the when an event is no longer filtered - - - - - Insert FilterCount value into when an event is no longer filtered - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/IOB-MAN/packages.config b/IOB-MAN/packages.config index fc4b5a6f..431a5c96 100644 --- a/IOB-MAN/packages.config +++ b/IOB-MAN/packages.config @@ -1,16 +1,14 @@  - + - - - - + + From debc16e42ee08f1e9f627103d918858de005c313 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 09:06:02 +0200 Subject: [PATCH 28/38] Ancora upgrade IOB-MAN --- IOB-MAN/App.config | 6 +++- IOB-MAN/IOB-MAN.csproj | 70 ++++++++++++++++++++++++----------------- IOB-MAN/packages.config | 27 +++++++++------- 3 files changed, 62 insertions(+), 41 deletions(-) diff --git a/IOB-MAN/App.config b/IOB-MAN/App.config index 6d151e04..23dbccd3 100644 --- a/IOB-MAN/App.config +++ b/IOB-MAN/App.config @@ -63,7 +63,7 @@ - + @@ -103,6 +103,10 @@ + + + + diff --git a/IOB-MAN/IOB-MAN.csproj b/IOB-MAN/IOB-MAN.csproj index cf0737db..73aa1385 100644 --- a/IOB-MAN/IOB-MAN.csproj +++ b/IOB-MAN/IOB-MAN.csproj @@ -38,8 +38,14 @@ IobManIcon.ico - - ..\packages\DnsClient.1.6.0\lib\net45\DnsClient.dll + + ..\packages\AWSSDK.Core.3.7.100.14\lib\net45\AWSSDK.Core.dll + + + ..\packages\AWSSDK.SecurityToken.3.7.100.14\lib\net45\AWSSDK.SecurityToken.dll + + + ..\packages\DnsClient.1.6.1\lib\net45\DnsClient.dll ..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll @@ -51,17 +57,20 @@ ..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - ..\packages\MongoDB.Bson.2.15.0\lib\netstandard2.0\MongoDB.Bson.dll + + ..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.4\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll - - ..\packages\MongoDB.Driver.2.15.0\lib\netstandard2.0\MongoDB.Driver.dll + + ..\packages\MongoDB.Bson.2.21.0\lib\netstandard2.0\MongoDB.Bson.dll - - ..\packages\MongoDB.Driver.Core.2.15.0\lib\netstandard2.0\MongoDB.Driver.Core.dll + + ..\packages\MongoDB.Driver.2.21.0\lib\netstandard2.0\MongoDB.Driver.dll - - ..\packages\MongoDB.Libmongocrypt.1.3.0\lib\netstandard2.0\MongoDB.Libmongocrypt.dll + + ..\packages\MongoDB.Driver.Core.2.21.0\lib\netstandard2.0\MongoDB.Driver.Core.dll + + + ..\packages\MongoDB.Libmongocrypt.1.8.0\lib\netstandard2.0\MongoDB.Libmongocrypt.dll ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -70,7 +79,7 @@ ..\packages\NLog.5.2.3\lib\net46\NLog.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll ..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll @@ -81,17 +90,20 @@ ..\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll + + ..\packages\Snappier.1.0.0\lib\netstandard2.0\Snappier.dll + - ..\packages\StackExchange.Redis.2.5.61\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.6.122\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.IO.5.2.2205.1719\lib\net462\SteamWare.IO.dll + + ..\packages\SteamWare.IO.5.2.2206.1310\lib\net462\SteamWare.IO.dll - - ..\packages\SteamWare.Logger.5.2.2205.1719\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.2.2206.1310\lib\net462\SteamWare.Logger.dll - - ..\packages\SteamWare.Scheduler.5.2.2205.1719\lib\net462\SteamWare.Scheduler.dll + + ..\packages\SteamWare.Scheduler.5.2.2206.1310\lib\net462\SteamWare.Scheduler.dll @@ -111,8 +123,8 @@ ..\packages\System.IO.Pipelines.6.0.2\lib\net461\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll @@ -176,6 +188,9 @@ + + ..\packages\ZstdSharp.Port.0.6.2\lib\net461\ZstdSharp.dll + @@ -230,10 +245,6 @@ - - - - Always @@ -264,6 +275,9 @@ + + + @@ -271,13 +285,11 @@ - + - Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + - \ No newline at end of file diff --git a/IOB-MAN/packages.config b/IOB-MAN/packages.config index 431a5c96..a8424f5c 100644 --- a/IOB-MAN/packages.config +++ b/IOB-MAN/packages.config @@ -1,29 +1,33 @@  - + + + - - - - + + + + + - + - - - - + + + + + - + @@ -36,4 +40,5 @@ + \ No newline at end of file From 293dc103f82583f35acac59914744194af249a86 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 09:25:04 +0200 Subject: [PATCH 29/38] Autogenerate binding redirect x icoel proxy --- EgwProxy.Icoel.DataLayer/App.config | 26 ------------------- .../EgwProxy.Icoel.DataLayer.csproj | 3 +++ EgwProxy.Icoel.Test/App.config | 26 ------------------- EgwProxy.Icoel/App.config | 26 ------------------- 4 files changed, 3 insertions(+), 78 deletions(-) diff --git a/EgwProxy.Icoel.DataLayer/App.config b/EgwProxy.Icoel.DataLayer/App.config index cd37fb59..46b80daf 100644 --- a/EgwProxy.Icoel.DataLayer/App.config +++ b/EgwProxy.Icoel.DataLayer/App.config @@ -16,31 +16,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj index 709043fa..90117ab0 100644 --- a/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj +++ b/EgwProxy.Icoel.DataLayer/EgwProxy.Icoel.DataLayer.csproj @@ -34,6 +34,9 @@ prompt 4 + + true + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll diff --git a/EgwProxy.Icoel.Test/App.config b/EgwProxy.Icoel.Test/App.config index 3acc1c60..504f8ea2 100644 --- a/EgwProxy.Icoel.Test/App.config +++ b/EgwProxy.Icoel.Test/App.config @@ -47,31 +47,5 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/EgwProxy.Icoel/App.config b/EgwProxy.Icoel/App.config index dbfff9ff..e6508929 100644 --- a/EgwProxy.Icoel/App.config +++ b/EgwProxy.Icoel/App.config @@ -33,31 +33,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 31c48f50e55ab369cebaadc5333e84e5a94cef98 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 09:51:26 +0200 Subject: [PATCH 30/38] Update slowCheetach + rimozione prettyBin x test (OK compila) --- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 3 ++ IOB-WIN-NEXT/App.config | 2 +- IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 17 ++++++------ IOB-WIN-NEXT/MainForm.cs | 29 ++++++++++++-------- IOB-WIN-NEXT/Program.cs | 7 +---- IOB-WIN-NEXT/Properties/Settings.Designer.cs | 2 +- IOB-WIN-NEXT/packages.config | 3 +- 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index ed214e40..9f585c85 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -74,6 +74,9 @@ prompt MinimumRecommendedRules.ruleset + + true + ..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index d1cb673f..27335470 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -196,4 +196,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 3710b247..9b7f1961 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -776,12 +776,6 @@ true - - - {90512e12-29fc-460d-94cc-648c2a072dbd} - IOB-UT-NEXT - - @@ -807,6 +801,12 @@ + + + {90512e12-29fc-460d-94cc-648c2a072dbd} + IOB-UT-NEXT + + "$(ProjectDir)setupTgt.bat" "$(ConfigurationName)" "$(ProjectDir)" @@ -815,7 +815,6 @@ - "$(ProjectDir)postBuildTgt.bat" "$(ConfigurationName)" "$(TargetDir)" @@ -826,7 +825,6 @@ - @@ -834,13 +832,14 @@ + - + \ No newline at end of file diff --git a/IOB-WIN-NEXT/MainForm.cs b/IOB-WIN-NEXT/MainForm.cs index 6e867f05..aec6ac27 100644 --- a/IOB-WIN-NEXT/MainForm.cs +++ b/IOB-WIN-NEXT/MainForm.cs @@ -47,22 +47,29 @@ namespace IOB_WIN_NEXT // salvo aprametri avvio... saveArgs(args); // continuo iNIT!!! - InitializeComponent(); - myInit(); - if (args != null) + try { - if (args.Length > 0) + InitializeComponent(); + myInit(); + if (args != null) { - lgInfo("Argomenti di avvio:"); - foreach (var item in myArgs) + if (args.Length > 0) { - lgInfo(item); + lgInfo("Argomenti di avvio:"); + foreach (var item in myArgs) + { + lgInfo(item); + } + } + else + { + lgInfo("NESSUN Argomento di avvio trovato"); } } - else - { - lgInfo("NESSUN Argomento di avvio trovato"); - } + } + catch(Exception exc) + { + lgError($"Errore in avvio MainForm:{Environment.NewLine}{exc}"); } } diff --git a/IOB-WIN-NEXT/Program.cs b/IOB-WIN-NEXT/Program.cs index 562de392..621d64c5 100644 --- a/IOB-WIN-NEXT/Program.cs +++ b/IOB-WIN-NEXT/Program.cs @@ -16,12 +16,7 @@ namespace IOB_WIN_NEXT { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - try - { - Application.Run(new MainForm(args)); - } - catch - { } + Application.Run(new MainForm(args)); } #endregion Private Methods diff --git a/IOB-WIN-NEXT/Properties/Settings.Designer.cs b/IOB-WIN-NEXT/Properties/Settings.Designer.cs index 9e4e3008..6e913356 100644 --- a/IOB-WIN-NEXT/Properties/Settings.Designer.cs +++ b/IOB-WIN-NEXT/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace IOB_WIN_NEXT.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index fdb8e768..86b29638 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -16,7 +16,7 @@ - + @@ -27,7 +27,6 @@ - From cb6c8564f136cc0eb2a20a81993b9abb5ac80224 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 10:56:46 +0200 Subject: [PATCH 31/38] Cleanup Soluzione con Fody.Weavers --- IOB-WIN-NEXT/App.config | 20 +++++ IOB-WIN-NEXT/FodyWeavers.xml | 3 + IOB-WIN-NEXT/FodyWeavers.xsd | 141 +++++++++++++++++++++++++++++++ IOB-WIN-NEXT/IOB-WIN-NEXT.csproj | 126 ++++++++++++++++++++++++++- IOB-WIN-NEXT/packages.config | 48 +++++++++++ 5 files changed, 336 insertions(+), 2 deletions(-) create mode 100644 IOB-WIN-NEXT/FodyWeavers.xml create mode 100644 IOB-WIN-NEXT/FodyWeavers.xsd diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 27335470..2b122620 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -155,6 +155,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/IOB-WIN-NEXT/FodyWeavers.xml b/IOB-WIN-NEXT/FodyWeavers.xml new file mode 100644 index 00000000..5029e706 --- /dev/null +++ b/IOB-WIN-NEXT/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/IOB-WIN-NEXT/FodyWeavers.xsd b/IOB-WIN-NEXT/FodyWeavers.xsd new file mode 100644 index 00000000..05e92c11 --- /dev/null +++ b/IOB-WIN-NEXT/FodyWeavers.xsd @@ -0,0 +1,141 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj index 9b7f1961..b5ba74d0 100644 --- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj +++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj @@ -1,5 +1,6 @@  + @@ -103,6 +104,9 @@ ..\EgwProxy.MultiCncLib\ExtLib\CndexLinkDotNet.dll + + ..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll + ..\packages\EasyModbusTCP.5.6.0\lib\net40\EasyModbus.dll @@ -167,6 +171,11 @@ ..\packages\Microsoft.Web.WebView2.1.0.1938.49\lib\net45\Microsoft.Web.WebView2.Wpf.dll + + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + ..\packages\MTConnect.NET.2.9.1.28314\lib\net40\MTConnect-NET.dll @@ -200,34 +209,137 @@ ..\packages\S7netplus.0.1.9\lib\net45\S7.Net.dll + + ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll + True + True + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + True + True + + + ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + ..\packages\System.Drawing.Common.7.0.0\lib\net462\System.Drawing.Common.dll ..\packages\System.Formats.Asn1.6.0.0\lib\net461\System.Formats.Asn1.dll + + ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + - + + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True + + + + ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + True + True + + + ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - + + ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + True + True + + + ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll + True + True + + + ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll + True + True + + + ..\packages\System.Runtime.InteropServices.4.3.0\lib\net462\System.Runtime.InteropServices.dll + True + True + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + @@ -244,6 +356,11 @@ + + ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + True + True + ..\ExtLibs\AdsApi\.NET\v4.0.30319\TwinCAT.Ads.dll @@ -833,6 +950,9 @@ + + + @@ -842,4 +962,6 @@ + + \ No newline at end of file diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config index 86b29638..14f4d644 100644 --- a/IOB-WIN-NEXT/packages.config +++ b/IOB-WIN-NEXT/packages.config @@ -1,6 +1,7 @@  + @@ -9,6 +10,7 @@ + @@ -16,9 +18,12 @@ + + + @@ -33,11 +38,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From cb4d158cf2fac11f84ae00b8410c5f7f5561425b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 7 Sep 2023 11:01:09 +0200 Subject: [PATCH 32/38] Fix rimozione XML da release --- IOB-WIN-NEXT/postBuildTgt.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IOB-WIN-NEXT/postBuildTgt.bat b/IOB-WIN-NEXT/postBuildTgt.bat index 740d4abd..39e366e6 100644 --- a/IOB-WIN-NEXT/postBuildTgt.bat +++ b/IOB-WIN-NEXT/postBuildTgt.bat @@ -39,8 +39,9 @@ if %1 == "Remote_DEBUG" goto RemoteDebug :Release REM INIZIO eliminando i files pdb del /S %2"*.pdb"" +del /S %2"*.xml"" del /S %2"lib/*.pdb"" -echo Release: eliminato pdb!!! +echo Release: eliminato pdb + xml!!! goto END :Debug From e89e743ec21f6d21e3d3da6f4e26bfbf9c7d0960 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 8 Sep 2023 11:47:12 +0200 Subject: [PATCH 33/38] Update MTConnect x problema disconnesisone in avvio --- IOB-WIN-NEXT/Iob/MTConnect.cs | 66 ++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/MTConnect.cs b/IOB-WIN-NEXT/Iob/MTConnect.cs index 0eea2ae6..2f8413e0 100644 --- a/IOB-WIN-NEXT/Iob/MTConnect.cs +++ b/IOB-WIN-NEXT/Iob/MTConnect.cs @@ -125,7 +125,9 @@ namespace IOB_WIN_NEXT.Iob /// public override void readSemafori(ref newDisplayData currDispData) { - base.readSemafori(ref currDispData); +#if false + base.readSemafori(ref currDispData); +#endif try { if (verboseLog) @@ -242,24 +244,34 @@ namespace IOB_WIN_NEXT.Iob /// public override void tryDisconnect() { - if (connectionOk) + // verifico che NON sia in fase di avvio MTC... + if (isConnecting && DateTime.Now.Subtract(startConnecting).TotalSeconds<60) { - string szStatusConnection = ""; - try - { - MTC_ref.Stop(); - connectionOk = false; - lgInfo(szStatusConnection); - lgInfo("Effettuata disconnessione adapter MTC!"); - } - catch (Exception exc) - { - lgFatal(exc, "Errore nella disconnessione dall'adapter MTC"); - } + lgInfo("Disconnessione non effettuata: connessione ancora in corso"); } else { - lgError("IMPOSSIBILE effettuare disconnessione MTC: Connessione non disponibile..."); + lgTrace("Richiesta tryDisconnect"); + if (connectionOk) + { + string szStatusConnection = ""; + try + { + MTC_ref.Stop(); + connectionOk = false; + isConnecting = false; + lgInfo($"conn status: {szStatusConnection}"); + lgInfo("Effettuata disconnessione adapter MTC!"); + } + catch (Exception exc) + { + lgFatal(exc, "Errore nella disconnessione dall'adapter MTC"); + } + } + else + { + lgError("IMPOSSIBILE effettuare disconnessione MTC: Connessione non disponibile..."); + } } } @@ -574,16 +586,16 @@ namespace IOB_WIN_NEXT.Iob { if (document != null) { - lgInfo($"DiscoverySuccessful: discovery per {document.Url}"); + lgInfo($"CurrentSuccessful: discovery per {document.Url}"); if (document.DeviceStreams != null) { - lgInfo($"DiscoverySuccessful: trovati {document.DeviceStreams.Count} streams"); + lgInfo($"CurrentSuccessful: trovati {document.DeviceStreams.Count} streams"); } checkAndSend(document, true); } else { - lgError("StreamsSuccessful ERROR: document è null"); + lgError("CurrentSuccessful ERROR: document è null"); } } @@ -641,15 +653,15 @@ namespace IOB_WIN_NEXT.Iob // invio IN BLOCCO il dataItem serializzati... if (elencoDataItems.Count > 0) { - lgInfo($"STEP 04 invio dati di {elencoDataItems.Count} records"); + lgInfo($"STEP 03 invio dati di {elencoDataItems.Count} records"); sendDataItemsList(elencoDataItems); } hasReadItems = true; - lgInfo($"STEP 05: memorizzati {dataItemMem.Count} oggetti in memoria"); + lgInfo($"STEP 04: memorizzati {dataItemMem.Count} oggetti in memoria"); } else { - lgError("STEP 06 error: document null!"); + lgError("STEP 05 error: document null!"); } } @@ -751,6 +763,7 @@ namespace IOB_WIN_NEXT.Iob /// protected void StreamsSuccessful(MTConnectStreams.Document document) { + lgTrace("STEP 01 StreamsSuccessful reached!"); checkAndSend(document, false); } @@ -923,13 +936,13 @@ namespace IOB_WIN_NEXT.Iob // Controllo booleano PING e POWERON... string currPowerOn = getDataItemValue(mtcParams.condPowerOn.keyName); // se valido il check ping lo eseguo... altrimenti lo do x buono - bool isPingOk = (testPingMachine == IPStatus.Success); + bool isPingOk = mtcParams.pingAsPowerOn && (testPingMachine == IPStatus.Success); // verifico da target value richiesto... bool checkPowerOn = (currPowerOn == mtcParams.condPowerOn.targetValue); // bit 0 (poweron) imposto a 1 SE pingo o PowerOn=="ON"... - B_input = ((isPingOk && mtcParams.pingAsPowerOn) || checkPowerOn) ? 1 : 0; + B_input = (isPingOk || checkPowerOn) ? 1 : 0; // variabili RUN... string currRun = getDataItemValue(mtcParams.keyRunMode); @@ -1024,6 +1037,8 @@ namespace IOB_WIN_NEXT.Iob lgInfo($"Trasformazione B_input: {B_input} | currRun = {currRun}"); } } + protected bool isConnecting { get; set; } = false; + protected DateTime startConnecting { get; set; } = DateTime.Today; /// /// Vera connessione ad MTC @@ -1031,6 +1046,8 @@ namespace IOB_WIN_NEXT.Iob /// private short doConnect() { + isConnecting = true; + startConnecting = DateTime.Now; short esitoLink = 0; // reset memoria dataItem.. dataItemMem = new Dictionary(); @@ -1079,6 +1096,7 @@ namespace IOB_WIN_NEXT.Iob } catch { } + isConnecting = false; return esitoLink; } @@ -1232,7 +1250,7 @@ namespace IOB_WIN_NEXT.Iob try { mtcParams = JsonConvert.DeserializeObject(jsonData); - lgInfo($"Decodifica aree MtcParamConf: trovati {mtcParams.paramsEndThresh.Count} valori paramsEndThresh"); + lgInfo($"Decodifica aree MtcParamConf | condPowerOn: {mtcParams.condPowerOn.keyName}={mtcParams.condPowerOn.targetValue} | condWork: {mtcParams.condWork.Count} | keyPartCount: {mtcParams.keyPartCount} | itemTranslation: {mtcParams.itemTranslation.Count} | fluxLogVeto: {mtcParams.fluxLogVeto.Count} | paramsEndThresh: {mtcParams.paramsEndThresh.Count} "); } catch (Exception exc) { From 83e971f1e9f3d982188ce133fa03c856c1798366 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 8 Sep 2023 15:22:38 +0200 Subject: [PATCH 34/38] Aggiunto veto accodamento QUEUE-IN: - default 1 sec - configurabile in OPCPAR come VETO_QUEUE_IN=15 - indica num secondi x cui NON accoda info IN per l'invio --- IOB-UT-NEXT/baseUtils.cs | 5 +++ IOB-WIN-NEXT/DATA/CONF/PING.ini | 1 + IOB-WIN-NEXT/Iob/Generic.cs | 47 +++++++++++++++++++++++--- IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs | 22 ++++++++---- IOB-WIN-NEXT/IobSql/SqlServPama.cs | 22 ++++++++---- 5 files changed, 79 insertions(+), 18 deletions(-) diff --git a/IOB-UT-NEXT/baseUtils.cs b/IOB-UT-NEXT/baseUtils.cs index c1bab73f..9ad2a84e 100644 --- a/IOB-UT-NEXT/baseUtils.cs +++ b/IOB-UT-NEXT/baseUtils.cs @@ -22,6 +22,11 @@ namespace IOB_UT_NEXT /// public static DateTime dtVetoPing = DateTime.Now; + /// + /// Indicazione VETO accodamento INGRESSI/EVENTI sino alla data-ora indicata + /// + public static DateTime dtVetoQueueIN = DateTime.Now; + /// /// Indicazione VETO invio a server sino alla data-ora indicata /// diff --git a/IOB-WIN-NEXT/DATA/CONF/PING.ini b/IOB-WIN-NEXT/DATA/CONF/PING.ini index de8135e3..dcf81672 100644 --- a/IOB-WIN-NEXT/DATA/CONF/PING.ini +++ b/IOB-WIN-NEXT/DATA/CONF/PING.ini @@ -34,6 +34,7 @@ MAX_COUNTER_BLINK = 15 BLINK_FILT=0 [OPTPAR] +VETO_QUEUE_IN=15 AUTO_CHANGE_ODL=false POWEROFF_TIMEOUT_SEC=60 diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index d39ae9b1..fc6a3527 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -337,6 +337,8 @@ namespace IOB_WIN_NEXT.Iob // checkLogDir x shrink! checkShrinkDir(); + // imposto veto invio per i prossimi sec + dtVetoQueueIN = DateTime.Now.AddSeconds(vetoQueueIn); // concluso! lgInfoStartup("Istanziata classe preliminare IOBGeneric"); } @@ -396,6 +398,21 @@ namespace IOB_WIN_NEXT.Iob } } + /// + /// Indicazione VETO accodamento valori INGRESSI/EVENTI sino alla data-ora indicata + /// + public static DateTime dtVetoQueueIN + { + get + { + return utils.dtVetoQueueIN; + } + set + { + utils.dtVetoQueueIN = value; + } + } + /// /// Indicazione VETO invio a server sino alla data-ora indicata /// @@ -1696,6 +1713,7 @@ namespace IOB_WIN_NEXT.Iob /// public void accodaSigIN(ref newDisplayData currDispData) { + DateTime adesso = DateTime.Now; // mostro dati variati letti... displayInData(ref currDispData); // verifico veto a invio status macchina @@ -1706,10 +1724,18 @@ namespace IOB_WIN_NEXT.Iob } else { - // --> accodo (valore già formattato)! - QueueIN.Enqueue(qEncodeIN); - // loggo! - lgDebug($"[QUEUE-IN] {qEncodeIN}"); + // verifico non sia in veto invio iniziale... + if (dtVetoQueueIN >= adesso) + { + lgDebug($"[VETO FOR QUEUE-IN] | {qEncodeIN} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + } + else + { + // --> accodo (valore già formattato)! + QueueIN.Enqueue(qEncodeIN); + // loggo! + lgDebug($"[QUEUE-IN] {qEncodeIN}"); + } } // aggiorno counters ed eventuale reset nReadFilt++; @@ -2102,6 +2128,8 @@ namespace IOB_WIN_NEXT.Iob return valTransl; } + + /// /// effettua recupero dati ed invio valori modificati... /// @@ -4360,6 +4388,11 @@ namespace IOB_WIN_NEXT.Iob /// protected int[] i_counters; + /// + /// Durata in secondi del divieto accodamento segnali IN alla fase di startup + /// + protected int vetoQueueIn = 1; + /// /// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...) /// @@ -8143,6 +8176,12 @@ namespace IOB_WIN_NEXT.Iob lastPeriodicLog = DateTime.Now; // fix parametri generali... enablePrgName = true; + // valore standard divieto accodamento segnali IN + string VETO_QUEUE_IN = getOptPar("VETO_QUEUE_IN"); + if (!string.IsNullOrEmpty(VETO_QUEUE_IN)) + { + int.TryParse(VETO_QUEUE_IN, out vetoQueueIn); + } } private void svuotaCodaContapezzi() diff --git a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs index bfa3b5f0..4f617e33 100644 --- a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs +++ b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs @@ -528,14 +528,22 @@ namespace IOB_WIN_NEXT.IobFile int valInt = decodeSoitaabLog(sLog2send.valString); string currVal = getEncodSigLog(sLog2send.dtRif, valInt, counterSigIN); - // --> accodo (valore già formattato)! - QueueIN.Enqueue(currVal); - // loggo! - lgTrace(string.Format("[QUEUE-IN] {0}", currVal)); - counterSigIN++; - if (counterSigIN > 9999) + // verifico non sia in veto invio iniziale... + if (dtVetoQueueIN >= adesso) { - counterSigIN = 0; + lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + } + else + { + // --> accodo (valore già formattato)! + QueueIN.Enqueue(currVal); + // loggo! + lgTrace(string.Format("[QUEUE-IN] {0}", currVal)); + counterSigIN++; + if (counterSigIN > 9999) + { + counterSigIN = 0; + } } } diff --git a/IOB-WIN-NEXT/IobSql/SqlServPama.cs b/IOB-WIN-NEXT/IobSql/SqlServPama.cs index fbd754a3..a0427b47 100644 --- a/IOB-WIN-NEXT/IobSql/SqlServPama.cs +++ b/IOB-WIN-NEXT/IobSql/SqlServPama.cs @@ -639,14 +639,22 @@ namespace IOB_WIN_NEXT.IobSql foreach (var sLog2send in data2send) { string currVal = getEncodSigLog(sLog2send.DtEve, sLog2send.ValInt, counterSigIN); - // --> accodo (valore già formattato)! - QueueIN.Enqueue(currVal); - // loggo! - lgTrace(string.Format("[QUEUE-IN] {0}", currVal)); - counterSigIN++; - if (counterSigIN > 9999) + // verifico non sia in veto invio iniziale... + if (dtVetoQueueIN >= adesso) { - counterSigIN = 0; + lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + } + else + { + // --> accodo (valore già formattato)! + QueueIN.Enqueue(currVal); + // loggo! + lgTrace(string.Format("[QUEUE-IN] {0}", currVal)); + counterSigIN++; + if (counterSigIN > 9999) + { + counterSigIN = 0; + } } } } From 5aa35b741d79d71b2c47c586bfd9a0637e98cfae Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 8 Sep 2023 16:25:18 +0200 Subject: [PATCH 35/38] cambio logica veto x MTConnect x lettura semafori --- IOB-WIN-NEXT/Iob/Generic.cs | 1 + IOB-WIN-NEXT/Iob/MTConnect.cs | 40 ++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index fc6a3527..8f949a0c 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -339,6 +339,7 @@ namespace IOB_WIN_NEXT.Iob // imposto veto invio per i prossimi sec dtVetoQueueIN = DateTime.Now.AddSeconds(vetoQueueIn); + lgInfoStartup($"Impostato veto QUEUE-IN a {vetoQueueIn}s | fino alle {dtVetoQueueIN:yyyy.MM.dd HH:mm:ss}"); // concluso! lgInfoStartup("Istanziata classe preliminare IOBGeneric"); } diff --git a/IOB-WIN-NEXT/Iob/MTConnect.cs b/IOB-WIN-NEXT/Iob/MTConnect.cs index 2f8413e0..e7cb1340 100644 --- a/IOB-WIN-NEXT/Iob/MTConnect.cs +++ b/IOB-WIN-NEXT/Iob/MTConnect.cs @@ -125,26 +125,32 @@ namespace IOB_WIN_NEXT.Iob /// public override void readSemafori(ref newDisplayData currDispData) { -#if false - base.readSemafori(ref currDispData); -#endif - try + DateTime adesso = DateTime.Now; + // verifico non sia in veto invio iniziale... + if (dtVetoQueueIN >= adesso) { - if (verboseLog) - { - lgInfo("inizio read semafori"); - } - - currDispData.semIn = Semaforo.SV; - - // decodifica e gestione - decodeToBaseBitmap(); - reportRawInput(ref currDispData); + lgDebug($"[VETO readSemafori] | veto attivo sino alle {adesso:yyyy.MM.dd HH:mm:ss}"); } - catch (Exception exc) + else { - currDispData.semIn = Semaforo.SR; - lgError($"Eccezione in readSemafori:{Environment.NewLine}{exc}"); + try + { + if (verboseLog) + { + lgInfo("inizio read semafori"); + } + + currDispData.semIn = Semaforo.SV; + + // decodifica e gestione + decodeToBaseBitmap(); + reportRawInput(ref currDispData); + } + catch (Exception exc) + { + currDispData.semIn = Semaforo.SR; + lgError($"Eccezione in readSemafori:{Environment.NewLine}{exc}"); + } } } From 002ee09ccd0500fe8c19cfb5570f2721b2953384 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 8 Sep 2023 17:34:25 +0200 Subject: [PATCH 36/38] update last read PLC x MTC --- IOB-WIN-NEXT/Iob/MTConnect.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IOB-WIN-NEXT/Iob/MTConnect.cs b/IOB-WIN-NEXT/Iob/MTConnect.cs index e7cb1340..6eb6f29f 100644 --- a/IOB-WIN-NEXT/Iob/MTConnect.cs +++ b/IOB-WIN-NEXT/Iob/MTConnect.cs @@ -126,6 +126,7 @@ namespace IOB_WIN_NEXT.Iob public override void readSemafori(ref newDisplayData currDispData) { DateTime adesso = DateTime.Now; + lastReadPLC = adesso; // verifico non sia in veto invio iniziale... if (dtVetoQueueIN >= adesso) { @@ -500,7 +501,9 @@ namespace IOB_WIN_NEXT.Iob double newVal = 0; if (newValue != null) { - lgTrace($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}"); +#if false + lgTrace($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}"); +#endif // verifico in memoria se ho l'oggetto condition ed il suo valore.. if (dataItemMem.ContainsKey(newValue.DataItemId)) { From 9d36511fa5d0127f730761673bcef02b77c628f2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 8 Sep 2023 18:45:45 +0200 Subject: [PATCH 37/38] =?UTF-8?q?Fix=20modalit=C3=A0=20abilitazione=20coda?= =?UTF-8?q?=20con=20bool=20in=20tutti=20gli=20IOB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IOB-WIN-NEXT/Iob/Fanuc.cs | 2 + IOB-WIN-NEXT/Iob/Generic.cs | 87 +++++++++++++++++--------- IOB-WIN-NEXT/Iob/Kawasaki.cs | 2 + IOB-WIN-NEXT/Iob/MTConnect.cs | 27 ++++---- IOB-WIN-NEXT/Iob/OSAI.cs | 2 + IOB-WIN-NEXT/Iob/Omron.cs | 2 + IOB-WIN-NEXT/IobBeckhoff/Beckhoff.cs | 2 + IOB-WIN-NEXT/IobFile/FileEurom63.cs | 2 + IOB-WIN-NEXT/IobFile/FileGen.cs | 2 + IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs | 13 ++-- IOB-WIN-NEXT/IobModbusTCP/ModbusTCP.cs | 2 + IOB-WIN-NEXT/IobNet/IcoelSoap.cs | 2 + IOB-WIN-NEXT/IobNet/Ping.cs | 2 + IOB-WIN-NEXT/IobNet/WebPageScrap.cs | 2 + IOB-WIN-NEXT/IobOpc/OpcUa.cs | 5 +- IOB-WIN-NEXT/IobSiemens/Siemens.cs | 2 + IOB-WIN-NEXT/IobSql/IcoelDb.cs | 2 + IOB-WIN-NEXT/IobSql/SqlServLantek.cs | 2 + IOB-WIN-NEXT/IobSql/SqlServPama.cs | 13 ++-- 19 files changed, 119 insertions(+), 54 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/Fanuc.cs b/IOB-WIN-NEXT/Iob/Fanuc.cs index c2853ec5..24b85354 100644 --- a/IOB-WIN-NEXT/Iob/Fanuc.cs +++ b/IOB-WIN-NEXT/Iob/Fanuc.cs @@ -933,6 +933,7 @@ namespace IOB_WIN_NEXT.Iob // refresh stato allarmi!!! if (connectionOk) { + queueInEnabCurr = true; dtAvvioAdp = DateTime.Now; if (adpRunning) { @@ -996,6 +997,7 @@ namespace IOB_WIN_NEXT.Iob { lgError("IMPOSSIBILE effettuare disconnessione: Connessione non disponibile..."); } + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 8f949a0c..51849c36 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -414,6 +414,15 @@ namespace IOB_WIN_NEXT.Iob } } + protected bool queueInEnabCurr { get; set; } = false; + /// + /// Verifica veto coda QueueIN ed aggiorna abilitazione su variabile + /// + protected void checkVetoQueueIn() + { + queueInEnabCurr = dtVetoQueueIN < DateTime.Now; + } + /// /// Indicazione VETO invio a server sino alla data-ora indicata /// @@ -1726,29 +1735,30 @@ namespace IOB_WIN_NEXT.Iob else { // verifico non sia in veto invio iniziale... - if (dtVetoQueueIN >= adesso) - { - lgDebug($"[VETO FOR QUEUE-IN] | {qEncodeIN} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); - } - else + if (queueInEnabCurr) { // --> accodo (valore già formattato)! QueueIN.Enqueue(qEncodeIN); // loggo! lgDebug($"[QUEUE-IN] {qEncodeIN}"); } - } - // aggiorno counters ed eventuale reset - nReadFilt++; - if (nReadFilt > int.MaxValue - 1) - { - nReadFilt = 0; // per evitare buffer overflow... - } + else + { + lgDebug($"[VETO FOR QUEUE-IN] | {qEncodeIN} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + checkVetoQueueIn(); + } + // aggiorno counters ed eventuale reset + nReadFilt++; + if (nReadFilt > int.MaxValue - 1) + { + nReadFilt = 0; // per evitare buffer overflow... + } - counterSigIN++; - if (counterSigIN > 9999) - { - counterSigIN = 0; + counterSigIN++; + if (counterSigIN > 9999) + { + counterSigIN = 0; + } } } @@ -3107,7 +3117,7 @@ namespace IOB_WIN_NEXT.Iob // resetto tutti i valori BYTE IN/PREV/OUT... così invio macchina spenta... B_input = 0; B_output = 0; - B_previous = 0; + B_previous = -1; accodaSigIN(ref currDispData); // update controllo lastDisconnCheck = DateTime.Now; @@ -3874,6 +3884,10 @@ namespace IOB_WIN_NEXT.Iob // aggiungo altri defaults setDefaults(resetQueue); adpTryRestart = true; + // sistemo altri check avvio + queueInEnabCurr = false; + dtVetoQueueIN = DateTime.Now.AddSeconds(vetoQueueIn); + lgInfoStartup($"Impostato veto QUEUE-IN a {vetoQueueIn}s | fino alle {dtVetoQueueIN:yyyy.MM.dd HH:mm:ss}"); lgDebug("startAdapter completed"); } @@ -4069,6 +4083,7 @@ namespace IOB_WIN_NEXT.Iob public virtual void tryConnect() { dtAvvioAdp = DateTime.Now; + queueInEnabCurr = true; } /// @@ -4076,6 +4091,7 @@ namespace IOB_WIN_NEXT.Iob /// public virtual void tryDisconnect() { + queueInEnabCurr = false; } /// @@ -4322,7 +4338,7 @@ namespace IOB_WIN_NEXT.Iob /// /// Vettore 32 BIT valori precedenti /// - protected int B_previous; + protected int B_previous = -1; /// /// Num errori check alive @@ -7815,21 +7831,30 @@ namespace IOB_WIN_NEXT.Iob /// private void processAllMemory() { - // init obj display - newDisplayData currDispData = new newDisplayData(); - // in primis SALVO valori previous/precedenti - B_previous = B_output; - // poi faccio lettura NUOVI valori - readAllData(ref currDispData); - // eseguo il filtering dei valori (per i bit "blinking") - filterData(); - // effettuo confronto valori vecchi/nuovi... SE trovo variazione OPPURE se è passato + - // di un timeout di controllo... - if (B_output != B_previous) + //verifico se sia abilitato processing... + if (queueInEnabCurr) { - accodaSigIN(ref currDispData); + // init obj display + newDisplayData currDispData = new newDisplayData(); + // in primis SALVO valori previous/precedenti + B_previous = B_output; + // poi faccio lettura NUOVI valori + readAllData(ref currDispData); + // eseguo il filtering dei valori (per i bit "blinking") + filterData(); + // effettuo confronto valori vecchi/nuovi... SE trovo variazione OPPURE se è passato + + // di un timeout di controllo... + if (B_output != B_previous) + { + accodaSigIN(ref currDispData); + } + raiseRefresh(currDispData); + } + else + { + lgInfo($"VETO on processAllMemory: queueIn disabled"); + checkVetoQueueIn(); } - raiseRefresh(currDispData); } private void processMem2Write() diff --git a/IOB-WIN-NEXT/Iob/Kawasaki.cs b/IOB-WIN-NEXT/Iob/Kawasaki.cs index f5e94b75..b233dcf1 100644 --- a/IOB-WIN-NEXT/Iob/Kawasaki.cs +++ b/IOB-WIN-NEXT/Iob/Kawasaki.cs @@ -401,6 +401,7 @@ namespace IOB_WIN_NEXT.Iob // verifico se sta girando if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -462,6 +463,7 @@ namespace IOB_WIN_NEXT.Iob { lgError("IMPOSSIBILE effettuare disconnessione KAWASAKI: Connessione non disponibile..."); } + queueInEnabCurr = false; needRefresh = true; } diff --git a/IOB-WIN-NEXT/Iob/MTConnect.cs b/IOB-WIN-NEXT/Iob/MTConnect.cs index 6eb6f29f..f54c71cb 100644 --- a/IOB-WIN-NEXT/Iob/MTConnect.cs +++ b/IOB-WIN-NEXT/Iob/MTConnect.cs @@ -18,8 +18,7 @@ namespace IOB_WIN_NEXT.Iob #region Public Constructors /// - /// Estende l'init della classe base, impiegando il pacchetto Nuget TrackHound - /// https://github.com/TrakHound/MTConnect.NET + /// Estende l'init della classe base, impiegando il pacchetto Nuget TrackHound https://github.com/TrakHound/MTConnect.NET /// /// /// @@ -128,11 +127,7 @@ namespace IOB_WIN_NEXT.Iob DateTime adesso = DateTime.Now; lastReadPLC = adesso; // verifico non sia in veto invio iniziale... - if (dtVetoQueueIN >= adesso) - { - lgDebug($"[VETO readSemafori] | veto attivo sino alle {adesso:yyyy.MM.dd HH:mm:ss}"); - } - else + if (queueInEnabCurr) { try { @@ -153,6 +148,11 @@ namespace IOB_WIN_NEXT.Iob lgError($"Eccezione in readSemafori:{Environment.NewLine}{exc}"); } } + else + { + lgDebug($"[VETO readSemafori] | veto attivo sino alle {adesso:yyyy.MM.dd HH:mm:ss}"); + checkVetoQueueIn(); + } } /// @@ -206,6 +206,7 @@ namespace IOB_WIN_NEXT.Iob // refresh stato allarmi!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -252,7 +253,7 @@ namespace IOB_WIN_NEXT.Iob public override void tryDisconnect() { // verifico che NON sia in fase di avvio MTC... - if (isConnecting && DateTime.Now.Subtract(startConnecting).TotalSeconds<60) + if (isConnecting && DateTime.Now.Subtract(startConnecting).TotalSeconds < 60) { lgInfo("Disconnessione non effettuata: connessione ancora in corso"); } @@ -280,6 +281,8 @@ namespace IOB_WIN_NEXT.Iob lgError("IMPOSSIBILE effettuare disconnessione MTC: Connessione non disponibile..."); } } + queueInEnabCurr = false; + needRefresh = true; } #endregion Public Methods @@ -371,11 +374,15 @@ namespace IOB_WIN_NEXT.Iob } } + protected bool isConnecting { get; set; } = false; + /// /// Parametri specifici MTC /// protected MtcParamConf mtcParams { get; set; } + protected DateTime startConnecting { get; set; } = DateTime.Today; + /// /// URL x salvataggio elenco dataItems MTC /// @@ -502,7 +509,7 @@ namespace IOB_WIN_NEXT.Iob if (newValue != null) { #if false - lgTrace($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}"); + lgTrace($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}"); #endif // verifico in memoria se ho l'oggetto condition ed il suo valore.. if (dataItemMem.ContainsKey(newValue.DataItemId)) @@ -1046,8 +1053,6 @@ namespace IOB_WIN_NEXT.Iob lgInfo($"Trasformazione B_input: {B_input} | currRun = {currRun}"); } } - protected bool isConnecting { get; set; } = false; - protected DateTime startConnecting { get; set; } = DateTime.Today; /// /// Vera connessione ad MTC diff --git a/IOB-WIN-NEXT/Iob/OSAI.cs b/IOB-WIN-NEXT/Iob/OSAI.cs index 731f291a..10a3a18f 100644 --- a/IOB-WIN-NEXT/Iob/OSAI.cs +++ b/IOB-WIN-NEXT/Iob/OSAI.cs @@ -471,6 +471,7 @@ namespace IOB_WIN_NEXT.Iob if (connectionOk) { dtAvvioAdp = DateTime.Now; + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -536,6 +537,7 @@ namespace IOB_WIN_NEXT.Iob { lgError("IMPOSSIBILE effettuare disconnessione: Connessione non disponibile..."); } + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/Iob/Omron.cs b/IOB-WIN-NEXT/Iob/Omron.cs index 7f463ba3..5a823283 100644 --- a/IOB-WIN-NEXT/Iob/Omron.cs +++ b/IOB-WIN-NEXT/Iob/Omron.cs @@ -207,6 +207,7 @@ namespace IOB_WIN_NEXT.Iob // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -271,6 +272,7 @@ namespace IOB_WIN_NEXT.Iob { lgError("IMPOSSIBILE effettuare disconnessione OMRON: Connessione non disponibile..."); } + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobBeckhoff/Beckhoff.cs b/IOB-WIN-NEXT/IobBeckhoff/Beckhoff.cs index 56b3e36c..f76d6205 100644 --- a/IOB-WIN-NEXT/IobBeckhoff/Beckhoff.cs +++ b/IOB-WIN-NEXT/IobBeckhoff/Beckhoff.cs @@ -118,6 +118,7 @@ namespace IOB_WIN_NEXT.IobBeckhoff { setEventHandler(); readCurrVal(); + queueInEnabCurr = true; } lgInfo($"Connected: {connectionOk}"); } @@ -134,6 +135,7 @@ namespace IOB_WIN_NEXT.IobBeckhoff AdsCli.dispose(); } connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobFile/FileEurom63.cs b/IOB-WIN-NEXT/IobFile/FileEurom63.cs index ca28132e..ceb5c237 100644 --- a/IOB-WIN-NEXT/IobFile/FileEurom63.cs +++ b/IOB-WIN-NEXT/IobFile/FileEurom63.cs @@ -413,6 +413,7 @@ namespace IOB_WIN_NEXT.IobFile var nextLevel = Eurom63.ComLevel.IsConnected; var connectSession = confE63.ActiveSessions[0]; processSession(nextLevel, ref connectSession); + queueInEnabCurr = true; } /// @@ -421,6 +422,7 @@ namespace IOB_WIN_NEXT.IobFile public override void tryDisconnect() { connectionOk = false; + queueInEnabCurr = false; try { abortPrevJob(); diff --git a/IOB-WIN-NEXT/IobFile/FileGen.cs b/IOB-WIN-NEXT/IobFile/FileGen.cs index 1556a21a..7f1ccea7 100644 --- a/IOB-WIN-NEXT/IobFile/FileGen.cs +++ b/IOB-WIN-NEXT/IobFile/FileGen.cs @@ -199,6 +199,7 @@ namespace IOB_WIN_NEXT.IobFile connectionOk = Directory.Exists(BaseDir); if (connectionOk) { + queueInEnabCurr = true; #if false try { @@ -225,6 +226,7 @@ namespace IOB_WIN_NEXT.IobFile public override void tryDisconnect() { connectionOk = false; + queueInEnabCurr = false; try { #if false diff --git a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs index 4f617e33..e165f522 100644 --- a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs +++ b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs @@ -161,6 +161,7 @@ namespace IOB_WIN_NEXT.IobFile // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo($"Connessione OK alla folder {logDirPath}"); @@ -201,6 +202,7 @@ namespace IOB_WIN_NEXT.IobFile { // registro solo che è disconnesso connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods @@ -529,11 +531,7 @@ namespace IOB_WIN_NEXT.IobFile string currVal = getEncodSigLog(sLog2send.dtRif, valInt, counterSigIN); // verifico non sia in veto invio iniziale... - if (dtVetoQueueIN >= adesso) - { - lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); - } - else + if (queueInEnabCurr) { // --> accodo (valore già formattato)! QueueIN.Enqueue(currVal); @@ -545,6 +543,11 @@ namespace IOB_WIN_NEXT.IobFile counterSigIN = 0; } } + else + { + lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + checkVetoQueueIn(); + } } // salvo in last il valore di act... diff --git a/IOB-WIN-NEXT/IobModbusTCP/ModbusTCP.cs b/IOB-WIN-NEXT/IobModbusTCP/ModbusTCP.cs index d4ce44e0..3e955be1 100644 --- a/IOB-WIN-NEXT/IobModbusTCP/ModbusTCP.cs +++ b/IOB-WIN-NEXT/IobModbusTCP/ModbusTCP.cs @@ -523,6 +523,7 @@ namespace IOB_WIN_NEXT.IobModbusTCP // refresh stato allarmi!!! if (connectionOk) { + queueInEnabCurr = true; lgInfo($"Connessione OK: {connectionOk}"); if (adpRunning) { @@ -582,6 +583,7 @@ namespace IOB_WIN_NEXT.IobModbusTCP } } connectionOk = false; + queueInEnabCurr = false; // resetto last ping... lastPING = DateTime.Now.AddMinutes(-1); } diff --git a/IOB-WIN-NEXT/IobNet/IcoelSoap.cs b/IOB-WIN-NEXT/IobNet/IcoelSoap.cs index b26f9036..ae821569 100644 --- a/IOB-WIN-NEXT/IobNet/IcoelSoap.cs +++ b/IOB-WIN-NEXT/IobNet/IcoelSoap.cs @@ -282,6 +282,7 @@ namespace IOB_WIN_NEXT.IobNet // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -320,6 +321,7 @@ namespace IOB_WIN_NEXT.IobNet { // registro solo che è disconnesso connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobNet/Ping.cs b/IOB-WIN-NEXT/IobNet/Ping.cs index 55a615a1..24506c67 100644 --- a/IOB-WIN-NEXT/IobNet/Ping.cs +++ b/IOB-WIN-NEXT/IobNet/Ping.cs @@ -149,6 +149,7 @@ namespace IOB_WIN_NEXT.IobNet // in primis salvo data ping... lastPING = DateTime.Now; connectionOk = true; + queueInEnabCurr = true; lgInfo("PING OK"); } else @@ -167,6 +168,7 @@ namespace IOB_WIN_NEXT.IobNet { lgInfo("Richiesta disconnessione adapter PING!"); connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobNet/WebPageScrap.cs b/IOB-WIN-NEXT/IobNet/WebPageScrap.cs index 20b461e8..d1ae3b44 100644 --- a/IOB-WIN-NEXT/IobNet/WebPageScrap.cs +++ b/IOB-WIN-NEXT/IobNet/WebPageScrap.cs @@ -203,6 +203,7 @@ namespace IOB_WIN_NEXT.IobNet connectionOk = (testPingMachine == IPStatus.Success); if (connectionOk) { + queueInEnabCurr = true; try { //var t = TaskEx.Run(() => startDriver()); @@ -229,6 +230,7 @@ namespace IOB_WIN_NEXT.IobNet public override void tryDisconnect() { connectionOk = false; + queueInEnabCurr = false; try { // in primis chiudo driver... diff --git a/IOB-WIN-NEXT/IobOpc/OpcUa.cs b/IOB-WIN-NEXT/IobOpc/OpcUa.cs index f8291839..586899fe 100644 --- a/IOB-WIN-NEXT/IobOpc/OpcUa.cs +++ b/IOB-WIN-NEXT/IobOpc/OpcUa.cs @@ -109,7 +109,7 @@ namespace IOB_WIN_NEXT.IobOpc lastPzCountSend = adesso; lastWarnODL = adesso; lastCurrent = adesso; - lgTrace($"Aggiornato IobOpcUa.lastCurrent: {lastCurrent}"); + lgTrace($"Aggiornato IobOpcUa.lastCurrent: {lastCurrent}"); // ora leggo il file di conf specifico.... string jsonFileName = getOptPar("OPC_PARAM_CONF"); if (!string.IsNullOrEmpty(jsonFileName)) @@ -543,10 +543,10 @@ namespace IOB_WIN_NEXT.IobOpc parentForm.commPlcActive = false; // connesso se esito == 1... connectionOk = (esitoLink == 1); - //connectionOk = true; // refresh stato allarmi!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -618,6 +618,7 @@ namespace IOB_WIN_NEXT.IobOpc { lgDebug("IMPOSSIBILE effettuare disconnessione OpcUa: Connessione non disponibile..."); } + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobSiemens/Siemens.cs b/IOB-WIN-NEXT/IobSiemens/Siemens.cs index 1312b883..38bf79dd 100644 --- a/IOB-WIN-NEXT/IobSiemens/Siemens.cs +++ b/IOB-WIN-NEXT/IobSiemens/Siemens.cs @@ -1032,6 +1032,7 @@ namespace IOB_WIN_NEXT.IobSiemens // refresh stato allarmi!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo($"Connessione OK: {connectionOk} | adpRunning: {adpRunning}"); @@ -1080,6 +1081,7 @@ namespace IOB_WIN_NEXT.IobSiemens { currPLC.Close(); connectionOk = false; + queueInEnabCurr = false; lgInfo(szStatusConnection); lgInfo("Effettuata disconnessione adapter SIEMENS!"); } diff --git a/IOB-WIN-NEXT/IobSql/IcoelDb.cs b/IOB-WIN-NEXT/IobSql/IcoelDb.cs index af9d0b2b..c7ae6c9b 100644 --- a/IOB-WIN-NEXT/IobSql/IcoelDb.cs +++ b/IOB-WIN-NEXT/IobSql/IcoelDb.cs @@ -207,6 +207,7 @@ namespace IOB_WIN_NEXT.IobSql // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -246,6 +247,7 @@ namespace IOB_WIN_NEXT.IobSql { // registro solo che è disconnesso connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobSql/SqlServLantek.cs b/IOB-WIN-NEXT/IobSql/SqlServLantek.cs index 1649f9f4..1f991c4a 100644 --- a/IOB-WIN-NEXT/IobSql/SqlServLantek.cs +++ b/IOB-WIN-NEXT/IobSql/SqlServLantek.cs @@ -296,6 +296,7 @@ namespace IOB_WIN_NEXT.IobSql // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -335,6 +336,7 @@ namespace IOB_WIN_NEXT.IobSql { // registro solo che è disconnesso connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods diff --git a/IOB-WIN-NEXT/IobSql/SqlServPama.cs b/IOB-WIN-NEXT/IobSql/SqlServPama.cs index a0427b47..c1f9d8c6 100644 --- a/IOB-WIN-NEXT/IobSql/SqlServPama.cs +++ b/IOB-WIN-NEXT/IobSql/SqlServPama.cs @@ -298,6 +298,7 @@ namespace IOB_WIN_NEXT.IobSql // refresh stato connessione!!! if (connectionOk) { + queueInEnabCurr = true; if (adpRunning) { lgInfo("Connessione OK"); @@ -337,6 +338,7 @@ namespace IOB_WIN_NEXT.IobSql { // registro solo che è disconnesso connectionOk = false; + queueInEnabCurr = false; } #endregion Public Methods @@ -640,11 +642,7 @@ namespace IOB_WIN_NEXT.IobSql { string currVal = getEncodSigLog(sLog2send.DtEve, sLog2send.ValInt, counterSigIN); // verifico non sia in veto invio iniziale... - if (dtVetoQueueIN >= adesso) - { - lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); - } - else + if (queueInEnabCurr) { // --> accodo (valore già formattato)! QueueIN.Enqueue(currVal); @@ -656,6 +654,11 @@ namespace IOB_WIN_NEXT.IobSql counterSigIN = 0; } } + else + { + lgDebug($"[VETO FOR QUEUE-IN] | {currVal} - MESSAGE NOT SENT | {adesso:yyyyMMdd_HHmmss}"); + checkVetoQueueIn(); + } } } From c6929b6ff26f8f8d1cae464fe55bb1dd1e415778 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 11 Sep 2023 18:13:34 +0200 Subject: [PATCH 38/38] IOB-MTC: - Aggiunti ulteriori blocchi esecuzione lettura dati in fase avvio --- IOB-WIN-NEXT/Iob/MTConnect.cs | 271 +++++++++++++++++++--------------- 1 file changed, 150 insertions(+), 121 deletions(-) diff --git a/IOB-WIN-NEXT/Iob/MTConnect.cs b/IOB-WIN-NEXT/Iob/MTConnect.cs index f54c71cb..a5777c47 100644 --- a/IOB-WIN-NEXT/Iob/MTConnect.cs +++ b/IOB-WIN-NEXT/Iob/MTConnect.cs @@ -72,14 +72,21 @@ namespace IOB_WIN_NEXT.Iob public string getDataItemValue(string diKey) { string answ = ""; - try + if (queueInEnabCurr) { - var currDataItem = dataItemMem[diKey]; - answ = currDataItem.value; + try + { + var currDataItem = dataItemMem[diKey]; + answ = currDataItem.value; + } + catch (Exception exc) + { + Logging.Instance.Error($"Errore in getDataItemValue per {diKey}{Environment.NewLine}{exc}"); + } } - catch (Exception exc) + else { - Logging.Instance.Error($"Errore in getDataItemValue per {diKey}{Environment.NewLine}{exc}"); + lgDebug($"[VETO getDataItemValue] | veto attivo alle {DateTime.Now:yyyy.MM.dd HH:mm:ss}"); } return answ; } @@ -100,20 +107,27 @@ namespace IOB_WIN_NEXT.Iob { if (utils.CRB("enableContapezzi")) { - // cerco parametro contapezzi... - string currPzCount = getDataItemValue(mtcParams.keyPartCount); - - if (isVerboseLog) + if (queueInEnabCurr) { - lgInfo($"contapezzi: {mtcParams.keyPartCount} --> {currPzCount}"); + // cerco parametro contapezzi... + string currPzCount = getDataItemValue(mtcParams.keyPartCount); + + if (isVerboseLog) + { + lgInfo($"contapezzi: {mtcParams.keyPartCount} --> {currPzCount}"); + } + + // se ho un contapezzi... processo... + if (!string.IsNullOrEmpty(currPzCount)) + { + int newVal = -1; + Int32.TryParse(currPzCount, out newVal); + contapezziPLC = newVal > -1 ? newVal : contapezziPLC; + } } - - // se ho un contapezzi... processo... - if (!string.IsNullOrEmpty(currPzCount)) + else { - int newVal = -1; - Int32.TryParse(currPzCount, out newVal); - contapezziPLC = newVal > -1 ? newVal : contapezziPLC; + lgDebug($"[VETO processContapezzi] | veto attivo alle {DateTime.Now:yyyy.MM.dd HH:mm:ss}"); } } } @@ -150,7 +164,7 @@ namespace IOB_WIN_NEXT.Iob } else { - lgDebug($"[VETO readSemafori] | veto attivo sino alle {adesso:yyyy.MM.dd HH:mm:ss}"); + lgDebug($"[VETO readSemafori] | veto attivo alle {adesso:yyyy.MM.dd HH:mm:ss}"); checkVetoQueueIn(); } } @@ -360,16 +374,25 @@ namespace IOB_WIN_NEXT.Iob get { bool answ = false; - try + if (queueInEnabCurr) { - if (!string.IsNullOrEmpty(mtcParams.keyEStop)) + try { - string currEStop = getDataItemValue(mtcParams.keyEStop); - answ = (currEStop == "TRIGGERED"); + if (!string.IsNullOrEmpty(mtcParams.keyEStop)) + { + string currEStop = getDataItemValue(mtcParams.keyEStop); + answ = (currEStop == "TRIGGERED"); + } + } + catch (Exception exc) + { + Logging.Instance.Error($"Errore in hasEStopTriggered{Environment.NewLine}{exc}"); } } - catch - { } + else + { + lgDebug($"[VETO hasEStopTriggered] | veto attivo alle {DateTime.Now:yyyy.MM.dd HH:mm:ss}"); + } return answ; } } @@ -938,119 +961,125 @@ namespace IOB_WIN_NEXT.Iob { // init a zero... B_input = 0; - - /* ----------------------------------------------------- - * bitmap MAPO - * B0: POWER_ON - * B1: RUN - * B2: pzCount - * B3: allarme - * B4: manuale - * B5: emergenza (dipende da state machine se riportare 1 = armata/premuta, vedere conf mtcParams.emergencyArmedTrue) - ----------------------------------------------------- */ - - // Controllo booleano PING e POWERON... - string currPowerOn = getDataItemValue(mtcParams.condPowerOn.keyName); - // se valido il check ping lo eseguo... altrimenti lo do x buono - bool isPingOk = mtcParams.pingAsPowerOn && (testPingMachine == IPStatus.Success); - - // verifico da target value richiesto... - bool checkPowerOn = (currPowerOn == mtcParams.condPowerOn.targetValue); - - // bit 0 (poweron) imposto a 1 SE pingo o PowerOn=="ON"... - B_input = (isPingOk || checkPowerOn) ? 1 : 0; - - // variabili RUN... - string currRun = getDataItemValue(mtcParams.keyRunMode); - - // controllo RUN MODE preliminare... CABLATO - è GENERALE x MTC - if (currRun == "AUTOMATIC" || currRun == "SEMI_AUTO" || currRun == "SEMI_AUTOMATIC") + if (queueInEnabCurr) { - int numCond = mtcParams.condWork.Count; - int numCondOk = 0; - // cerco nell'elenco delle condizioni che indicano lavora se sono ok faccio +1 conteggio...... - foreach (var item in mtcParams.condWork) + /* ----------------------------------------------------- + * bitmap MAPO + * B0: POWER_ON + * B1: RUN + * B2: pzCount + * B3: allarme + * B4: manuale + * B5: emergenza (dipende da state machine se riportare 1 = armata/premuta, vedere conf mtcParams.emergencyArmedTrue) + ----------------------------------------------------- */ + + // Controllo booleano PING e POWERON... + string currPowerOn = getDataItemValue(mtcParams.condPowerOn.keyName); + // se valido il check ping lo eseguo... altrimenti lo do x buono + bool isPingOk = mtcParams.pingAsPowerOn && (testPingMachine == IPStatus.Success); + + // verifico da target value richiesto... + bool checkPowerOn = (currPowerOn == mtcParams.condPowerOn.targetValue); + + // bit 0 (poweron) imposto a 1 SE pingo o PowerOn=="ON"... + B_input = (isPingOk || checkPowerOn) ? 1 : 0; + + // variabili RUN... + string currRun = getDataItemValue(mtcParams.keyRunMode); + + // controllo RUN MODE preliminare... CABLATO - è GENERALE x MTC + if (currRun == "AUTOMATIC" || currRun == "SEMI_AUTO" || currRun == "SEMI_AUTOMATIC") { - if (getDataItemValue(item.keyName) == item.targetValue) + int numCond = mtcParams.condWork.Count; + int numCondOk = 0; + // cerco nell'elenco delle condizioni che indicano lavora se sono ok faccio +1 conteggio...... + foreach (var item in mtcParams.condWork) { - numCondOk++; + if (getDataItemValue(item.keyName) == item.targetValue) + { + numCondOk++; + } + } + // se tutte condizioni rispettate --> lavora! + if (numCond == numCondOk) + { + // RUN = LAVORA! + B_input += (1 << 1); } } - // se tutte condizioni rispettate --> lavora! - if (numCond == numCondOk) + // se ho almeno 1 allarme E NON SONO IN AUTO --> ALARM! + else if (hasError) { - // RUN = LAVORA! - B_input += (1 << 1); + B_input += (1 << 3); + } + else + { + // se ho run mode != auto --> manual + B_input += (1 << 4); } - } - // se ho almeno 1 allarme E NON SONO IN AUTO --> ALARM! - else if (hasError) - { - B_input += (1 << 3); - } - else - { - // se ho run mode != auto --> manual - B_input += (1 << 4); - } - // emergenza armata da riportare con bit True/ 1 - if (mtcParams.emergencyArmedTrue) - { - //se NON premuta lazo il bit - if (!hasEStopTriggered) + // emergenza armata da riportare con bit True/ 1 + if (mtcParams.emergencyArmedTrue) { - B_input += (1 << 5); - } - } - // emergenza armata da riportare come False/0 (!mtcParams.emergencyArmedTrue) - else - { - // se premuta alzo il bit... - if (hasEStopTriggered) - { - B_input += (1 << 5); - } - } - - DateTime adesso = DateTime.Now; - int vFactor = 1; - // controllo SE HO dati per fare verifiche... - if (string.IsNullOrEmpty(currRun)) - { - // se ho parametro x gestione reset... - if (enableMtcRestart) - { - // controllo se ho ricevuto il current da OLTRE 1 minuto... - if (lastCurrent.AddMinutes(3) < adesso) + //se NON premuta lazo il bit + if (!hasEStopTriggered) { - lastCurrent = adesso; - // stop... - lgInfo("Fermato MTC_ref per mancanza dati current"); - MTC_ref.Stop(); - Thread.Sleep(1000); - // restart - lgInfo("Riavviato MTC_ref per mancanza dati current"); - MTC_ref.Start(); + B_input += (1 << 5); } } + // emergenza armata da riportare come False/0 (!mtcParams.emergencyArmedTrue) + else + { + // se premuta alzo il bit... + if (hasEStopTriggered) + { + B_input += (1 << 5); + } + } + + DateTime adesso = DateTime.Now; + int vFactor = 1; + // controllo SE HO dati per fare verifiche... + if (string.IsNullOrEmpty(currRun)) + { + // se ho parametro x gestione reset... + if (enableMtcRestart) + { + // controllo se ho ricevuto il current da OLTRE 1 minuto... + if (lastCurrent.AddMinutes(3) < adesso) + { + lastCurrent = adesso; + // stop... + lgInfo("Fermato MTC_ref per mancanza dati current"); + MTC_ref.Stop(); + Thread.Sleep(1000); + // restart + lgInfo("Riavviato MTC_ref per mancanza dati current"); + MTC_ref.Start(); + } + } + } + else + { + vFactor = 6; + } + + // solo se non ho veto check + if (vetoCheckStatus < adesso) + { + lgInfo($"Stato variabili: currRun: {currRun}"); + // imposto veto per vetoSeconds... + vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor); + } + // log opzionale! + if (verboseLog) + { + lgInfo($"Trasformazione B_input: {B_input} | currRun = {currRun}"); + } } else { - vFactor = 6; - } - - // solo se non ho veto check - if (vetoCheckStatus < adesso) - { - lgInfo($"Stato variabili: currRun: {currRun}"); - // imposto veto per vetoSeconds... - vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor); - } - // log opzionale! - if (verboseLog) - { - lgInfo($"Trasformazione B_input: {B_input} | currRun = {currRun}"); + lgDebug($"[VETO getDataItemValue] | veto attivo alle {DateTime.Now:yyyy.MM.dd HH:mm:ss}"); } }