Răsfoiți Sursa

UI增加整车信息2、骑行助力参数、ODO写入等,代码未写。

Dail 1 an în urmă
părinte
comite
79af762d40

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 7 - 3
Welling_Motor_Debug_Tool/Params.cs

@@ -8,13 +8,15 @@ namespace Welling_Motor_Debug_Tool
 {
     internal class Params
     {
-        public List<string> MotorParma = new List<string> { "极对数","电阻","d轴电感","q轴电感","永磁体磁链","Id最大值","Id最小值",
+        public List<string> MotorParam = new List<string> { "极对数","电阻","d轴电感","q轴电感","永磁体磁链","Id最大值","Id最小值",
                                                             "额定转速","额定功率","额定电流","额定电压","惯量","最大转矩",
                                                             "预留1","预留2","预留3","预留4","预留5","预留6"};
-        public List<string> BikeParma = new List<string> { "轮胎周长", "电控传动比", "转把模式限速", "推行模式限速", "前牙盘T数", "后牙盘T数",
+        public List<string> BikeParam = new List<string> { "轮胎周长", "电控传动比", "转把模式限速", "推行模式限速", "前牙盘T数", "后牙盘T数",
                                                            "助力方案1", "助力方案2", "前后灯参数","轮胎周长微调","启动模式","开关机参数",
                                                            "预留1"};
-        public List<string> ControlParma = new List<string> {"位置传感器零点","位置传感器当前零点","峰值电流","电流保护阈值","最高档电压保护阈值","最高档欠压保护阈值",
+        public List<string> BikeParam2 = new List<string> { "支持无码表","尾灯控制周期","尾灯控制脉宽","限速微调","预留1", "预留2", "预留3", "预留4", "预留5", "预留6", "预留7", "预留8", "预留9", "预留10",
+                                                           "预留11","预留12"};
+        public List<string> ControlParam = new List<string> {"位置传感器零点","位置传感器当前零点","峰值电流","电流保护阈值","最高档电压保护阈值","最高档欠压保护阈值",
                                                              "超速保护阈值","过热保护阈值","过热保护恢复阈值","过热降额启动阈值","电机过热保护阈值","电机过热保护恢复阈值", "电机过热降额启动阈值",
                                                              "预留1","预留2","预留3"};
         public List<string> AssistParam = new List<string> { "零速启动增益", "巡航启动增益", "助力转矩曲线编号", "助力踏频曲线编号",
@@ -24,6 +26,8 @@ namespace Welling_Motor_Debug_Tool
                                                              "启动对应踏频脉冲数", "转矩滤波对应踏频脉冲数", "待速转速", "启动平滑系数阶梯",
                                                              "车速限幅启动阈值", "车速限幅停止阈值" ,"踏频占比", "踏频助力Kp","踏频助力加速限制","踏频助力退饱和步进","踏频助力电流步进",
                                                              "预留1","预留2","预留3","预留4"};
+        public List<string> UsrRideParam = new List<string> { "ECO助力比增益","ECO加速度增益", "NORM助力比增益", "NORM加速度增益", "SPORT助力比增益", "SPORT加速度增益", "TURBO助力比增益", "TURBO加速度增益", "SMART助力比增益", "SMART加速度增益",
+                                                              "ECO最大电流增益","ECO最大力矩增益","NORM最大电流增益","NORM最大力矩增益","SPORT最大电流增益","SPORT最大力矩增益","TURBO最大电流增益","TURBO最大力矩增益","TURBO最大电流增益","TURBO最大力矩增益"};
         public List<string> DebugParam = new List<string> { "整体运行模式","位置获取模式","采样模式","旋转方向","定位电流","拖拽电压",
                                                             "拖拽电流","拖拽频率","加速斜率","减速斜率","转速环控制器带宽","转速环控制器m",
                                                             "电流环控制器带宽","电流环控制器m","磁链观测器带宽","磁链观测器m",

+ 395 - 97
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -339,7 +339,6 @@ namespace Welling_Motor_Debug_Tool
             this.label81 = new System.Windows.Forms.Label();
             this.textBox_FacModeName = new System.Windows.Forms.TextBox();
             this.groupBox22 = new System.Windows.Forms.GroupBox();
-            this.label80 = new System.Windows.Forms.Label();
             this.button_FacModeLightSW = new System.Windows.Forms.Button();
             this.label_FacModeMotorSpeedSet = new System.Windows.Forms.Label();
             this.label67 = new System.Windows.Forms.Label();
@@ -484,7 +483,6 @@ namespace Welling_Motor_Debug_Tool
             this.label_ServerStatus = new System.Windows.Forms.Label();
             this.label_PortStatus = new System.Windows.Forms.Label();
             this.label_Computername = new System.Windows.Forms.Label();
-            this.label46 = new System.Windows.Forms.Label();
             this.tabControl2 = new System.Windows.Forms.TabControl();
             this.tabPage_RunInfo = new System.Windows.Forms.TabPage();
             this.textBox_RunInfo_BikeSpeed = new System.Windows.Forms.TextBox();
@@ -558,6 +556,30 @@ namespace Welling_Motor_Debug_Tool
             this.label107 = new System.Windows.Forms.Label();
             this.label_StarInfo = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
+            this.label_UserName = new System.Windows.Forms.Label();
+            this.label124 = new System.Windows.Forms.Label();
+            this.label46 = new System.Windows.Forms.Label();
+            this.groupBox23 = new System.Windows.Forms.GroupBox();
+            this.textBox_TagInfo = new System.Windows.Forms.TextBox();
+            this.button_WriteTag = new System.Windows.Forms.Button();
+            this.button_ReadTag = new System.Windows.Forms.Button();
+            this.groupBox24 = new System.Windows.Forms.GroupBox();
+            this.textBox_ODO_KM = new System.Windows.Forms.TextBox();
+            this.textBox_ODO_TIME = new System.Windows.Forms.TextBox();
+            this.textBox_TRIP_TIME = new System.Windows.Forms.TextBox();
+            this.textBox_TRIP_KM = new System.Windows.Forms.TextBox();
+            this.label119 = new System.Windows.Forms.Label();
+            this.label126 = new System.Windows.Forms.Label();
+            this.button_ReadRideLog = new System.Windows.Forms.Button();
+            this.button_WriteRideLog = new System.Windows.Forms.Button();
+            this.tabPage_BikeParam2 = new System.Windows.Forms.TabPage();
+            this.tabPage_UsrRideParam = new System.Windows.Forms.TabPage();
+            this.button_WriteBikeParam2 = new System.Windows.Forms.Button();
+            this.button_ReadBikeParam2 = new System.Windows.Forms.Button();
+            this.richTextBox_BikeParam2 = new System.Windows.Forms.RichTextBox();
+            this.button_WriteUsrRidetParam = new System.Windows.Forms.Button();
+            this.button_ReadUsrRideParam = new System.Windows.Forms.Button();
+            this.richTextBox_UsrRidesParam = new System.Windows.Forms.RichTextBox();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -613,6 +635,10 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_RunInfo.SuspendLayout();
             this.tabPage_DebugInfo.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            this.groupBox23.SuspendLayout();
+            this.groupBox24.SuspendLayout();
+            this.tabPage_BikeParam2.SuspendLayout();
+            this.tabPage_UsrRideParam.SuspendLayout();
             this.SuspendLayout();
             // 
             // menuStrip_Set
@@ -650,7 +676,7 @@ namespace Welling_Motor_Debug_Tool
             // 刷新ToolStripMenuItem
             // 
             this.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem";
-            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.刷新ToolStripMenuItem.Text = "刷新";
             this.刷新ToolStripMenuItem.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click);
             // 
@@ -659,7 +685,7 @@ namespace Welling_Motor_Debug_Tool
             this.端口号ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_ComNum});
             this.端口号ToolStripMenuItem.Name = "端口号ToolStripMenuItem";
-            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.端口号ToolStripMenuItem.Text = "端口号";
             this.端口号ToolStripMenuItem.Click += new System.EventHandler(this.ConfigFileSave_Click);
             // 
@@ -677,7 +703,7 @@ namespace Welling_Motor_Debug_Tool
             this.波特率ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_Baudrate});
             this.波特率ToolStripMenuItem.Name = "波特率ToolStripMenuItem";
-            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.波特率ToolStripMenuItem.Text = "波特率";
             // 
             // toolStripComboBox_Baudrate
@@ -696,14 +722,14 @@ namespace Welling_Motor_Debug_Tool
             // 连接ToolStripMenuItem
             // 
             this.连接ToolStripMenuItem.Name = "连接ToolStripMenuItem";
-            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.连接ToolStripMenuItem.Text = "连接";
             this.连接ToolStripMenuItem.Click += new System.EventHandler(this.连接ToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
             // 
             // 其它配置项ToolStripMenuItem
             // 
@@ -712,7 +738,7 @@ namespace Welling_Motor_Debug_Tool
             this.断开关机ToolStripMenuItem,
             this.识别通讯盒ToolStripMenuItem});
             this.其它配置项ToolStripMenuItem.Name = "其它配置项ToolStripMenuItem";
-            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.其它配置项ToolStripMenuItem.Text = "其它配置项";
             // 
             // 连接开机ToolStripMenuItem
@@ -1181,7 +1207,7 @@ namespace Welling_Motor_Debug_Tool
             this.协议类型ToolStripMenuItem});
             this.uART协议ToolStripMenuItem.Name = "uART协议ToolStripMenuItem";
             this.uART协议ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
-            this.uART协议ToolStripMenuItem.Text = "UART协议";
+            this.uART协议ToolStripMenuItem.Text = "UART协议设置";
             // 
             // 协议类型ToolStripMenuItem
             // 
@@ -1540,9 +1566,11 @@ namespace Welling_Motor_Debug_Tool
             // 
             this.tabControl1.Controls.Add(this.tabPage_MotorParam);
             this.tabControl1.Controls.Add(this.tabPage_BikeParam);
+            this.tabControl1.Controls.Add(this.tabPage_BikeParam2);
             this.tabControl1.Controls.Add(this.tabPage_ControlParam);
             this.tabControl1.Controls.Add(this.tabPage_SensorParam);
             this.tabControl1.Controls.Add(this.tabPage_AssistParam);
+            this.tabControl1.Controls.Add(this.tabPage_UsrRideParam);
             this.tabControl1.Controls.Add(this.tabPage_DebugParam);
             this.tabControl1.Controls.Add(this.tabPage_RecordInfo);
             this.tabControl1.Controls.Add(this.tabPage_OtherInfo);
@@ -1626,7 +1654,7 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_BikeParam.Padding = new System.Windows.Forms.Padding(3);
             this.tabPage_BikeParam.Size = new System.Drawing.Size(990, 315);
             this.tabPage_BikeParam.TabIndex = 1;
-            this.tabPage_BikeParam.Text = "整车信息";
+            this.tabPage_BikeParam.Text = "整车信息1";
             // 
             // textBox_AutoPowerOff
             // 
@@ -2215,6 +2243,7 @@ namespace Welling_Motor_Debug_Tool
             // 
             this.tabPage_OtherInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.tabPage_OtherInfo.Controls.Add(this.groupBox16);
+            this.tabPage_OtherInfo.Controls.Add(this.groupBox23);
             this.tabPage_OtherInfo.Controls.Add(this.groupBox9);
             this.tabPage_OtherInfo.Controls.Add(this.groupBox8);
             this.tabPage_OtherInfo.Controls.Add(this.groupBox7);
@@ -2234,9 +2263,9 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox16.Controls.Add(this.button_ReadSaveFlag);
             this.groupBox16.Controls.Add(this.button_WriteSaveFlag);
             this.groupBox16.Controls.Add(this.checkBox_SaveYes);
-            this.groupBox16.Location = new System.Drawing.Point(707, 185);
+            this.groupBox16.Location = new System.Drawing.Point(648, 185);
             this.groupBox16.Name = "groupBox16";
-            this.groupBox16.Size = new System.Drawing.Size(280, 127);
+            this.groupBox16.Size = new System.Drawing.Size(335, 127);
             this.groupBox16.TabIndex = 5;
             this.groupBox16.TabStop = false;
             this.groupBox16.Text = "存储标志";
@@ -2247,7 +2276,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox18.Controls.Add(this.radioButton_SIP_SaveYes);
             this.groupBox18.Location = new System.Drawing.Point(107, 30);
             this.groupBox18.Name = "groupBox18";
-            this.groupBox18.Size = new System.Drawing.Size(95, 95);
+            this.groupBox18.Size = new System.Drawing.Size(95, 91);
             this.groupBox18.TabIndex = 11;
             this.groupBox18.TabStop = false;
             this.groupBox18.Text = "SIP校准";
@@ -2255,7 +2284,7 @@ namespace Welling_Motor_Debug_Tool
             // radioButton_SIP_SaveNo
             // 
             this.radioButton_SIP_SaveNo.AutoSize = true;
-            this.radioButton_SIP_SaveNo.Location = new System.Drawing.Point(12, 31);
+            this.radioButton_SIP_SaveNo.Location = new System.Drawing.Point(12, 27);
             this.radioButton_SIP_SaveNo.Name = "radioButton_SIP_SaveNo";
             this.radioButton_SIP_SaveNo.Size = new System.Drawing.Size(76, 25);
             this.radioButton_SIP_SaveNo.TabIndex = 9;
@@ -2266,7 +2295,7 @@ namespace Welling_Motor_Debug_Tool
             // radioButton_SIP_SaveYes
             // 
             this.radioButton_SIP_SaveYes.AutoSize = true;
-            this.radioButton_SIP_SaveYes.Location = new System.Drawing.Point(12, 56);
+            this.radioButton_SIP_SaveYes.Location = new System.Drawing.Point(12, 57);
             this.radioButton_SIP_SaveYes.Name = "radioButton_SIP_SaveYes";
             this.radioButton_SIP_SaveYes.Size = new System.Drawing.Size(76, 25);
             this.radioButton_SIP_SaveYes.TabIndex = 8;
@@ -2280,7 +2309,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox17.Controls.Add(this.radioButton_EE_SaveNo);
             this.groupBox17.Location = new System.Drawing.Point(6, 29);
             this.groupBox17.Name = "groupBox17";
-            this.groupBox17.Size = new System.Drawing.Size(95, 96);
+            this.groupBox17.Size = new System.Drawing.Size(95, 92);
             this.groupBox17.TabIndex = 10;
             this.groupBox17.TabStop = false;
             this.groupBox17.Text = "EEPROM";
@@ -2288,7 +2317,7 @@ namespace Welling_Motor_Debug_Tool
             // radioButton_EE_SaveYes
             // 
             this.radioButton_EE_SaveYes.AutoSize = true;
-            this.radioButton_EE_SaveYes.Location = new System.Drawing.Point(15, 57);
+            this.radioButton_EE_SaveYes.Location = new System.Drawing.Point(13, 57);
             this.radioButton_EE_SaveYes.Name = "radioButton_EE_SaveYes";
             this.radioButton_EE_SaveYes.Size = new System.Drawing.Size(76, 25);
             this.radioButton_EE_SaveYes.TabIndex = 8;
@@ -2299,7 +2328,7 @@ namespace Welling_Motor_Debug_Tool
             // radioButton_EE_SaveNo
             // 
             this.radioButton_EE_SaveNo.AutoSize = true;
-            this.radioButton_EE_SaveNo.Location = new System.Drawing.Point(15, 32);
+            this.radioButton_EE_SaveNo.Location = new System.Drawing.Point(13, 27);
             this.radioButton_EE_SaveNo.Name = "radioButton_EE_SaveNo";
             this.radioButton_EE_SaveNo.Size = new System.Drawing.Size(76, 25);
             this.radioButton_EE_SaveNo.TabIndex = 9;
@@ -2321,7 +2350,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteSaveFlag
             // 
             this.button_WriteSaveFlag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
-            this.button_WriteSaveFlag.Location = new System.Drawing.Point(207, 92);
+            this.button_WriteSaveFlag.Location = new System.Drawing.Point(268, 59);
             this.button_WriteSaveFlag.Name = "button_WriteSaveFlag";
             this.button_WriteSaveFlag.Size = new System.Drawing.Size(61, 29);
             this.button_WriteSaveFlag.TabIndex = 4;
@@ -2345,19 +2374,20 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox9.Controls.Add(this.button_ClearLog);
             this.groupBox9.Controls.Add(this.button_Reset);
             this.groupBox9.Controls.Add(this.button_SystemClear);
-            this.groupBox9.Location = new System.Drawing.Point(707, 4);
+            this.groupBox9.Location = new System.Drawing.Point(602, 4);
             this.groupBox9.Name = "groupBox9";
-            this.groupBox9.Size = new System.Drawing.Size(280, 175);
+            this.groupBox9.Size = new System.Drawing.Size(381, 65);
             this.groupBox9.TabIndex = 4;
             this.groupBox9.TabStop = false;
             this.groupBox9.Text = "系统操作";
             // 
             // button_Recovery
             // 
-            this.button_Recovery.BackColor = System.Drawing.Color.Fuchsia;
-            this.button_Recovery.Location = new System.Drawing.Point(152, 28);
+            this.button_Recovery.BackColor = System.Drawing.Color.HotPink;
+            this.button_Recovery.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.button_Recovery.Location = new System.Drawing.Point(100, 25);
             this.button_Recovery.Name = "button_Recovery";
-            this.button_Recovery.Size = new System.Drawing.Size(100, 60);
+            this.button_Recovery.Size = new System.Drawing.Size(85, 35);
             this.button_Recovery.TabIndex = 2;
             this.button_Recovery.Text = "参数还原";
             this.button_Recovery.UseVisualStyleBackColor = false;
@@ -2365,10 +2395,11 @@ namespace Welling_Motor_Debug_Tool
             // 
             // button_ClearLog
             // 
-            this.button_ClearLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_ClearLog.Location = new System.Drawing.Point(152, 92);
+            this.button_ClearLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
+            this.button_ClearLog.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.button_ClearLog.Location = new System.Drawing.Point(288, 24);
             this.button_ClearLog.Name = "button_ClearLog";
-            this.button_ClearLog.Size = new System.Drawing.Size(100, 60);
+            this.button_ClearLog.Size = new System.Drawing.Size(85, 35);
             this.button_ClearLog.TabIndex = 2;
             this.button_ClearLog.Text = "记录清除";
             this.button_ClearLog.UseVisualStyleBackColor = false;
@@ -2376,10 +2407,11 @@ namespace Welling_Motor_Debug_Tool
             // 
             // button_Reset
             // 
-            this.button_Reset.BackColor = System.Drawing.Color.Lime;
-            this.button_Reset.Location = new System.Drawing.Point(21, 92);
+            this.button_Reset.BackColor = System.Drawing.Color.MediumSeaGreen;
+            this.button_Reset.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.button_Reset.Location = new System.Drawing.Point(194, 25);
             this.button_Reset.Name = "button_Reset";
-            this.button_Reset.Size = new System.Drawing.Size(100, 60);
+            this.button_Reset.Size = new System.Drawing.Size(85, 35);
             this.button_Reset.TabIndex = 2;
             this.button_Reset.Text = "系统关机";
             this.button_Reset.UseVisualStyleBackColor = false;
@@ -2387,10 +2419,11 @@ namespace Welling_Motor_Debug_Tool
             // 
             // button_SystemClear
             // 
-            this.button_SystemClear.BackColor = System.Drawing.Color.Red;
-            this.button_SystemClear.Location = new System.Drawing.Point(21, 28);
+            this.button_SystemClear.BackColor = System.Drawing.Color.Tomato;
+            this.button_SystemClear.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.button_SystemClear.Location = new System.Drawing.Point(6, 25);
             this.button_SystemClear.Name = "button_SystemClear";
-            this.button_SystemClear.Size = new System.Drawing.Size(100, 60);
+            this.button_SystemClear.Size = new System.Drawing.Size(85, 35);
             this.button_SystemClear.TabIndex = 2;
             this.button_SystemClear.Text = "系统清除";
             this.button_SystemClear.UseVisualStyleBackColor = false;
@@ -2401,7 +2434,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox8.Controls.Add(this.button_ReadOnLine);
             this.groupBox8.Controls.Add(this.textBox_Online);
             this.groupBox8.Controls.Add(this.label42);
-            this.groupBox8.Location = new System.Drawing.Point(409, 248);
+            this.groupBox8.Location = new System.Drawing.Point(350, 248);
             this.groupBox8.Name = "groupBox8";
             this.groupBox8.Size = new System.Drawing.Size(292, 64);
             this.groupBox8.TabIndex = 3;
@@ -2449,9 +2482,9 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox7.Controls.Add(this.textBox_MAC);
             this.groupBox7.Controls.Add(this.label40);
             this.groupBox7.Controls.Add(this.label41);
-            this.groupBox7.Location = new System.Drawing.Point(409, 4);
+            this.groupBox7.Location = new System.Drawing.Point(350, 4);
             this.groupBox7.Name = "groupBox7";
-            this.groupBox7.Size = new System.Drawing.Size(292, 175);
+            this.groupBox7.Size = new System.Drawing.Size(246, 175);
             this.groupBox7.TabIndex = 3;
             this.groupBox7.TabStop = false;
             this.groupBox7.Text = "生产信息";
@@ -2459,7 +2492,7 @@ namespace Welling_Motor_Debug_Tool
             // button_ReadMAC
             // 
             this.button_ReadMAC.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.button_ReadMAC.Location = new System.Drawing.Point(236, 106);
+            this.button_ReadMAC.Location = new System.Drawing.Point(183, 106);
             this.button_ReadMAC.Name = "button_ReadMAC";
             this.button_ReadMAC.Size = new System.Drawing.Size(50, 62);
             this.button_ReadMAC.TabIndex = 2;
@@ -2470,7 +2503,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteMac
             // 
             this.button_WriteMac.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteMac.Location = new System.Drawing.Point(236, 25);
+            this.button_WriteMac.Location = new System.Drawing.Point(183, 25);
             this.button_WriteMac.Name = "button_WriteMac";
             this.button_WriteMac.Size = new System.Drawing.Size(50, 62);
             this.button_WriteMac.TabIndex = 2;
@@ -2483,7 +2516,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_PP.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_PP.Location = new System.Drawing.Point(82, 140);
             this.textBox_PP.Name = "textBox_PP";
-            this.textBox_PP.Size = new System.Drawing.Size(148, 28);
+            this.textBox_PP.Size = new System.Drawing.Size(95, 28);
             this.textBox_PP.TabIndex = 1;
             // 
             // textBox_MACDate
@@ -2491,7 +2524,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_MACDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_MACDate.Location = new System.Drawing.Point(82, 102);
             this.textBox_MACDate.Name = "textBox_MACDate";
-            this.textBox_MACDate.Size = new System.Drawing.Size(148, 28);
+            this.textBox_MACDate.Size = new System.Drawing.Size(95, 28);
             this.textBox_MACDate.TabIndex = 1;
             // 
             // textBox_MACAdd
@@ -2499,7 +2532,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_MACAdd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_MACAdd.Location = new System.Drawing.Point(82, 64);
             this.textBox_MACAdd.Name = "textBox_MACAdd";
-            this.textBox_MACAdd.Size = new System.Drawing.Size(148, 28);
+            this.textBox_MACAdd.Size = new System.Drawing.Size(95, 28);
             this.textBox_MACAdd.TabIndex = 1;
             // 
             // label34
@@ -2525,7 +2558,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_MAC.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_MAC.Location = new System.Drawing.Point(82, 25);
             this.textBox_MAC.Name = "textBox_MAC";
-            this.textBox_MAC.Size = new System.Drawing.Size(148, 28);
+            this.textBox_MAC.Size = new System.Drawing.Size(95, 28);
             this.textBox_MAC.TabIndex = 1;
             // 
             // label40
@@ -2562,7 +2595,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox6.Controls.Add(this.label38);
             this.groupBox6.Location = new System.Drawing.Point(4, 185);
             this.groupBox6.Name = "groupBox6";
-            this.groupBox6.Size = new System.Drawing.Size(399, 127);
+            this.groupBox6.Size = new System.Drawing.Size(340, 127);
             this.groupBox6.TabIndex = 2;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "自定义";
@@ -2570,7 +2603,7 @@ namespace Welling_Motor_Debug_Tool
             // button_ReadUser3
             // 
             this.button_ReadUser3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.button_ReadUser3.Location = new System.Drawing.Point(287, 88);
+            this.button_ReadUser3.Location = new System.Drawing.Point(230, 89);
             this.button_ReadUser3.Name = "button_ReadUser3";
             this.button_ReadUser3.Size = new System.Drawing.Size(50, 29);
             this.button_ReadUser3.TabIndex = 5;
@@ -2581,7 +2614,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteUser3
             // 
             this.button_WriteUser3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteUser3.Location = new System.Drawing.Point(339, 88);
+            this.button_WriteUser3.Location = new System.Drawing.Point(287, 89);
             this.button_WriteUser3.Name = "button_WriteUser3";
             this.button_WriteUser3.Size = new System.Drawing.Size(50, 29);
             this.button_WriteUser3.TabIndex = 6;
@@ -2592,7 +2625,7 @@ namespace Welling_Motor_Debug_Tool
             // button_ReadUser2
             // 
             this.button_ReadUser2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.button_ReadUser2.Location = new System.Drawing.Point(287, 58);
+            this.button_ReadUser2.Location = new System.Drawing.Point(230, 59);
             this.button_ReadUser2.Name = "button_ReadUser2";
             this.button_ReadUser2.Size = new System.Drawing.Size(50, 29);
             this.button_ReadUser2.TabIndex = 3;
@@ -2603,7 +2636,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteUser2
             // 
             this.button_WriteUser2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteUser2.Location = new System.Drawing.Point(339, 58);
+            this.button_WriteUser2.Location = new System.Drawing.Point(287, 59);
             this.button_WriteUser2.Name = "button_WriteUser2";
             this.button_WriteUser2.Size = new System.Drawing.Size(50, 29);
             this.button_WriteUser2.TabIndex = 4;
@@ -2614,7 +2647,7 @@ namespace Welling_Motor_Debug_Tool
             // button_ReadUser1
             // 
             this.button_ReadUser1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.button_ReadUser1.Location = new System.Drawing.Point(287, 28);
+            this.button_ReadUser1.Location = new System.Drawing.Point(230, 29);
             this.button_ReadUser1.Name = "button_ReadUser1";
             this.button_ReadUser1.Size = new System.Drawing.Size(50, 29);
             this.button_ReadUser1.TabIndex = 2;
@@ -2625,7 +2658,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteUser1
             // 
             this.button_WriteUser1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteUser1.Location = new System.Drawing.Point(339, 28);
+            this.button_WriteUser1.Location = new System.Drawing.Point(287, 29);
             this.button_WriteUser1.Name = "button_WriteUser1";
             this.button_WriteUser1.Size = new System.Drawing.Size(50, 29);
             this.button_WriteUser1.TabIndex = 2;
@@ -2638,7 +2671,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_User3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_User3.Location = new System.Drawing.Point(29, 89);
             this.textBox_User3.Name = "textBox_User3";
-            this.textBox_User3.Size = new System.Drawing.Size(251, 28);
+            this.textBox_User3.Size = new System.Drawing.Size(195, 28);
             this.textBox_User3.TabIndex = 1;
             // 
             // textBox_User2
@@ -2646,7 +2679,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_User2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_User2.Location = new System.Drawing.Point(29, 59);
             this.textBox_User2.Name = "textBox_User2";
-            this.textBox_User2.Size = new System.Drawing.Size(251, 28);
+            this.textBox_User2.Size = new System.Drawing.Size(195, 28);
             this.textBox_User2.TabIndex = 1;
             // 
             // label35
@@ -2663,7 +2696,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_User1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_User1.Location = new System.Drawing.Point(29, 29);
             this.textBox_User1.Name = "textBox_User1";
-            this.textBox_User1.Size = new System.Drawing.Size(251, 28);
+            this.textBox_User1.Size = new System.Drawing.Size(195, 28);
             this.textBox_User1.TabIndex = 1;
             // 
             // label36
@@ -2690,7 +2723,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox5.Controls.Add(this.button_WriteKey);
             this.groupBox5.Controls.Add(this.textBox_Key);
             this.groupBox5.Controls.Add(this.label37);
-            this.groupBox5.Location = new System.Drawing.Point(409, 185);
+            this.groupBox5.Location = new System.Drawing.Point(350, 185);
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Size = new System.Drawing.Size(292, 62);
             this.groupBox5.TabIndex = 1;
@@ -2753,7 +2786,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox4.Controls.Add(this.label30);
             this.groupBox4.Location = new System.Drawing.Point(4, 4);
             this.groupBox4.Name = "groupBox4";
-            this.groupBox4.Size = new System.Drawing.Size(399, 175);
+            this.groupBox4.Size = new System.Drawing.Size(340, 175);
             this.groupBox4.TabIndex = 0;
             this.groupBox4.TabStop = false;
             this.groupBox4.Text = "版本信息";
@@ -2773,13 +2806,13 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_SP.Location = new System.Drawing.Point(56, 140);
             this.textBox_SP.Name = "textBox_SP";
             this.textBox_SP.ReadOnly = true;
-            this.textBox_SP.Size = new System.Drawing.Size(281, 28);
+            this.textBox_SP.Size = new System.Drawing.Size(224, 28);
             this.textBox_SP.TabIndex = 3;
             // 
             // button_ReadVersion
             // 
             this.button_ReadVersion.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.button_ReadVersion.Location = new System.Drawing.Point(343, 84);
+            this.button_ReadVersion.Location = new System.Drawing.Point(287, 85);
             this.button_ReadVersion.Name = "button_ReadVersion";
             this.button_ReadVersion.Size = new System.Drawing.Size(50, 83);
             this.button_ReadVersion.TabIndex = 2;
@@ -2790,7 +2823,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteSN
             // 
             this.button_WriteSN.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteSN.Location = new System.Drawing.Point(343, 52);
+            this.button_WriteSN.Location = new System.Drawing.Point(287, 53);
             this.button_WriteSN.Name = "button_WriteSN";
             this.button_WriteSN.Size = new System.Drawing.Size(50, 29);
             this.button_WriteSN.TabIndex = 2;
@@ -2801,7 +2834,7 @@ namespace Welling_Motor_Debug_Tool
             // button_WriteModel
             // 
             this.button_WriteModel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_WriteModel.Location = new System.Drawing.Point(343, 23);
+            this.button_WriteModel.Location = new System.Drawing.Point(287, 24);
             this.button_WriteModel.Name = "button_WriteModel";
             this.button_WriteModel.Size = new System.Drawing.Size(50, 29);
             this.button_WriteModel.TabIndex = 2;
@@ -2815,7 +2848,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FW.Location = new System.Drawing.Point(56, 111);
             this.textBox_FW.Name = "textBox_FW";
             this.textBox_FW.ReadOnly = true;
-            this.textBox_FW.Size = new System.Drawing.Size(281, 28);
+            this.textBox_FW.Size = new System.Drawing.Size(224, 28);
             this.textBox_FW.TabIndex = 1;
             // 
             // textBox_HW
@@ -2824,7 +2857,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_HW.Location = new System.Drawing.Point(56, 82);
             this.textBox_HW.Name = "textBox_HW";
             this.textBox_HW.ReadOnly = true;
-            this.textBox_HW.Size = new System.Drawing.Size(281, 28);
+            this.textBox_HW.Size = new System.Drawing.Size(224, 28);
             this.textBox_HW.TabIndex = 1;
             // 
             // textBox_SN
@@ -2832,7 +2865,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_SN.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_SN.Location = new System.Drawing.Point(56, 53);
             this.textBox_SN.Name = "textBox_SN";
-            this.textBox_SN.Size = new System.Drawing.Size(281, 28);
+            this.textBox_SN.Size = new System.Drawing.Size(224, 28);
             this.textBox_SN.TabIndex = 1;
             // 
             // label33
@@ -2858,7 +2891,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_Model.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_Model.Location = new System.Drawing.Point(56, 24);
             this.textBox_Model.Name = "textBox_Model";
-            this.textBox_Model.Size = new System.Drawing.Size(281, 28);
+            this.textBox_Model.Size = new System.Drawing.Size(224, 28);
             this.textBox_Model.TabIndex = 1;
             // 
             // label31
@@ -3600,6 +3633,7 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_FactoryMode.Controls.Add(this.groupBox22);
             this.tabPage_FactoryMode.Controls.Add(this.groupBox21);
             this.tabPage_FactoryMode.Controls.Add(this.groupBox20);
+            this.tabPage_FactoryMode.Controls.Add(this.groupBox24);
             this.tabPage_FactoryMode.Controls.Add(this.groupBox19);
             this.tabPage_FactoryMode.Location = new System.Drawing.Point(4, 30);
             this.tabPage_FactoryMode.Name = "tabPage_FactoryMode";
@@ -3825,7 +3859,6 @@ namespace Welling_Motor_Debug_Tool
             // 
             // groupBox22
             // 
-            this.groupBox22.Controls.Add(this.label80);
             this.groupBox22.Controls.Add(this.button_FacModeLightSW);
             this.groupBox22.Controls.Add(this.label_FacModeMotorSpeedSet);
             this.groupBox22.Controls.Add(this.label67);
@@ -3833,27 +3866,18 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox22.Controls.Add(this.button_FacModeMotorRun);
             this.groupBox22.Location = new System.Drawing.Point(190, 3);
             this.groupBox22.Name = "groupBox22";
-            this.groupBox22.Size = new System.Drawing.Size(198, 309);
+            this.groupBox22.Size = new System.Drawing.Size(198, 178);
             this.groupBox22.TabIndex = 10;
             this.groupBox22.TabStop = false;
             this.groupBox22.Text = "驱动测试";
             // 
-            // label80
-            // 
-            this.label80.BackColor = System.Drawing.Color.Silver;
-            this.label80.ForeColor = System.Drawing.Color.White;
-            this.label80.Location = new System.Drawing.Point(6, 100);
-            this.label80.Name = "label80";
-            this.label80.Size = new System.Drawing.Size(85, 1);
-            this.label80.TabIndex = 21;
-            // 
             // button_FacModeLightSW
             // 
             this.button_FacModeLightSW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.button_FacModeLightSW.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.button_FacModeLightSW.Location = new System.Drawing.Point(6, 38);
+            this.button_FacModeLightSW.Location = new System.Drawing.Point(15, 38);
             this.button_FacModeLightSW.Name = "button_FacModeLightSW";
-            this.button_FacModeLightSW.Size = new System.Drawing.Size(85, 45);
+            this.button_FacModeLightSW.Size = new System.Drawing.Size(75, 45);
             this.button_FacModeLightSW.TabIndex = 20;
             this.button_FacModeLightSW.Text = "开/关灯";
             this.button_FacModeLightSW.UseVisualStyleBackColor = false;
@@ -3865,7 +3889,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeMotorSpeedSet.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.label_FacModeMotorSpeedSet.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_FacModeMotorSpeedSet.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label_FacModeMotorSpeedSet.Location = new System.Drawing.Point(152, 70);
+            this.label_FacModeMotorSpeedSet.Location = new System.Drawing.Point(138, 91);
             this.label_FacModeMotorSpeedSet.Name = "label_FacModeMotorSpeedSet";
             this.label_FacModeMotorSpeedSet.Size = new System.Drawing.Size(40, 17);
             this.label_FacModeMotorSpeedSet.TabIndex = 19;
@@ -3876,7 +3900,7 @@ namespace Welling_Motor_Debug_Tool
             // 
             this.label67.AutoSize = true;
             this.label67.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label67.Location = new System.Drawing.Point(96, 39);
+            this.label67.Location = new System.Drawing.Point(22, 96);
             this.label67.Name = "label67";
             this.label67.Size = new System.Drawing.Size(56, 17);
             this.label67.TabIndex = 18;
@@ -3885,22 +3909,21 @@ namespace Welling_Motor_Debug_Tool
             // trackBar_FacModeMotorSpeedAdj
             // 
             this.trackBar_FacModeMotorSpeedAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
-            this.trackBar_FacModeMotorSpeedAdj.Location = new System.Drawing.Point(97, 63);
+            this.trackBar_FacModeMotorSpeedAdj.Location = new System.Drawing.Point(15, 116);
             this.trackBar_FacModeMotorSpeedAdj.Maximum = 100;
             this.trackBar_FacModeMotorSpeedAdj.Name = "trackBar_FacModeMotorSpeedAdj";
-            this.trackBar_FacModeMotorSpeedAdj.Orientation = System.Windows.Forms.Orientation.Vertical;
-            this.trackBar_FacModeMotorSpeedAdj.Size = new System.Drawing.Size(45, 240);
+            this.trackBar_FacModeMotorSpeedAdj.Size = new System.Drawing.Size(163, 45);
             this.trackBar_FacModeMotorSpeedAdj.TabIndex = 17;
-            this.trackBar_FacModeMotorSpeedAdj.TickStyle = System.Windows.Forms.TickStyle.Both;
+            this.trackBar_FacModeMotorSpeedAdj.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
             this.trackBar_FacModeMotorSpeedAdj.ValueChanged += new System.EventHandler(this.trackBar_FacModeMotorSpeedAdj_ValueChanged);
             // 
             // button_FacModeMotorRun
             // 
             this.button_FacModeMotorRun.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.button_FacModeMotorRun.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.button_FacModeMotorRun.Location = new System.Drawing.Point(6, 116);
+            this.button_FacModeMotorRun.Location = new System.Drawing.Point(103, 38);
             this.button_FacModeMotorRun.Name = "button_FacModeMotorRun";
-            this.button_FacModeMotorRun.Size = new System.Drawing.Size(85, 45);
+            this.button_FacModeMotorRun.Size = new System.Drawing.Size(75, 45);
             this.button_FacModeMotorRun.TabIndex = 16;
             this.button_FacModeMotorRun.Text = "启/停";
             this.button_FacModeMotorRun.UseVisualStyleBackColor = false;
@@ -5554,20 +5577,12 @@ namespace Welling_Motor_Debug_Tool
             this.label_Computername.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.label_Computername.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
             this.label_Computername.ForeColor = System.Drawing.Color.White;
-            this.label_Computername.Location = new System.Drawing.Point(700, 4);
+            this.label_Computername.Location = new System.Drawing.Point(750, 4);
             this.label_Computername.Name = "label_Computername";
-            this.label_Computername.Size = new System.Drawing.Size(190, 21);
+            this.label_Computername.Size = new System.Drawing.Size(140, 21);
             this.label_Computername.TabIndex = 21;
-            this.label_Computername.Text = "用户名:";
-            // 
-            // label46
-            // 
-            this.label46.BackColor = System.Drawing.Color.Silver;
-            this.label46.ForeColor = System.Drawing.Color.White;
-            this.label46.Location = new System.Drawing.Point(692, 7);
-            this.label46.Name = "label46";
-            this.label46.Size = new System.Drawing.Size(1, 15);
-            this.label46.TabIndex = 22;
+            this.label_Computername.Text = "计算机名:";
+            this.label_Computername.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
             // tabControl2
             // 
@@ -6303,16 +6318,271 @@ namespace Welling_Motor_Debug_Tool
             this.pictureBox2.TabIndex = 16;
             this.pictureBox2.TabStop = false;
             // 
+            // label_UserName
+            // 
+            this.label_UserName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label_UserName.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.label_UserName.ForeColor = System.Drawing.Color.White;
+            this.label_UserName.Location = new System.Drawing.Point(580, 4);
+            this.label_UserName.Name = "label_UserName";
+            this.label_UserName.Size = new System.Drawing.Size(140, 21);
+            this.label_UserName.TabIndex = 21;
+            this.label_UserName.Text = "用户名:";
+            this.label_UserName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label124
+            // 
+            this.label124.BackColor = System.Drawing.Color.Silver;
+            this.label124.ForeColor = System.Drawing.Color.White;
+            this.label124.Location = new System.Drawing.Point(568, 7);
+            this.label124.Name = "label124";
+            this.label124.Size = new System.Drawing.Size(1, 15);
+            this.label124.TabIndex = 25;
+            // 
+            // label46
+            // 
+            this.label46.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label46.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.label46.ForeColor = System.Drawing.Color.White;
+            this.label46.Location = new System.Drawing.Point(726, 4);
+            this.label46.Name = "label46";
+            this.label46.Size = new System.Drawing.Size(23, 21);
+            this.label46.TabIndex = 21;
+            this.label46.Text = "/";
+            // 
+            // groupBox23
+            // 
+            this.groupBox23.Controls.Add(this.button_ReadTag);
+            this.groupBox23.Controls.Add(this.button_WriteTag);
+            this.groupBox23.Controls.Add(this.textBox_TagInfo);
+            this.groupBox23.Location = new System.Drawing.Point(602, 72);
+            this.groupBox23.Name = "groupBox23";
+            this.groupBox23.Size = new System.Drawing.Size(381, 107);
+            this.groupBox23.TabIndex = 4;
+            this.groupBox23.TabStop = false;
+            this.groupBox23.Text = "产品标签";
+            // 
+            // textBox_TagInfo
+            // 
+            this.textBox_TagInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TagInfo.Location = new System.Drawing.Point(9, 35);
+            this.textBox_TagInfo.Name = "textBox_TagInfo";
+            this.textBox_TagInfo.Size = new System.Drawing.Size(364, 28);
+            this.textBox_TagInfo.TabIndex = 1;
+            // 
+            // button_WriteTag
+            // 
+            this.button_WriteTag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.button_WriteTag.Location = new System.Drawing.Point(323, 67);
+            this.button_WriteTag.Name = "button_WriteTag";
+            this.button_WriteTag.Size = new System.Drawing.Size(50, 29);
+            this.button_WriteTag.TabIndex = 2;
+            this.button_WriteTag.Text = "写入";
+            this.button_WriteTag.UseVisualStyleBackColor = false;
+            this.button_WriteTag.Click += new System.EventHandler(this.button_WriteTag_Click);
+            // 
+            // button_ReadTag
+            // 
+            this.button_ReadTag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.button_ReadTag.Location = new System.Drawing.Point(268, 67);
+            this.button_ReadTag.Name = "button_ReadTag";
+            this.button_ReadTag.Size = new System.Drawing.Size(50, 29);
+            this.button_ReadTag.TabIndex = 2;
+            this.button_ReadTag.Text = "查询";
+            this.button_ReadTag.UseVisualStyleBackColor = false;
+            this.button_ReadTag.Click += new System.EventHandler(this.button_ReadTag_Click);
+            // 
+            // groupBox24
+            // 
+            this.groupBox24.Controls.Add(this.button_ReadRideLog);
+            this.groupBox24.Controls.Add(this.button_WriteRideLog);
+            this.groupBox24.Controls.Add(this.textBox_TRIP_KM);
+            this.groupBox24.Controls.Add(this.textBox_TRIP_TIME);
+            this.groupBox24.Controls.Add(this.textBox_ODO_KM);
+            this.groupBox24.Controls.Add(this.textBox_ODO_TIME);
+            this.groupBox24.Controls.Add(this.label126);
+            this.groupBox24.Controls.Add(this.label119);
+            this.groupBox24.Location = new System.Drawing.Point(189, 187);
+            this.groupBox24.Name = "groupBox24";
+            this.groupBox24.Size = new System.Drawing.Size(199, 125);
+            this.groupBox24.TabIndex = 7;
+            this.groupBox24.TabStop = false;
+            this.groupBox24.Text = "骑行信息";
+            // 
+            // textBox_ODO_KM
+            // 
+            this.textBox_ODO_KM.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_ODO_KM.Location = new System.Drawing.Point(63, 30);
+            this.textBox_ODO_KM.Name = "textBox_ODO_KM";
+            this.textBox_ODO_KM.Size = new System.Drawing.Size(60, 28);
+            this.textBox_ODO_KM.TabIndex = 15;
+            this.textBox_ODO_KM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // textBox_ODO_TIME
+            // 
+            this.textBox_ODO_TIME.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_ODO_TIME.Location = new System.Drawing.Point(129, 30);
+            this.textBox_ODO_TIME.Name = "textBox_ODO_TIME";
+            this.textBox_ODO_TIME.Size = new System.Drawing.Size(60, 28);
+            this.textBox_ODO_TIME.TabIndex = 15;
+            this.textBox_ODO_TIME.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // textBox_TRIP_TIME
+            // 
+            this.textBox_TRIP_TIME.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TRIP_TIME.Location = new System.Drawing.Point(129, 60);
+            this.textBox_TRIP_TIME.Name = "textBox_TRIP_TIME";
+            this.textBox_TRIP_TIME.Size = new System.Drawing.Size(60, 28);
+            this.textBox_TRIP_TIME.TabIndex = 15;
+            this.textBox_TRIP_TIME.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // textBox_TRIP_KM
+            // 
+            this.textBox_TRIP_KM.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TRIP_KM.Location = new System.Drawing.Point(63, 60);
+            this.textBox_TRIP_KM.Name = "textBox_TRIP_KM";
+            this.textBox_TRIP_KM.Size = new System.Drawing.Size(60, 28);
+            this.textBox_TRIP_KM.TabIndex = 15;
+            this.textBox_TRIP_KM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label119
+            // 
+            this.label119.AutoSize = true;
+            this.label119.Location = new System.Drawing.Point(6, 34);
+            this.label119.Name = "label119";
+            this.label119.Size = new System.Drawing.Size(48, 21);
+            this.label119.TabIndex = 3;
+            this.label119.Text = "ODO";
+            // 
+            // label126
+            // 
+            this.label126.AutoSize = true;
+            this.label126.Location = new System.Drawing.Point(6, 64);
+            this.label126.Name = "label126";
+            this.label126.Size = new System.Drawing.Size(44, 21);
+            this.label126.TabIndex = 3;
+            this.label126.Text = "TRIP";
+            // 
+            // button_ReadRideLog
+            // 
+            this.button_ReadRideLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.button_ReadRideLog.Location = new System.Drawing.Point(63, 92);
+            this.button_ReadRideLog.Name = "button_ReadRideLog";
+            this.button_ReadRideLog.Size = new System.Drawing.Size(60, 29);
+            this.button_ReadRideLog.TabIndex = 16;
+            this.button_ReadRideLog.Text = "查询";
+            this.button_ReadRideLog.UseVisualStyleBackColor = false;
+            this.button_ReadRideLog.Click += new System.EventHandler(this.button_ReadRideLog_Click);
+            // 
+            // button_WriteRideLog
+            // 
+            this.button_WriteRideLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.button_WriteRideLog.Location = new System.Drawing.Point(129, 92);
+            this.button_WriteRideLog.Name = "button_WriteRideLog";
+            this.button_WriteRideLog.Size = new System.Drawing.Size(60, 29);
+            this.button_WriteRideLog.TabIndex = 17;
+            this.button_WriteRideLog.Text = "写入";
+            this.button_WriteRideLog.UseVisualStyleBackColor = false;
+            this.button_WriteRideLog.Click += new System.EventHandler(this.button_WriteRideLog_Click);
+            // 
+            // tabPage_BikeParam2
+            // 
+            this.tabPage_BikeParam2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.tabPage_BikeParam2.Controls.Add(this.button_WriteBikeParam2);
+            this.tabPage_BikeParam2.Controls.Add(this.button_ReadBikeParam2);
+            this.tabPage_BikeParam2.Controls.Add(this.richTextBox_BikeParam2);
+            this.tabPage_BikeParam2.Location = new System.Drawing.Point(4, 30);
+            this.tabPage_BikeParam2.Name = "tabPage_BikeParam2";
+            this.tabPage_BikeParam2.Size = new System.Drawing.Size(990, 315);
+            this.tabPage_BikeParam2.TabIndex = 13;
+            this.tabPage_BikeParam2.Text = "整车信息2";
+            // 
+            // tabPage_UsrRideParam
+            // 
+            this.tabPage_UsrRideParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.tabPage_UsrRideParam.Controls.Add(this.button_WriteUsrRidetParam);
+            this.tabPage_UsrRideParam.Controls.Add(this.button_ReadUsrRideParam);
+            this.tabPage_UsrRideParam.Controls.Add(this.richTextBox_UsrRidesParam);
+            this.tabPage_UsrRideParam.Location = new System.Drawing.Point(4, 30);
+            this.tabPage_UsrRideParam.Name = "tabPage_UsrRideParam";
+            this.tabPage_UsrRideParam.Size = new System.Drawing.Size(990, 315);
+            this.tabPage_UsrRideParam.TabIndex = 14;
+            this.tabPage_UsrRideParam.Text = "用户骑行参数";
+            // 
+            // button_WriteBikeParam2
+            // 
+            this.button_WriteBikeParam2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.button_WriteBikeParam2.Location = new System.Drawing.Point(858, 259);
+            this.button_WriteBikeParam2.Name = "button_WriteBikeParam2";
+            this.button_WriteBikeParam2.Size = new System.Drawing.Size(126, 50);
+            this.button_WriteBikeParam2.TabIndex = 7;
+            this.button_WriteBikeParam2.Text = "写入参数";
+            this.button_WriteBikeParam2.UseVisualStyleBackColor = false;
+            this.button_WriteBikeParam2.Click += new System.EventHandler(this.button_WriteBikeParam2_Click);
+            // 
+            // button_ReadBikeParam2
+            // 
+            this.button_ReadBikeParam2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.button_ReadBikeParam2.Location = new System.Drawing.Point(858, 203);
+            this.button_ReadBikeParam2.Name = "button_ReadBikeParam2";
+            this.button_ReadBikeParam2.Size = new System.Drawing.Size(126, 50);
+            this.button_ReadBikeParam2.TabIndex = 6;
+            this.button_ReadBikeParam2.Text = "读取参数";
+            this.button_ReadBikeParam2.UseVisualStyleBackColor = false;
+            this.button_ReadBikeParam2.Click += new System.EventHandler(this.button_ReadBikeParam2_Click);
+            // 
+            // richTextBox_BikeParam2
+            // 
+            this.richTextBox_BikeParam2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.richTextBox_BikeParam2.Location = new System.Drawing.Point(6, 6);
+            this.richTextBox_BikeParam2.Name = "richTextBox_BikeParam2";
+            this.richTextBox_BikeParam2.Size = new System.Drawing.Size(846, 303);
+            this.richTextBox_BikeParam2.TabIndex = 5;
+            this.richTextBox_BikeParam2.Text = "";
+            // 
+            // button_WriteUsrRidetParam
+            // 
+            this.button_WriteUsrRidetParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.button_WriteUsrRidetParam.Location = new System.Drawing.Point(858, 259);
+            this.button_WriteUsrRidetParam.Name = "button_WriteUsrRidetParam";
+            this.button_WriteUsrRidetParam.Size = new System.Drawing.Size(126, 50);
+            this.button_WriteUsrRidetParam.TabIndex = 7;
+            this.button_WriteUsrRidetParam.Text = "写入参数";
+            this.button_WriteUsrRidetParam.UseVisualStyleBackColor = false;
+            this.button_WriteUsrRidetParam.Click += new System.EventHandler(this.button_WriteUsrRidetParam_Click);
+            // 
+            // button_ReadUsrRideParam
+            // 
+            this.button_ReadUsrRideParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.button_ReadUsrRideParam.Location = new System.Drawing.Point(858, 203);
+            this.button_ReadUsrRideParam.Name = "button_ReadUsrRideParam";
+            this.button_ReadUsrRideParam.Size = new System.Drawing.Size(126, 50);
+            this.button_ReadUsrRideParam.TabIndex = 6;
+            this.button_ReadUsrRideParam.Text = "读取参数";
+            this.button_ReadUsrRideParam.UseVisualStyleBackColor = false;
+            this.button_ReadUsrRideParam.Click += new System.EventHandler(this.button_ReadUsrRideParam_Click);
+            // 
+            // richTextBox_UsrRidesParam
+            // 
+            this.richTextBox_UsrRidesParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.richTextBox_UsrRidesParam.Location = new System.Drawing.Point(6, 6);
+            this.richTextBox_UsrRidesParam.Name = "richTextBox_UsrRidesParam";
+            this.richTextBox_UsrRidesParam.Size = new System.Drawing.Size(846, 303);
+            this.richTextBox_UsrRidesParam.TabIndex = 5;
+            this.richTextBox_UsrRidesParam.Text = "";
+            // 
             // mainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.ClientSize = new System.Drawing.Size(1034, 641);
+            this.Controls.Add(this.label124);
             this.Controls.Add(this.tabControl2);
             this.Controls.Add(this.groupBox3);
             this.Controls.Add(this.label_StarInfo);
             this.Controls.Add(this.label46);
+            this.Controls.Add(this.label_UserName);
             this.Controls.Add(this.label_Computername);
             this.Controls.Add(this.label_PortStatus);
             this.Controls.Add(this.label_ServerStatus);
@@ -6427,6 +6697,12 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_DebugInfo.ResumeLayout(false);
             this.tabPage_DebugInfo.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            this.groupBox23.ResumeLayout(false);
+            this.groupBox23.PerformLayout();
+            this.groupBox24.ResumeLayout(false);
+            this.groupBox24.PerformLayout();
+            this.tabPage_BikeParam2.ResumeLayout(false);
+            this.tabPage_UsrRideParam.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -6738,7 +7014,6 @@ namespace Welling_Motor_Debug_Tool
         private Button button_ScanCode;
         private TabPage tabPage_ProductMode_Write;
         private Label label_Computername;
-        private Label label46;
         private TabControl tabControl2;
         private TabPage tabPage_RunInfo;
         private TextBox textBox_RunInfo_BikeSpeed;
@@ -6953,11 +7228,34 @@ namespace Welling_Motor_Debug_Tool
         private Button button_MOS_Write;
         private Button button_MOS_Read;
         private Button button_MOS_Cal;
-        private Label label80;
         private Label label79;
         private Label label78;
         private ToolStripMenuItem uART协议ToolStripMenuItem;
         private ToolStripComboBox 协议类型ToolStripMenuItem;
         private ToolStripMenuItem 本机信息ToolStripMenuItem;
+        private Label label_UserName;
+        private Label label124;
+        private Label label46;
+        private GroupBox groupBox23;
+        private TextBox textBox_TagInfo;
+        private Button button_ReadTag;
+        private Button button_WriteTag;
+        private GroupBox groupBox24;
+        private Button button_ReadRideLog;
+        private Button button_WriteRideLog;
+        private TextBox textBox_TRIP_KM;
+        private TextBox textBox_TRIP_TIME;
+        private TextBox textBox_ODO_KM;
+        private TextBox textBox_ODO_TIME;
+        private Label label126;
+        private Label label119;
+        private TabPage tabPage_BikeParam2;
+        private TabPage tabPage_UsrRideParam;
+        private Button button_WriteBikeParam2;
+        private Button button_ReadBikeParam2;
+        private RichTextBox richTextBox_BikeParam2;
+        private Button button_WriteUsrRidetParam;
+        private Button button_ReadUsrRideParam;
+        private RichTextBox richTextBox_UsrRidesParam;
     }
 }

+ 253 - 23
Welling_Motor_Debug_Tool/mainForm.cs

@@ -633,22 +633,7 @@ namespace Welling_Motor_Debug_Tool
                 {
                     System.Environment.Exit(0);
                 }
-            } while (true);            
-
-            //端口自动连接           
-            if ((PortNumSave != string.Empty) && (PortBaudrateSave != string.Empty)) //有数值时采用上次使用的值
-            {
-                try
-                {
-                    PortConnect();
-                }
-                catch (System.Exception)
-                {
-                    timer_1s.Enabled = false;
-                    MessageBox.Show("参数格式错误,写入默认值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    timer_1s.Enabled = true;
-                }
-            }
+            } while (true);                        
 
             //配置网络FTP服务器
             myFtp.FtpOption(toolStripTextBox_ServerIP.Text, toolStripTextBox_ServerPort.Text, toolStripTextBox_ServerUser.Text, toolStripTextBox_ServerPasswd.Text, "admin", "ttium_admin");
@@ -712,7 +697,7 @@ namespace Welling_Motor_Debug_Tool
                 //创建定时器,定时10s检查网络
                 System.Timers.Timer timer_CheckNet = new System.Timers.Timer();
                 timer_CheckNet.Enabled = true;
-                timer_CheckNet.Interval = 10000;
+                timer_CheckNet.Interval = 30000;
                 timer_CheckNet.Elapsed += new System.Timers.ElapsedEventHandler(this.timer_CheckNet_Tick);
                 timer_CheckNet.Start();
                 while (true)
@@ -781,9 +766,67 @@ namespace Welling_Motor_Debug_Tool
         {
             //页面初始化
             label_BuildTime.Text = "编译时间:" + System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString("yyyy-MM-dd HH:mm:ss");
-            label_Computername.Text = "用户名:" + System.Environment.UserName;
+            label_Computername.Text = System.Environment.UserName;
+            label_UserName.Text = EnterForm1.comboBox_User.Text;
             this.Text += Version;
 
+            //检查版本,自动更新
+            do
+            {
+                //检查网络状态
+                if (myFtp.CheckFtp() == false)
+                {
+                    break; ;
+                }
+                else
+                {
+                    //检查本地文件删除            
+                    if (System.IO.File.Exists(localInfo.LocalPath + "\\Version"))
+                        System.IO.File.Delete(localInfo.LocalPath + "\\Version");
+                    //读取最新版本号
+                    myFtp.DownloadFile("/Tools/Welling_Motor_Debug_Tool/Version", localInfo.LocalPath);
+                    StreamReader objReader = new StreamReader(localInfo.LocalPath + "\\Version");
+                    string sLine = "";
+                    ArrayList arrText = new ArrayList();//创建一个动态数组
+                    while (sLine != null)
+                    {
+                        sLine = objReader.ReadLine();
+                        arrText.Add(sLine);
+                    }
+                    objReader.Close();
+                    System.IO.File.Delete(localInfo.LocalPath + "\\Version");
+                    //检查是否有最新版本
+                    string[] VerOld = mainForm.Version.Trim().Split('.');
+                    string[] VerNew = arrText[0].ToString().Trim().Split('.');
+                    if (Convert.ToInt16(VerNew[0]) <= Convert.ToInt16(VerOld[0]))
+                    {
+                        if (Convert.ToInt16(VerNew[1]) <= Convert.ToInt16(VerOld[1]))
+                        {
+                            if (Convert.ToInt16(VerNew[2]) <= Convert.ToInt16(VerOld[2]))
+                            {
+                                //版本已是最新,跳出
+                                break;
+                            }
+                        }
+                    }
+                    //确认下载最新版本
+                    if (MessageBox.Show("是否更新新版本?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+                    {
+                        string SavePath = Directory.GetCurrentDirectory();
+                        string[] FileList = myFtp.GetFileNameList("/Tools/Welling_Motor_Debug_Tool");
+                        foreach (string file in FileList)
+                        {
+                            if (file.Contains(".exe"))
+                            {
+                                myFtp.DownloadFile("/Tools/Welling_Motor_Debug_Tool/" + file, SavePath);
+                                MessageBox.Show("新版本下载完成,请手动删除旧版本!\r\n最新版本:" + file, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                                System.Environment.Exit(0);
+                            }
+                        }
+                    }                    
+                }
+            } while (false);
+
             //下拉控件初始值设定
             comboBox_WorkMode.SelectedIndex = 0;
             comboBox_GearSt.SelectedIndex = 0;
@@ -798,7 +841,22 @@ namespace Welling_Motor_Debug_Tool
             this.comboBox_GearSt.SelectedIndexChanged += new System.EventHandler(this.comboBox_GearSt_SelectedIndexChanged);
             this.comboBox_LightSwitch.SelectedIndexChanged += new System.EventHandler(this.comboBox_GearSt_SelectedIndexChanged);
             this.comboBox_OBC_SetGearST.SelectedIndexChanged += new System.EventHandler(this.comboBox_OBC_SetGearST_SelectedIndexChanged);
-            this.comboBox_OBC_LightSw.SelectedIndexChanged += new System.EventHandler(this.comboBox_OBC_SetGearST_SelectedIndexChanged);            
+            this.comboBox_OBC_LightSw.SelectedIndexChanged += new System.EventHandler(this.comboBox_OBC_SetGearST_SelectedIndexChanged);
+
+            //端口自动连接           
+            if ((PortNumSave != string.Empty) && (PortBaudrateSave != string.Empty)) //有数值时采用上次使用的值
+            {
+                try
+                {
+                    PortConnect();
+                }
+                catch (System.Exception)
+                {
+                    timer_1s.Enabled = false;
+                    MessageBox.Show("参数格式错误,写入默认值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    timer_1s.Enabled = true;
+                }
+            }
 
             //创建线程,定时解析数据
             Thread th = new Thread(Task_SerialProcess);
@@ -5023,7 +5081,7 @@ namespace Welling_Motor_Debug_Tool
             string CfgFileInfo = "";
             CfgFileInfo += "[PortSet]" + "\r\n";
             CfgFileInfo += "PortNum:" + toolStripComboBox_ComNum.Text + "\r\n";
-            CfgFileInfo += "PortBaudrate:" + toolStripComboBox_Baudrate.Text + "\r\n";
+            CfgFileInfo += "PortBaudrate:" + "115200" + "\r\n";
             CfgFileInfo += "AutoOn:" + 连接开机ToolStripMenuItem.Checked.ToString() + "\r\n";
             CfgFileInfo += "AutoOff:" + 断开关机ToolStripMenuItem.Checked.ToString() + "\r\n";
             CfgFileInfo += "CheckCDL:" + 识别通讯盒ToolStripMenuItem.Checked.ToString() + "\r\n";
@@ -5176,7 +5234,7 @@ namespace Welling_Motor_Debug_Tool
                         string Model = InfoList[0];
                         string Spec = InfoList[1];
                         string Sn = InfoList[2];
-                        InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
+                        InfoList[0] = Model.Replace("-", "").Replace("Q12", "QA").Replace("Q15", "QB").Replace("Q18", "QC").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
                         InfoList[1] = Sn;
                     }
                 }
@@ -5850,7 +5908,7 @@ namespace Welling_Motor_Debug_Tool
                             string Model = InfoList[0];
                             string Spec = InfoList[1];
                             string Sn = InfoList[2];
-                            InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
+                            InfoList[0] = Model.Replace("-", "").Replace("Q12", "QA").Replace("Q15", "QB").Replace("Q18", "QC").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
                             InfoList[1] = Sn;
                         }
                     }
@@ -7178,7 +7236,7 @@ namespace Welling_Motor_Debug_Tool
                         string Model = InfoList[0];
                         string Spec = InfoList[1];
                         string Sn = InfoList[2];
-                        InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
+                        InfoList[0] = Model.Replace("-", "").Replace("Q12", "QA").Replace("Q15", "QB").Replace("Q18", "QC").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
                         InfoList[1] = Sn;
                     }
                 }
@@ -7956,5 +8014,177 @@ namespace Welling_Motor_Debug_Tool
             }
         }
 
+        /// <summary>
+        /// 读取整车信息2
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_ReadBikeParam2_Click(object sender, EventArgs e)
+        {
+            richTextBox_BikeParam2.Clear();
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4C00, null);
+        }
+
+        /// <summary>
+        /// 写入整车信息2
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_WriteBikeParam2_Click(object sender, EventArgs e)
+        {
+            var ConfigParam = new byte[34];
+            for (int i = 0; i < 34; i++)
+                ConfigParam[i] = 0;
+            ConfigParam[0] = (byte)((写入存储ToolStripMenuItem.Checked) ? 0x01 : 0x00);
+
+            string[] strDataTemp = richTextBox_BikeParam2.Text.Split(new string[] { ", " }, StringSplitOptions.None);
+            try
+            {
+                for (int i = 0; i < strDataTemp.Length; i++)
+                {
+                    short wDataTemp = 0;                    
+                    wDataTemp = Convert.ToInt16(strDataTemp[i].Split('=')[1]);
+                    wDataTemp = Convert.ToInt16(strDataTemp[i].Split('=')[1]);
+                    ConfigParam[2 * i + 2] = (byte)wDataTemp;
+                    ConfigParam[2 * i + 3] = (byte)(wDataTemp >> 8);
+                }
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4D22, ConfigParam);
+            }
+            catch (Exception)
+            {
+                timer_1s.Enabled = false;
+                MessageBox.Show("数据格式不正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                timer_1s.Enabled = true;
+            }
+        }
+
+        /// <summary>
+        /// 读取用户骑行参数
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_ReadUsrRideParam_Click(object sender, EventArgs e)
+        {
+            richTextBox_UsrRidesParam.Clear();
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4A00, null);
+        }
+
+        /// <summary>
+        /// 写入用户骑行参数
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_WriteUsrRidetParam_Click(object sender, EventArgs e)
+        {
+            var ConfigParam = new byte[34];
+            for (int i = 0; i < 34; i++)
+                ConfigParam[i] = 0;
+            ConfigParam[0] = (byte)((写入存储ToolStripMenuItem.Checked) ? 0x01 : 0x00);
+
+            string[] strDataTemp = richTextBox_UsrRidesParam.Text.Split(new string[] { ", " }, StringSplitOptions.None);
+            try
+            {
+                for (int i = 0; i < strDataTemp.Length; i++)
+                {
+                    short wDataTemp = 0;
+                    wDataTemp = Convert.ToInt16(strDataTemp[i].Split('=')[1]);
+                    wDataTemp = Convert.ToInt16(strDataTemp[i].Split('=')[1]);
+                    ConfigParam[2 * i + 2] = (byte)wDataTemp;
+                    ConfigParam[2 * i + 3] = (byte)(wDataTemp >> 8);
+                }
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x4B22, ConfigParam);
+            }
+            catch (Exception)
+            {
+                timer_1s.Enabled = false;
+                MessageBox.Show("数据格式不正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                timer_1s.Enabled = true;
+            }
+        }
+
+        /// <summary>
+        /// 读取产品标签
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_ReadTag_Click(object sender, EventArgs e)
+        {
+            textBox_TagInfo.Text = "---";
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4E00, null);
+        }
+
+        /// <summary>
+        /// 写入产品标签
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_WriteTag_Click(object sender, EventArgs e)
+        {
+            string User = textBox_User1.Text;
+            var UserArray = new byte[32];
+
+            for (ushort i = 0; i < User.Length; i++)
+            {
+                UserArray[i] = (byte)User[i];
+            }
+            if (User.Length < 32)
+            {
+                UserArray[User.Length] = (byte)'.';
+                for (ushort i = 0; i < 32 - User.Length - 1; i++)
+                {
+                    UserArray[User.Length + 1 + i] = 0x20;
+                }
+            }
+
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0xBB20, UserArray);
+        }
+
+        /// <summary>
+        /// 上位机读取骑行历史
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_ReadRideLog_Click(object sender, EventArgs e)
+        {
+            textBox_ODO_KM.Text = "---";
+            textBox_ODO_TIME.Text = "---";
+            textBox_TRIP_KM.Text = "---";
+            textBox_TRIP_TIME.Text = "---";
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x2E00, null);
+        }
+
+        /// <summary>
+        /// 上位机写入骑行历史
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button_WriteRideLog_Click(object sender, EventArgs e)
+        {
+            UInt32 Data;
+            var UserArray = new byte[16];
+
+            Data = Convert.ToUInt32(textBox_ODO_KM.Text);
+            UserArray[0] = (byte)(Data & 0xFF);
+            UserArray[1] = (byte)(Data >> 8);
+            UserArray[2] = (byte)(Data >> 16);
+            UserArray[3] = (byte)(Data >> 24);
+            Data = Convert.ToUInt32(textBox_ODO_TIME.Text);
+            UserArray[4] = (byte)(Data & 0xFF);
+            UserArray[5] = (byte)(Data >> 8);
+            UserArray[6] = (byte)(Data >> 16);
+            UserArray[7] = (byte)(Data >> 24);
+            Data = Convert.ToUInt32(textBox_TRIP_KM.Text);
+            UserArray[8] = (byte)(Data & 0xFF);
+            UserArray[9] = (byte)(Data >> 8);
+            UserArray[10] = (byte)(Data >> 16);
+            UserArray[11] = (byte)(Data >> 24);
+            Data = Convert.ToUInt32(textBox_TRIP_TIME.Text);
+            UserArray[12] = (byte)(Data & 0xFF);
+            UserArray[13] = (byte)(Data >> 8);
+            UserArray[14] = (byte)(Data >> 16);
+            UserArray[15] = (byte)(Data >> 24);
+
+            mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0xBB20, UserArray);
+        }
     }
 }

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