|
|
@@ -1675,6 +1675,7 @@ namespace TeamAAS_VP.Core
|
|
|
catch { }
|
|
|
var sysConfig = _configService.GetSystemConfiguration();
|
|
|
|
|
|
+ #region 扫码枪扫码
|
|
|
if (sysConfig.ScannerUse == true && cameraIndex == 1 && sysConfig.CodeUse2 == true)
|
|
|
{
|
|
|
ScanValue = "";
|
|
|
@@ -1950,6 +1951,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
if (procIds.Count == 0 && cameraIndex != currentProduct.PhotoCountStop)
|
|
|
{
|
|
|
@@ -2010,7 +2012,7 @@ namespace TeamAAS_VP.Core
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ #region 相机扫码
|
|
|
if (sysConfig.CodeUse == true && cameraIndex == 1)
|
|
|
{
|
|
|
var cts = new CancellationTokenSource();
|
|
|
@@ -2100,6 +2102,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
ProductMainSN = snItem.Replace("sn=", "").Trim();
|
|
|
_productService.CurrentProductCode = ProductMainSN;
|
|
|
+ await plc.WriteNodeAsync<string>(string.Format(addressConfig.In_Code.Address, 0), ProductMainSN);
|
|
|
SendTaskMessage($"产品主sn:{ProductMainSN}", MessageLevel.Info);
|
|
|
}
|
|
|
string woItem = item.FirstOrDefault(f => f.Contains("wo="));
|
|
|
@@ -2172,7 +2175,15 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
LogHelper.WriteLogMes($"第二次询问mes失败");
|
|
|
SendTaskMessage($"第二次询问mes失败:{response2}", MessageLevel.Error);
|
|
|
-
|
|
|
+ string[] item = response2.Split('\n');
|
|
|
+ string snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
+ {
|
|
|
+ ProductMainSN = snItem.Replace("sn=", "").Trim();
|
|
|
+ _productService.CurrentProductCode = ProductMainSN;
|
|
|
+ await plc.WriteNodeAsync<string>(string.Format(addressConfig.In_Code.Address, 0), ProductMainSN);
|
|
|
+ SendTaskMessage($"产品主sn:{ProductMainSN}", MessageLevel.Info);
|
|
|
+ }
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_FixedCameraPickStatus.Address, (Int16)3);
|
|
|
}
|
|
|
}
|
|
|
@@ -2259,6 +2270,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
ProductMainSN = snItem.Replace("sn=", "").Trim();
|
|
|
_productService.CurrentProductCode = ProductMainSN;
|
|
|
+ await plc.WriteNodeAsync<string>(string.Format(addressConfig.In_Code.Address, 0), ProductMainSN);
|
|
|
SendTaskMessage($"产品主sn:{ProductMainSN}", MessageLevel.Info);
|
|
|
}
|
|
|
string woItem = items.FirstOrDefault(f => f.Contains("wo="));
|
|
|
@@ -2333,7 +2345,16 @@ namespace TeamAAS_VP.Core
|
|
|
//产品发生改变并且供料器发生了变化时,需要通知PLC进行取料更改
|
|
|
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_FixedCameraPickStatus.Address, (Int16)3);
|
|
|
+ string[] items = response.Split('\n');
|
|
|
|
|
|
+ string snItem = items.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
+ {
|
|
|
+ ProductMainSN = snItem.Replace("sn=", "").Trim();
|
|
|
+ _productService.CurrentProductCode = ProductMainSN;
|
|
|
+ await plc.WriteNodeAsync<string>(string.Format(addressConfig.In_Code.Address, 0), ProductMainSN);
|
|
|
+ SendTaskMessage($"产品主sn:{ProductMainSN}", MessageLevel.Info);
|
|
|
+ }
|
|
|
LogHelper.WriteLogMes($"询问mes失败");
|
|
|
SendTaskMessage($"询问mes失败:{response}", MessageLevel.Error);
|
|
|
}
|
|
|
@@ -2345,6 +2366,8 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+ #endregion
|
|
|
+
|
|
|
|
|
|
//不能使用全局变量,不然并发的时候会被清除掉,所以局部变量
|
|
|
var _ImageTaskList = new List<Task<(bool IsSucceed, ICogImage[] Images, string Message, int cameraIndex, Guid procedureId)>>();
|
|
|
@@ -2685,6 +2708,11 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
code = plc.ReadNode<string>(string.Format(addressConfig.In_Code.Address, i));
|
|
|
}
|
|
|
+ if (sysConfig.IsManual && i == 1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
//var homeview = _container.Resolve<HomeViewModel>();
|
|
|
if (i == 0)
|
|
|
{
|
|
|
@@ -2823,7 +2851,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
- { SendTaskMessage($"切换产品异常"+ex.Message, MessageLevel.Error); }
|
|
|
+ { SendTaskMessage($"切换产品异常" + ex.Message, MessageLevel.Error); }
|
|
|
}
|
|
|
}
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)1);
|
|
|
@@ -2910,7 +2938,9 @@ namespace TeamAAS_VP.Core
|
|
|
//{
|
|
|
// submitData.Append($"{item.PhotoName}={item.ResultData}");
|
|
|
//}
|
|
|
- string data = $"{item.PhotoName}={item.ResultData}&";
|
|
|
+ string PhotoName = item.PhotoName.Replace("?", "%3F").Replace("#", "%23").Replace("+", "%2B").Replace("/", "%2F").Replace("%", "%25");
|
|
|
+ string data = $"{PhotoName}={item.ResultData}&";
|
|
|
+ //string data = $"{item.PhotoName}={item.ResultData}&";
|
|
|
|
|
|
// 按顺序填满,不超过 3500 就加进去
|
|
|
if (submitData.Length + data.Length <= 3500)
|