Costruita condizione da verificare x carico BUNK

This commit is contained in:
Samuele E. Locatelli
2020-07-13 16:36:46 +02:00
parent f3223e32ab
commit aef71558a3
6 changed files with 227 additions and 125 deletions
+48 -39
View File
@@ -110,27 +110,36 @@ namespace NKC_WF.WebUserControls
// controllo sia quello RICHIESTO, eventualmente permetteremo TUTTI quelli del giorno in ogni ordine...
if (decoData.codeInt == cmp_stackNextloading.StackIdReq)
{
cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}");
ComLib.taktMLCurrStack = decoData.code;
// processo DB e salvo che lo stack è stato caricato in MACHINE LOAD
int stackId = 0;
try
// verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking)
if (currentBunkPrinted)
{
var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData);
if (tabStack.Count == 1)
cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}");
ComLib.taktMLCurrStack = decoData.code;
// processo DB e salvo che lo stack è stato caricato in MACHINE LOAD
int stackId = 0;
try
{
stackId = tabStack[0].StackID;
var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData);
if (tabStack.Count == 1)
{
stackId = tabStack[0].StackID;
}
}
catch
{ }
// SE HO uno stackId valido (>0)...
if (stackId > 0)
{
DataLayer.man.taSTL.updatePos(stackId, 5);
// controllo status del bunk nel suo insieme...
ComLib.updateBatchPositionByBunk(stackId);
doRaiseEv = true;
}
}
catch
{ }
// SE HO uno stackId valido (>0)...
if (stackId > 0)
// altrimenti segnalo NON pronto x caricare prossimo
else
{
DataLayer.man.taSTL.updatePos(stackId, 5);
// controllo status del bunk nel suo insieme...
ComLib.updateBatchPositionByBunk(stackId);
doRaiseEv = true;
cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}");
}
}
else
@@ -138,29 +147,6 @@ namespace NKC_WF.WebUserControls
cmp_barcode.showOutput("badge badge-danger", $"WRONG BUNK, {decoData.rawData}");
}
}
//DS_App.SheetListDataTable nextTbl = DataLayer.man.taSHL.getNextByStack(StackId);
//// se tab vuota --> HO FINITO!!!!
//if (nextTbl.Count == 0)
//{
// cmp_barcode.showOutput("badge badge-warning", $"STACK IS COMPLETED, {decoData.description}");
//}
//// se ho valori --> controllo se corretto...
//else
//{
// string codReq = nextTbl[0].MatExtCode.ToString();
// if (codReq == decoData.codeInt.ToString())
// {
// cmp_barcode.showOutput("badge badge-success", $"SHEET RECORDED: {decoData.description}");
// // chiamo stored x indicare preparato
// DataLayer.man.taSHL.setPrepared(nextTbl[0].SheetID);
// }
// else
// {
// cmp_barcode.showOutput("badge badge-danger", $"WRONG SHEET: {decoData.description}");
// }
//}
//cmp_barcode.showOutput("badge badge-warning", "Stack - ignored");
break;
case codeType.Batch:
cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}");
@@ -182,6 +168,29 @@ namespace NKC_WF.WebUserControls
}
}
protected bool currentBunkPrinted
{
get
{
bool answ = true;
// leggo i dati del bunk...
var currBunks = DataLayer.man.taSTL.getCurrByBatch(BatchIdCurr);
if (currBunks.Count > 0)
{
// verifico x ogni bunk corrente
foreach (var item in currBunks)
{
// verifico se numSheet = NumWorging
bool checkNum = item.NumSheets == item.NumSheetsWorking;
// update answ
answ = answ && checkNum;
}
}
return answ;
}
}
protected void checkVisibility()
{
lblLoaded.Visible = StackId != 0;