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

默认增加FCT账户,可离线使用。

Dail 1 год назад
Родитель
Сommit
34ae29c71d

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 1 - 0
Welling_Motor_Debug_Tool/Login.cs

@@ -41,6 +41,7 @@ namespace Welling_Motor_Debug_Tool
                     file.WriteLine("USER=轮毂量产检验,PASSWD=4");
                     file.WriteLine("USER=中置样机测试,PASSWD=5");
                     file.WriteLine("USER=轮毂样机测试,PASSWD=6");
+                    file.WriteLine("USER=FCT治具测试,PASSWD=7");
                     file.WriteLine("USER=工程参数配置,PASSWD=123456");
                     file.WriteLine("USER=研发调试,PASSWD=123456");
                     file.WriteLine("USER=管理员,PASSWD=ttium.123");

BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool_202404191530.exe


+ 21 - 21
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -647,7 +647,7 @@ namespace Welling_Motor_Debug_Tool
             // 刷新ToolStripMenuItem
             // 
             this.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem";
-            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.刷新ToolStripMenuItem.Text = "刷新";
             this.刷新ToolStripMenuItem.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click);
             // 
@@ -656,7 +656,7 @@ namespace Welling_Motor_Debug_Tool
             this.端口号ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_ComNum});
             this.端口号ToolStripMenuItem.Name = "端口号ToolStripMenuItem";
-            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.端口号ToolStripMenuItem.Text = "端口号";
             this.端口号ToolStripMenuItem.Click += new System.EventHandler(this.ConfigFileSave_Click);
             // 
@@ -674,7 +674,7 @@ namespace Welling_Motor_Debug_Tool
             this.波特率ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_Baudrate});
             this.波特率ToolStripMenuItem.Name = "波特率ToolStripMenuItem";
-            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.波特率ToolStripMenuItem.Text = "波特率";
             // 
             // toolStripComboBox_Baudrate
@@ -693,14 +693,14 @@ namespace Welling_Motor_Debug_Tool
             // 连接ToolStripMenuItem
             // 
             this.连接ToolStripMenuItem.Name = "连接ToolStripMenuItem";
-            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.连接ToolStripMenuItem.Text = "连接";
             this.连接ToolStripMenuItem.Click += new System.EventHandler(this.连接ToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
             // 
             // 其它配置项ToolStripMenuItem
             // 
@@ -709,7 +709,7 @@ namespace Welling_Motor_Debug_Tool
             this.断开关机ToolStripMenuItem,
             this.识别通讯盒ToolStripMenuItem});
             this.其它配置项ToolStripMenuItem.Name = "其它配置项ToolStripMenuItem";
-            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.其它配置项ToolStripMenuItem.Text = "其它配置项";
             // 
             // 连接开机ToolStripMenuItem
@@ -1025,7 +1025,7 @@ namespace Welling_Motor_Debug_Tool
             this.电压ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThVol});
             this.电压ToolStripMenuItem.Name = "电压ToolStripMenuItem";
-            this.电压ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.电压ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.电压ToolStripMenuItem.Text = "电压";
             // 
             // toolStripTextBox_ThVol
@@ -1041,7 +1041,7 @@ namespace Welling_Motor_Debug_Tool
             this.电流ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThCur});
             this.电流ToolStripMenuItem.Name = "电流ToolStripMenuItem";
-            this.电流ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.电流ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.电流ToolStripMenuItem.Text = "电流";
             // 
             // toolStripTextBox_ThCur
@@ -1057,7 +1057,7 @@ namespace Welling_Motor_Debug_Tool
             this.转速ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThSpeed});
             this.转速ToolStripMenuItem.Name = "转速ToolStripMenuItem";
-            this.转速ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.转速ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.转速ToolStripMenuItem.Text = "转速";
             // 
             // toolStripTextBox_ThSpeed
@@ -1073,7 +1073,7 @@ namespace Welling_Motor_Debug_Tool
             this.力矩ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThTor});
             this.力矩ToolStripMenuItem.Name = "力矩ToolStripMenuItem";
-            this.力矩ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.力矩ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.力矩ToolStripMenuItem.Text = "力矩";
             // 
             // toolStripTextBox_ThTor
@@ -1089,7 +1089,7 @@ namespace Welling_Motor_Debug_Tool
             this.踏频ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThCad});
             this.踏频ToolStripMenuItem.Name = "踏频ToolStripMenuItem";
-            this.踏频ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.踏频ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.踏频ToolStripMenuItem.Text = "踏频";
             // 
             // toolStripTextBox_ThCad
@@ -1105,7 +1105,7 @@ namespace Welling_Motor_Debug_Tool
             this.车速ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThBikeSpeed});
             this.车速ToolStripMenuItem.Name = "车速ToolStripMenuItem";
-            this.车速ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.车速ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.车速ToolStripMenuItem.Text = "车速";
             // 
             // toolStripTextBox_ThBikeSpeed
@@ -1121,7 +1121,7 @@ namespace Welling_Motor_Debug_Tool
             this.pCB温度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThT_PCB});
             this.pCB温度ToolStripMenuItem.Name = "pCB温度ToolStripMenuItem";
-            this.pCB温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.pCB温度ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.pCB温度ToolStripMenuItem.Text = "PCB温度";
             // 
             // toolStripTextBox_ThT_PCB
@@ -1137,7 +1137,7 @@ namespace Welling_Motor_Debug_Tool
             this.mCU温度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThT_MCU});
             this.mCU温度ToolStripMenuItem.Name = "mCU温度ToolStripMenuItem";
-            this.mCU温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.mCU温度ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.mCU温度ToolStripMenuItem.Text = "MCU温度";
             // 
             // toolStripTextBox_ThT_MCU
@@ -1153,7 +1153,7 @@ namespace Welling_Motor_Debug_Tool
             this.电机温度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripTextBox_ThT_Motor});
             this.电机温度ToolStripMenuItem.Name = "电机温度ToolStripMenuItem";
-            this.电机温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.电机温度ToolStripMenuItem.Size = new System.Drawing.Size(151, 26);
             this.电机温度ToolStripMenuItem.Text = "电机温度";
             // 
             // toolStripTextBox_ThT_Motor
@@ -4773,9 +4773,9 @@ namespace Welling_Motor_Debug_Tool
             this.comboBox_FacModeCfgFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_FacModeCfgFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_FacModeCfgFile.FormattingEnabled = true;
-            this.comboBox_FacModeCfgFile.Location = new System.Drawing.Point(235, 6);
+            this.comboBox_FacModeCfgFile.Location = new System.Drawing.Point(218, 6);
             this.comboBox_FacModeCfgFile.Name = "comboBox_FacModeCfgFile";
-            this.comboBox_FacModeCfgFile.Size = new System.Drawing.Size(680, 29);
+            this.comboBox_FacModeCfgFile.Size = new System.Drawing.Size(697, 29);
             this.comboBox_FacModeCfgFile.TabIndex = 8;
             // 
             // comboBox_FacModeCfgDate
@@ -4786,7 +4786,7 @@ namespace Welling_Motor_Debug_Tool
             this.comboBox_FacModeCfgDate.FormattingEnabled = true;
             this.comboBox_FacModeCfgDate.Location = new System.Drawing.Point(92, 6);
             this.comboBox_FacModeCfgDate.Name = "comboBox_FacModeCfgDate";
-            this.comboBox_FacModeCfgDate.Size = new System.Drawing.Size(137, 29);
+            this.comboBox_FacModeCfgDate.Size = new System.Drawing.Size(120, 29);
             this.comboBox_FacModeCfgDate.TabIndex = 8;
             this.comboBox_FacModeCfgDate.SelectionChangeCommitted += new System.EventHandler(this.comboBox_FacModeCfgDate_SelectionChangeCommitted);
             this.comboBox_FacModeCfgDate.Click += new System.EventHandler(this.comboBox_FacModeCfgDate_Click);
@@ -5057,9 +5057,9 @@ namespace Welling_Motor_Debug_Tool
             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.Location = new System.Drawing.Point(218, 6);
             this.comboBox_CheckModeCfgFile.Name = "comboBox_CheckModeCfgFile";
-            this.comboBox_CheckModeCfgFile.Size = new System.Drawing.Size(680, 29);
+            this.comboBox_CheckModeCfgFile.Size = new System.Drawing.Size(697, 29);
             this.comboBox_CheckModeCfgFile.TabIndex = 18;
             // 
             // groupBox31
@@ -5204,7 +5204,7 @@ namespace Welling_Motor_Debug_Tool
             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.Size = new System.Drawing.Size(120, 29);
             this.comboBox_CheckModeCfgDate.TabIndex = 19;
             this.comboBox_CheckModeCfgDate.SelectionChangeCommitted += new System.EventHandler(this.comboBox_CheckModeCfgDate_SelectionChangeCommitted);
             this.comboBox_CheckModeCfgDate.Click += new System.EventHandler(this.comboBox_CheckModeCfgDate_Click);

+ 69 - 2
Welling_Motor_Debug_Tool/mainForm.cs

@@ -143,7 +143,7 @@ namespace Welling_Motor_Debug_Tool
                 System.IO.File.WriteAllText(localInfo.LocalPath + localInfo.NoteFileName, "");
             }
 
-            //检查配置文件
+            //检查文件
             if (!Directory.Exists(localInfo.LocalPath))
             {
                 Directory.CreateDirectory(localInfo.LocalPath);
@@ -156,6 +156,12 @@ namespace Welling_Motor_Debug_Tool
             {
                 Directory.CreateDirectory(localInfo.ToolsPath);
             }
+            if (!Directory.Exists(localInfo.LocalPath + localInfo.CfgPathName))
+            {
+                Directory.CreateDirectory(localInfo.LocalPath + localInfo.CfgPathName);
+            }
+
+            //检查配置文件
             if (File.Exists(localInfo.LocalPath + localInfo.ConfigFileName)) //存在配置文件,导入配置信息
             {
                 //打开文件
@@ -358,6 +364,67 @@ namespace Welling_Motor_Debug_Tool
                             ConfigFileSave(false, localInfo.LocalPath + localInfo.ConfigFileName);
                         }
                     }
+                    else if (EnterForm1.comboBox_User.Text == "FCT治具测试")
+                    {
+                        //隐藏设置项
+                        其它配置项ToolStripMenuItem.Visible = false;
+                        写入存储ToolStripMenuItem.Visible = false;
+                        离线使用ToolStripMenuItem.Visible = false;
+                        服务器配置ToolStripMenuItem.Visible = false;
+                        判断阈值ToolStripMenuItem.Visible = false;
+                        力矩传感器检验ToolStripMenuItem.Visible = false;
+                        //显示生产信息
+                        生产信息ToolStripMenuItem.Visible = true;
+                        //显示电机类型,但不可编辑
+                        电机类型ToolStripMenuItem.Visible = true;
+                        中置电机ToolStripMenuItem.Enabled = true;
+                        轮毂电机ToolStripMenuItem.Enabled = true;
+                        //隐藏研发调试界面
+                        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_DebugInfo.Parent = null;
+                        //显示运行信息
+                        tabPage_RunInfo.Parent = tabControl2;
+                        //根据电机类型修改生产信息和电机类型
+                        if (EnterForm1.comboBox_User.Text.Contains("中置"))
+                        {
+                            中置电机ToolStripMenuItem.Checked = true;
+                            轮毂电机ToolStripMenuItem.Checked = false;
+                            toolStripTextBox_MACPD.Text = "MM_MC1";
+                            toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
+                            ConfigFileSave(false, localInfo.LocalPath + localInfo.ConfigFileName);
+                        }
+                        else if (EnterForm1.comboBox_User.Text.Contains("轮毂"))
+                        {
+                            中置电机ToolStripMenuItem.Checked = false;
+                            轮毂电机ToolStripMenuItem.Checked = true;
+                            toolStripTextBox_MACPD.Text = "GF_250_1";
+                            toolStripTextBox_ServerPath.Text = "HUB_Control_TEST";
+                            ConfigFileSave(false, localInfo.LocalPath + localInfo.ConfigFileName);
+                        }
+                        //显示量产测试界面
+                        tabPage_ProductMode_Write.Parent = tabControl1;
+                        tabPage_ProductMode_Write.Select();
+                        tabPage_ProductMode_Read.Parent = null;
+                        //允许离线使用
+                        允许ToolStripMenuItem.Checked = true;
+                        不允许ToolStripMenuItem.Checked = false;
+                        checkBox_OffLineFacMode.Checked = true;
+                        checkBox_OffLineFacMode.Enabled = true ;
+                        checkBox_OffLineCheckMode.Checked = true;
+                        checkBox_OffLineCheckMode.Enabled = true;
+                        //应答指令不提示
+                        ACK_DisFlag = false;
+                    }
                     else if (EnterForm1.comboBox_User.Text == "研发调试")
                     {
                         //隐藏量产界面
@@ -428,7 +495,7 @@ namespace Welling_Motor_Debug_Tool
                 myFtp.IsNetConnected = false;
                 if (允许ToolStripMenuItem.Checked == false) ///不允许离线使用,自动关闭 
                 {
-                    if (EnterForm1.comboBox_User.Text != "管理员")
+                    if ((EnterForm1.comboBox_User.Text != "管理员") && (EnterForm1.comboBox_User.Text != "FCT治具测试"))
                     {
                         timer_1s.Enabled = false;
                         MessageBox.Show("网络断开,将自动关闭!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

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


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb