Abbozzata decodifica dati
This commit is contained in:
@@ -43,6 +43,7 @@ namespace MP_MAG.WebUserControls
|
||||
set
|
||||
{
|
||||
txtBarcode.Text = "";
|
||||
txtBarcode.Focus();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using MagData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -55,8 +56,6 @@ namespace MP_MAG.WebUserControls
|
||||
|
||||
private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
// verifico barcode
|
||||
lblDecodedData.Text = cmp_barcode.inputAcquired;
|
||||
|
||||
|
||||
bool doRaiseEv = false;
|
||||
@@ -69,6 +68,8 @@ namespace MP_MAG.WebUserControls
|
||||
// aggiorno...
|
||||
doUpdate();
|
||||
|
||||
// verifico barcode
|
||||
lblDecodedData.Text = lastValidCmd;
|
||||
}
|
||||
|
||||
private void resetIcons()
|
||||
@@ -87,9 +88,8 @@ namespace MP_MAG.WebUserControls
|
||||
private bool processLastCmd(bool doRaiseEv)
|
||||
{
|
||||
if (lastCmd == "") doRaiseEv = true;
|
||||
#if false
|
||||
// processiamo barcode letto
|
||||
decodedData decoData = DataLayer.man.decodeBcode(lastCmd);
|
||||
decodedData decoData = MagDataLayer.man.decodeBcode(lastCmd);
|
||||
switch (decoData.codeType)
|
||||
{
|
||||
case codeType.UNK:
|
||||
@@ -97,51 +97,243 @@ namespace MP_MAG.WebUserControls
|
||||
resetSelection(false);
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Item:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid IT Code: {decoData.rawData}");
|
||||
case codeType.Lotto:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Lotto Valido: {decoData.rawData}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.ItemGeneric:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid IG Code: {decoData.rawData}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.OtherItem:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid Generic PART Code: {decoData.rawData}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
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:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"BUNK - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Batch:
|
||||
cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}");
|
||||
doRaiseEv = true;
|
||||
break;
|
||||
case codeType.Cart:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
case codeType.Bin:
|
||||
cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}");
|
||||
processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
break;
|
||||
default:
|
||||
cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
|
||||
resetSelection(false);
|
||||
break;
|
||||
//case codeType.ItemGeneric:
|
||||
// cmp_barcode.showOutput("badge badge-success", $"Valid IG Code: {decoData.rawData}");
|
||||
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
// break;
|
||||
//case codeType.OtherItem:
|
||||
// cmp_barcode.showOutput("badge badge-success", $"Valid Generic PART Code: {decoData.rawData}");
|
||||
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
// 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:
|
||||
// cmp_barcode.showOutput("badge badge-warning", $"BUNK - ignored: {decoData.description}");
|
||||
// doRaiseEv = true;
|
||||
// break;
|
||||
//case codeType.Batch:
|
||||
// cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}");
|
||||
// doRaiseEv = true;
|
||||
// break;
|
||||
//case codeType.Cart:
|
||||
// cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}");
|
||||
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
// break;
|
||||
//case codeType.Bin:
|
||||
// cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}");
|
||||
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
|
||||
// break;
|
||||
//default:
|
||||
// cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
|
||||
// resetSelection(false);
|
||||
// break;
|
||||
}
|
||||
#endif
|
||||
|
||||
return doRaiseEv;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processo il DataMatrix letto
|
||||
/// </summary>
|
||||
/// <param name="tipoCod"></param>
|
||||
/// <param name="rawData"></param>
|
||||
/// <param name="codeInt"></param>
|
||||
private void processItemSuggestion(codeType tipoCod, string rawData, int codeInt)
|
||||
{
|
||||
//DS_App.ItemListDataTable tabItem = null;
|
||||
// processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
|
||||
switch (tipoCod)
|
||||
{
|
||||
case codeType.Lotto:
|
||||
//var tabOtherItem = DataLayer.man.taOtItem.getByKey(codeInt);
|
||||
//if (tabOtherItem.Count == 1)
|
||||
//{
|
||||
// showOtherItemDetail(true, tabOtherItem[0], false);
|
||||
//}
|
||||
break;
|
||||
//case codeType.Item:
|
||||
// tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData, 0, 999);
|
||||
// if (tabItem.Count == 1)
|
||||
// {
|
||||
// showItemDetail(true, tabItem[0], false);
|
||||
// }
|
||||
// else if (tabItem.Count == 0)
|
||||
// {
|
||||
// showItemDetail(false, null, true);
|
||||
// }
|
||||
// break;
|
||||
//case codeType.ItemGeneric:
|
||||
// // PRIMA CERCSE ne ho in stato 1..3
|
||||
// tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 3);
|
||||
// if (tabItem.Count == 0)
|
||||
// {
|
||||
// // se NON ne trovo cerci FINO a stato 5...
|
||||
// tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 5);
|
||||
// }
|
||||
// if (tabItem.Count == 1)
|
||||
// {
|
||||
// showItemDetail(true, tabItem[0], false);
|
||||
// }
|
||||
// else if (tabItem.Count == 0)
|
||||
// {
|
||||
// showItemDetail(false, null, true);
|
||||
// }
|
||||
// break;
|
||||
//case codeType.Cart:
|
||||
// // verifico NON SIA richiesto PAINT
|
||||
// if (showBin)
|
||||
// {
|
||||
// displError("PAINT: BIN REQUESTED: please retry", true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (currCartTab.Count == 1)
|
||||
// {
|
||||
// // controllo se sia quello corretto
|
||||
// if (rawData != currCartTab[0].CartDtmx)
|
||||
// {
|
||||
// displError("INCORRECT CART: please retry", true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // dichiaro che è depositato
|
||||
// DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId);
|
||||
// lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}";
|
||||
// resetSelection(false);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
//case codeType.Bin:
|
||||
// // verifico NON SIA richiesto PAINT
|
||||
// if (showCart)
|
||||
// {
|
||||
// displError("NOT PAINTED: CART REQUESTED: please retry", true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (currBinTab.Count == 1)
|
||||
// {
|
||||
// // controllo se sia quello corretto
|
||||
// if (rawData != currBinTab[0].BinDtmx)
|
||||
// {
|
||||
// displError("INCORRECT BIN: please retry", true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // dichiaro che è depositato
|
||||
// DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId);
|
||||
// lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}";
|
||||
// resetSelection(false);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Mostra o nasconde dettaglio su ITEM letto
|
||||
/// </summary>
|
||||
/// <param name="showItem"></param>
|
||||
/// <param name="itemRow"></param>
|
||||
/// <param name="showError"></param>
|
||||
private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError)
|
||||
{
|
||||
resetShowData();
|
||||
divItemDet.Visible = showItem;
|
||||
divItemError.Visible = showError;
|
||||
if (showError)
|
||||
{
|
||||
displError("Item not found", true);
|
||||
}
|
||||
if (showItem)
|
||||
{
|
||||
lblItemCode.Text = itemRow.ItemExtCode;
|
||||
lblItemDesc.Text = itemRow.ItemDesc;
|
||||
lblItemDtmx.Text = itemRow.ItemDtmx;
|
||||
itemIdSelected = itemRow.ItemID;
|
||||
// CONTROLLO SIA in stato 1 --> worked, 2--> selected, 100--> parked...
|
||||
switch (itemRow.StatusID)
|
||||
{
|
||||
case 0:
|
||||
displError("ERROR: Item not ready", false);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 100:
|
||||
// salvo che è in STATO 2 (picked up)
|
||||
DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId);
|
||||
// verifico cosa devo mostrare come PROX passaggio...
|
||||
showCart = itemRow.ProcessesReq == "";
|
||||
showBin = (itemRow.ProcessesReq.Contains("PaintFlag"));
|
||||
secOp = itemRow.PostProcList;
|
||||
showSecOp = (secOp != "");
|
||||
doUpdate();
|
||||
break;
|
||||
case 3:
|
||||
displError("Item already on CART!", false);
|
||||
break;
|
||||
case 4:
|
||||
// fino a concorrenza qta richiesta sposto, POI do errori
|
||||
displError("ALL Item already scanned on BIN!", false);
|
||||
break;
|
||||
case 5:
|
||||
displError("Item already at KIT STATION!", false);
|
||||
break;
|
||||
case 990:
|
||||
displError("Item declared SCRAP!", false);
|
||||
break;
|
||||
case 991:
|
||||
displError("Item declared SCRAP with CNC program created!", false);
|
||||
break;
|
||||
default:
|
||||
displError("ERROR: Item status UNKNOWN!", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
lbtResetSel.Visible = (itemIdSelected != 0);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Reset selezione item + blocchi suggerimento + sel REDIS x pagina unload
|
||||
/// </summary>
|
||||
/// <param name="resetStatus"></param>
|
||||
protected void resetSelection(bool resetStatus)
|
||||
{
|
||||
#if false
|
||||
if (resetStatus)
|
||||
{
|
||||
try
|
||||
{
|
||||
// SE item esiste...
|
||||
var tabItem = DataLayer.man.taIL.getBySearch(itemIdSelected, itemIdSelected.ToString(), 0, 999);
|
||||
if (tabItem.Count == 1)
|
||||
{
|
||||
// riposto item a status 1...
|
||||
DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// elimino item sel...
|
||||
itemIdSelected = 0;
|
||||
resetShowData();
|
||||
ComLib.resetItemPickup(SheetID, DeviceId);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void doUpdate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user