Pārlūkot izejas kodu

增加电机类型定义,同时修改产品标识和远程路径。

hero 1 gadu atpakaļ
vecāks
revīzija
210929adb5

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


BIN
Welling_Motor_Debug_Tool/Images/logo.png


+ 57 - 25
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -410,6 +410,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeResult = new System.Windows.Forms.Label();
             this.label111 = new System.Windows.Forms.Label();
             this.tabPage_ProductMode_Read = new System.Windows.Forms.TabPage();
+            this.comboBox_CheckModeCfgFile = new System.Windows.Forms.ComboBox();
             this.groupBox31 = new System.Windows.Forms.GroupBox();
             this.label148 = new System.Windows.Forms.Label();
             this.label_CheckModeSN = new System.Windows.Forms.Label();
@@ -419,6 +420,7 @@ namespace Welling_Motor_Debug_Tool
             this.label_CheckModeCfg = new System.Windows.Forms.Label();
             this.label160 = new System.Windows.Forms.Label();
             this.label_CheckModeFWVer = new System.Windows.Forms.Label();
+            this.comboBox_CheckModeCfgDate = new System.Windows.Forms.ComboBox();
             this.groupBox30 = new System.Windows.Forms.GroupBox();
             this.richTextBox_CheckModeLog = new System.Windows.Forms.RichTextBox();
             this.groupBox29 = new System.Windows.Forms.GroupBox();
@@ -520,8 +522,9 @@ namespace Welling_Motor_Debug_Tool
             this.label107 = new System.Windows.Forms.Label();
             this.label_StarInfo = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.comboBox_CheckModeCfgFile = new System.Windows.Forms.ComboBox();
-            this.comboBox_CheckModeCfgDate = new System.Windows.Forms.ComboBox();
+            this.电机类型ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.中置电机ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.轮毂电机ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -709,7 +712,8 @@ namespace Welling_Motor_Debug_Tool
             this.写入存储ToolStripMenuItem,
             this.离线使用ToolStripMenuItem,
             this.服务器配置ToolStripMenuItem,
-            this.生产信息ToolStripMenuItem});
+            this.生产信息ToolStripMenuItem,
+            this.电机类型ToolStripMenuItem});
             this.配置ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.配置ToolStripMenuItem.Name = "配置ToolStripMenuItem";
             this.配置ToolStripMenuItem.Size = new System.Drawing.Size(54, 25);
@@ -864,7 +868,7 @@ namespace Welling_Motor_Debug_Tool
             this.生产商ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_MAC});
             this.生产商ToolStripMenuItem.Name = "生产商ToolStripMenuItem";
-            this.生产商ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
+            this.生产商ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.生产商ToolStripMenuItem.Text = "生产商";
             // 
             // toolStripTextBox_MAC
@@ -880,7 +884,7 @@ namespace Welling_Motor_Debug_Tool
             this.生产地ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBoxMACAddr});
             this.生产地ToolStripMenuItem.Name = "生产地ToolStripMenuItem";
-            this.生产地ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
+            this.生产地ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.生产地ToolStripMenuItem.Text = "生产地";
             // 
             // toolStripTextBoxMACAddr
@@ -896,7 +900,7 @@ namespace Welling_Motor_Debug_Tool
             this.生产日期ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_MACDate});
             this.生产日期ToolStripMenuItem.Name = "生产日期ToolStripMenuItem";
-            this.生产日期ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
+            this.生产日期ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.生产日期ToolStripMenuItem.Text = "生产日期";
             // 
             // toolStripTextBox_MACDate
@@ -912,7 +916,7 @@ namespace Welling_Motor_Debug_Tool
             this.产品标识ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_MACPD});
             this.产品标识ToolStripMenuItem.Name = "产品标识ToolStripMenuItem";
-            this.产品标识ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
+            this.产品标识ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.产品标识ToolStripMenuItem.Text = "产品标识";
             // 
             // toolStripTextBox_MACPD
@@ -4722,6 +4726,17 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_ProductMode_Read.TabIndex = 12;
             this.tabPage_ProductMode_Read.Text = "量产检验";
             // 
+            // comboBox_CheckModeCfgFile
+            // 
+            this.comboBox_CheckModeCfgFile.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_CheckModeCfgFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_CheckModeCfgFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.comboBox_CheckModeCfgFile.FormattingEnabled = true;
+            this.comboBox_CheckModeCfgFile.Location = new System.Drawing.Point(235, 6);
+            this.comboBox_CheckModeCfgFile.Name = "comboBox_CheckModeCfgFile";
+            this.comboBox_CheckModeCfgFile.Size = new System.Drawing.Size(746, 29);
+            this.comboBox_CheckModeCfgFile.TabIndex = 18;
+            // 
             // groupBox31
             // 
             this.groupBox31.Controls.Add(this.label148);
@@ -4831,6 +4846,17 @@ namespace Welling_Motor_Debug_Tool
             this.label_CheckModeFWVer.TabIndex = 9;
             this.label_CheckModeFWVer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // comboBox_CheckModeCfgDate
+            // 
+            this.comboBox_CheckModeCfgDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_CheckModeCfgDate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_CheckModeCfgDate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.comboBox_CheckModeCfgDate.FormattingEnabled = true;
+            this.comboBox_CheckModeCfgDate.Location = new System.Drawing.Point(92, 6);
+            this.comboBox_CheckModeCfgDate.Name = "comboBox_CheckModeCfgDate";
+            this.comboBox_CheckModeCfgDate.Size = new System.Drawing.Size(137, 29);
+            this.comboBox_CheckModeCfgDate.TabIndex = 19;
+            // 
             // groupBox30
             // 
             this.groupBox30.Controls.Add(this.richTextBox_CheckModeLog);
@@ -5850,27 +5876,30 @@ namespace Welling_Motor_Debug_Tool
             this.pictureBox2.TabIndex = 16;
             this.pictureBox2.TabStop = false;
             // 
-            // comboBox_CheckModeCfgFile
+            // 电机类型ToolStripMenuItem
             // 
-            this.comboBox_CheckModeCfgFile.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
-            this.comboBox_CheckModeCfgFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_CheckModeCfgFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.comboBox_CheckModeCfgFile.FormattingEnabled = true;
-            this.comboBox_CheckModeCfgFile.Location = new System.Drawing.Point(235, 6);
-            this.comboBox_CheckModeCfgFile.Name = "comboBox_CheckModeCfgFile";
-            this.comboBox_CheckModeCfgFile.Size = new System.Drawing.Size(746, 29);
-            this.comboBox_CheckModeCfgFile.TabIndex = 18;
+            this.电机类型ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.中置电机ToolStripMenuItem,
+            this.轮毂电机ToolStripMenuItem});
+            this.电机类型ToolStripMenuItem.Name = "电机类型ToolStripMenuItem";
+            this.电机类型ToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
+            this.电机类型ToolStripMenuItem.Text = "电机类型";
             // 
-            // comboBox_CheckModeCfgDate
+            // 中置电机ToolStripMenuItem
             // 
-            this.comboBox_CheckModeCfgDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
-            this.comboBox_CheckModeCfgDate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_CheckModeCfgDate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.comboBox_CheckModeCfgDate.FormattingEnabled = true;
-            this.comboBox_CheckModeCfgDate.Location = new System.Drawing.Point(92, 6);
-            this.comboBox_CheckModeCfgDate.Name = "comboBox_CheckModeCfgDate";
-            this.comboBox_CheckModeCfgDate.Size = new System.Drawing.Size(137, 29);
-            this.comboBox_CheckModeCfgDate.TabIndex = 19;
+            this.中置电机ToolStripMenuItem.Checked = true;
+            this.中置电机ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.中置电机ToolStripMenuItem.Name = "中置电机ToolStripMenuItem";
+            this.中置电机ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.中置电机ToolStripMenuItem.Text = "中置电机";
+            this.中置电机ToolStripMenuItem.Click += new System.EventHandler(this.中置电机ToolStripMenuItem_Click);
+            // 
+            // 轮毂电机ToolStripMenuItem
+            // 
+            this.轮毂电机ToolStripMenuItem.Name = "轮毂电机ToolStripMenuItem";
+            this.轮毂电机ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.轮毂电机ToolStripMenuItem.Text = "轮毂电机";
+            this.轮毂电机ToolStripMenuItem.Click += new System.EventHandler(this.轮毂电机ToolStripMenuItem_Click);
             // 
             // mainForm
             // 
@@ -6494,5 +6523,8 @@ namespace Welling_Motor_Debug_Tool
         private CheckBox checkBox_CheckModeSN;
         private ComboBox comboBox_CheckModeCfgFile;
         private ComboBox comboBox_CheckModeCfgDate;
+        private ToolStripMenuItem 电机类型ToolStripMenuItem;
+        private ToolStripMenuItem 中置电机ToolStripMenuItem;
+        private ToolStripMenuItem 轮毂电机ToolStripMenuItem;
     }
 }

+ 128 - 10
Welling_Motor_Debug_Tool/mainForm.cs

@@ -111,7 +111,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "武汉Wuhan") || (EnterForm1.comboBox_User.Text == "越南Vietnam"))
+                    if (EnterForm1.comboBox_User.Text == "中置量产")
                     {                        
                         其它配置项ToolStripMenuItem.Visible = false;
                         配置ToolStripMenuItem.Visible = false;
@@ -129,8 +129,85 @@ namespace Welling_Motor_Debug_Tool
                         tabPage_ProductMode_Write.Parent = tabControl1;
                         tabPage_RunInfo.Parent = tabControl2;
                         tabPage_DebugInfo.Parent = null;
+                        中置电机ToolStripMenuItem.Checked = true;
+                        轮毂电机ToolStripMenuItem.Checked = false;
+                        toolStripTextBox_MACPD.Text = "MM_MC1";
+                        toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
+                        ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
+                    }
+                    else if (EnterForm1.comboBox_User.Text == "轮毂量产")
+                    {
+                        其它配置项ToolStripMenuItem.Visible = false;
+                        配置ToolStripMenuItem.Visible = false;
+                        tabPage_MotorParam.Parent = null;
+                        tabPage_BikeParam.Parent = null;
+                        tabPage_ControlParam.Parent = null;
+                        tabPage_SensorParam.Parent = null;
+                        tabPage_AssistParam.Parent = null;
+                        tabPage_DebugParam.Parent = null;
+                        tabPage_RecordInfo.Parent = null;
+                        tabPage_OtherInfo.Parent = null;
+                        tabPage_OBC.Parent = null;
+                        tabPage_RAMorFLASH.Parent = null;
+                        tabPage_FactoryMode.Parent = null;
+                        tabPage_ProductMode_Write.Parent = tabControl1;
+                        tabPage_RunInfo.Parent = tabControl2;
+                        tabPage_DebugInfo.Parent = null;
+                        中置电机ToolStripMenuItem.Checked = false;
+                        轮毂电机ToolStripMenuItem.Checked = true;
+                        toolStripTextBox_MACPD.Text = "GF_250_1";
+                        toolStripTextBox_ServerPath.Text = "HUB_Control_TEST";
+                        ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
+                    }
+                    else if (EnterForm1.comboBox_User.Text == "中置样机")
+                    {
+                        其它配置项ToolStripMenuItem.Visible = false;
+                        配置ToolStripMenuItem.Visible = false;
+                        tabPage_MotorParam.Parent = null;
+                        tabPage_BikeParam.Parent = null;
+                        tabPage_ControlParam.Parent = null;
+                        tabPage_SensorParam.Parent = null;
+                        tabPage_AssistParam.Parent = null;
+                        tabPage_DebugParam.Parent = null;
+                        tabPage_RecordInfo.Parent = null;
+                        tabPage_OtherInfo.Parent = null;
+                        tabPage_OBC.Parent = null;
+                        tabPage_RAMorFLASH.Parent = null;
+                        tabPage_FactoryMode.Parent = null;
+                        tabPage_ProductMode_Write.Parent = tabControl1;
+                        tabPage_RunInfo.Parent = tabControl2;
+                        tabPage_DebugInfo.Parent = null;
+                        中置电机ToolStripMenuItem.Checked = true;
+                        轮毂电机ToolStripMenuItem.Checked = false;
+                        toolStripTextBox_MACPD.Text = "MM_MC1";
+                        toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
+                        ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
                     }
-                    else if (EnterForm1.comboBox_User.Text == "工程Engineer")
+                    else if (EnterForm1.comboBox_User.Text == "轮毂样机")
+                    {
+                        其它配置项ToolStripMenuItem.Visible = false;
+                        配置ToolStripMenuItem.Visible = false;
+                        tabPage_MotorParam.Parent = null;
+                        tabPage_BikeParam.Parent = null;
+                        tabPage_ControlParam.Parent = null;
+                        tabPage_SensorParam.Parent = null;
+                        tabPage_AssistParam.Parent = null;
+                        tabPage_DebugParam.Parent = null;
+                        tabPage_RecordInfo.Parent = null;
+                        tabPage_OtherInfo.Parent = null;
+                        tabPage_OBC.Parent = null;
+                        tabPage_RAMorFLASH.Parent = null;
+                        tabPage_FactoryMode.Parent = null;
+                        tabPage_ProductMode_Write.Parent = tabControl1;
+                        tabPage_RunInfo.Parent = tabControl2;
+                        tabPage_DebugInfo.Parent = null;
+                        中置电机ToolStripMenuItem.Checked = false;
+                        轮毂电机ToolStripMenuItem.Checked = true;
+                        toolStripTextBox_MACPD.Text = "GF_250_1";
+                        toolStripTextBox_ServerPath.Text = "HUB_Control_TEST";
+                        ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
+                    }
+                    else if (EnterForm1.comboBox_User.Text == "工程")
                     {
                         其它配置项ToolStripMenuItem.Visible = true;
                         配置ToolStripMenuItem.Visible = true;
@@ -149,7 +226,7 @@ namespace Welling_Motor_Debug_Tool
                         tabPage_RunInfo.Parent = tabControl2;
                         tabPage_DebugInfo.Parent = null;
                     }
-                    else if (EnterForm1.comboBox_User.Text == "研发RD")
+                    else if (EnterForm1.comboBox_User.Text == "研发")
                     {
                         其它配置项ToolStripMenuItem.Visible = true;
                         配置ToolStripMenuItem.Visible = true;
@@ -231,6 +308,9 @@ namespace Welling_Motor_Debug_Tool
                     //Log Address
                     textBox_LogAddrBegin.Text = array_CfgInfo[25].ToString().Split(':')[1];
                     textBox_LogAddrEnd.Text = array_CfgInfo[26].ToString().Split(':')[1];
+                    //电机类型
+                    中置电机ToolStripMenuItem.Checked = (array_CfgInfo[29].ToString().Split(':')[1] == "True");
+                    轮毂电机ToolStripMenuItem.Checked = !中置电机ToolStripMenuItem.Checked;
                 }
                 catch (System.Exception)
                 {
@@ -4345,11 +4425,6 @@ namespace Welling_Motor_Debug_Tool
                     MessageBox.Show("SN无效,上传失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     break;
                 }
-                if (!textBox_FacModeName.Text.Contains("MIGIC"))
-                {
-                    MessageBox.Show("型号名无效,上传失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    break;
-                }
 
                 //设置文件存储路径
                 string Save_Path = localInfo.LocalPath  + DateTime.Now.ToString("yyyy-MM-dd") + "\\"; ;
@@ -5000,6 +5075,10 @@ namespace Welling_Motor_Debug_Tool
             CfgFileInfo += "[LogAddress]" + "\r\n";
             CfgFileInfo += "BeginAddress:" + textBox_LogAddrBegin.Text + "\r\n";
             CfgFileInfo += "EndAddress:" + textBox_LogAddrEnd.Text + "\r\n";
+            CfgFileInfo += "\r\n";
+            CfgFileInfo += "[MotorType]" + "\r\n";
+            CfgFileInfo += "MidMotor:" + 中置电机ToolStripMenuItem.Checked.ToString() + "\r\n";
+            CfgFileInfo += "HubMotor:" + 轮毂电机ToolStripMenuItem.Checked.ToString() + "\r\n";
             System.IO.File.WriteAllText(FileName, CfgFileInfo);
         }
 
@@ -5096,8 +5175,18 @@ namespace Welling_Motor_Debug_Tool
                     break;
                 }
                 string ScanInfo = scan_form.textBox_Code.Text;
-                string regexInfo = @"[0-9][0-9][V][0-9][0-9][0-9][W]";
-                string[] InfoList = Regex.Split(ScanInfo, regexInfo, RegexOptions.IgnoreCase);
+                string regexInfo = "";
+                string[] InfoList = { "" };
+                if (中置电机ToolStripMenuItem.Checked == true)
+                {
+                    regexInfo = @"[0-9][0-9][V][0-9][0-9][0-9][W]";
+                    InfoList = Regex.Split(ScanInfo, regexInfo, RegexOptions.IgnoreCase);
+                }
+                else if (轮毂电机ToolStripMenuItem.Checked == true)
+                {
+                    regexInfo = @"\s{2}";
+                    InfoList = Regex.Split(ScanInfo, regexInfo, RegexOptions.IgnoreCase);
+                }
                 if (InfoList.Length >= 2)
                 {
                     //写入型号
@@ -5236,6 +5325,35 @@ namespace Welling_Motor_Debug_Tool
                 产品标识ToolStripMenuItem.Visible = false;
             }
         }
+
+
+        /// <summary>
+        /// 切换电机类型
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void 中置电机ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            中置电机ToolStripMenuItem.Checked = true;
+            轮毂电机ToolStripMenuItem.Checked = false;
+            toolStripTextBox_MACPD.Text = "MM_MC1";
+            toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
+            ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
+        }
+
+        /// <summary>
+        /// 切换电机类型
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void 轮毂电机ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            中置电机ToolStripMenuItem.Checked = false;
+            轮毂电机ToolStripMenuItem.Checked = true;
+            toolStripTextBox_MACPD.Text = "GF_250_1";
+            toolStripTextBox_ServerPath.Text = "HUB_Control_TEST";
+            ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
+        }
     }
 
 

BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache