Forráskód Böngészése

针对UART控制器FCT治具进行调试,目前测试存在问题。

Dail 1 éve
szülő
commit
047c1da53e

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 146 - 67
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -589,6 +589,12 @@ namespace Welling_Motor_Debug_Tool
             this.label_UserName = new System.Windows.Forms.Label();
             this.label124 = new System.Windows.Forms.Label();
             this.label46 = new System.Windows.Forms.Label();
+            this.checkBox_FacMode_MosCal = new System.Windows.Forms.CheckBox();
+            this.label130 = new System.Windows.Forms.Label();
+            this.label_FacModeMosCal = new System.Windows.Forms.Label();
+            this.协议类型ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.cANToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.uARTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -812,6 +818,7 @@ namespace Welling_Motor_Debug_Tool
             this.电机类型ToolStripMenuItem,
             this.判断阈值ToolStripMenuItem,
             this.力矩传感器检验ToolStripMenuItem,
+            this.协议类型ToolStripMenuItem1,
             this.UART协议ToolStripMenuItem});
             this.配置ToolStripMenuItem.ForeColor = System.Drawing.Color.White;
             this.配置ToolStripMenuItem.Name = "配置ToolStripMenuItem";
@@ -1218,6 +1225,7 @@ namespace Welling_Motor_Debug_Tool
             this.UART协议ToolStripMenuItem.Name = "UART协议ToolStripMenuItem";
             this.UART协议ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
             this.UART协议ToolStripMenuItem.Text = "UART协议设置";
+            this.UART协议ToolStripMenuItem.Visible = false;
             // 
             // 协议类型ToolStripMenuItem
             // 
@@ -4711,6 +4719,8 @@ namespace Welling_Motor_Debug_Tool
             // 
             // groupBox28
             // 
+            this.groupBox28.Controls.Add(this.label130);
+            this.groupBox28.Controls.Add(this.label_FacModeMosCal);
             this.groupBox28.Controls.Add(this.label117);
             this.groupBox28.Controls.Add(this.label_FacModeSpeed);
             this.groupBox28.Controls.Add(this.label_FacModeBMS);
@@ -4753,11 +4763,11 @@ namespace Welling_Motor_Debug_Tool
             // label117
             // 
             this.label117.AutoSize = true;
-            this.label117.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label117.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label117.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label117.Location = new System.Drawing.Point(123, 50);
+            this.label117.Location = new System.Drawing.Point(123, 48);
             this.label117.Name = "label117";
-            this.label117.Size = new System.Drawing.Size(79, 20);
+            this.label117.Size = new System.Drawing.Size(68, 17);
             this.label117.TabIndex = 24;
             this.label117.Text = "车速传感器";
             this.label117.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4767,7 +4777,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeSpeed.BackColor = System.Drawing.Color.Red;
             this.label_FacModeSpeed.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeSpeed.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeSpeed.Location = new System.Drawing.Point(208, 54);
+            this.label_FacModeSpeed.Location = new System.Drawing.Point(208, 50);
             this.label_FacModeSpeed.Name = "label_FacModeSpeed";
             this.label_FacModeSpeed.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeSpeed.TabIndex = 25;
@@ -4778,7 +4788,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeBMS.BackColor = System.Drawing.Color.Red;
             this.label_FacModeBMS.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeBMS.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeBMS.Location = new System.Drawing.Point(95, 54);
+            this.label_FacModeBMS.Location = new System.Drawing.Point(95, 50);
             this.label_FacModeBMS.Name = "label_FacModeBMS";
             this.label_FacModeBMS.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeBMS.TabIndex = 23;
@@ -4787,11 +4797,11 @@ namespace Welling_Motor_Debug_Tool
             // label116
             // 
             this.label116.AutoSize = true;
-            this.label116.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label116.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label116.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label116.Location = new System.Drawing.Point(6, 50);
+            this.label116.Location = new System.Drawing.Point(6, 48);
             this.label116.Name = "label116";
-            this.label116.Size = new System.Drawing.Size(68, 20);
+            this.label116.Size = new System.Drawing.Size(59, 17);
             this.label116.TabIndex = 22;
             this.label116.Text = "BMS通讯";
             this.label116.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4799,11 +4809,11 @@ namespace Welling_Motor_Debug_Tool
             // label114
             // 
             this.label114.AutoSize = true;
-            this.label114.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label114.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label114.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label114.Location = new System.Drawing.Point(123, 128);
+            this.label114.Location = new System.Drawing.Point(123, 120);
             this.label114.Name = "label114";
-            this.label114.Size = new System.Drawing.Size(79, 20);
+            this.label114.Size = new System.Drawing.Size(68, 17);
             this.label114.TabIndex = 19;
             this.label114.Text = "踏频传感器";
             this.label114.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4813,7 +4823,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeCad.BackColor = System.Drawing.Color.Red;
             this.label_FacModeCad.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeCad.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeCad.Location = new System.Drawing.Point(208, 132);
+            this.label_FacModeCad.Location = new System.Drawing.Point(208, 122);
             this.label_FacModeCad.Name = "label_FacModeCad";
             this.label_FacModeCad.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeCad.TabIndex = 20;
@@ -4824,7 +4834,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeTq.BackColor = System.Drawing.Color.Red;
             this.label_FacModeTq.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeTq.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeTq.Location = new System.Drawing.Point(95, 132);
+            this.label_FacModeTq.Location = new System.Drawing.Point(95, 122);
             this.label_FacModeTq.Name = "label_FacModeTq";
             this.label_FacModeTq.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeTq.TabIndex = 21;
@@ -4833,11 +4843,11 @@ namespace Welling_Motor_Debug_Tool
             // label113
             // 
             this.label113.AutoSize = true;
-            this.label113.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label113.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label113.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label113.Location = new System.Drawing.Point(6, 128);
+            this.label113.Location = new System.Drawing.Point(6, 120);
             this.label113.Name = "label113";
-            this.label113.Size = new System.Drawing.Size(79, 20);
+            this.label113.Size = new System.Drawing.Size(68, 17);
             this.label113.TabIndex = 18;
             this.label113.Text = "力矩传感器";
             this.label113.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4845,11 +4855,11 @@ namespace Welling_Motor_Debug_Tool
             // label134
             // 
             this.label134.AutoSize = true;
-            this.label134.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label134.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label134.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label134.Location = new System.Drawing.Point(123, 206);
+            this.label134.Location = new System.Drawing.Point(123, 192);
             this.label134.Name = "label134";
-            this.label134.Size = new System.Drawing.Size(48, 20);
+            this.label134.Size = new System.Drawing.Size(43, 17);
             this.label134.TabIndex = 14;
             this.label134.Text = "BOOT";
             this.label134.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4859,7 +4869,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeBootVer.BackColor = System.Drawing.Color.Red;
             this.label_FacModeBootVer.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeBootVer.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeBootVer.Location = new System.Drawing.Point(208, 210);
+            this.label_FacModeBootVer.Location = new System.Drawing.Point(208, 194);
             this.label_FacModeBootVer.Name = "label_FacModeBootVer";
             this.label_FacModeBootVer.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeBootVer.TabIndex = 15;
@@ -4868,11 +4878,11 @@ namespace Welling_Motor_Debug_Tool
             // label136
             // 
             this.label136.AutoSize = true;
-            this.label136.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label136.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label136.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label136.Location = new System.Drawing.Point(6, 206);
+            this.label136.Location = new System.Drawing.Point(6, 192);
             this.label136.Name = "label136";
-            this.label136.Size = new System.Drawing.Size(65, 20);
+            this.label136.Size = new System.Drawing.Size(56, 17);
             this.label136.TabIndex = 16;
             this.label136.Text = "软件版本";
             this.label136.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4882,7 +4892,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeFWVersion.BackColor = System.Drawing.Color.Red;
             this.label_FacModeFWVersion.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeFWVersion.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeFWVersion.Location = new System.Drawing.Point(95, 210);
+            this.label_FacModeFWVersion.Location = new System.Drawing.Point(95, 194);
             this.label_FacModeFWVersion.Name = "label_FacModeFWVersion";
             this.label_FacModeFWVersion.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeFWVersion.TabIndex = 17;
@@ -4891,11 +4901,11 @@ namespace Welling_Motor_Debug_Tool
             // label145
             // 
             this.label145.AutoSize = true;
-            this.label145.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label145.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label145.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label145.Location = new System.Drawing.Point(123, 180);
+            this.label145.Location = new System.Drawing.Point(123, 168);
             this.label145.Name = "label145";
-            this.label145.Size = new System.Drawing.Size(65, 20);
+            this.label145.Size = new System.Drawing.Size(56, 17);
             this.label145.TabIndex = 10;
             this.label145.Text = "后灯控制";
             this.label145.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4903,11 +4913,11 @@ namespace Welling_Motor_Debug_Tool
             // label127
             // 
             this.label127.AutoSize = true;
-            this.label127.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label127.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label127.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label127.Location = new System.Drawing.Point(123, 154);
+            this.label127.Location = new System.Drawing.Point(123, 144);
             this.label127.Name = "label127";
-            this.label127.Size = new System.Drawing.Size(65, 20);
+            this.label127.Size = new System.Drawing.Size(56, 17);
             this.label127.TabIndex = 10;
             this.label127.Text = "断电刹车";
             this.label127.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4917,7 +4927,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeLightB.BackColor = System.Drawing.Color.Red;
             this.label_FacModeLightB.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeLightB.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeLightB.Location = new System.Drawing.Point(208, 184);
+            this.label_FacModeLightB.Location = new System.Drawing.Point(208, 170);
             this.label_FacModeLightB.Name = "label_FacModeLightB";
             this.label_FacModeLightB.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeLightB.TabIndex = 11;
@@ -4928,7 +4938,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeBreak.BackColor = System.Drawing.Color.Red;
             this.label_FacModeBreak.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeBreak.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeBreak.Location = new System.Drawing.Point(208, 158);
+            this.label_FacModeBreak.Location = new System.Drawing.Point(208, 146);
             this.label_FacModeBreak.Name = "label_FacModeBreak";
             this.label_FacModeBreak.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeBreak.TabIndex = 11;
@@ -4937,11 +4947,11 @@ namespace Welling_Motor_Debug_Tool
             // label143
             // 
             this.label143.AutoSize = true;
-            this.label143.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label143.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label143.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label143.Location = new System.Drawing.Point(6, 180);
+            this.label143.Location = new System.Drawing.Point(6, 168);
             this.label143.Name = "label143";
-            this.label143.Size = new System.Drawing.Size(65, 20);
+            this.label143.Size = new System.Drawing.Size(56, 17);
             this.label143.TabIndex = 12;
             this.label143.Text = "前灯控制";
             this.label143.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4951,7 +4961,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeLightF.BackColor = System.Drawing.Color.Red;
             this.label_FacModeLightF.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeLightF.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeLightF.Location = new System.Drawing.Point(95, 184);
+            this.label_FacModeLightF.Location = new System.Drawing.Point(95, 170);
             this.label_FacModeLightF.Name = "label_FacModeLightF";
             this.label_FacModeLightF.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeLightF.TabIndex = 13;
@@ -4960,11 +4970,11 @@ namespace Welling_Motor_Debug_Tool
             // label129
             // 
             this.label129.AutoSize = true;
-            this.label129.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label129.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label129.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label129.Location = new System.Drawing.Point(6, 154);
+            this.label129.Location = new System.Drawing.Point(6, 144);
             this.label129.Name = "label129";
-            this.label129.Size = new System.Drawing.Size(65, 20);
+            this.label129.Size = new System.Drawing.Size(56, 17);
             this.label129.TabIndex = 12;
             this.label129.Text = "转把功能";
             this.label129.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4974,7 +4984,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeGas.BackColor = System.Drawing.Color.Red;
             this.label_FacModeGas.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeGas.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeGas.Location = new System.Drawing.Point(95, 158);
+            this.label_FacModeGas.Location = new System.Drawing.Point(95, 146);
             this.label_FacModeGas.Name = "label_FacModeGas";
             this.label_FacModeGas.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeGas.TabIndex = 13;
@@ -4983,11 +4993,11 @@ namespace Welling_Motor_Debug_Tool
             // label123
             // 
             this.label123.AutoSize = true;
-            this.label123.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label123.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label123.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label123.Location = new System.Drawing.Point(123, 102);
+            this.label123.Location = new System.Drawing.Point(123, 96);
             this.label123.Name = "label123";
-            this.label123.Size = new System.Drawing.Size(65, 20);
+            this.label123.Size = new System.Drawing.Size(56, 17);
             this.label123.TabIndex = 6;
             this.label123.Text = "电机转速";
             this.label123.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -4997,7 +5007,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeMotorSpeed.BackColor = System.Drawing.Color.Red;
             this.label_FacModeMotorSpeed.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeMotorSpeed.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeMotorSpeed.Location = new System.Drawing.Point(208, 106);
+            this.label_FacModeMotorSpeed.Location = new System.Drawing.Point(208, 98);
             this.label_FacModeMotorSpeed.Name = "label_FacModeMotorSpeed";
             this.label_FacModeMotorSpeed.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeMotorSpeed.TabIndex = 7;
@@ -5006,11 +5016,11 @@ namespace Welling_Motor_Debug_Tool
             // label125
             // 
             this.label125.AutoSize = true;
-            this.label125.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label125.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label125.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label125.Location = new System.Drawing.Point(6, 102);
+            this.label125.Location = new System.Drawing.Point(6, 96);
             this.label125.Name = "label125";
-            this.label125.Size = new System.Drawing.Size(65, 20);
+            this.label125.Size = new System.Drawing.Size(56, 17);
             this.label125.TabIndex = 8;
             this.label125.Text = "温度测量";
             this.label125.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -5020,7 +5030,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeNTC.BackColor = System.Drawing.Color.Red;
             this.label_FacModeNTC.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeNTC.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeNTC.Location = new System.Drawing.Point(95, 106);
+            this.label_FacModeNTC.Location = new System.Drawing.Point(95, 98);
             this.label_FacModeNTC.Name = "label_FacModeNTC";
             this.label_FacModeNTC.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeNTC.TabIndex = 9;
@@ -5029,11 +5039,11 @@ namespace Welling_Motor_Debug_Tool
             // label122
             // 
             this.label122.AutoSize = true;
-            this.label122.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label122.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label122.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label122.Location = new System.Drawing.Point(123, 76);
+            this.label122.Location = new System.Drawing.Point(123, 72);
             this.label122.Name = "label122";
-            this.label122.Size = new System.Drawing.Size(65, 20);
+            this.label122.Size = new System.Drawing.Size(56, 17);
             this.label122.TabIndex = 5;
             this.label122.Text = "电流检测";
             this.label122.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -5041,11 +5051,11 @@ namespace Welling_Motor_Debug_Tool
             // label118
             // 
             this.label118.AutoSize = true;
-            this.label118.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label118.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label118.ForeColor = System.Drawing.SystemColors.ControlText;
             this.label118.Location = new System.Drawing.Point(123, 24);
             this.label118.Name = "label118";
-            this.label118.Size = new System.Drawing.Size(65, 20);
+            this.label118.Size = new System.Drawing.Size(56, 17);
             this.label118.TabIndex = 5;
             this.label118.Text = "参数写入";
             this.label118.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -5055,7 +5065,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeCurrentTest.BackColor = System.Drawing.Color.Red;
             this.label_FacModeCurrentTest.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeCurrentTest.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeCurrentTest.Location = new System.Drawing.Point(208, 80);
+            this.label_FacModeCurrentTest.Location = new System.Drawing.Point(208, 74);
             this.label_FacModeCurrentTest.Name = "label_FacModeCurrentTest";
             this.label_FacModeCurrentTest.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeCurrentTest.TabIndex = 5;
@@ -5066,7 +5076,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacMode_CfgWrite.BackColor = System.Drawing.Color.Red;
             this.label_FacMode_CfgWrite.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacMode_CfgWrite.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacMode_CfgWrite.Location = new System.Drawing.Point(208, 28);
+            this.label_FacMode_CfgWrite.Location = new System.Drawing.Point(208, 26);
             this.label_FacMode_CfgWrite.Name = "label_FacMode_CfgWrite";
             this.label_FacMode_CfgWrite.Size = new System.Drawing.Size(12, 12);
             this.label_FacMode_CfgWrite.TabIndex = 5;
@@ -5075,11 +5085,11 @@ namespace Welling_Motor_Debug_Tool
             // label120
             // 
             this.label120.AutoSize = true;
-            this.label120.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label120.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label120.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label120.Location = new System.Drawing.Point(6, 76);
+            this.label120.Location = new System.Drawing.Point(6, 72);
             this.label120.Name = "label120";
-            this.label120.Size = new System.Drawing.Size(65, 20);
+            this.label120.Size = new System.Drawing.Size(56, 17);
             this.label120.TabIndex = 5;
             this.label120.Text = "电压测量";
             this.label120.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -5089,7 +5099,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeVolTest.BackColor = System.Drawing.Color.Red;
             this.label_FacModeVolTest.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeVolTest.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeVolTest.Location = new System.Drawing.Point(95, 80);
+            this.label_FacModeVolTest.Location = new System.Drawing.Point(95, 74);
             this.label_FacModeVolTest.Name = "label_FacModeVolTest";
             this.label_FacModeVolTest.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeVolTest.TabIndex = 5;
@@ -5098,11 +5108,11 @@ namespace Welling_Motor_Debug_Tool
             // label115
             // 
             this.label115.AutoSize = true;
-            this.label115.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label115.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label115.ForeColor = System.Drawing.SystemColors.ControlText;
             this.label115.Location = new System.Drawing.Point(6, 24);
             this.label115.Name = "label115";
-            this.label115.Size = new System.Drawing.Size(65, 20);
+            this.label115.Size = new System.Drawing.Size(56, 17);
             this.label115.TabIndex = 5;
             this.label115.Text = "系统清除";
             this.label115.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -5112,7 +5122,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeSysClear.BackColor = System.Drawing.Color.Red;
             this.label_FacModeSysClear.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeSysClear.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.label_FacModeSysClear.Location = new System.Drawing.Point(95, 28);
+            this.label_FacModeSysClear.Location = new System.Drawing.Point(95, 26);
             this.label_FacModeSysClear.Name = "label_FacModeSysClear";
             this.label_FacModeSysClear.Size = new System.Drawing.Size(12, 12);
             this.label_FacModeSysClear.TabIndex = 5;
@@ -5179,6 +5189,7 @@ namespace Welling_Motor_Debug_Tool
             // 
             // groupBox2
             // 
+            this.groupBox2.Controls.Add(this.checkBox_FacMode_MosCal);
             this.groupBox2.Controls.Add(this.pictureBox_WriteLock);
             this.groupBox2.Controls.Add(this.checkBox_FacCad);
             this.groupBox2.Controls.Add(this.checkBox_FacLightTest);
@@ -5214,7 +5225,7 @@ namespace Welling_Motor_Debug_Tool
             this.checkBox_FacCad.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacCad.Enabled = false;
             this.checkBox_FacCad.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacCad.Location = new System.Drawing.Point(94, 132);
+            this.checkBox_FacCad.Location = new System.Drawing.Point(94, 158);
             this.checkBox_FacCad.Name = "checkBox_FacCad";
             this.checkBox_FacCad.Size = new System.Drawing.Size(51, 21);
             this.checkBox_FacCad.TabIndex = 6;
@@ -5242,7 +5253,7 @@ namespace Welling_Motor_Debug_Tool
             this.checkBox_FacBreakTest.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacBreakTest.Enabled = false;
             this.checkBox_FacBreakTest.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacBreakTest.Location = new System.Drawing.Point(6, 184);
+            this.checkBox_FacBreakTest.Location = new System.Drawing.Point(94, 184);
             this.checkBox_FacBreakTest.Name = "checkBox_FacBreakTest";
             this.checkBox_FacBreakTest.Size = new System.Drawing.Size(51, 21);
             this.checkBox_FacBreakTest.TabIndex = 4;
@@ -5256,7 +5267,7 @@ namespace Welling_Motor_Debug_Tool
             this.checkBox_FacTor.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacTor.Enabled = false;
             this.checkBox_FacTor.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacTor.Location = new System.Drawing.Point(6, 132);
+            this.checkBox_FacTor.Location = new System.Drawing.Point(6, 158);
             this.checkBox_FacTor.Name = "checkBox_FacTor";
             this.checkBox_FacTor.Size = new System.Drawing.Size(51, 21);
             this.checkBox_FacTor.TabIndex = 3;
@@ -5270,7 +5281,7 @@ namespace Welling_Motor_Debug_Tool
             this.checkBox_FacThrrotleTest.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacThrrotleTest.Enabled = false;
             this.checkBox_FacThrrotleTest.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacThrrotleTest.Location = new System.Drawing.Point(6, 158);
+            this.checkBox_FacThrrotleTest.Location = new System.Drawing.Point(6, 184);
             this.checkBox_FacThrrotleTest.Name = "checkBox_FacThrrotleTest";
             this.checkBox_FacThrrotleTest.Size = new System.Drawing.Size(51, 21);
             this.checkBox_FacThrrotleTest.TabIndex = 3;
@@ -5298,7 +5309,7 @@ namespace Welling_Motor_Debug_Tool
             this.checkBox_FacBaseFucTest.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacBaseFucTest.Enabled = false;
             this.checkBox_FacBaseFucTest.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacBaseFucTest.Location = new System.Drawing.Point(6, 106);
+            this.checkBox_FacBaseFucTest.Location = new System.Drawing.Point(6, 132);
             this.checkBox_FacBaseFucTest.Name = "checkBox_FacBaseFucTest";
             this.checkBox_FacBaseFucTest.Size = new System.Drawing.Size(75, 21);
             this.checkBox_FacBaseFucTest.TabIndex = 2;
@@ -6679,6 +6690,68 @@ namespace Welling_Motor_Debug_Tool
             this.label46.TabIndex = 21;
             this.label46.Text = "/";
             // 
+            // checkBox_FacMode_MosCal
+            // 
+            this.checkBox_FacMode_MosCal.AutoSize = true;
+            this.checkBox_FacMode_MosCal.Checked = true;
+            this.checkBox_FacMode_MosCal.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.checkBox_FacMode_MosCal.Enabled = false;
+            this.checkBox_FacMode_MosCal.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.checkBox_FacMode_MosCal.Location = new System.Drawing.Point(6, 106);
+            this.checkBox_FacMode_MosCal.Name = "checkBox_FacMode_MosCal";
+            this.checkBox_FacMode_MosCal.Size = new System.Drawing.Size(104, 21);
+            this.checkBox_FacMode_MosCal.TabIndex = 8;
+            this.checkBox_FacMode_MosCal.Text = "MOS内阻校准";
+            this.checkBox_FacMode_MosCal.UseVisualStyleBackColor = true;
+            // 
+            // label130
+            // 
+            this.label130.AutoSize = true;
+            this.label130.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label130.ForeColor = System.Drawing.SystemColors.ControlText;
+            this.label130.Location = new System.Drawing.Point(6, 216);
+            this.label130.Name = "label130";
+            this.label130.Size = new System.Drawing.Size(85, 17);
+            this.label130.TabIndex = 26;
+            this.label130.Text = "MOS内阻校准";
+            this.label130.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label_FacModeMosCal
+            // 
+            this.label_FacModeMosCal.BackColor = System.Drawing.Color.Red;
+            this.label_FacModeMosCal.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_FacModeMosCal.ForeColor = System.Drawing.SystemColors.ControlText;
+            this.label_FacModeMosCal.Location = new System.Drawing.Point(95, 218);
+            this.label_FacModeMosCal.Name = "label_FacModeMosCal";
+            this.label_FacModeMosCal.Size = new System.Drawing.Size(12, 12);
+            this.label_FacModeMosCal.TabIndex = 27;
+            this.label_FacModeMosCal.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // 协议类型ToolStripMenuItem1
+            // 
+            this.协议类型ToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.cANToolStripMenuItem,
+            this.uARTToolStripMenuItem});
+            this.协议类型ToolStripMenuItem1.Name = "协议类型ToolStripMenuItem1";
+            this.协议类型ToolStripMenuItem1.Size = new System.Drawing.Size(192, 26);
+            this.协议类型ToolStripMenuItem1.Text = "协议类型";
+            // 
+            // cANToolStripMenuItem
+            // 
+            this.cANToolStripMenuItem.Checked = true;
+            this.cANToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.cANToolStripMenuItem.Name = "cANToolStripMenuItem";
+            this.cANToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.cANToolStripMenuItem.Text = "CAN";
+            this.cANToolStripMenuItem.Click += new System.EventHandler(this.cANToolStripMenuItem_Click);
+            // 
+            // uARTToolStripMenuItem
+            // 
+            this.uARTToolStripMenuItem.Name = "uARTToolStripMenuItem";
+            this.uARTToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.uARTToolStripMenuItem.Text = "UART";
+            this.uARTToolStripMenuItem.Click += new System.EventHandler(this.uARTToolStripMenuItem_Click);
+            // 
             // mainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -7376,5 +7449,11 @@ namespace Welling_Motor_Debug_Tool
         private ToolStripMenuItem 样机测试记录ToolStripMenuItem;
         private ToolStripComboBox toolStripTextBox_DelCfgFile;
         private ToolStripComboBox toolStripTextBox_DelLogFile;
+        private CheckBox checkBox_FacMode_MosCal;
+        private Label label130;
+        private Label label_FacModeMosCal;
+        private ToolStripMenuItem 协议类型ToolStripMenuItem1;
+        private ToolStripMenuItem cANToolStripMenuItem;
+        private ToolStripMenuItem uARTToolStripMenuItem;
     }
 }

+ 105 - 12
Welling_Motor_Debug_Tool/mainForm.cs

@@ -5651,7 +5651,7 @@ namespace Welling_Motor_Debug_Tool
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
 
             //关闭串口
-            mySerialProcess.SerialClose(false);
+            //mySerialProcess.SerialClose(false);
 
             //路径设置
             string LocalSavePath = "";
@@ -5788,7 +5788,8 @@ namespace Welling_Motor_Debug_Tool
             richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "检查扫码信息" + "\r\n");
             if (textBox_FacModeScan.Text == string.Empty)
             {
-                MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);                
+                MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                button__FacMode_Start.Enabled = true;
                 return;
             }
             try
@@ -5858,17 +5859,30 @@ namespace Welling_Motor_Debug_Tool
             label_FacModeStatus.Text = "开始测试";
             Delay_ms(500);
             label_FacModeStatus.Text = "系统开机";
-
-            //系统开机,确保测试前先关机,发送关机指令再发送开机指令
+            
+            //UART控制器发送复位指令把联动装置盒控制器接口波特率改为57600
+            if (uARTToolStripMenuItem.Checked)
+            {
+                Code[0] = (byte)'R';
+                Code[1] = (byte)'E';
+                Code[2] = (byte)'S';
+                Code[3] = (byte)'E';
+                Code[4] = (byte)'T';
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2505, Code);
+                Delay_ms(500);
+            }
+            //发送开机指令            
             BootInfo = "";
+            //确保测试前先关机,发送关机指令再发送开机指令
             Code[0] = 0xF0;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
             Delay_ms(1500);
             Code[0] = 0xF1;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
             ACK_WaitCnt = 0;
-            while (ACK_WaitCnt <= 7); //3.5s
 
+            while (ACK_WaitCnt <= 10) ; //5s,等待开机成功,联动装置盒控制器接口波特率需等待5s接口自动切换为9600
+            
             //检查BOOT版本
             if (BootInfo != string.Empty)
             {
@@ -5881,18 +5895,26 @@ namespace Welling_Motor_Debug_Tool
                 richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开机失败" + BootInfo + "\r\n");
                 label_FacModeStatus.Text = "存在故障!";
                 label_FacModeResult.BackColor = Color.Red;
-                label_FacModeResult.Text = "测试异常";                
+                label_FacModeResult.Text = "测试异常";
                 Delay_ms(500);
                 //存储异常并上传
                 FacMode_Stop(false);
                 return;
-            }                        
-
+            }
+                                    
             //系统清除
             if (checkBox_FacModeSysClear.Checked)
             {
                 do
                 {
+                    if (uARTToolStripMenuItem.Checked)//UART控制器默认按照5S协议收发数据
+                    {
+                        Code[0] = 0x00;//5S协议
+                        Code[1] = 0x00;
+                        mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                        richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
+                    }
+                    
                     //发送系统清除指令    
                     label_FacModeStatus.Text = "系统清除";
                     richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除" + "\r\n");
@@ -5925,14 +5947,30 @@ namespace Welling_Motor_Debug_Tool
                         FacMode_Stop(false);
                         return;
                     }
-
+                    
+                    //UART控制器发送复位指令把联动装置盒控制器接口波特率改为57600
+                    if (uARTToolStripMenuItem.Checked)
+                    {
+                        Code[0] = (byte)'R';
+                        Code[1] = (byte)'E';
+                        Code[2] = (byte)'S';
+                        Code[3] = (byte)'E';
+                        Code[4] = (byte)'T';
+                        mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2505, Code);
+                        Delay_ms(500);
+                    }
                     //系统重新开机
                     label_FacModeStatus.Text = "重新开机";
                     BootInfo = "";
+                    //确保测试前先关机,发送关机指令再发送开机指令
+                    BootInfo = "";
+                    Code[0] = 0xF0;
+                    mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
+                    Delay_ms(1500);
                     Code[0] = 0xF1;
                     mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
                     ACK_WaitCnt = 0;
-                    while (ACK_WaitCnt <= 7); //3.5s
+                    while (ACK_WaitCnt <= 10); //5s
 
                     //获取Boot版本信息
                     if (BootInfo != string.Empty)
@@ -5960,6 +5998,15 @@ namespace Welling_Motor_Debug_Tool
                 Delay_ms(500);
             }
 
+            if (uARTToolStripMenuItem.Checked)//UART控制器默认按照5S协议收发数据
+            {
+                Code[0] = 0x00;//5S协议
+                Code[1] = 0x00;
+                mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
+                richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
+            }
+            Delay_ms(2000);
+
             //检查是否有故障
             if (textBox_ErrorCode.Text.Contains("H"))
             {
@@ -6217,6 +6264,26 @@ namespace Welling_Motor_Debug_Tool
                 Delay_ms(500);
             }
 
+            //MOS内阻校准
+            if (checkBox_FacMode_MosCal.Checked)
+            {
+                //提示进行负载切换
+
+                //确认后发送校准指令
+
+                //显示校准返回数据
+
+                //与校准返回数据对比
+
+            }
+            else
+            {
+                label_FacModeMosCal.BackColor = Color.Yellow;
+                label_FacModeStatus.Text = "跳过MOS内阻校准!";
+                richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过MOS内阻校准" + "\r\n");
+                Delay_ms(500);
+            }
+
             //基础功能检测
             if (checkBox_FacBaseFucTest.Checked)
             {
@@ -6725,7 +6792,7 @@ namespace Welling_Motor_Debug_Tool
                 WriteCnt = 0;
                 ACK_WaitCnt = 0;
                 while (ACK_WaitCnt <= 2) ; //1s
-                if (textBox_RunInfo_GearSt.Text != "WALK")
+                if ((textBox_RunInfo_GearSt.Text != "WALK") || (Convert.ToInt32(textBox_RunInfo_MotorSpeed.Text.Split(' ')[0]) < 200))
                 {
                     richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入WALK异常" + "\r\n");
                     label_FacModeStatus.Text = "存在故障!";
@@ -6993,7 +7060,7 @@ namespace Welling_Motor_Debug_Tool
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
 
             //关闭串口
-            mySerialProcess.SerialClose(false);
+            //mySerialProcess.SerialClose(false);
 
             //路径设置
             string LocalSavePath = "";
@@ -7124,6 +7191,7 @@ namespace Welling_Motor_Debug_Tool
             if (textBox_CheckModeScan.Text == string.Empty)
             {
                 MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                button__FacMode_Start.Enabled = false;
                 return;
             }
             try
@@ -7165,6 +7233,7 @@ namespace Welling_Motor_Debug_Tool
             if (!mySerialProcess.mySerial.IsOpen)
             {
                 MessageBox.Show("请检查串口连接!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                button__FacMode_Start.Enabled = false;
                 return;
             }
 
@@ -8474,5 +8543,29 @@ namespace Welling_Motor_Debug_Tool
                 }
             } while (false);
         }
+
+        /// <summary>
+        /// CAN协议选择
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void cANToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            cANToolStripMenuItem.Checked= true;
+            uARTToolStripMenuItem.Checked = false;
+            UART协议ToolStripMenuItem.Visible = false;
+        }
+
+        /// <summary>
+        /// UART协议选择
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void uARTToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            cANToolStripMenuItem.Checked = false;
+            uARTToolStripMenuItem.Checked = true;
+            UART协议ToolStripMenuItem.Visible = true;
+        }
     }
 }

BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb