Update x gestione machine LOAD

This commit is contained in:
Samuele E. Locatelli
2020-08-17 12:48:28 +02:00
parent 94c038723f
commit fc424b84cb
6 changed files with 38 additions and 64 deletions
+2 -1
View File
@@ -37,7 +37,8 @@
</httpModules>
<!--Nascondo gli erroracci-->
<!--<customErrors mode="On" defaultRedirect="~/site/Default"/>-->
<customErrors mode="On" defaultRedirect="~/"/>
<!--<customErrors mode="On" defaultRedirect="~/"/>-->
<customErrors mode="On" defaultRedirect="~/site/ErrorsLog"/>
<!--Mostro gli erroracci-->
<!--<customErrors mode="Off"/>-->
</system.web>
+2 -2
View File
@@ -1,7 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_barcode.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_barcode" %>
<div class="form-group bigText">
<%--AutoPostBack="True"--%>
<asp:TextBox runat="server" ID="txtBarcode" class="form-control" autofocus="true" OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
<asp:Label ID="lblOutput" runat="server" for="txtBarcode" Width="100%" />
<asp:TextBox runat="server" ID="txtBarcode" class="form-control" autofocus="true" OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
<asp:Label ID="lblOutput" runat="server" for="txtBarcode" Width="100%" />
<asp:HiddenField ID="hfLastCmd" runat="server" />
</div>
+2 -7
View File
@@ -9,7 +9,7 @@
<h3><%: traduci("ProdSimul") %></h3>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbtAdvanceProd" class="shortcut" OnClick="lbtAdvanceProd_Click"> <i class="fa fa-wrench shortcut-icon"></i><span class="shortcut-label"><b><%: traduci("Advance") %></b> #<%: traduci("Prod") %></span> </asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtAdvanceProd" class="shortcut" OnClick="lbtAdvanceProd_Click"> <i class="fa fa-wrench shortcut-icon"></i><span class="shortcut-label"><b><%: traduci("Advance") %></b> #<%: traduci("Prod") %></span></asp:LinkButton>
</div>
</div>
</div>
@@ -53,11 +53,6 @@
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
</div>
<div class="col-12">
<asp:UpdatePanel runat="server" ID="upnlLoading" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Timer ID="timerLoad" runat="server" Interval="2000" OnTick="timerLoad_Tick"></asp:Timer>
<uc1:cmp_stackNextloading runat="server" ID="cmp_stackNextloading" />
</ContentTemplate>
</asp:UpdatePanel>
<uc1:cmp_stackNextloading runat="server" ID="cmp_stackNextloading" />
</div>
</div>
+28 -35
View File
@@ -31,7 +31,6 @@ namespace NKC_WF.WebUserControls
private void fixDisplay()
{
cmp_barcode.Visible = enableBCode;
//frmView.Visible = !enableBCode;
}
public bool enableBCode
@@ -102,9 +101,24 @@ namespace NKC_WF.WebUserControls
}
private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e)
{
bool doRaiseEv = false;
// processo evento..
lastCmd = cmp_barcode.inputAcquired.ToUpper();
doRaiseEv = processLastCmd(doRaiseEv);
// reset comando
cmp_barcode.inputAcquired = "";
// aggiorno...
doUpdate();
// se richiesto faccio raiseEvent
if (doRaiseEv)
{
cmp_stackNextloading.doUpdate();
}
}
private bool processLastCmd(bool doRaiseEv)
{
if (string.IsNullOrEmpty(lastCmd))
{
doRaiseEv = true;
@@ -113,27 +127,16 @@ namespace NKC_WF.WebUserControls
decodedData decoData = DataLayer.man.decodeBcode(lastCmd);
switch (decoData.codeType)
{
case codeType.UNK:
cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
doRaiseEv = true;
break;
case codeType.Item:
case codeType.ItemGeneric:
cmp_barcode.showOutput("text-warning", $"Item - ignored: {decoData.description}");
doRaiseEv = true;
break;
case codeType.Material:
cmp_barcode.showOutput("badge badge-warning", $"Material - ignored: {decoData.description}");
doRaiseEv = true;
break;
case codeType.Sheet:
cmp_barcode.showOutput("badge badge-warning", $"Sheet - ignored: {decoData.description}");
doRaiseEv = true;
break;
case codeType.Stack:
// verifico SE lo stack esista...
DS_App.StackListDataTable tabStack = DataLayer.man.taSTL.getByKey(decoData.codeInt);
if (tabStack.Count == 0)
DS_App.StackListDataTable tabStack = null;
try
{
tabStack = DataLayer.man.taSTL.getByKey(decoData.codeInt);
}
catch
{ }
if (tabStack != null && tabStack.Count == 0)
{
cmp_barcode.showOutput("badge badge-danger", $"BUNK NOT FOUND: {decoData.description}");
doRaiseEv = true;
@@ -203,25 +206,15 @@ namespace NKC_WF.WebUserControls
}
}
break;
case codeType.Batch:
cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}");
doRaiseEv = true;
break;
default:
cmp_barcode.showOutput("text-danger", $"Data Ignored: {decoData.rawData} --> no action");
doRaiseEv = true;
break;
}
// reset comando
cmp_barcode.resetInput();
// aggiorno...
doUpdate();
// se richiesto faccio raiseEvent
if (doRaiseEv)
{
cmp_stackNextloading.doUpdate();
raiseEvent();
}
return doRaiseEv;
}
protected bool currentBunkAlreadyWorking(int StackIdRequested)
{
bool answ = false;
@@ -281,7 +274,7 @@ namespace NKC_WF.WebUserControls
protected void checkVisibility()
{
lblLoaded.Visible = StackId != 0;
frmView.Visible = !lblLoaded.Visible;// && !enableBCode;
frmView.Visible = !lblLoaded.Visible;
// fix div di simulazione
divSim.Visible = (memLayer.ML.CRS("environment") == "DEV" && !enableBCode);
}
-18
View File
@@ -95,24 +95,6 @@ namespace NKC_WF.WebUserControls
/// </remarks>
protected global::NKC_WF.WebUserControls.cmp_barcode cmp_barcode;
/// <summary>
/// Controllo upnlLoading.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upnlLoading;
/// <summary>
/// Controllo timerLoad.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.Timer timerLoad;
/// <summary>
/// Controllo cmp_stackNextloading.
/// </summary>
@@ -49,7 +49,10 @@ namespace NKC_WF.WebUserControls
get
{
int answ = 0;
int.TryParse(frmViewNext.SelectedValue.ToString(), out answ);
if (frmViewNext.SelectedValue != null)
{
int.TryParse(frmViewNext.SelectedValue.ToString(), out answ);
}
return answ;
}
}