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
+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);
}