Pārlūkot izejas kodu

节拍优化、60弹窗优化、琐螺丝

WIN-GH9CEESPLTB\Administrator 1 mēnesi atpakaļ
vecāks
revīzija
b5f0feaeb3

+ 46 - 1
MainForm/Atlas/AtlasScrew.cs

@@ -1,8 +1,10 @@
 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;
 
@@ -60,13 +62,37 @@ namespace CommonLib
         /// </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;
-            public double PearkTorque = 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()
@@ -249,6 +275,25 @@ namespace CommonLib
                                         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.MainDir + "\\扭力曲线_临时\\";
+                                        if (!Directory.Exists(dic))
+                                        {
+                                            Directory.CreateDirectory(dic);
+                                        }
+                                        string 扭力曲线文件名 = dic + DateTime.Now.ToString("yyyy_MM_dd HH:mm:ss:FFF")+".csv" ;
+
+                                        StringBuilder sbStr =new StringBuilder();
+                                        if (!File.Exists(扭力曲线文件名))
+                                        {
+                                            sbStr.AppendLine("扭力数组,角度数组,峰值扭矩,总角度,总持续时间,结果代码");
+                                        }
+                                        sbStr.AppendLine($"{tightResult.torque},{tightResult.angle},{tightResult.PearkTorque},{tightResult.TotalAngle},{tightResult.TotalDuration},{tightResult.ResultCode}");
+                                        sbStr.AppendLine();
+                                        File.WriteAllText(扭力曲线文件名, sbStr.ToString());
+                                        #endregion 保存数据
+
                                         tightResult.PearkTorque = tightResult.PearkTorque / 98;
                                        
                                         #region

+ 1 - 1
MainForm/ClassFile/Inovance_EIP.cs

@@ -143,7 +143,7 @@ namespace EIP_Protocol
         public short testStatus;            //测试状态:=1 PASS  0=FAIL
 
         [MarshalAs(UnmanagedType.I2)]
-        public short BeatAction;            //节拍动作 1:上料开始  2:上料结束 3
+        public short beatAction;            //节拍动作 1:上料开始  2:上料结束 3
                                             //:作业开始  4:作业结束   5:下料开始  6:下料结束
 
         [MarshalAs(UnmanagedType.I2)]       //节拍返回 1:OK   2:NG   

+ 1 - 1
MainForm/ClassFile/ProjectClass/SQLHelper.cs

@@ -649,7 +649,7 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单信息
             }
             catch (Exception ex)
             {
-
+                Console.WriteLine($"获取载具绑定的PCB码报错:{ex.Message}");
                 return string.Empty;
             }
         }

+ 21 - 8
MainForm/FaForm/BandBarodeDialog.cs

@@ -14,15 +14,24 @@ namespace MainForm.FaForm
     public partial class BandBarodeDialog : Form
     {
         public string pcbCode { get; private set; }
-        public string _CarrierBarcode { private get;  set; }
-        public string _ProductBarcode { private get;  set; }
-        public string _PCBBarcode { private get; set; }
+        public string _CarrierBarcode {  get;  set; }
 
+        #region
+        private string _strProductBarcode = "";
+        private string _strPCBBarcode = "";
+        #endregion 
+
+        public string _ProductBarcode {  get;  set; }
+        public string _PCBBarcode { get; set; }
 
         private Timer _inputTimer;
 
-        public BandBarodeDialog()
+        public BandBarodeDialog(string carrierBarcode, string strProductBarcode, string strPCBBarcode)
         {
+            _CarrierBarcode = carrierBarcode;
+            _strProductBarcode = strProductBarcode;
+            _strPCBBarcode = strPCBBarcode;
+
             InitializeComponent();
             //置顶
             this.TopMost = true; 
@@ -34,11 +43,10 @@ namespace MainForm.FaForm
         private void BandBarodeDialog_Load(object sender, EventArgs e)
         {
             CarrierBarcode.Text = _CarrierBarcode;
-            ProductBarcode.Text = _ProductBarcode;
-            PCBBarcode.Text = _PCBBarcode;
+            ProductBarcode.Text = _strProductBarcode;
+            PCBBarcode.Text = _strPCBBarcode;
             Barcode.Text = string.Empty;
 
-            Form_Home.isNoStop=true;
 
             // 初始化定时器
             _inputTimer = new Timer();
@@ -47,6 +55,9 @@ namespace MainForm.FaForm
 
             // 绑定 TextChanged 事件
             Barcode.TextChanged += PCBBarcode_TextChanged;
+
+            Form_Home.StopWhile = true;
+
         }
 
         private void button1_Click(object sender, EventArgs e)
@@ -89,6 +100,7 @@ namespace MainForm.FaForm
             _CarrierBarcode = string.Empty;
             _ProductBarcode = string.Empty;
             this.DialogResult= DialogResult.OK;
+            Form_Home.StopWhile = false;
             this.Close();
         }
         private void MainForm_Shown(object sender, EventArgs e)
@@ -99,7 +111,8 @@ namespace MainForm.FaForm
 
         private void BandBarodeDialog_FormClosing(object sender, FormClosingEventArgs e)
         {
-            Form_Home.isNoStop = false;
+            Form_Home.StopWhile = false;
+
         }
     }
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 460 - 1770
MainForm/FaForm/Form_Home.cs


+ 5 - 6
MainForm/FaForm/Form_UserLogin.designer.cs

@@ -51,7 +51,7 @@
             "管理员",
             "超级管理员"});
             this.cbb_UserName.Location = new System.Drawing.Point(448, 147);
-            this.cbb_UserName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cbb_UserName.Margin = new System.Windows.Forms.Padding(4);
             this.cbb_UserName.MaxDropDownItems = 15;
             this.cbb_UserName.Name = "cbb_UserName";
             this.cbb_UserName.Size = new System.Drawing.Size(194, 29);
@@ -61,12 +61,11 @@
             // 
             this.txt_Password.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.txt_Password.Location = new System.Drawing.Point(448, 208);
-            this.txt_Password.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.txt_Password.Margin = new System.Windows.Forms.Padding(4);
             this.txt_Password.Name = "txt_Password";
             this.txt_Password.PasswordChar = '*';
             this.txt_Password.Size = new System.Drawing.Size(194, 31);
             this.txt_Password.TabIndex = 0;
-            this.txt_Password.Text = "123789";
             this.txt_Password.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_Password_KeyDown);
             // 
             // label1
@@ -116,7 +115,7 @@
             this.bt_Exit.Image = ((System.Drawing.Image)(resources.GetObject("bt_Exit.Image")));
             this.bt_Exit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
             this.bt_Exit.Location = new System.Drawing.Point(482, 387);
-            this.bt_Exit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bt_Exit.Margin = new System.Windows.Forms.Padding(4);
             this.bt_Exit.Name = "bt_Exit";
             this.bt_Exit.Size = new System.Drawing.Size(164, 60);
             this.bt_Exit.TabIndex = 2;
@@ -132,7 +131,7 @@
             this.bt_Login.Image = ((System.Drawing.Image)(resources.GetObject("bt_Login.Image")));
             this.bt_Login.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
             this.bt_Login.Location = new System.Drawing.Point(296, 387);
-            this.bt_Login.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bt_Login.Margin = new System.Windows.Forms.Padding(4);
             this.bt_Login.Name = "bt_Login";
             this.bt_Login.Size = new System.Drawing.Size(164, 60);
             this.bt_Login.TabIndex = 1;
@@ -173,7 +172,7 @@
             this.Controls.Add(this.cbb_UserName);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.MaximizeBox = false;
             this.MinimizeBox = false;
             this.Name = "Form_UserLogin";

+ 3 - 0
MainForm/MainForm.csproj

@@ -98,6 +98,9 @@
     <ErrorReport>prompt</ErrorReport>
     <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="AxInterop.ActUtlTypeLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>