|
@@ -1300,15 +1300,16 @@ namespace MainForm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public Dictionary<string, string> GetLastLineCompensation(string path, string direction, string sn)
|
|
|
+ /// <summary>
|
|
|
+ /// 解析三点激光存储的文本
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="path">文本路径</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string GetLastLineCompensation(string path)
|
|
|
{
|
|
|
- // 创建字典存储补偿点及其对应的值
|
|
|
- Dictionary<string, string> compensationDict = new Dictionary<string, string>();
|
|
|
-
|
|
|
+ string result = "";
|
|
|
try
|
|
|
{
|
|
|
- //string path = GlobalContext.MESLaserRPath;
|
|
|
// 获取当前日期并格式化为 "yyyy-MM-dd" 格式
|
|
|
string currentDate = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
string filename = $"Laser-{currentDate}-W0.txt";
|
|
@@ -1334,22 +1335,18 @@ namespace MainForm
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 将最后一行按逗号分隔
|
|
|
string[] values = lastLine.Split(',');
|
|
|
- values[1] = sn;
|
|
|
|
|
|
- string key = "三点激光_" + direction; // 构造键名
|
|
|
- string value = string.Join(",", values); // 获取值并去除多余空格
|
|
|
- compensationDict[key] = value;
|
|
|
-
|
|
|
- //// 提取“1点补偿”到“6点补偿”的值
|
|
|
- //for (int i = 2; i <= 7 && i < values.Length; i++) // 从索引2开始,最多提取6个值
|
|
|
- //{
|
|
|
- // string key = $"{i - 1}点补偿"; // 构造键名
|
|
|
- // string value = values[i].Trim(); // 获取值并去除多余空格
|
|
|
- // compensationDict[key] = value;
|
|
|
- //}
|
|
|
+ // 跳过前两个元素并转换为新的数组
|
|
|
+ string[] newValues = values.Skip(0).Skip(1).ToArray();
|
|
|
+ string value = string.Join(",", newValues); // 获取值并去除多余空格
|
|
|
+ value = value.Replace(" ", "").Replace("\t", "").TrimStart(',');
|
|
|
+ if (value.StartsWith(","))
|
|
|
+ {
|
|
|
+ value = value.Substring(1);
|
|
|
+ }
|
|
|
+ result = value;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1363,7 +1360,7 @@ namespace MainForm
|
|
|
Console.WriteLine($"发生错误: {ex.Message}");
|
|
|
}
|
|
|
|
|
|
- return compensationDict;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public int PCBStationOutData(BarcodeSet_t Barcode, IoT_DataSet_t iotData)
|
|
@@ -1707,33 +1704,6 @@ namespace MainForm
|
|
|
}); // 设备数据 - 部件码
|
|
|
}
|
|
|
|
|
|
- //OP30站读txt数据
|
|
|
- if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
|
- {
|
|
|
- string path = "";
|
|
|
- if (direction == "Left")
|
|
|
- {
|
|
|
- string pathStr = GlobalContext.MESLaserLPath;
|
|
|
- path = DecFileName(pathStr);
|
|
|
- }
|
|
|
- else {
|
|
|
- string pathStr = GlobalContext.MESLaserRPath;
|
|
|
- path = DecFileName(pathStr);
|
|
|
- }
|
|
|
-
|
|
|
- //字典存储数据
|
|
|
- Dictionary<string, string> compensationDict = GetLastLineCompensation(path, direction, sn);
|
|
|
- foreach (var kvp in compensationDict)
|
|
|
- {
|
|
|
- outRequest_Body.unitData.processData.Add(
|
|
|
- new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
|
|
|
- {
|
|
|
- dataName = kvp.Key.ToString(),
|
|
|
- dataValue = kvp.Value.ToString()
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//过站明细
|
|
|
if (GlobalContext.IsSendProcessDetail)
|
|
|
{
|
|
@@ -1756,6 +1726,29 @@ namespace MainForm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //OP30站读txt数据
|
|
|
+ if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
|
+ {
|
|
|
+ string path = "";
|
|
|
+ if (direction == "Left")
|
|
|
+ {
|
|
|
+ string pathStr = GlobalContext.MESLaserLPath;
|
|
|
+ path = DecFileName(pathStr);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string pathStr = GlobalContext.MESLaserRPath;
|
|
|
+ path = DecFileName(pathStr);
|
|
|
+ }
|
|
|
+ outRequest_Body.unitData.processData.Add(
|
|
|
+ new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
|
|
|
+ {
|
|
|
+ dataName = "fMesHeightInfos",
|
|
|
+ dataValue = GetLastLineCompensation(path)
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (GlobalContext.MESIsSendUpFile)
|
|
|
{
|
|
|
foreach (var item in fileUploadData.fileData)
|
|
@@ -2841,7 +2834,7 @@ namespace MainForm
|
|
|
bool actionBool = Enum.TryParse(oEEType, out XiaomiDeviceOEE deviceOEE);
|
|
|
(short, string) result = (0, "");
|
|
|
|
|
|
- // 上传开始节拍
|
|
|
+ // 上传开始节拍 节拍只需要PLC传1、3、4、5
|
|
|
result = SaveOEEData(plcNo, stationNameStr, deviceOEE, strProductBarcode, CarrierBarcode);
|
|
|
//上传结束节拍
|
|
|
switch (oEEType)
|
|
@@ -2858,7 +2851,6 @@ namespace MainForm
|
|
|
|
|
|
if (result.Item1 == 1)
|
|
|
{
|
|
|
-
|
|
|
OnMessage(LogType.Info, $"PLC{plcNo}_{stationNameStr} 节拍[{deviceOEE}]上传成功!");
|
|
|
//写入PLC
|
|
|
IoT_DataSet_t iotData = new IoT_DataSet_t();
|
|
@@ -2937,6 +2929,224 @@ namespace MainForm
|
|
|
/// [S1] 壳体清洁上料装备
|
|
|
/// </summary>
|
|
|
/// <param name="plcNo">PLC编号</param>
|
|
|
+ //private void ReadStation_S1(int plcNo)
|
|
|
+ //{
|
|
|
+ // string stationCode = "[OP10]";
|
|
|
+ // string stationName = "壳体清洁上料";
|
|
|
+ // string stationNameStr = stationCode + stationName;
|
|
|
+ // string tagBaseName = "g_OP10_MES"; //标签变量名称
|
|
|
+ // string tagMesCommName = "mesCommToPC"; //标签变量名称
|
|
|
+ // string tagAgvCommName = "agvCommFrmPC";
|
|
|
+ // string tagiotComnName = "iotData";
|
|
|
+ // string tagBarsetName = "BarcodeSet";
|
|
|
+
|
|
|
+ // string CarrierBarcode = "";
|
|
|
+ // string ProductBarcode = "";
|
|
|
+
|
|
|
+ // // 触发信号字典
|
|
|
+ // //s1PLCSignal_Old.Add("a1OEEPLC_FLAG", 0); // PLC_FLAG 节拍接口
|
|
|
+ // s1PLCSignal_Old.Add("a1OEEType", 0); // 节拍类型(plc写入)
|
|
|
+
|
|
|
+ // // PLC数据字典 赋值
|
|
|
+ // s1PLCData.Add("a1OEEType", 0); // 节拍类型(plc写入)
|
|
|
+ // s1PLCData.Add("OEETypeFlag", 0); // 节拍类型(plc写入)
|
|
|
+
|
|
|
+ // OP10_MesData_t stPLC_MesData; //PLC的MES数据
|
|
|
+ // (int, string) result;
|
|
|
+
|
|
|
+ // while (true)
|
|
|
+ // {
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // if (!GlobalContext._IsCon_Funs1)
|
|
|
+ // {
|
|
|
+ // UpdatePLCMonitor(1, plcNo, 0);
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (FunsEip[plcNo].IsConnected) // 检查PLC是否已连接上
|
|
|
+ // {
|
|
|
+ // Stopwatch stopwatch1 = new Stopwatch();
|
|
|
+ // Stopwatch stopwatch2 = new Stopwatch();
|
|
|
+ // stopwatch1.Start();
|
|
|
+
|
|
|
+ // stopwatch2.Start();
|
|
|
+
|
|
|
+ // #region 一次性读取所有数据
|
|
|
+
|
|
|
+ // // 一次性读取所有数据
|
|
|
+ // result = FunsEip[plcNo]
|
|
|
+ // .Read_SingleTag<OP10_MesData_t>(tagBaseName, 1, out stPLC_MesData, this); //读取单个结构体数据
|
|
|
+ // if (result.Item1 != 0)
|
|
|
+ // {
|
|
|
+ // //richTextBox1.AppendText("\n" + strRet);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // //richTextBox1.AppendText("\n" + "读取成功");
|
|
|
+ // stPLC_MesData.BarcodeSet.strProductBarcode =
|
|
|
+ // FormatStrbyPLC(stPLC_MesData.BarcodeSet.strProductBarcode);
|
|
|
+ // stPLC_MesData.BarcodeSet.strPartBarcode =
|
|
|
+ // FormatStrbyPLC(stPLC_MesData.BarcodeSet.strPartBarcode);
|
|
|
+ // stPLC_MesData.BarcodeSet.strCarrierBarcode =
|
|
|
+ // FormatStrbyPLC(stPLC_MesData.BarcodeSet.strCarrierBarcode);
|
|
|
+ // stPLC_MesData.BarcodeSet.strPCBBarcode =
|
|
|
+ // FormatStrbyPLC(stPLC_MesData.BarcodeSet.strPCBBarcode);
|
|
|
+
|
|
|
+ // //设备状态
|
|
|
+ // int xmDeviceStateInt = stPLC_MesData.iotData.machineState;
|
|
|
+ // xmDeviceStateData.left = (xmDeviceStateInt < 0 || xmDeviceStateInt > 7)
|
|
|
+ // ? XiaomiDeviceState.Unknown
|
|
|
+ // : (XiaomiDeviceState)xmDeviceStateInt;
|
|
|
+
|
|
|
+ // // 载具SN
|
|
|
+ // CarrierBarcode = stPLC_MesData.BarcodeSet.strCarrierBarcode.ToString();
|
|
|
+ // // 物料码(物料码还未绑定载具SN时必填)
|
|
|
+ // ProductBarcode = stPLC_MesData.BarcodeSet.strProductBarcode;
|
|
|
+ // // 节拍
|
|
|
+ // s1PLCData["a1OEEType"] = stPLC_MesData.iotData.beatAction;
|
|
|
+ // //报警信息
|
|
|
+ // _FaultDatas = stPLC_MesData.iotData.fault_codes;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // #endregion 一次性读取所有数据
|
|
|
+
|
|
|
+ // stopwatch2.Stop();
|
|
|
+
|
|
|
+ // #region 进站
|
|
|
+
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // if (stPLC_MesData.mesCommFrmPLC.cmd == (byte)eMesCmd.InStation)
|
|
|
+ // {
|
|
|
+ // lock (lockObj)
|
|
|
+ // {
|
|
|
+ // if (!ProgressState)
|
|
|
+ // {
|
|
|
+ // uuid = Guid.NewGuid().ToString(); //创建贯穿进出站的uuid
|
|
|
+ // ProgressState = true;
|
|
|
+ // Task.Run(() => S1进站(plcNo, stationNameStr, stPLC_MesData,
|
|
|
+ // tagBaseName + "." + tagMesCommName, out ProgressState));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception ex)
|
|
|
+ // {
|
|
|
+ // ProgressState = false;
|
|
|
+ // string str = ex.StackTrace;
|
|
|
+ // AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
+ // $"PLC{plcNo}_{stationNameStr} 上料进站出错!错误信息:" + ex.Message + "异常位置:" +
|
|
|
+ // str.Substring(str.LastIndexOf("\\") + 1, str.Length - str.LastIndexOf("\\") - 1));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // #endregion 进站
|
|
|
+
|
|
|
+ // #region 出站
|
|
|
+
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // if (stPLC_MesData.mesCommFrmPLC.cmd == (byte)eMesCmd.OutStation)
|
|
|
+ // {
|
|
|
+ // lock (lockObj)
|
|
|
+ // {
|
|
|
+ // if (!ProgressState)
|
|
|
+ // {
|
|
|
+ // ProgressState = true;
|
|
|
+ // Task.Run(() => S1出站(plcNo, stationNameStr, stPLC_MesData,
|
|
|
+ // tagBaseName + "." + tagMesCommName, stationCode, stationName,
|
|
|
+ // out ProgressState));
|
|
|
+ // stPLC_MesData.mesCommFrmPLC.cmd = 0; //清除入站申请
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception ex)
|
|
|
+ // {
|
|
|
+ // ProgressState = false;
|
|
|
+ // string str = ex.StackTrace;
|
|
|
+ // AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
+ // $"PLC{plcNo}_{stationNameStr} 上料进站出错!错误信息:" + ex.Message + "异常位置:" +
|
|
|
+ // str.Substring(str.LastIndexOf("\\") + 1, str.Length - str.LastIndexOf("\\") - 1));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // #endregion 出站
|
|
|
+
|
|
|
+
|
|
|
+ // #region 节拍接口
|
|
|
+
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // if (stPLC_MesData.iotData.beatAction > 0)
|
|
|
+ // {
|
|
|
+ // int a1OEEType = Convert.ToInt32(s1PLCData["a1OEEType"]);
|
|
|
+ // int a1OEETypeGOld = Convert.ToInt32(s1PLCSignal_Old["a1OEEType"]);
|
|
|
+
|
|
|
+ // if (a1OEEType != a1OEETypeGOld)
|
|
|
+ // {
|
|
|
+ // s1PLCData["OEETypeFlag"] = "1";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // s1PLCData["OEETypeFlag"] = "0";
|
|
|
+ // }
|
|
|
+ // if (s1PLCData["OEETypeFlag"].ToString() == "1" && (a1OEEType == 1 || a1OEEType == 3 || a1OEEType == 4 || a1OEEType == 5))
|
|
|
+ // {
|
|
|
+ // 通用节拍接口(plcNo, stationNameStr, tagBaseName + "." + tagiotComnName, CarrierBarcode, stPLC_MesData.iotData, out res);
|
|
|
+ // if (res == 1)
|
|
|
+ // {
|
|
|
+ // s1PLCSignal_Old["a1OEEType"] = s1PLCData["a1OEEType"];
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // s1PLCSignal_Old["a1OEEType"] = 0;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // s1PLCSignal_Old["a1OEEType"] = 0;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception ex)
|
|
|
+ // {
|
|
|
+ // string str = ex.StackTrace;
|
|
|
+ // AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
+ // $"PLC{plcNo}_{stationNameStr} 上传出站数据出错!错误信息:" + ex.Message + "异常位置:" +
|
|
|
+ // str.Substring(str.LastIndexOf("\\") + 1, str.Length - str.LastIndexOf("\\") - 1));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // #endregion
|
|
|
+
|
|
|
+ // UpdatePLCMonitor(1, plcNo, 1); // 更新PLC状态的UI // 更新PLC状态的UI
|
|
|
+
|
|
|
+ // stopwatch1.Stop();
|
|
|
+ // //OnMessage(LogType.Info, $"循环读取PLC数据一次,总用时{stopwatch1.ElapsedMilliseconds}ms[读取用时{stopwatch2.ElapsedMilliseconds}ms]");
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // UpdatePLCMonitor(1, plcNo, 0); // 更新PLC状态的UI
|
|
|
+ // AddMessage_Station(stationNameStr, LogType.Info,
|
|
|
+ // "PLC" + plcNo.ToString() + "_" + stationNameStr + "连接失败!");
|
|
|
+
|
|
|
+ // FunsEip[plcNo].Connect(); // 重连
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception ex)
|
|
|
+ // {
|
|
|
+ // UpdatePLCMonitor(1, plcNo, 0); // 更新PLC状态的UI
|
|
|
+ // AddMessage_Station(stationNameStr, LogType.Error,
|
|
|
+ // $"PLC{plcNo}_{stationNameStr}运行出错!错误信息:" + ex.Message.ToString());
|
|
|
+ // }
|
|
|
+
|
|
|
+ // Thread.Sleep(IntervalReadPLC);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// [S1] 壳体清洁上料装备(临时方案)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="plcNo">PLC编号</param>
|
|
|
private void ReadStation_S1(int plcNo)
|
|
|
{
|
|
|
string stationCode = "[OP10]";
|
|
@@ -3025,6 +3235,26 @@ namespace MainForm
|
|
|
|
|
|
try
|
|
|
{
|
|
|
+ if (OpenDailogFalg)
|
|
|
+ {
|
|
|
+ using (var dialog = new BandBarodeDialog(strCarrierBarcode, ProductBarcode, PCBBarcode))
|
|
|
+ {
|
|
|
+ var rs = dialog.ShowDialog();
|
|
|
+ if (rs == DialogResult.OK)
|
|
|
+ {
|
|
|
+ AddMessage(LogType.Info, $"扫码校验通过,载具码:{strCarrierBarcode}");
|
|
|
+ OpenDailogFalg = false; //关闭扫码
|
|
|
+ StopWhile = false;//开启while循环
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ProgressState = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (stPLC_MesData.mesCommFrmPLC.cmd == (byte)eMesCmd.InStation)
|
|
|
{
|
|
|
lock (lockObj)
|
|
@@ -3105,12 +3335,14 @@ namespace MainForm
|
|
|
{
|
|
|
s1PLCSignal_Old["a1OEEType"] = s1PLCData["a1OEEType"];
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
s1PLCSignal_Old["a1OEEType"] = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
s1PLCSignal_Old["a1OEEType"] = 0;
|
|
|
}
|
|
|
}
|
|
@@ -3149,7 +3381,6 @@ namespace MainForm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// [S1] 壳体清洁上料 - 进站
|
|
|
/// </summary>
|
|
@@ -3256,7 +3487,6 @@ namespace MainForm
|
|
|
{
|
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
|
Stopwatch stopwatch2 = new Stopwatch();
|
|
|
-
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -3317,7 +3547,7 @@ namespace MainForm
|
|
|
string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
typeof(XiaomiMESEnum_ProcessData.Enum_10_ProcessData));
|
|
|
//获取过站明细的值
|
|
|
- object valueObj = field.GetValue(stPLC_MesData.mesData);
|
|
|
+ object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
dic.Add(name, valueObj.ToString());
|
|
|
}
|
|
|
|
|
@@ -3762,8 +3992,28 @@ namespace MainForm
|
|
|
Parameter_unit = ""
|
|
|
});
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP20_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_20_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
|
|
|
+
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
|
MachineId, StationId, PartBarcode, paramJson);
|
|
@@ -4373,9 +4623,27 @@ namespace MainForm
|
|
|
Parameter_unit = ""
|
|
|
});
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ //创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP30_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_30_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+ #endregion
|
|
|
+ string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
//if (direction == "Right")
|
|
|
//{
|
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData).Replace("null","0");
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,slot,
|
|
|
MachineId, StationId, "", paramJson, direction);
|
|
@@ -4814,6 +5082,8 @@ namespace MainForm
|
|
|
}
|
|
|
|
|
|
sn = strProductBarcode;
|
|
|
+ stPLC_MesData.BarcodeSet.strProductBarcode = strProductBarcode;
|
|
|
+
|
|
|
AddMessage(LogType.Info, $"载具码:{CarrierBarcode};产品码:{sn}");
|
|
|
|
|
|
List<TestItem> items = new List<TestItem>();
|
|
@@ -4831,7 +5101,6 @@ namespace MainForm
|
|
|
});
|
|
|
|
|
|
#region 上传图片
|
|
|
-
|
|
|
if (GlobalContext.MQTTIsSendUpFile)
|
|
|
{
|
|
|
string[] urlarry = GlobalContext.UpFilePath.Split(",");
|
|
@@ -4850,8 +5119,26 @@ namespace MainForm
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
|
|
|
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,
|
|
|
"01-SLOT-01", MachineId, StationId, "", paramJson);
|
|
@@ -5351,8 +5638,28 @@ namespace MainForm
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP50_DataSet_t).GetFields();
|
|
|
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_50_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
int result1 = 0;
|
|
|
byte mesResultFrmWeb = 0;
|
|
|
if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
|
|
@@ -5877,7 +6184,28 @@ namespace MainForm
|
|
|
Parameter_unit = ""
|
|
|
});
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP60_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_60_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
|
MachineId, StationId, "", paramJson);
|
|
@@ -6500,9 +6828,29 @@ namespace MainForm
|
|
|
Parameter_unit = ""
|
|
|
});
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP70_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_70_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
//if (direction == "Right")
|
|
|
//{
|
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem, workorder_code,
|
|
|
batch_num, mtltmrk, plcDate_YMD, supplierCode
|
|
|
, sn, pass, CarrierBarcode, slot, MachineId, StationId, "", paramJson);
|
|
@@ -6951,6 +7299,7 @@ namespace MainForm
|
|
|
}
|
|
|
|
|
|
sn = strProductBarcode;
|
|
|
+ stPLC_MesData.BarcodeSet.strProductBarcode = strProductBarcode;
|
|
|
AddMessage(LogType.Info, $"载具码:{CarrierBarcode};产品码:{sn}");
|
|
|
List<TestItem> items = new List<TestItem>();
|
|
|
items.Add(new TestItem()
|
|
@@ -6986,8 +7335,27 @@ namespace MainForm
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP80_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_80_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
|
MachineId, StationId, "", paramJson);
|
|
@@ -7413,7 +7781,28 @@ namespace MainForm
|
|
|
Parameter_value = sn,
|
|
|
Parameter_unit = ""
|
|
|
});
|
|
|
+
|
|
|
+ #region 转换过站明细字符串
|
|
|
+ ////创建字典
|
|
|
+ //var dic = new Dictionary<string, string>();
|
|
|
+ //// 获取结构体类型
|
|
|
+ //FieldInfo[] fields = typeof(OP90_DataSet_t).GetFields();
|
|
|
+
|
|
|
+ //// 遍历变量名转换成字典描述
|
|
|
+ //foreach (FieldInfo field in fields)
|
|
|
+ //{
|
|
|
+ // //获取枚举描述
|
|
|
+ // string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
|
|
|
+ // typeof(XiaomiMESEnum_ProcessData.Enum_90_ProcessData));
|
|
|
+ // //获取过站明细的值
|
|
|
+ // object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
|
|
|
+ // dic.Add(name, valueObj.ToString());
|
|
|
+ //}
|
|
|
+ //string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
+
|
|
|
+ #endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode, "01-SLOT-01",
|
|
|
MachineId, StationId, "", paramJson);
|