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
@@ -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