diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index 25fb5bbf..a5ef2592 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -1,8 +1,6 @@ using EgwProxy.Ftp; -using EgwProxy.MultiCncLib.OPENcontrol; using IOB_UT_NEXT; using MapoSDK; -using MathNet.Numerics; using MathNet.Numerics.Statistics; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -510,6 +508,26 @@ namespace IOB_WIN_NEXT.Iob } } + /// + /// URL per creazione di un PODL da cod art (metodo GET)... + /// + public string urlCreatePOdl + { + get + { + string answ = ""; + try + { + answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/forceCreatePOdl/{cIobConf.codIOB}?"; + } + catch (Exception exc) + { + lgError(exc, "Errore in composizione urlStartPODL"); + } + return answ; + } + } + /// /// URL per chiamata generazione Snapshot Dossier giornalieri alla data /// @@ -859,28 +877,6 @@ namespace IOB_WIN_NEXT.Iob return answ; } } - /// - /// URL per creazione di un PODL da cod art (metodo GET)... - /// - public string urlCreatePOdl - { - get - { - string answ = ""; - try - { - answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/forceCreatePOdl/{cIobConf.codIOB}?"; - } - catch (Exception exc) - { - lgError(exc, "Errore in composizione urlStartPODL"); - } - return answ; - } - } - - - /// /// URL per chiusura PODL --> ODL corrente (metodo GET)... @@ -4556,6 +4552,17 @@ namespace IOB_WIN_NEXT.Iob return answ; } + /// + /// Recupera ODL attivo su impianto + /// + protected int CurrOdl() + { + int answ = 0; + string sCurrODL = utils.callUrl(urlGetCurrODL); + int.TryParse(sCurrODL, out answ); + return answ; + } + /// /// Imposta eventuali altri valori default /// @@ -5188,6 +5195,34 @@ namespace IOB_WIN_NEXT.Iob lgInfoStartup("DONE loadMemConf"); } + /// + /// Recupera elenco PODL assegnabili + /// + /// + protected List MachineNextPodl() + { + List reqPOdlList = new List(); + // per prima cosa recupero elenco PODL da gestire.... + var rawListPODL = callUrl(urlGetCurrPODL, false); + if (!string.IsNullOrEmpty(rawListPODL)) + { + try + { + reqPOdlList = JsonConvert.DeserializeObject>(rawListPODL); + } + catch (Exception exc) + { + lg.Error($"Errore: chiamata elenco PODL ha restituito errore{Environment.NewLine}{exc}"); + } + } + else + { + lg.Error($"Errore: chiamata elenco PODL ({urlGetCurrPODL}) ha restituito valore vuoto"); + } + + return reqPOdlList; + } + /// /// Metodo da overridare x scrivere DAVVERO i parametri sul PLC /// NB: deve resettare reqValue @@ -5853,34 +5888,6 @@ namespace IOB_WIN_NEXT.Iob return fatto; } - /// - /// Recupera elenco PODL assegnabili - /// - /// - protected List MachineNextPodl() - { - List reqPOdlList = new List(); - // per prima cosa recupero elenco PODL da gestire.... - var rawListPODL = callUrl(urlGetCurrPODL, false); - if (!string.IsNullOrEmpty(rawListPODL)) - { - try - { - reqPOdlList = JsonConvert.DeserializeObject>(rawListPODL); - } - catch (Exception exc) - { - lg.Error($"Errore: chiamata elenco PODL ha restituito errore{Environment.NewLine}{exc}"); - } - } - else - { - lg.Error($"Errore: chiamata elenco PODL ({urlGetCurrPODL}) ha restituito valore vuoto"); - } - - return reqPOdlList; - } - /// /// Prepara le ricette dato path temp scaricando elenco PODL /// @@ -6031,6 +6038,34 @@ namespace IOB_WIN_NEXT.Iob return answ; } + /// + /// Processa chiusura ODL + /// + /// Idx dell'ODL da chiudere + /// DataOra di riferimento evento stop + protected bool SendCloseOdl(int idxOdl, DateTime dtRif) + { + bool answ = false; + DateTime dtCurr = DateTime.Now; + string resp = callUrl($"{urlODLClose}{idxOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); + answ = resp == "OK"; + return answ; + } + + /// + /// Processa chiusura PODL + /// + /// Idx del PODL da chiudere + /// DataOra di riferimento evento stop + protected bool SendClosePOdl(int idxPOdl, DateTime dtRif) + { + bool answ = false; + DateTime dtCurr = DateTime.Now; + string resp = callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); + answ = resp == "OK"; + return answ; + } + /// /// Invia informazioni associazione IOB 2 machine /// @@ -6069,6 +6104,21 @@ namespace IOB_WIN_NEXT.Iob sendOptVal(paramName, paramValueInt.ToString()); } + /// + /// Processa avvio PODL 8ed eventuale chiusura precedente) + /// + /// Idx del PODL da avviare + /// DataOra di riferimento evento start + protected bool SendStartPodl(int idxPOdl, DateTime dtRif) + { + bool answ = false; + DateTime dtCurr = DateTime.Now; + // chiamata avvio PODL (a posteriori) + string resp = callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); + answ = resp == "OK"; + return answ; + } + /// /// Invia messaggio a logWatcher /// @@ -6461,6 +6511,19 @@ namespace IOB_WIN_NEXT.Iob return fatto; } + /// + /// Processa avvio PODL (ed eventuale chiusura precedente) + /// + /// Cod Articolo del PODL da avviare + /// num pz richiesti + protected int TryCreatePodl(string codArt, int numPz) + { + int answ = 0; + string resp = callUrl($"{urlCreatePOdl}CodArt={codArt}&numPz={numPz}", false); + int.TryParse(resp, out answ); + return answ; + } + /// /// Cerca di inviare su un altro thread i vari dati accumulati... /// @@ -7442,71 +7505,6 @@ namespace IOB_WIN_NEXT.Iob } return answ; } - /// - /// Processa avvio PODL (ed eventuale chiusura precedente) - /// - /// Cod Articolo del PODL da avviare - /// num pz richiesti - protected int TryCreatePodl(string codArt, int numPz) - { - int answ = 0; - string resp = callUrl($"{urlCreatePOdl}CodArt={codArt}&numPz={numPz}", false); - int.TryParse(resp, out answ); - return answ; - } - /// - /// Recupera ODL attivo su impianto - /// - protected int CurrOdl() - { - int answ = 0; - string sCurrODL = utils.callUrl(urlGetCurrODL); - int.TryParse(sCurrODL, out answ); - return answ; - } - /// - /// Processa avvio PODL 8ed eventuale chiusura precedente) - /// - /// Idx del PODL da avviare - /// DataOra di riferimento evento start - protected bool SendStartPodl(int idxPOdl, DateTime dtRif) - { - bool answ = false; - DateTime dtCurr = DateTime.Now; - // chiamata avvio PODL (a posteriori) - string resp = callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); - answ = resp == "OK"; - return answ; - } - - /// - /// Processa chiusura ODL - /// - /// Idx dell'ODL da chiudere - /// DataOra di riferimento evento stop - protected bool SendCloseOdl(int idxOdl, DateTime dtRif) - { - bool answ = false; - DateTime dtCurr = DateTime.Now; - string resp = callUrl($"{urlODLClose}{idxOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); - answ = resp == "OK"; - return answ; - } - /// - /// Processa chiusura PODL - /// - /// Idx del PODL da chiudere - /// DataOra di riferimento evento stop - protected bool SendClosePOdl(int idxPOdl, DateTime dtRif) - { - bool answ = false; - DateTime dtCurr = DateTime.Now; - string resp = callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false); - answ = resp == "OK"; - return answ; - } - - /// /// Elimino record da REDIS (locale e remoto)