|
|
@@ -119,38 +119,6 @@ namespace TeamAAS_VP.Core
|
|
|
//键盘差值
|
|
|
public bool isValueOk;
|
|
|
|
|
|
- private System.Windows.Media.Brush _StatusBackground;
|
|
|
-
|
|
|
- public System.Windows.Media.Brush StatusBackground
|
|
|
- {
|
|
|
- get { return _StatusBackground; }
|
|
|
- set { SetProperty(ref _StatusBackground, value); }
|
|
|
- }
|
|
|
-
|
|
|
- private System.Windows.Media.Brush _RunModelBackground;
|
|
|
-
|
|
|
- public System.Windows.Media.Brush RunModelBackground
|
|
|
- {
|
|
|
- get { return _RunModelBackground; }
|
|
|
- set { SetProperty(ref _RunModelBackground, value); }
|
|
|
- }
|
|
|
-
|
|
|
- private System.Windows.Media.Brush _ManualModeBackground;
|
|
|
-
|
|
|
- public System.Windows.Media.Brush ManualModeBackground
|
|
|
- {
|
|
|
- get { return _ManualModeBackground; }
|
|
|
- set { SetProperty(ref _ManualModeBackground, value); }
|
|
|
- }
|
|
|
-
|
|
|
- private System.Windows.Media.Brush _ClearModeBackground;
|
|
|
-
|
|
|
- public System.Windows.Media.Brush ClearModeBackground
|
|
|
- {
|
|
|
- get { return _ClearModeBackground; }
|
|
|
- set { SetProperty(ref _ClearModeBackground, value); }
|
|
|
- }
|
|
|
-
|
|
|
private SerialPortClient _Scan_Client;
|
|
|
|
|
|
public SerialPortClient Scan_Client
|
|
|
@@ -1935,15 +1903,22 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_FixedCameraPickStatus.Address, (Int16)1);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
LogHelper.WriteLogMes($"第二次询问mes失败");
|
|
|
SendTaskMessage($"第二次询问mes失败:{response2}", MessageLevel.Error);
|
|
|
-
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_FixedCameraPickStatus.Address, (Int16)3);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -2180,6 +2155,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
LogHelper.WriteLogMes($"第二次询问mes失败");
|
|
|
SendTaskMessage($"第二次询问mes失败:{response2}", MessageLevel.Error);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_FixedCameraPickStatus.Address, (Int16)3);
|
|
|
string[] item = response2.Split('\n');
|
|
|
string snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
if (snItem != null)
|
|
|
@@ -2189,7 +2165,6 @@ namespace TeamAAS_VP.Core
|
|
|
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);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -2924,6 +2899,18 @@ namespace TeamAAS_VP.Core
|
|
|
|
|
|
LogHelper.WriteLogMes($"二次询问mes失败");
|
|
|
SendTaskMessage($"二次询问mes失败:{response}", MessageLevel.Error);
|
|
|
+ string[] item = response2.Split('\n');
|
|
|
+ //获取产品主sn和wo用于后续上传数据使用
|
|
|
+ string snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
+ {
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ ProductMainSN = snItem.Replace("sn=", "").Trim();
|
|
|
+ _productService.CurrentProductCode = ProductMainSN;
|
|
|
+ }
|
|
|
+ SendTaskMessage($"产品主sn:{ProductMainSN}", MessageLevel.Info);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -4082,16 +4069,12 @@ namespace TeamAAS_VP.Core
|
|
|
bool paraStatus = true;
|
|
|
try
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
var stationConfig = _configService.GetDeviceInfo(0);
|
|
|
if (!stationConfig.EnableMES || !stationConfig.EnableDoubleMes || !stationConfig.SaveCsv)
|
|
|
{
|
|
|
mesStatus = false;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
foreach (var item in Status)
|
|
|
{
|
|
|
if (item.Background == System.Windows.Media.Brushes.Red)
|