|
|
@@ -2866,17 +2866,31 @@ namespace TeamAAS_VP.Core
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //if (currentProduct.ID != productId && q.ProductKBSN == kb_sn && q.ProductColor == color && q.ProductCode == model_num)
|
|
|
- if (currentProduct.ID != productId && q.ProductLoad.Contains(kb_pn[i]))
|
|
|
+ if (_configService.GetSystemConfiguration().IsTP_AOI)
|
|
|
{
|
|
|
- //切换产品
|
|
|
- SendTaskMessage($"开始切换产品{q.ProductKBSN}", MessageLevel.Error);
|
|
|
- _productService.LoadProduct(productId);
|
|
|
- _productService.SetCurrentProduct(productId);
|
|
|
- await WritePositionToPlcAsync();
|
|
|
- SendTaskMessage($"切换产品成功", MessageLevel.Debug);
|
|
|
- break;
|
|
|
+ if (currentProduct.ID != productId && q.ProductLoad.Contains(kb_pn[i]))
|
|
|
+ {
|
|
|
+ //切换产品
|
|
|
+ SendTaskMessage($"开始切换产品{q.ProductKBSN}", MessageLevel.Error);
|
|
|
+ _productService.LoadProduct(productId);
|
|
|
+ _productService.SetCurrentProduct(productId);
|
|
|
+ await WritePositionToPlcAsync();
|
|
|
+ SendTaskMessage($"切换产品成功", MessageLevel.Debug);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (currentProduct.ID != productId && q.ProductKBSN == kb_sn[i] && q.ProductColor == color[i] && q.ProductCode == model_num[i])
|
|
|
+ {
|
|
|
+ //切换产品
|
|
|
+ SendTaskMessage($"开始切换产品{q.ProductKBSN}", MessageLevel.Error);
|
|
|
+ _productService.LoadProduct(productId);
|
|
|
+ _productService.SetCurrentProduct(productId);
|
|
|
+ await WritePositionToPlcAsync();
|
|
|
+ SendTaskMessage($"切换产品成功", MessageLevel.Debug);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|