From 2b7ed3b75a9e5890f70e4d1e869fde6035260195 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 7 Jan 2026 16:43:36 +0100 Subject: [PATCH 1/4] Update ping, WPS, Shelly --- IOB-WIN-BECKHOFF/App.config | 2 +- IOB-WIN-FILE/App.config | 2 +- IOB-WIN-FORM/AdapterForm.cs | 33 +- IOB-WIN-FORM/Iob/Generic.Protected.cs | 516 +++++++++++++++++--------- IOB-WIN-FORM/Iob/Generic.Public.cs | 4 +- IOB-WIN-FORM/MainForm.cs | 59 ++- IOB-WIN-FTP/App.config | 2 +- IOB-WIN-KAWASAKI/App.config | 2 +- IOB-WIN-MBUS/App.config | 2 +- IOB-WIN-MITSUBISHI/App.config | 2 +- IOB-WIN-OMRON/App.config | 2 +- IOB-WIN-OSAI/App.config | 2 +- IOB-WIN-PING/App.config | 8 + IOB-WIN-PING/DATA/CONF/MAIN.ini | 4 +- IOB-WIN-PING/IOB-WIN-PING.csproj | 9 +- IOB-WIN-PING/packages.config | 5 +- IOB-WIN-SIEMENS/App.config | 2 +- IOB-WIN-WPS/DATA/CONF/MAIN.ini | 5 +- 18 files changed, 433 insertions(+), 228 deletions(-) diff --git a/IOB-WIN-BECKHOFF/App.config b/IOB-WIN-BECKHOFF/App.config index dcb50167..3705a7f3 100644 --- a/IOB-WIN-BECKHOFF/App.config +++ b/IOB-WIN-BECKHOFF/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-FILE/App.config b/IOB-WIN-FILE/App.config index a2bfb720..4b651cb9 100644 --- a/IOB-WIN-FILE/App.config +++ b/IOB-WIN-FILE/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-FORM/AdapterForm.cs b/IOB-WIN-FORM/AdapterForm.cs index 5bd2257d..240d476f 100644 --- a/IOB-WIN-FORM/AdapterForm.cs +++ b/IOB-WIN-FORM/AdapterForm.cs @@ -1386,7 +1386,7 @@ namespace IOB_WIN_FORM forcedTask.Add(cmbParamValues.SelectedValue.ToString(), txtValue.Text); } // chiedo esecuzione task! forzato SENZA tavola - iobObj.processTask(forcedTask, ""); + _ = iobObj.processTask(forcedTask, ""); chkEdit.Checked = false; toggleEditMes2Plc(); } @@ -1458,23 +1458,33 @@ namespace IOB_WIN_FORM if (!sendDone) { TimersCycleCount[item]++; - Stopwatch sw = new Stopwatch(); - sw.Start(); - // se scaduto processo! - iobObj.getAndSend(item); - sendDone = true; + Stopwatch sw = Stopwatch.StartNew(); + + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => await iobObj.getAndSendAsync(item)) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in getAndSendAsync per {item}: {ex.Message}"); + } + sw.Stop(); + sendDone = true; TimersCycleElaps[item] += sw.Elapsed.TotalMilliseconds; // metto nuova scadenza perturbata 10% TimersVeto[item] = adesso.AddMilliseconds(iobObj.IOBConfFull.TimerMs(item, 0.1)); } // log + reset se ho contato ALMENO 100 exec o il tempo totale supera 1000msec int limMs = 10000; - if (TimersCycleCount[item] >= 100 || (TimersCycleElaps.ContainsKey(item) && TimersCycleElaps[item] > limMs)) + double totalMs = TimersCycleElaps.ContainsKey(item) ? TimersCycleElaps[item] : 0; + if (TimersCycleCount[item] >= 100 || totalMs > limMs) { - var nCount = TimersCycleCount[item]; - nCount = nCount > 0 ? nCount : 1; - lgDebug($"checkScad | {item} | {TimersCycleElaps[item] / nCount:F1}ms x {nCount}"); + int nCount = Math.Max(TimersCycleCount[item], 1); + lgDebug($"checkScad | {item} | {totalMs / nCount:F1}ms x {nCount}"); TimersCycleCount[item] = 0; TimersCycleElaps[item] = 0; } @@ -1484,6 +1494,7 @@ namespace IOB_WIN_FORM { TimersVeto.Add(item, adesso.AddMilliseconds(iobObj.IOBConfFull.TimerMs(item, 0))); TimersCycleCount.Add(item, 0); + if (!TimersCycleElaps.ContainsKey(item)) TimersCycleElaps.Add(item, 0); } } } @@ -1530,7 +1541,7 @@ namespace IOB_WIN_FORM try { // check esecuzione SendTask (MsVHF) COMUNQUE... - iobObj.getAndSend(gatherCycle.VHF); + await iobObj.getAndSendAsync(gatherCycle.VHF); // eseguo cicli attivi SOLO se adapter è in EFFETTIVO running... if (iobObj.adpRunning) { diff --git a/IOB-WIN-FORM/Iob/Generic.Protected.cs b/IOB-WIN-FORM/Iob/Generic.Protected.cs index 24dd43ea..90f902be 100644 --- a/IOB-WIN-FORM/Iob/Generic.Protected.cs +++ b/IOB-WIN-FORM/Iob/Generic.Protected.cs @@ -2757,8 +2757,18 @@ namespace IOB_WIN_FORM.Iob { if (weekData.Key != currWeek) { - // ...x ogni settimana PASSATA effettua SendArch... --> lancia un task! - processOtherInfo(weekData.Key, "SendArch"); + // ...x ogni settimana PASSATA effettua SendArch... --> lancia un task! + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => await processOtherInfo(weekData.Key, "SendArch")) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in processOtherInfo per {weekData.Key}: {ex.Message}"); + } } } answ = true; @@ -3410,7 +3420,7 @@ namespace IOB_WIN_FORM.Iob /// protected void setupMemMap() { - bool serverOk = testPingServer == IPStatus.Success; + bool serverOk = GetPingStatus() == IPStatus.Success; if (memMap == null) { lgError($"setupMemMap | memMap nullo"); @@ -4111,7 +4121,7 @@ namespace IOB_WIN_FORM.Iob if (srvAlive) { bool iobOk = false; - iobOk = await checkIobEnabled(); + iobOk = CheckIobEnabled(); // verifico SE posso inviare dati if (iobOk) { @@ -4413,94 +4423,169 @@ namespace IOB_WIN_FORM.Iob /// /// Verifica se la IOB sia ENABLED (da server o Demo) /// - private async Task checkIobEnabled() + public bool CheckIobEnabled() { - bool answ = false; - // controllo se ho veto al check... - if (dtVetoCheckIOB < DateTime.Now) + +#if false + bool answ = false; + // controllo se ho veto al check... + if (dtVetoCheckIOB < DateTime.Now) + { + if (DemoOut) { - if (DemoOut) - { - answ = (QueueIN.Count + QueueFLog.Count >= nMaxSend); - IobOnline = answ; - } - else - { - try - { - // chiamo URL, se restituisce "OK" è enabled! - string callResp = await callUrl(urlIobEnabled, true); - answ = (callResp == "OK"); - // attesa casuale se necessario - var rand = new Random(); - // primi 2 test - int maxTry = 2; - while (maxTry > 0 && !answ) - { - Thread.Sleep(rand.Next(250, 500)); - callResp = await callUrl(urlIobEnabled, true); - answ = (callResp == "OK"); - maxTry--; - } - // se NON OK riprovo ANCORA 1 volta... - if (!answ) - { - resetWebClients(); - Thread.Sleep(rand.Next(250, 1000)); - callResp = await callUrl(urlIobEnabled, false); - answ = (callResp == "OK"); - } - // altri 2 - maxTry = 2; - while (maxTry > 0 && !answ) - { - Thread.Sleep(rand.Next(250, 500)); - callResp = await callUrl(urlIobEnabled, false); - answ = (callResp == "OK"); - maxTry--; - } - // salvo status... - IobOnline = answ; - // se online imposto veto check a 5 x tempo reinvio... - if (answ) - { - lastIobOnline = DateTime.Now; - } - dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5); - } - catch - { } - } - // verifico SE è variato stato online/offline... - if (IobOnline != answ) - { - // se ORA sono online riporto... - if (answ) - { - lgInfo("IOB ONLINE for server MP/IO"); - } - else - { - lgInfo("IOB OFFLINE for server MP/IO"); - } - } - // fix colore - if (answ) - { - parentForm.commSrvActive = 2; - } - else - { - parentForm.commSrvActive = 1; - } + answ = (QueueIN.Count + QueueFLog.Count >= nMaxSend); + IobOnline = answ; } else { - // altrimenti passo ultimo valore noto - answ = IobOnline; + try + { + // chiamo URL, se restituisce "OK" è enabled! + string callResp = await callUrl(urlIobEnabled, true); + answ = (callResp == "OK"); + // attesa casuale se necessario + var rand = new Random(); + // primi 2 test + int maxTry = 2; + while (maxTry > 0 && !answ) + { + Thread.Sleep(rand.Next(250, 500)); + callResp = await callUrl(urlIobEnabled, true); + answ = (callResp == "OK"); + maxTry--; + } + // se NON OK riprovo ANCORA 1 volta... + if (!answ) + { + resetWebClients(); + Thread.Sleep(rand.Next(250, 1000)); + callResp = await callUrl(urlIobEnabled, false); + answ = (callResp == "OK"); + } + // altri 2 + maxTry = 2; + while (maxTry > 0 && !answ) + { + Thread.Sleep(rand.Next(250, 500)); + callResp = await callUrl(urlIobEnabled, false); + answ = (callResp == "OK"); + maxTry--; + } + // salvo status... + IobOnline = answ; + // se online imposto veto check a 5 x tempo reinvio... + if (answ) + { + lastIobOnline = DateTime.Now; + } + dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5); + } + catch + { } + } + // verifico SE è variato stato online/offline... + if (IobOnline != answ) + { + // se ORA sono online riporto... + if (answ) + { + lgInfo("IOB ONLINE for server MP/IO"); + } + else + { + lgInfo("IOB OFFLINE for server MP/IO"); + } + } + // fix colore + if (answ) + { + parentForm.commSrvActive = 2; + } + else + { + parentForm.commSrvActive = 1; } - return answ; } + else + { + // altrimenti passo ultimo valore noto + answ = IobOnline; + } + return answ; +#endif + + // 1. Controllo Veto (Sincrono) + if (dtVetoCheckIOB >= DateTime.Now) + return IobOnline; + + bool currentAnsw = false; + + if (DemoOut) + { + currentAnsw = (QueueIN.Count + QueueFLog.Count >= nMaxSend); + } + else + { + // 2. Chiamata asincrona con Retry (Ponte Sync/Async) + currentAnsw = Task.Run(async () => await ExecuteIobCheckWithRetry(maxRetries: 5)) + .GetAwaiter() + .GetResult(); + } + + // 3. Gestione Stato e Logica UI + UpdateIobState(currentAnsw); + + return currentAnsw; + } + + private async Task ExecuteIobCheckWithRetry(int maxRetries) + { + var rand = new Random(); + for (int i = 0; i <= maxRetries; i++) + { + try + { + if (i > 0) + { + // Al terzo tentativo fallito resetto i client + if (i == 3) resetWebClients(); + + int delay = i == 3 ? rand.Next(250, 1000) : rand.Next(250, 500); + await Task.Delay(delay); + } + + string callResp = await callUrl(urlIobEnabled, i < 3); // true per i primi tentativi + if (callResp == "OK") return true; + } + catch { /* Retry silente */ } + } + return false; + } + + private void UpdateIobState(bool newStatus) + { + // Log se lo stato è cambiato + if (IobOnline != newStatus) + { + lgInfo(newStatus ? "IOB ONLINE for server MP/IO" : "IOB OFFLINE for server MP/IO"); + } + + IobOnline = newStatus; + + if (newStatus) + { + lastIobOnline = DateTime.Now; + parentForm.commSrvActive = 2; // Stato Online + } + else + { + parentForm.commSrvActive = 1; // Stato Degradato/Offline + } + + // Imposto il veto per il prossimo controllo + dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5); + } + /// /// Boolean abilitazione coda eventi IN @@ -4516,92 +4601,177 @@ namespace IOB_WIN_FORM.Iob } /// - /// test ping all'indirizzo impostato nei parametri + /// Test ping all'indirizzo impostato nei parametri /// /// - private IPStatus testPingServer + private IPStatus GetPingStatus() { - get + var pStatus = Task.Run(async () => await GetPingStatusAsync(maxPingRetry + 1)) + .GetAwaiter() + .GetResult(); + + return pStatus; + } + + /// + /// Test ping all'indirizzo impostato nei parametri + /// + /// Numero max tentativi (maxPingRetry + 1) + /// + private async Task GetPingStatusAsync(int maxAttempts) + { + +#if false + IPStatus answ = IPStatus.Unknown; + // se disabilitato salto... + if (IOBConfFull.MapoMes.DisabPing) { - IPStatus answ = IPStatus.Unknown; - // se disabilitato salto... - if (IOBConfFull.MapoMes.DisabPing) + answ = IPStatus.Success; + } + else + { + IPAddress address; + PingReply reply; + var rand = new Random(); + int pingTOut = 500; + using (Ping pingSender = new Ping()) { - answ = IPStatus.Success; - } - else - { - IPAddress address; - PingReply reply; - var rand = new Random(); - int pingTOut = 500; - using (Ping pingSender = new Ping()) + address = IPAddress.Loopback; + int numRetry = 1; + string ipAddr = IOBConfFull.MapoMes.IpAddr.Replace($"{IOBConfFull.MapoMes.Transport}://", ""); + // fix se fosse ip + porta... + if (ipAddr.IndexOf(":") >= 0) { - address = IPAddress.Loopback; - int maxRetry = maxPingRetry + 1; - int numRetry = 1; - string ipAddr = IOBConfFull.MapoMes.IpAddr.Replace($"{IOBConfFull.MapoMes.Transport}://", ""); - // fix se fosse ip + porta... - if (ipAddr.IndexOf(":") >= 0) + ipAddr = ipAddr.Substring(0, ipAddr.IndexOf(":")); + } + IPAddress.TryParse(ipAddr, out address); + // se null --> provo DNS... + if (address == null) + { + var rawAddresses = Dns.GetHostAddresses(ipAddr); + if (rawAddresses.Length > 0) { - ipAddr = ipAddr.Substring(0, ipAddr.IndexOf(":")); - } - IPAddress.TryParse(ipAddr, out address); - // se null --> provo DNS... - if (address == null) - { - var rawAddresses = Dns.GetHostAddresses(ipAddr); - if (rawAddresses.Length > 0) - { - address = rawAddresses[0]; - } - } - try - { - // se != null --> uso address... - if (address != null) - { - pingTOut = rand.Next(200, 400); - reply = pingSender.Send(address, pingTOut); - } - else - { - pingTOut = rand.Next(300, 600); - //reply = pingSender.Send(cIobConf.cncIpAddr, pingTOut); - reply = pingSender.Send(IPAddress.Loopback, pingTOut); - lgError($"ping to loopback addres per mancanza address server"); - } - } - catch (Exception exc) - { - pingTOut = rand.Next(100, 200); - reply = pingSender.Send(IPAddress.Loopback, pingTOut); - lgError($"ping to loopback addres per eccezione:{Environment.NewLine}{exc}"); - } - // se ho timeout riprovo... - while (reply.Status != IPStatus.Success && numRetry < maxRetry) - { - Thread.Sleep(rand.Next(50, 200)); - pingTOut = pingServerMsTimeout * numRetry / 2; - reply = pingSender.Send(address, pingTOut); - numRetry++; - if (reply.Status == IPStatus.Success) - { - lgInfo("Server PING OK!"); - break; - } - else - { - lgInfo($"Server Ping KO | reply: {reply.Status} --> retry | TimeOut: {pingTOut}"); - } + address = rawAddresses[0]; + } + } + try + { + // se != null --> uso address... + if (address != null) + { + pingTOut = rand.Next(200, 400); + reply = pingSender.Send(address, pingTOut); + } + else + { + pingTOut = rand.Next(300, 600); + //reply = pingSender.Send(cIobConf.cncIpAddr, pingTOut); + reply = pingSender.Send(IPAddress.Loopback, pingTOut); + lgError($"ping to loopback addres per mancanza address server"); + } + } + catch (Exception exc) + { + pingTOut = rand.Next(100, 200); + reply = pingSender.Send(IPAddress.Loopback, pingTOut); + lgError($"ping to loopback addres per eccezione:{Environment.NewLine}{exc}"); + } + // se ho timeout riprovo... + while (reply.Status != IPStatus.Success && numRetry < maxRetry) + { + await Task.Delay(rand.Next(50, 200)); + //Thread.Sleep(rand.Next(50, 200)); + pingTOut = pingServerMsTimeout * numRetry / 2; + reply = pingSender.Send(address, pingTOut); + numRetry++; + if (reply.Status == IPStatus.Success) + { + lgInfo("Server PING OK!"); + break; + } + else + { + lgInfo($"Server Ping KO | reply: {reply.Status} --> retry | TimeOut: {pingTOut}"); } } - answ = reply.Status; } - return answ; + answ = reply.Status; } + return answ; +#endif + + // 1. Check disabilitazione + if (IOBConfFull.MapoMes.DisabPing) return IPStatus.Success; + + // 2. Estrazione Host/IP pulita + string host = IOBConfFull.MapoMes.IpAddr; + try + { + // Rimuove protocollo (http://, ftp://, etc) + if (host.Contains("://")) + host = new Uri(host).Host; + else if (host.Contains(":")) + host = host.Split(':')[0]; + } + catch { /* fallback al valore originale se Uri fallisce */ } + + // 3. Risoluzione Indirizzo + if (!IPAddress.TryParse(host, out IPAddress address)) + { + try + { + var addresses = Dns.GetHostAddresses(host); + if (addresses.Length > 0) address = addresses[0]; + } + catch (Exception ex) + { + lgError($"Impossibile risolvere DNS per {host}: {ex.Message}"); + return IPStatus.DestinationHostUnreachable; + } + } + + if (address == null) return IPStatus.Unknown; + + // 4. Ciclo di Ping con Retry + var rand = new Random(); + using (Ping pingSender = new Ping()) + { + for (int attempt = 1; attempt <= maxAttempts; attempt++) + { + try + { + // Timeout dinamico come nel tuo originale + int timeout = (attempt == 1) + ? rand.Next(200, 400) + : (pingServerMsTimeout * attempt / 2); + + PingReply reply = pingSender.Send(address, timeout); + + if (reply.Status == IPStatus.Success) + { + if (attempt > 1) lgInfo("Server PING OK dopo retry!"); + return IPStatus.Success; + } + + lgInfo($"Ping tent. {attempt} fallito: {reply.Status} (Timeout: {timeout}ms)"); + } + catch (Exception ex) + { + lgError($"Eccezione durante ping tent. {attempt}: {ex.Message}"); + } + + // Attesa prima del prossimo tentativo (se non è l'ultimo) + if (attempt < maxAttempts) + { + await Task.Delay(rand.Next(50, 200)); + } + } + } + + return IPStatus.TimedOut; } + /// /// URL di base del server MES da contattare /// @@ -5305,15 +5475,29 @@ namespace IOB_WIN_FORM.Iob dtEndPOdl = dtStartPOdl.AddSeconds(duration); } - // prova ad avviare/chiudere PODL relativo (eventualmente duplicandolo) - dtEve = $"{dtStartPOdl:yyyyMMddHHmmssfff}"; - dtCurr = $"{DateTime.Now:yyyyMMddHHmmssfff}"; - callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtEve}&dtCurr={dtCurr}", false); + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + // prova ad avviare/chiudere PODL relativo (eventualmente duplicandolo) + dtEve = $"{dtStartPOdl:yyyyMMddHHmmssfff}"; + dtCurr = $"{DateTime.Now:yyyyMMddHHmmssfff}"; + await callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtEve}&dtCurr={dtCurr}", false); + + // ora chiamo chiusura... + dtEve = $"{dtEndPOdl:yyyyMMddHHmmssfff}"; + dtCurr = $"{DateTime.Now:yyyyMMddHHmmssfff}"; + await callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtEve}&dtCurr={dtCurr}", false); + }) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in RecipeDoProcessPODL.callUrl: {ex.Message}"); + } - // ora chiamo chiusura... - dtEve = $"{dtEndPOdl:yyyyMMddHHmmssfff}"; - dtCurr = $"{DateTime.Now:yyyyMMddHHmmssfff}"; - callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtEve}&dtCurr={dtCurr}", false); } answ = true; } diff --git a/IOB-WIN-FORM/Iob/Generic.Public.cs b/IOB-WIN-FORM/Iob/Generic.Public.cs index ec9ec338..44ce202c 100644 --- a/IOB-WIN-FORM/Iob/Generic.Public.cs +++ b/IOB-WIN-FORM/Iob/Generic.Public.cs @@ -717,7 +717,7 @@ namespace IOB_WIN_FORM.Iob } else { - IPStatus pingStatus = testPingServer; + IPStatus pingStatus = GetPingStatus(); // se passa il ping faccio il resto... if (pingStatus == IPStatus.Success) { @@ -1337,7 +1337,7 @@ namespace IOB_WIN_FORM.Iob /// effettua recupero dati ed invio valori modificati... /// /// - public async Task getAndSend(gatherCycle ciclo) + public async Task getAndSendAsync(gatherCycle ciclo) { // init obj display newDisplayData currDispData = new newDisplayData(); diff --git a/IOB-WIN-FORM/MainForm.cs b/IOB-WIN-FORM/MainForm.cs index 06fd5fc9..950a0ec9 100644 --- a/IOB-WIN-FORM/MainForm.cs +++ b/IOB-WIN-FORM/MainForm.cs @@ -104,7 +104,7 @@ namespace IOB_WIN_FORM { if (utils.dtVetoPing < DateTime.Now) { - IPStatus pingStatus = testPingServer; + IPStatus pingStatus = GetPingStatus(); // se passa il ping faccio il resto... if (pingStatus == IPStatus.Success) { @@ -596,7 +596,7 @@ namespace IOB_WIN_FORM } try { - IPStatus pingStatus = testPingServer; + IPStatus pingStatus = GetPingStatus(); // se passa il ping faccio il resto... if (pingStatus == IPStatus.Success) { @@ -692,46 +692,43 @@ namespace IOB_WIN_FORM /// test ping all'indirizzo impostato nei parametri /// /// - private IPStatus testPingServer + private IPStatus GetPingStatus() { - get + IPStatus answ = IPStatus.Unknown; + // se disabilitato salto... + if (IOBConfFull != null && IOBConfFull.MapoMes.DisabPing) { - IPStatus answ = IPStatus.Unknown; - // se disabilitato salto... - if (IOBConfFull != null && IOBConfFull.MapoMes.DisabPing) + answ = IPStatus.Success; + } + else + { + IPAddress address; + PingReply reply; + using (Ping pingSender = new Ping()) { - answ = IPStatus.Success; - } - else - { - IPAddress address; - PingReply reply; - using (Ping pingSender = new Ping()) + address = IPAddress.Loopback; + string ipAdrr = MPIP; + IPAddress.TryParse(ipAdrr, out address); + try { - address = IPAddress.Loopback; - string ipAdrr = MPIP; - IPAddress.TryParse(ipAdrr, out address); - try + // se != null --> uso address... + if (address != null) { - // se != null --> uso address... - if (address != null) - { - reply = pingSender.Send(address, 500); - } - else - { - reply = pingSender.Send(MPIP, 500); - } + reply = pingSender.Send(address, 500); } - catch + else { - reply = pingSender.Send(IPAddress.Loopback, 100); + reply = pingSender.Send(MPIP, 500); } } - answ = reply.Status; + catch + { + reply = pingSender.Send(IPAddress.Loopback, 100); + } } - return answ; + answ = reply.Status; } + return answ; } #endregion Private Properties diff --git a/IOB-WIN-FTP/App.config b/IOB-WIN-FTP/App.config index f04a7c7d..4a931b62 100644 --- a/IOB-WIN-FTP/App.config +++ b/IOB-WIN-FTP/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-KAWASAKI/App.config b/IOB-WIN-KAWASAKI/App.config index 39f7e606..4316a335 100644 --- a/IOB-WIN-KAWASAKI/App.config +++ b/IOB-WIN-KAWASAKI/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-MBUS/App.config b/IOB-WIN-MBUS/App.config index d0a0d0e1..0843b901 100644 --- a/IOB-WIN-MBUS/App.config +++ b/IOB-WIN-MBUS/App.config @@ -168,7 +168,7 @@ - + diff --git a/IOB-WIN-MITSUBISHI/App.config b/IOB-WIN-MITSUBISHI/App.config index 76dca8f4..4f0cc252 100644 --- a/IOB-WIN-MITSUBISHI/App.config +++ b/IOB-WIN-MITSUBISHI/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-OMRON/App.config b/IOB-WIN-OMRON/App.config index 1fef0a66..21b8406d 100644 --- a/IOB-WIN-OMRON/App.config +++ b/IOB-WIN-OMRON/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-OSAI/App.config b/IOB-WIN-OSAI/App.config index 63e0da50..0cb49721 100644 --- a/IOB-WIN-OSAI/App.config +++ b/IOB-WIN-OSAI/App.config @@ -167,7 +167,7 @@ - + diff --git a/IOB-WIN-PING/App.config b/IOB-WIN-PING/App.config index 96244000..d655c15a 100644 --- a/IOB-WIN-PING/App.config +++ b/IOB-WIN-PING/App.config @@ -165,6 +165,14 @@ + + + + + + + + diff --git a/IOB-WIN-PING/DATA/CONF/MAIN.ini b/IOB-WIN-PING/DATA/CONF/MAIN.ini index 2f4ece23..0a886ef0 100644 --- a/IOB-WIN-PING/DATA/CONF/MAIN.ini +++ b/IOB-WIN-PING/DATA/CONF/MAIN.ini @@ -12,12 +12,12 @@ CMDIOB2CALL=/IOB/getIob2call?GWIP= CLI_INST=SteamWareSim [IOB] -;STARTLIST=PING +STARTLIST=PING ;STARTLIST=SIMUL_01 ;STARTLIST=FTP-PING ;STARTLIST=SIMUL_08 ;STARTLIST=3024-PING -STARTLIST=3023-PING,3024-PING +;STARTLIST=3023-PING,3024-PING MAXCNC=10 diff --git a/IOB-WIN-PING/IOB-WIN-PING.csproj b/IOB-WIN-PING/IOB-WIN-PING.csproj index 16df0843..e8dbf1f1 100644 --- a/IOB-WIN-PING/IOB-WIN-PING.csproj +++ b/IOB-WIN-PING/IOB-WIN-PING.csproj @@ -44,8 +44,8 @@ prompt - - ..\packages\MapoSDK.6.14.2505.2916\lib\MapoSDK.dll + + ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll @@ -66,7 +66,7 @@ ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll - ..\packages\StackExchange.Redis.2.8.24\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.10.1\lib\net461\StackExchange.Redis.dll @@ -80,6 +80,9 @@ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + + ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll + ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll diff --git a/IOB-WIN-PING/packages.config b/IOB-WIN-PING/packages.config index 0905ee2e..9bbc8648 100644 --- a/IOB-WIN-PING/packages.config +++ b/IOB-WIN-PING/packages.config @@ -1,6 +1,6 @@  - + @@ -8,10 +8,11 @@ - + + diff --git a/IOB-WIN-SIEMENS/App.config b/IOB-WIN-SIEMENS/App.config index b1cdaee9..aa336006 100644 --- a/IOB-WIN-SIEMENS/App.config +++ b/IOB-WIN-SIEMENS/App.config @@ -168,7 +168,7 @@ - + diff --git a/IOB-WIN-WPS/DATA/CONF/MAIN.ini b/IOB-WIN-WPS/DATA/CONF/MAIN.ini index 79ab62f0..42f824ce 100644 --- a/IOB-WIN-WPS/DATA/CONF/MAIN.ini +++ b/IOB-WIN-WPS/DATA/CONF/MAIN.ini @@ -20,7 +20,8 @@ CLI_INST=SteamWareSim ;STARTLIST=WPS ;STARTLIST=3018,3019 ;STARTLIST=3018 -STARTLIST=3019 -;STARTLIST=SIMUL_05 +;STARTLIST=3019 +STARTLIST=SIMUL_01 MAXCNC=10 + From c0e5fa79cd08f84aeb72c94d2d51d11349372200 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 7 Jan 2026 17:10:53 +0100 Subject: [PATCH 2/4] UPDATE BINDIG REDIRECT + STACK (4.7.2) + NUGET --- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 62 ++--- IOB-UT-NEXT/app.config | 20 +- IOB-UT-NEXT/packages.config | 30 +-- IOB-WIN-BECKHOFF/App.config | 8 - IOB-WIN-FANUC/App.config | 8 - IOB-WIN-FILE/App.config | 8 - IOB-WIN-FORM/AdapterForm.cs | 6 - IOB-WIN-FORM/IOB-WIN-FORM.csproj | 57 +++-- IOB-WIN-FORM/app.config | 31 +-- IOB-WIN-FORM/packages.config | 26 +- IOB-WIN-FTP/App.config | 8 - IOB-WIN-KAWASAKI/App.config | 8 - IOB-WIN-MBUS/App.config | 9 - IOB-WIN-MITSUBISHI/App.config | 8 - IOB-WIN-MTC/App.config | 9 - IOB-WIN-NEXT/App.config | 8 - IOB-WIN-OMRON/App.config | 8 - IOB-WIN-OPC-UA/App.config | 8 - IOB-WIN-OSAI/App.config | 8 - IOB-WIN-PING/App.config | 29 +-- IOB-WIN-PING/IOB-WIN-PING.csproj | 56 +++-- IOB-WIN-PING/Properties/Resources.Designer.cs | 46 ++-- IOB-WIN-PING/Properties/Settings.Designer.cs | 22 +- IOB-WIN-PING/packages.config | 22 +- IOB-WIN-SHELLY/App.config | 230 +++++++++--------- IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj | 4 +- .../Properties/Resources.Designer.cs | 44 ++-- .../Properties/Settings.Designer.cs | 22 +- IOB-WIN-SHELLY/packages.config | 12 +- IOB-WIN-SIEMENS/App.config | 4 - IOB-WIN-SQL/App.config | 8 - IOB-WIN-WPS/App.config | 8 - IOB-WIN-WS/App.config | 8 - 33 files changed, 342 insertions(+), 503 deletions(-) diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index 10695531..50527fa0 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -9,7 +9,7 @@ Properties IOB_UT_NEXT IOB-UT-NEXT - v4.6.2 + v4.7.2 512 @@ -65,8 +65,8 @@ ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -81,17 +81,17 @@ ..\packages\NLog.5.3.4\lib\net46\NLog.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll - - ..\packages\RestSharp.112.1.0\lib\netstandard2.0\RestSharp.dll + + ..\packages\RestSharp.113.0.0\lib\net471\RestSharp.dll - - ..\packages\StackExchange.Redis.2.10.1\lib\net461\StackExchange.Redis.dll + + ..\packages\StackExchange.Redis.1.2.6\lib\net46\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -104,45 +104,44 @@ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll True + True ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll + - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - - ..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - @@ -150,7 +149,7 @@ - ..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll + ..\packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll @@ -241,4 +240,11 @@ + + + + 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-UT-NEXT/app.config b/IOB-UT-NEXT/app.config index ec0c01bc..da3effdf 100644 --- a/IOB-UT-NEXT/app.config +++ b/IOB-UT-NEXT/app.config @@ -4,37 +4,33 @@ - - - - - + - + - + - + - + - + - + @@ -51,6 +47,6 @@ - + diff --git a/IOB-UT-NEXT/packages.config b/IOB-UT-NEXT/packages.config index a2716c19..527346b8 100644 --- a/IOB-UT-NEXT/packages.config +++ b/IOB-UT-NEXT/packages.config @@ -1,29 +1,29 @@  - + - - + + - - + + - + - - - - + + + + - - + + - - - + + + \ No newline at end of file diff --git a/IOB-WIN-BECKHOFF/App.config b/IOB-WIN-BECKHOFF/App.config index 3705a7f3..d6fcfea3 100644 --- a/IOB-WIN-BECKHOFF/App.config +++ b/IOB-WIN-BECKHOFF/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-FANUC/App.config b/IOB-WIN-FANUC/App.config index a2f913f6..d23dc068 100644 --- a/IOB-WIN-FANUC/App.config +++ b/IOB-WIN-FANUC/App.config @@ -133,10 +133,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-FILE/App.config b/IOB-WIN-FILE/App.config index 4b651cb9..92b30df3 100644 --- a/IOB-WIN-FILE/App.config +++ b/IOB-WIN-FILE/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-FORM/AdapterForm.cs b/IOB-WIN-FORM/AdapterForm.cs index 240d476f..d51b9c2f 100644 --- a/IOB-WIN-FORM/AdapterForm.cs +++ b/IOB-WIN-FORM/AdapterForm.cs @@ -1680,16 +1680,10 @@ namespace IOB_WIN_FORM /// private void gather_Tick(object sender, EventArgs e) { - bool doLog = false; if (iobObj != null) { // fermo il timer... gather.Stop(); - // procedo! - if (iobObj.periodicLog) - { - doLog = true; - } try { refreshFormData(); diff --git a/IOB-WIN-FORM/IOB-WIN-FORM.csproj b/IOB-WIN-FORM/IOB-WIN-FORM.csproj index eca6a5b6..90fef87f 100644 --- a/IOB-WIN-FORM/IOB-WIN-FORM.csproj +++ b/IOB-WIN-FORM/IOB-WIN-FORM.csproj @@ -8,11 +8,12 @@ Library IOB_WIN_FORM IOB-WIN-FORM - v4.6.2 + v4.7.2 512 true + true @@ -35,8 +36,8 @@ ..\packages\EgwProxy.Ftp.3.6.2410.816\lib\EgwProxy.Ftp.dll - - ..\packages\FluentFTP.52.1.0\lib\net462\FluentFTP.dll + + ..\packages\FluentFTP.53.0.2\lib\net472\FluentFTP.dll ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll @@ -44,8 +45,8 @@ ..\packages\MathNet.Numerics.5.0.0\lib\net461\MathNet.Numerics.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -61,8 +62,8 @@ - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -74,32 +75,31 @@ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll - - ..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -112,7 +112,7 @@ - ..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll + ..\packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll @@ -162,4 +162,11 @@ + + + + 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-WIN-FORM/app.config b/IOB-WIN-FORM/app.config index f6d19825..84a081ff 100644 --- a/IOB-WIN-FORM/app.config +++ b/IOB-WIN-FORM/app.config @@ -3,11 +3,6 @@ - - - - - @@ -16,37 +11,33 @@ - - - - - + - + - + - + - + - + - + @@ -62,8 +53,12 @@ - + + + + + - \ No newline at end of file + diff --git a/IOB-WIN-FORM/packages.config b/IOB-WIN-FORM/packages.config index b6fda30e..aa2864e2 100644 --- a/IOB-WIN-FORM/packages.config +++ b/IOB-WIN-FORM/packages.config @@ -1,25 +1,25 @@  - + - + - + - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/IOB-WIN-FTP/App.config b/IOB-WIN-FTP/App.config index 4a931b62..a1742b38 100644 --- a/IOB-WIN-FTP/App.config +++ b/IOB-WIN-FTP/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-KAWASAKI/App.config b/IOB-WIN-KAWASAKI/App.config index 4316a335..aa4db25d 100644 --- a/IOB-WIN-KAWASAKI/App.config +++ b/IOB-WIN-KAWASAKI/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-MBUS/App.config b/IOB-WIN-MBUS/App.config index 0843b901..5e9074c6 100644 --- a/IOB-WIN-MBUS/App.config +++ b/IOB-WIN-MBUS/App.config @@ -109,11 +109,6 @@ - - - - - @@ -162,10 +157,6 @@ - - - - diff --git a/IOB-WIN-MITSUBISHI/App.config b/IOB-WIN-MITSUBISHI/App.config index 4f0cc252..09630cb9 100644 --- a/IOB-WIN-MITSUBISHI/App.config +++ b/IOB-WIN-MITSUBISHI/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-MTC/App.config b/IOB-WIN-MTC/App.config index 57f0ab13..3965c871 100644 --- a/IOB-WIN-MTC/App.config +++ b/IOB-WIN-MTC/App.config @@ -109,11 +109,6 @@ - - - - - @@ -150,10 +145,6 @@ - - - - diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config index 386ce40b..1be2802f 100644 --- a/IOB-WIN-NEXT/App.config +++ b/IOB-WIN-NEXT/App.config @@ -116,10 +116,6 @@ - - - - @@ -204,10 +200,6 @@ - - - - diff --git a/IOB-WIN-OMRON/App.config b/IOB-WIN-OMRON/App.config index 21b8406d..433782c4 100644 --- a/IOB-WIN-OMRON/App.config +++ b/IOB-WIN-OMRON/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-OPC-UA/App.config b/IOB-WIN-OPC-UA/App.config index f84968ff..10ec1135 100644 --- a/IOB-WIN-OPC-UA/App.config +++ b/IOB-WIN-OPC-UA/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-OSAI/App.config b/IOB-WIN-OSAI/App.config index 0cb49721..70defdec 100644 --- a/IOB-WIN-OSAI/App.config +++ b/IOB-WIN-OSAI/App.config @@ -109,10 +109,6 @@ - - - - @@ -149,10 +145,6 @@ - - - - diff --git a/IOB-WIN-PING/App.config b/IOB-WIN-PING/App.config index d655c15a..934a1b99 100644 --- a/IOB-WIN-PING/App.config +++ b/IOB-WIN-PING/App.config @@ -5,7 +5,7 @@
- + @@ -109,21 +109,17 @@ - - - - - + - + - + @@ -131,15 +127,15 @@ - + - + - + @@ -149,13 +145,10 @@ - - - - + - + @@ -171,7 +164,7 @@ - + @@ -187,4 +180,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-PING/IOB-WIN-PING.csproj b/IOB-WIN-PING/IOB-WIN-PING.csproj index e8dbf1f1..3029898e 100644 --- a/IOB-WIN-PING/IOB-WIN-PING.csproj +++ b/IOB-WIN-PING/IOB-WIN-PING.csproj @@ -8,12 +8,13 @@ WinExe IOB_WIN_PING IOB-WIN-PING - v4.6.2 + v4.7.2 512 true true + x86 @@ -47,8 +48,8 @@ ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -63,14 +64,14 @@ ..\packages\NLog.5.3.4\lib\net46\NLog.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll - - ..\packages\StackExchange.Redis.2.10.1\lib\net461\StackExchange.Redis.dll + + ..\packages\StackExchange.Redis.1.2.6\lib\net46\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -79,31 +80,35 @@ ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -111,7 +116,6 @@ - @@ -250,13 +254,6 @@ - - - - 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}. - - - @@ -267,4 +264,11 @@ + + + + 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-WIN-PING/Properties/Resources.Designer.cs b/IOB-WIN-PING/Properties/Resources.Designer.cs index 1b872ccf..627e2e28 100644 --- a/IOB-WIN-PING/Properties/Resources.Designer.cs +++ b/IOB-WIN-PING/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SHELLY.Properties -{ - - +namespace IOB_WIN_PING.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_SHELLY.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_SHELLY.Properties.Resources", typeof(Resources).Assembly); + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_PING.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-PING/Properties/Settings.Designer.cs b/IOB-WIN-PING/Properties/Settings.Designer.cs index ee9726a4..a7a7558c 100644 --- a/IOB-WIN-PING/Properties/Settings.Designer.cs +++ b/IOB-WIN-PING/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SHELLY.Properties -{ - - +namespace IOB_WIN_PING.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-PING/packages.config b/IOB-WIN-PING/packages.config index 9bbc8648..e165f84a 100644 --- a/IOB-WIN-PING/packages.config +++ b/IOB-WIN-PING/packages.config @@ -1,23 +1,23 @@  - + - + - - - + + + - + - - - - + + + + - + \ No newline at end of file diff --git a/IOB-WIN-SHELLY/App.config b/IOB-WIN-SHELLY/App.config index 58cdb670..8b5d3977 100644 --- a/IOB-WIN-SHELLY/App.config +++ b/IOB-WIN-SHELLY/App.config @@ -1,183 +1,175 @@ - + -
+
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - + + - + - + - \ No newline at end of file + diff --git a/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj b/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj index f0b9e4a1..e9d23620 100644 --- a/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj +++ b/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj @@ -8,12 +8,13 @@ WinExe IOB_WIN_SHELLY IOB-WIN-SHELLY - v4.6.2 + v4.7.2 512 true true + x86 @@ -162,6 +163,7 @@ True Resources.resx + True App.config diff --git a/IOB-WIN-SHELLY/Properties/Resources.Designer.cs b/IOB-WIN-SHELLY/Properties/Resources.Designer.cs index 1b872ccf..f5cc2302 100644 --- a/IOB-WIN-SHELLY/Properties/Resources.Designer.cs +++ b/IOB-WIN-SHELLY/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SHELLY.Properties -{ - - +namespace IOB_WIN_SHELLY.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_SHELLY.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_SHELLY.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-SHELLY/Properties/Settings.Designer.cs b/IOB-WIN-SHELLY/Properties/Settings.Designer.cs index ee9726a4..4ef158f2 100644 --- a/IOB-WIN-SHELLY/Properties/Settings.Designer.cs +++ b/IOB-WIN-SHELLY/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SHELLY.Properties -{ - - +namespace IOB_WIN_SHELLY.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-SHELLY/packages.config b/IOB-WIN-SHELLY/packages.config index 5ef71d9f..0686726b 100644 --- a/IOB-WIN-SHELLY/packages.config +++ b/IOB-WIN-SHELLY/packages.config @@ -1,17 +1,17 @@  - + - + - - + + @@ -26,6 +26,6 @@ - - + + \ No newline at end of file diff --git a/IOB-WIN-SIEMENS/App.config b/IOB-WIN-SIEMENS/App.config index aa336006..37807fae 100644 --- a/IOB-WIN-SIEMENS/App.config +++ b/IOB-WIN-SIEMENS/App.config @@ -150,10 +150,6 @@ - - - - diff --git a/IOB-WIN-SQL/App.config b/IOB-WIN-SQL/App.config index d0fabe7a..44a6229a 100644 --- a/IOB-WIN-SQL/App.config +++ b/IOB-WIN-SQL/App.config @@ -123,10 +123,6 @@ - - - - @@ -155,10 +151,6 @@ - - - - diff --git a/IOB-WIN-WPS/App.config b/IOB-WIN-WPS/App.config index 7986e509..a567fe9a 100644 --- a/IOB-WIN-WPS/App.config +++ b/IOB-WIN-WPS/App.config @@ -157,18 +157,10 @@ - - - - - - - - diff --git a/IOB-WIN-WS/App.config b/IOB-WIN-WS/App.config index 9b649643..c34e9ab5 100644 --- a/IOB-WIN-WS/App.config +++ b/IOB-WIN-WS/App.config @@ -129,10 +129,6 @@ - - - - @@ -153,10 +149,6 @@ - - - - From 29eb2ad114821f5d1ee827c36704c1c46741a064 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 7 Jan 2026 17:17:01 +0100 Subject: [PATCH 3/4] Fix versione proj + chiamate sync/async --- IOB-WIN-FORM/Iob/Generic.Protected.cs | 16 +- IOB-WIN-FORM/Iob/Generic.Public.cs | 19 +- IOB-WIN-FORM/Iob/Simula.cs | 2 +- IOB-WIN-WPS/App.config | 230 ++++++++++---------- IOB-WIN-WPS/IOB-WIN-WPS.csproj | 3 +- IOB-WIN-WPS/Properties/Settings.Designer.cs | 2 +- IOB-WIN-WPS/packages.config | 4 +- 7 files changed, 149 insertions(+), 127 deletions(-) diff --git a/IOB-WIN-FORM/Iob/Generic.Protected.cs b/IOB-WIN-FORM/Iob/Generic.Protected.cs index 90f902be..6501f14b 100644 --- a/IOB-WIN-FORM/Iob/Generic.Protected.cs +++ b/IOB-WIN-FORM/Iob/Generic.Protected.cs @@ -3100,7 +3100,7 @@ namespace IOB_WIN_FORM.Iob /// /// /// - protected async Task remTask2exe(string taskName, string esitoTask, string codTav) + protected string remTask2exe(string taskName, string esitoTask, string codTav) { string answ = ""; bool srvAlive = CheckServerAlive(); @@ -3111,11 +3111,21 @@ namespace IOB_WIN_FORM.Iob { url2call = $"{urlRemTask2ExeTav(codTav)}{taskName}"; } - answ = await utils.callUrlAsync(url2call); + + try + { + Task.Run(async () => answ = await utils.callUrlAsync(url2call)) + .GetAwaiter() + .GetResult(); + lgInfo($"Task2Exe.remTask2exe | {esitoTask} | chiamata URL {url2call} | answ: {answ}"); + } + catch (Exception ex) + { + lgError("ProcessAutoOdl | Crash nel ponte Sync/Async: " + ex.Message); + } #if false answ = utils.callUrlNow(url2call); #endif - lgInfo($"Task2Exe.remTask2exe | {esitoTask} | chiamata URL {url2call} | answ: {answ}"); } return answ; } diff --git a/IOB-WIN-FORM/Iob/Generic.Public.cs b/IOB-WIN-FORM/Iob/Generic.Public.cs index 44ce202c..180b389e 100644 --- a/IOB-WIN-FORM/Iob/Generic.Public.cs +++ b/IOB-WIN-FORM/Iob/Generic.Public.cs @@ -844,7 +844,7 @@ namespace IOB_WIN_FORM.Iob /// /// Elenco task da eseguire /// Codice TAV (per macchine multi pallet) - opzionale - public virtual async Task> executeTasks(Dictionary task2exe, string codTav) + public virtual Dictionary executeTasks(Dictionary task2exe, string codTav) { string logMsg = $"Generic: call executeTasks | {task2exe.Count} task"; if (!string.IsNullOrEmpty(codTav)) @@ -1082,8 +1082,19 @@ namespace IOB_WIN_FORM.Iob break; case taskType.processOtherInfo: - bool okProc = await processOtherInfo(iKey, item.Value); - taskVal = okProc ? $"OK processOtherInfo | {iKey} | {item.Value}" : $"ERROR processOtherInfo | {iKey} | {item.Value}"; + bool okProc = false; + try + { + Task.Run(async () => okProc = await processOtherInfo(iKey, item.Value)) + .GetAwaiter() + .GetResult(); + taskVal = okProc ? $"OK processOtherInfo | {iKey} | {item.Value}" : $"ERROR processOtherInfo | {iKey} | {item.Value}"; + } + catch (Exception ex) + { + lgError("processOtherInfo | Crash nel ponte Sync/Async: " + ex.Message); + } + break; default: @@ -2643,7 +2654,7 @@ namespace IOB_WIN_FORM.Iob } } // chiamo procedura esecutiva (diversa x ogni IOB) - taskDone = await executeTasks(task2exe, codTav); + taskDone = executeTasks(task2exe, codTav); lgInfo($"Task2Exe S02: eseguiti {taskDone.Count} task"); // loggo tutti i task done... foreach (var item in taskDone) diff --git a/IOB-WIN-FORM/Iob/Simula.cs b/IOB-WIN-FORM/Iob/Simula.cs index 0ccbefdb..a307d915 100644 --- a/IOB-WIN-FORM/Iob/Simula.cs +++ b/IOB-WIN-FORM/Iob/Simula.cs @@ -152,7 +152,7 @@ namespace IOB_WIN_FORM.Iob /// Processo i task richiesti e li elimino dalla coda 1:1 (in realtà SOLO forceSetPzCount x ora) /// /// - public override async Task> executeTasks(Dictionary task2exe, string codTav) + public override Dictionary executeTasks(Dictionary task2exe, string codTav) { // Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti... Dictionary taskDone = new Dictionary(); diff --git a/IOB-WIN-WPS/App.config b/IOB-WIN-WPS/App.config index a567fe9a..e8928bd6 100644 --- a/IOB-WIN-WPS/App.config +++ b/IOB-WIN-WPS/App.config @@ -1,182 +1,182 @@ - + -
+
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - \ No newline at end of file + diff --git a/IOB-WIN-WPS/IOB-WIN-WPS.csproj b/IOB-WIN-WPS/IOB-WIN-WPS.csproj index cf0770aa..219ca782 100644 --- a/IOB-WIN-WPS/IOB-WIN-WPS.csproj +++ b/IOB-WIN-WPS/IOB-WIN-WPS.csproj @@ -8,12 +8,13 @@ WinExe IOB_WIN_WPS IOB-WIN-WPS - v4.6.2 + v4.7.2 512 true true + x86 diff --git a/IOB-WIN-WPS/Properties/Settings.Designer.cs b/IOB-WIN-WPS/Properties/Settings.Designer.cs index 799d2bdd..d6340c10 100644 --- a/IOB-WIN-WPS/Properties/Settings.Designer.cs +++ b/IOB-WIN-WPS/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace IOB_WIN_WPS.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.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-WPS/packages.config b/IOB-WIN-WPS/packages.config index e04b3de2..bfa69aa0 100644 --- a/IOB-WIN-WPS/packages.config +++ b/IOB-WIN-WPS/packages.config @@ -3,7 +3,7 @@ - + @@ -19,5 +19,5 @@ - + \ No newline at end of file From c82d64974e8a166b1884995996466723b1d9fa29 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 7 Jan 2026 17:58:45 +0100 Subject: [PATCH 4/4] Continua consolidamento nuget, async, ... --- IOB-UT-NEXT/IOB-UT-NEXT.csproj | 4 +- IOB-UT-NEXT/packages.config | 10 +- IOB-WIN-FORM/AdapterForm.cs | 33 ++- IOB-WIN-FORM/Iob/Generic.Protected.cs | 68 ++++-- IOB-WIN-FORM/Iob/Generic.Public.cs | 38 +-- IOB-WIN-MTC/App.config | 26 ++- IOB-WIN-MTC/DATA/CONF/MAIN.ini | 4 +- IOB-WIN-MTC/IOB-WIN-MTC.csproj | 104 +++++---- IOB-WIN-MTC/Properties/Resources.Designer.cs | 44 ++-- IOB-WIN-MTC/Properties/Settings.Designer.cs | 22 +- IOB-WIN-MTC/packages.config | 117 +++++----- IOB-WIN-SHELLY/App.config | 228 +++++++++--------- IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj | 55 ++--- IOB-WIN-SHELLY/Iob/ShellyClientGen1.cs | 2 - IOB-WIN-SHELLY/Iob/ShellyClientGen2.cs | 2 - IOB-WIN-SHELLY/packages.config | 30 +-- IOB-WIN-WPS/App.config | 232 ++++++++++--------- IOB-WIN-WPS/IOB-WIN-WPS.csproj | 47 ++-- IOB-WIN-WPS/IobNet/WebPageScrap.cs | 5 +- IOB-WIN-WPS/packages.config | 22 +- 20 files changed, 588 insertions(+), 505 deletions(-) diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj index 50527fa0..b68ff273 100644 --- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj +++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj @@ -86,8 +86,8 @@ ..\packages\RestSharp.113.0.0\lib\net471\RestSharp.dll - - ..\packages\StackExchange.Redis.1.2.6\lib\net46\StackExchange.Redis.dll + + ..\packages\StackExchange.Redis.2.8.24\lib\net472\StackExchange.Redis.dll diff --git a/IOB-UT-NEXT/packages.config b/IOB-UT-NEXT/packages.config index 527346b8..aadc7a62 100644 --- a/IOB-UT-NEXT/packages.config +++ b/IOB-UT-NEXT/packages.config @@ -2,16 +2,16 @@ - - + + - + - + @@ -22,7 +22,7 @@ - + diff --git a/IOB-WIN-FORM/AdapterForm.cs b/IOB-WIN-FORM/AdapterForm.cs index d51b9c2f..90a8262d 100644 --- a/IOB-WIN-FORM/AdapterForm.cs +++ b/IOB-WIN-FORM/AdapterForm.cs @@ -1386,7 +1386,7 @@ namespace IOB_WIN_FORM forcedTask.Add(cmbParamValues.SelectedValue.ToString(), txtValue.Text); } // chiedo esecuzione task! forzato SENZA tavola - _ = iobObj.processTask(forcedTask, ""); + iobObj.ProcessTask(forcedTask, ""); chkEdit.Checked = false; toggleEditMes2Plc(); } @@ -1620,16 +1620,31 @@ namespace IOB_WIN_FORM { try { - iobObj.stopAdapter(tryRestart, forceDequeue); - stop.Enabled = false; - start.Enabled = true; - restart.Enabled = false; - _isSuspended = true; - if (stopTimer) + try { - gather.Enabled = false; - _ = StopWorker(); + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + await iobObj.stopAdapter(tryRestart, forceDequeue); + stop.Enabled = false; + start.Enabled = true; + restart.Enabled = false; + _isSuspended = true; + if (stopTimer) + { + gather.Enabled = false; + await StopWorker(); + } + }) + .GetAwaiter() + .GetResult(); } + catch (Exception ex) + { + lgError($"Errore in fermaTutto |stopTimer: {stopTimer} | tryRestart: {tryRestart} | forceDequeue: {forceDequeue} | updateForm: {updateForm}{Environment.NewLine}{ex.Message}"); + } + + newDisplayData currDispData = new newDisplayData(); currDispData.semIn = Semaforo.SS; diff --git a/IOB-WIN-FORM/Iob/Generic.Protected.cs b/IOB-WIN-FORM/Iob/Generic.Protected.cs index 6501f14b..838a6fad 100644 --- a/IOB-WIN-FORM/Iob/Generic.Protected.cs +++ b/IOB-WIN-FORM/Iob/Generic.Protected.cs @@ -2369,10 +2369,10 @@ namespace IOB_WIN_FORM.Iob } // processo invio: provo forzare send... - answ = await svuotaCodaRawTransf(true); + answ = await SvuotaCodaRawTransfAsync(true); if (!answ) { - errore = $"Errore in fase di invio dati svuotaCodaRawTransf x {fileItem}"; + errore = $"Errore in fase di invio dati SvuotaCodaRawTransfAsync x {fileItem}"; } // archivio il file else @@ -3212,7 +3212,25 @@ namespace IOB_WIN_FORM.Iob /// /// Invia informazioni associazione IOB 2 machine /// - protected async Task SendM2IOB() + protected void SendM2IOB() + { + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => await SendM2IobAsync()) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in SendM2IOB: {ex.Message}"); + } + } + + /// + /// Invia informazioni associazione IOB 2 machine + /// + protected async Task SendM2IobAsync() { bool srvAlive = CheckServerAlive(); if (srvAlive) @@ -3225,6 +3243,24 @@ namespace IOB_WIN_FORM.Iob } } + /// + /// Ponte Async invio MachineConf + /// + protected virtual void SendMachineConf() + { + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => await SendMachineConfAsync()) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in SendMachineConf: {ex.Message}"); + } + } + /// /// Effettua invio al server IO dei dati di IOB + macchina: /// - dati dell'IOB (IdxMacchina, IobName, IobIp, Tipo, counter...) "classici" @@ -3234,7 +3270,7 @@ namespace IOB_WIN_FORM.Iob /// - MachinePort /// - Abilitazione gestione FOLDER di ritorno x SPEC (es x FTP) /// - protected virtual async Task SendMachineConf() + protected virtual async Task SendMachineConfAsync() { // se non espressamente vietato da conf... if (enabSendMachineConf) @@ -4137,19 +4173,19 @@ namespace IOB_WIN_FORM.Iob { currDispData.semOut = Semaforo.SV; // gestione queue SignalIN (invio, display) - svuotaCodaSignIN(); + await svuotaCodaSignInAsync(); currDispData.counter = contapezziIOB; raiseRefresh(currDispData); // provo a svuotare coda contapezzi - await svuotaCodaContapezzi(); + await SvuotaCodaContapezziAsync(); currDispData.counter = contapezziIOB; raiseRefresh(currDispData); // gestione queue FluxLog (invio, display) - await svuotaCodaFLog(); + await SvuotaCodaFLogAsync(); // coda RawTransf - await svuotaCodaRawTransf(); + await SvuotaCodaRawTransfAsync(); // coda UserLog - svuotaCodaULog(); + await SvuotaCodaULogAsync(); // refresh raiseRefresh(currDispData); // se arrivo è tutto ok... @@ -5595,7 +5631,7 @@ namespace IOB_WIN_FORM.Iob disableOdl = IOBConfFull.Odl.DisableOdl; } - private async Task svuotaCodaContapezzi() + private async Task SvuotaCodaContapezziAsync() { // permetto al max 2 tentativi infruttuosi... int maxTry = 2; @@ -5610,7 +5646,7 @@ namespace IOB_WIN_FORM.Iob // se ho contapezzi OLTRE limite... while ((MPOnline) && (contapezziPLC > contapezziIOB + minSendPzCountBlock)) { - lgInfo($"Ciclo svuotaCodaContapezzi --> contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}"); + lgInfo($"Ciclo SvuotaCodaContapezziAsync --> contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}"); if (!isMulti) { pzCntReload(true); @@ -5644,7 +5680,7 @@ namespace IOB_WIN_FORM.Iob /// /// Processo la coda FLog... /// - private async Task svuotaCodaFLog() + private async Task SvuotaCodaFLogAsync() { bool sendOnMachineOff = false; // controllo se è passato oltre watchdog e non ho inviato nulla --> RE-INVIO (ultimo inviato)!!!! @@ -5737,7 +5773,7 @@ namespace IOB_WIN_FORM.Iob /// /// Processo la coda RawTransf... /// - private async Task svuotaCodaRawTransf(bool force = false) + private async Task SvuotaCodaRawTransfAsync(bool force = false) { bool fatto = false; // verifico SE la coda abbia dei valori... @@ -5801,7 +5837,7 @@ namespace IOB_WIN_FORM.Iob /// /// Processo la coda UserLog... /// - private void svuotaCodaULog() + private async Task SvuotaCodaULogAsync() { // verifico SE la coda abbia dei valori... if (QueueULog.Count > 0) @@ -5827,14 +5863,14 @@ namespace IOB_WIN_FORM.Iob QueueULog.TryDequeue(out currVal); listaValori.Add(currVal); } - sendDataBlock(urlType.ULog, listaValori); + await sendDataBlock(urlType.ULog, listaValori); } else { // invio in blocco listaValori = QueueULog.ToList(); // invio - sendDataBlock(urlType.ULog, listaValori); + await sendDataBlock(urlType.ULog, listaValori); // svuoto! QueueULog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueULog", false, redisMan); } diff --git a/IOB-WIN-FORM/Iob/Generic.Public.cs b/IOB-WIN-FORM/Iob/Generic.Public.cs index 180b389e..b7e7da1e 100644 --- a/IOB-WIN-FORM/Iob/Generic.Public.cs +++ b/IOB-WIN-FORM/Iob/Generic.Public.cs @@ -1435,9 +1435,9 @@ namespace IOB_WIN_FORM.Iob pzCntReload(true); } // refresh associazione Macchina - IOB - await SendM2IOB(); + await SendM2IobAsync(); // invio altri dati accessori... - await SendMachineConf(); + await SendMachineConfAsync(); } // recupero dati SETUP (sysinfo) e li invio/mostro se variati... processSysInfo(); @@ -2595,14 +2595,14 @@ namespace IOB_WIN_FORM.Iob { // recupero elenco delle cose da fare string resp = await getTask2exe(""); - await processResp(resp, ""); + ProcessResp(resp, ""); // se fosse multi --> eseguo task per le varie sub (Tavole/Pallet) if (isMulti) { foreach (var item in IOBConfFull.Device.MultiIobList) { resp = await getTask2exe(item); - await processResp(resp, item); + ProcessResp(resp, item); } } } @@ -2613,7 +2613,7 @@ namespace IOB_WIN_FORM.Iob /// /// /// - public async Task> processTask(Dictionary task2exe, string codTav) + public Dictionary ProcessTask(Dictionary task2exe, string codTav) { Dictionary taskDone = new Dictionary(); Dictionary task2Add = new Dictionary(); @@ -3448,7 +3448,7 @@ namespace IOB_WIN_FORM.Iob /// in automatico) /// /// indica se sia richiesto di SVUOTARE le code delle info - public virtual void stopAdapter(bool tryRestart, bool forceDequeue) + public virtual async Task stopAdapter(bool tryRestart, bool forceDequeue) { // controllo che non ci sia redis queue altrimenti NON forza svuotamento... if (forceDequeue && !IOBConfFull.General.EnabRedisQue) @@ -3460,7 +3460,7 @@ namespace IOB_WIN_FORM.Iob // INVIO COMUNQUE...!!! string valore = ""; QueueIN.TryDequeue(out valore); - sendToMoonPro(urlType.SignIN, valore); + await sendToMoonPro(urlType.SignIN, valore); } parentForm.displayTaskAndLog("[CLOSING] Svuotamento FORZATO coda FluxLOG...", true); // se ho + di 2 elementi in coda --> uso invio JSON in blocco... @@ -3479,14 +3479,14 @@ namespace IOB_WIN_FORM.Iob QueueFLog.TryDequeue(out currVal); listaValori.Add(currVal); } - sendDataBlock(urlType.FLog, listaValori); + await sendDataBlock(urlType.FLog, listaValori); } else { // invio in blocco listaValori = QueueFLog.ToList(); // invio - sendDataBlock(urlType.FLog, listaValori); + await sendDataBlock(urlType.FLog, listaValori); // svuoto! NO REDIS QueueFLog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueFLog", false, redisMan); //QueueFLog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue, redisMan); @@ -3501,7 +3501,7 @@ namespace IOB_WIN_FORM.Iob { // INVIO COMUNQUE...!!! QueueFLog.TryDequeue(out currVal); - sendToMoonPro(urlType.FLog, currVal); + await sendToMoonPro(urlType.FLog, currVal); } } @@ -3519,14 +3519,14 @@ namespace IOB_WIN_FORM.Iob QueueULog.TryDequeue(out currVal); listaValori.Add(currVal); } - sendDataBlock(urlType.ULog, listaValori); + await sendDataBlock(urlType.ULog, listaValori); } else { // invio in blocco listaValori = QueueULog.ToList(); // invio - sendDataBlock(urlType.ULog, listaValori); + await sendDataBlock(urlType.ULog, listaValori); // svuoto! QueueULog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueULog", false, redisMan); } @@ -3553,7 +3553,7 @@ namespace IOB_WIN_FORM.Iob /// /// Processo la coda SignalIN... /// - public void svuotaCodaSignIN() + public async Task svuotaCodaSignInAsync() { // verifico SE la coda abbia dei valori... if (QueueIN.Count > 0) @@ -3582,14 +3582,14 @@ namespace IOB_WIN_FORM.Iob QueueIN.TryDequeue(out currVal); listaValori.Add(currVal); } - sendDataBlock(urlType.SignIN, listaValori); + await sendDataBlock(urlType.SignIN, listaValori); } else { // invio in blocco listaValori = QueueIN.ToList(); // invio - sendDataBlock(urlType.SignIN, listaValori); + await sendDataBlock(urlType.SignIN, listaValori); // svuoto! QueueIN = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueIN", IOBConfFull.General.EnabRedisQue, redisMan); } @@ -3598,7 +3598,7 @@ namespace IOB_WIN_FORM.Iob { // INVIO SINGOLO...!!! QueueIN.TryDequeue(out currVal); - sendToMoonPro(urlType.SignIN, currVal); + await sendToMoonPro(urlType.SignIN, currVal); } // salvo come last signal in il currVal ultimo... SE !="" if (!string.IsNullOrEmpty(currVal)) @@ -3818,7 +3818,7 @@ namespace IOB_WIN_FORM.Iob /// /// Risposta come string RAW /// Cod Tav (opzionale) - private async Task processResp(string resp, string codTav) + private void ProcessResp(string resp, string codTav) { Dictionary task2exe = new Dictionary(); Dictionary taskDone = new Dictionary(); @@ -3830,12 +3830,12 @@ namespace IOB_WIN_FORM.Iob // se ho da fare chiamo esecuzione.. if (task2exe.Count > 0) { - taskDone = await processTask(task2exe, codTav); + taskDone = ProcessTask(task2exe, codTav); } } catch (Exception exc) { - lgError($"Eccezione in processServerRequests.processResp:{Environment.NewLine}{exc}"); + lgError($"Eccezione in processServerRequests.ProcessResp:{Environment.NewLine}{exc}"); } } } diff --git a/IOB-WIN-MTC/App.config b/IOB-WIN-MTC/App.config index 3965c871..32648294 100644 --- a/IOB-WIN-MTC/App.config +++ b/IOB-WIN-MTC/App.config @@ -5,7 +5,7 @@
- + @@ -111,15 +111,15 @@ - + - + - + @@ -127,15 +127,15 @@ - + - + - + @@ -147,11 +147,11 @@ - + - + @@ -167,12 +167,16 @@ - + + + + + @@ -187,4 +191,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-MTC/DATA/CONF/MAIN.ini b/IOB-WIN-MTC/DATA/CONF/MAIN.ini index 93859fea..68924ab3 100644 --- a/IOB-WIN-MTC/DATA/CONF/MAIN.ini +++ b/IOB-WIN-MTC/DATA/CONF/MAIN.ini @@ -17,9 +17,9 @@ CLI_INST=SteamWareSim ;STARTLIST=SIMUL_01,SIMUL_02,SIMUL_03,SIMUL_04 ;STARTLIST=IMI_50 ;STARTLIST=GT593 -STARTLIST=3024 +;STARTLIST=3024 ;STARTLIST=TEST -;STARTLIST=SIMUL_01 +STARTLIST=SIMUL_01 ;NB: mettere copy always ai file di conf x fare test... ;STARTLIST=3024 diff --git a/IOB-WIN-MTC/IOB-WIN-MTC.csproj b/IOB-WIN-MTC/IOB-WIN-MTC.csproj index 0088c5f6..eac3b2e1 100644 --- a/IOB-WIN-MTC/IOB-WIN-MTC.csproj +++ b/IOB-WIN-MTC/IOB-WIN-MTC.csproj @@ -8,12 +8,13 @@ WinExe IOB_WIN_MTC IOB-WIN-MTC - v4.6.2 + v4.7.2 512 true true + AnyCPU @@ -44,11 +45,11 @@ prompt - - ..\packages\MapoSDK.6.14.2505.2916\lib\MapoSDK.dll + + ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.Configuration.7.0.0\lib\net462\Microsoft.Extensions.Configuration.dll @@ -132,31 +133,31 @@ ..\packages\MQTTnet.Extensions.ManagedClient.4.3.3.952\lib\net461\MQTTnet.Extensions.ManagedClient.dll - ..\packages\MTConnect.NET.6.5.1\lib\net462\MTConnect.NET.dll + ..\packages\MTConnect.NET.6.5.1\lib\net472\MTConnect.NET.dll - ..\packages\MTConnect.NET-Common.6.5.1\lib\net462\MTConnect.NET-Common.dll + ..\packages\MTConnect.NET-Common.6.5.1\lib\net472\MTConnect.NET-Common.dll - ..\packages\MTConnect.NET-HTTP.6.5.1\lib\net462\MTConnect.NET-HTTP.dll + ..\packages\MTConnect.NET-HTTP.6.5.1\lib\net472\MTConnect.NET-HTTP.dll - ..\packages\MTConnect.NET-JSON.6.5.1\lib\net462\MTConnect.NET-JSON.dll + ..\packages\MTConnect.NET-JSON.6.5.1\lib\net472\MTConnect.NET-JSON.dll - ..\packages\MTConnect.NET-JSON-cppagent.6.5.1\lib\net462\MTConnect.NET-JSON-cppagent.dll + ..\packages\MTConnect.NET-JSON-cppagent.6.5.1\lib\net472\MTConnect.NET-JSON-cppagent.dll - ..\packages\MTConnect.NET-MQTT.6.5.1\lib\net462\MTConnect.NET-MQTT.dll + ..\packages\MTConnect.NET-MQTT.6.5.1\lib\net472\MTConnect.NET-MQTT.dll - ..\packages\MTConnect.NET-SHDR.6.5.1\lib\net462\MTConnect.NET-SHDR.dll + ..\packages\MTConnect.NET-SHDR.6.5.1\lib\net472\MTConnect.NET-SHDR.dll - ..\packages\MTConnect.NET-TLS.6.5.1\lib\net462\MTConnect.NET-TLS.dll + ..\packages\MTConnect.NET-TLS.6.5.1\lib\net472\MTConnect.NET-TLS.dll - ..\packages\MTConnect.NET-XML.6.5.1\lib\net462\MTConnect.NET-XML.dll + ..\packages\MTConnect.NET-XML.6.5.1\lib\net472\MTConnect.NET-XML.dll ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -165,61 +166,82 @@ ..\packages\NLog.5.3.4\lib\net46\NLog.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll - ..\packages\StackExchange.Redis.2.8.24\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.8.24\lib\net472\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll + ..\packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll + + ..\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.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True - - ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\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.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -233,7 +255,7 @@ - ..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll + ..\packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll @@ -369,11 +391,11 @@ - 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}. + @@ -386,4 +408,6 @@ + + \ No newline at end of file diff --git a/IOB-WIN-MTC/Properties/Resources.Designer.cs b/IOB-WIN-MTC/Properties/Resources.Designer.cs index 0f013ea4..704cdd7c 100644 --- a/IOB-WIN-MTC/Properties/Resources.Designer.cs +++ b/IOB-WIN-MTC/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_MTC.Properties -{ - - +namespace IOB_WIN_MTC.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_MTC.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_MTC.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-MTC/Properties/Settings.Designer.cs b/IOB-WIN-MTC/Properties/Settings.Designer.cs index 894a7528..e643a06f 100644 --- a/IOB-WIN-MTC/Properties/Settings.Designer.cs +++ b/IOB-WIN-MTC/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_MTC.Properties -{ - - +namespace IOB_WIN_MTC.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-MTC/packages.config b/IOB-WIN-MTC/packages.config index 2fd85b82..9e53c636 100644 --- a/IOB-WIN-MTC/packages.config +++ b/IOB-WIN-MTC/packages.config @@ -1,62 +1,65 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IOB-WIN-SHELLY/App.config b/IOB-WIN-SHELLY/App.config index 8b5d3977..f34bceae 100644 --- a/IOB-WIN-SHELLY/App.config +++ b/IOB-WIN-SHELLY/App.config @@ -1,174 +1,182 @@ - + -
+
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + - + - + diff --git a/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj b/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj index e9d23620..55b00584 100644 --- a/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj +++ b/IOB-WIN-SHELLY/IOB-WIN-SHELLY.csproj @@ -49,7 +49,7 @@ ..\packages\EgwProxy.Shelly.3.7.2509.219\lib\EgwProxy.Shelly.dll - ..\packages\Flurl.4.0.0\lib\net461\Flurl.dll + ..\packages\Flurl.4.0.0\lib\net472\Flurl.dll ..\packages\Flurl.Http.4.0.2\lib\net461\Flurl.Http.dll @@ -57,8 +57,8 @@ ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -70,14 +70,14 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll - ..\packages\StackExchange.Redis.2.10.1\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.6.111\lib\net472\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -86,39 +86,39 @@ ..\packages\System.Diagnostics.PerformanceCounter.9.0.0\lib\net462\System.Diagnostics.PerformanceCounter.dll + ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - - ..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -130,7 +130,7 @@ - ..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll + ..\packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll @@ -275,11 +275,12 @@ - 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}. + + @@ -291,4 +292,6 @@ + + \ No newline at end of file diff --git a/IOB-WIN-SHELLY/Iob/ShellyClientGen1.cs b/IOB-WIN-SHELLY/Iob/ShellyClientGen1.cs index 1041b30f..426d037c 100644 --- a/IOB-WIN-SHELLY/Iob/ShellyClientGen1.cs +++ b/IOB-WIN-SHELLY/Iob/ShellyClientGen1.cs @@ -227,8 +227,6 @@ namespace IOB_WIN_SHELLY.Iob #region Private Fields - private static Stopwatch sw = new Stopwatch(); - /// /// Oggetto dove viene salvata ultima risposta shelly /// diff --git a/IOB-WIN-SHELLY/Iob/ShellyClientGen2.cs b/IOB-WIN-SHELLY/Iob/ShellyClientGen2.cs index 9149975c..8e0ae611 100644 --- a/IOB-WIN-SHELLY/Iob/ShellyClientGen2.cs +++ b/IOB-WIN-SHELLY/Iob/ShellyClientGen2.cs @@ -302,8 +302,6 @@ namespace IOB_WIN_SHELLY.Iob #region Private Fields - private static Stopwatch sw = new Stopwatch(); - /// /// Oggetto dove viene salvata ultima risposta Shelly x dati RT (potenza, correnti, ...) /// diff --git a/IOB-WIN-SHELLY/packages.config b/IOB-WIN-SHELLY/packages.config index 0686726b..c862d044 100644 --- a/IOB-WIN-SHELLY/packages.config +++ b/IOB-WIN-SHELLY/packages.config @@ -1,31 +1,31 @@  - + - + - + - - - + + + - - - - + + + + - - + + - - - + + + \ No newline at end of file diff --git a/IOB-WIN-WPS/App.config b/IOB-WIN-WPS/App.config index e8928bd6..9234687c 100644 --- a/IOB-WIN-WPS/App.config +++ b/IOB-WIN-WPS/App.config @@ -1,181 +1,185 @@ - + -
+
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + - + - + diff --git a/IOB-WIN-WPS/IOB-WIN-WPS.csproj b/IOB-WIN-WPS/IOB-WIN-WPS.csproj index 219ca782..367f475b 100644 --- a/IOB-WIN-WPS/IOB-WIN-WPS.csproj +++ b/IOB-WIN-WPS/IOB-WIN-WPS.csproj @@ -48,8 +48,8 @@ ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -58,8 +58,8 @@ ..\packages\NLog.5.3.4\lib\net46\NLog.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -67,34 +67,33 @@ - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll - - ..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - @@ -292,15 +291,17 @@ 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}. - + + - + + \ No newline at end of file diff --git a/IOB-WIN-WPS/IobNet/WebPageScrap.cs b/IOB-WIN-WPS/IobNet/WebPageScrap.cs index 1006a70a..84902de4 100644 --- a/IOB-WIN-WPS/IobNet/WebPageScrap.cs +++ b/IOB-WIN-WPS/IobNet/WebPageScrap.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System.IO; using System.Net.NetworkInformation; using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; namespace IOB_WIN_WPS.IobNet @@ -191,7 +192,7 @@ namespace IOB_WIN_WPS.IobNet /// /// /// - public override void stopAdapter(bool tryRestart, bool forceDequeue) + public override async Task stopAdapter(bool tryRestart, bool forceDequeue) { try { @@ -211,7 +212,7 @@ namespace IOB_WIN_WPS.IobNet } // continuo - base.stopAdapter(tryRestart, forceDequeue); + await base.stopAdapter(tryRestart, forceDequeue); } /// diff --git a/IOB-WIN-WPS/packages.config b/IOB-WIN-WPS/packages.config index bfa69aa0..7ae19022 100644 --- a/IOB-WIN-WPS/packages.config +++ b/IOB-WIN-WPS/packages.config @@ -1,23 +1,23 @@  - + - + - + - - - - - - - - + + + + + + + + \ No newline at end of file