|
@@ -24,26 +24,47 @@ namespace SCADA_DAQ.Customer
|
|
|
{
|
|
|
var MesUploadData = new MESUploadData();
|
|
|
var url = $"{CustomerConfig.MESInfo.MesDataUrl}";
|
|
|
- for (int i = 0; i < productData.ProcessDatas.Count; i++)
|
|
|
+ //for (int i = 0; i < productData.ProcessDatas.Count; i++) ///每一秒的数据进行上传
|
|
|
+ //{
|
|
|
+ // var result = "FAIL";
|
|
|
+ // var value = new List<ProductProcessData>();
|
|
|
+ // if (productData.ProcessDatas[i].Power >= CustomerConfig.SetPower.MinPower && productData.ProcessDatas[i].Power <= CustomerConfig.SetPower.MaxPower)
|
|
|
+ // {
|
|
|
+ // result = "PASS";
|
|
|
+ // }
|
|
|
+ // for (int j = 0; j < 3; j++)
|
|
|
+ // {
|
|
|
+ // value.Add(SplitSecondData(productData.ProcessDatas[i], j, result));
|
|
|
+ // }
|
|
|
+ // MesUploadData.DETAIL.Add(new ProductData
|
|
|
+ // {
|
|
|
+ // stepNum = (i + 1).ToString(),
|
|
|
+ // stepResult = result,
|
|
|
+ // Args = value
|
|
|
+ // });
|
|
|
+ //}
|
|
|
+
|
|
|
+ //只上传单条峰值功率数据
|
|
|
+ var value = productData.ProcessDatas.Max(i=>i.Power);
|
|
|
+ var result = "FAIL";
|
|
|
+ string errCode = "0625";
|
|
|
+ if(value >= CustomerConfig.SetPower.MinPower && value <= CustomerConfig.SetPower.MaxPower)
|
|
|
{
|
|
|
- var result = "FAIL";
|
|
|
- var value = new List<ProductProcessData>();
|
|
|
- if (productData.ProcessDatas[i].Power >= CustomerConfig.SetPower.MinPower && productData.ProcessDatas[i].Power <= CustomerConfig.SetPower.MaxPower)
|
|
|
- {
|
|
|
- result = "PASS";
|
|
|
- }
|
|
|
- for (int j = 0; j < 3; j++)
|
|
|
- {
|
|
|
- value.Add(SplitSecondData(productData.ProcessDatas[i], j, result));
|
|
|
- }
|
|
|
- MesUploadData.DETAIL.Add(new ProductData
|
|
|
- {
|
|
|
- stepNum = (i + 1).ToString(),
|
|
|
- stepResult = result,
|
|
|
- Args = value
|
|
|
- });
|
|
|
+ result = "PASS";
|
|
|
+ errCode = "";
|
|
|
}
|
|
|
-
|
|
|
+ MesUploadData.DETAIL.Add(new ProductData
|
|
|
+ {
|
|
|
+ stepNum = "1",
|
|
|
+ stepResult = result,
|
|
|
+ errCode = errCode,
|
|
|
+ Args = new List<ProductProcessData> { new ProductProcessData {
|
|
|
+ Comment = "功率",
|
|
|
+ Result = result,
|
|
|
+ Value = Math.Round(value,2),
|
|
|
+ UOM = "W"
|
|
|
+ }}
|
|
|
+ });
|
|
|
MesUploadData.DATATIME_ACQUISITION = productData.CreateTime;
|
|
|
MesUploadData.TEST_STATUS = productData.TestResult == SCADA.CommonLib.TestResult.OK ? "PASS" : "FAIL";
|
|
|
MesUploadData.BarCode = productData.Barcode;
|
|
@@ -227,12 +248,12 @@ namespace SCADA_DAQ.Customer
|
|
|
|
|
|
public string stepResult { get; set; }
|
|
|
|
|
|
- public string errCode { get; set; } = "";
|
|
|
+ public string errCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 产品测试过程数据明细
|
|
|
/// </summary>
|
|
|
- public List<ProductProcessData> Args { get; set; } = new List<ProductProcessData>();
|
|
|
+ public List<ProductProcessData> Args { get; set; }
|
|
|
}
|
|
|
|
|
|
public class ProductProcessData
|