浏览代码

警报重复、图片上传重构、生产参数汉化、10弹窗异步

WIN-GH9CEESPLTB\Administrator 1 月之前
父节点
当前提交
1498d3c307

+ 7 - 4
MainForm/Atlas/AtlasScrew.cs

@@ -277,20 +277,23 @@ namespace CommonLib
                                         MTF6K.CurveResult.Convert(out tightResult.torque, out tightResult.torCoef, out tightResult.angle, out tightResult.angCoef);
                                         MTF6K.CurveResult.Convert(out tightResult.torque, out tightResult.torCoef, out tightResult.angle, out tightResult.angCoef);
 
 
                                         #region 保存数据
                                         #region 保存数据
-                                        string dic = GlobalContext.MainDir + "\\扭力曲线_临时\\";
+                                        string dic = GlobalContext.MainDir + "扭力曲线_临时\\";
                                         if (!Directory.Exists(dic))
                                         if (!Directory.Exists(dic))
                                         {
                                         {
                                             Directory.CreateDirectory(dic);
                                             Directory.CreateDirectory(dic);
                                         }
                                         }
-                                        string 扭力曲线文件名 = dic + DateTime.Now.ToString("yyyy_MM_dd HH:mm:ss:FFF")+".csv" ;
+                                        string 扭力曲线文件名 = dic + DateTime.Now.ToString("yyyy_MM_dd") +".csv" ;
 
 
                                         StringBuilder sbStr =new StringBuilder();
                                         StringBuilder sbStr =new StringBuilder();
                                         if (!File.Exists(扭力曲线文件名))
                                         if (!File.Exists(扭力曲线文件名))
                                         {
                                         {
+                                            // 记录时间,产品SN,螺丝序号
                                             sbStr.AppendLine("扭力数组,角度数组,峰值扭矩,总角度,总持续时间,结果代码");
                                             sbStr.AppendLine("扭力数组,角度数组,峰值扭矩,总角度,总持续时间,结果代码");
                                         }
                                         }
-                                        sbStr.AppendLine($"{tightResult.torque},{tightResult.angle},{tightResult.PearkTorque},{tightResult.TotalAngle},{tightResult.TotalDuration},{tightResult.ResultCode}");
-                                        sbStr.AppendLine();
+                                        
+                                        string torqueData =string.Join(",", tightResult.torque);
+                                        string angleData = string.Join(",", tightResult.angle);
+                                        sbStr.AppendLine($"{torqueData},{angleData},{tightResult.PearkTorque},{tightResult.TotalAngle},{tightResult.TotalDuration},{tightResult.ResultCode}");
                                         File.WriteAllText(扭力曲线文件名, sbStr.ToString());
                                         File.WriteAllText(扭力曲线文件名, sbStr.ToString());
                                         #endregion 保存数据
                                         #endregion 保存数据
 
 

+ 4 - 4
MainForm/ClassFile/Inovance_EIP.cs

@@ -242,7 +242,7 @@ namespace EIP_Protocol
     [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 8)]
     [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 8)]
     public struct OP40_TestData_t  //测试项
     public struct OP40_TestData_t  //测试项
     {
     {
-        [MarshalAs(UnmanagedType.R4)]
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
         public float[] fGlue_Areas;             //胶线面积
         public float[] fGlue_Areas;             //胶线面积
 
 
         [MarshalAs(UnmanagedType.R4)]
         [MarshalAs(UnmanagedType.R4)]
@@ -251,7 +251,7 @@ namespace EIP_Protocol
         [MarshalAs(UnmanagedType.R4)]
         [MarshalAs(UnmanagedType.R4)]
         public float fGlue_AreasMin;          //胶线面积(最小值)
         public float fGlue_AreasMin;          //胶线面积(最小值)
 
 
-        [MarshalAs(UnmanagedType.R4)]
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
         public float[] fGlue_Heights;         //胶线高度
         public float[] fGlue_Heights;         //胶线高度
 
 
         [MarshalAs(UnmanagedType.R4)]
         [MarshalAs(UnmanagedType.R4)]
@@ -281,10 +281,10 @@ namespace EIP_Protocol
     [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 8)]
     [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 8)]
     public struct OP50_TestData_t
     public struct OP50_TestData_t
     {
     {
-        [MarshalAs(UnmanagedType.I4)]
+        [MarshalAs(UnmanagedType.R4)]
         public float fForceAddPCB;                                //装ADD板的压力
         public float fForceAddPCB;                                //装ADD板的压力
 
 
-        [MarshalAs(UnmanagedType.I4)]
+        [MarshalAs(UnmanagedType.R4)]
         public float fForceAddPCBMax;                                   //装ADD板的压力(最大值)
         public float fForceAddPCBMax;                                   //装ADD板的压力(最大值)
 
 
         [MarshalAs(UnmanagedType.R4)]
         [MarshalAs(UnmanagedType.R4)]

+ 1 - 0
MainForm/ClassFile/ProjectClass/GlobalContext.cs

@@ -41,6 +41,7 @@ namespace MainForm
         public static string MqttPassDetailLogDir = MqttLogDir + @"过站明细\";    // mqtt日志 - 过站明细日志
         public static string MqttPassDetailLogDir = MqttLogDir + @"过站明细\";    // mqtt日志 - 过站明细日志
         public static string MqttFileUpLogDir = MqttLogDir + @"文件上传\";    // mqtt日志 - 文件上传日志
         public static string MqttFileUpLogDir = MqttLogDir + @"文件上传\";    // mqtt日志 - 文件上传日志
         public static string MqttFileBackupLogDir = MqttLogDir + @"文件上传\文件备份";    // mqtt日志 - 文件上传日志
         public static string MqttFileBackupLogDir = MqttLogDir + @"文件上传\文件备份";    // mqtt日志 - 文件上传日志
+        public static string MqttFileTempDir = MqttLogDir + @"文件上传\临时文件";    // mqtt日志 - 文件上传日志
         public static string MqttDeviceConfigLogDir = MqttLogDir + @"装备配置\";    // mqtt日志 - 装备配置日志
         public static string MqttDeviceConfigLogDir = MqttLogDir + @"装备配置\";    // mqtt日志 - 装备配置日志
 
 
         public static string MqttServerPath = AppDomain.CurrentDomain.BaseDirectory + @"\ThingsMode\MqttServer.exe";
         public static string MqttServerPath = AppDomain.CurrentDomain.BaseDirectory + @"\ThingsMode\MqttServer.exe";

+ 16 - 3
MainForm/FaForm/BandBarodeDialog_S1.cs

@@ -46,6 +46,7 @@ namespace MainForm.FaForm
 
 
         private void BandBarodeDialog_S1_Load(object sender, EventArgs e)
         private void BandBarodeDialog_S1_Load(object sender, EventArgs e)
         {
         {
+            Form_Home.OpenDailogFalg=false;
             // 初始化定时器
             // 初始化定时器
             _inputTimer = new Timer();
             _inputTimer = new Timer();
             _inputTimer.Interval = 500; // 500毫秒
             _inputTimer.Interval = 500; // 500毫秒
@@ -101,9 +102,9 @@ namespace MainForm.FaForm
             GetBarcode.Focus();
             GetBarcode.Focus();
 
 
             //收到PLC确认反馈,关闭弹窗
             //收到PLC确认反馈,关闭弹窗
-            if (isNoClose) { 
-                closeWin();
-            }
+            //if (isNoClose) { 
+            //    closeWin();
+            //}
 
 
             // 处理条码
             // 处理条码
             string Barcode = GetBarcode.Text.Trim();
             string Barcode = GetBarcode.Text.Trim();
@@ -119,6 +120,16 @@ namespace MainForm.FaForm
 
 
                 GetBarcode.Text = "";
                 GetBarcode.Text = "";
             }
             }
+            if (CarrierBarcode.Text.Length < 9)
+            {
+                ErrorLab.Text = $"载具码格式不正确,请重新扫码!";
+                return;
+            }
+            if (ProductBarcode.Text.Length < 47)
+            {
+                ErrorLab.Text = $"载具码格式不正确,请重新扫码!";
+                return;
+            }
             if (!string.IsNullOrEmpty(ProductBarcode.Text) && !string.IsNullOrEmpty(CarrierBarcode.Text))
             if (!string.IsNullOrEmpty(ProductBarcode.Text) && !string.IsNullOrEmpty(CarrierBarcode.Text))
             {
             {
                 CommandFromPLC CommandToPlC = new CommandFromPLC();
                 CommandFromPLC CommandToPlC = new CommandFromPLC();
@@ -151,11 +162,13 @@ namespace MainForm.FaForm
         {
         {
             this.DialogResult = DialogResult.OK;
             this.DialogResult = DialogResult.OK;
             //Form_Home.StopWhile = false;
             //Form_Home.StopWhile = false;
+            Form_Home.OpenDailogFalg = true;
             this.Close();
             this.Close();
         }
         }
 
 
         private void BandBarodeDialog_S1_FormClosing(object sender, FormClosingEventArgs e)
         private void BandBarodeDialog_S1_FormClosing(object sender, FormClosingEventArgs e)
         {
         {
+            Form_Home.OpenDailogFalg = true;
             //Form_Home.StopWhile = false;
             //Form_Home.StopWhile = false;
         }
         }
 
 

+ 355 - 138
MainForm/FaForm/Form_Home.cs

@@ -1114,7 +1114,7 @@ namespace MainForm
         private static readonly object lockObj = new object(); // 锁对象
         private static readonly object lockObj = new object(); // 锁对象
         private static bool isCollectingFlagLeft;
         private static bool isCollectingFlagLeft;
         private static bool isCollectingFlagRight;
         private static bool isCollectingFlagRight;
-        private bool OpenDailogFalg = true; //是否开启扫码弹窗标识
+        public static bool OpenDailogFalg = true; //是否开启扫码弹窗标识
         private static int res = 0;
         private static int res = 0;
         public static bool StopWhile =false; //二维码弹窗后停止循环
         public static bool StopWhile =false; //二维码弹窗后停止循环
         public static bool inStationPass = true;  //过站结果,保存进站结果
         public static bool inStationPass = true;  //过站结果,保存进站结果
@@ -1748,7 +1748,7 @@ namespace MainForm
                     }
                     }
                     #endregion
                     #endregion
 
 
-                    #region OP30站读txt数据
+                    #region OP30站读三点测高
                     if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
                     if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
                     {
                     {
                         string path = "";
                         string path = "";
@@ -1762,17 +1762,22 @@ namespace MainForm
                             string pathStr = GlobalContext.MESLaserRPath;
                             string pathStr = GlobalContext.MESLaserRPath;
                             path = DecFileName(pathStr);
                             path = DecFileName(pathStr);
                         }
                         }
-                        outRequest_Body.unitData.processData.Add(
-                            new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
-                            {
-                                dataName = "fMesHeightInfos",
-                                dataValue = GetLastLineCompensation(path)
-                            });
+                        var item = outRequest_Body.unitData.processData.FirstOrDefault(data => data.dataName == "fMesHeightInfos");
+                        if (item != null)
+                        {
+                            item.dataValue = GetLastLineCompensation(path);
+                        }
+                        //outRequest_Body.unitData.processData.Add(
+                        //    new XmMES_StationOutRequest_Body.XmStationOut_ProcessData()
+                        //    {
+                        //        dataName = "fMesHeightInfos",
+                        //        dataValue = GetLastLineCompensation(path)
+                        //    });
                       
                       
                     }
                     }
                     #endregion
                     #endregion
 
 
-                    #region 上传文件
+                    #region 上传文件,添加附件uuid
                     if (GlobalContext.MESIsSendUpFile)
                     if (GlobalContext.MESIsSendUpFile)
                     {
                     {
                         foreach (var item in fileUploadData.fileData)
                         foreach (var item in fileUploadData.fileData)
@@ -1831,6 +1836,7 @@ namespace MainForm
                         {
                         {
                             AddMessage(LogType.Info, $"【出站数据 SN {sn}】上传MES服务器---失败!接口报错信息:" + mesRet);
                             AddMessage(LogType.Info, $"【出站数据 SN {sn}】上传MES服务器---失败!接口报错信息:" + mesRet);
                         }
                         }
+                        fileUploadData.fileData.Clear();
 
 
                         string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
                         string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
                             JsonConvert.SerializeObject(outRequest_Body),
                             JsonConvert.SerializeObject(outRequest_Body),
@@ -2303,6 +2309,39 @@ namespace MainForm
             }
             }
         }
         }
 
 
+        private void CopyFileToTempPath(string morepath,string temppath) {
+            string tempPath = GlobalContext.MqttFileTempDir; //临时存放图片的文件夹
+            var morePath = morepath.Split(",");
+            try
+            {
+                if (Directory.Exists(tempPath))
+                {
+                    Directory.Delete(tempPath, recursive: true); // 清理临时目录
+                }
+                foreach (var item in morePath)
+                {
+                    foreach (var file in Directory.GetFiles(item, "*.*", SearchOption.AllDirectories))
+                    {
+                        var relativePath = file.Substring(item.Length + 1);
+                        var destFile = Path.Combine(temppath, relativePath);
+                        Directory.CreateDirectory(Path.GetDirectoryName(destFile));
+                        File.Copy(file, destFile, overwrite: true);
+                        //删除文件
+                        (bool, string) newResult = DeleteFile(file);
+                    }
+                }
+            }
+            catch (Exception ex){
+                throw ex;
+            }
+        }
+
+        /// <summary>
+        /// 压缩文件
+        /// </summary>
+        /// <param name="folderPath">源文件地址</param>
+        /// <param name="zipFilePath">目标地址</param>
+        /// <returns></returns>
         public static (int, string) CompressFolder(string folderPath, string zipFilePath)
         public static (int, string) CompressFolder(string folderPath, string zipFilePath)
         {
         {
             try
             try
@@ -2417,19 +2456,6 @@ namespace MainForm
                         msg = msg + fileresult.Item2 + "\r\n";
                         msg = msg + fileresult.Item2 + "\r\n";
                     }
                     }
 
 
-
-                    foreach (var imageFile in imageFiles)
-                    {
-                        if (File.Exists(imageFile))
-                        {
-                            //删除文件
-                            (bool, string) newResult = DeleteFile(imageFile);
-                            if (!newResult.Item1)
-                            {
-                                return (0, Path.GetFileName(imageFile) + newResult.Item2);
-                            }
-                        }
-                    }
                 }
                 }
 
 
                 return (1, msg);
                 return (1, msg);
@@ -2669,6 +2695,19 @@ namespace MainForm
 
 
                     if (FaultData.Length > 0 && isNoAlarm && isNoNewAlarm)
                     if (FaultData.Length > 0 && isNoAlarm && isNoNewAlarm)
                     {
                     {
+                        //如果警报都是0,则跳过解析
+                        if (FaultData?.All(x => x == 0) ?? true)
+                        {
+                            if (flag == "left")
+                            {
+                                _FaultDatas_Old = FaultData.ToArray();
+                            }
+                            else
+                            {
+                                _FaultDatas_Old2 = FaultData.ToArray();
+                            }
+                            return;
+                        }
                         //解析报警信息,分析当前报警在字典中的定位
                         //解析报警信息,分析当前报警在字典中的定位
                         for (int i = 0; i <= FaultData.Length - 1; i++)
                         for (int i = 0; i <= FaultData.Length - 1; i++)
                         {
                         {
@@ -2951,6 +2990,57 @@ namespace MainForm
             return cleanedString;
             return cleanedString;
         }
         }
 
 
+        private void S1_OpenDialog(int plcNo,string stationNameStr,string tagBaseName,string tagMesCommName) {
+            Task.Run(() =>
+            {
+                using (var dialog = new BandBarodeDialog_S1())
+                {
+                    var rs = dialog.ShowDialog();
+                    if (rs == DialogResult.OK)
+                    {
+                        //绑定载具和产品
+                        ResponseMessage message = new ResponseMessage();
+
+                        message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
+                        if (message.result == false)
+                        {
+                            AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
+
+                            CommandFromPLC CommandToPlC = new CommandFromPLC();
+                            CommandToPlC.cmd = 0;
+                            CommandToPlC.cmdParam = 5;
+                            CommandToPlC.cmdResult = 0;
+                            WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
+                            return;
+                        }
+                        else
+                        {
+                            AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
+
+                            CommandFromPLC CommandToPlC = new CommandFromPLC();
+                            CommandToPlC.cmd = 0;
+                            CommandToPlC.cmdParam = 4;
+                            CommandToPlC.cmdResult = 0;
+                            WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
+                        }
+                        AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strProductBarcode}");
+
+                        //StopWhile = false;//开启while循环
+                    }
+                }
+            });
+        }
+        /// <summary>
+        /// 连接数组元素
+        /// </summary>
+        /// <param name="array"></param>
+        /// <returns></returns>
+        private static string ArrayToString(Array array)
+        {
+            // 使用 string.Join 连接数组元素
+            return string.Join(", ", array.Cast<object>().Select(x => x.ToString()));
+        }
+
         #endregion
         #endregion
 
 
         #region S1
         #region S1
@@ -3177,7 +3267,7 @@ namespace MainForm
         /// [S1] 壳体清洁上料装备(10扫码改造注释(临时))
         /// [S1] 壳体清洁上料装备(10扫码改造注释(临时))
         /// </summary>
         /// </summary>
         /// <param name="plcNo">PLC编号</param>
         /// <param name="plcNo">PLC编号</param>
-        private void ReadStation_S1(int plcNo)
+        private async void ReadStation_S1(int plcNo)
         {
         {
             string stationCode = "[OP10]";
             string stationCode = "[OP10]";
             string stationName = "壳体清洁上料";
             string stationName = "壳体清洁上料";
@@ -3262,10 +3352,10 @@ namespace MainForm
                             //报警信息
                             //报警信息
                             _FaultDatas = stPLC_MesData.iotData.fault_codes;
                             _FaultDatas = stPLC_MesData.iotData.fault_codes;
 
 
-                            if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
-                            {
-                                BandBarodeDialog_S1.isNoClose=true;
-                            }
+                            //if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
+                            //{
+                            //    BandBarodeDialog_S1.isNoClose=true;
+                            //}
                         }
                         }
 
 
                         #endregion 一次性读取所有数据
                         #endregion 一次性读取所有数据
@@ -3281,41 +3371,47 @@ namespace MainForm
 
 
                         if (stPLC_MesData.mesCommFrmPLC.cmdParam==1)
                         if (stPLC_MesData.mesCommFrmPLC.cmdParam==1)
                         {
                         {
-                            using (var dialog = new BandBarodeDialog_S1())
+                            if (OpenDailogFalg)
                             {
                             {
-                                var rs = dialog.ShowDialog();
-                                if (rs == DialogResult.OK)
-                                {
-                                    //绑定载具和产品
-                                    ResponseMessage message = new ResponseMessage();
-
-                                    message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
-                                    if (message.result == false)
-                                    {
-                                        AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
-
-                                        CommandFromPLC CommandToPlC = new CommandFromPLC();
-                                        CommandToPlC.cmd = 0;
-                                        CommandToPlC.cmdParam = 5;
-                                        CommandToPlC.cmdResult = 0;
-                                        WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
-                                        return;
-                                    }
-                                    else
-                                    {
-                                        AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
-
-                                        CommandFromPLC CommandToPlC = new CommandFromPLC();
-                                        CommandToPlC.cmd = 0;
-                                        CommandToPlC.cmdParam = 4;
-                                        CommandToPlC.cmdResult = 0;
-                                        WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
-                                    }
-                                    AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strCarrierBarcode}");
-        
-                                    //StopWhile = false;//开启while循环
-                                }
+                                //await S1_OpenDialog(plcNo, stationNameStr, tagBaseName, tagMesCommName);
+                                S1_OpenDialog(plcNo, stationNameStr, tagBaseName, tagMesCommName);
                             }
                             }
+
+                            //using (var dialog = new BandBarodeDialog_S1())
+                            //{
+                            //    var rs = dialog.ShowDialog();
+                            //    if (rs == DialogResult.OK)
+                            //    {
+                            //        //绑定载具和产品
+                            //        ResponseMessage message = new ResponseMessage();
+
+                            //        message = SQLHelper.InsertCarrierBind(_strCarrierBarcode, _strProductBarcode);
+                            //        if (message.result == false)
+                            //        {
+                            //            AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定失败,错误:" + message.text);
+
+                            //            CommandFromPLC CommandToPlC = new CommandFromPLC();
+                            //            CommandToPlC.cmd = 0;
+                            //            CommandToPlC.cmdParam = 5;
+                            //            CommandToPlC.cmdResult = 0;
+                            //            WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
+                            //            return;
+                            //        }
+                            //        else
+                            //        {
+                            //            AddMessage(LogType.Error, stationNameStr + "_载具码与产品码绑定成功");
+
+                            //            CommandFromPLC CommandToPlC = new CommandFromPLC();
+                            //            CommandToPlC.cmd = 0;
+                            //            CommandToPlC.cmdParam = 4;
+                            //            CommandToPlC.cmdResult = 0;
+                            //            WriteResultToPlc(plcNo, stationNameStr, tagBaseName + "." + tagMesCommName, 1, CommandToPlC);
+                            //        }
+                            //        AddMessage(LogType.Info, $"载具码:{_strCarrierBarcode},产品码:{_strCarrierBarcode}");
+
+                            //        //StopWhile = false;//开启while循环
+                            //    }
+                            //}
                         }
                         }
                         #endregion
                         #endregion
 
 
@@ -3467,15 +3563,15 @@ 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 sn = _strProductBarcode;
-                string CarrierBarcode = _strCarrierBarcode;
+                string CarrierBarcode = (string)stPLC_MesData.BarcodeSet.strCarrierBarcode; // 载具条码;
+                string sn = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
 
 
                 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; // 产品结果
                 bool pass = a1Result == 1;
                 bool pass = a1Result == 1;
 
 
+
                 if (string.IsNullOrEmpty(sn))
                 if (string.IsNullOrEmpty(sn))
                 {
                 {
                     ProgressState = false;
                     ProgressState = false;
@@ -3608,23 +3704,32 @@ namespace MainForm
                 });
                 });
 
 
                 #region 转换过站明细字符串
                 #region 转换过站明细字符串
-
                 //创建字典
                 //创建字典
                 var dic = new Dictionary<string, string>();
                 var dic = new Dictionary<string, string>();
                 // 获取结构体类型
                 // 获取结构体类型
-                FieldInfo[] fields = typeof(OP10_DataSet_t).GetFields();
+                FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                string resultString = "";
 
 
                 // 遍历变量名转换成字典描述
                 // 遍历变量名转换成字典描述
                 foreach (FieldInfo field in fields)
                 foreach (FieldInfo field in fields)
                 {
                 {
                     //获取枚举描述
                     //获取枚举描述
                     string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                     string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                        typeof(XiaomiMESEnum_ProcessData.Enum_10_ProcessData));
+                        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                     //获取过站明细的值
                     //获取过站明细的值
                     object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                     object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                    dic.Add(name, valueObj.ToString());
+                    // 检查是否为数组
+                    if (valueObj.GetType().IsArray)
+                    {
+                        var array = valueObj as Array;
+                        resultString = ArrayToString(array);
+                    }
+                    else
+                    {
+                        resultString = valueObj.ToString();
+                    }
+                    dic.Add(name, resultString);
                 }
                 }
-
                 string paramJson = JsonConvert.SerializeObject(dic);
                 string paramJson = JsonConvert.SerializeObject(dic);
 
 
                 #endregion
                 #endregion
@@ -4070,19 +4175,29 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP20_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_20_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
-
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 #endregion
                 #endregion
                 string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
                 string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
@@ -4704,20 +4819,31 @@ namespace MainForm
                 });
                 });
 
 
                 #region 转换过站明细字符串
                 #region 转换过站明细字符串
-                //创建字典
+                ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP30_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_30_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 #endregion
                 #endregion
@@ -4908,13 +5034,13 @@ namespace MainForm
                         {
                         {
                             //测试数据
                             //测试数据
                             //stPLC_MesData.mesCommFrmPLC.cmd = 2;
                             //stPLC_MesData.mesCommFrmPLC.cmd = 2;
-                            stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
+                            //stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
                             //stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
                             //stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
 
 
-                            //stPLC_MesData.testData.fGlue_Areas = new float[] {12,22,16 };
+                            //stPLC_MesData.testData.fGlue_Areas = new float[] { 12, 22, 16 };
                             //stPLC_MesData.testData.fGlue_AreasMax = 20f;
                             //stPLC_MesData.testData.fGlue_AreasMax = 20f;
                             //stPLC_MesData.testData.fGlue_AreasMin = 0;
                             //stPLC_MesData.testData.fGlue_AreasMin = 0;
-                            //stPLC_MesData.testData.fGlue_Heights = new float[] { 5, 8, 6.6f};
+                            //stPLC_MesData.testData.fGlue_Heights = new float[] { 5, 8, 6.6f };
                             //stPLC_MesData.testData.fGlue_HeightsMax = 10f;
                             //stPLC_MesData.testData.fGlue_HeightsMax = 10f;
                             //stPLC_MesData.testData.fGlue_HeightsMin = 0;
                             //stPLC_MesData.testData.fGlue_HeightsMin = 0;
 
 
@@ -5227,42 +5353,63 @@ namespace MainForm
                 #region 上传图片
                 #region 上传图片
                 if (GlobalContext.MQTTIsSendUpFile)
                 if (GlobalContext.MQTTIsSendUpFile)
                 {
                 {
-                    string[] urlarry = GlobalContext.UpFilePath.Split(",");
-                    fileUploadData.fileData.Clear();
-                    foreach (var item in urlarry)
+                    CopyFileToTempPath(GlobalContext.UpFilePath,GlobalContext.MqttFileTempDir);
+                    if (Directory.Exists(GlobalContext.MqttFileTempDir))
                     {
                     {
-                        if (!string.IsNullOrEmpty(item))
+                        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
+                        if (result.Item1==1)
                         {
                         {
-                            //上传图片
-                            var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
-                                item, uuid).Result;
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                         }
                         }
                     }
                     }
+
+                    //string[] urlarry = GlobalContext.UpFilePath.Split(",");
+                    //// fileUploadData.fileData.Clear();
+                    //foreach (var item in urlarry)
+                    //{
+                    //    if (!string.IsNullOrEmpty(item))
+                    //    {
+                    //        //上传图片
+                    //        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
+                    //            item, uuid).Result;
+                    //        OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
+                    //    }
+                    //}
                 }
                 }
 
 
                 #endregion
                 #endregion
 
 
                 #region 转换过站明细字符串
                 #region 转换过站明细字符串
-                ////创建字典
-                //var dic = new Dictionary<string, string>();
-                //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //创建字典
+                var dic = new Dictionary<string, string>();
+                // 获取结构体类型
+                FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                string resultString = "";
 
 
-                //// 遍历变量名转换成字典描述
-                //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);
+                // 遍历变量名转换成字典描述
+                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;
+                    // 检查是否为数组
+                    if (valueObj.GetType().IsArray)
+                    {
+                        var array = valueObj as Array;
+                        resultString = ArrayToString(array);
+                    }
+                    else
+                    {
+                        resultString = valueObj.ToString();
+                    }
+                    dic.Add(name, resultString);
+                }
+                string paramJson = JsonConvert.SerializeObject(dic);
                 #endregion
                 #endregion
 
 
-                string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
+                //string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
 
 
                 #region MAS测试项
                 #region MAS测试项
                 XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
                 XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
@@ -5278,6 +5425,9 @@ namespace MainForm
                 float fGlue_HeightsMin = stPLC_MesData.testData.fGlue_HeightsMin;
                 float fGlue_HeightsMin = stPLC_MesData.testData.fGlue_HeightsMin;
 
 
                 XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
                 XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
+                inspectionItemData.childUnitSn = strProductBarcode;
+                inspectionItemData.childUnitState = AllpassFlag;
+                inspectionItemData.toolVersion = "1.0";
                 if (fGlue_AreasMax > fGlue_AreasMin && (fGlue_AreasMax != 0 || fGlue_AreasMin != 0))
                 if (fGlue_AreasMax > fGlue_AreasMin && (fGlue_AreasMax != 0 || fGlue_AreasMin != 0))
                 {
                 {
                     for (int i = 0; i < fGlue_Areas.Length -1 ; i++)
                     for (int i = 0; i < fGlue_Areas.Length -1 ; i++)
@@ -5305,10 +5455,6 @@ namespace MainForm
                     }
                     }
                     inspectionItemData.AddDataItem("GlueLine", "胶线高度", string.Join(",", fGlue_Heights), fGlue_HeightsMax.ToString(), fGlue_HeightsMin.ToString(), passFlag);
                     inspectionItemData.AddDataItem("GlueLine", "胶线高度", string.Join(",", fGlue_Heights), fGlue_HeightsMax.ToString(), fGlue_HeightsMin.ToString(), passFlag);
                 }
                 }
-
-                inspectionItemData.childUnitSn = strProductBarcode;
-                inspectionItemData.childUnitState = AllpassFlag;
-                inspectionItemData.toolVersion = "1.0";
                 #endregion
                 #endregion
 
 
                 int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
                 int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
@@ -5442,7 +5588,7 @@ namespace MainForm
                             //stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
                             //stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
                             //stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
                             //stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
                             //stPLC_MesData.iotData.beatAction = 1;
                             //stPLC_MesData.iotData.beatAction = 1;
-                            //stPLC_MesData.iotData.beatAction = 2;
+                            //stPLC_MesData.iotData.beatAction = 2; 
                             //stPLC_MesData.iotData.beatAction = 3;
                             //stPLC_MesData.iotData.beatAction = 3;
                             //stPLC_MesData.iotData.beatAction = 4;
                             //stPLC_MesData.iotData.beatAction = 4;
                             //stPLC_MesData.iotData.beatAction = 5;
                             //stPLC_MesData.iotData.beatAction = 5;
@@ -5793,18 +5939,27 @@ namespace MainForm
 
 
                 if (GlobalContext.MQTTIsSendUpFile)
                 if (GlobalContext.MQTTIsSendUpFile)
                 {
                 {
-                    string[] urlarry = GlobalContext.UpFilePath.Split(",");
-                    fileUploadData.fileData.Clear();
-                    foreach (var item in urlarry)
+                    CopyFileToTempPath(GlobalContext.UpFilePath, GlobalContext.MqttFileTempDir);
+                    if (Directory.Exists(GlobalContext.MqttFileTempDir))
                     {
                     {
-                        if (!string.IsNullOrEmpty(item))
+                        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
+                        if (result.Item1 == 1)
                         {
                         {
-                            //上传图片
-                            var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
-                                item, uuid).Result;
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                         }
                         }
                     }
                     }
+                    //string[] urlarry = GlobalContext.UpFilePath.Split(",");
+                    //// fileUploadData.fileData.Clear();
+                    //foreach (var item in urlarry)
+                    //{
+                    //    if (!string.IsNullOrEmpty(item))
+                    //    {
+                    //        //上传图片
+                    //        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result,
+                    //            item, uuid).Result;
+                    //        OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
+                    //    }
+                    //}
                 }
                 }
 
 
                 #endregion
                 #endregion
@@ -5813,19 +5968,29 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP50_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_50_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
-
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
 
 
                 #endregion
                 #endregion
@@ -6393,19 +6558,29 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP60_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_60_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
-
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
 
 
                 #endregion
                 #endregion
@@ -7037,17 +7212,28 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP70_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_70_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
 
 
@@ -7524,18 +7710,27 @@ namespace MainForm
 
 
                 if (GlobalContext.MQTTIsSendUpFile)
                 if (GlobalContext.MQTTIsSendUpFile)
                 {
                 {
-                    string[] urlarry = GlobalContext.UpFilePath.Split(",");
-                    fileUploadData.fileData.Clear();
-                    foreach (var item in urlarry)
+                    CopyFileToTempPath(GlobalContext.UpFilePath, GlobalContext.MqttFileTempDir);
+                    if (Directory.Exists(GlobalContext.MqttFileTempDir))
                     {
                     {
-                        if (!string.IsNullOrEmpty(item))
+                        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName, a1Result, GlobalContext.MqttFileTempDir, uuid).Result;
+                        if (result.Item1 == 1)
                         {
                         {
-                            //上传图片
-                            var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName,
-                                a1Result, item, uuid).Result;
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                             OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
                         }
                         }
                     }
                     }
+                    //string[] urlarry = GlobalContext.UpFilePath.Split(",");
+                    //// fileUploadData.fileData.Clear();
+                    //foreach (var item in urlarry)
+                    //{
+                    //    if (!string.IsNullOrEmpty(item))
+                    //    {
+                    //        //上传图片
+                    //        var result = SaveDBbyFileInfo(stPLC_MesData.BarcodeSet, stationCode, stationName,
+                    //            a1Result, item, uuid).Result;
+                    //        OnMessage(LogType.Error, $"【文件上传】 产品码 [{sn}] " + result.Item2);
+                    //    }
+                    //}
                 }
                 }
 
 
                 #endregion
                 #endregion
@@ -7544,17 +7739,28 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP80_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_80_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);
 
 
@@ -7991,17 +8197,28 @@ namespace MainForm
                 ////创建字典
                 ////创建字典
                 //var dic = new Dictionary<string, string>();
                 //var dic = new Dictionary<string, string>();
                 //// 获取结构体类型
                 //// 获取结构体类型
-                //FieldInfo[] fields = typeof(OP90_DataSet_t).GetFields();
+                //FieldInfo[] fields = typeof(OP40_DataSet_t).GetFields();
+                //string resultString = "";
 
 
                 //// 遍历变量名转换成字典描述
                 //// 遍历变量名转换成字典描述
                 //foreach (FieldInfo field in fields)
                 //foreach (FieldInfo field in fields)
                 //{
                 //{
                 //    //获取枚举描述
                 //    //获取枚举描述
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
                 //    string name = XiaomiMESEnumMethod.GetEnumDescriptionByName(field.Name,
-                //        typeof(XiaomiMESEnum_ProcessData.Enum_90_ProcessData));
+                //        typeof(XiaomiMESEnum_ProcessData.Enum_40_ProcessData));
                 //    //获取过站明细的值
                 //    //获取过站明细的值
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
                 //    object valueObj = field.GetValue(stPLC_MesData.mesData) ?? 0;
-                //    dic.Add(name, valueObj.ToString());
+                //    // 检查是否为数组
+                //    if (valueObj.GetType().IsArray)
+                //    {
+                //        var array = valueObj as Array;
+                //        resultString = ArrayToString(array);
+                //    }
+                //    else
+                //    {
+                //        resultString = valueObj.ToString();
+                //    }
+                //    dic.Add(name, resultString);
                 //}
                 //}
                 //string paramJson = JsonConvert.SerializeObject(dic);
                 //string paramJson = JsonConvert.SerializeObject(dic);