diff --git a/MP-TAB/SendParameters.aspx b/MP-TAB/SendParameters.aspx index 42487249..0684ff64 100644 --- a/MP-TAB/SendParameters.aspx +++ b/MP-TAB/SendParameters.aspx @@ -4,31 +4,19 @@ <%@ Register Src="~/WebUserControls/mod_sendParameters.ascx" TagPrefix="uc1" TagName="mod_sendParameters" %> <%@ Register Src="~/WebUserControls/mod_dettMacchina.ascx" TagPrefix="uc1" TagName="mod_dettMacchina" %> - - -
-
-
- - - <%--
-
- Reg. SCARTI -
-
- Reg.CONTROLLI -
-
--%> -
-
- -
+
+
+
+ + +
+
+ +
+
-
- - - + \ No newline at end of file diff --git a/MP-TAB/SendParameters.aspx.designer.cs b/MP-TAB/SendParameters.aspx.designer.cs index c2822fd8..36a519bc 100644 --- a/MP-TAB/SendParameters.aspx.designer.cs +++ b/MP-TAB/SendParameters.aspx.designer.cs @@ -1,44 +1,44 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// This code was generated by a tool. // -// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se -// il codice viene rigenerato. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ namespace MoonProTablet { - public partial class SendParameters - { + public partial class SendParameters + { - /// - /// Controllo mod_dettMacchina. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::MoonProTablet.WebUserControls.mod_dettMacchina mod_dettMacchina; + /// + /// mod_dettMacchina control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MoonProTablet.WebUserControls.mod_dettMacchina mod_dettMacchina; - /// - /// Controllo mod_sendParameters. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::MoonProTablet.WebUserControls.mod_sendParameters mod_sendParameters; + /// + /// mod_sendParameters control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MoonProTablet.WebUserControls.mod_sendParameters mod_sendParameters; - /// - /// Controllo mod_directLinks. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::MoonProTablet.WebUserControls.mod_directLinks mod_directLinks; - } + /// + /// mod_directLinks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::MoonProTablet.WebUserControls.mod_directLinks mod_directLinks; + } } diff --git a/MP-TAB/WebUserControls/mod_ODL.ascx.cs b/MP-TAB/WebUserControls/mod_ODL.ascx.cs index 5dc90174..f4f3b072 100644 --- a/MP-TAB/WebUserControls/mod_ODL.ascx.cs +++ b/MP-TAB/WebUserControls/mod_ODL.ascx.cs @@ -857,6 +857,9 @@ namespace MoonProTablet.WebUserControls Response.Redirect("~/DettaglioMacchina.aspx"); } } + // invio task x end produzione... + DataLayerObj.addTask4Machine(idxMacchinaFix, taskType.endProd, ""); + // resetto ODL su redis... DataLayerObj.emptyCurrODL(idxMacchinaFix); // reset ODL!... diff --git a/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs b/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs index 5aba9a1c..f7497b3b 100644 --- a/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs +++ b/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs @@ -13,10 +13,29 @@ namespace MoonProTablet.WebUserControls { public partial class mod_sendParameters : BaseUserControl { + #region Protected Methods + + protected void grView_RowEditing(object sender, GridViewEditEventArgs e) + { + } + + protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) + { + } + + protected void lbtReload_Click(object sender, EventArgs e) + { + grView.DataBind(); + } + protected void Page_Load(object sender, EventArgs e) { } + #endregion Protected Methods + + #region Public Methods + /// /// wrapper recupero parametri macchina /// @@ -53,38 +72,7 @@ namespace MoonProTablet.WebUserControls DataLayerObj.updateMachineParameter(idxMacchina, Original_uid, reqValue); } } - protected void lbtReload_Click(object sender, EventArgs e) - { - grView.DataBind(); - } - protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e) - { -#if false - var txtReqVal = grView.Rows[e.RowIndex].FindControl("txtReqValue") as TextBox; - string Original_uid = e.Keys[0].ToString(); - // recupero items... - List dcList = DataLayer.getCurrObjItems(idxMacchina); - // cerco quello da aggiornare - objItem trovato = dcList.Find(obj => obj.uid == Original_uid); - List list2Update = new List(); - // se trovato procedo - if (trovato != null) - { - // aggiorno valore richiesto + dt richiesta - trovato.reqValue = txtReqVal.Text.Trim(); - trovato.lastRequest = DateTime.Now; - list2Update.Add(trovato); - DataLayer.upsertCurrObjItems(idxMacchina, list2Update); - // accodo in task 2 exe la richiesta di processing - DataLayer.addTask4Machine(idxMacchina, taskType.setParameter, trovato.uid); - } -#endif - } - - protected void grView_RowEditing(object sender, GridViewEditEventArgs e) - { - - } + #endregion Public Methods } } \ No newline at end of file diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index 3d6e9cac..79c26bd4 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -786,6 +786,16 @@ namespace MapoDb return mHash(string.Format("PzCount:{0}", idxMacchina)); } + /// + /// Hash dati SAVED (EXE) TASK x la macchina specificata x poter ripristinare in caso di perdita valore WRITE + /// + /// + /// + public static string savedTaskHash(string idxMacchina) + { + return mHash(string.Format("SavedTask:{0}", idxMacchina)); + } + /// /// Hash dati STATUS x la macchina specificata. /// - dati ODL @@ -842,15 +852,36 @@ namespace MapoDb { bool answ = false; string currHash = exeTaskHash(idxMacchina); + string currSavedParHash = savedTaskHash(idxMacchina); + Dictionary currTask = new Dictionary(); try { // leggo task attuali... - var currTask = mTaskMacchina(idxMacchina); + currTask = mTaskMacchina(idxMacchina); currTask[taskKey.ToString()] = taskVal; answ = memLayer.ML.redSaveHashDict(currHash, currTask); logger.lg.scriviLog($"Task ADD - idxMacchina: {idxMacchina} | taskKey: {taskKey.ToString()} | taskVal: {taskVal}"); } catch { } + // verifico in base al tipo di task se fare backup... + switch (taskKey) + { + case taskType.setArt: + case taskType.setComm: + case taskType.setPzComm: + case taskType.setProg: + answ = memLayer.ML.redSaveHashDict(currSavedParHash, currTask); + break; + + case taskType.endProd: + // salvo un DICT vuoto x resettare + currTask = new Dictionary(); + answ = memLayer.ML.redSaveHashDict(currSavedParHash, currTask); + break; + + default: + break; + } return answ; } diff --git a/MapoSDK/Enums.cs b/MapoSDK/Enums.cs index 41535fca..63196da3 100644 --- a/MapoSDK/Enums.cs +++ b/MapoSDK/Enums.cs @@ -173,7 +173,12 @@ /// /// Richiesta invio watchdog a PLC /// - sendWatchDogMes2Plc + sendWatchDogMes2Plc, + + /// + /// Indica che è FINITA la produzione (e quindi cancello dati backup) + /// + endProd, } ///