Ancora spostamento timers vari in tab config

This commit is contained in:
Samuele Locatelli
2024-06-14 09:18:36 +02:00
parent 53c8620be0
commit bd2ea7dab0
13 changed files with 230 additions and 203 deletions
+1 -1
View File
@@ -3502,7 +3502,7 @@ namespace AppData
protected static void setCurrSheetTab(string machine, DS_App.SheetListDataTable tabella)
{
string rawData = JsonConvert.SerializeObject(tabella);
// TTL 2 sec
// TTL 1 sec
memLayer.ML.setRSV(redCurrSheetTabKey(machine), rawData, 1);
}
+17
View File
@@ -4,6 +4,7 @@ using NKC_SDK;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Web;
namespace NKC_WF
{
@@ -58,6 +59,22 @@ namespace NKC_WF
}
}
/// <summary>
/// pagina corrente...
/// </summary>
public string currPage
{
get
{
string url = HttpContext.Current.Request.Url.PathAndQuery;
if (url.Contains("?"))
{
url = url.Substring(0, url.IndexOf("?"));
}
return url;
}
}
#endregion Public Properties
#region Public Methods
-4
View File
@@ -85,10 +85,6 @@
</system.web>
<appSettings>
<!--Configurazioni generali-->
<add key="intUpdatePagina_ms" value="120000"/>
<!--Dopo 5 minuto da ultima lettura (180000) svuota barcode in pagine smart-->
<add key="smartForceReloadPagina_ms" value="180000"/>
<add key="kittingPageRefresh" value="3000"/>
<add key="appName" value="NKC"/>
<add key="CodModulo" value="NKC"/>
<add key="copyRight" value="Egaltech &amp; Steamware "/>
@@ -12,18 +12,6 @@ namespace NKC_WF.WebUserControls
{
#region Public Properties
public string currPage
{
get
{
string url = HttpContext.Current.Request.Url.PathAndQuery;
if (url.Contains("?mach="))
{
url = url.Substring(0, url.IndexOf("?mach="));
}
return url;
}
}
public string MachineSel
{
@@ -31,19 +31,6 @@ namespace NKC_WF.WebUserControls
}
}
public string currPage
{
get
{
string url = HttpContext.Current.Request.Url.PathAndQuery;
if (url.Contains("?mach="))
{
url = url.Substring(0, url.IndexOf("?mach="));
}
return url;
}
}
public bool machSelected
{
get
+26 -9
View File
@@ -127,6 +127,8 @@ namespace NKC_WF.WebUserControls
{
resetInput();
resetMessage();
setTimer();
test4reload();
}
else if (string.IsNullOrEmpty(inputAcquired))
{
@@ -147,14 +149,7 @@ namespace NKC_WF.WebUserControls
protected void UiTimer_Tick(object sender, EventArgs e)
{
// controllo, se ultima operazione > smartForceReloadPagina_ms --> reload!
var tsLastUpdate = DateTime.Now.Subtract(lastDtInput);
if (tsLastUpdate.TotalMilliseconds > memLayer.ML.confReadInt("smartForceReloadPagina_ms"))
{
lgInfo($"cmp_barcode | Reload page for timeout: {tsLastUpdate.TotalSeconds} sec from last update");
inputAcquired = "##";
Response.Redirect(Request.RawUrl);
}
test4reload();
}
#endregion Protected Methods
@@ -182,10 +177,32 @@ namespace NKC_WF.WebUserControls
{
resetInput();
}
}
}
resetInput();
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh del componente
/// </summary>
private void setTimer()
{
int timer = memLayer.ML.CRI("timerBarcode");
timer = timer > 0 ? timer : 10000;
UiTimer.Interval = timer;
}
private void test4reload()
{
// controllo, se ultima operazione > smartForceReloadPagina_ms --> reload!
var tsLastUpdate = DateTime.Now.Subtract(lastDtInput);
if (tsLastUpdate.TotalMilliseconds > memLayer.ML.CRI("smartForceReloadPagina_ms"))
{
lgInfo($"cmp_barcode | Reload page for timeout: {tsLastUpdate.TotalSeconds} sec from last update");
inputAcquired = "##";
Response.Redirect(Request.RawUrl);
}
}
#endregion Private Methods
}
}
+1 -3
View File
@@ -26,9 +26,7 @@ namespace NKC_WF.WebUserControls
/// </summary>
private void setTimer()
{
//Timer1.Tick += Timer1_Tick;
int intUpdatePagina_ms = memLayer.ML.confReadInt("intUpdatePagina_ms");
//intUpdatePagina_ms = intUpdatePagina_ms > 10000 ? 10000 : intUpdatePagina_ms;
int intUpdatePagina_ms = memLayer.ML.CRI("intUpdatePagina_ms");
Timer1.Interval = intUpdatePagina_ms;
}
@@ -4,10 +4,11 @@ using SteamWare;
using System;
using System.Data;
using System.Linq;
using System.Web.WebPages;
namespace NKC_WF.WebUserControls
{
public partial class cmp_kittingSmart : BaseUserControl
public partial class cmp_kittingSmart : BaseUserControl, IDisposable
{
#region Public Properties
@@ -47,6 +48,19 @@ namespace NKC_WF.WebUserControls
#endregion Public Properties
#region Public Methods
public override void Dispose()
{
cmp_barcode.eh_doRefresh -= Cmp_barcode_eh_doRefresh;
cmp_barcode.eh_doReset -= Cmp_barcode_eh_doReset;
cmp_KS_BinCart.eh_doRefresh -= cmp_KS_BinCart_eh_doRefresh;
cmp_KS_OtherItemsCart.eh_doRefresh -= cmp_KS_OtherItemsCart_eh_doRefresh;
cmp_KS_Items.eh_doRefresh -= cmp_KS_Items_eh_doRefresh;
}
#endregion Public Methods
#region Protected Properties
protected DS_App.BinsDataTable currBinTab
@@ -330,6 +344,7 @@ namespace NKC_WF.WebUserControls
DS_App.ItemListDataTable tabItem = null;
DataLayer DLMan = new DataLayer();
divInfo.Visible = false;
divError.Visible = false;
// processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
switch (tipoCod)
{
@@ -392,7 +407,7 @@ namespace NKC_WF.WebUserControls
if (lastObject == rawData)
{
// --> metto cart in scarico e registro LOG come se avesse
// appena letto 1:1 ogni Dtmx
// appena letto 1:1 ogni Dtmx
DLMan.taPLog.closeCart(codeInt);
lgInfo($"cmp_kittingSmart | taPLog.closeCart | codeInt: {codeInt} | rawData: {rawData}");
// mostro che ho fatto
@@ -430,7 +445,7 @@ namespace NKC_WF.WebUserControls
if (lastObject == rawData)
{
// --> metto cart in scarico e registro LOG come se
// avesse appena letto 1:1 ogni Dtmx
// avesse appena letto 1:1 ogni Dtmx
DLMan.taPLog.acquireCart(rawData, currIpAddress, user_std.UtSn.userNameAD);
lgInfo($"cmp_kittingSmart | taPLog.acquireCart | KittingStart = GETDATE() | rawData: {rawData} | UserName: {user_std.UtSn.userNameAD} | currIpAddress: {currIpAddress}");
displInfo($"OK: CART acquired {rawData} - item confirmed");
@@ -1,4 +1,5 @@
using SteamWare;
using NKC_SDK;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -75,7 +76,16 @@ namespace NKC_WF.WebUserControls
set
{
hfShowFull.Value = value.ToString();
grView.DataBind();
try
{
grView.DataBind();
}
catch (Exception exc)
{
lgError($"Eccezione durante cpm_partMIA_byPLID.showFull{Environment.NewLine}{exc}");
// rimando a pagina
Response.Redirect(currPage);
}
}
}
@@ -12,19 +12,6 @@ namespace NKC_WF.WebUserControls
{
#region Public Properties
public string currPage
{
get
{
string url = HttpContext.Current.Request.Url.PathAndQuery;
if (url.Contains("?"))
{
url = url.Substring(0, url.IndexOf("?"));
}
return url;
}
}
public ReportType SelReport
{
get
+25 -16
View File
@@ -4,7 +4,7 @@ using System.Web.UI;
namespace NKC_WF.site
{
public partial class KittingSmart : BasePage
public partial class KittingSmart : BasePage, IDisposable
{
#region Public Properties
@@ -27,6 +27,30 @@ namespace NKC_WF.site
#endregion Public Properties
#region Public Methods
public override void Dispose()
{
cmp_kittingSmart.eh_doRefresh -= cmp_kittingSmart_eh_doRefresh;
}
#endregion Public Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
((SiteMaster)this.Master).showSearch = false;
doUpdate();
}
cmp_kittingSmart.eh_doRefresh += cmp_kittingSmart_eh_doRefresh;
cmp_kittingSmart.PlaceCod = "KIT001";
}
#endregion Protected Methods
#region Private Methods
private void cmp_kittingSmart_eh_doRefresh(object sender, EventArgs e)
@@ -57,20 +81,5 @@ namespace NKC_WF.site
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
((SiteMaster)this.Master).showSearch = false;
doUpdate();
}
cmp_kittingSmart.eh_doRefresh += cmp_kittingSmart_eh_doRefresh;
cmp_kittingSmart.PlaceCod = "KIT001";
}
#endregion Protected Methods
}
}
+11 -11
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <generato automaticamente>
// Codice generato da uno strumento.
// <auto-generated>
// 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.
// </generato automaticamente>
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace NKC_WF.site
@@ -15,20 +15,20 @@ namespace NKC_WF.site
{
/// <summary>
/// Controllo hfPackListID.
/// hfPackListID control.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfPackListID;
/// <summary>
/// Controllo cmp_kittingSmart.
/// cmp_kittingSmart control.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::NKC_WF.WebUserControls.cmp_kittingSmart cmp_kittingSmart;
}
+119 -116
View File
@@ -6,6 +6,79 @@ namespace NKC_WF
{
public partial class MachineUnload : BasePage, IDisposable
{
#region Public Properties
/// <summary>
/// BatchId corrente...
/// </summary>
public int BatchId
{
set
{
hfBatchID.Value = value.ToString();
ComLib.setCurrBatchId(MachineSel, value);
}
get
{
int answ = 0;
int.TryParse(hfBatchID.Value, out answ);
return answ;
}
}
/// <summary>
/// SheetId corrente...
/// </summary>
public int SheetId
{
set
{
hfSheetID.Value = value.ToString();
ComLib.setCurrSheetId(MachineSel, value);
}
get
{
int answ = 0;
int.TryParse(hfSheetID.Value, out answ);
return answ;
}
}
/// <summary>
/// Verifica se sia da mostrare pagina MissingInAction
/// </summary>
public bool showPartMIA
{
get
{
bool answ = false;
if (BatchId > 0)
{
try
{
bool hasMIA = DLMan.taIL.getMissingByBatch(BatchId).Count > 0;
answ = hasMIA && MachineSel != "#";
}
catch
{ }
}
return answ;
}
}
#endregion Public Properties
#region Public Methods
public override void Dispose()
{
timerSvg.Tick -= timerSvg_Tick;
timerSvg.Dispose();
base.Dispose();
}
#endregion Public Methods
#region Protected Properties
protected string MachineSel
@@ -73,67 +146,68 @@ namespace NKC_WF
#endregion Protected Properties
#region Public Properties
#region Protected Methods
/// <summary>
/// BatchId corrente...
/// Incrementa counter redis
/// </summary>
public int BatchId
protected void incrNumWait()
{
set
if (numWaitSvg > 30)
{
hfBatchID.Value = value.ToString();
ComLib.setCurrBatchId(MachineSel, value);
memLayer.ML.resetRCnt(redProdReq);
Response.Redirect(Request.RawUrl);
}
get
memLayer.ML.setRCntI(redProdReq);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
int answ = 0;
int.TryParse(hfBatchID.Value, out answ);
return answ;
((SiteMaster)this.Master).showSearch = false;
setTimer();
doUpdate();
}
}
/// <summary>
/// SheetId corrente...
/// Main SVG timer
/// </summary>
public int SheetId
/// <param name="sender"></param>
/// <param name="e"></param>
protected void timerSvg_Tick(object sender, EventArgs e)
{
set
// in base al num di sec dell'ora decido cosa aggiornare...
int counter = numWaitSvg;
// ogni x cicli resetto batch/Foglio
if (counter % 15 == 0)
{
hfSheetID.Value = value.ToString();
ComLib.setCurrSheetId(MachineSel, value);
SheetId = -3;
}
get
// ora faccio verifiche
doUpdate();
// ogni x cicli
if (counter % 5 == 0)
{
int answ = 0;
int.TryParse(hfSheetID.Value, out answ);
return answ;
cmp_MU_stats.doUpdate();
upnlStats.Update();
}
// faccio update bin/cart ogni pari/dispari...
if (counter % 2 == 0)
{
cmp_MU_carts.doUpdate();
upnlCarts.Update();
}
else
{
cmp_MU_bins.doUpdate();
upnlBins.Update();
}
incrNumWait();
}
/// <summary>
/// Verifica se sia da mostrare pagina MissingInAction
/// </summary>
public bool showPartMIA
{
get
{
bool answ = false;
if (BatchId > 0)
{
try
{
bool hasMIA = DLMan.taIL.getMissingByBatch(BatchId).Count > 0;
answ = hasMIA && MachineSel!="#";
}
catch
{ }
}
return answ;
}
}
#endregion Public Properties
#endregion Protected Methods
#region Private Methods
@@ -168,8 +242,8 @@ namespace NKC_WF
upnlTitle.Update();
}
}
// definisco se mostrare PartMIA
hlPartMIA.Visible = showPartMIA;
// definisco se mostrare PartMIA
hlPartMIA.Visible = showPartMIA;
}
/// <summary>
@@ -218,34 +292,6 @@ namespace NKC_WF
return needUpdate;
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Incrementa counter redis
/// </summary>
protected void incrNumWait()
{
if (numWaitSvg > 30)
{
memLayer.ML.resetRCnt(redProdReq);
Response.Redirect(Request.RawUrl);
}
memLayer.ML.setRCntI(redProdReq);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
((SiteMaster)this.Master).showSearch = false;
setTimer();
doUpdate();
}
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh del componente
/// </summary>
@@ -255,50 +301,7 @@ namespace NKC_WF
timerSvgInt = timerSvgInt > 0 ? timerSvgInt : 500;
timerSvg.Interval = timerSvgInt;
}
public override void Dispose()
{
timerSvg.Tick -= timerSvg_Tick;
timerSvg.Dispose();
base.Dispose();
}
/// <summary>
/// Main SVG timer
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void timerSvg_Tick(object sender, EventArgs e)
{
// in base al num di sec dell'ora decido cosa aggiornare...
int counter = numWaitSvg;
// ogni x cicli resetto batch/Foglio
if (counter % 15 == 0)
{
SheetId = -3;
}
// ora faccio verifiche
doUpdate();
// ogni x cicli
if (counter % 5 == 0)
{
cmp_MU_stats.doUpdate();
upnlStats.Update();
}
// faccio update bin/cart ogni pari/dispari...
if (counter % 2 == 0)
{
cmp_MU_carts.doUpdate();
upnlCarts.Update();
}
else
{
cmp_MU_bins.doUpdate();
upnlBins.Update();
}
incrNumWait();
}
#endregion Protected Methods
#endregion Private Methods
}
}