|
@@ -1765,17 +1765,17 @@ namespace TeamAAS_VP.Core
|
|
|
//吸嘴数量+1
|
|
//吸嘴数量+1
|
|
|
NumStatistics.NozzleNum = await _systemDatabaseService.IncrementLatestNozzleLockCountAsync(currentUserName);
|
|
NumStatistics.NozzleNum = await _systemDatabaseService.IncrementLatestNozzleLockCountAsync(currentUserName);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
|
|
|
|
|
- // 停止采集压力并保存
|
|
|
|
|
- await StopAndSavePressureCollectionAsync(currentProduct.Name, _productService.CurrentProductCode, positionIndex);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- SendTaskMessage(Lang.停止锁付信号已关闭, MessageLevel.Alarm);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
|
|
|
|
|
+ // 停止采集压力并保存
|
|
|
|
|
+ await StopAndSavePressureCollectionAsync(currentProduct.Name, _productService.CurrentProductCode, positionIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ SendTaskMessage(Lang.停止锁付信号已关闭, MessageLevel.Alarm);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
// 多相机坐标合并
|
|
// 多相机坐标合并
|
|
|
else if (addressConfig.In_RequestPosition.Address.Contains(tuple.nodeId))
|
|
else if (addressConfig.In_RequestPosition.Address.Contains(tuple.nodeId))
|
|
|
{
|
|
{
|
|
@@ -1867,7 +1867,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 过站检查
|
|
// 过站检查
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1932,7 +1932,6 @@ namespace TeamAAS_VP.Core
|
|
|
swCT.Stop();
|
|
swCT.Stop();
|
|
|
CTtime = Math.Round(swCT.Elapsed.TotalSeconds, 3);
|
|
CTtime = Math.Round(swCT.Elapsed.TotalSeconds, 3);
|
|
|
WriteProductLog(lockResultsAll, code, CTtime);
|
|
WriteProductLog(lockResultsAll, code, CTtime);
|
|
|
- lockResultsAll.Clear();
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1970,7 +1969,7 @@ namespace TeamAAS_VP.Core
|
|
|
/// <param name="productName">配方名称</param>
|
|
/// <param name="productName">配方名称</param>
|
|
|
/// <param name="productCode">产品编号</param>
|
|
/// <param name="productCode">产品编号</param>
|
|
|
/// <param name="positionIndex">锁付点编号</param>
|
|
/// <param name="positionIndex">锁付点编号</param>
|
|
|
- private void StartPressureCollection(string productName,string productCode, int positionIndex)
|
|
|
|
|
|
|
+ private void StartPressureCollection(string productName, string productCode, int positionIndex)
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
@@ -2016,7 +2015,7 @@ namespace TeamAAS_VP.Core
|
|
|
if (_pressureTimeoutCts.IsCancellationRequested && !_pressureCts.IsCancellationRequested)
|
|
if (_pressureTimeoutCts.IsCancellationRequested && !_pressureCts.IsCancellationRequested)
|
|
|
{
|
|
{
|
|
|
SendTaskMessage("Pressure collection timed out, saving collected data.", MessageLevel.Alarm);
|
|
SendTaskMessage("Pressure collection timed out, saving collected data.", MessageLevel.Alarm);
|
|
|
- await StopAndSavePressureCollectionAsync(productName, productCode,positionIndex);
|
|
|
|
|
|
|
+ await StopAndSavePressureCollectionAsync(productName, productCode, positionIndex);
|
|
|
}
|
|
}
|
|
|
}, token);
|
|
}, token);
|
|
|
}
|
|
}
|
|
@@ -2164,7 +2163,7 @@ namespace TeamAAS_VP.Core
|
|
|
/// 产品锁付记录进行存储
|
|
/// 产品锁付记录进行存储
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="result">结果</param>
|
|
/// <param name="result">结果</param>
|
|
|
- public void WriteProductLog(List<LockResult> lockResults,string rfid,double ct)
|
|
|
|
|
|
|
+ public void WriteProductLog(List<LockResult> lockResults, string rfid, double ct)
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
@@ -2183,7 +2182,7 @@ namespace TeamAAS_VP.Core
|
|
|
string path = $"E:\\Data\\生产数据\\{dt.ToString("yyyy-MM")}\\{dt.ToString("yyyy-MM-dd")}.csv";
|
|
string path = $"E:\\Data\\生产数据\\{dt.ToString("yyyy-MM")}\\{dt.ToString("yyyy-MM-dd")}.csv";
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
|
//具体的ct需要优化
|
|
//具体的ct需要优化
|
|
|
- sb.Append($"{dt.ToString("yyyy-MM-dd HH:mm:ss")},{lockResults[0].ProductName},{Math.Round(ct, 3)},{rfid},{result},{lockResults[number-1].NozzleNumber},{lockResults[number - 1].HeadNumber},");
|
|
|
|
|
|
|
+ sb.Append($"{dt.ToString("yyyy-MM-dd HH:mm:ss")},{lockResults[0].ProductName},{Math.Round(ct, 3)},{rfid},{result},{lockResults[number - 1].NozzleNumber},{lockResults[number - 1].HeadNumber},");
|
|
|
foreach (var item in lockResults)
|
|
foreach (var item in lockResults)
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
@@ -2230,6 +2229,8 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
{
|
|
|
LogHelper.WriteLogError("写入产品记录时出错!", ex);
|
|
LogHelper.WriteLogError("写入产品记录时出错!", ex);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ lockResultsAll.Clear();
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|