WIN-GH9CEESPLTB\Administrator 3 hete%!(EXTRA string=óta)
szülő
commit
2f5921f5c4

+ 0 - 523
MainForm/Atlas/AtlasScrew.cs

@@ -1,523 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using MainForm;
-using MathNet.Numerics.RootFinding;
-using Newtonsoft.Json;
-
-namespace CommonLib
-{
-    public class AtlasScrew : BaseScrew
-    {
-        MTF6KConnStus connFlow = new MTF6KConnStus();
-        public TightResult tightResult = new TightResult();
-
-        string receiveMsg;
-
-        //连接状态
-        //public bool connectStaus = false;
-
-        public Thread MTF6KThread;
-
-        public AtlasScrew(object ip, object port, int connectTimeOut,int sendDataTimeOut,string direction)
-        {
-            Ip = ip.ToString();
-            Port = port.ToString();
-            ConnectTimeOut = connectTimeOut;
-            SendDataTimeOut = sendDataTimeOut;
-            IsCarriage = true;
-            IsShield = false;
-            Direction = direction;
-        }
-
-        /// <summary>
-        /// MTF6K连接流程结构体
-        /// </summary>
-        enum MTF6KConnStus
-        {
-            Idle,
-            Disconnect,
-            Connected,
-            CheckConnect,
-            SelectPSET,
-            CheckSelectPSET,
-            SelectBatch,
-            CheckSelectBatch,
-            SubscribeResult,
-            CheckSubscribeResult1,
-            CheckSubscribeResult2,
-            CheckSubscribeResult3,
-            SubscribeCurve,
-            CheckSubscribeCurve,
-            Ready,
-            UnsubcribeResult,
-            UnsubscribeCurve,
-        };
-
-        /// <summary>
-        /// 拧紧结果
-        /// </summary>
-        public class TightResult
-        {
-            /// <summary>
-            /// 扭矩数组
-            /// </summary>
-            public double[] torque;
-            /// <summary>
-            /// 角度数组
-            /// </summary>
-            public double[] angle;
-            /// <summary>
-            /// 
-            /// </summary>
-            public double torCoef = 0.0;
-            /// <summary>
-            /// 
-            /// </summary>
-            public double angCoef = 0.0;
-            /// <summary>
-            /// 峰值扭矩
-            /// </summary>
-            public double PearkTorque = 0.0;
-            /// <summary>
-            /// 总角度
-            /// </summary>
-            public double TotalAngle = 0.0;//总角度
-            /// <summary>
-            /// 总持续时间
-            /// </summary>
-            public double TotalDuration;//总持续时间
-            /// <summary>
-            /// 结果代码
-            /// </summary>
-            public int ResultCode = 0;//结果代码
-
-            public TightResult()
-            {
-
-            }
-            public void Reset()
-            {
-                torCoef = 0.0;
-                angCoef = 0.0;
-                ResultCode = 0;
-                PearkTorque = 0.0;//峰值扭矩
-                TotalAngle = 0.0;//总角度
-                TotalDuration = 0.0;//总持续时间
-                MTF6K.isDataRecvFinish = false;
-            }
-
-        }
-        private Communicate TCP;
-        public override void Initial()
-        {
-            base.Initial();
-            try
-            {
-                // 如果线程已经存在,先关闭旧线程
-                if (MTF6KThread != null && MTF6KThread.IsAlive)
-                {
-                    MTF6KThread.Abort(); // 强制终止线程(注意:Abort 不推荐使用,建议改用信号机制)
-                    MTF6KThread = null;
-                }
-
-                // 如果 TCP 已经连接,先关闭连接
-                if (TCP != null)
-                {
-                    TCP.ConnectedResult -= new Communicate.ConnectResultEventHandler(Comm_ConnectedResult);
-                    TCP.MessageReceived -= new Communicate.MessageReceivedEventHandler(Comm_MessageReceived);
-                    TCP.closeSocket();
-                    TCP = null;
-                }
-
-                TCP = new Communicate("TCP1", Ip, Convert.ToInt32(Port));
-                TCP.FormOpening = true;
-                TCP.ConnectedResult += new Communicate.ConnectResultEventHandler(Comm_ConnectedResult);
-                TCP.MessageReceived += new Communicate.MessageReceivedEventHandler(Comm_MessageReceived);
-
-                MTF6KThread = new Thread(MTF6KFlow);
-                MTF6KThread.IsBackground = true;
-                MTF6KThread.Start();
-                IsOk = true;
-            }
-            catch (Exception)
-            {
-                IsOk = IsShield ? true : false;
-            }
-        }
-
-        /// <summary>
-        /// MTF6K -TCP连接状态
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        public void Comm_ConnectedResult(object sender, Communicate.ResultEventArgs e)
-        {
-            if (e.conResult)
-            {
-                connFlow = MTF6KConnStus.Connected;
-                connectStaus = true;
-
-            }
-            else
-            {
-                connectStaus = false;
-            }
-
-        }
-
-        /// <summary>
-        /// 接收数据-MTF6K
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        public void Comm_MessageReceived(object sender, Communicate.MessageEventArgs e)
-        {
-            if (connFlow == MTF6KConnStus.Ready)
-            {
-                MTF6K.ParseKerwords(e.byteMes, false);
-                ReceiveIP = ((CommonLib.Communicate)sender).IpAddress.ToString();
-            }
-            else
-            {
-                MTF6K.ParseKerwords(e.byteMes, true);
-            }
-        }
-        /// <summary>
-        /// 连接MTF6K流程
-        /// </summary>
-        private void MTF6KFlow()
-        {
-            int screwIndex = 0;
-
-            while (true)
-            {
-                Thread.Sleep(20);
-                while (connectStaus)
-                {
-                    Thread.Sleep(20);
-                    try
-                    {
-                        switch (connFlow)
-                        {
-                            case MTF6KConnStus.Idle:
-                                break;
-                            case MTF6KConnStus.Disconnect:
-                                {
-                                    TCP.SendMessage(MTF6K.disconnect);
-                                    connectStaus = false;
-                                    TCP.FormOpening = false;
-                                    TCP.ConnectedResult -= new Communicate.ConnectResultEventHandler(Comm_ConnectedResult);
-                                    TCP.MessageReceived -= new Communicate.MessageReceivedEventHandler(Comm_MessageReceived);
-                                    TCP.closeSocket();
-                                    TCP = null;
-                                }
-                                break;
-                            case MTF6KConnStus.Connected:
-                                TCP.SendMessage(MTF6K.disconnect);
-                                Thread.Sleep(20);
-                                TCP.SendMessage(MTF6K.connect);
-                                connFlow = MTF6KConnStus.CheckConnect;
-                                break;
-                            case MTF6KConnStus.CheckConnect:
-                                if (MTF6K.MID == "0002")
-                                {
-                                    TCP.SendMessage(MTF6K.keepAlive);
-                                    connFlow = MTF6KConnStus.SelectPSET;
-                                }
-                                else
-                                { }
-                                break;
-                            case MTF6KConnStus.SelectPSET:
-                                TCP.SendMessage(MTF6K.switchPSET1);
-                                connFlow = MTF6KConnStus.CheckSelectPSET;
-                                break;
-                            case MTF6KConnStus.CheckSelectPSET:
-                                if (MTF6K.MID == "0005")
-                                {
-                                    connFlow = MTF6KConnStus.SubscribeResult;
-                                }
-                                else if (MTF6K.MID == "0004")
-                                {
-                                    connFlow = MTF6KConnStus.SubscribeResult;
-                                }
-                                break;
-                            case MTF6KConnStus.SubscribeResult:
-                                TCP.SendMessage(MTF6K.subscribeTightingResult);
-                                connFlow = MTF6KConnStus.CheckSubscribeResult1;
-                                break;
-                            case MTF6KConnStus.CheckSubscribeResult1:
-                                if (MTF6K.MID == "1202")
-                                {
-                                    connFlow = MTF6KConnStus.SubscribeCurve;
-                                }
-                                else
-                                { }
-                                break;
-                            case MTF6KConnStus.SubscribeCurve:
-                                TCP.SendMessage(MTF6K.subscribeLastTightingCurve);
-                                connFlow = MTF6KConnStus.CheckSubscribeCurve;
-                                break;
-                            case MTF6KConnStus.CheckSubscribeCurve:
-                                if (MTF6K.MID == "0005")
-                                {
-                                    connFlow = MTF6KConnStus.Ready;
-                                }
-                                else
-                                { }
-                                break;
-                            case MTF6KConnStus.Ready:
-
-                                {
-                                    if (MTF6K.MID == "0901" && MTF6K.isDataRecvFinish == true)
-                                    {
-                                        MTF6K.MID = "error";
-                                        MTF6K.TightingResult.Convert(out tightResult.ResultCode, out tightResult.PearkTorque, out tightResult.TotalAngle, out tightResult.TotalDuration);
-                                        
-                                        tightResult.torque = new double[MTF6K.CurveResult.SampleCount];
-                                        tightResult.angle = new double[MTF6K.CurveResult.SampleCount];
-                                        MTF6K.CurveResult.Convert(out tightResult.torque, out tightResult.torCoef, out tightResult.angle, out tightResult.angCoef);
-                                        
-                                        #region 保存数据
-                                        string dic = GlobalContext.AtlasLogDir + "扭力曲线\\";
-                                        if (!Directory.Exists(dic))
-                                        {
-                                            Directory.CreateDirectory(dic);
-                                        }
-                                        string 扭力曲线文件名 = dic + DateTime.Now.ToString("yyyy_MM_dd") +".csv" ;
-
-                                        string strDirection = "";
-                                        string strValue="";
-                                        StringBuilder sbStr =new StringBuilder();
-                                        if (!File.Exists(扭力曲线文件名))
-                                        {
-                                            // 记录时间,产品SN,螺丝序号
-                                            //sbStr.AppendLine("序号,产品SN,扭力数组,角度数组,峰值扭矩,总角度,总持续时间,结果代码,工位");
-                                            sbStr.Append("序号,产品SN,扭力数组,角度数组,峰值扭矩,总角度,总持续时间,结果代码,工位");
-                                            File.WriteAllText(扭力曲线文件名, sbStr.ToString());
-                                        }
-                                        if (ReceiveIP == GlobalContext.AtlasAddressLeft)
-                                        {
-                                            //左工位
-                                            Form_Home.screwIndex_left += 1;//螺丝序号,采集一次加一次,进站时先清0
-                                            screwIndex = Form_Home.screwIndex_left;
-                                            strDirection = "左工位";
-                                            string torqueData = string.Join(",", tightResult.torque);
-                                            string angleData = string.Join(",", tightResult.angle);
-                                            string sn = Form_Home.barcode_left.strProductBarcode;
-                                            strValue=$"{screwIndex},{sn},{torqueData},{angleData},{tightResult.PearkTorque},{tightResult.TotalAngle}" +
-                                                $",{tightResult.TotalDuration},{tightResult.ResultCode},{strDirection}";
-                                        }
-                                        else if (ReceiveIP == GlobalContext.AtlasAddressRight)
-                                        {
-                                            Form_Home.screwIndex_right += 1;//螺丝序号,采集一次加一次,进站时先清0
-                                            screwIndex = Form_Home.screwIndex_right;
-                                            strDirection = "右工位";
-                                            string torqueData = string.Join(",", tightResult.torque);
-                                            string angleData = string.Join(",", tightResult.angle);
-                                            string sn = Form_Home.barcode_left.strProductBarcode;
-                                            strValue = $"{screwIndex},{sn},{torqueData},{angleData},{tightResult.PearkTorque},{tightResult.TotalAngle}" +
-                                                $",{tightResult.TotalDuration},{tightResult.ResultCode},{strDirection}";
-                                        }
-                                        
-                                        using(StreamWriter writer=new StreamWriter(扭力曲线文件名,true)){
-                                            writer.WriteLine(strValue);
-                                        }
-
-                                        #endregion 保存数据
-
-                                        //tightResult.PearkTorque = tightResult.PearkTorque / 98;
-                                       
-                                        #region 删除
-                                        //double preDegree = 0;
-                                        //double curDegree = 0;
-                                        //bool Step3 = false;
-                                        //double PearkTorque = 0.0;
-                                        //double Pearkdegree = 0.0;
-                                        //double mindegree = 0;
-                                        //double minvalue = 0;
-                                        //JD.Clear();
-                                        //NL.Clear();
-                                        //List<double> pearkTorqueList = new List<double>(); // 存储 PearkTorque
-                                        //List<double> pearkDegreeList = new List<double>(); // 存储 Pearkdegree
-                                        //for (int i = 0; i < tightResult.angle.Length; i++)
-                                        //{
-                                        //    double degree = tightResult.angle[i] * tightResult.angCoef;
-                                        //    double torque = tightResult.torque[i] * tightResult.torCoef / 98;
-                                        //    preDegree = curDegree;
-                                        //    curDegree = degree;
-                                        //    if (i > tightResult.angle.Length - 5 && torque <= 0)
-                                        //    {
-                                        //        continue;
-                                        //    }
-                                        //    JD.Add(Math.Round(degree,0).ToString());
-                                        //    NL.Add(Math.Round(torque,2).ToString());
-                                        //    //反转
-                                        //    if (curDegree - preDegree <= 0 && degree < 0)
-                                        //    {
-                                        //        if (torque > PearkTorque)
-                                        //        {
-                                        //            PearkTorque = torque;
-                                        //            Pearkdegree = degree;
-                                        //        }
-
-                                        //        if (torque < mindegree)
-                                        //        {
-                                        //            mindegree = torque;
-                                        //            minvalue = degree;
-                                        //        }
-
-                                        //    }
-                                        //    else if (curDegree - preDegree > 0)//正转
-                                        //    {
-                                        //        if (degree < 360 && !Step3)//切换扭矩值
-                                        //        {
-                                        //            if (torque > PearkTorque)
-                                        //            {
-                                        //                PearkTorque = torque;
-                                        //                Pearkdegree = degree;
-                                        //            }
-                                        //        }
-                                        //        else
-                                        //        {
-                                        //            Step3 = true;
-                                        //            if (torque > PearkTorque)
-                                        //            {
-                                        //                PearkTorque = torque;
-                                        //                Pearkdegree = degree;
-                                        //            }
-                                        //        }
-                                        //    }
-                                        //    pearkTorqueList.Add(Math.Round(Pearkdegree)); // 添加到列表
-                                        //    pearkDegreeList.Add(Math.Round(PearkTorque, 2)); // 添加到列表
-                                        //}
-                                        
-                                        ////精度
-                                        //JD_MEAN = Math.Round(Pearkdegree);
-                                        ////扭力
-                                        //NL_MEAN = Math.Round(PearkTorque, 2);
-                                        //// 调用 AddData 方法,存储数据
-                                        //AddData(JD_MEAN, NL_MEAN, pearkTorqueList.ToArray(), pearkDegreeList.ToArray());
-                                        #endregion
-                                    }
-                                }
-                                break;
-                            case MTF6KConnStus.UnsubscribeCurve:
-                                TCP.SendMessage(MTF6K.unsubscribeLastTightingCurve);
-                                break;
-                            case MTF6KConnStus.UnsubcribeResult:
-                                TCP.SendMessage(MTF6K.unsubscribeTightingResult);
-                                break;
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        //logHelper.WriteLog("阿特拉斯通讯异常:" + e.StackTrace);
-                    }
-                }
-            }
-        }
-         // 线程安全锁对象
-        private readonly object _queueLock = new object();
-        // 添加数据到缓存
-        private readonly Queue<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)> _dataQueueLeft = new Queue<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)>();
-        private readonly Queue<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)> _dataQueueRight = new Queue<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)>();
-
-        // 添加数据到缓存
-        public void AddData(double jdMean, double nlMean, double[] pearkTorque, double[] pearkDegree)
-        {
-            lock (_queueLock)
-            {
-                if (ReceiveIP == GlobalContext.AtlasAddressLeft)
-                {
-                    _dataQueueLeft.Enqueue((jdMean, nlMean, pearkTorque, pearkDegree));
-                }
-                else if (Direction == GlobalContext.AtlasAddressRight)
-                {
-                    _dataQueueRight.Enqueue((jdMean, nlMean, pearkTorque, pearkDegree));
-                }
-            }
-        }
-
-        // 获取并清空缓存中的所有数据(左侧)
-        public IEnumerable<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)> GetCachedDataLeft()
-        {
-            lock (_queueLock)
-            {
-                var cachedData = _dataQueueLeft.ToList(); // 将当前队列内容复制到列表
-                _dataQueueLeft.Clear(); // 清空队列
-                return cachedData;
-            }
-        }
-
-        // 获取并清空缓存中的所有数据(右侧)
-        public IEnumerable<(double JD_MEAN, double NL_MEAN, double[] PearkTorque, double[] Pearkdegree)> GetCachedDataRight()
-        {
-            lock (_queueLock)
-            {
-                var cachedData = _dataQueueRight.ToList(); // 将当前队列内容复制到列表
-                _dataQueueRight.Clear(); // 清空队列
-                return cachedData;
-            }
-        }
-
-        public void DrawCurveDegTor()
-        {
-            double preDegree = 0;
-            double curDegree = 0;
-            bool Step3 = false;
-            double PearkTorque = 0.0;
-            double Pearkdegree = 0.0;
-            for (int i = 0; i < tightResult.angle.Length; i++)
-            {
-                double degree = tightResult.angle[i] * tightResult.angCoef;
-                double torque = tightResult.torque[i] * tightResult.torCoef / 98;
-                preDegree = curDegree;
-                curDegree = degree;
-
-                //反转
-                if (curDegree - preDegree <= 0 && degree < 0)
-                {
-
-                    if (torque > PearkTorque)
-                    {
-                        PearkTorque = torque;
-                        Pearkdegree = degree;
-                    }
-                }
-                else if (curDegree - preDegree > 0)//正转
-                {
-                    if (degree < 360 && !Step3)//切换扭矩值
-                    {
-
-                        if (torque > PearkTorque)
-                        {
-                            PearkTorque = torque;
-                            Pearkdegree = degree;
-                        }
-                    }
-                    else
-                    {
-                        Step3 = true;
-
-                        if (torque > PearkTorque)
-                        {
-                            PearkTorque = torque;
-                            Pearkdegree = degree;
-                        }
-                    }
-                    //bianliang.NL_MEAN = PearkTorque;
-                    //   bianliang.JD_MEAN = Pearkdegree;
-                }
-
-            }
-        }
-
-
-
-
-    }
-}

+ 6 - 3
MainForm/ClassFile/XiaomiAPI_MES/XiaomiMESHttp_ConfirmInfoVerify.cs

@@ -23,7 +23,7 @@ namespace MainForm.ClassFile.XiaomiAPI_MES
         /// <summary>
         /// 接口方法
         /// </summary>
-        protected new static string Method { set; get; } = "UnitConfirmInfoVerify";
+        protected new static string Method { set; get; } = "MaterialConfirmDataVerify";
         #endregion 变量
 
         /// <summary>
@@ -88,16 +88,19 @@ namespace MainForm.ClassFile.XiaomiAPI_MES
             /// 客⼾端本机MAC地址(格式:4C-52-62-39-CC-F0)
             /// </summary>
             public string clientMac { get; set; } = string.Empty;
-
             /// <summary>
             /// 客⼾端请求时间(格式:yyyy-MM-dd HH:mm:ss)
             /// </summary>
             public string clientTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
             /// <summary>
-            /// 物料sn
+            /// 产品sn
             /// </summary>
             public string unitSn { get; set; } = string.Empty;
             /// <summary>
+            /// 物料sn
+            /// </summary>
+            public string materialSn { get; set; } = string.Empty;
+            /// <summary>
             /// 操作⼈
             /// </summary>
             public string userId { get; set; } = string.Empty;

+ 106 - 154
MainForm/FaForm/Form_Home.cs

@@ -121,8 +121,8 @@ namespace MainForm
         private int IntervalAlarm = 1000; //ms 数据(报警)查询与设备运行信息
 
         //采集Atlas数据
-        AtlasScrew atlasScrewLeft;
-        AtlasScrew atlasScrewRight;
+        AtlasScrew_Left atlasScrewLeft;
+        AtlasScrew_Right atlasScrewRight;
 
         /// <summary>
         /// 设备报警数据
@@ -553,10 +553,10 @@ namespace MainForm
                     //收集Atlas
                     if (GlobalContext.IsUsePLC7)
                     {
-                        atlasScrewLeft = new AtlasScrew(GlobalContext.AtlasAddressLeft, GlobalContext.AtlasAddressPort,
+                        atlasScrewLeft = new AtlasScrew_Left(GlobalContext.AtlasAddressLeft, GlobalContext.AtlasAddressPort,
                             3000, 3000, "Left");
                         atlasScrewLeft.Initial();
-                        atlasScrewRight = new AtlasScrew(GlobalContext.AtlasAddressRight, GlobalContext.AtlasAddressPort,
+                        atlasScrewRight = new AtlasScrew_Right(GlobalContext.AtlasAddressRight, GlobalContext.AtlasAddressPort,
                             3000, 3000, "Right");
                         atlasScrewRight.Initial();
                     }
@@ -1139,7 +1139,6 @@ namespace MainForm
         public static string _strProductBarcode = "";
         public static string _strCarrierBarcode = "";
         DateTime lastWarningTime = DateTime.MinValue;
-        TimeSpan warningInterval = TimeSpan.FromSeconds(10); // 每10秒提醒一次
         public static BarcodeSet_t barcode_left =new BarcodeSet_t();
         public static BarcodeSet_t barcode_right = new BarcodeSet_t();
 
@@ -1506,7 +1505,7 @@ namespace MainForm
         /// <param name="Barcode"></param>
         /// <param name="iotData"></param>
         /// <returns></returns>
-        public int PostMesByCheck(string ProductBarcode, string machineId,string stationId)
+        public int PostMesByCheck(string ProductBarcode,string PCBBarcode, string machineId,string stationId)
         {
             int res = 0;
             string jsonstr1 = "";
@@ -1518,7 +1517,8 @@ namespace MainForm
                 outRequest_Body.clientMac = GlobalContext.MacStr; // 客⼾端本机MAC地址,格式:XX-XX-XX-XX-XX-XX
                 outRequest_Body.clientTime =
                     DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); // 客⼾端请求时间,格式yyyy-MM-dd HH:mm:ss.fff
-                outRequest_Body.unitSn = ProductBarcode; // 产品SN
+                outRequest_Body.unitSn = PCBBarcode; // 产品SN
+                outRequest_Body.materialSn = ProductBarcode; // 产品SN
                 outRequest_Body.userId = GlobalContext.MESUserId; // ⽤⼾ID
                 outRequest_Body.factoryId = long.Parse(GlobalContext.Factory_Code); // ⼯⼚id
 
@@ -1680,9 +1680,9 @@ namespace MainForm
                             $"【进站数据 SN {stationIn.Sn}】上传MES服务器---失败!接口报错信息: {mesRet},请求参数:{json_Body}");
                     }
 
-                    string sql_response =
-                        stationIn.ToStringUpdateStationInReturn_body(JsonConvert.SerializeObject(response));
-                    SQLHelper_New.ExecuteNonQuery(sql_response, null);
+                    //string sql_response =
+                    //    stationIn.ToStringUpdateStationInReturn_body(JsonConvert.SerializeObject(response));
+                    //SQLHelper_New.ExecuteNonQuery(sql_response, null);
                 }
                 catch (Exception ex)
                 {
@@ -1878,7 +1878,7 @@ namespace MainForm
                                 DataTable jd_Table = jd_row.Any() ? jd_row.CopyToDataTable(): dt.Clone();
                                 //只保留螺丝序号和扭力
                                 DataTable jd_dt = Form_Home.GetSelectedColumns(jd_Table, new[] {"序号", "角度数组" } );
-                                string jd_json = JsonConvert.SerializeObject(nj_dt, Formatting.Indented);
+                                string jd_json = JsonConvert.SerializeObject(jd_dt, Formatting.Indented);
                                 outRequest_Body.unitData.processData.Add(
                                     new XmStationOut_ProcessData()
                                     {
@@ -2019,10 +2019,10 @@ namespace MainForm
                         }
                         fileUploadData.fileData.Clear();
 
-                        string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
-                            JsonConvert.SerializeObject(outRequest_Body),
-                            JsonConvert.SerializeObject(response), id);
-                        SQLHelper_New.ExecuteNonQuery(sql_UpStationout, null);
+                        //string sql_UpStationout = ProcessData.ToStringUpdateStationOut_body(
+                        //    JsonConvert.SerializeObject(outRequest_Body),
+                        //    JsonConvert.SerializeObject(response), id);
+                        //SQLHelper_New.ExecuteNonQuery(sql_UpStationout, null);
                     }
                     #endregion
                 }
@@ -2280,7 +2280,7 @@ namespace MainForm
             return Encoding.UTF8.GetString(btArr);
         }
 
-        private void CollectAndProcessDataLeft(AtlasScrew atlasScrew, string sn, string direction)
+        private void CollectAndProcessDataLeft(AtlasScrew_Left atlasScrew, string sn, string direction)
         {
             Stopwatch stopwatch = new Stopwatch();
             stopwatch.Start();
@@ -2385,7 +2385,7 @@ namespace MainForm
             }
         }
 
-        private void CollectAndProcessDataRight(AtlasScrew atlasScrew, string sn, string direction)
+        private void CollectAndProcessDataRight(AtlasScrew_Right atlasScrew, string sn, string direction)
         {
             Stopwatch stopwatch = new Stopwatch();
             stopwatch.Start();
@@ -3936,13 +3936,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -4302,13 +4299,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 //这个地方之后PLC可能会返回SN码,到时用返回的和数据库中的比较下对错,结果faalse怎么办现在不知道
@@ -4403,13 +4397,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -5023,13 +5014,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -5132,13 +5120,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -5572,13 +5557,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -5667,13 +5649,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -6245,14 +6224,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
-
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 stPLC_MesData.BarcodeSet.strProductBarcode = strProductBarcode;
@@ -6372,7 +6347,7 @@ namespace MainForm
                     inspectionItemData.AddDataItem("AirPressure", "ADD板压力", fForceAddPCB.ToString(), fForceAddPCBMax.ToString(), fForceAddPCBMin.ToString(), passFlag);
                 }
 
-                inspectionItemData.childUnitSn = strProductBarcode;
+                inspectionItemData.childUnitSn = pcbBarcode;
                 inspectionItemData.childUnitState = AllpassFlag;
                 inspectionItemData.toolVersion = "1.0";
                 #endregion
@@ -6391,7 +6366,7 @@ namespace MainForm
                 }
                 else if (stPLC_MesData.mesCommFrmPLC.cmdParam == 1)
                 {
-                    result1 = PostMesByCheck(sn,GlobalContext.s5_device_code,GlobalContext.S5_StationId);
+                    result1 = PostMesByCheck(sn, pcbBarcode, GlobalContext.s5_device_code,GlobalContext.S5_StationId);
                     AddMessage(LogType.Info, stationNameStr + "_校验结束");
                 }
                 //原流程,ADD板进站==>ADD板出站==>组装==>壳体出站
@@ -6412,24 +6387,24 @@ namespace MainForm
                 //if (mesResultFrmWeb == 1)
                 //{
                 //    //进站结果写入PLC
-                //    resultToPlC.cmd = 0;
-                //    resultToPlC.cmdParam = 0; //指令参数
-                //    resultToPlC.cmdResult = mesResultFrmWeb;
-                //    WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, resultToPlC);
-
-                    //保存PLC返回MES数据到本地
-                    //ResponseMessage message = new ResponseMessage();
-                    //message = SQLHelper.InsertOp50Data(CarrierBarcode, sn, stPLC_MesData.mesData.nIsAddPCBAsmOK,
-                    //    stPLC_MesData.mesData.nHaveAddPCB, stPLC_MesData.mesData.fForceAddPCB,
-                    //    stPLC_MesData.mesData.nRemainCount, "");
-                    //if (message.result == false)
-                    //{
-                    //    OnMessage(LogType.Info, stationNameStr + "_保存加工数据到本地失败");
-                    //}
-                    //else
-                    //{
-                    //    OnMessage(LogType.Info, stationNameStr + "_保存加工数据到本地成功");
-                    //}
+                resultToPlC.cmd = 0;
+                resultToPlC.cmdParam = 0; //指令参数
+                resultToPlC.cmdResult = mesResultFrmWeb;
+                WriteResultToPlc(plcNo, stationNameStr, tagMesCommName, 1, resultToPlC);
+
+                //保存PLC返回MES数据到本地
+                //ResponseMessage message = new ResponseMessage();
+                //message = SQLHelper.InsertOp50Data(CarrierBarcode, sn, stPLC_MesData.mesData.nIsAddPCBAsmOK,
+                //    stPLC_MesData.mesData.nHaveAddPCB, stPLC_MesData.mesData.fForceAddPCB,
+                //    stPLC_MesData.mesData.nRemainCount, "");
+                //if (message.result == false)
+                //{
+                //    OnMessage(LogType.Info, stationNameStr + "_保存加工数据到本地失败");
+                //}
+                //else
+                //{
+                //    OnMessage(LogType.Info, stationNameStr + "_保存加工数据到本地成功");
+                //}
                 //}
 
                 //保存部件码信息
@@ -6797,12 +6772,12 @@ namespace MainForm
                 }
                 sn = ProductBarcode;
                 AddMessage(LogType.Info, $"载具码:{strCarrierBarcode};产品码:{sn}");
-                if (ProductBarcode != "")
-                {
-                    MessageBox.Show($"产品码:{sn}线外螺丝机过站后点击确认", "提示",
-                    MessageBoxButtons.OK,
-                    MessageBoxIcon.Information);
-                }
+                //if (ProductBarcode != "")
+                //{
+                //    MessageBox.Show($"产品码:{sn}线外螺丝机过站后点击确认", "提示",
+                //    MessageBoxButtons.OK,
+                //    MessageBoxIcon.Information);
+                //}
 
                 // 产品SN(物料码)校验
                 List<TestItem> item = new List<TestItem>();
@@ -6906,13 +6881,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -7217,8 +7189,7 @@ namespace MainForm
                                         ProgressState = true;
                                         Task.Run(() => S7进站(plcNo, stationNameStr, stPLC_MesData.Left,
                                             tagBaseName + ".Left." + tagMesCommName,
-                                            tagBaseName + ".Left." + tagBarsetName, "Left", out ProgressState,
-                                            atlasScrewLeft));
+                                            tagBaseName + ".Left." + tagBarsetName, "Left", out ProgressState));
                                     }
                                 }
                             }
@@ -7284,8 +7255,7 @@ namespace MainForm
                                         ProgressState = true;
                                         Task.Run(() => S7进站(plcNo, stationNameStr, stPLC_MesData.Right,
                                             tagBaseName + ".Right." + tagMesCommName,
-                                            tagBaseName + ".Right" + tagBarsetName, "Right", out ProgressState,
-                                            atlasScrewRight));
+                                            tagBaseName + ".Right" + tagBarsetName, "Right", out ProgressState));
                                     }
                                 }
                             }
@@ -7457,7 +7427,7 @@ namespace MainForm
         /// <param name="stPLC_MesData"></param>
         /// <param name="tagMesCommName"></param>
         private void S7进站(int plcNo, string stationNameStr, OP70_stnDataSet_t stPLC_MesData, string tagMesCommName,
-            string tagBarsetName, string direction, out bool ProgressState, AtlasScrew atlasScrew)
+            string tagBarsetName, string direction, out bool ProgressState)
         {
             Stopwatch stopwatch1 = new Stopwatch();
             Stopwatch stopwatch2 = new Stopwatch();
@@ -7479,13 +7449,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
                 sn = strProductBarcode;
                 AddMessage(LogType.Info, $"载具码:{strCarrierBarcode};产品码:{sn}");
@@ -7620,13 +7587,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -8027,13 +7991,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -8123,13 +8084,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -8520,13 +8478,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(strCarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{strCarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;
@@ -8616,13 +8571,10 @@ namespace MainForm
                 string strProductBarcode = SQLHelper.GetProductBarcodeByCarrierCode(CarrierBarcode);
                 if (string.IsNullOrEmpty(strProductBarcode))
                 {
-                    if (DateTime.Now - lastWarningTime > warningInterval)
-                    {
-                        AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
-                        ProgressState = false;
-                        lastWarningTime = DateTime.Now;
-                        return;
-                    }
+                    AddMessage(LogType.Error, $"{stationNameStr}_数据库未查询到载具码[{CarrierBarcode}]的绑定信息!");
+                    ProgressState = false;
+                    lastWarningTime = DateTime.Now;
+                    return;
                 }
 
                 sn = strProductBarcode;

+ 57 - 40
MainForm/FaForm/Form_Main.Designer.cs

@@ -38,8 +38,6 @@
             this.toolStripStatusLabel_user = new System.Windows.Forms.ToolStripStatusLabel();
             this.imageList1 = new System.Windows.Forms.ImageList(this.components);
             this.panel2 = new System.Windows.Forms.Panel();
-            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
-            this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.btnMES = new System.Windows.Forms.Button();
             this.Btn_DevAlarm = new System.Windows.Forms.Button();
             this.btnOrder = new System.Windows.Forms.Button();
@@ -50,6 +48,8 @@
             this.button_Login = new System.Windows.Forms.Button();
             this.button_SystemSet = new System.Windows.Forms.Button();
             this.button_Alarm = new System.Windows.Forms.Button();
+            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.statusStrip1.SuspendLayout();
             this.panel2.SuspendLayout();
             this.SuspendLayout();
@@ -60,9 +60,10 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.panelMain.BackColor = System.Drawing.Color.WhiteSmoke;
-            this.panelMain.Location = new System.Drawing.Point(1, 65);
+            this.panelMain.Location = new System.Drawing.Point(2, 98);
+            this.panelMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panelMain.Name = "panelMain";
-            this.panelMain.Size = new System.Drawing.Size(1073, 611);
+            this.panelMain.Size = new System.Drawing.Size(1610, 916);
             this.panelMain.TabIndex = 1;
             // 
             // statusStrip1
@@ -74,10 +75,10 @@
             this.toolStripStatusLabel2,
             this.toolStripStatusLabel_user});
             this.statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
-            this.statusStrip1.Location = new System.Drawing.Point(0, 679);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 1020);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Padding = new System.Windows.Forms.Padding(2, 0, 23, 0);
-            this.statusStrip1.Size = new System.Drawing.Size(1084, 22);
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(3, 0, 34, 0);
+            this.statusStrip1.Size = new System.Drawing.Size(1626, 32);
             this.statusStrip1.TabIndex = 2;
             this.statusStrip1.Text = "statusStrip1";
             // 
@@ -85,19 +86,19 @@
             // 
             this.toolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(56, 17);
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(82, 25);
             this.toolStripStatusLabel1.Text = "小米汽车";
             // 
             // toolStripStatusLabel_Time
             // 
             this.toolStripStatusLabel_Time.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
             this.toolStripStatusLabel_Time.Name = "toolStripStatusLabel_Time";
-            this.toolStripStatusLabel_Time.Size = new System.Drawing.Size(0, 17);
+            this.toolStripStatusLabel_Time.Size = new System.Drawing.Size(0, 25);
             // 
             // toolStripStatusLabel2
             // 
             this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
-            this.toolStripStatusLabel2.Size = new System.Drawing.Size(68, 17);
+            this.toolStripStatusLabel2.Size = new System.Drawing.Size(100, 25);
             this.toolStripStatusLabel2.Text = "当前用户:";
             // 
             // toolStripStatusLabel_user
@@ -105,7 +106,7 @@
             this.toolStripStatusLabel_user.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.toolStripStatusLabel_user.ForeColor = System.Drawing.SystemColors.MenuHighlight;
             this.toolStripStatusLabel_user.Name = "toolStripStatusLabel_user";
-            this.toolStripStatusLabel_user.Size = new System.Drawing.Size(44, 17);
+            this.toolStripStatusLabel_user.Size = new System.Drawing.Size(66, 25);
             this.toolStripStatusLabel_user.Text = "操作员";
             // 
             // imageList1
@@ -181,16 +182,12 @@
             this.panel2.Controls.Add(this.button_Login);
             this.panel2.Controls.Add(this.button_SystemSet);
             this.panel2.Controls.Add(this.button_Alarm);
-            this.panel2.Location = new System.Drawing.Point(1, 4);
+            this.panel2.Location = new System.Drawing.Point(2, 6);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1073, 55);
+            this.panel2.Size = new System.Drawing.Size(1610, 82);
             this.panel2.TabIndex = 3;
             // 
-            // timer1
-            // 
-            this.timer1.Interval = 1800000;
-            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
-            // 
             // btnMES
             // 
             this.btnMES.BackColor = System.Drawing.Color.WhiteSmoke;
@@ -198,9 +195,10 @@
             this.btnMES.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnMES.ImageIndex = 51;
             this.btnMES.ImageList = this.imageList1;
-            this.btnMES.Location = new System.Drawing.Point(348, 4);
+            this.btnMES.Location = new System.Drawing.Point(179, 3);
+            this.btnMES.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.btnMES.Name = "btnMES";
-            this.btnMES.Size = new System.Drawing.Size(50, 48);
+            this.btnMES.Size = new System.Drawing.Size(75, 72);
             this.btnMES.TabIndex = 7;
             this.toolTip1.SetToolTip(this.btnMES, "MES手动交互");
             this.btnMES.UseVisualStyleBackColor = false;
@@ -212,12 +210,14 @@
             this.Btn_DevAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.Btn_DevAlarm.ImageIndex = 0;
             this.Btn_DevAlarm.ImageList = this.imageList1;
-            this.Btn_DevAlarm.Location = new System.Drawing.Point(234, 3);
+            this.Btn_DevAlarm.Location = new System.Drawing.Point(1342, 4);
+            this.Btn_DevAlarm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Btn_DevAlarm.Name = "Btn_DevAlarm";
-            this.Btn_DevAlarm.Size = new System.Drawing.Size(50, 48);
+            this.Btn_DevAlarm.Size = new System.Drawing.Size(75, 72);
             this.Btn_DevAlarm.TabIndex = 6;
             this.toolTip1.SetToolTip(this.Btn_DevAlarm, "设备报警统计面板");
             this.Btn_DevAlarm.UseVisualStyleBackColor = false;
+            this.Btn_DevAlarm.Visible = false;
             // 
             // btnOrder
             // 
@@ -226,12 +226,14 @@
             this.btnOrder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnOrder.ImageIndex = 47;
             this.btnOrder.ImageList = this.imageList1;
-            this.btnOrder.Location = new System.Drawing.Point(122, 3);
+            this.btnOrder.Location = new System.Drawing.Point(1425, 4);
+            this.btnOrder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.btnOrder.Name = "btnOrder";
-            this.btnOrder.Size = new System.Drawing.Size(50, 48);
+            this.btnOrder.Size = new System.Drawing.Size(75, 72);
             this.btnOrder.TabIndex = 5;
             this.toolTip1.SetToolTip(this.btnOrder, "订单维护");
             this.btnOrder.UseVisualStyleBackColor = false;
+            this.btnOrder.Visible = false;
             this.btnOrder.Click += new System.EventHandler(this.btnOrder_Click);
             // 
             // btnPLCDB
@@ -241,12 +243,14 @@
             this.btnPLCDB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnPLCDB.ImageIndex = 49;
             this.btnPLCDB.ImageList = this.imageList1;
-            this.btnPLCDB.Location = new System.Drawing.Point(291, 4);
+            this.btnPLCDB.Location = new System.Drawing.Point(1176, 7);
+            this.btnPLCDB.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.btnPLCDB.Name = "btnPLCDB";
-            this.btnPLCDB.Size = new System.Drawing.Size(50, 48);
+            this.btnPLCDB.Size = new System.Drawing.Size(75, 72);
             this.btnPLCDB.TabIndex = 4;
             this.toolTip1.SetToolTip(this.btnPLCDB, "PLC交互");
             this.btnPLCDB.UseVisualStyleBackColor = false;
+            this.btnPLCDB.Visible = false;
             this.btnPLCDB.Click += new System.EventHandler(this.btnPLCDB_Click);
             // 
             // button_Home
@@ -257,9 +261,10 @@
             this.button_Home.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button_Home.ImageIndex = 8;
             this.button_Home.ImageList = this.imageList1;
-            this.button_Home.Location = new System.Drawing.Point(64, 2);
+            this.button_Home.Location = new System.Drawing.Point(96, 3);
+            this.button_Home.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button_Home.Name = "button_Home";
-            this.button_Home.Size = new System.Drawing.Size(50, 48);
+            this.button_Home.Size = new System.Drawing.Size(75, 72);
             this.button_Home.TabIndex = 3;
             this.toolTip1.SetToolTip(this.button_Home, "首页");
             this.button_Home.UseVisualStyleBackColor = false;
@@ -271,9 +276,10 @@
             this.Openfile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.Openfile.ImageIndex = 46;
             this.Openfile.ImageList = this.imageList1;
-            this.Openfile.Location = new System.Drawing.Point(404, 4);
+            this.Openfile.Location = new System.Drawing.Point(258, 3);
+            this.Openfile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Openfile.Name = "Openfile";
-            this.Openfile.Size = new System.Drawing.Size(50, 48);
+            this.Openfile.Size = new System.Drawing.Size(75, 72);
             this.Openfile.TabIndex = 2;
             this.toolTip1.SetToolTip(this.Openfile, "日志文件");
             this.Openfile.UseVisualStyleBackColor = false;
@@ -286,9 +292,10 @@
             this.button_Other.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button_Other.ImageIndex = 41;
             this.button_Other.ImageList = this.imageList1;
-            this.button_Other.Location = new System.Drawing.Point(1005, 6);
+            this.button_Other.Location = new System.Drawing.Point(1508, 9);
+            this.button_Other.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button_Other.Name = "button_Other";
-            this.button_Other.Size = new System.Drawing.Size(50, 48);
+            this.button_Other.Size = new System.Drawing.Size(75, 72);
             this.button_Other.TabIndex = 2;
             this.button_Other.UseVisualStyleBackColor = true;
             this.button_Other.Click += new System.EventHandler(this.button_vision_Click);
@@ -301,9 +308,10 @@
             this.button_Login.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button_Login.ImageIndex = 15;
             this.button_Login.ImageList = this.imageList1;
-            this.button_Login.Location = new System.Drawing.Point(8, 2);
+            this.button_Login.Location = new System.Drawing.Point(12, 3);
+            this.button_Login.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button_Login.Name = "button_Login";
-            this.button_Login.Size = new System.Drawing.Size(50, 48);
+            this.button_Login.Size = new System.Drawing.Size(75, 72);
             this.button_Login.TabIndex = 0;
             this.toolTip1.SetToolTip(this.button_Login, "用户登录");
             this.button_Login.UseVisualStyleBackColor = false;
@@ -316,9 +324,10 @@
             this.button_SystemSet.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button_SystemSet.ImageIndex = 17;
             this.button_SystemSet.ImageList = this.imageList1;
-            this.button_SystemSet.Location = new System.Drawing.Point(460, 4);
+            this.button_SystemSet.Location = new System.Drawing.Point(347, 3);
+            this.button_SystemSet.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button_SystemSet.Name = "button_SystemSet";
-            this.button_SystemSet.Size = new System.Drawing.Size(50, 48);
+            this.button_SystemSet.Size = new System.Drawing.Size(75, 72);
             this.button_SystemSet.TabIndex = 0;
             this.toolTip1.SetToolTip(this.button_SystemSet, "软件设置");
             this.button_SystemSet.UseVisualStyleBackColor = false;
@@ -330,25 +339,33 @@
             this.button_Alarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.button_Alarm.ImageIndex = 3;
             this.button_Alarm.ImageList = this.imageList1;
-            this.button_Alarm.Location = new System.Drawing.Point(178, 3);
+            this.button_Alarm.Location = new System.Drawing.Point(1259, 6);
+            this.button_Alarm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button_Alarm.Name = "button_Alarm";
-            this.button_Alarm.Size = new System.Drawing.Size(50, 48);
+            this.button_Alarm.Size = new System.Drawing.Size(75, 72);
             this.button_Alarm.TabIndex = 0;
             this.toolTip1.SetToolTip(this.button_Alarm, "加工与点检数据");
             this.button_Alarm.UseVisualStyleBackColor = false;
+            this.button_Alarm.Visible = false;
             this.button_Alarm.Click += new System.EventHandler(this.button_Alarm_Click);
             // 
+            // timer1
+            // 
+            this.timer1.Interval = 1800000;
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+            // 
             // Form_Main
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.WhiteSmoke;
-            this.ClientSize = new System.Drawing.Size(1084, 701);
+            this.ClientSize = new System.Drawing.Size(1626, 1052);
             this.Controls.Add(this.panel2);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.panelMain);
             this.HelpButton = true;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Form_Main";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "N801A上位机-Xiaomi";

+ 1 - 1
MainForm/FaForm/Form_Main.resx

@@ -128,7 +128,7 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADO
-        eAUAAk1TRnQBSQFMAgEBNQEAAcABAgHAAQIBMgEAATIBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHI
+        eAUAAk1TRnQBSQFMAgEBNQEAAcgBAgHIAQIBMgEAATIBAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAHI
         AwABvAECAgABAQEAARgFAAGgAWgBBhEAAecB8AHqAbwB4gHJAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHI
         AbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHI
         AbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHIAbwB4QHI

+ 2 - 1
MainForm/MainForm.csproj

@@ -239,7 +239,8 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Atlas\AtlasScrew.cs" />
+    <Compile Include="Atlas\AtlasScrew_Right.cs" />
+    <Compile Include="Atlas\AtlasScrew_Left.cs" />
     <Compile Include="Atlas\BaseScrew.cs" />
     <Compile Include="Atlas\Communicate.cs" />
     <Compile Include="Atlas\MTF6K.cs" />