diff --git a/MP-ADM/MP-ADM.csproj b/MP-ADM/MP-ADM.csproj index 08f74be5..d7f10050 100644 --- a/MP-ADM/MP-ADM.csproj +++ b/MP-ADM/MP-ADM.csproj @@ -125,11 +125,11 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -538,8 +538,6 @@ - - @@ -562,6 +560,8 @@ + + diff --git a/MP-ADM/packages.config b/MP-ADM/packages.config index e1533057..4f605549 100644 --- a/MP-ADM/packages.config +++ b/MP-ADM/packages.config @@ -46,8 +46,8 @@ - - + + diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs index 1e7d391e..136db6de 100644 --- a/MP-IO/Controllers/IOBController.cs +++ b/MP-IO/Controllers/IOBController.cs @@ -209,7 +209,7 @@ namespace MP_IO.Controllers { DataLayer DataLayerObj = new DataLayer(); // salvo risposta! - answ = DataLayerObj.insEnab(id) ? "OK" : "NO"; + answ = DataLayerObj.insEnab(id) ? "OK" : "NO"; // 2025.03.04 aggiunto keepalive x evitare C101 MapoDb.MapoDb connDb = new MapoDb.MapoDb(); connDb.scriviKeepAlive(id, DateTime.Now); diff --git a/MP-IO/MP-IO.csproj b/MP-IO/MP-IO.csproj index 83299720..d5c59110 100644 --- a/MP-IO/MP-IO.csproj +++ b/MP-IO/MP-IO.csproj @@ -124,11 +124,11 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll diff --git a/MP-IO/Web.config b/MP-IO/Web.config index e2fa62fe..1b48e459 100644 --- a/MP-IO/Web.config +++ b/MP-IO/Web.config @@ -51,9 +51,7 @@ - + diff --git a/MP-IO/packages.config b/MP-IO/packages.config index 23e68126..34b7fcb1 100644 --- a/MP-IO/packages.config +++ b/MP-IO/packages.config @@ -45,8 +45,8 @@ - - + + diff --git a/MP-MAG/MP-MAG.csproj b/MP-MAG/MP-MAG.csproj index bf788915..0fb701c4 100644 --- a/MP-MAG/MP-MAG.csproj +++ b/MP-MAG/MP-MAG.csproj @@ -131,14 +131,14 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll - - ..\packages\SteamWare.Reports.5.3.2311.2908\lib\net462\SteamWare.Reports.dll + + ..\packages\SteamWare.Reports.5.4.2509.1510\lib\net462\SteamWare.Reports.dll @@ -881,8 +881,6 @@ - - @@ -925,6 +923,8 @@ + + diff --git a/MP-MAG/packages.config b/MP-MAG/packages.config index c6627454..442b355a 100644 --- a/MP-MAG/packages.config +++ b/MP-MAG/packages.config @@ -55,9 +55,9 @@ - - - + + + diff --git a/MP-Site/MP-Site.csproj b/MP-Site/MP-Site.csproj index 4280c12b..89f206fc 100644 --- a/MP-Site/MP-Site.csproj +++ b/MP-Site/MP-Site.csproj @@ -121,11 +121,11 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -376,8 +376,6 @@ - - @@ -400,6 +398,8 @@ + + diff --git a/MP-Site/Web.config b/MP-Site/Web.config index bea816ba..f4e13f5a 100644 --- a/MP-Site/Web.config +++ b/MP-Site/Web.config @@ -43,9 +43,7 @@ - + diff --git a/MP-Site/packages.config b/MP-Site/packages.config index 034baf20..370ab0ac 100644 --- a/MP-Site/packages.config +++ b/MP-Site/packages.config @@ -44,8 +44,8 @@ - - + + diff --git a/MP-TAB/MP-TAB.csproj b/MP-TAB/MP-TAB.csproj index 41bc3bf5..1b11065c 100644 --- a/MP-TAB/MP-TAB.csproj +++ b/MP-TAB/MP-TAB.csproj @@ -158,11 +158,11 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -341,8 +341,6 @@ - - @@ -359,6 +357,8 @@ + + typeahead.less diff --git a/MP-TAB/Web.config b/MP-TAB/Web.config index 3af4aeb2..3edb23f1 100644 --- a/MP-TAB/Web.config +++ b/MP-TAB/Web.config @@ -75,9 +75,7 @@ - + diff --git a/MP-TAB/packages.config b/MP-TAB/packages.config index 8d3363f4..07e0d9f7 100644 --- a/MP-TAB/packages.config +++ b/MP-TAB/packages.config @@ -36,8 +36,8 @@ - - + + diff --git a/MagData/MagData.csproj b/MagData/MagData.csproj index 8f47dab0..5a2f5cf1 100644 --- a/MagData/MagData.csproj +++ b/MagData/MagData.csproj @@ -97,14 +97,14 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.IO.5.3.2311.2908\lib\net462\SteamWare.IO.dll + + ..\packages\SteamWare.IO.5.4.2509.1510\lib\net462\SteamWare.IO.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll - - ..\packages\SteamWare.Reports.5.3.2311.2908\lib\net462\SteamWare.Reports.dll + + ..\packages\SteamWare.Reports.5.4.2509.1510\lib\net462\SteamWare.Reports.dll ..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll diff --git a/MagData/packages.config b/MagData/packages.config index 810bd4be..72c0dc44 100644 --- a/MagData/packages.config +++ b/MagData/packages.config @@ -19,9 +19,9 @@ - - - + + + diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index fa1d3ee2..e3245aa0 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -117,6 +117,9 @@ namespace MapoDb // init config.. ListConfig = taConfig.GetData(); + + // altri init + setupConf(); } /// @@ -210,13 +213,13 @@ namespace MapoDb { string answ = ""; Log.Info("Richiesta MSE da REDIS"); - answ = memLayer.ML.getRSV(hMSE); + answ = cMemLayer.getRSV(hMSE); return answ; } set { - int MSE_cacheDuration = memLayer.ML.CRI("MSE_cacheDuration"); - memLayer.ML.setRSV(hMSE, value, MSE_cacheDuration); + int MSE_cacheDuration = cMemLayer.CRI("MSE_cacheDuration"); + cMemLayer.setRSV(hMSE, value, MSE_cacheDuration); } } @@ -229,12 +232,12 @@ namespace MapoDb { string answ = ""; Log.Info("Richiesta rawTransfData da REDIS"); - answ = memLayer.ML.getRSV(redKeyRawTransfData); + answ = cMemLayer.getRSV(redKeyRawTransfData); return answ; } set { - memLayer.ML.setRSV(redKeyRawTransfData, value); + cMemLayer.setRSV(redKeyRawTransfData, value); } } @@ -248,14 +251,14 @@ namespace MapoDb int idx = 0; try { - idx = memLayer.ML.IntSessionObj("MatrOpr"); + idx = cMemLayer.IntSessionObj("MatrOpr"); } catch { } return idx; } set { - memLayer.ML.setSessionVal("MatrOpr", value); + cMemLayer.setSessionVal("MatrOpr", value); } } @@ -488,7 +491,7 @@ namespace MapoDb /// public static string mHash(string dataType) { - return memLayer.ML.redHash(dataType); + return cMemLayer.redHash(dataType); } /// @@ -602,7 +605,7 @@ namespace MapoDb Dictionary currTask = mTaskMacchina(idxMacchina); // rimetto in task da eseguire... currTask[taskKey.ToString()] = savedVal; - answ = memLayer.ML.redSaveHashDict(currHash, currTask); + answ = cMemLayer.redSaveHashDict(currHash, currTask); Log.Info($"re-issued task4machine: idxMacchina: {idxMacchina} | taskKey: {taskKey} | savedVal: {savedVal}"); } } @@ -628,7 +631,7 @@ namespace MapoDb // leggo task attuali... var currVal = mOptParMacchina(idxMacchina); currVal[taskKey] = taskVal; - answ = memLayer.ML.redSaveHashDict(currHash, currVal); + answ = cMemLayer.redSaveHashDict(currHash, currVal); } catch { } return answ; @@ -661,7 +664,7 @@ namespace MapoDb { currTask.Add($"{taskKey}", taskVal); } - answ = memLayer.ML.redSaveHashDict(currHash, currTask); + answ = cMemLayer.redSaveHashDict(currHash, currTask); Log.Info($"Task ADD - idxMacchina: {idxMacchina} | taskKey: {taskKey} | taskVal: {taskVal}"); } catch { } @@ -675,13 +678,13 @@ namespace MapoDb // leggo task SALVATI attuali... savedTask = mSavedTaskMacchina(idxMacchina); savedTask[taskKey.ToString()] = taskVal; - answ = memLayer.ML.redSaveHashDict(currSavedParHash, savedTask); + answ = cMemLayer.redSaveHashDict(currSavedParHash, savedTask); break; case taskType.endProd: // salvo un DICT vuoto x resettare savedTask = new Dictionary(); - answ = memLayer.ML.redSaveHashDict(currSavedParHash, savedTask); + answ = cMemLayer.redSaveHashDict(currSavedParHash, savedTask); break; default: @@ -699,12 +702,12 @@ namespace MapoDb DS_applicazione.AnagraficaStatiDataTable answTab = null; // cerco in cache... string rCall = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("hasAnagStati"); try { - rCall = memLayer.ML.getRSV(currAnagStatiMacc()); + rCall = cMemLayer.getRSV(currAnagStatiMacc()); if (!string.IsNullOrEmpty(rCall)) { answTab = JsonConvert.DeserializeObject(rCall); @@ -717,8 +720,8 @@ namespace MapoDb //resultList = MapoDbObj.taAnagSt.GetData(); // salvo in redis... rCall = JsonConvert.SerializeObject(answTab); - int anagrCacheDur = memLayer.ML.CRI("anagrCacheDur"); - memLayer.ML.setRSV(currAnagStatiMacc(), rCall, anagrCacheDur); + int anagrCacheDur = cMemLayer.CRI("anagrCacheDur"); + cMemLayer.setRSV(currAnagStatiMacc(), rCall, anagrCacheDur); } } catch (Exception exc) @@ -751,11 +754,11 @@ namespace MapoDb DateTime adesso = DateTime.Now; // verifico NON CI SIA un veto a NUOVI split... 2 min di default... string redKey = vetoSplitOdlMaccHash(idxMacchina); - string rawData = memLayer.ML.getRSV(redKey); + string rawData = cMemLayer.getRSV(redKey); if (string.IsNullOrEmpty(rawData)) { // registro VETO x altri split... 5 minuti - memLayer.ML.setRSV(redKey, $"Inizio SPLIT-ODL {adesso}", 300); + cMemLayer.setRSV(redKey, $"Inizio SPLIT-ODL {adesso}", 300); // calcolo la qta da gestire int qtyConf = 0; int qtyNew = 0; @@ -816,23 +819,23 @@ namespace MapoDb if (confRett) { // confermo al netto dei pezzi lasciati... - fatto = confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, qtyScarto, adesso, matrOpr); - if (memLayer.ML.CRB("SlaveConfirmPzProd")) + fatto = confermaProdMacchinaFull(idxMacchinaSel, cMemLayer.CRI("modoConfProd"), qtyConf, 0, qtyScarto, adesso, matrOpr); + if (cMemLayer.CRB("SlaveConfirmPzProd")) { foreach (var machine in slaveList) { - confermaProdMacchinaFull(machine.IdxMacchinaSlave, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, qtyScarto, adesso, matrOpr); + confermaProdMacchinaFull(machine.IdxMacchinaSlave, cMemLayer.CRI("modoConfProd"), qtyConf, 0, qtyScarto, adesso, matrOpr); } } } else { - fatto = confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, qtyScarto, adesso, matrOpr); - if (memLayer.ML.CRB("SlaveConfirmPzProd")) + fatto = confermaProdMacchina(idxMacchinaSel, cMemLayer.CRI("modoConfProd"), qtyConf, qtyScarto, adesso, matrOpr); + if (cMemLayer.CRB("SlaveConfirmPzProd")) { foreach (var machine in slaveList) { - confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, qtyScarto, adesso, matrOpr); + confermaProdMacchina(idxMacchinaSel, cMemLayer.CRI("modoConfProd"), qtyConf, qtyScarto, adesso, matrOpr); } } } @@ -852,8 +855,8 @@ namespace MapoDb // chiamo splitOdl MapoDbObj.taODL.autoStart(currData[0].IdxODL, 0, idxMacchina, currData[0].TCRichAttr, currData[0].PzPallet, $"Nuovo ODL da forceSplitOdl.autoStart", true, qtyNew, keyRichiesta); // elimino eventuale ODL precedente... - string rKey = memLayer.ML.redHash($"ODL:{idxMacchina}"); - memLayer.ML.setRSV(rKey, ""); + string rKey = cMemLayer.redHash($"ODL:{idxMacchina}"); + cMemLayer.setRSV(rKey, ""); // ricalcola ODL macchina var newOdl = currODL(idxMacchina, true); // attendo 1000 msec @@ -886,7 +889,7 @@ namespace MapoDb // chiamo refresh MSE taMSE.forceRecalc(0, idxMacchina); // resetto stato macchina... - memLayer.ML.redDelKey(currStatoMaccHash(idxMacchina)); + cMemLayer.redDelKey(currStatoMaccHash(idxMacchina)); answ = "OK"; Log.Info($"Effettuato reset e ricalcoli x split ODL per macchina {idxMacchina}", tipoLog.INFO); // se è una master richiamo fix x child... @@ -937,7 +940,7 @@ namespace MapoDb /// public inputComandoMapo checkMicroStato(string idxMacchina, string valore, DateTime dtEve, string contatore) { - int _logLevel = memLayer.ML.CRI("_logLevel"); + int _logLevel = cMemLayer.CRI("_logLevel"); // recupero SE IMPIEGATO REDIS i valori del Dictionary della macchina... Dictionary datiMacc = mDatiMacchine(idxMacchina); @@ -952,7 +955,7 @@ namespace MapoDb // verifico se esista la macchina altrimenti la creo... REDIS compliant verificaIdxMacchina(idxMacchina); string CodArticolo = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { try { @@ -969,7 +972,7 @@ namespace MapoDb { // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione // NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // 2017.07.10 forzo init x errori "sovrapposizioni" taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter(); @@ -987,7 +990,7 @@ namespace MapoDb { valINT = int.Parse(valore, System.Globalization.NumberStyles.HexNumber); // esecuzione in REDIS... - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { try { @@ -999,7 +1002,7 @@ namespace MapoDb // verifico esistenza tab SMI... string fiHASH = DataLayer.hSMI(idxFamIn); string todoSMI = ""; - bool trovato = memLayer.ML.redHashPresentSz(fiHASH); + bool trovato = cMemLayer.redHashPresentSz(fiHASH); if (!trovato) { // ricarico tabella! @@ -1031,7 +1034,7 @@ namespace MapoDb { // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione // NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // 2017.06.09 forzo init x errori "sovrapposizioni" MapoDbObj.taTransIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter(); @@ -1058,7 +1061,7 @@ namespace MapoDb } // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione // NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // 2017.06.09 forzo init x errori "sovrapposizioni" MapoDbObj.taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter(); @@ -1076,7 +1079,7 @@ namespace MapoDb // aggiunto contatore! answ = scriviRigaEvento(idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, valEsteso, 0, "-", dtEve, DateTime.Now); // 2017.09.12 SE era in modalità redis RICARICA dati macchina... - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { resetDatiMacchina(idxMacchina); } @@ -1103,7 +1106,7 @@ namespace MapoDb /// public inputComandoMapo checkMicroStato(string idxMacchina, string valore, DateTime dtEve) { - if (memLayer.ML.CRI("_logLevel") > 6) + if (cMemLayer.CRI("_logLevel") > 6) { Log.Info(string.Format("{2}---------------------------{2}Richiesta verifica INPUT per Macchina {0}, seriale {1}", idxMacchina, valore, Environment.NewLine), tipoLog.INFO); } @@ -1143,7 +1146,7 @@ namespace MapoDb { Log.Info(string.Format("[ChkMiSt_5b] - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION); } - int _logLevel = memLayer.ML.CRI("_logLevel"); + int _logLevel = cMemLayer.CRI("_logLevel"); // effettuo update vari if (rigaTransIn != null) { @@ -1256,14 +1259,14 @@ namespace MapoDb { List resultList = new List(); string rawData = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("confFluxMach"); string redKey = confFluxMaccHash(idxMacchina); try { DataLayer man = new DataLayer(); - rawData = memLayer.ML.getRSV(redKey); + rawData = cMemLayer.getRSV(redKey); if (!string.IsNullOrEmpty(rawData)) { var redisResult = JsonConvert.DeserializeObject>(rawData); @@ -1278,8 +1281,8 @@ namespace MapoDb .ToList(); // salvo in redis... rawData = JsonConvert.SerializeObject(resultList); - int IO_CacheConfFluxMin = memLayer.ML.CRI("IO_CacheConfFluxMin"); - memLayer.ML.setRSV(redKey, rawData, IO_CacheConfFluxMin * 60); + int IO_CacheConfFluxMin = cMemLayer.CRI("IO_CacheConfFluxMin"); + cMemLayer.setRSV(redKey, rawData, IO_CacheConfFluxMin * 60); } } catch (Exception exc) @@ -1312,12 +1315,12 @@ namespace MapoDb { string answ = ""; string rCall = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("hasODL"); try { - rCall = memLayer.ML.getRSV(currODLHash(idxMacchina)); + rCall = cMemLayer.getRSV(currODLHash(idxMacchina)); if (!string.IsNullOrEmpty(rCall)) { answ = rCall; @@ -1346,8 +1349,8 @@ namespace MapoDb string answ = ""; // faccio comunque verifica se sia stato letto da poco il valore... x cui anche a fronte // di richiesta lettura da DB per 3 sec tengo buono valore in cache redis... - string rKey = memLayer.ML.redHash($"ODL:{idxMacchina}"); - string _idxOdl = memLayer.ML.getRSV(rKey); + string rKey = cMemLayer.redHash($"ODL:{idxMacchina}"); + string _idxOdl = cMemLayer.getRSV(rKey); if (forceDb) { if (!string.IsNullOrEmpty(_idxOdl)) @@ -1359,7 +1362,7 @@ namespace MapoDb answ = getCurrODL(idxMacchina); // salvo in redis... saveCurrODL(idxMacchina, answ); - memLayer.ML.setRSV(rKey, answ, 3); + cMemLayer.setRSV(rKey, answ, 3); } } else @@ -1379,12 +1382,12 @@ namespace MapoDb DS_ProdTempi.ODLDataTable answTab = null; string rCall = ""; string rKey = currOdlRowHash(idxMacchina); - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("hasODL_row"); try { - rCall = memLayer.ML.getRSV(rKey); + rCall = cMemLayer.getRSV(rKey); if (!string.IsNullOrEmpty(rCall)) { answTab = JsonConvert.DeserializeObject(rCall); @@ -1396,8 +1399,8 @@ namespace MapoDb answTab = connDb.currODLTab(idxMacchina); // salvo in redis... rCall = JsonConvert.SerializeObject(answTab); - int currOdlRowCacheDur = memLayer.ML.CRI("currOdlRowCacheDur"); - memLayer.ML.setRSV(rKey, rCall, currOdlRowCacheDur); + int currOdlRowCacheDur = cMemLayer.CRI("currOdlRowCacheDur"); + cMemLayer.setRSV(rKey, rCall, currOdlRowCacheDur); } } catch (Exception exc) @@ -1423,12 +1426,12 @@ namespace MapoDb { DS_applicazione.StatoMacchineDataTable answTab = null; string rCall = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("hasStatoMacc"); try { - rCall = memLayer.ML.getRSV(currStatoMaccHash(idxMacchina)); + rCall = cMemLayer.getRSV(currStatoMaccHash(idxMacchina)); if (!string.IsNullOrEmpty(rCall)) { answTab = JsonConvert.DeserializeObject(rCall); @@ -1441,8 +1444,8 @@ namespace MapoDb //resultList = MapoDbObj.currStatoMaccTab(idxMacchina); // salvo in redis... rCall = JsonConvert.SerializeObject(answTab); - int currStatoMaccCacheDur = memLayer.ML.CRI("currStatoMaccCacheDur"); - memLayer.ML.setRSV(currStatoMaccHash(idxMacchina), rCall, currStatoMaccCacheDur); + int currStatoMaccCacheDur = cMemLayer.CRI("currStatoMaccCacheDur"); + cMemLayer.setRSV(currStatoMaccHash(idxMacchina), rCall, currStatoMaccCacheDur); } } catch (Exception exc) @@ -1467,14 +1470,14 @@ namespace MapoDb { List resultList = new List(); string rawData = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("dossierLastByMach"); string redKey = dossLastMaccHash(idxMacchina); try { DataLayer man = new DataLayer(); - rawData = memLayer.ML.getRSV(redKey); + rawData = cMemLayer.getRSV(redKey); if (!string.IsNullOrEmpty(rawData) && rawData.Length > 2) { var redisResult = JsonConvert.DeserializeObject>(rawData); @@ -1488,8 +1491,8 @@ namespace MapoDb .ToList(); // salvo in redis... rawData = JsonConvert.SerializeObject(resultList); - int IO_CacheDossLastMin = memLayer.ML.CRI("IO_CacheDossLastMin"); - memLayer.ML.setRSV(redKey, rawData, IO_CacheDossLastMin * 60); + int IO_CacheDossLastMin = cMemLayer.CRI("IO_CacheDossLastMin"); + cMemLayer.setRSV(redKey, rawData, IO_CacheDossLastMin * 60); } } catch (Exception exc) @@ -1521,7 +1524,7 @@ namespace MapoDb bool answ = false; string rawData = ""; string redKey = dossLastMaccHash(idxMacchina); - memLayer.ML.setRSV(redKey, rawData, 1); + cMemLayer.setRSV(redKey, rawData, 1); return answ; } @@ -1535,8 +1538,8 @@ namespace MapoDb string answ = ""; try { - memLayer.ML.redDelKey(currODLHash(idxMacchina)); - memLayer.ML.redDelKey(currOdlRowHash(idxMacchina)); + cMemLayer.redDelKey(currODLHash(idxMacchina)); + cMemLayer.redDelKey(currOdlRowHash(idxMacchina)); answ = "OK"; } catch @@ -1578,8 +1581,8 @@ namespace MapoDb * **********************************************/ // calcolo il secret... DateTime adesso = DateTime.Now; - string Dominio = memLayer.ML.CRS("dominio"); - string UsrName = memLayer.ML.CRS("user"); + string Dominio = cMemLayer.CRS("dominio"); + string UsrName = cMemLayer.CRS("user"); // recupero dati da matricola... try { @@ -1597,13 +1600,13 @@ namespace MapoDb catch { Log.Info($"Eccezione! non sono riuscito a recuperare utente per matricola {matricola}", tipoLog.ERROR); - Dominio = memLayer.ML.CRS("dominio"); - UsrName = memLayer.ML.CRS("user"); + Dominio = cMemLayer.CRS("dominio"); + UsrName = cMemLayer.CRS("user"); } - string cookieName = memLayer.ML.CRS("cookieName"); - //DateTime expDate = DateTime.Now.AddDays(memLayer.ML.CRI("cookieDayExpire")); + string cookieName = cMemLayer.CRS("cookieName"); + //DateTime expDate = DateTime.Now.AddDays(cMemLayer.CRI("cookieDayExpire")); - string cookieDayExpire = memLayer.ML.CRS("cookieDayExpire").Replace(".", ","); + string cookieDayExpire = cMemLayer.CRS("cookieDayExpire").Replace(".", ","); double dayExp = 1; NumberStyles style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands; CultureInfo culture = CultureInfo.CreateSpecificCulture("it-IT"); @@ -1637,14 +1640,14 @@ namespace MapoDb { List resultList = new List(); string rawData = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("fluxLogFirstByMach"); string redKey = fluxLogFirstMaccHash(idxMacchina); try { DataLayer man = new DataLayer(); - rawData = memLayer.ML.getRSV(redKey); + rawData = cMemLayer.getRSV(redKey); if (!string.IsNullOrEmpty(rawData)) { var redisResult = JsonConvert.DeserializeObject>(rawData); @@ -1658,8 +1661,8 @@ namespace MapoDb .ToList(); // salvo in redis... rawData = JsonConvert.SerializeObject(resultList); - int IO_CacheFluxLogFirstMin = memLayer.ML.CRI("IO_CacheFluxLogFirstMin"); - memLayer.ML.setRSV(redKey, rawData, IO_CacheFluxLogFirstMin * 60); + int IO_CacheFluxLogFirstMin = cMemLayer.CRI("IO_CacheFluxLogFirstMin"); + cMemLayer.setRSV(redKey, rawData, IO_CacheFluxLogFirstMin * 60); } } catch (Exception exc) @@ -1768,7 +1771,7 @@ namespace MapoDb // verifico NON CI SIA un veto altre chiamate (es split...) - 30 sec di default... string redKey = vetoForceStartPOdlMaccHash(idxMacchina); - string rawData = memLayer.ML.getRSV(redKey); + string rawData = cMemLayer.getRSV(redKey); if (!string.IsNullOrEmpty(rawData)) { Log.Info($"VETO ATTIVO | Richiesto ForceStartPOdl per impianto {idxMacchina} | impossibile procedere"); @@ -1778,7 +1781,7 @@ namespace MapoDb // determino veto: se realtime 30sec, altrimenti 1 soltanto int vetoTtl = rtimeProc ? 30 : 1; // registro VETO x altre chiamate (es split...) 30sec - memLayer.ML.setRSV(redKey, $"Inizio FORCE START PODL: {idxPODL} | realtime: {rtimeProc} | dtEve: {dtEvent}", vetoTtl); + cMemLayer.setRSV(redKey, $"Inizio FORCE START PODL: {idxPODL} | realtime: {rtimeProc} | dtEve: {dtEvent}", vetoTtl); // calcolo la qta da gestire int qtyConf = 0; if (doConfirm) @@ -1985,7 +1988,7 @@ namespace MapoDb /// public List getCurrObjItems(string idxMacchina) { - string serVal = memLayer.ML.getRSV(currParametersHash(idxMacchina)); + string serVal = cMemLayer.getRSV(currParametersHash(idxMacchina)); List actValues = new List(); if (serVal != null) { @@ -2017,7 +2020,7 @@ namespace MapoDb /// public List getCurrObjItemsPendigWrite(string idxMacchina) { - string serVal = memLayer.ML.getRSV(currParametersHash(idxMacchina)); + string serVal = cMemLayer.getRSV(currParametersHash(idxMacchina)); List actValues = new List(); List writeValues = new List(); if (serVal != null) @@ -2083,8 +2086,8 @@ namespace MapoDb public StCheckOverride getDerogaSt(int idxST) { StCheckOverride answ = new StCheckOverride() { IdxST = idxST }; - string keyDerogaST = memLayer.ML.redHash($"DerogaSt:{user_std.UtSn.utente}:{idxST:000}"); - string rawData = memLayer.ML.getRSV(keyDerogaST); + string keyDerogaST = cMemLayer.redHash($"DerogaSt:{user_std.UtSn.utente}:{idxST:000}"); + string rawData = cMemLayer.getRSV(keyDerogaST); if (!string.IsNullOrEmpty(rawData)) { try @@ -2127,7 +2130,7 @@ namespace MapoDb { DS_applicazione.MSFDDataTable tabMSMI = new DS_applicazione.MSFDDataTable(); // 2017.09.13: inserisco gestione singleton condizionale - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // instanzio un nuovo oggetto MapoDb MapoDb connDb = new MapoDb(); @@ -2159,12 +2162,12 @@ namespace MapoDb DS_ProdTempi.PromesseODLDataTable answTab = null; string rCall = ""; string rKey = getPOdlRowHash(idxPODL); - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("hasPODL_row"); try { - rCall = memLayer.ML.getRSV(rKey); + rCall = cMemLayer.getRSV(rKey); if (!string.IsNullOrEmpty(rCall)) { answTab = JsonConvert.DeserializeObject(rCall); @@ -2175,8 +2178,8 @@ namespace MapoDb // salvo in redis... rCall = JsonConvert.SerializeObject(answTab); - int currOdlRowCacheDur = memLayer.ML.CRI("currOdlRowCacheDur"); - memLayer.ML.setRSV(rKey, rCall, currOdlRowCacheDur); + int currOdlRowCacheDur = cMemLayer.CRI("currOdlRowCacheDur"); + cMemLayer.setRSV(rKey, rCall, currOdlRowCacheDur); } } catch (Exception exc) @@ -2285,7 +2288,7 @@ namespace MapoDb public bool insEnab(string idxMacchina) { bool answ = false; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("insEnabled"); try @@ -2297,7 +2300,7 @@ namespace MapoDb // ...oppure dritto su DB else { - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // instanzio un nuovo oggetto MapoDb MapoDb connDb = new MapoDb(); @@ -2320,7 +2323,7 @@ namespace MapoDb public bool isMaster(string idxMacchina) { bool answ = false; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("isMaster"); try @@ -2345,7 +2348,7 @@ namespace MapoDb public bool isMulti(string idxMacchina) { bool answ = false; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("isMulti"); try @@ -2370,7 +2373,7 @@ namespace MapoDb public bool isSlave(string idxMacchina) { bool answ = false; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("isSlave"); try @@ -2417,7 +2420,7 @@ namespace MapoDb try { string currHash = dtMaccHash(idxMacchina); - answ = memLayer.ML.redGetHashDict(currHash); + answ = cMemLayer.redGetHashDict(currHash); // se è vuoto... leggo da DB e popolo! if (answ.Count == 0) { @@ -2444,7 +2447,7 @@ namespace MapoDb try { string currHash = optParHash(idxMacchina); - answ = memLayer.ML.redGetHashDict(currHash); + answ = cMemLayer.redGetHashDict(currHash); } catch (Exception exc) { @@ -2466,7 +2469,7 @@ namespace MapoDb try { string currHash = savedTaskHash(idxMacchina); - answ = memLayer.ML.redGetHashDict(currHash); + answ = cMemLayer.redGetHashDict(currHash); } catch (Exception exc) { @@ -2492,7 +2495,7 @@ namespace MapoDb try { string currHash = hMSMI(idxMacchina); - answ = memLayer.ML.redGetHash(currHash); + answ = cMemLayer.redGetHash(currHash); // se è vuoto... leggo da DB e popolo! if (answ.Length == 0) { @@ -2523,7 +2526,7 @@ namespace MapoDb try { string currHash = hSMI(idxFamIn); - answ = memLayer.ML.redGetHash(currHash); + answ = cMemLayer.redGetHash(currHash); // se è vuoto... leggo da DB e popolo! if (answ.Length == 0) { @@ -2550,7 +2553,7 @@ namespace MapoDb try { string currHash = exeTaskHash(idxMacchina); - answ = memLayer.ML.redGetHashDict(currHash); + answ = cMemLayer.redGetHashDict(currHash); } catch (Exception exc) { @@ -2581,7 +2584,7 @@ namespace MapoDb connDb.scriviKeepAlive(idxMacchina, DateTime.Now); } // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("processFluxLog"); } @@ -2599,7 +2602,7 @@ namespace MapoDb string key = DataLayer.LiveFLogKeyHash(idxMacchina, flux); // 10 min cache max... int ttlFlog = 60 * 10; - memLayer.ML.setRSV(key, valore, ttlFlog); + cMemLayer.setRSV(key, valore, ttlFlog); // registro in risposta che è andato tutto bene... answ = "OK"; } @@ -2646,7 +2649,7 @@ namespace MapoDb dtEve = dtEve.Length > 17 ? dtEve.Substring(0, 17) : dtEve; dtCurr = dtCurr.Length > 17 ? dtCurr.Substring(0, 17) : dtCurr; // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("processInput"); } @@ -2717,7 +2720,7 @@ namespace MapoDb { // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la // gestione NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // instanzio un nuovo oggetto MapoDb MapoDb connDb = new MapoDb(); @@ -2758,7 +2761,7 @@ namespace MapoDb } catch (Exception exc) { - if (memLayer.ML.CRI("_logLevel") > 5) + if (cMemLayer.CRI("_logLevel") > 5) { string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc); Log.Info(errore, tipoLog.EXCEPTION); @@ -2802,7 +2805,7 @@ namespace MapoDb } catch (Exception exc) { - if (memLayer.ML.CRI("_logLevel") > 5) + if (cMemLayer.CRI("_logLevel") > 5) { string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc); Log.Info(errore, tipoLog.EXCEPTION); @@ -2841,7 +2844,7 @@ namespace MapoDb throw new ArgumentNullException(nameof(liveData)); } // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("processLiveJson"); } @@ -2854,14 +2857,14 @@ namespace MapoDb if (liveData.dataList.Count > 0) { // salvo in Redis nell'area CURR_VAL TUTTI i valori live - memLayer.ML.redSaveHashList(LiveCurrValHash(idxMacchina), liveData.dataList); + cMemLayer.redSaveHashList(LiveCurrValHash(idxMacchina), liveData.dataList); // accodo in buffer ULTIMI valori con dataora uno ad uno... KeyValuePair[] newData = new KeyValuePair[1]; foreach (var item in liveData.dataList) { // accodo update valori... newData[0] = new KeyValuePair(dataOraEvento.ToString(), item.Value); - memLayer.ML.redSaveHash(LiveBufferHash(idxMacchina, item.Key), newData); + cMemLayer.redSaveHash(LiveBufferHash(idxMacchina, item.Key), newData); } } else @@ -2895,7 +2898,7 @@ namespace MapoDb throw new ArgumentNullException(nameof(liveData)); } // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("processLiveRec"); } @@ -2922,14 +2925,14 @@ namespace MapoDb i++; } // salvo in Redis nell'area CURR_VAL TUTTI i valori live - memLayer.ML.redSaveHash(LiveCurrValHash(idxMacchina), liveSet); + cMemLayer.redSaveHash(LiveCurrValHash(idxMacchina), liveSet); // accodo in buffer ULTIMI valori con dataora uno ad uno... KeyValuePair[] newData = new KeyValuePair[1]; foreach (var item in liveSet) { // accodo update valori... newData[0] = new KeyValuePair(dataOraEvento.ToString(), item.Value); - memLayer.ML.redSaveHash(LiveBufferHash(idxMacchina, item.Key), newData); + cMemLayer.redSaveHash(LiveBufferHash(idxMacchina, item.Key), newData); } } else @@ -2980,7 +2983,7 @@ namespace MapoDb dtEve = dtEve.Length > 17 ? dtEve.Substring(0, 17) : dtEve; dtCurr = dtCurr.Length > 17 ? dtCurr.Substring(0, 17) : dtCurr; // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("processUserLog"); } @@ -3075,12 +3078,12 @@ namespace MapoDb { int answ = -1; string rCall = ""; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("getCounter"); try { - rCall = memLayer.ML.getRSV(pzCountHash(idxMacchina)); + rCall = cMemLayer.getRSV(pzCountHash(idxMacchina)); if (rCall != "" && rCall != null) { int.TryParse(rCall, out answ); @@ -3105,14 +3108,14 @@ namespace MapoDb public int pzCounterTC(string idxMacchina) { int answ = -1; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("getCounterTC"); } // variabile x controllo dati recuperati DS_ProdTempi.StatoProdDataTable datiProdAct = null; bool okDatiProd = false; - int taSP_ms_ant = memLayer.ML.cdvi("taStatoProd_ms_anticipo"); + int taSP_ms_ant = cMemLayer.cdvi("taStatoProd_ms_anticipo"); DateTime dataRif = DateTime.Now.AddMilliseconds(-taSP_ms_ant); okDatiProd = getStatoProd(idxMacchina, ref datiProdAct, dataRif); // se NON avesse recuperato --> aspetto taSP_ms_ant e poi RICHIAMO procedura... @@ -3172,8 +3175,8 @@ namespace MapoDb // leggo task attuali... var currVal = mOptParMacchina(idxMacchina); currVal.Remove(taskKey); - memLayer.ML.redDelKey(currHash); - answ = memLayer.ML.redSaveHashDict(currHash, currVal); + cMemLayer.redDelKey(currHash); + answ = cMemLayer.redSaveHashDict(currHash, currVal); } catch { } return answ; @@ -3194,8 +3197,8 @@ namespace MapoDb // leggo task attuali... var currTask = mTaskMacchina(idxMacchina); currTask.Remove(taskKey.ToString()); - memLayer.ML.redDelKey(currHash); - answ = memLayer.ML.redSaveHashDict(currHash, currTask); + cMemLayer.redDelKey(currHash); + answ = cMemLayer.redSaveHashDict(currHash, currTask); Log.Info($"Task REM - idxMacchina: {idxMacchina} | taskKey: {taskKey.ToString()}"); } catch { } @@ -3211,7 +3214,7 @@ namespace MapoDb { string currHash = dtMaccHash(idxMacchina); // inizio con un bel reset... - memLayer.ML.redFlushKey(currHash); + cMemLayer.redFlushKey(currHash); Dictionary answ = new Dictionary(); DS_applicazione.MSFDDataTable tabMSFD = new DS_applicazione.MSFDDataTable(); // 2018.01.08 SEMPRE senza singleton: instanzio un nuovo oggetto MapoDb @@ -3281,8 +3284,8 @@ namespace MapoDb answ.Add("Slave", isSlave); // verifico il timeout che cambia a seconda che sia vero o falso insEnabled... - int tOutShort = memLayer.ML.cdvi("TmOut.MS.S"); - int tOutLong = memLayer.ML.cdvi("TmOut.MS.L"); + int tOutShort = cMemLayer.cdvi("TmOut.MS.S"); + int tOutLong = cMemLayer.cdvi("TmOut.MS.L"); int redDtMacTOut = tOutLong; try { @@ -3293,7 +3296,7 @@ namespace MapoDb Log.Info($"Eccezione in calcolo timeout dati macchina: idxMacchina{idxMacchina} | TShort: {tOutShort} | TLong {tOutLong}{Environment.NewLine}{exc}"); } // salvo in redis! - memLayer.ML.redSaveHashDict(currHash, answ, redDtMacTOut); + cMemLayer.redSaveHashDict(currHash, answ, redDtMacTOut); } else { @@ -3327,7 +3330,7 @@ namespace MapoDb string currHash = hMSMI(idxMacchina); DS_applicazione.MSFDDataTable tabMSMI = new DS_applicazione.MSFDDataTable(); // 2017.09.13: inserisco gestione singleton condizionale - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // instanzio un nuovo oggetto MapoDb MapoDb connDb = new MapoDb(); @@ -3347,9 +3350,9 @@ namespace MapoDb i++; } // verifico il timeout (default 60 sec...) - int tOut = (memLayer.ML.cdvi("TmOut.MSMI") <= 0) ? 60 : memLayer.ML.cdvi("TmOut.MSMI"); + int tOut = (cMemLayer.cdvi("TmOut.MSMI") <= 0) ? 60 : cMemLayer.cdvi("TmOut.MSMI"); // salvo in redis! - memLayer.ML.redSaveHash(currHash, answ, tOut); + cMemLayer.redSaveHash(currHash, answ, tOut); return answ; } @@ -3365,7 +3368,7 @@ namespace MapoDb string currHash = hSMI(idxFamIn); DS_applicazione.TransizioneIngressiDataTable tabSMI = new DS_applicazione.TransizioneIngressiDataTable(); // 2017.09.13: inserisco gestione singleton condizionale - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // instanzio un nuovo oggetto MapoDb MapoDb connDb = new MapoDb(); @@ -3389,9 +3392,9 @@ namespace MapoDb i++; } // verifico il timeout (default 60 sec...) - int tOut = (memLayer.ML.cdvi("TmOut.SMI") <= 0) ? 60 : memLayer.ML.cdvi("TmOut.SMI"); + int tOut = (cMemLayer.cdvi("TmOut.SMI") <= 0) ? 60 : cMemLayer.cdvi("TmOut.SMI"); // salvo in redis! - memLayer.ML.redSaveHash(currHash, answ, tOut); + cMemLayer.redSaveHash(currHash, answ, tOut); return answ; } @@ -3518,7 +3521,7 @@ namespace MapoDb public string saveCounter(string idxMacchina, string counter) { // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("saveCounter"); } @@ -3535,11 +3538,11 @@ namespace MapoDb { string redKey = pzCountHash(idxMacchina); // verifico SE ci sia chiave in redis (ALTRIMENTI rileggo da DB) - string redVal = memLayer.ML.getRSV(redKey); + string redVal = cMemLayer.getRSV(redKey); if (!string.IsNullOrEmpty(redVal)) { // salvo in Redis nell'area corretta il valore richiesto - memLayer.ML.setRSV(redKey, counter); + cMemLayer.setRSV(redKey, counter); // imposto risposta... answ = counter; } @@ -3547,7 +3550,7 @@ namespace MapoDb { // rileggo da DB e salvo e poi restituisco questo... int currCount = pzCounterTC(idxMacchina); - memLayer.ML.setRSV(redKey, currCount.ToString()); + cMemLayer.setRSV(redKey, currCount.ToString()); // imposto risposta... answ = currCount.ToString(); } @@ -3582,7 +3585,7 @@ namespace MapoDb throw new ArgumentNullException(nameof(currODL)); } // registro conteggio impiego chiamate REDIS - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("saveCurrODL"); } @@ -3592,13 +3595,13 @@ namespace MapoDb { if (idxMacchina != "" && currODL != "") { - int currOdlCacheDur = memLayer.ML.CRI("currOdlCacheDur"); + int currOdlCacheDur = cMemLayer.CRI("currOdlCacheDur"); // se ODL fosse 0 USO DURATA CACHE 1/4... if (currODL == "0") { currOdlCacheDur = currOdlCacheDur / 4; } - memLayer.ML.setRSV(currODLHash(idxMacchina), currODL, currOdlCacheDur); + cMemLayer.setRSV(currODLHash(idxMacchina), currODL, currOdlCacheDur); // registro in risposta che è andato tutto bene... answ = "OK"; } @@ -3635,7 +3638,7 @@ namespace MapoDb } catch { } // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // 2017.06.09 forzo init x errori "sovrapposizioni" taSigLog = new DS_applicazioneTableAdapters.SignalLogTableAdapter(); @@ -3659,7 +3662,7 @@ namespace MapoDb { int inserito = 0; // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { // 2017.06.09 forzo init x errori "sovrapposizioni" MapoDbObj.taEvList = new DS_applicazioneTableAdapters.EventListTableAdapter(); @@ -3963,7 +3966,7 @@ namespace MapoDb try { // compongo la stringa - string mittente = memLayer.ML.CRS("_fromEmail"); + string mittente = cMemLayer.CRS("_fromEmail"); gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo); fatto = true; } @@ -3995,11 +3998,11 @@ namespace MapoDb try { // compongo la stringa - smtpCli = memLayer.ML.CRS("_smtpCli"); - mittente = memLayer.ML.CRS("_fromEmail"); + smtpCli = cMemLayer.CRS("_smtpCli"); + mittente = cMemLayer.CRS("_fromEmail"); oggetto = "Link autorizzazione device per GPW"; - baseUrl = memLayer.ML.CRS("baseUrl"); - baseWebUrl = memLayer.ML.CRS("baseWebUrl"); + baseUrl = cMemLayer.CRS("baseUrl"); + baseWebUrl = cMemLayer.CRS("baseWebUrl"); userUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseUrl); userWebUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseWebUrl); corpo = string.Format("Hai ricevuto questa email su richiesta tua o dell'Admin per poter procedere a registrare un (nuovo) devices con GPW:{0}
Per proseguire clicca sul link seguente(rete interna):
{0}{0}{1}{0}{0}

oppure sul link seguente (internet):
{0}{0}{2}{0}{0}

Team GPW Steamware", Environment.NewLine, userUrl, userWebUrl); @@ -4025,11 +4028,11 @@ namespace MapoDb try { // compongo la stringa - mittente = memLayer.ML.CRS("_fromEmail"); - oggetto = memLayer.ML.CRS("oggettoChgTc"); - pageUrl = string.Format("{0}{1}", memLayer.ML.CRS("baseUrlAdmin"), memLayer.ML.CRS("pageUrlApprODL")); - corpo = string.Format(memLayer.ML.CRS("corpoChgTc"), Environment.NewLine, pageUrl); - if (memLayer.ML.CRB("_useAuthSmtp")) + mittente = cMemLayer.CRS("_fromEmail"); + oggetto = cMemLayer.CRS("oggettoChgTc"); + pageUrl = string.Format("{0}{1}", cMemLayer.CRS("baseUrlAdmin"), cMemLayer.CRS("pageUrlApprODL")); + corpo = string.Format(cMemLayer.CRS("corpoChgTc"), Environment.NewLine, pageUrl); + if (cMemLayer.CRB("_useAuthSmtp")) { gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo); } @@ -4055,7 +4058,7 @@ namespace MapoDb if (currValues != null) { string serVal = JsonConvert.SerializeObject(currValues); - memLayer.ML.setRSV(currParametersHash(idxMacchina), serVal); + cMemLayer.setRSV(currParametersHash(idxMacchina), serVal); // controllo se ha valori write... foreach (var item in currValues) { @@ -4086,9 +4089,9 @@ namespace MapoDb bool fatto = false; try { - string keyDerogaST = memLayer.ML.redHash($"DerogaSt:{user_std.UtSn.utente}:{deroga.IdxST:000}"); + string keyDerogaST = cMemLayer.redHash($"DerogaSt:{user_std.UtSn.utente}:{deroga.IdxST:000}"); string rawData = JsonConvert.SerializeObject(deroga); - memLayer.ML.setRSV(keyDerogaST, rawData, 60 * 2); + cMemLayer.setRSV(keyDerogaST, rawData, 60 * 2); fatto = true; } catch @@ -4109,7 +4112,7 @@ namespace MapoDb if (!string.IsNullOrEmpty(iobConfFull)) { // salvo! - memLayer.ML.setRSV(ConfYamlHash(idxMacchina), iobConfFull); + cMemLayer.setRSV(ConfYamlHash(idxMacchina), iobConfFull); } return answ; } @@ -4128,7 +4131,7 @@ namespace MapoDb { // salvo! string serVal = JsonConvert.SerializeObject(currMemMap); - memLayer.ML.setRSV(memMapHash(idxMacchina), serVal); + cMemLayer.setRSV(memMapHash(idxMacchina), serVal); } return answ; } @@ -4142,7 +4145,7 @@ namespace MapoDb public bool sLogEnab(string idxMacchina) { bool answ = false; - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { saveCallRec("sLogEnabled"); try @@ -4297,7 +4300,7 @@ namespace MapoDb } // serializzo e salvo string serVal = JsonConvert.SerializeObject(innovations); - memLayer.ML.setRSV(currParametersHash(idxMacchina), serVal); + cMemLayer.setRSV(currParametersHash(idxMacchina), serVal); } return answ; } @@ -4314,7 +4317,7 @@ namespace MapoDb { string currHash = hSMI(idxFamIn); string field = string.Format("{0}_{1}", idxMicroStato, valoreIn); - return memLayer.ML.redGetHashField(currHash, field); + return cMemLayer.redGetHashField(currHash, field); } #endregion Public Methods @@ -4324,7 +4327,7 @@ namespace MapoDb /// /// indica conferma con rettifica (evento 121) /// - protected bool confRett = memLayer.ML.CRB("confRett"); + protected bool confRett = false; #endregion Protected Fields @@ -4400,17 +4403,18 @@ namespace MapoDb taWKS = new DS_IntServTableAdapters.WipSetupKitTableAdapter(); } + // cMemLayer.CRB("confRett"); /// /// effettua setup dei connection strings da web.config delal singola applicazione /// protected virtual void setupConnectionStringBase() { - string connectionString = memLayer.ML.confReadString("MoonProConnectionString"); - string connectionStringIS = memLayer.ML.confReadString("MoonProConnectionStringIS"); - string connectionStringArca = memLayer.ML.confReadString("MoonProConnectionStringArca"); - string connectionStringES3 = memLayer.ML.confReadString("MoonProConnectionStringES3"); - string connectionStringFluxData = memLayer.ML.confReadString("MoonProConnectionStringFluxData"); - string connectionStringMAG = memLayer.ML.confReadString("MoonProConnectionStringMAG"); + string connectionString = cMemLayer.confReadString("MoonProConnectionString"); + string connectionStringIS = cMemLayer.confReadString("MoonProConnectionStringIS"); + string connectionStringArca = cMemLayer.confReadString("MoonProConnectionStringArca"); + string connectionStringES3 = cMemLayer.confReadString("MoonProConnectionStringES3"); + string connectionStringFluxData = cMemLayer.confReadString("MoonProConnectionStringFluxData"); + string connectionStringMAG = cMemLayer.confReadString("MoonProConnectionStringMAG"); // connections del db taAG.Connection.ConnectionString = connectionString; taAlarmLog.Connection.ConnectionString = connectionString; @@ -4487,10 +4491,10 @@ namespace MapoDb ///
private Lazy lazyConnection = new Lazy(() => { - string RedisConn = memLayer.ML.confReadString("RedisConnSPEC"); + string RedisConn = cMemLayer.confReadString("RedisConnSPEC"); if (string.IsNullOrEmpty(RedisConn)) { - RedisConn = memLayer.ML.confReadString("RedisConn"); + RedisConn = cMemLayer.confReadString("RedisConn"); } if (string.IsNullOrEmpty(RedisConn)) { @@ -4504,10 +4508,10 @@ namespace MapoDb ///
private Lazy lazyConnectionAdmin = new Lazy(() => { - string RedisConnAdmin = memLayer.ML.confReadString("RedisConnSPECAdmin"); + string RedisConnAdmin = cMemLayer.confReadString("RedisConnSPECAdmin"); if (string.IsNullOrEmpty(RedisConnAdmin)) { - RedisConnAdmin = memLayer.ML.confReadString("RedisConnAdmin"); + RedisConnAdmin = cMemLayer.confReadString("RedisConnAdmin"); } if (string.IsNullOrEmpty(RedisConnAdmin)) { @@ -4518,6 +4522,12 @@ namespace MapoDb #endregion Private Fields + #region Private Properties + + private static memLayer cMemLayer { get; set; } = new memLayer(); + + #endregion Private Properties + #region Private Methods private static T ConvertDataRowToGenericType(DataRow row) where T : class, new() @@ -4549,15 +4559,15 @@ namespace MapoDb private static void saveCallRec(string callCountKey) { // conto la richiesta nel contatore REDIS - long nCall = memLayer.ML.setRCntI(mHash($"COUNT:pCall:{callCountKey}")); + long nCall = cMemLayer.setRCntI(mHash($"COUNT:pCall:{callCountKey}")); //... se == nCall2Log scrivo su log e resetto - long nCall2Log = memLayer.ML.cdvi("nCall2Log"); + long nCall2Log = cMemLayer.cdvi("nCall2Log"); if (nCall >= nCall2Log) { // loggo Log.Info($"{callCountKey}: {nCall} call received", tipoLog.INFO); // resetto! - memLayer.ML.resetRCnt(mHash($"COUNT:pCall:{callCountKey}")); + cMemLayer.resetRCnt(mHash($"COUNT:pCall:{callCountKey}")); } } @@ -4574,7 +4584,7 @@ namespace MapoDb /// private void checkCambiaStatoBatch(tipoInputEvento tipoInput, string IdxMacchina, DateTime InizioStato, int IdxTipo, string CodArt, string Value, int MatrOpr, string pallet) { - int _logLevel = memLayer.ML.CRI("_logLevel"); + int _logLevel = cMemLayer.CRI("_logLevel"); DS_applicazione.TransizioneStatiDataTable tabTransStati; DS_applicazione.TransizioneStatiRow rigaTransStati; switch (tipoInput) @@ -4669,16 +4679,16 @@ namespace MapoDb try { string chiamata = confRett ? "confermaProdMacchinaFull" : "confermaProdMacchina"; - Log.Info($"Chiamata a {chiamata} con parametri | IdxMacchina: {currODLData[0].IdxMacchina} | MatrOpr: {MatrOpr} | dtEvent {dtEvento} | {qtyConf} | modoConf: {memLayer.ML.CRI("modoConfProd")}", tipoLog.INFO); + Log.Info($"Chiamata a {chiamata} con parametri | IdxMacchina: {currODLData[0].IdxMacchina} | MatrOpr: {MatrOpr} | dtEvent {dtEvento} | {qtyConf} | modoConf: {cMemLayer.CRI("modoConfProd")}", tipoLog.INFO); string idxMacchinaSel = currODLData[0].IdxMacchina; if (confRett) { // confermo al netto dei pezzi lasciati... - fatto = confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, 0, dtEvento, matrOpr); + fatto = confermaProdMacchinaFull(idxMacchinaSel, cMemLayer.CRI("modoConfProd"), qtyConf, 0, 0, dtEvento, matrOpr); } else { - fatto = confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), qtyConf, 0, dtEvento, matrOpr); + fatto = confermaProdMacchina(idxMacchinaSel, cMemLayer.CRI("modoConfProd"), qtyConf, 0, dtEvento, matrOpr); } if (!fatto) { @@ -4694,8 +4704,8 @@ namespace MapoDb // chiamo chiusura MapoDbObj.taODL.forceClose(currODLData[0].IdxODL, idxMacchina, dtEvento); // elimino eventuale ODL precedente... - string rKey = memLayer.ML.redHash($"ODL:{idxMacchina}"); - memLayer.ML.setRSV(rKey, ""); + string rKey = cMemLayer.redHash($"ODL:{idxMacchina}"); + cMemLayer.setRSV(rKey, ""); fatto = true; return fatto; } @@ -4705,7 +4715,7 @@ namespace MapoDb /// private void fixCommandTimeout() { - int sqlLongCommandTimeout = memLayer.ML.CRI("sqlLongCommandTimeout") > 1 ? memLayer.ML.CRI("sqlLongCommandTimeout") : 300; + int sqlLongCommandTimeout = cMemLayer.CRI("sqlLongCommandTimeout") > 1 ? cMemLayer.CRI("sqlLongCommandTimeout") : 300; SetAllCommandTimeouts(taComm, sqlLongCommandTimeout); } @@ -4805,7 +4815,7 @@ namespace MapoDb private void resetPODLData(int idxPODL) { string rKey = getPOdlRowHash(idxPODL); - memLayer.ML.setRSV(rKey, "", 1); + cMemLayer.setRSV(rKey, "", 1); } private string saveOdlData(string idxMacchina, DS_ProdTempi.ODLDataTable currODLData, DS_ProdTempi.PromesseODLDataTable reqPODLData) @@ -4840,7 +4850,7 @@ namespace MapoDb // chiamo refresh MSE taMSE.forceRecalc(0, idxMacchina); // resetto stato macchina... - memLayer.ML.redDelKey(currStatoMaccHash(idxMacchina)); + cMemLayer.redDelKey(currStatoMaccHash(idxMacchina)); answ = "OK"; Log.Info($"Effettuato reset e ricalcoli x split ODL per macchina {idxMacchina}", tipoLog.INFO); // se è una master richiamo fix x child... @@ -4885,6 +4895,11 @@ namespace MapoDb } } + private void setupConf() + { + confRett = cMemLayer.CRB("confRett"); + } + /// /// cerca codice in anagrafica macchine ed eventualmente inserisce nuova macchina /// @@ -4892,9 +4907,9 @@ namespace MapoDb private void verificaIdxMacchina(string IdxMacchina) { bool needDB = false; - if (!memLayer.ML.CRB("disable_verificaIdxMacchina")) + if (!cMemLayer.CRB("disable_verificaIdxMacchina")) { - if (memLayer.ML.CRB("IOB_RedEnab")) + if (cMemLayer.CRB("IOB_RedEnab")) { try { @@ -4915,7 +4930,7 @@ namespace MapoDb { // 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione // NUOVO oggetto - if (memLayer.ML.CRB("disable_singleton")) + if (cMemLayer.CRB("disable_singleton")) { taMacchine = new DS_applicazioneTableAdapters.MacchineTableAdapter(); MapoDbObj.taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter(); diff --git a/MapoDb/MapoDb.csproj b/MapoDb/MapoDb.csproj index 710d4b5b..ff5c5254 100644 --- a/MapoDb/MapoDb.csproj +++ b/MapoDb/MapoDb.csproj @@ -136,11 +136,11 @@ ..\packages\StackExchange.Redis.2.8.0\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.5.3.2311.2908\lib\net462\SteamWare.dll + + ..\packages\SteamWare.5.4.2509.1510\lib\net462\SteamWare.dll - - ..\packages\SteamWare.Logger.5.3.2311.2908\lib\net462\SteamWare.Logger.dll + + ..\packages\SteamWare.Logger.5.4.2509.1510\lib\net462\SteamWare.Logger.dll diff --git a/MapoDb/app.config b/MapoDb/app.config index d123208f..02bee836 100644 --- a/MapoDb/app.config +++ b/MapoDb/app.config @@ -5,29 +5,14 @@
- - - - - - - - + + + + + + + + diff --git a/MapoDb/packages.config b/MapoDb/packages.config index 8a0a1cc0..43cbc981 100644 --- a/MapoDb/packages.config +++ b/MapoDb/packages.config @@ -24,8 +24,8 @@ - - + + diff --git a/MapoSDK/dataConfTSVC.cs b/MapoSDK/dataConfTSVC.cs index ada45488..6744bdb0 100644 --- a/MapoSDK/dataConfTSVC.cs +++ b/MapoSDK/dataConfTSVC.cs @@ -20,7 +20,8 @@ namespace MapoSDK public VC_func func { get; set; } = VC_func.MAX; /// - /// Indica se il parametro possa solo crescere (come i contatori energia, contatori TOT) + relativa gestione + /// Indica se il parametro sia semidefinito-positivo (=possa solo crescere) + relativa gestione + /// es: i contatori energia, contatori TOT generali non resettabili ore impiego / pezzi /// public bool onlyIncr { get; set; } = false;