diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 1fbb5e4..e7d879d 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -1439,7 +1439,7 @@ namespace AppData // salvo in redis cachedCurrBunkTab = tabBunk; } - if (tabBunk.Count > 0) + if (tabBunk != null && tabBunk.Count > 0) { answ = tabBunk[0]; } diff --git a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs index ef1822f..70faaaa 100644 --- a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs @@ -18,7 +18,7 @@ namespace NKC_WF.WebUserControls if (hfBatchId.Value != value.ToString()) { hfBatchId.Value = value.ToString(); - doUpdate(); + //doUpdate(); } } get diff --git a/NKC_WF/site/MachineUnload.aspx b/NKC_WF/site/MachineUnload.aspx index 961efac..715f1e1 100644 --- a/NKC_WF/site/MachineUnload.aspx +++ b/NKC_WF/site/MachineUnload.aspx @@ -9,46 +9,51 @@
-
-

<%: traduci("MachineUnload") %> (<%: hfBatchID.Value %>)

-
- - - - - - - -
-
- +<%-- + --%> +
+

<%: traduci("MachineUnload") %> (<%: hfBatchID.Value %>)

+
+ + - + + + -
-
- +
+
+ + + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ - - - - -
-
- - - +
- - - - - -
-
+ <%-- + --%>
diff --git a/NKC_WF/site/MachineUnload.aspx.cs b/NKC_WF/site/MachineUnload.aspx.cs index d3ed294..704434c 100644 --- a/NKC_WF/site/MachineUnload.aspx.cs +++ b/NKC_WF/site/MachineUnload.aspx.cs @@ -53,56 +53,68 @@ namespace NKC_WF private void doUpdate() { // imposto dati correnti - setCurrData(); - // aggiorno child - cmp_MU_stats.BatchId = BatchId; - cmp_MU_bins.BatchId = BatchId; - cmp_MU_carts.BatchId = BatchId; - cmp_MU_svgViewer.BatchId = BatchId; - cmp_MU_svgViewer.SheetId = SheetId; + bool doUpdate = setCurrData(); + if (doUpdate) + { + // aggiorno child + cmp_MU_stats.BatchId = BatchId; + cmp_MU_bins.BatchId = BatchId; + cmp_MU_carts.BatchId = BatchId; + cmp_MU_svgViewer.BatchId = BatchId; + cmp_MU_svgViewer.SheetId = SheetId; + } } /// - /// Imposta dati correnti (Bunk / Sheet) + /// Imposta dati correnti (Bunk / Sheet) indicando SE fare update /// - private void setCurrData() + private bool setCurrData() { + bool needUpdate = false; // recupero bunk corrente... DS_App.StackListRow currBunk = ComLib.getCurrBunk(); if (currBunk != null) { - BatchId = currBunk.BatchID; + if (BatchId != currBunk.BatchID) + { + BatchId = currBunk.BatchID; + needUpdate = true; + } + DS_App.SheetListRow currSheet = ComLib.getCurrSheet(BatchId); if (currSheet != null) { - SheetId = currSheet.SheetID; + if (SheetId != currSheet.SheetID) + { + SheetId = currSheet.SheetID; + needUpdate = true; + } } } else { BatchId = 0; } + return needUpdate; } protected void timerSvg_Tick(object sender, EventArgs e) { // in base al num di sec dell'ora decido cosa aggiornare... int counter = numWaitSvg; - // ogni 10 generale - if (counter % 10 == 0) - { - doUpdate(); - } - // ogni 5 stats - else if (counter % 5 == 0) + // ogni 2 sec bin/cart + doUpdate(); + if (counter % 5 == 0) { cmp_MU_stats.doUpdate(); + upnlStats.DataBind(); } - // ogni 2 sec bin/cart - else if (counter % 2 == 0) - { - cmp_MU_carts.doUpdate(); - cmp_MU_bins.doUpdate(); - } + //if (counter % 2 == 0) + //{ + cmp_MU_carts.doUpdate(); + upnlCarts.DataBind(); + cmp_MU_bins.doUpdate(); + upnlCarts.DataBind(); + //} incrNumWait(); } /// @@ -131,6 +143,7 @@ namespace NKC_WF if (numWaitSvg > 10) { memLayer.ML.resetRCnt(redProdReq); + Response.Redirect(Request.RawUrl); } memLayer.ML.setRCntI(redProdReq); }