|
|
@@ -1223,6 +1223,10 @@ namespace TeamAAS_VP.Core
|
|
|
/// </summary>
|
|
|
string PartSN = "";
|
|
|
/// <summary>
|
|
|
+ /// 压力曲线编号
|
|
|
+ /// </summary>
|
|
|
+ int pngindex = 100;
|
|
|
+ /// <summary>
|
|
|
/// 产品SN
|
|
|
/// </summary>
|
|
|
string[] ProductMainSN = new string[10];//产品主sn
|
|
|
@@ -2990,7 +2994,7 @@ namespace TeamAAS_VP.Core
|
|
|
PD_ATTR_02 = ProductMainSN[i],
|
|
|
PD_ATTR_03 = PartSN,
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = "",
|
|
|
+ PD_ATTR_05 = "NA",
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -3019,7 +3023,7 @@ namespace TeamAAS_VP.Core
|
|
|
PD_ATTR_02 = ProductMainSN[i],
|
|
|
PD_ATTR_03 = PartSN,
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = "",
|
|
|
+ PD_ATTR_05 = "NA",
|
|
|
});
|
|
|
#endregion
|
|
|
}
|
|
|
@@ -3079,9 +3083,9 @@ namespace TeamAAS_VP.Core
|
|
|
ERROR_MESSAGE = presRes ? "NA" : "Pressure OOS",
|
|
|
PD_ATTR_01 = midValue,
|
|
|
PD_ATTR_02 = ProductMainSN[i],
|
|
|
- PD_ATTR_03 = "",
|
|
|
+ PD_ATTR_03 = "NA",
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = "",
|
|
|
+ PD_ATTR_05 = "NA",
|
|
|
});
|
|
|
midValue = ((currentProduct.GlobalParamEx.DownPressure.PressureTime + currentProduct.GlobalParamEx.DownPressure.PressureTime) / 2).ToString("F3");
|
|
|
DFC.Add(new DataFormCtq
|
|
|
@@ -3106,9 +3110,9 @@ namespace TeamAAS_VP.Core
|
|
|
ERROR_MESSAGE = "NA",
|
|
|
PD_ATTR_01 = midValue,
|
|
|
PD_ATTR_02 = ProductMainSN[i],
|
|
|
- PD_ATTR_03 = "",
|
|
|
+ PD_ATTR_03 = "NA",
|
|
|
PD_ATTR_04 = code,
|
|
|
- PD_ATTR_05 = "",
|
|
|
+ PD_ATTR_05 = "NA",
|
|
|
});
|
|
|
#endregion
|
|
|
}
|
|
|
@@ -3145,13 +3149,20 @@ namespace TeamAAS_VP.Core
|
|
|
DateTime dt = DateTime.Now;
|
|
|
string filename = $"{ProductMainSN[i]}_{dt.ToString("yyyyMMddHHmmss")}";
|
|
|
string csvfilename = $"{i}_{stationConfig.DeviceName}_{dt.ToString("yyyy-MM-dd")}";
|
|
|
- var device = _configService.GetDeviceInfo();
|
|
|
+ var device = _configService.GetDeviceInfo(i);
|
|
|
+ var systemConfig = _configService.GetSystemConfiguration();
|
|
|
+ var pressureSensorConfig = systemConfig.PressureSensorConfig.FirstOrDefault();
|
|
|
(bool isSuc, string resp) = await _mesService.SendFtpFileAsync(ProductMainSN[i], filename);
|
|
|
if (isSuc)
|
|
|
{
|
|
|
LogHelper.WriteLogMes($"上传数据成功");
|
|
|
SendTaskMessage($"上传数据成功", MessageLevel.Debug);
|
|
|
string filePath = $"D:\\image\\Recored\\{dt.ToString("yyyy-MM")}\\{dt.ToString("MM-dd")}\\{currentProduct.Name}\\{ProductMainSN[i]}";
|
|
|
+ string source_csv2 = $"{stationConfig.SaveCsvPath}\\{dt.ToString("yyyy-MM")}\\{i}_{stationConfig.DeviceName}_{dt.ToString("yyyy-MM-dd")}";
|
|
|
+ if (!Directory.Exists(filePath))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(filePath);
|
|
|
+ }
|
|
|
//复制csv
|
|
|
string source_csv = $"{stationConfig.SaveCsvPath}\\{dt.ToString("yyyy-MM")}\\{i}_{stationConfig.DeviceName}_{dt.ToString("yyyy-MM-dd")}.csv";
|
|
|
string target_csv = Path.Combine(filePath, Path.GetFileName(source_csv)); ;
|
|
|
@@ -3160,6 +3171,16 @@ namespace TeamAAS_VP.Core
|
|
|
string source_log = $"..\\Log\\LogInfo\\{dt.ToString("yyyy-MM")}\\{dt.ToString("yyyy-MM-dd")}.txt";
|
|
|
string target_log = Path.Combine(filePath, Path.GetFileName(source_log));
|
|
|
File.Copy(source_log, target_log, true);
|
|
|
+ if (pressureSensorConfig.IsSavePressureCurve && i == pngindex)
|
|
|
+ {
|
|
|
+ //复制曲线图
|
|
|
+ string pngfile_path = $"{pressureSensorConfig.PressureCurvePath}\\{dt.ToString("yyyy-MM")}\\{dt.ToString("MM-dd")}\\{currentProduct.Name}\\{ProductMainSN[i]}";
|
|
|
+ string pngfileName = $"{pngfile_path}\\pressure-{ProductMainSN[i]}-{pngindex}.png";
|
|
|
+ string target_png = Path.Combine(filePath, Path.GetFileName(pngfileName));
|
|
|
+ File.Copy(pngfileName, target_png, true);
|
|
|
+ SendTaskMessage($"曲线图{pngindex}复制完成", MessageLevel.Debug);
|
|
|
+ }
|
|
|
+
|
|
|
CompressionImage(filePath, filename, device.Station, device.FixtureId);
|
|
|
|
|
|
//上传csv
|
|
|
@@ -3170,7 +3191,7 @@ namespace TeamAAS_VP.Core
|
|
|
if (isAfter20 && isNewDay && !_hasCompressedToday)
|
|
|
{
|
|
|
// 执行压缩
|
|
|
- CompressionImage(source_csv, csvfilename, device.Station, device.FixtureId);
|
|
|
+ CompressionImage(source_csv2, csvfilename, device.Station, device.FixtureId);
|
|
|
_lastCompressDate = dt;
|
|
|
_hasCompressedToday = true;
|
|
|
LogHelper.WriteLogMes("csv上传数据成功");
|
|
|
@@ -3250,7 +3271,7 @@ namespace TeamAAS_VP.Core
|
|
|
//SendTaskMessage($"收到开始组装信号[{i}]...", MessageLevel.Debug);
|
|
|
SendTaskMessage($"收到开始保压信号[{i}]...", MessageLevel.Debug);
|
|
|
// 开始采集压力值
|
|
|
- StartPressureCollection(currentProduct.Name, code, i);
|
|
|
+ StartPressureCollection(currentProduct.Name, ProductMainSN[i], i);
|
|
|
StartCtqTime[i] = DateTime.Now;
|
|
|
}
|
|
|
else
|
|
|
@@ -3287,7 +3308,7 @@ namespace TeamAAS_VP.Core
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.In_WorkDone.Address, i), (Int16)0);
|
|
|
var code = plc.ReadNode<string>(string.Format(addressConfig.In_Code.Address, i));
|
|
|
// 停止采集压力并保存
|
|
|
- await StopAndSavePressureCollectionAsync(currentProduct.Name, code, i);
|
|
|
+ await StopAndSavePressureCollectionAsync(currentProduct.Name, ProductMainSN[i], i);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -3451,14 +3472,14 @@ namespace TeamAAS_VP.Core
|
|
|
if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath);
|
|
|
string csvfileName = $"pressure-{productCode}-{Index}-{DateTime.Now.ToString("HHmmss")}.csv";
|
|
|
string csvPath = Path.Combine(dirPath, csvfileName);
|
|
|
- string pngfileName = $"pressure-{productCode}-{Index}-{DateTime.Now.ToString("HHmmss")}.png";
|
|
|
+ string pngfileName = $"pressure-{productCode}-{Index}.png";
|
|
|
string pngPath = Path.Combine(dirPath, pngfileName);
|
|
|
if (!pressureSensorConfig.IsSavePressureCurve)
|
|
|
{
|
|
|
csvPath = string.Empty;
|
|
|
pngPath = string.Empty;
|
|
|
}
|
|
|
-
|
|
|
+ pngindex = Index;
|
|
|
App.Current.Dispatcher.Invoke(() =>
|
|
|
{
|
|
|
_eventAggregator.GetEvent<PressureFinishNotification>().Publish((true, Index, snapshot.ToArray(), pngPath));
|