瀏覽代碼

1、增加指拨模式转速判断阈值的设置;
2、增加TE软件版本的判断;

dail 4 年之前
父節點
當前提交
ed43f1ce0d

二進制
.vs/MOTINOVA_Motor_Factory_Set/v16/.suo


+ 56 - 10
ExportForm.Designer.cs

@@ -148,6 +148,10 @@
             this.label55 = new System.Windows.Forms.Label();
             this.textBox_SpeedTh = new System.Windows.Forms.TextBox();
             this.textBox_NC_Current = new System.Windows.Forms.TextBox();
+            this.textBox_GasSpeedTh = new System.Windows.Forms.TextBox();
+            this.label56 = new System.Windows.Forms.Label();
+            this.textBox_TE_FW_Version = new System.Windows.Forms.TextBox();
+            this.label57 = new System.Windows.Forms.Label();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
             this.groupBox7.SuspendLayout();
@@ -1197,9 +1201,11 @@
             // groupBox1
             // 
             this.groupBox1.Controls.Add(this.label53);
+            this.groupBox1.Controls.Add(this.label57);
             this.groupBox1.Controls.Add(this.label52);
             this.groupBox1.Controls.Add(this.label51);
             this.groupBox1.Controls.Add(this.textBox_Remark);
+            this.groupBox1.Controls.Add(this.textBox_TE_FW_Version);
             this.groupBox1.Controls.Add(this.label50);
             this.groupBox1.Controls.Add(this.textBox_FW_Version);
             this.groupBox1.Controls.Add(this.textBox_Client);
@@ -1215,7 +1221,7 @@
             // label53
             // 
             this.label53.AutoSize = true;
-            this.label53.Location = new System.Drawing.Point(62, 243);
+            this.label53.Location = new System.Drawing.Point(62, 249);
             this.label53.Name = "label53";
             this.label53.Size = new System.Drawing.Size(42, 21);
             this.label53.TabIndex = 0;
@@ -1224,16 +1230,16 @@
             // label52
             // 
             this.label52.AutoSize = true;
-            this.label52.Location = new System.Drawing.Point(46, 174);
+            this.label52.Location = new System.Drawing.Point(30, 141);
             this.label52.Name = "label52";
-            this.label52.Size = new System.Drawing.Size(74, 21);
+            this.label52.Size = new System.Drawing.Size(106, 21);
             this.label52.TabIndex = 0;
-            this.label52.Text = "软件版本";
+            this.label52.Text = "主控软件版本";
             // 
             // label51
             // 
             this.label51.AutoSize = true;
-            this.label51.Location = new System.Drawing.Point(46, 103);
+            this.label51.Location = new System.Drawing.Point(46, 87);
             this.label51.Name = "label51";
             this.label51.Size = new System.Drawing.Size(74, 21);
             this.label51.TabIndex = 0;
@@ -1242,7 +1248,7 @@
             // textBox_Remark
             // 
             this.textBox_Remark.ForeColor = System.Drawing.Color.Black;
-            this.textBox_Remark.Location = new System.Drawing.Point(8, 272);
+            this.textBox_Remark.Location = new System.Drawing.Point(7, 272);
             this.textBox_Remark.Name = "textBox_Remark";
             this.textBox_Remark.Size = new System.Drawing.Size(152, 29);
             this.textBox_Remark.TabIndex = 2;
@@ -1259,7 +1265,7 @@
             // textBox_FW_Version
             // 
             this.textBox_FW_Version.ForeColor = System.Drawing.Color.Black;
-            this.textBox_FW_Version.Location = new System.Drawing.Point(8, 204);
+            this.textBox_FW_Version.Location = new System.Drawing.Point(7, 164);
             this.textBox_FW_Version.Name = "textBox_FW_Version";
             this.textBox_FW_Version.Size = new System.Drawing.Size(152, 29);
             this.textBox_FW_Version.TabIndex = 2;
@@ -1267,7 +1273,7 @@
             // textBox_Client
             // 
             this.textBox_Client.ForeColor = System.Drawing.Color.Black;
-            this.textBox_Client.Location = new System.Drawing.Point(8, 134);
+            this.textBox_Client.Location = new System.Drawing.Point(7, 110);
             this.textBox_Client.Name = "textBox_Client";
             this.textBox_Client.Size = new System.Drawing.Size(152, 29);
             this.textBox_Client.TabIndex = 2;
@@ -1275,7 +1281,7 @@
             // textBox_Model
             // 
             this.textBox_Model.ForeColor = System.Drawing.Color.Black;
-            this.textBox_Model.Location = new System.Drawing.Point(6, 65);
+            this.textBox_Model.Location = new System.Drawing.Point(7, 56);
             this.textBox_Model.Name = "textBox_Model";
             this.textBox_Model.Size = new System.Drawing.Size(152, 29);
             this.textBox_Model.TabIndex = 2;
@@ -1283,11 +1289,13 @@
             // groupBox8
             // 
             this.groupBox8.Controls.Add(this.label54);
+            this.groupBox8.Controls.Add(this.label56);
+            this.groupBox8.Controls.Add(this.textBox_GasSpeedTh);
             this.groupBox8.Controls.Add(this.label55);
             this.groupBox8.Controls.Add(this.textBox_SpeedTh);
             this.groupBox8.Controls.Add(this.textBox_NC_Current);
             this.groupBox8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.groupBox8.Location = new System.Drawing.Point(888, 349);
+            this.groupBox8.Location = new System.Drawing.Point(888, 343);
             this.groupBox8.Name = "groupBox8";
             this.groupBox8.Size = new System.Drawing.Size(166, 136);
             this.groupBox8.TabIndex = 5;
@@ -1328,6 +1336,40 @@
             this.textBox_NC_Current.Size = new System.Drawing.Size(76, 29);
             this.textBox_NC_Current.TabIndex = 2;
             // 
+            // textBox_GasSpeedTh
+            // 
+            this.textBox_GasSpeedTh.ForeColor = System.Drawing.Color.Black;
+            this.textBox_GasSpeedTh.Location = new System.Drawing.Point(82, 96);
+            this.textBox_GasSpeedTh.Name = "textBox_GasSpeedTh";
+            this.textBox_GasSpeedTh.Size = new System.Drawing.Size(76, 29);
+            this.textBox_GasSpeedTh.TabIndex = 2;
+            // 
+            // label56
+            // 
+            this.label56.AutoSize = true;
+            this.label56.Location = new System.Drawing.Point(6, 100);
+            this.label56.Name = "label56";
+            this.label56.Size = new System.Drawing.Size(74, 21);
+            this.label56.TabIndex = 0;
+            this.label56.Text = "指拨转速";
+            // 
+            // textBox_TE_FW_Version
+            // 
+            this.textBox_TE_FW_Version.ForeColor = System.Drawing.Color.Black;
+            this.textBox_TE_FW_Version.Location = new System.Drawing.Point(7, 218);
+            this.textBox_TE_FW_Version.Name = "textBox_TE_FW_Version";
+            this.textBox_TE_FW_Version.Size = new System.Drawing.Size(152, 29);
+            this.textBox_TE_FW_Version.TabIndex = 2;
+            // 
+            // label57
+            // 
+            this.label57.AutoSize = true;
+            this.label57.Location = new System.Drawing.Point(37, 195);
+            this.label57.Name = "label57";
+            this.label57.Size = new System.Drawing.Size(92, 21);
+            this.label57.TabIndex = 0;
+            this.label57.Text = "TE软件版本";
+            // 
             // ExportForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -1496,5 +1538,9 @@
         private System.Windows.Forms.Label label55;
         private System.Windows.Forms.TextBox textBox_SpeedTh;
         private System.Windows.Forms.TextBox textBox_NC_Current;
+        private System.Windows.Forms.Label label56;
+        private System.Windows.Forms.TextBox textBox_GasSpeedTh;
+        private System.Windows.Forms.Label label57;
+        private System.Windows.Forms.TextBox textBox_TE_FW_Version;
     }
 }

+ 14 - 5
ExportForm.cs

@@ -100,6 +100,7 @@ namespace MOTINOVA_Motor_Factory_Set
             TestThData.Clear();
             TestThData.Add("空载电流", 1000);
             TestThData.Add("车速", 60);
+            TestThData.Add("指拨转速", 1200);
 
         }
 
@@ -222,6 +223,7 @@ namespace MOTINOVA_Motor_Factory_Set
             //测试阈值
             textBox_NC_Current.Text = TestThData["空载电流"].ToString();
             textBox_SpeedTh.Text = TestThData["车速"].ToString();
+            textBox_GasSpeedTh.Text = TestThData["指拨转速"].ToString();
 
         }
 
@@ -414,6 +416,7 @@ namespace MOTINOVA_Motor_Factory_Set
                 TestThData.Clear();
                 TestThData.Add("空载电流", Convert.ToUInt16(textBox_NC_Current.Text));
                 TestThData.Add("车速", Convert.ToUInt16(textBox_SpeedTh.Text));
+                TestThData.Add("指拨转速", Convert.ToUInt16(textBox_GasSpeedTh.Text));
                 return true;
             }
             catch(Exception ex)
@@ -439,24 +442,30 @@ namespace MOTINOVA_Motor_Factory_Set
             }
 
             //保存为文件
-            if (textBox_Model.Text == string.Empty)
+            if (textBox_Model.Text == string.Empty) //判断型号是否填写
             {
                 MessageBox.Show("请输入电机型号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
-            if (textBox_Client.Text == string.Empty)
+            if (textBox_Client.Text == string.Empty) //判断客户号是否填写
             {
                 textBox_Client.Text = "STD";
             }
             Regex Reg = new Regex(@"[V][0-9].[0-9].[0-9].[0-9].[0-9]_20\d{6}");
-            if (Reg.IsMatch(textBox_FW_Version.Text) == false)
+            if (Reg.IsMatch(textBox_FW_Version.Text) == false) //判断主控软件版本是否填写
             {
-                MessageBox.Show("软件版本格式不正确,例如V1.0.0.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                MessageBox.Show("主控软件版本格式不正确,例如V1.0.0.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                return;
+            }
+            Reg = new Regex(@"[V][0-9].[0-9].[0-9]_20\d{6}"); //判断TE软件版本是否填写
+            if (Reg.IsMatch(textBox_TE_FW_Version.Text) == false) //判断TE软件版本是否填写
+            {
+                MessageBox.Show("TE软件版本格式不正确,例如V1.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             if (System.IO.Directory.Exists(FilePath) == false)
                 System.IO.Directory.CreateDirectory(FilePath);
-            using (StreamWriter file = new StreamWriter(FilePath + textBox_Model.Text + "_" + textBox_Client.Text + "_" + textBox_FW_Version.Text + "_" + ((textBox_Remark.Text == string.Empty) ? "" : textBox_Remark.Text + "_") + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".ttcfg"))
+            using (StreamWriter file = new StreamWriter(FilePath + textBox_Model.Text + "_" + textBox_Client.Text + "_" + textBox_FW_Version.Text + "_" + textBox_TE_FW_Version.Text + "_" + ((textBox_Remark.Text == string.Empty) ? "" : textBox_Remark.Text + "_") + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".ttcfg"))
             {
                 //用户参数1
                 file.WriteLine("[{0}]", "用户参数1");

+ 10 - 4
ImportForm.cs

@@ -30,6 +30,7 @@ namespace MOTINOVA_Motor_Factory_Set
         //以下值在软件测试文件params.cfg文件中修改
         ushort No_load_Current = 1000; //空载电流
         ushort SpeedSensorThData = 60; //车速传感器判断阈值
+        ushort GasModeSpeed = 1200;    //指拨模式测试转速
         #endregion
 
         #region 配置文件信息
@@ -399,6 +400,7 @@ namespace MOTINOVA_Motor_Factory_Set
                                     textBox_Coil.Text = Convert.ToString((int)(DataTemp - 40));
 
                                     //MCU温度
+                                    DataTemp = (ushort)(binary_data_1[25]);
                                     textBox_MCU.Text = Convert.ToString((int)(DataTemp - 40));
                                 }));
                             }
@@ -1364,13 +1366,13 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "断电开关检测结束,请松开断电开关" + "\r\n";
             label_Step.Text = "请松开断电开关!";
-            Delay_ms(1000);
             button_Walk.Text = "停止";
             Walk_Process(0x00);
+            Delay_ms(1000);
             //判断测试结果
             if (OK_cnt < 9)
             {
-                label_Step.Text = "断电开关测试异常,测试结束!";
+                label_Step.Text = "推行测试异常,测试结束!";
                 richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "推行测试失败,测试结束" + "\r\n";
                 button_Start.Enabled = true;
                 return;
@@ -1396,7 +1398,7 @@ namespace MOTINOVA_Motor_Factory_Set
                 while (WalkProcess_Cnt < 10)//10s内判断电机是否启动
                 {
                     DataTemp = Convert.ToUInt16(textBox_MotorSpeed.Text);
-                    if ((DataTemp > (MotorRadeSpeed - 200)) && (DataTemp < (MotorRadeSpeed + 200)))
+                    if ((DataTemp > (GasModeSpeed - 50)) && (DataTemp < (GasModeSpeed + 50)))
                     {
                         label_Sensor_Gas.BackColor = Color.Green;
                         label_Sensor_Gas.Text = "OK";
@@ -1430,9 +1432,12 @@ namespace MOTINOVA_Motor_Factory_Set
             Delay_ms(200);
             string FW_Version_Check = comboBox_File.Text.Split('_')[2] + "_" + comboBox_File.Text.Split('_')[3];
             string FW_Version_Result = "";
+            string TE_FW_Ver_Check = comboBox_File.Text.Split('_')[4] + "_" + comboBox_File.Text.Split('_')[5];
+            string TW_FW_Ver_Result = "";
             FW_Version_Result = richTextBox_Ver.Lines[3].Split(':')[1];
             FW_Version_Result = FW_Version_Result.Split('_')[0] + richTextBox_Ver.Lines[4].Split('-')[2].Replace('V', '.') + "_" + FW_Version_Result.Split('_')[1];
-            if (string.Equals(FW_Version_Check, FW_Version_Result) == true)
+            TW_FW_Ver_Result = richTextBox_Ver.Lines[5].Split(':')[1];
+            if ((string.Equals(FW_Version_Check, FW_Version_Result) == true) && (string.Equals(TE_FW_Ver_Check, TW_FW_Ver_Result) == true)) 
             {
                 label_FW_Version.BackColor = Color.Green;
                 label_FW_Version.Text = "OK";
@@ -1912,6 +1917,7 @@ namespace MOTINOVA_Motor_Factory_Set
             {
                 No_load_Current = Convert.ToUInt16(array_CfgInfo[57].ToString().Split(',')[1]);
                 SpeedSensorThData = Convert.ToUInt16(array_CfgInfo[58].ToString().Split(',')[1]);
+                GasModeSpeed = Convert.ToUInt16(array_CfgInfo[59].ToString().Split(',')[1]);
             }
 
             objReader.Close();

+ 1 - 1
StartForm.Designer.cs

@@ -121,7 +121,7 @@
             this.label_Ver.Name = "label_Ver";
             this.label_Ver.Size = new System.Drawing.Size(185, 21);
             this.label_Ver.TabIndex = 2;
-            this.label_Ver.Text = "Ver: V1.1.0 Build Time: ";
+            this.label_Ver.Text = "Ver: V1.1.1 Build Time: ";
             // 
             // StartForm
             // 

二進制
bin/Debug/MOTINOVA_Motor_Factory_Set.exe


二進制
bin/Debug/MOTINOVA_Motor_Factory_Set.pdb


+ 1 - 1
bin/Debug/SerialNum

@@ -1,2 +1,2 @@
 流水号:
-46
+67

二進制
bin/Debug/app.publish/MOTINOVA_Motor_Factory_Set.exe


二進制
bin/Debug/发布文件/MOTINOVA_Motor_Factory_Set/使用说明.docx


二進制
bin/Debug/发布文件/MOTINOVA_Motor_Factory_Set/使用说明.pdf


二進制
bin/Debug/发布文件20210908/MOTINOVA_Motor_Factory_Set_20210908.exe


二進制
obj/Debug/DesignTimeResolveAssemblyReferences.cache


二進制
obj/Debug/MOTINOVA_Motor_Factory_Set.csproj.GenerateResource.cache


二進制
obj/Debug/MOTINOVA_Motor_Factory_Set.csprojAssemblyReference.cache


二進制
obj/Debug/MOTINOVA_Motor_Factory_Set.exe


二進制
obj/Debug/MOTINOVA_Motor_Factory_Set.pdb