|
|
@@ -1903,7 +1903,8 @@ namespace TeamAAS_VP.Core
|
|
|
//位置编号
|
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
|
SendTaskMessage(string.Format(Lang.编号0, positionIndex), MessageLevel.Info);
|
|
|
- // 开始采集压力值
|
|
|
+ // 开始采集压力值,ProductMainSN[i]
|
|
|
+ //StartPressureCollection(currentProduct.Name, _productService.CurrentProductCode, 0);
|
|
|
StartPressureCollection(currentProduct.Name, _productService.CurrentProductCode, 0);
|
|
|
}
|
|
|
else
|
|
|
@@ -2026,7 +2027,6 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
if (lockResult.Pressure >= stationConfig.DataInfo.CTQ_LSL_Pressure && lockResult.Pressure <= stationConfig.DataInfo.CTQ_USL_Pressure)
|
|
|
{
|
|
|
- SendTaskMessage($"Screw{lockResult.Number}:压力不合格", MessageLevel.Error);
|
|
|
pressureRes = true;
|
|
|
}
|
|
|
if (lockResult.LockTurns >= lockResult.TargetTurnsLowerLimit && lockResult.LockTurns <= lockResult.TargetTurnsUpperLimit)
|
|
|
@@ -2469,19 +2469,23 @@ namespace TeamAAS_VP.Core
|
|
|
if (val)
|
|
|
{
|
|
|
SendTaskMessage($"是当站螺丝:{code}", MessageLevel.Info);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_QrCodePhotoResault.Address, (Int16)1);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
SendTaskMessage($"不是当站螺丝:{code}", MessageLevel.Info);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_QrCodePhotoResault.Address, (Int16)2);
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)3);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
SendTaskMessage($"二维码扫码成功:{code}", MessageLevel.Info);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_QrCodePhotoResault.Address, (Int16)1);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
SendTaskMessage("二维码扫码失败", MessageLevel.Alarm);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_QrCodePhotoResault.Address, (Int16)2);
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)2);
|
|
|
return;
|
|
|
}
|
|
|
@@ -2490,6 +2494,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
code = "";
|
|
|
SendTaskMessage("二维码扫码失败", MessageLevel.Alarm);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_QrCodePhotoResault.Address, (Int16)2);
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)2);
|
|
|
return;
|
|
|
}
|
|
|
@@ -2546,7 +2551,10 @@ namespace TeamAAS_VP.Core
|
|
|
if (snItem != null)
|
|
|
{
|
|
|
ProductMainSN[i] = snItem.Replace("sn=", "").Trim();
|
|
|
- _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ }
|
|
|
//_eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
@@ -2793,9 +2801,10 @@ namespace TeamAAS_VP.Core
|
|
|
else if (state == 2)
|
|
|
{
|
|
|
DFC.Clear();//CTQ数据集合
|
|
|
-
|
|
|
- //获取当前工位的配置
|
|
|
+ // string productccode = ProductMainSN[i];
|
|
|
+ //获取当前工位的配置
|
|
|
var stationConfig = _configService.GetDeviceInfo(i);
|
|
|
+ var sysConfig = _configService.GetSystemConfiguration();
|
|
|
SendTaskMessage($"收到{i}:{stationConfig.DeviceName}上传本站数据请求...", MessageLevel.Debug);
|
|
|
//从服务器中获取当前时间
|
|
|
LogHelper.WriteLogMes($"【从服务器中获取当前时间】");
|
|
|
@@ -2951,21 +2960,23 @@ namespace TeamAAS_VP.Core
|
|
|
upvlalue = Convert.ToDouble(currentProduct.GlobalParamEx.CC1DownLimit.ToString("F3"));
|
|
|
doenvlaue = Convert.ToDouble(currentProduct.GlobalParamEx.CC1UpLimit.ToString("F3"));
|
|
|
midValue = ((currentProduct.GlobalParamEx.CC1DownLimit + currentProduct.GlobalParamEx.CC1UpLimit) / 2).ToString("F3");
|
|
|
+ if (Convert.ToDouble(item.Value) < upvlalue || Convert.ToDouble(item.Value) > doenvlaue)
|
|
|
+ {
|
|
|
+ resultToMes.Add($"CC{item.Key}_Fail");
|
|
|
+ SendTaskMessage($"CC{item.Key}:超限", MessageLevel.Error);
|
|
|
+ }
|
|
|
break;
|
|
|
case "2":
|
|
|
upvlalue = Convert.ToDouble(currentProduct.GlobalParamEx.CC2DownLimit.ToString("F3"));
|
|
|
doenvlaue = Convert.ToDouble(currentProduct.GlobalParamEx.CC2UpLimit.ToString("F3"));
|
|
|
midValue = ((currentProduct.GlobalParamEx.CC2DownLimit + currentProduct.GlobalParamEx.CC2UpLimit) / 2).ToString("F3");
|
|
|
+ if (Convert.ToDouble(item.Value) < upvlalue || Convert.ToDouble(item.Value) > doenvlaue)
|
|
|
+ {
|
|
|
+ resultToMes.Add($"CC{item.Key}_Fail");
|
|
|
+ SendTaskMessage($"CC{item.Key}:超限", MessageLevel.Error);
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
- if (doenvlaue <= currentProduct.GlobalParamEx.CC1DownLimit || doenvlaue >= currentProduct.GlobalParamEx.CC1UpLimit)
|
|
|
- {
|
|
|
- pressureRes = false;
|
|
|
- }
|
|
|
- if (doenvlaue <= currentProduct.GlobalParamEx.CC2DownLimit || doenvlaue >= currentProduct.GlobalParamEx.CC2UpLimit)
|
|
|
- {
|
|
|
- pressureRes = false;
|
|
|
- }
|
|
|
dataToMes.Add($"CC{item.Key}", $"{item.Value}");
|
|
|
DFC.Add(new DataFormCtq
|
|
|
{
|
|
|
@@ -3000,6 +3011,13 @@ namespace TeamAAS_VP.Core
|
|
|
//上传mes
|
|
|
if (stationConfig.EnableMES)
|
|
|
{
|
|
|
+
|
|
|
+ //测试使用,强制上传mes为pass
|
|
|
+ if (sysConfig.IsMesResult)
|
|
|
+ {
|
|
|
+ resultToMes.Clear();
|
|
|
+ }
|
|
|
+
|
|
|
(bool isSuccess, string response) = await _mesService.SubmitGetExAsync(ProductMainSN[i], "", dataToMes, resultToMes, _LastMesCheckTime[i], serverTimeResult.Now);
|
|
|
if (isSuccess)
|
|
|
{
|