|
@@ -1625,11 +1625,11 @@ namespace MainForm
|
|
string processItem,
|
|
string processItem,
|
|
string workorder_code, string batch_num, string mtltmrk, string proDate,
|
|
string workorder_code, string batch_num, string mtltmrk, string proDate,
|
|
string supplierCode, string sn, bool pass, string vehicleSn, string vehicleSlot, string MachineId,
|
|
string supplierCode, string sn, bool pass, string vehicleSn, string vehicleSlot, string MachineId,
|
|
- string StationId, string PartBarcode, string jsonParm, string direction = "")
|
|
|
|
|
|
+ string StationId, string PartBarcode, string detailjson, XmStationOut_InspectionItemData inspectionItemData, string direction = "")
|
|
{
|
|
{
|
|
return SaveProcessDataByDB(stationNameStr, items, equipmentCode, processItem, workorder_code, batch_num,
|
|
return SaveProcessDataByDB(stationNameStr, items, equipmentCode, processItem, workorder_code, batch_num,
|
|
mtltmrk,
|
|
mtltmrk,
|
|
- proDate, supplierCode, sn, pass, vehicleSn, vehicleSlot, MachineId, StationId, PartBarcode, jsonParm,
|
|
|
|
|
|
+ proDate, supplierCode, sn, pass, vehicleSn, vehicleSlot, MachineId, StationId, PartBarcode, detailjson, inspectionItemData,
|
|
direction);
|
|
direction);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1649,7 +1649,7 @@ namespace MainForm
|
|
public int SaveProcessDataByDB(string stationNameStr, List<TestItem> items, string equipmentCode,
|
|
public int SaveProcessDataByDB(string stationNameStr, List<TestItem> items, string equipmentCode,
|
|
string processItem, string workorder_code, string batch_num, string mtltmrk,
|
|
string processItem, string workorder_code, string batch_num, string mtltmrk,
|
|
string proDate, string supplierCode, string sn, bool pass, string vehicleSn, string vehicleSlot,
|
|
string proDate, string supplierCode, string sn, bool pass, string vehicleSn, string vehicleSlot,
|
|
- string machineId, string stationId, string partBarcode, string jsonParm, string direction = "")
|
|
|
|
|
|
+ string machineId, string stationId, string partBarcode, string detailjson, XmStationOut_InspectionItemData inspectionItemData, string direction = "")
|
|
{
|
|
{
|
|
int upload = 0;
|
|
int upload = 0;
|
|
int result = 0;
|
|
int result = 0;
|
|
@@ -1706,16 +1706,16 @@ namespace MainForm
|
|
}); // 设备数据 - 部件码
|
|
}); // 设备数据 - 部件码
|
|
}
|
|
}
|
|
|
|
|
|
- //过站明细
|
|
|
|
|
|
+ #region 过站明细
|
|
if (GlobalContext.IsSendProcessDetail)
|
|
if (GlobalContext.IsSendProcessDetail)
|
|
{
|
|
{
|
|
- if (jsonParm.Length > 0)
|
|
|
|
|
|
+ if (detailjson.Length > 0)
|
|
{
|
|
{
|
|
- //jsonParm = "{\"fGlueSupplySpeed\":0.63,\"fAB_AirPress\":0.0,\"fAB_AirPressDiff\":0.0,\"fMesHeightInfos\":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],\"fIntervalWeights\":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],\"fRemainGlues\":[600.0,600.0]}";
|
|
|
|
|
|
+ //detailjson = "{\"fGlueSupplySpeed\":0.63,\"fAB_AirPress\":0.0,\"fAB_AirPressDiff\":0.0,\"fMesHeightInfos\":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],\"fIntervalWeights\":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],\"fRemainGlues\":[600.0,600.0]}";
|
|
// 解析JSON字符串为字典
|
|
// 解析JSON字符串为字典
|
|
- jsonParm = jsonParm.Replace("[", "\"[");
|
|
|
|
- jsonParm = jsonParm.Replace("]", "]\"");
|
|
|
|
- var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonParm);
|
|
|
|
|
|
+ detailjson = detailjson.Replace("[", "\"[");
|
|
|
|
+ detailjson = detailjson.Replace("]", "]\"");
|
|
|
|
+ var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(detailjson);
|
|
foreach (var kvp in dictionary)
|
|
foreach (var kvp in dictionary)
|
|
{
|
|
{
|
|
outRequest_Body.unitData.processData.Add(
|
|
outRequest_Body.unitData.processData.Add(
|
|
@@ -1727,8 +1727,28 @@ namespace MainForm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 测试项
|
|
|
|
+ if (GlobalContext.IsSendTestData)
|
|
|
|
+ {
|
|
|
|
+ if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
|
|
+ {
|
|
|
|
+ outRequest_Body.unitData.inspectionItemData.Add(
|
|
|
|
+ new XmStationOut_InspectionItemData()
|
|
|
|
+ {
|
|
|
|
+ childUnitSn = inspectionItemData.childUnitSn,
|
|
|
|
+ childUnitState = inspectionItemData.childUnitState,
|
|
|
|
+ toolVersion = inspectionItemData.toolVersion,
|
|
|
|
+ dataItem = inspectionItemData.dataItem,
|
|
|
|
|
|
- //OP30站读txt数据
|
|
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region OP30站读txt数据
|
|
if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
{
|
|
{
|
|
string path = "";
|
|
string path = "";
|
|
@@ -1767,9 +1787,12 @@ namespace MainForm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ #endregion
|
|
|
|
|
|
- string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ #region 上传MES
|
|
|
|
+ string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
if (GlobalContext.IsSendProcessData)
|
|
if (GlobalContext.IsSendProcessData)
|
|
{
|
|
{
|
|
XmMES_StationOutResponse response = new XmMES_StationOutResponse();
|
|
XmMES_StationOutResponse response = new XmMES_StationOutResponse();
|
|
@@ -1814,6 +1837,7 @@ namespace MainForm
|
|
JsonConvert.SerializeObject(response), id);
|
|
JsonConvert.SerializeObject(response), id);
|
|
SQLHelper_New.ExecuteNonQuery(sql_UpStationout, null);
|
|
SQLHelper_New.ExecuteNonQuery(sql_UpStationout, null);
|
|
}
|
|
}
|
|
|
|
+ #endregion
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
@@ -1843,10 +1867,10 @@ namespace MainForm
|
|
request.function_name = "Machine_加⼯模块";
|
|
request.function_name = "Machine_加⼯模块";
|
|
request.status = "PASS";
|
|
request.status = "PASS";
|
|
(int, string) iotResult = (0, "");
|
|
(int, string) iotResult = (0, "");
|
|
- if (jsonParm.Length > 0)
|
|
|
|
|
|
+ if (detailjson.Length > 0)
|
|
{
|
|
{
|
|
// 解析JSON字符串为字典
|
|
// 解析JSON字符串为字典
|
|
- var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonParm);
|
|
|
|
|
|
+ var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(detailjson);
|
|
foreach (var kvp in dictionary)
|
|
foreach (var kvp in dictionary)
|
|
{
|
|
{
|
|
test_item_num += 1;
|
|
test_item_num += 1;
|
|
@@ -2821,62 +2845,82 @@ namespace MainForm
|
|
AddMessage(LogType.Info, "【装备配置】上传失败!错误原因:" + iotResult.Item2 );
|
|
AddMessage(LogType.Info, "【装备配置】上传失败!错误原因:" + iotResult.Item2 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ private static readonly object _oeeLock = new object();
|
|
private void 通用节拍接口(int plcNo, string stationNameStr, string tagMesCommName, string CarrierBarcode,
|
|
private void 通用节拍接口(int plcNo, string stationNameStr, string tagMesCommName, string CarrierBarcode,
|
|
IoT_DataSet_t iot_data, out int res)
|
|
IoT_DataSet_t iot_data, out int res)
|
|
{
|
|
{
|
|
- Stopwatch stopwatch1 = new Stopwatch();
|
|
|
|
- Stopwatch stopwatch2 = new Stopwatch();
|
|
|
|
-
|
|
|
|
- string resultStr = string.Empty;
|
|
|
|
- try
|
|
|
|
|
|
+ lock (_oeeLock) // 保证同一时间只有一个任务执行
|
|
{
|
|
{
|
|
- string oEEType = iot_data.beatAction.ToString(); // 节拍类型(plc写入)
|
|
|
|
- string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode); //产品SN
|
|
|
|
- bool actionBool = Enum.TryParse(oEEType, out XiaomiDeviceOEE deviceOEE);
|
|
|
|
- (short, string) result = (0, "");
|
|
|
|
|
|
+ Stopwatch stopwatch1 = new Stopwatch();
|
|
|
|
+ Stopwatch stopwatch2 = new Stopwatch();
|
|
|
|
|
|
- // 上传开始节拍 节拍只需要PLC传1、3、4、5
|
|
|
|
- result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
- //上传结束节拍
|
|
|
|
- switch (oEEType)
|
|
|
|
|
|
+ string resultStr = string.Empty;
|
|
|
|
+ try
|
|
{
|
|
{
|
|
- case "1":
|
|
|
|
- Enum.TryParse("2", out deviceOEE);
|
|
|
|
- result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
- break;
|
|
|
|
- case "5":
|
|
|
|
- Enum.TryParse("6", out deviceOEE);
|
|
|
|
- result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ string oEEType = iot_data.beatAction.ToString(); // 节拍类型(plc写入)
|
|
|
|
+ string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode); //产品SN
|
|
|
|
+ bool actionBool = Enum.TryParse(oEEType, out XiaomiDeviceOEE deviceOEE);
|
|
|
|
+ (short, string) result = (0, "");
|
|
|
|
|
|
- if (result.Item1 == 1)
|
|
|
|
- {
|
|
|
|
- OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]上传成功!");
|
|
|
|
- //写入PLC
|
|
|
|
- IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
|
|
- iotData.machineState = iot_data.machineState;
|
|
|
|
- iotData.work_type = iot_data.work_type;
|
|
|
|
- iotData.testStatus = iot_data.testStatus;
|
|
|
|
- iotData.beatAction = 0;
|
|
|
|
- iotData.beatReturn = 1; //OK
|
|
|
|
- iotData.fault_codes = iot_data.fault_codes;
|
|
|
|
- (int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
|
|
- if (PLCresult.Item1 == 0)
|
|
|
|
|
|
+ // 上传开始节拍 节拍只需要PLC传1、3、4、5
|
|
|
|
+ result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
+ //上传结束节拍
|
|
|
|
+ switch (oEEType)
|
|
|
|
+ {
|
|
|
|
+ case "1":
|
|
|
|
+ Enum.TryParse("2", out deviceOEE);
|
|
|
|
+ result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
+ break;
|
|
|
|
+ case "5":
|
|
|
|
+ Enum.TryParse("6", out deviceOEE);
|
|
|
|
+ result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (result.Item1 == 1)
|
|
{
|
|
{
|
|
- res = 1;
|
|
|
|
- OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]写入成功!");
|
|
|
|
|
|
+ OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]上传成功!");
|
|
|
|
+ //写入PLC
|
|
|
|
+ IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
|
|
+ iotData.machineState = iot_data.machineState;
|
|
|
|
+ iotData.work_type = iot_data.work_type;
|
|
|
|
+ iotData.testStatus = iot_data.testStatus;
|
|
|
|
+ iotData.beatAction = 0;
|
|
|
|
+ iotData.beatReturn = 1; //OK
|
|
|
|
+ iotData.fault_codes = iot_data.fault_codes;
|
|
|
|
+ (int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
|
|
+ if (PLCresult.Item1 == 0)
|
|
|
|
+ {
|
|
|
|
+ res = 1;
|
|
|
|
+ OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]写入成功!");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ res = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
res = 0;
|
|
res = 0;
|
|
|
|
+ OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]接口出错!错误信息:" + result.Item2);
|
|
|
|
+ //写入PLC
|
|
|
|
+ IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
|
|
+ iotData.machineState = iot_data.machineState;
|
|
|
|
+ iotData.work_type = iot_data.work_type;
|
|
|
|
+ iotData.testStatus = iot_data.testStatus;
|
|
|
|
+ iotData.beatAction = 0;
|
|
|
|
+ iotData.beatReturn = 2; //NG
|
|
|
|
+ iotData.fault_codes = iot_data.fault_codes;
|
|
|
|
+ (int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ catch (Exception ex)
|
|
{
|
|
{
|
|
res = 0;
|
|
res = 0;
|
|
- OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]接口出错!错误信息:" + result.Item2);
|
|
|
|
|
|
+ string str = ex.StackTrace;
|
|
|
|
+ AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
|
+ $"PLC{plcNo}_{stationNameStr} 节拍接口出错!错误信息:" + ex.Message + "异常位置:" +
|
|
|
|
+ str.Substring(str.LastIndexOf("\\") + 1, str.Length - str.LastIndexOf("\\") - 1));
|
|
//写入PLC
|
|
//写入PLC
|
|
IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
iotData.machineState = iot_data.machineState;
|
|
iotData.machineState = iot_data.machineState;
|
|
@@ -2888,23 +2932,7 @@ namespace MainForm
|
|
(int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
(int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- catch (Exception ex)
|
|
|
|
- {
|
|
|
|
- res = 0;
|
|
|
|
- string str = ex.StackTrace;
|
|
|
|
- AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
|
- $"PLC{plcNo}_{stationNameStr} 节拍接口出错!错误信息:" + ex.Message + "异常位置:" +
|
|
|
|
- str.Substring(str.LastIndexOf("\\") + 1, str.Length - str.LastIndexOf("\\") - 1));
|
|
|
|
- //写入PLC
|
|
|
|
- IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
|
|
- iotData.machineState = iot_data.machineState;
|
|
|
|
- iotData.work_type = iot_data.work_type;
|
|
|
|
- iotData.testStatus = iot_data.testStatus;
|
|
|
|
- iotData.beatAction = 0;
|
|
|
|
- iotData.beatReturn = 2; //NG
|
|
|
|
- iotData.fault_codes = iot_data.fault_codes;
|
|
|
|
- (int, string) PLCresult = WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, iotData);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -3439,13 +3467,10 @@ namespace MainForm
|
|
AddMessage(LogType.Info, stationNameStr + "_进站开始");
|
|
AddMessage(LogType.Info, stationNameStr + "_进站开始");
|
|
//10扫码改造注释(临时)
|
|
//10扫码改造注释(临时)
|
|
//string sn = (string)stPLC_MesData.BarcodeSet.strProductBarcode; // 产品SN(物料码),现在PLC只有OP10和OP50返回
|
|
//string sn = (string)stPLC_MesData.BarcodeSet.strProductBarcode; // 产品SN(物料码),现在PLC只有OP10和OP50返回
|
|
- string CarrierBarcode = (string)stPLC_MesData.BarcodeSet.strCarrierBarcode; // 载具条码;
|
|
|
|
|
|
+ //string CarrierBarcode = (string)stPLC_MesData.BarcodeSet.strCarrierBarcode; // 载具条码;
|
|
string sn = _strProductBarcode;
|
|
string sn = _strProductBarcode;
|
|
- if (string.IsNullOrEmpty(CarrierBarcode))
|
|
|
|
- {
|
|
|
|
- //获取手持扫码枪的载具码
|
|
|
|
- CarrierBarcode = _strCarrierBarcode;
|
|
|
|
- }
|
|
|
|
|
|
+ string CarrierBarcode = _strCarrierBarcode;
|
|
|
|
+
|
|
string MachineId = GlobalContext.S1_MachineId; // 装备ID(可配置)
|
|
string MachineId = GlobalContext.S1_MachineId; // 装备ID(可配置)
|
|
string StationId = GlobalContext.S1_StationId; // 工位ID(可配置)
|
|
string StationId = GlobalContext.S1_StationId; // 工位ID(可配置)
|
|
int a1Result = (int)stPLC_MesData.iotData.testStatus; // 产品结果
|
|
int a1Result = (int)stPLC_MesData.iotData.testStatus; // 产品结果
|
|
@@ -3607,7 +3632,7 @@ namespace MainForm
|
|
//出站接口
|
|
//出站接口
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
- MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|
|
@@ -4065,7 +4090,7 @@ namespace MainForm
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
- MachineId, StationId, PartBarcode, paramJson);
|
|
|
|
|
|
+ MachineId, StationId, PartBarcode, paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|
|
@@ -4202,6 +4227,13 @@ namespace MainForm
|
|
//stPLC_MesData.Left.iotData.beatAction = 2;
|
|
//stPLC_MesData.Left.iotData.beatAction = 2;
|
|
//stPLC_MesData.Left.BarcodeSet.strCarrierBarcode = "A123456";
|
|
//stPLC_MesData.Left.BarcodeSet.strCarrierBarcode = "A123456";
|
|
|
|
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPressDiff = 2.5f;
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPressDiffMax = 2.5f;
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPressDiffMin = 0;
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPress = 0.1f;
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPressMax = 0.2f;
|
|
|
|
+ //stPLC_MesData.Left.testData.fAB_AirPressMin = 0;
|
|
|
|
+
|
|
#region 去除扫码产生的特殊字符
|
|
#region 去除扫码产生的特殊字符
|
|
|
|
|
|
stPLC_MesData.Left.BarcodeSet.strProductBarcode =
|
|
stPLC_MesData.Left.BarcodeSet.strProductBarcode =
|
|
@@ -4610,7 +4642,6 @@ namespace MainForm
|
|
{
|
|
{
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
Stopwatch stopwatch2 = new Stopwatch();
|
|
Stopwatch stopwatch2 = new Stopwatch();
|
|
-
|
|
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -4690,13 +4721,51 @@ namespace MainForm
|
|
//}
|
|
//}
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
#endregion
|
|
#endregion
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
|
- //if (direction == "Right")
|
|
|
|
- //{
|
|
|
|
|
|
+ string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
|
|
|
|
+
|
|
|
|
+ #region MAS测试项
|
|
|
|
+ XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
|
|
|
|
+ string passFlag = "";
|
|
|
|
+ string AllpassFlag = "PASS";
|
|
|
|
+
|
|
|
|
+ float fAB_AirPressDiff = stPLC_MesData.testData.fAB_AirPressDiff;
|
|
|
|
+ float fAB_AirPressDiffMax = stPLC_MesData.testData.fAB_AirPressDiffMax;
|
|
|
|
+ float fAB_AirPressDiffMin = stPLC_MesData.testData.fAB_AirPressDiffMin;
|
|
|
|
+ float fAB_AirPress = stPLC_MesData.testData.fAB_AirPress;
|
|
|
|
+ float fAB_AirPressMax = stPLC_MesData.testData.fAB_AirPressMax;
|
|
|
|
+ float fAB_AirPressMin = stPLC_MesData.testData.fAB_AirPressMin;
|
|
|
|
+
|
|
|
|
+ XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
|
|
|
|
+ if (fAB_AirPressDiffMax > fAB_AirPressDiffMin && (fAB_AirPressDiffMax != 0 || fAB_AirPressDiffMin != 0))
|
|
|
|
+ {
|
|
|
|
+ if (fAB_AirPressDiff > fAB_AirPressDiffMin && fAB_AirPressDiff <= fAB_AirPressDiffMax)
|
|
|
|
+ passFlag = "PASS";
|
|
|
|
+ else
|
|
|
|
+ passFlag = "FAIL";
|
|
|
|
+
|
|
|
|
+ if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
|
+ inspectionItemData.AddDataItem("","AB管气压", fAB_AirPressDiff.ToString(), fAB_AirPressDiffMax.ToString(), fAB_AirPressDiffMin.ToString(), passFlag);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (fAB_AirPressMax > fAB_AirPressMin && (fAB_AirPressMax != 0 || fAB_AirPressMin != 0))
|
|
|
|
+ {
|
|
|
|
+ if (fAB_AirPress > fAB_AirPressMin && fAB_AirPress <= fAB_AirPressMax)
|
|
|
|
+ passFlag = "PASS";
|
|
|
|
+ else
|
|
|
|
+ passFlag = "FAIL";
|
|
|
|
+
|
|
|
|
+ if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
|
+ inspectionItemData.AddDataItem("","AB管气压差", fAB_AirPress.ToString(), fAB_AirPressMax.ToString(), fAB_AirPressMin.ToString(), passFlag);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ inspectionItemData.childUnitSn = strProductBarcode;
|
|
|
|
+ inspectionItemData.childUnitState = AllpassFlag;
|
|
|
|
+ inspectionItemData.toolVersion = "1.0";
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
- , workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,slot,
|
|
|
|
- MachineId, StationId, "", paramJson, direction);
|
|
|
|
- //}
|
|
|
|
|
|
+ , workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, strProductBarcode, pass, CarrierBarcode,slot,
|
|
|
|
+ MachineId, StationId, "", paramJson, inspectionItemData, direction);
|
|
|
|
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
@@ -5190,7 +5259,7 @@ namespace MainForm
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,
|
|
- "01-SLOT-01", MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ "01-SLOT-01", MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|
|
@@ -5716,7 +5785,7 @@ namespace MainForm
|
|
result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem, workorder_code,
|
|
result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem, workorder_code,
|
|
batch_num
|
|
batch_num
|
|
, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01", MachineId, StationId,
|
|
, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01", MachineId, StationId,
|
|
- PartBarcode, paramJson);
|
|
|
|
|
|
+ PartBarcode, paramJson,new XmStationOut_InspectionItemData(), "");
|
|
uuid = "";
|
|
uuid = "";
|
|
}
|
|
}
|
|
else if (stPLC_MesData.mesCommFrmPLC.cmdParam == 1)
|
|
else if (stPLC_MesData.mesCommFrmPLC.cmdParam == 1)
|
|
@@ -6264,7 +6333,7 @@ namespace MainForm
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
- MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|
|
@@ -6909,7 +6978,7 @@ namespace MainForm
|
|
//{
|
|
//{
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem, workorder_code,
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem, workorder_code,
|
|
batch_num, mtltmrk, plcDate_YMD, supplierCode
|
|
batch_num, mtltmrk, plcDate_YMD, supplierCode
|
|
- , sn, pass, CarrierBarcode, slot, MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ , sn, pass, CarrierBarcode, slot, MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
//}
|
|
//}
|
|
|
|
|
|
@@ -7414,7 +7483,7 @@ namespace MainForm
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
- MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|
|
@@ -7861,7 +7930,7 @@ namespace MainForm
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
- MachineId, StationId, "", paramJson);
|
|
|
|
|
|
+ MachineId, StationId, "", paramJson,new XmStationOut_InspectionItemData(), "");
|
|
|
|
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
byte mesResultFrmWeb = (byte)(result1 == 1 ? 1 : 110);
|
|
if (mesResultFrmWeb == 1)
|
|
if (mesResultFrmWeb == 1)
|