Просмотр исходного кода

1、测试和检验时,增加检查boot功能;
2、测试和检验页面增加OK计数,清除流水时需要工程账号登陆;
3、测试和检验页面关闭时,自动删除cfg目录下文件;
4、生成参数时,增加根据型号自动填写关键参数;
5、增加越南账户,根据越南账户登陆时,默认不执行系统清除

dail 3 лет назад
Родитель
Сommit
a5be19f365

BIN
.vs/MOTINOVA_Motor_Factory_Set/v17/.suo


+ 48 - 12
CheckForm.Designer.cs

@@ -81,6 +81,8 @@
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label_TestUser = new System.Windows.Forms.Label();
             this.label31 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label_OK_Count = new System.Windows.Forms.Label();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -214,13 +216,15 @@
             // comboBox_cfgFileDate
             // 
             this.comboBox_cfgFileDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_cfgFileDate.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.comboBox_cfgFileDate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_cfgFileDate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.comboBox_cfgFileDate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.comboBox_cfgFileDate.FormattingEnabled = true;
             this.comboBox_cfgFileDate.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.comboBox_cfgFileDate.Location = new System.Drawing.Point(10, 26);
             this.comboBox_cfgFileDate.Name = "comboBox_cfgFileDate";
-            this.comboBox_cfgFileDate.Size = new System.Drawing.Size(144, 29);
+            this.comboBox_cfgFileDate.Size = new System.Drawing.Size(144, 30);
             this.comboBox_cfgFileDate.TabIndex = 3;
             this.comboBox_cfgFileDate.SelectionChangeCommitted += new System.EventHandler(this.comboBox_cfgFileDate_SelectionChangeCommitted);
             // 
@@ -238,13 +242,15 @@
             // comboBox_File
             // 
             this.comboBox_File.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_File.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.comboBox_File.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_File.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.comboBox_File.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.comboBox_File.FormattingEnabled = true;
             this.comboBox_File.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.comboBox_File.Location = new System.Drawing.Point(160, 26);
             this.comboBox_File.Name = "comboBox_File";
-            this.comboBox_File.Size = new System.Drawing.Size(725, 29);
+            this.comboBox_File.Size = new System.Drawing.Size(725, 30);
             this.comboBox_File.TabIndex = 1;
             this.comboBox_File.SelectionChangeCommitted += new System.EventHandler(this.comboBox_File_SelectionChangeCommitted);
             // 
@@ -425,7 +431,7 @@
             // 
             this.label_error_code.BackColor = System.Drawing.Color.Green;
             this.label_error_code.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_error_code.Location = new System.Drawing.Point(478, 151);
+            this.label_error_code.Location = new System.Drawing.Point(590, 152);
             this.label_error_code.Name = "label_error_code";
             this.label_error_code.Size = new System.Drawing.Size(105, 30);
             this.label_error_code.TabIndex = 3;
@@ -437,7 +443,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label1.Location = new System.Drawing.Point(501, 124);
+            this.label1.Location = new System.Drawing.Point(613, 115);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(58, 21);
             this.label1.TabIndex = 0;
@@ -467,15 +473,13 @@
             // 
             // groupBox5
             // 
-            this.groupBox5.Controls.Add(this.label32);
-            this.groupBox5.Controls.Add(this.label_SerialNum);
             this.groupBox5.Controls.Add(this.button_Start);
             this.groupBox5.Controls.Add(this.label4);
             this.groupBox5.Controls.Add(this.textBox_PDinfo);
             this.groupBox5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.groupBox5.Location = new System.Drawing.Point(12, 103);
             this.groupBox5.Name = "groupBox5";
-            this.groupBox5.Size = new System.Drawing.Size(460, 86);
+            this.groupBox5.Size = new System.Drawing.Size(378, 86);
             this.groupBox5.TabIndex = 17;
             this.groupBox5.TabStop = false;
             this.groupBox5.Text = "操作";
@@ -486,7 +490,7 @@
             this.label32.BackColor = System.Drawing.Color.White;
             this.label32.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label32.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label32.Location = new System.Drawing.Point(280, 24);
+            this.label32.Location = new System.Drawing.Point(409, 125);
             this.label32.Name = "label32";
             this.label32.Size = new System.Drawing.Size(58, 21);
             this.label32.TabIndex = 18;
@@ -499,7 +503,7 @@
             this.label_SerialNum.BackColor = System.Drawing.Color.White;
             this.label_SerialNum.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_SerialNum.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label_SerialNum.Location = new System.Drawing.Point(269, 51);
+            this.label_SerialNum.Location = new System.Drawing.Point(398, 152);
             this.label_SerialNum.Name = "label_SerialNum";
             this.label_SerialNum.Size = new System.Drawing.Size(80, 29);
             this.label_SerialNum.TabIndex = 19;
@@ -510,7 +514,7 @@
             // 
             this.button_Start.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.button_Start.ForeColor = System.Drawing.Color.White;
-            this.button_Start.Location = new System.Drawing.Point(352, 21);
+            this.button_Start.Location = new System.Drawing.Point(266, 22);
             this.button_Start.Name = "button_Start";
             this.button_Start.Size = new System.Drawing.Size(102, 57);
             this.button_Start.TabIndex = 17;
@@ -535,9 +539,9 @@
             this.label_Result.BackColor = System.Drawing.Color.Red;
             this.label_Result.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_Result.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_Result.Location = new System.Drawing.Point(589, 115);
+            this.label_Result.Location = new System.Drawing.Point(698, 115);
             this.label_Result.Name = "label_Result";
-            this.label_Result.Size = new System.Drawing.Size(265, 67);
+            this.label_Result.Size = new System.Drawing.Size(156, 67);
             this.label_Result.TabIndex = 19;
             this.label_Result.Text = "不合格";
             this.label_Result.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -652,12 +656,41 @@
             this.label31.Size = new System.Drawing.Size(1, 20);
             this.label31.TabIndex = 37;
             // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.BackColor = System.Drawing.Color.White;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label7.Location = new System.Drawing.Point(496, 125);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(74, 21);
+            this.label7.TabIndex = 38;
+            this.label7.Text = "合格计数";
+            this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label_OK_Count
+            // 
+            this.label_OK_Count.BackColor = System.Drawing.Color.White;
+            this.label_OK_Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_OK_Count.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label_OK_Count.Location = new System.Drawing.Point(493, 152);
+            this.label_OK_Count.Name = "label_OK_Count";
+            this.label_OK_Count.Size = new System.Drawing.Size(80, 29);
+            this.label_OK_Count.TabIndex = 39;
+            this.label_OK_Count.Text = "0";
+            this.label_OK_Count.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // CheckForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(1234, 817);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.label_OK_Count);
+            this.Controls.Add(this.label32);
+            this.Controls.Add(this.label_SerialNum);
             this.Controls.Add(this.label31);
             this.Controls.Add(this.label_TestUser);
             this.Controls.Add(this.pictureBox2);
@@ -687,6 +720,7 @@
             this.Name = "CheckForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "检验模式";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CheckForm_FormClosing);
             this.Load += new System.EventHandler(this.CheckForm_Load);
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();
@@ -762,5 +796,7 @@
         private System.Windows.Forms.ToolStripMenuItem 不合格ToolStripMenuItem;
         private System.Windows.Forms.Label label_TestUser;
         private System.Windows.Forms.Label label31;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label_OK_Count;
     }
 }

+ 142 - 19
CheckForm.cs

@@ -20,6 +20,10 @@ namespace MOTINOVA_Motor_Factory_Set
         public string LogSaveFileName = "";
         #endregion
 
+        #region Boot版本正确标志
+        bool IsBootVerOK = false;
+        #endregion
+
         #region 端口设置界面
         public static PortSettings portsettings_form = new PortSettings();
         #endregion
@@ -234,6 +238,24 @@ namespace MOTINOVA_Motor_Factory_Set
             {
                 switch (CmdTemp)
                 {
+                    case 0xC109://Boot 版本
+                        {
+                            unchecked
+                            {
+                                this.Invoke((EventHandler)(delegate
+                                {
+                                    IsBootVerOK = true;
+                                    richTextBox_TestRecord.AppendText("\r\n" + "Boot 版本:");
+                                    for (ushort i = 0; i < 9; i++)
+                                    {
+                                        richTextBox_TestRecord.Text += ((char)binary_data_1[2 + i]).ToString();
+                                    }
+                                    richTextBox_TestRecord.AppendText("\r\n");
+                                }));
+                            }
+                            break;
+                        }
+
                     case 0x1104://故障码
                         {
                             unchecked
@@ -965,6 +987,25 @@ namespace MOTINOVA_Motor_Factory_Set
             
             Delay_ms(2000);
 
+            #region 判断Boot Loader版本
+            if (IsBootVerOK == false)
+            {
+                label_Step.Text = "Bootloader波特率错误!";
+                button_Start.Enabled = true;
+                //关机
+                Code[0] = 0xF0;
+                SendCmd(0x7FF, 0x16, 0x2201, Code);
+                开ToolStripMenuItem.Checked = false;
+                关ToolStripMenuItem.Checked = true;
+                Delay_ms(500);
+                //关闭串口
+                portsettings_form.closePort();
+                //存储测试数据
+                ErrorSaveLog();
+                return;
+            }
+            #endregion
+
             #region 版本查询和确认
             label_Step.Text = "检查版本信息";
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令查询版本信息" + "\r\n";
@@ -1317,6 +1358,28 @@ namespace MOTINOVA_Motor_Factory_Set
             //关闭串口
             portsettings_form.closePort();
 
+            //合格计数累加和存储
+            label_OK_Count.Text = (Convert.ToInt32(label_OK_Count.Text) + 1).ToString();
+            string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
+            StreamReader objReader = new StreamReader(cfg_file);
+            string sLine = "";
+            ArrayList arrText = new ArrayList();//创建一个动态数组
+            while (sLine != null)
+            {
+                sLine = objReader.ReadLine();
+                arrText.Add(sLine);
+            }
+            arrText.RemoveAt(arrText.Count - 1);
+            objReader.Close();
+            arrText[3] = label_OK_Count.Text;
+            using (StreamWriter file = new StreamWriter(cfg_file))
+            {
+                foreach (var entry in arrText)
+                {
+                    file.WriteLine(entry);
+                }
+            }
+
             #region 按照产品信息设置测试文件路径
             string ResultPathName = textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_");
             if (System.IO.Directory.Exists(LogSavePath + "log\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\" + ResultPathName) == false)
@@ -1407,6 +1470,7 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             objReader.Close();
             label_SerialNum.Text = arrText[1].ToString();//流水号
+            label_OK_Count.Text = arrText[3].ToString();//合格计数
         }
 
         //测试失败存储测试界面
@@ -1450,6 +1514,9 @@ namespace MOTINOVA_Motor_Factory_Set
             richTextBox_TQ.Text = "";
             richTextBox_VerInfo.Text = "";
 
+            //Boot版本标志复位
+            IsBootVerOK = false;
+
             #region 检查配置文件
             if (comboBox_File.Items.Count == 0) //配置文件目录为空
             {
@@ -1551,30 +1618,54 @@ namespace MOTINOVA_Motor_Factory_Set
         //双击清零流水号
         private void label32_DoubleClick(object sender, EventArgs e)
         {
-            //流水号清零
-            if (MessageBox.Show("流水号清零", "确认清零?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+            StartForm.EnterForm1.ShowDialog();
+            try
             {
-                label_SerialNum.Text = "0";
-                //存储
-                string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
-                StreamReader objReader = new StreamReader(cfg_file);
-                string sLine = "";
-                ArrayList arrText = new ArrayList();//创建一个动态数组
-                while (sLine != null)
-                {
-                    sLine = objReader.ReadLine();
-                    arrText.Add(sLine);
-                }
-                arrText.RemoveAt(arrText.Count - 1);
-                objReader.Close();
-                arrText[1] = label_SerialNum.Text;
-                using (StreamWriter file = new StreamWriter(cfg_file))
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    foreach (var entry in arrText)
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        //流水号清零
+                        if (MessageBox.Show("流水号清零", "确认清零?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+                        {
+                            label_SerialNum.Text = "0";
+                            label_OK_Count.Text = "0";
+                            //存储
+                            string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
+                            StreamReader objReader = new StreamReader(cfg_file);
+                            string sLine = "";
+                            ArrayList arrText = new ArrayList();//创建一个动态数组
+                            while (sLine != null)
+                            {
+                                sLine = objReader.ReadLine();
+                                arrText.Add(sLine);
+                            }
+                            arrText.RemoveAt(arrText.Count - 1);
+                            objReader.Close();
+                            arrText[1] = label_SerialNum.Text;
+                            arrText[3] = label_OK_Count.Text;
+                            using (StreamWriter file = new StreamWriter(cfg_file))
+                            {
+                                foreach (var entry in arrText)
+                                {
+                                    file.WriteLine(entry);
+                                }
+                            }
+                        }
+                    }
+                    else
                     {
-                        file.WriteLine(entry);
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
+                else
+                {
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
 
@@ -1608,5 +1699,37 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             System.Diagnostics.Process.Start("explorer.exe", LogSavePath + "errorlog\\");
         }
+
+        private void CheckForm_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            portsettings_form.serialPort1.Close();
+            portsettings_form.comboBox_ComIndex.Enabled = true;
+            portsettings_form.button_Enter.Text = "确认";
+            portsettings_form.g_blnIsOpen = false;
+            //关闭前,删除本地所有配置文件
+            string path = StartForm.UserPath + "\\cfg\\";
+            try
+            {
+                DirectoryInfo dir = new DirectoryInfo(path);
+                FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();  //返回目录中所有文件和子目录
+                foreach (FileSystemInfo i in fileinfo)
+                {
+                    if (i is DirectoryInfo)            //判断是否文件夹
+                    {
+                        DirectoryInfo subdir = new DirectoryInfo(i.FullName);
+                        subdir.Delete(true);          //删除子目录和文件
+                    }
+                    else
+                    {
+                        File.Delete(i.FullName);      //删除指定文件
+                    }
+                }
+                //MessageBox.Show("文件清理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("文件清理失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
     }
 }

+ 83 - 66
ExportForm.Designer.cs

@@ -273,7 +273,7 @@
             // 
             // textBox_WalkSpeed
             // 
-            this.textBox_WalkSpeed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_WalkSpeed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_WalkSpeed.ForeColor = System.Drawing.Color.Black;
             this.textBox_WalkSpeed.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_WalkSpeed.Location = new System.Drawing.Point(463, 353);
@@ -283,7 +283,7 @@
             // 
             // textBox_WheelSizeAdj
             // 
-            this.textBox_WheelSizeAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_WheelSizeAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_WheelSizeAdj.ForeColor = System.Drawing.Color.Black;
             this.textBox_WheelSizeAdj.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_WheelSizeAdj.Location = new System.Drawing.Point(463, 317);
@@ -302,7 +302,7 @@
             // 
             // textBox_CadenceStart
             // 
-            this.textBox_CadenceStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_CadenceStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_CadenceStart.ForeColor = System.Drawing.Color.Black;
             this.textBox_CadenceStart.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_CadenceStart.Location = new System.Drawing.Point(463, 281);
@@ -321,7 +321,7 @@
             // 
             // textBox_SMART_Gain
             // 
-            this.textBox_SMART_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SMART_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_SMART_Gain.ForeColor = System.Drawing.Color.Black;
             this.textBox_SMART_Gain.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SMART_Gain.Location = new System.Drawing.Point(463, 245);
@@ -340,7 +340,7 @@
             // 
             // textBox_SPORT_Acc
             // 
-            this.textBox_SPORT_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SPORT_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_SPORT_Acc.ForeColor = System.Drawing.Color.Black;
             this.textBox_SPORT_Acc.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SPORT_Acc.Location = new System.Drawing.Point(463, 209);
@@ -359,7 +359,7 @@
             // 
             // textBox_NORM_Gain
             // 
-            this.textBox_NORM_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_NORM_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_NORM_Gain.ForeColor = System.Drawing.Color.Black;
             this.textBox_NORM_Gain.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_NORM_Gain.Location = new System.Drawing.Point(463, 173);
@@ -378,7 +378,7 @@
             // 
             // textBox_Serial
             // 
-            this.textBox_Serial.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Serial.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Serial.ForeColor = System.Drawing.Color.Black;
             this.textBox_Serial.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Serial.Location = new System.Drawing.Point(463, 137);
@@ -397,7 +397,7 @@
             // 
             // textBox_NTC_Ptotect
             // 
-            this.textBox_NTC_Ptotect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_NTC_Ptotect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_NTC_Ptotect.ForeColor = System.Drawing.Color.Black;
             this.textBox_NTC_Ptotect.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_NTC_Ptotect.Location = new System.Drawing.Point(463, 101);
@@ -444,7 +444,7 @@
             // 
             // textBox_SpeedLimit
             // 
-            this.textBox_SpeedLimit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SpeedLimit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_SpeedLimit.ForeColor = System.Drawing.Color.Black;
             this.textBox_SpeedLimit.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SpeedLimit.Location = new System.Drawing.Point(463, 29);
@@ -454,7 +454,7 @@
             // 
             // textBox_Walk_SpeedLimit
             // 
-            this.textBox_Walk_SpeedLimit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Walk_SpeedLimit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Walk_SpeedLimit.ForeColor = System.Drawing.Color.Black;
             this.textBox_Walk_SpeedLimit.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Walk_SpeedLimit.Location = new System.Drawing.Point(288, 353);
@@ -482,7 +482,7 @@
             // 
             // textBox_SMART_Acc
             // 
-            this.textBox_SMART_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SMART_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_SMART_Acc.ForeColor = System.Drawing.Color.Black;
             this.textBox_SMART_Acc.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SMART_Acc.Location = new System.Drawing.Point(105, 281);
@@ -502,7 +502,7 @@
             // 
             // textBox_SpeedSensor
             // 
-            this.textBox_SpeedSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SpeedSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_SpeedSensor.ForeColor = System.Drawing.Color.Black;
             this.textBox_SpeedSensor.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SpeedSensor.Location = new System.Drawing.Point(288, 281);
@@ -521,7 +521,7 @@
             // 
             // textBox_TURBO_Gain
             // 
-            this.textBox_TURBO_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TURBO_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_TURBO_Gain.ForeColor = System.Drawing.Color.Black;
             this.textBox_TURBO_Gain.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_TURBO_Gain.Location = new System.Drawing.Point(105, 245);
@@ -531,7 +531,7 @@
             // 
             // textBox_TURBO_Acc
             // 
-            this.textBox_TURBO_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TURBO_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_TURBO_Acc.ForeColor = System.Drawing.Color.Black;
             this.textBox_TURBO_Acc.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_TURBO_Acc.Location = new System.Drawing.Point(288, 245);
@@ -550,7 +550,7 @@
             // 
             // textBox_NORM_Acc
             // 
-            this.textBox_NORM_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_NORM_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_NORM_Acc.ForeColor = System.Drawing.Color.Black;
             this.textBox_NORM_Acc.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_NORM_Acc.Location = new System.Drawing.Point(105, 209);
@@ -560,7 +560,7 @@
             // 
             // textBox_SPORT_Gain
             // 
-            this.textBox_SPORT_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SPORT_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_SPORT_Gain.ForeColor = System.Drawing.Color.Black;
             this.textBox_SPORT_Gain.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SPORT_Gain.Location = new System.Drawing.Point(288, 209);
@@ -579,7 +579,7 @@
             // 
             // textBox_ECO_Gain
             // 
-            this.textBox_ECO_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_ECO_Gain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_ECO_Gain.ForeColor = System.Drawing.Color.Black;
             this.textBox_ECO_Gain.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_ECO_Gain.Location = new System.Drawing.Point(105, 173);
@@ -589,7 +589,7 @@
             // 
             // textBox_ECO_Acc
             // 
-            this.textBox_ECO_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_ECO_Acc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_ECO_Acc.ForeColor = System.Drawing.Color.Black;
             this.textBox_ECO_Acc.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_ECO_Acc.Location = new System.Drawing.Point(288, 173);
@@ -608,7 +608,7 @@
             // 
             // textBox_WheelSize
             // 
-            this.textBox_WheelSize.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_WheelSize.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_WheelSize.ForeColor = System.Drawing.Color.Black;
             this.textBox_WheelSize.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_WheelSize.Location = new System.Drawing.Point(288, 137);
@@ -627,7 +627,7 @@
             // 
             // textBox_NTC_Alarm
             // 
-            this.textBox_NTC_Alarm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_NTC_Alarm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_NTC_Alarm.ForeColor = System.Drawing.Color.Black;
             this.textBox_NTC_Alarm.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_NTC_Alarm.Location = new System.Drawing.Point(288, 101);
@@ -655,7 +655,7 @@
             // 
             // textBox_MaxCurrent
             // 
-            this.textBox_MaxCurrent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_MaxCurrent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_MaxCurrent.ForeColor = System.Drawing.Color.Black;
             this.textBox_MaxCurrent.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_MaxCurrent.Location = new System.Drawing.Point(105, 101);
@@ -665,7 +665,7 @@
             // 
             // textBox_Dec
             // 
-            this.textBox_Dec.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Dec.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Dec.ForeColor = System.Drawing.Color.Black;
             this.textBox_Dec.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Dec.Location = new System.Drawing.Point(105, 65);
@@ -694,7 +694,7 @@
             // 
             // textBox_StopTime
             // 
-            this.textBox_StopTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_StopTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_StopTime.ForeColor = System.Drawing.Color.Black;
             this.textBox_StopTime.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_StopTime.Location = new System.Drawing.Point(288, 29);
@@ -713,10 +713,12 @@
             // 
             // comboBox_SpeedSensor
             // 
-            this.comboBox_SpeedSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_SpeedSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.comboBox_SpeedSensor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_SpeedSensor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_SpeedSensor.ForeColor = System.Drawing.Color.Black;
             this.comboBox_SpeedSensor.FormattingEnabled = true;
-            this.comboBox_SpeedSensor.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_SpeedSensor.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_SpeedSensor.Items.AddRange(new object[] {
             "传感器",
             "踏频",
@@ -728,10 +730,12 @@
             // 
             // comboBox_GasMode
             // 
-            this.comboBox_GasMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_GasMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.comboBox_GasMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_GasMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_GasMode.ForeColor = System.Drawing.Color.Black;
             this.comboBox_GasMode.FormattingEnabled = true;
-            this.comboBox_GasMode.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_GasMode.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_GasMode.Items.AddRange(new object[] {
             "不支持",
             "支持"});
@@ -787,10 +791,12 @@
             // 
             // comboBox_NoPBU
             // 
-            this.comboBox_NoPBU.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_NoPBU.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.comboBox_NoPBU.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_NoPBU.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_NoPBU.ForeColor = System.Drawing.Color.Black;
             this.comboBox_NoPBU.FormattingEnabled = true;
-            this.comboBox_NoPBU.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_NoPBU.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_NoPBU.Items.AddRange(new object[] {
             "无",
             "有"});
@@ -838,9 +844,11 @@
             // comboBox_StartMode
             // 
             this.comboBox_StartMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_StartMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_StartMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_StartMode.ForeColor = System.Drawing.Color.Black;
             this.comboBox_StartMode.FormattingEnabled = true;
-            this.comboBox_StartMode.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_StartMode.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_StartMode.Items.AddRange(new object[] {
             "柔和",
             "正常",
@@ -901,10 +909,12 @@
             // 
             // comboBox_TailLightVol
             // 
-            this.comboBox_TailLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_TailLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.comboBox_TailLightVol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_TailLightVol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_TailLightVol.ForeColor = System.Drawing.Color.Black;
             this.comboBox_TailLightVol.FormattingEnabled = true;
-            this.comboBox_TailLightVol.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_TailLightVol.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_TailLightVol.Items.AddRange(new object[] {
             "6V",
             "12V",
@@ -926,10 +936,12 @@
             // 
             // comboBox_HeadLightVol
             // 
-            this.comboBox_HeadLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_HeadLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+            this.comboBox_HeadLightVol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_HeadLightVol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_HeadLightVol.ForeColor = System.Drawing.Color.Black;
             this.comboBox_HeadLightVol.FormattingEnabled = true;
-            this.comboBox_HeadLightVol.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_HeadLightVol.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_HeadLightVol.Items.AddRange(new object[] {
             "6V",
             "12V",
@@ -942,7 +954,7 @@
             // 
             // textBox_Angle_R
             // 
-            this.textBox_Angle_R.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Angle_R.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Angle_R.ForeColor = System.Drawing.Color.Black;
             this.textBox_Angle_R.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Angle_R.Location = new System.Drawing.Point(463, 30);
@@ -953,9 +965,11 @@
             // comboBox_LightMode
             // 
             this.comboBox_LightMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_LightMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_LightMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_LightMode.ForeColor = System.Drawing.Color.Black;
             this.comboBox_LightMode.FormattingEnabled = true;
-            this.comboBox_LightMode.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_LightMode.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_LightMode.Items.AddRange(new object[] {
             "模式 1",
             "模式 2",
@@ -977,10 +991,12 @@
             // 
             // comboBox_AstSensor
             // 
-            this.comboBox_AstSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_AstSensor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.comboBox_AstSensor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_AstSensor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_AstSensor.ForeColor = System.Drawing.Color.Black;
             this.comboBox_AstSensor.FormattingEnabled = true;
-            this.comboBox_AstSensor.ImeMode = System.Windows.Forms.ImeMode.Disable;
+            this.comboBox_AstSensor.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.comboBox_AstSensor.Items.AddRange(new object[] {
             "不支持",
             "支持"});
@@ -1000,7 +1016,7 @@
             // 
             // textBox_Angle_P
             // 
-            this.textBox_Angle_P.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Angle_P.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Angle_P.ForeColor = System.Drawing.Color.Black;
             this.textBox_Angle_P.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Angle_P.Location = new System.Drawing.Point(288, 30);
@@ -1044,7 +1060,7 @@
             // 
             // textBox_Info2
             // 
-            this.textBox_Info2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Info2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Info2.ForeColor = System.Drawing.Color.Black;
             this.textBox_Info2.Location = new System.Drawing.Point(82, 63);
             this.textBox_Info2.Name = "textBox_Info2";
@@ -1062,7 +1078,7 @@
             // 
             // textBox_Info1
             // 
-            this.textBox_Info1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Info1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Info1.ForeColor = System.Drawing.Color.Black;
             this.textBox_Info1.Location = new System.Drawing.Point(82, 30);
             this.textBox_Info1.Name = "textBox_Info1";
@@ -1071,7 +1087,7 @@
             // 
             // textBox_Info3
             // 
-            this.textBox_Info3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Info3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Info3.ForeColor = System.Drawing.Color.Black;
             this.textBox_Info3.Location = new System.Drawing.Point(82, 96);
             this.textBox_Info3.Name = "textBox_Info3";
@@ -1141,7 +1157,7 @@
             // 
             // textBox_RatePower
             // 
-            this.textBox_RatePower.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_RatePower.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_RatePower.ForeColor = System.Drawing.Color.Black;
             this.textBox_RatePower.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_RatePower.Location = new System.Drawing.Point(82, 29);
@@ -1151,7 +1167,7 @@
             // 
             // textBox_RotorR
             // 
-            this.textBox_RotorR.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_RotorR.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_RotorR.ForeColor = System.Drawing.Color.Black;
             this.textBox_RotorR.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_RotorR.Location = new System.Drawing.Point(82, 65);
@@ -1161,7 +1177,7 @@
             // 
             // textBox_Rate_Vol
             // 
-            this.textBox_Rate_Vol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Rate_Vol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Rate_Vol.ForeColor = System.Drawing.Color.Black;
             this.textBox_Rate_Vol.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Rate_Vol.Location = new System.Drawing.Point(82, 137);
@@ -1171,7 +1187,7 @@
             // 
             // textBox_Rotor_Ld
             // 
-            this.textBox_Rotor_Ld.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Rotor_Ld.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Rotor_Ld.ForeColor = System.Drawing.Color.Black;
             this.textBox_Rotor_Ld.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Rotor_Ld.Location = new System.Drawing.Point(82, 101);
@@ -1208,7 +1224,7 @@
             // 
             // textBox_RateSpeed
             // 
-            this.textBox_RateSpeed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_RateSpeed.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_RateSpeed.ForeColor = System.Drawing.Color.Black;
             this.textBox_RateSpeed.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_RateSpeed.Location = new System.Drawing.Point(248, 29);
@@ -1218,7 +1234,7 @@
             // 
             // textBox_Rotor_Lq
             // 
-            this.textBox_Rotor_Lq.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Rotor_Lq.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Rotor_Lq.ForeColor = System.Drawing.Color.Black;
             this.textBox_Rotor_Lq.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Rotor_Lq.Location = new System.Drawing.Point(248, 65);
@@ -1228,7 +1244,7 @@
             // 
             // textBox_E
             // 
-            this.textBox_E.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_E.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_E.ForeColor = System.Drawing.Color.Black;
             this.textBox_E.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_E.Location = new System.Drawing.Point(248, 101);
@@ -1259,7 +1275,7 @@
             // 
             // textBox_Secrect
             // 
-            this.textBox_Secrect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Secrect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.textBox_Secrect.ForeColor = System.Drawing.Color.Black;
             this.textBox_Secrect.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Secrect.Location = new System.Drawing.Point(82, 22);
@@ -1312,7 +1328,7 @@
             // 
             // textBox_Mac_Date
             // 
-            this.textBox_Mac_Date.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Mac_Date.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
             this.textBox_Mac_Date.ForeColor = System.Drawing.Color.Black;
             this.textBox_Mac_Date.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Mac_Date.Location = new System.Drawing.Point(82, 92);
@@ -1322,7 +1338,7 @@
             // 
             // textBox_Mac
             // 
-            this.textBox_Mac.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Mac.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
             this.textBox_Mac.ForeColor = System.Drawing.Color.Black;
             this.textBox_Mac.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Mac.Location = new System.Drawing.Point(82, 22);
@@ -1332,7 +1348,7 @@
             // 
             // textBox_Mac_Addr
             // 
-            this.textBox_Mac_Addr.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Mac_Addr.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
             this.textBox_Mac_Addr.ForeColor = System.Drawing.Color.Black;
             this.textBox_Mac_Addr.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Mac_Addr.Location = new System.Drawing.Point(82, 57);
@@ -1431,7 +1447,7 @@
             // 
             // textBox_TE_FW_Version
             // 
-            this.textBox_TE_FW_Version.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_TE_FW_Version.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_TE_FW_Version.ForeColor = System.Drawing.Color.Black;
             this.textBox_TE_FW_Version.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_TE_FW_Version.Location = new System.Drawing.Point(7, 218);
@@ -1450,7 +1466,7 @@
             // 
             // textBox_FW_Version
             // 
-            this.textBox_FW_Version.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_FW_Version.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_FW_Version.ForeColor = System.Drawing.Color.Black;
             this.textBox_FW_Version.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_FW_Version.Location = new System.Drawing.Point(7, 164);
@@ -1460,7 +1476,7 @@
             // 
             // textBox_Client
             // 
-            this.textBox_Client.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Client.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_Client.ForeColor = System.Drawing.Color.Black;
             this.textBox_Client.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Client.Location = new System.Drawing.Point(7, 110);
@@ -1470,13 +1486,14 @@
             // 
             // textBox_Model
             // 
-            this.textBox_Model.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Model.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
             this.textBox_Model.ForeColor = System.Drawing.Color.Black;
             this.textBox_Model.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Model.Location = new System.Drawing.Point(7, 56);
             this.textBox_Model.Name = "textBox_Model";
             this.textBox_Model.Size = new System.Drawing.Size(183, 29);
             this.textBox_Model.TabIndex = 2;
+            this.textBox_Model.TextChanged += new System.EventHandler(this.textBox_Model_TextChanged);
             // 
             // groupBox8
             // 
@@ -1523,7 +1540,7 @@
             // 
             // textBox_Start_Max
             // 
-            this.textBox_Start_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Start_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Start_Max.ForeColor = System.Drawing.Color.Black;
             this.textBox_Start_Max.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Start_Max.Location = new System.Drawing.Point(140, 176);
@@ -1542,7 +1559,7 @@
             // 
             // textBox_K_Max
             // 
-            this.textBox_K_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_K_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_K_Max.ForeColor = System.Drawing.Color.Black;
             this.textBox_K_Max.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_K_Max.Location = new System.Drawing.Point(140, 145);
@@ -1552,7 +1569,7 @@
             // 
             // textBox_Start_Min
             // 
-            this.textBox_Start_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Start_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Start_Min.ForeColor = System.Drawing.Color.Black;
             this.textBox_Start_Min.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Start_Min.Location = new System.Drawing.Point(82, 176);
@@ -1571,7 +1588,7 @@
             // 
             // textBox_K_Min
             // 
-            this.textBox_K_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_K_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_K_Min.ForeColor = System.Drawing.Color.Black;
             this.textBox_K_Min.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_K_Min.Location = new System.Drawing.Point(82, 145);
@@ -1581,7 +1598,7 @@
             // 
             // textBox_Zero_Max
             // 
-            this.textBox_Zero_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Zero_Max.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Zero_Max.ForeColor = System.Drawing.Color.Black;
             this.textBox_Zero_Max.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Zero_Max.Location = new System.Drawing.Point(140, 114);
@@ -1591,7 +1608,7 @@
             // 
             // textBox_Zero_Min
             // 
-            this.textBox_Zero_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_Zero_Min.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_Zero_Min.ForeColor = System.Drawing.Color.Black;
             this.textBox_Zero_Min.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Zero_Min.Location = new System.Drawing.Point(82, 114);
@@ -1610,7 +1627,7 @@
             // 
             // textBox_GasSpeedTh
             // 
-            this.textBox_GasSpeedTh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_GasSpeedTh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_GasSpeedTh.ForeColor = System.Drawing.Color.Black;
             this.textBox_GasSpeedTh.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_GasSpeedTh.Location = new System.Drawing.Point(82, 83);
@@ -1629,7 +1646,7 @@
             // 
             // textBox_SpeedTh
             // 
-            this.textBox_SpeedTh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_SpeedTh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_SpeedTh.ForeColor = System.Drawing.Color.Black;
             this.textBox_SpeedTh.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_SpeedTh.Location = new System.Drawing.Point(82, 52);
@@ -1639,7 +1656,7 @@
             // 
             // textBox_NC_Current
             // 
-            this.textBox_NC_Current.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.textBox_NC_Current.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.textBox_NC_Current.ForeColor = System.Drawing.Color.Black;
             this.textBox_NC_Current.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_NC_Current.Location = new System.Drawing.Point(82, 22);

+ 121 - 46
ExportForm.cs

@@ -93,7 +93,7 @@ namespace MOTINOVA_Motor_Factory_Set
             Otherinfo.Clear();
             Otherinfo.Add("生产商", "TTIUM");
             Otherinfo.Add("生产地", "WUHAN");
-            Otherinfo.Add("生产日期", "20200901");
+            Otherinfo.Add("生产日期", DateTime.Now.ToString("yyyyMMdd"));
             Otherinfo.Add("校验密钥", "AVONITOM");
             Otherinfo.Add("信息1", "");
             Otherinfo.Add("信息2", "");
@@ -115,18 +115,7 @@ namespace MOTINOVA_Motor_Factory_Set
         private void ParamsDisplayUpdate()
         {
             //参数1
-            if (Params1["启动模式"] == 1)
-            {
-                comboBox_StartMode.Text = "柔和";
-            }
-            else if (Params1["启动模式"] == 2)
-            {
-                comboBox_StartMode.Text = "正常";
-            }
-            else if (Params1["启动模式"] == 3)
-            {
-                comboBox_StartMode.Text = "强劲";
-            }
+            comboBox_StartMode.SelectedIndex = Params1["启动模式"] - 1;
             textBox_StopTime.Text = Params1["停机时间"].ToString();
             textBox_SpeedLimit.Text = Params1["限速值"].ToString();
             textBox_Dec.Text = Params1["下降速度"].ToString();
@@ -137,11 +126,11 @@ namespace MOTINOVA_Motor_Factory_Set
             textBox_NTC_Ptotect.Text = Params1["温度保护"].ToString();
             if (Params1["码表"] == 0x55)
             {
-                comboBox_NoPBU.Text = "有";
+                comboBox_NoPBU.SelectedIndex = 1;
             }
             else if (Params1["码表"] == 0xAA)
             {
-                comboBox_NoPBU.Text = "无";
+                comboBox_NoPBU.SelectedIndex = 0;
             }
             textBox_WheelSize.Text = Params1["轮胎周长"].ToString();
             textBox_Serial.Text = Params1["系列号"].ToString();
@@ -159,23 +148,23 @@ namespace MOTINOVA_Motor_Factory_Set
             textBox_CadenceStart.Text = Params1["踏频启动"].ToString();
             if (Params1["指拨模式"] == 0x55)
             {
-                comboBox_GasMode.Text = "不支持";
+                comboBox_GasMode.SelectedIndex = 0;
             }
             else if (Params1["指拨模式"] == 0xAA)
             {
-                comboBox_GasMode.Text = "支持";
+                comboBox_GasMode.SelectedIndex = 1;
             }
             if (Params1["速度信号来源"] == 0x55)
             {
-                comboBox_SpeedSensor.Text = "传感器";
+                comboBox_SpeedSensor.SelectedIndex = 0;
             }
             else if (Params1["速度信号来源"] == 0xAA)
             {
-                comboBox_SpeedSensor.Text = "踏频";
+                comboBox_SpeedSensor.SelectedIndex = 1;
             }
             else if (Params1["速度信号来源"] == 0xEE)
             {
-                comboBox_SpeedSensor.Text = "通信";
+                comboBox_SpeedSensor.SelectedIndex = 2;
             }
             textBox_WheelSizeAdj.Text = Params1["周长微调"].ToString();
             textBox_UV_Protect.Text = Params1["低压保护"].ToString();
@@ -185,61 +174,46 @@ namespace MOTINOVA_Motor_Factory_Set
             //参数2
             if (Params2["姿态传感器"] == 0x55)
             {
-                comboBox_AstSensor.Text = "不支持";
+                comboBox_AstSensor.SelectedIndex = 0;
             }
             else if (Params1["姿态传感器"] == 0xAA)
             {
-                comboBox_AstSensor.Text = "支持";
+                comboBox_AstSensor.SelectedIndex = 1;
             }
             textBox_Angle_P.Text = ((float)(Params2["俯仰角零偏"]) / 10.0f).ToString("#0.0");
             textBox_Angle_R.Text = ((float)(Params2["横滚角零偏"]) / 10.0f).ToString("#0.0");
-            if (Params2["尾灯模式"] == 1)
-            {
-                comboBox_LightMode.Text = "模式 1";
-            }
-            else if (Params2["尾灯模式"] == 2)
-            {
-                comboBox_LightMode.Text = "模式 2";
-            }
-            else if (Params2["尾灯模式"] == 3)
-            {
-                comboBox_LightMode.Text = "模式 3";
-            }
-            else if (Params2["尾灯模式"] == 4)
-            {
-                comboBox_LightMode.Text = "模式 4";
-            }
+            comboBox_LightMode.SelectedIndex = Params2["尾灯模式"] - 1;
             if (Params2["前灯电压"] == 6)
             {
-                comboBox_HeadLightVol.Text = "6V";
+                comboBox_HeadLightVol.SelectedIndex = 0;
             }
             else if (Params2["前灯电压"] == 12)
             {
-                comboBox_HeadLightVol.Text = "12V";
+                comboBox_HeadLightVol.SelectedIndex = 1;
             }
             else if (Params2["前灯电压"] == 0xFF)
             {
-                comboBox_HeadLightVol.Text = "随电池";
+                comboBox_HeadLightVol.SelectedIndex = 2;
             }
             else if (Params2["前灯电压"] == 0)
             {
-                comboBox_HeadLightVol.Text = "硬件配置";
+                comboBox_HeadLightVol.SelectedIndex = 3;
             }
             if (Params2["尾灯电压"] == 6)
             {
-                comboBox_TailLightVol.Text = "6V";
+                comboBox_TailLightVol.SelectedIndex = 0;
             }
             else if (Params2["尾灯电压"] == 12)
             {
-                comboBox_TailLightVol.Text = "12V";
+                comboBox_TailLightVol.SelectedIndex = 1;
             }
             else if (Params2["尾灯电压"] == 0xFF)
             {
-                comboBox_TailLightVol.Text = "随电池";
+                comboBox_TailLightVol.SelectedIndex = 2;
             }
             else if (Params2["尾灯电压"] == 0)
             {
-                comboBox_TailLightVol.Text = "硬件配置";
+                comboBox_TailLightVol.SelectedIndex = 3;
             }
 
             //马达参数
@@ -632,5 +606,106 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             System.Diagnostics.Process.Start("osk.exe");
         }
+
+        //输入型号时自动更新关键参数
+        private void textBox_Model_TextChanged(object sender, EventArgs e)
+        {
+            if (textBox_Model.Text.Contains("J01"))
+            {
+                textBox_Serial.Text = "1";//系列号
+                textBox_MaxCurrent.Text = "13";//限流
+                textBox_RatePower.Text = "250";//额定功率
+                textBox_RateSpeed.Text = "1200";//额定转速
+                textBox_Rate_Vol.Text = "36";//额定电压
+                textBox_NC_Current.Text = "1000";//空载电流
+                textBox_GasSpeedTh.Text = "1000";//指拨转速
+                textBox_Zero_Min.Text = "100";//零偏下限
+                textBox_Zero_Max.Text = "2000";//零偏上限
+                textBox_K_Min.Text = "0.40";//传感器标定值下限
+                textBox_K_Max.Text = "1.20";//传感器标定值下限
+                textBox_Start_Min.Text = "350";//启动值下限
+                textBox_Start_Max.Text = "750";//启动值上限
+            }
+            else if (textBox_Model.Text.Contains("VL"))
+            {
+                textBox_Serial.Text = "1";//系列号
+                textBox_MaxCurrent.Text = "13";//限流
+                textBox_RatePower.Text = "250";//额定功率
+                textBox_RateSpeed.Text = "1200";//额定转速
+                textBox_Rate_Vol.Text = "36";//额定电压
+                textBox_NC_Current.Text = "1000";//空载电流
+                textBox_GasSpeedTh.Text = "1000";//指拨转速
+                textBox_Zero_Min.Text = "200";//零偏下限
+                textBox_Zero_Max.Text = "1800";//零偏上限
+                textBox_K_Min.Text = "0.25";//传感器标定值下限
+                textBox_K_Max.Text = "0.75";//传感器标定值下限
+                textBox_Start_Min.Text = "350";//启动值下限
+                textBox_Start_Max.Text = "750";//启动值上限
+            }
+            else if (textBox_Model.Text.Contains("VS"))
+            {
+                textBox_Serial.Text = "2";//系列号
+                textBox_MaxCurrent.Text = "15";//限流
+                textBox_RatePower.Text = "250";//额定功率
+                textBox_RateSpeed.Text = "1200";//额定转速
+                textBox_Rate_Vol.Text = "36";//额定电压
+                textBox_NC_Current.Text = "1000";//空载电流
+                textBox_GasSpeedTh.Text = "1000";//指拨转速
+                textBox_Zero_Min.Text = "200";//零偏下限
+                textBox_Zero_Max.Text = "1800";//零偏上限
+                textBox_K_Min.Text = "0.25";//传感器标定值下限
+                textBox_K_Max.Text = "0.75";//传感器标定值下限
+                textBox_Start_Min.Text = "350";//启动值下限
+                textBox_Start_Max.Text = "750";//启动值上限
+            }
+            else if (textBox_Model.Text.Contains("PG"))
+            {
+                textBox_Serial.Text = "3";//系列号
+                textBox_MaxCurrent.Text = "17";//限流
+                textBox_RatePower.Text = "250";//额定功率
+                textBox_RateSpeed.Text = "1600";//额定转速
+                textBox_Rate_Vol.Text = "36";//额定电压
+                textBox_NC_Current.Text = "1000";//空载电流
+                textBox_GasSpeedTh.Text = "1000";//指拨转速
+                textBox_Zero_Min.Text = "100";//零偏下限
+                textBox_Zero_Max.Text = "2000";//零偏上限
+                textBox_K_Min.Text = "0.25";//传感器标定值下限
+                textBox_K_Max.Text = "1.20";//传感器标定值下限
+                textBox_Start_Min.Text = "350";//启动值下限
+                textBox_Start_Max.Text = "750";//启动值上限
+            }
+            else if (textBox_Model.Text.Contains("PS"))
+            {
+                textBox_Serial.Text = "4";//系列号
+                textBox_MaxCurrent.Text = "17";//限流
+                textBox_RatePower.Text = "500";//额定功率
+                textBox_RateSpeed.Text = "1800";//额定转速
+                textBox_Rate_Vol.Text = "48";//额定电压
+                textBox_NC_Current.Text = "1000";//空载电流
+                textBox_GasSpeedTh.Text = "1000";//指拨转速
+                textBox_Zero_Min.Text = "100";//零偏下限
+                textBox_Zero_Max.Text = "2000";//零偏上限
+                textBox_K_Min.Text = "0.25";//传感器标定值下限
+                textBox_K_Max.Text = "1.20";//传感器标定值下限
+                textBox_Start_Min.Text = "350";//启动值下限
+                textBox_Start_Max.Text = "750";//启动值上限
+            }
+            else
+            {
+                textBox_Serial.Text = "";//系列号
+                textBox_MaxCurrent.Text = "";//限流
+                textBox_RatePower.Text = "";//额定功率
+                textBox_RateSpeed.Text = "";//额定转速
+                textBox_Rate_Vol.Text = "";//额定电压
+                textBox_NC_Current.Text = "";//空载电流
+                textBox_GasSpeedTh.Text = "";//指拨转速
+                textBox_Zero_Min.Text = "";//零偏下限
+                textBox_Zero_Max.Text = "";//零偏上限
+                textBox_K_Min.Text = "";//传感器标定值下限
+                textBox_K_Max.Text = "";//传感器标定值下限
+                textBox_Start_Min.Text = "";//启动值下限
+                textBox_Start_Max.Text = "";//启动值上限
+            }
+        }
     }
 }

+ 95 - 49
ImportForm.Designer.cs

@@ -98,8 +98,6 @@
             this.label7 = new System.Windows.Forms.Label();
             this.label12 = new System.Windows.Forms.Label();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.label10 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
             this.label_SerialNum = new System.Windows.Forms.Label();
@@ -158,6 +156,11 @@
             this.label_TestFun = new System.Windows.Forms.Label();
             this.label_TestUser = new System.Windows.Forms.Label();
             this.label31 = new System.Windows.Forms.Label();
+            this.label29 = new System.Windows.Forms.Label();
+            this.label30 = new System.Windows.Forms.Label();
+            this.label_Boot_Version = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label_OK_Count = new System.Windows.Forms.Label();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -283,7 +286,7 @@
             this.推行测试执行ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
             this.推行测试执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.推行测试执行ToolStripMenuItem.Name = "推行测试执行ToolStripMenuItem";
-            this.推行测试执行ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.推行测试执行ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.推行测试执行ToolStripMenuItem.Text = "执行";
             this.推行测试执行ToolStripMenuItem.Click += new System.EventHandler(this.推行测试执行ToolStripMenuItem_Click);
             // 
@@ -291,7 +294,7 @@
             // 
             this.推行测试不执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.推行测试不执行ToolStripMenuItem.Name = "推行测试不执行ToolStripMenuItem";
-            this.推行测试不执行ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.推行测试不执行ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.推行测试不执行ToolStripMenuItem.Text = "不执行";
             this.推行测试不执行ToolStripMenuItem.Click += new System.EventHandler(this.推行测试不执行ToolStripMenuItem_Click);
             // 
@@ -311,7 +314,7 @@
             this.系统清除执行ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
             this.系统清除执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.系统清除执行ToolStripMenuItem.Name = "系统清除执行ToolStripMenuItem";
-            this.系统清除执行ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.系统清除执行ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.系统清除执行ToolStripMenuItem.Text = "执行";
             this.系统清除执行ToolStripMenuItem.Click += new System.EventHandler(this.系统清除执行ToolStripMenuItem_Click);
             // 
@@ -319,7 +322,7 @@
             // 
             this.系统清除不执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.系统清除不执行ToolStripMenuItem.Name = "系统清除不执行ToolStripMenuItem";
-            this.系统清除不执行ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.系统清除不执行ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.系统清除不执行ToolStripMenuItem.Text = "不执行";
             this.系统清除不执行ToolStripMenuItem.Click += new System.EventHandler(this.系统清除不执行ToolStripMenuItem_Click);
             // 
@@ -339,7 +342,7 @@
             this.BMS检测执行ToolStripMenuItem1.CheckState = System.Windows.Forms.CheckState.Checked;
             this.BMS检测执行ToolStripMenuItem1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.BMS检测执行ToolStripMenuItem1.Name = "BMS检测执行ToolStripMenuItem1";
-            this.BMS检测执行ToolStripMenuItem1.Size = new System.Drawing.Size(180, 26);
+            this.BMS检测执行ToolStripMenuItem1.Size = new System.Drawing.Size(128, 26);
             this.BMS检测执行ToolStripMenuItem1.Text = "执行";
             this.BMS检测执行ToolStripMenuItem1.Click += new System.EventHandler(this.BMS检测执行ToolStripMenuItem1_Click);
             // 
@@ -347,7 +350,7 @@
             // 
             this.BMS检测不执行ToolStripMenuItem1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.BMS检测不执行ToolStripMenuItem1.Name = "BMS检测不执行ToolStripMenuItem1";
-            this.BMS检测不执行ToolStripMenuItem1.Size = new System.Drawing.Size(180, 26);
+            this.BMS检测不执行ToolStripMenuItem1.Size = new System.Drawing.Size(128, 26);
             this.BMS检测不执行ToolStripMenuItem1.Text = "不执行";
             this.BMS检测不执行ToolStripMenuItem1.Click += new System.EventHandler(this.BMS检测不执行ToolStripMenuItem1_Click);
             // 
@@ -434,31 +437,38 @@
             // comboBox_cfgFileDate
             // 
             this.comboBox_cfgFileDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_cfgFileDate.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.comboBox_cfgFileDate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_cfgFileDate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.comboBox_cfgFileDate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.comboBox_cfgFileDate.FormattingEnabled = true;
             this.comboBox_cfgFileDate.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.comboBox_cfgFileDate.Location = new System.Drawing.Point(6, 26);
             this.comboBox_cfgFileDate.Name = "comboBox_cfgFileDate";
-            this.comboBox_cfgFileDate.Size = new System.Drawing.Size(144, 29);
+            this.comboBox_cfgFileDate.Size = new System.Drawing.Size(144, 30);
             this.comboBox_cfgFileDate.TabIndex = 4;
             this.comboBox_cfgFileDate.SelectionChangeCommitted += new System.EventHandler(this.comboBox_cfgFileDate_SelectionChangeCommitted);
             // 
             // comboBox_File
             // 
             this.comboBox_File.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.comboBox_File.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.comboBox_File.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_File.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.comboBox_File.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.comboBox_File.FormattingEnabled = true;
             this.comboBox_File.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.comboBox_File.Location = new System.Drawing.Point(156, 26);
             this.comboBox_File.Name = "comboBox_File";
-            this.comboBox_File.Size = new System.Drawing.Size(725, 29);
+            this.comboBox_File.Size = new System.Drawing.Size(725, 30);
             this.comboBox_File.TabIndex = 1;
             this.comboBox_File.SelectionChangeCommitted += new System.EventHandler(this.comboBox_File_SelectionChangeCommitted);
             // 
             // groupBox1
             // 
+            this.groupBox1.Controls.Add(this.label30);
+            this.groupBox1.Controls.Add(this.label_Boot_Version);
+            this.groupBox1.Controls.Add(this.label29);
             this.groupBox1.Controls.Add(this.label_Sensor_Break2);
             this.groupBox1.Controls.Add(this.label_ErrorInfo);
             this.groupBox1.Controls.Add(this.label26);
@@ -801,7 +811,7 @@
             // 
             this.label_FW_Version.BackColor = System.Drawing.Color.Red;
             this.label_FW_Version.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_FW_Version.Location = new System.Drawing.Point(145, 446);
+            this.label_FW_Version.Location = new System.Drawing.Point(262, 446);
             this.label_FW_Version.Name = "label_FW_Version";
             this.label_FW_Version.Size = new System.Drawing.Size(42, 21);
             this.label_FW_Version.TabIndex = 0;
@@ -872,7 +882,7 @@
             // 
             // groupBox2
             // 
-            this.groupBox2.Controls.Add(this.label10);
+            this.groupBox2.Controls.Add(this.label_OK_Count);
             this.groupBox2.Controls.Add(this.label5);
             this.groupBox2.Controls.Add(this.label8);
             this.groupBox2.Controls.Add(this.label3);
@@ -892,30 +902,6 @@
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "操作";
             // 
-            // label10
-            // 
-            this.label10.BackColor = System.Drawing.Color.White;
-            this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label10.Location = new System.Drawing.Point(393, 86);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(75, 21);
-            this.label10.TabIndex = 6;
-            this.label10.Text = "推行";
-            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // label5
-            // 
-            this.label5.BackColor = System.Drawing.Color.White;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label5.Location = new System.Drawing.Point(393, 19);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(75, 21);
-            this.label5.TabIndex = 6;
-            this.label5.Text = "车灯";
-            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
             // label8
             // 
             this.label8.AutoSize = true;
@@ -933,20 +919,20 @@
             // label3
             // 
             this.label3.BackColor = System.Drawing.Color.Silver;
-            this.label3.Location = new System.Drawing.Point(378, 16);
+            this.label3.Location = new System.Drawing.Point(265, 24);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(1, 125);
+            this.label3.Size = new System.Drawing.Size(1, 50);
             this.label3.TabIndex = 3;
             this.label3.Text = "label3";
             // 
             // label_SerialNum
             // 
             this.label_SerialNum.BackColor = System.Drawing.Color.White;
-            this.label_SerialNum.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_SerialNum.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_SerialNum.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.label_SerialNum.Location = new System.Drawing.Point(269, 43);
+            this.label_SerialNum.Location = new System.Drawing.Point(275, 43);
             this.label_SerialNum.Name = "label_SerialNum";
-            this.label_SerialNum.Size = new System.Drawing.Size(103, 29);
+            this.label_SerialNum.Size = new System.Drawing.Size(90, 29);
             this.label_SerialNum.TabIndex = 0;
             this.label_SerialNum.Text = "0";
             this.label_SerialNum.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -955,6 +941,7 @@
             // 
             this.radioButton_Light_NG.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.radioButton_Light_NG.Enabled = false;
+            this.radioButton_Light_NG.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.radioButton_Light_NG.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.radioButton_Light_NG.Location = new System.Drawing.Point(264, 91);
             this.radioButton_Light_NG.Name = "radioButton_Light_NG";
@@ -967,9 +954,9 @@
             // 
             this.button_Walk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.button_Walk.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.button_Walk.Location = new System.Drawing.Point(390, 110);
+            this.button_Walk.Location = new System.Drawing.Point(393, 112);
             this.button_Walk.Name = "button_Walk";
-            this.button_Walk.Size = new System.Drawing.Size(80, 32);
+            this.button_Walk.Size = new System.Drawing.Size(60, 30);
             this.button_Walk.TabIndex = 0;
             this.button_Walk.Text = "启动";
             this.button_Walk.UseVisualStyleBackColor = false;
@@ -979,6 +966,7 @@
             // 
             this.radioButton_Light_OK.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.radioButton_Light_OK.Enabled = false;
+            this.radioButton_Light_OK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.radioButton_Light_OK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.radioButton_Light_OK.Location = new System.Drawing.Point(150, 91);
             this.radioButton_Light_OK.Name = "radioButton_Light_OK";
@@ -991,9 +979,9 @@
             // 
             this.button_LightCtl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.button_LightCtl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.button_LightCtl.Location = new System.Drawing.Point(390, 43);
+            this.button_LightCtl.Location = new System.Drawing.Point(393, 80);
             this.button_LightCtl.Name = "button_LightCtl";
-            this.button_LightCtl.Size = new System.Drawing.Size(80, 32);
+            this.button_LightCtl.Size = new System.Drawing.Size(60, 30);
             this.button_LightCtl.TabIndex = 0;
             this.button_LightCtl.Text = "开灯";
             this.button_LightCtl.UseVisualStyleBackColor = false;
@@ -1024,6 +1012,7 @@
             // button_Start
             // 
             this.button_Start.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.button_Start.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.button_Start.ForeColor = System.Drawing.Color.White;
             this.button_Start.Location = new System.Drawing.Point(6, 80);
             this.button_Start.Name = "button_Start";
@@ -1515,7 +1504,7 @@
             this.label_TestUser.AutoSize = true;
             this.label_TestUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.label_TestUser.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_TestUser.Location = new System.Drawing.Point(620, 4);
+            this.label_TestUser.Location = new System.Drawing.Point(503, 4);
             this.label_TestUser.Name = "label_TestUser";
             this.label_TestUser.Size = new System.Drawing.Size(114, 21);
             this.label_TestUser.TabIndex = 35;
@@ -1524,11 +1513,65 @@
             // label31
             // 
             this.label31.BackColor = System.Drawing.Color.Silver;
-            this.label31.Location = new System.Drawing.Point(612, 4);
+            this.label31.Location = new System.Drawing.Point(495, 4);
             this.label31.Name = "label31";
             this.label31.Size = new System.Drawing.Size(1, 20);
             this.label31.TabIndex = 36;
             // 
+            // label29
+            // 
+            this.label29.AutoSize = true;
+            this.label29.Location = new System.Drawing.Point(145, 446);
+            this.label29.Name = "label29";
+            this.label29.Size = new System.Drawing.Size(41, 21);
+            this.label29.TabIndex = 4;
+            this.label29.Text = "APP";
+            // 
+            // label30
+            // 
+            this.label30.AutoSize = true;
+            this.label30.Location = new System.Drawing.Point(310, 446);
+            this.label30.Name = "label30";
+            this.label30.Size = new System.Drawing.Size(55, 21);
+            this.label30.TabIndex = 6;
+            this.label30.Text = "BOOT";
+            // 
+            // label_Boot_Version
+            // 
+            this.label_Boot_Version.BackColor = System.Drawing.Color.Red;
+            this.label_Boot_Version.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.label_Boot_Version.Location = new System.Drawing.Point(419, 446);
+            this.label_Boot_Version.Name = "label_Boot_Version";
+            this.label_Boot_Version.Size = new System.Drawing.Size(42, 21);
+            this.label_Boot_Version.TabIndex = 5;
+            this.label_Boot_Version.Text = "NG";
+            this.label_Boot_Version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.BackColor = System.Drawing.Color.White;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label5.Location = new System.Drawing.Point(386, 19);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(74, 21);
+            this.label5.TabIndex = 5;
+            this.label5.Text = "合格计数";
+            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label_OK_Count
+            // 
+            this.label_OK_Count.BackColor = System.Drawing.Color.White;
+            this.label_OK_Count.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_OK_Count.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label_OK_Count.Location = new System.Drawing.Point(378, 43);
+            this.label_OK_Count.Name = "label_OK_Count";
+            this.label_OK_Count.Size = new System.Drawing.Size(90, 29);
+            this.label_OK_Count.TabIndex = 6;
+            this.label_OK_Count.Text = "0";
+            this.label_OK_Count.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // ImportForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -1675,8 +1718,6 @@
         private System.Windows.Forms.Label label_Sensor_Gas;
         private System.Windows.Forms.Label label_Sensor_Break1;
         private System.Windows.Forms.Label label8;
-        private System.Windows.Forms.Label label10;
-        private System.Windows.Forms.Label label5;
         public System.Windows.Forms.Label label_NetStatus;
         private System.Windows.Forms.ComboBox comboBox_cfgFileDate;
         private System.Windows.Forms.Label label22;
@@ -1712,5 +1753,10 @@
         private System.Windows.Forms.ToolStripMenuItem 不合格ToolStripMenuItem;
         private System.Windows.Forms.Label label_TestUser;
         private System.Windows.Forms.Label label31;
+        private System.Windows.Forms.Label label30;
+        private System.Windows.Forms.Label label_Boot_Version;
+        private System.Windows.Forms.Label label29;
+        private System.Windows.Forms.Label label_OK_Count;
+        private System.Windows.Forms.Label label5;
     }
 }

+ 208 - 63
ImportForm.cs

@@ -253,6 +253,15 @@ namespace MOTINOVA_Motor_Factory_Set
 
             //显示测试员信息
             label_TestUser.Text = "测试员:" + StartForm.EnterForm1.comboBox_User.Text;
+            //针对越南测试,默认不执行系统清除
+            if (StartForm.EnterForm1.comboBox_User.Text == "越南Vietnam")
+            {
+                系统清除执行ToolStripMenuItem.Checked = false;
+                系统清除不执行ToolStripMenuItem.Checked = true;
+                label_TestFunsUpdate();
+                系统清除执行ToolStripMenuItem.Enabled = false;
+                系统清除不执行ToolStripMenuItem.Enabled = false;
+            }
 
             //装载配置文件
             GetDateList(false);
@@ -269,6 +278,7 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             objReader.Close();
             label_SerialNum.Text = arrText[1].ToString();//流水号
+            label_OK_Count.Text = arrText[3].ToString();//合格计数
 
         }
 
@@ -499,6 +509,24 @@ namespace MOTINOVA_Motor_Factory_Set
             {
                 switch (CmdTemp)
                 {
+                    case 0xC109://Boot 版本
+                        {
+                            unchecked
+                            {
+                                this.Invoke((EventHandler)(delegate
+                                {
+                                    label_Boot_Version.BackColor = Color.Green;
+                                    label_Boot_Version.Text = "OK";
+                                    richTextBox_TestRecord.AppendText("\r\n" + "Boot 版本:");
+                                    for (ushort i = 0; i < 9; i++)
+                                    {
+                                        richTextBox_TestRecord.Text += ((char)binary_data_1[2 + i]).ToString();
+                                    }
+                                    richTextBox_TestRecord.AppendText("\r\n");
+                                }));
+                            }
+                            break;
+                        }
                     case 0x1020://电机运行信息
                         {
                             unchecked
@@ -787,6 +815,30 @@ namespace MOTINOVA_Motor_Factory_Set
             portsettings_form.comboBox_ComIndex.Enabled = true;
             portsettings_form.button_Enter.Text = "确认";
             portsettings_form.g_blnIsOpen = false;
+            //关闭前,删除本地所有配置文件
+            string path = StartForm.UserPath + "\\cfg\\";
+            try
+            {
+                DirectoryInfo dir = new DirectoryInfo(path);
+                FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();  //返回目录中所有文件和子目录
+                foreach (FileSystemInfo i in fileinfo)
+                {
+                    if (i is DirectoryInfo)            //判断是否文件夹
+                    {
+                        DirectoryInfo subdir = new DirectoryInfo(i.FullName);
+                        subdir.Delete(true);          //删除子目录和文件
+                    }
+                    else
+                    {
+                        File.Delete(i.FullName);      //删除指定文件
+                    }
+                }
+                //MessageBox.Show("文件清理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("文件清理失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
         }
 
         //开关灯
@@ -915,6 +967,8 @@ namespace MOTINOVA_Motor_Factory_Set
             label_Sensor_Gas.Text = "NG";
             label_FW_Version.BackColor = Color.Red;//版本信息
             label_FW_Version.Text = "NG";
+            label_Boot_Version.BackColor = Color.Red;//Boot 版本
+            label_Boot_Version.Text = "NG";
 
             label_BMS_COM.BackColor = Color.Red;//BMS通信
             label_BMS_COM.Text = "NG";
@@ -2334,6 +2388,24 @@ namespace MOTINOVA_Motor_Factory_Set
                 richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "版本信息正确" + "\r\n";
             }
             Delay_ms(1000);
+            //检查Boot版本是否正确
+            if (label_Boot_Version.Text != "OK")
+            {
+                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "Bootloader波特率错误" + "\r\n";
+                label_Step.Text = "Bootloader波特率错误,测试结束!";
+                //关机
+                Code[0] = 0xF0;
+                SendCmd(0x7FF, 0x16, 0x2201, Code);
+                开ToolStripMenuItem.Checked = false;
+                关ToolStripMenuItem.Checked = true;
+                button_Start.Enabled = true;
+                Delay_ms(500);
+                //关闭串口
+                portsettings_form.closePort();
+                //存储测试数据
+                ErrorSaveLog();
+                return;
+            }
             #endregion
 
             #region 按照产品信息设置测试文件路径
@@ -2532,6 +2604,28 @@ namespace MOTINOVA_Motor_Factory_Set
             //关闭串口
             portsettings_form.closePort();
 
+            //合格计数累加和存储
+            label_OK_Count.Text = (Convert.ToInt32(label_OK_Count.Text) + 1).ToString();
+            string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
+            StreamReader objReader = new StreamReader(cfg_file);
+            string sLine = "";
+            ArrayList arrText = new ArrayList();//创建一个动态数组
+            while (sLine != null)
+            {
+                sLine = objReader.ReadLine();
+                arrText.Add(sLine);
+            }
+            arrText.RemoveAt(arrText.Count - 1);
+            objReader.Close();
+            arrText[3] = label_OK_Count.Text;
+            using (StreamWriter file = new StreamWriter(cfg_file))
+            {
+                foreach (var entry in arrText)
+                {
+                    file.WriteLine(entry);
+                }
+            }
+
             //导出的参数上传服务器
             if (StartForm.myFtp.IsNetConnected == true)
             {
@@ -2828,32 +2922,55 @@ namespace MOTINOVA_Motor_Factory_Set
         //清除流水号
         private void label8_DoubleClick(object sender, EventArgs e)
         {
-            //流水号清零
-            if (MessageBox.Show("流水号清零", "确认清零?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
-            {
-                label_SerialNum.Text = "0";
-                //存储
-                string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
-                StreamReader objReader = new StreamReader(cfg_file);
-                string sLine = "";
-                ArrayList arrText = new ArrayList();//创建一个动态数组
-                while (sLine != null)
-                {
-                    sLine = objReader.ReadLine();
-                    arrText.Add(sLine);
-                }
-                arrText.RemoveAt(arrText.Count - 1);
-                objReader.Close();
-                arrText[1] = label_SerialNum.Text;
-                using (StreamWriter file = new StreamWriter(cfg_file))
+            StartForm.EnterForm1.ShowDialog();
+            try
+            {
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    foreach (var entry in arrText)
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
                     {
-                        file.WriteLine(entry);
+                        //流水号清零
+                        if (MessageBox.Show("流水号清零", "确认清零?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+                        {
+                            label_SerialNum.Text = "0";
+                            label_OK_Count.Text = "0";
+                            //存储
+                            string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
+                            StreamReader objReader = new StreamReader(cfg_file);
+                            string sLine = "";
+                            ArrayList arrText = new ArrayList();//创建一个动态数组
+                            while (sLine != null)
+                            {
+                                sLine = objReader.ReadLine();
+                                arrText.Add(sLine);
+                            }
+                            arrText.RemoveAt(arrText.Count - 1);
+                            objReader.Close();
+                            arrText[1] = label_SerialNum.Text;
+                            arrText[3] = label_OK_Count.Text;
+                            using (StreamWriter file = new StreamWriter(cfg_file))
+                            {
+                                foreach (var entry in arrText)
+                                {
+                                    file.WriteLine(entry);
+                                }
+                            }
+                        }
                     }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
-                
+            catch (Exception)
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }    
         }
 
         private void richTextBox_TestRecord_TextChanged(object sender, EventArgs e)
@@ -2895,22 +3012,29 @@ namespace MOTINOVA_Motor_Factory_Set
         private void BMS检测不执行ToolStripMenuItem1_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
+            try
             {
-                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    BMS检测不执行ToolStripMenuItem1.Checked = true;
-                    BMS检测执行ToolStripMenuItem1.Checked = false;
-                    label_TestFunsUpdate();
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        BMS检测不执行ToolStripMenuItem1.Checked = true;
+                        BMS检测执行ToolStripMenuItem1.Checked = false;
+                        label_TestFunsUpdate();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {
-                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
-            else
+            catch (Exception)
             {
-                MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
 
@@ -2924,22 +3048,29 @@ namespace MOTINOVA_Motor_Factory_Set
         private void 推行测试不执行ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
+            try
             {
-                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    推行测试不执行ToolStripMenuItem.Checked = true;
-                    推行测试执行ToolStripMenuItem.Checked = false;
-                    label_TestFunsUpdate();
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        推行测试不执行ToolStripMenuItem.Checked = true;
+                        推行测试执行ToolStripMenuItem.Checked = false;
+                        label_TestFunsUpdate();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {
-                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                }                
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
-            else
+            catch (Exception)
             {
-                MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
 
@@ -2953,22 +3084,29 @@ namespace MOTINOVA_Motor_Factory_Set
         private void 系统清除不执行ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
+            try 
             {
-                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    系统清除执行ToolStripMenuItem.Checked = false;
-                    系统清除不执行ToolStripMenuItem.Checked = true;
-                    label_TestFunsUpdate();
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        系统清除执行ToolStripMenuItem.Checked = false;
+                        系统清除不执行ToolStripMenuItem.Checked = true;
+                        label_TestFunsUpdate();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {
-                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
-            else
+            catch (Exception)
             {
-                MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
 
@@ -3004,31 +3142,38 @@ namespace MOTINOVA_Motor_Factory_Set
             else
             {
                 StartForm.EnterForm1.ShowDialog();
-                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
+                try
                 {
-                    if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                    if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                     {
-                        系统清除执行ToolStripMenuItem.Checked = false;
-                        系统清除不执行ToolStripMenuItem.Checked = true;
-                        推行测试执行ToolStripMenuItem.Checked = false;
-                        推行测试不执行ToolStripMenuItem.Checked = true;
-                        BMS检测执行ToolStripMenuItem1.Checked = false;
-                        BMS检测不执行ToolStripMenuItem1.Checked = true;
-
-                        只写入参数ToolStripMenuItem.Checked = true;
-                        推行测试ToolStripMenuItem.Enabled = false;
-                        bMS通信检测ToolStripMenuItem.Enabled = false;
-                        系统清除ToolStripMenuItem.Enabled = false;
-                        label_TestFunsUpdate();
+                        if (StartForm.EnterForm1.comboBox_User.Text == "工程Engineer")
+                        {
+                            系统清除执行ToolStripMenuItem.Checked = false;
+                            系统清除不执行ToolStripMenuItem.Checked = true;
+                            推行测试执行ToolStripMenuItem.Checked = false;
+                            推行测试不执行ToolStripMenuItem.Checked = true;
+                            BMS检测执行ToolStripMenuItem1.Checked = false;
+                            BMS检测不执行ToolStripMenuItem1.Checked = true;
+
+                            只写入参数ToolStripMenuItem.Checked = true;
+                            推行测试ToolStripMenuItem.Enabled = false;
+                            bMS通信检测ToolStripMenuItem.Enabled = false;
+                            系统清除ToolStripMenuItem.Enabled = false;
+                            label_TestFunsUpdate();
+                        }
+                        else
+                        {
+                            MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                        }
                     }
                     else
                     {
-                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                        MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
-                else
+                catch (Exception)
                 {
-                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             

+ 73 - 22
StartForm.cs

@@ -384,12 +384,19 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             //输入用户名
             EnterForm1.ShowDialog();
-            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+            try
             {
-                CheckForm1.timer1.Enabled = false;
-                ImportForm1.ShowDialog();
+                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+                {
+                    CheckForm1.timer1.Enabled = false;
+                    ImportForm1.ShowDialog();
+                }
+                else
+                {
+                    MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
-            else
+            catch (Exception)
             {
                 MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
@@ -399,40 +406,54 @@ namespace MOTINOVA_Motor_Factory_Set
         private void button_Export_Click(object sender, EventArgs e)
         {
             EnterForm1.ShowDialog();
-            if(EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//生成参数模式仅用户PT
-            {
-                if (EnterForm1.comboBox_User.Text == "工程")
+            try
+            { 
+                if(EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//生成参数模式仅用户PT
                 {
-                    ExportForm1.ShowDialog();
+                    if (EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        ExportForm1.ShowDialog();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {
-                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
-            else
+            catch (Exception)
             {
-                MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         
         private void button_Mang_Click(object sender, EventArgs e)
         {
             EnterForm1.ShowDialog();
-            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//本地文件管理仅支持PT用户
+            try
             {
-                if (EnterForm1.comboBox_User.Text == "工程")
+                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//本地文件管理仅支持PT用户
                 {
-                    ManageForm1.ShowDialog();
+                    if (EnterForm1.comboBox_User.Text == "工程Engineer")
+                    {
+                        ManageForm1.ShowDialog();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {
-                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
-            else
+            catch (Exception)
             {
-                MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
 
@@ -449,12 +470,19 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             //输入用户名
             EnterForm1.ShowDialog();
-            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//所有用户支持
+            try
             {
-                ImportForm1.timer1.Enabled = false;
-                CheckForm1.ShowDialog();
+                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//所有用户支持
+                {
+                    ImportForm1.timer1.Enabled = false;
+                    CheckForm1.ShowDialog();
+                }
+                else
+                {
+                    MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
-            else
+            catch (Exception)
             {
                 MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
@@ -467,7 +495,30 @@ namespace MOTINOVA_Motor_Factory_Set
 
         private void StartForm_FormClosing(object sender, FormClosingEventArgs e)
         {
-
+            //关闭前,删除本地所有配置文件
+            string path = StartForm.UserPath + "\\cfg\\"; ;
+            try
+            {
+                DirectoryInfo dir = new DirectoryInfo(path);
+                FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();  //返回目录中所有文件和子目录
+                foreach (FileSystemInfo i in fileinfo)
+                {
+                    if (i is DirectoryInfo)            //判断是否文件夹
+                    {
+                        DirectoryInfo subdir = new DirectoryInfo(i.FullName);
+                        subdir.Delete(true);          //删除子目录和文件
+                    }
+                    else
+                    {
+                        File.Delete(i.FullName);      //删除指定文件
+                    }
+                }
+                //MessageBox.Show("文件清理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("文件清理失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
         }
 
     }

+ 1 - 1
bin/Debug/MOTINOVA_Motor_Factory_Set.application

@@ -14,7 +14,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>G3BFDgBzhaG6P1LJKDBcRTFjqriDoPeInbyixE8sVyA=</dsig:DigestValue>
+        <dsig:DigestValue>37qLSsOB/Pp/S2x612x0YWl58YpPsYOtnDrMb8O0O9s=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.exe


+ 2 - 2
bin/Debug/MOTINOVA_Motor_Factory_Set.exe.manifest

@@ -42,14 +42,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="679936">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="685568">
       <assemblyIdentity name="MOTINOVA_Motor_Factory_Set" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>3c3NTc65iqgjafBKIGYAuQ4OxlI/gFamJtSKYERP0qY=</dsig:DigestValue>
+        <dsig:DigestValue>ZQ5y4712URuFXHxsHFFuGthk2t+H7T1feBUa37oz8Go=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.pdb


+ 3 - 1
bin/Debug/SerialNum

@@ -1,2 +1,4 @@
 流水号:
-138
+0
+合格计数:
+0

+ 8 - 8
bin/Debug/Server

@@ -1,11 +1,3 @@
-#虚拟机
-IP=192.168.1.246
-PORT=21
-USER=hero
-PASSWD=1229
-ROOT=/home/hero/MOTINOVA_MC_Factory_Set
-LOCAL=ENABLE
-
 #内部服务器
 IP=192.168.1.74
 PORT=21
@@ -14,6 +6,14 @@ PASSWD=ttium
 ROOT=MOTINOVA_MC_Factory_Set
 LOCAL=ENABLE
 
+#虚拟机
+IP=192.168.1.246
+PORT=21
+USER=hero
+PASSWD=1229
+ROOT=/home/hero/MOTINOVA_MC_Factory_Set
+LOCAL=ENABLE
+
 #阿里云
 IP=47.105.122.91
 PORT=21

+ 3 - 0
bin/Debug/UserAccount

@@ -0,0 +1,3 @@
+USER=工程Engineer,PASSWD=123456
+USER=武汉Wuhan,PASSWD=1
+USER=越南Vietnam,PASSWD=2

BIN
bin/Debug/app.publish/MOTINOVA_Motor_Factory_Set.exe


+ 1 - 1
obj/Debug/MOTINOVA_Motor_Factory_Set.application

@@ -14,7 +14,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>G3BFDgBzhaG6P1LJKDBcRTFjqriDoPeInbyixE8sVyA=</dsig:DigestValue>
+        <dsig:DigestValue>37qLSsOB/Pp/S2x612x0YWl58YpPsYOtnDrMb8O0O9s=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

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


BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.exe


+ 2 - 2
obj/Debug/MOTINOVA_Motor_Factory_Set.exe.manifest

@@ -42,14 +42,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="679936">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="685568">
       <assemblyIdentity name="MOTINOVA_Motor_Factory_Set" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>3c3NTc65iqgjafBKIGYAuQ4OxlI/gFamJtSKYERP0qY=</dsig:DigestValue>
+        <dsig:DigestValue>ZQ5y4712URuFXHxsHFFuGthk2t+H7T1feBUa37oz8Go=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.pdb