|
@@ -44,6 +44,8 @@ using static MainForm.ClassFile.XiaomiAPI.XiaomiMqttClient_Extend;
|
|
using System.Net.Http;
|
|
using System.Net.Http;
|
|
using static MainForm.ClassFile.XiaomiAPI_MES.XiaomiMESHttp_UpLoadFile;
|
|
using static MainForm.ClassFile.XiaomiAPI_MES.XiaomiMESHttp_UpLoadFile;
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
|
|
|
+using System.Reflection;
|
|
|
|
+using static MainForm.ClassFile.XiaomiAPI_MES.XiaomiMESHttp_StationOutbound.XmMES_StationOutRequest_Body;
|
|
|
|
|
|
/*
|
|
/*
|
|
* 注:本源码对外提供,所以有些地方使用中文命名方法及变量
|
|
* 注:本源码对外提供,所以有些地方使用中文命名方法及变量
|
|
@@ -1713,6 +1715,20 @@ namespace MainForm
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //过站明细
|
|
|
|
+ if (jsonParm.Length > 0)
|
|
|
|
+ {
|
|
|
|
+ // 解析JSON字符串为字典
|
|
|
|
+ var dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonParm);
|
|
|
|
+ foreach (var kvp in dictionary) {
|
|
|
|
+ outRequest_Body.unitData.processData.Add(
|
|
|
|
+ new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
|
|
|
|
+ {
|
|
|
|
+ dataName = kvp.Key.ToString(),
|
|
|
|
+ dataValue = kvp.Value.ToString()
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
|
|
|
|
@@ -2675,6 +2691,15 @@ namespace MainForm
|
|
if (!ProgressState)
|
|
if (!ProgressState)
|
|
{
|
|
{
|
|
ProgressState = true;
|
|
ProgressState = true;
|
|
|
|
+
|
|
|
|
+ stPLC_MesData.mesData.nThrowCount = 1;
|
|
|
|
+ stPLC_MesData.mesData.fCleanAirPress = 4;
|
|
|
|
+ stPLC_MesData.mesData.fCleanSpeed = 2;
|
|
|
|
+ stPLC_MesData.mesData.fWindBladeHeight = 5;
|
|
|
|
+ stPLC_MesData.mesData.fCleanTime = 2;
|
|
|
|
+ stPLC_MesData.mesData.nCleanCount = 7;
|
|
|
|
+ stPLC_MesData.mesData.nRemainCount = 1;
|
|
|
|
+
|
|
Task.Run(() => S1出站(plcNo, stationNameStr, stPLC_MesData,
|
|
Task.Run(() => S1出站(plcNo, stationNameStr, stPLC_MesData,
|
|
tagBaseName + "." + tagMesCommName, stationCode, stationName,
|
|
tagBaseName + "." + tagMesCommName, stationCode, stationName,
|
|
out ProgressState));
|
|
out ProgressState));
|
|
@@ -2900,7 +2925,24 @@ namespace MainForm
|
|
Parameter_value = sn,
|
|
Parameter_value = sn,
|
|
Parameter_unit = ""
|
|
Parameter_unit = ""
|
|
});
|
|
});
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
|
+ //创建字典
|
|
|
|
+ var dic = new Dictionary<string, string>();
|
|
|
|
+ // 获取结构体类型
|
|
|
|
+ FieldInfo[] fields = typeof(OP10_DataSet_t).GetFields();
|
|
|
|
+
|
|
|
|
+ // 遍历变量名转换成字典描述
|
|
|
|
+ foreach (FieldInfo field in fields)
|
|
|
|
+ {
|
|
|
|
+ //获取枚举描述
|
|
|
|
+ string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name, typeof(XiaomiMESEnum_ProcessData.Enum_10_ProcessData));
|
|
|
|
+ //获取过站明细的值
|
|
|
|
+ object valueObj = field.GetValue(stPLC_MesData.mesData);
|
|
|
|
+ dic.Add(name, valueObj.ToString());
|
|
|
|
+ }
|
|
|
|
+ string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
+ #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, "1", MachineId, StationId, "", paramJson);
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "1", MachineId, StationId, "", paramJson);
|