|
@@ -109,13 +109,18 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
private void Sbr1_BarCodeReceived(object sender, SCADA.BarcodeReader.BarcodeReceivedEventArgs e)
|
|
|
{
|
|
|
var barcode = e.Barcode;
|
|
|
- Plc1.GetListenReg(SortingDeliveryMachine.Tag_CodeMatch).WriteReg(0);
|
|
|
|
|
|
var barcodeTask = BoardTasks.Where(t => t.BoardID == barcode).FirstOrDefault();
|
|
|
+ if (barcodeTask == null)
|
|
|
+ {
|
|
|
+ barcodeTask = Env.DAL.App_Hold_BoardInfo.GetData<BoardTaskModel>(t=>t.BoardID == barcode).FirstOrDefault();
|
|
|
+ }
|
|
|
//var barcodeTask = Env.DAL.App_Hold_BoardInfo.GetData<BoardTaskModel>(t=>t.BoardID == barcode).FirstOrDefault();
|
|
|
var api = new WebApiHelper(_ScannerServiceConfig.Url);
|
|
|
if ((DateTime.Now - LastScanTime).TotalSeconds > 3)
|
|
|
{
|
|
|
+ Plc1.GetListenReg(SortingDeliveryMachine.Tag_CodeMatch).WriteReg(0);
|
|
|
+
|
|
|
if (barcode != "NoRead" && barcodeTask != null)
|
|
|
{
|
|
|
var MinProportion = Math.Min(barcodeTask.Width, barcodeTask.Height) / Math.Max(barcodeTask.Width, barcodeTask.Height);
|
|
@@ -174,7 +179,7 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
{
|
|
|
Plc1.GetListenReg(SortingDeliveryMachine.Tag_CodeMatch).WriteReg(2);
|
|
|
//Plc1.GetListenReg(SortingDeliveryMachine.Tag_IsLeftovers).WriteReg(1);
|
|
|
- Plc1.LeftLoversOrAbnormal.Enqueue(1);
|
|
|
+ Plc1.LeftLoversOrAbnormal.Enqueue(1);
|
|
|
|
|
|
Log.Info($"没有获取到条码");
|
|
|
}
|