瀏覽代碼

功能测试、参数写入、参数检验、生成参数都正常完成。
遗留:
1、测试是否需要自动连接和断开串口;
2、系统清除指令是否考虑多次发送,解决开机有故障码无法系统清除的问题;
3、增加Note,用于使用者记录信息。

Dail 1 年之前
父節點
當前提交
071383f2ec

+ 1 - 0
.gitignore

@@ -1 +1,2 @@
 /Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool_202305181600.exe
+/Welling_Motor_Debug_Tool/bin/Debug/Format/Test

二進制
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 1 - 1
Welling_Motor_Debug_Tool/GenerateParams.cs

@@ -481,7 +481,7 @@ namespace Welling_Motor_Debug_Tool
 
             //确定本地保存路径
             string Date = DateTime.Now.ToString("yyyy-MM-dd");
-            string LocalPath = localInfo.ConfigFilePath + "\\" + Date;            
+            string LocalPath = localInfo.LocalPath + "\\" + localInfo.CfgPathName + "\\" + Date;
             if (!Directory.Exists(LocalPath))
             {
                 Directory.CreateDirectory(LocalPath);

+ 0 - 1
Welling_Motor_Debug_Tool/LocalInfo.cs

@@ -10,7 +10,6 @@ namespace Welling_Motor_Debug_Tool
     {
         public string LocalPath = "C:\\Temp\\MotorTestTool\\"; //本地配置文件路径
         public string LocalDataPath = "C:\\Temp\\MotorTestTool\\DataLog\\"; //本地数据文件路径
-        public string ConfigFilePath = "C:\\Temp\\MotorTestTool\\Cfg\\";
         public string ConfigFileName = "Config.ttcfg"; //配置文件
         public string ToolsPath = "C:\\Temp\\MotorTestTool\\Tools";//工具路径
         public string TorqueSensorFileName = "TorqueSensor.ttcfg"; //配置文件

+ 1 - 1
Welling_Motor_Debug_Tool/TorqueParams.cs

@@ -52,7 +52,7 @@ namespace Welling_Motor_Debug_Tool
                     K2.Max = 2100;
                     K3.T = 600;
                     K3.Min = 2600;
-                    K3.Max = 3800;
+                    K3.Max = 2800;
                     K4.T = 800;
                     K4.Min = 3300;
                     K4.Max = 3500;

+ 0 - 241
Welling_Motor_Debug_Tool/bin/Debug/Format/Test/HUB_NM010-6G-36V-250W_Test_V1.0.0.0.0_20240304_Test_20240318.src

@@ -1,241 +0,0 @@
-#说明
-#0表示命令无效,1开启该命令的参数写入
-
-[型号],0
-电机型号,MIGIC T1
-
-[SN号],0
-电机SN,M220202A0001A
-
-[校验码],0
-校验码,MOTINOVA
-
-[自定义1],0
-自定义字符串1,1111
-
-[自定义2],0
-自定义字符串2,2222
-
-[自定义3],0
-自定义字符串3,3333
-
-[生产信息],1
-生产商,TTIUM
-生产地,WUHAN
-生产日期,20220101
-生产表示,GF_250_1
-
-[马达信息],1
-存储标志,1
-极对数,8
-电阻,1260
-d轴电感,51580
-q轴电感,59220
-永磁体磁链,24000
-Id最大值,0
-Id最最小,-157
-额定转速,860
-额定功率,250
-额定电流,2500
-额定电压,360
-惯量,1000
-最大转矩,95
-预留1,0
-预留2,0
-预留3,0
-预留4,0
-预留5,0
-预留6,0
-
-[整车参数],1
-存储标志,1
-轮胎周长,219
-电控传动比,4419
-助力最大限速,25
-推行模式限速,5
-前牙盘,38
-后牙盘,11
-助力方案1,341
-助力方案2,682
-前后灯参数,9734
-周长微调,0
-启动模式,2
-开关机时间,16399
-预留1,0
-
-[控制参数],1
-存储标志,1
-位置传感器零点,0
-位置传感器当前零点,0
-峰值电流,4200
-过流保护阈值,5000
-最高档位过压保护阈值,460
-最高档位欠压保护阈值,300
-超速保护阈值,6000
-控制器过热保护阈值,105
-控制器过热恢复阈值,90
-控制器过热降额阈值,90
-电机过热保护阈值,110
-电机过热恢复阈值,95
-电机过热降额阈值,95
-预留1,0
-预留2,0
-预留3,0
-
-[力矩传感器参数],0
-存储标志,1
-出厂零点,600
-历史零点1,0
-历史零点2,0
-历史零点3,0
-最新零点,600
-最大转矩,850
-第一阶段加载值,240
-第一阶段采集值,1428
-第二阶段加载值,480
-第二阶段采集值,1986
-第三阶段加载值,720
-第三阶段采集值,2545
-第四阶段加载值,960
-第四阶段采集值,3104
-
-[其它传感器参数],1
-存储标志,1
-踏频一圈脉冲数,38
-车速一圈脉冲数,1
-
-[助力参数],1
-存储标志,1
-空,0
-零速启动增益,4095
-巡航启动增益,4096
-转矩曲线1a,0
-转矩曲线1b,0
-转矩曲线1c,2048
-转矩曲线1d,137
-转矩曲线2a,0
-转矩曲线2b,0
-转矩曲线2c,2458
-转矩曲线2d,137
-转矩曲线3a,0
-转矩曲线3b,0
-转矩曲线3c,2867
-转矩曲线3d,137
-转矩曲线4a,0
-转矩曲线4b,7004
-转矩曲线4c,409
-转矩曲线4d,273
-转矩曲线5a,0
-转矩曲线5b,9216
-转矩曲线5c,409
-转矩曲线5d,273
-转矩曲线6a,0
-转矩曲线6b,12165
-转矩曲线6c,409
-转矩曲线6d,273
-转矩曲线7a,3318
-转矩曲线7b,15852
-转矩曲线7c,0
-转矩曲线7d,137
-转矩曲线8a,9953
-转矩曲线8b,21012
-转矩曲线8c,0
-转矩曲线8d,137
-转矩曲线9a,36495
-转矩曲线9b,22855
-转矩曲线9c,0
-转矩曲线9d,137
-转矩曲线10a,66355
-转矩曲线10b,29491
-转矩曲线10c,0
-转矩曲线10d,137
-转矩曲线11a,132710
-转矩曲线11b,29491
-转矩曲线11c,0
-转矩曲线11d,137
-转矩曲线12a,232243
-转矩曲线12b,29491
-转矩曲线12c,0
-转矩曲线12d,137
-转矩曲线13a,66355
-转矩曲线13b,29491
-转矩曲线13c,0
-转矩曲线13d,-683
-转矩曲线14a,132710
-转矩曲线14b,29491
-转矩曲线14c,0
-转矩曲线14d,-683
-转矩曲线15a,232243
-转矩曲线15b,29491
-转矩曲线15c,0
-转矩曲线15d,-683
-踏频曲线1a,0
-踏频曲线1b,0
-踏频曲线1c,10000
-踏频曲线1d,0
-踏频曲线2a,0
-踏频曲线2b,0
-踏频曲线2c,10000
-踏频曲线2d,0
-踏频曲线3a,0
-踏频曲线3b,0
-踏频曲线3c,10000
-踏频曲线3d,0
-踏频曲线4a,0
-踏频曲线4b,0
-踏频曲线4c,10000
-踏频曲线4d,0
-踏频曲线5a,0
-踏频曲线5b,0
-踏频曲线5c,10000
-踏频曲线5d,0
-助力启动阈值,50
-助力停止阈值,50
-启动时电流增长阶梯,20
-启动踏频脉冲数,700
-转矩滤波脉冲数,64
-待速转速,5
-待速最大电流,500
-车速限幅启动阈值,25
-车速限幅停止阈值,27
-踏频占比,50
-踏频助力Kp,20000
-踏频助力加速限制,-20000
-踏频助力退饱和步进,500
-踏频助力电流步进,1000
-预留1,0
-预留2,0
-预留3,0
-预留4,0
-
-[调试参数],0
-存储标志,1
-整体运行模式,5
-位置获取模式,2
-采样模式,3
-旋转方向,1
-定位电流,1000
-拖拽电压,10
-拖拽电流,1000
-拖拽频率,20
-加速斜率,500
-减速斜率,100
-转速环控制器带宽,8
-转速环控制器m,16
-电流环控制器带宽,200
-电流环控制器m,3
-磁链观测器带宽,10
-磁链观测器m,10
-锁相环带宽,150
-锁相环m,10
-惯量,1000
-PWM 最大占空比,900
-PWM七段式切五段式阈值,700
-功率限幅值,6980
-功率Error,500
-功率限幅Kp,120
-功率限幅Ki,100
-预留1,1
-预留2,2
-预留3,3
-预留4,4

+ 3 - 0
Welling_Motor_Debug_Tool/bin/Debug/Format/说明.txt

@@ -0,0 +1,3 @@
+1、ConsoleApp2.exe、Newtonsoft.Json.dll、Newtonsoft.Json.xml放到服务器Tools/GenerateParamsFile目录下;
+2、新版本更新时,需要修改文件名,程序中修改为新的文件名,避免客户机用本地旧版本;
+3、程序使用方法,终端中运行./ConsoleApp2.exe 文件.src,转换文件名一致,在相同目录下,格式名.ttcfg。 

二進制
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.exe


二進制
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.pdb


+ 87 - 80
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -551,8 +551,8 @@ namespace Welling_Motor_Debug_Tool
             this.label_StarInfo = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.屏幕键盘ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.checkBox_FacLocal = new System.Windows.Forms.CheckBox();
-            this.checkBox1 = new System.Windows.Forms.CheckBox();
+            this.checkBox_OffLineFacMode = new System.Windows.Forms.CheckBox();
+            this.checkBox_OffLineCheckMode = new System.Windows.Forms.CheckBox();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -647,7 +647,7 @@ namespace Welling_Motor_Debug_Tool
             // 刷新ToolStripMenuItem
             // 
             this.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem";
-            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.刷新ToolStripMenuItem.Text = "刷新";
             this.刷新ToolStripMenuItem.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click);
             // 
@@ -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(160, 26);
+            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(160, 26);
+            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(160, 26);
+            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.连接ToolStripMenuItem.Text = "连接";
             this.连接ToolStripMenuItem.Click += new System.EventHandler(this.连接ToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
             // 
             // 其它配置项ToolStripMenuItem
             // 
@@ -709,7 +709,7 @@ namespace Welling_Motor_Debug_Tool
             this.断开关机ToolStripMenuItem,
             this.识别通讯盒ToolStripMenuItem});
             this.其它配置项ToolStripMenuItem.Name = "其它配置项ToolStripMenuItem";
-            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
+            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.其它配置项ToolStripMenuItem.Text = "其它配置项";
             // 
             // 连接开机ToolStripMenuItem
@@ -798,17 +798,17 @@ namespace Welling_Motor_Debug_Tool
             // 
             // 允许ToolStripMenuItem
             // 
-            this.允许ToolStripMenuItem.Checked = true;
-            this.允许ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
             this.允许ToolStripMenuItem.Name = "允许ToolStripMenuItem";
-            this.允许ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
+            this.允许ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.允许ToolStripMenuItem.Text = "允许";
             this.允许ToolStripMenuItem.Click += new System.EventHandler(this.允许ToolStripMenuItem_Click);
             // 
             // 不允许ToolStripMenuItem
             // 
+            this.不允许ToolStripMenuItem.Checked = true;
+            this.不允许ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
             this.不允许ToolStripMenuItem.Name = "不允许ToolStripMenuItem";
-            this.不允许ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
+            this.不允许ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.不允许ToolStripMenuItem.Text = "不允许";
             this.不允许ToolStripMenuItem.Click += new System.EventHandler(this.不允许ToolStripMenuItem_Click);
             // 
@@ -869,7 +869,7 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripTextBox_ServerUser.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
             this.toolStripTextBox_ServerUser.Name = "toolStripTextBox_ServerUser";
             this.toolStripTextBox_ServerUser.Size = new System.Drawing.Size(200, 28);
-            this.toolStripTextBox_ServerUser.Text = "factory_test_admin";
+            this.toolStripTextBox_ServerUser.Text = "factory_test";
             this.toolStripTextBox_ServerUser.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
             // 
             // 存储路径ToolStripMenuItem
@@ -901,7 +901,7 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripTextBox_ServerPasswd.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
             this.toolStripTextBox_ServerPasswd.Name = "toolStripTextBox_ServerPasswd";
             this.toolStripTextBox_ServerPasswd.Size = new System.Drawing.Size(200, 28);
-            this.toolStripTextBox_ServerPasswd.Text = "ttium_admin";
+            this.toolStripTextBox_ServerPasswd.Text = "ttium";
             this.toolStripTextBox_ServerPasswd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
             // 
             // 生产信息ToolStripMenuItem
@@ -920,7 +920,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
@@ -936,7 +936,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
@@ -952,7 +952,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
@@ -968,7 +968,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
@@ -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(151, 26);
+            this.电压ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.电流ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.转速ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.力矩ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.踏频ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.车速ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.pCB温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.mCU温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 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(151, 26);
+            this.电机温度ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.电机温度ToolStripMenuItem.Text = "电机温度";
             // 
             // toolStripTextBox_ThT_Motor
@@ -1225,14 +1225,14 @@ namespace Welling_Motor_Debug_Tool
             // 调试记录数据ToolStripMenuItem
             // 
             this.调试记录数据ToolStripMenuItem.Name = "调试记录数据ToolStripMenuItem";
-            this.调试记录数据ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
+            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(176, 26);
+            this.生产记录数据ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.生产记录数据ToolStripMenuItem.Text = "生产记录数据";
             this.生产记录数据ToolStripMenuItem.Click += new System.EventHandler(this.生产记录数据ToolStripMenuItem_Click);
             // 
@@ -1250,13 +1250,13 @@ namespace Welling_Motor_Debug_Tool
             // 帮助ToolStripMenuItem
             // 
             this.帮助ToolStripMenuItem.Name = "帮助ToolStripMenuItem";
-            this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
+            this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.帮助ToolStripMenuItem.Text = "查看帮助";
             // 
             // 版本ToolStripMenuItem
             // 
             this.版本ToolStripMenuItem.Name = "版本ToolStripMenuItem";
-            this.版本ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
+            this.版本ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.版本ToolStripMenuItem.Text = "版本信息";
             // 
             // 累计运行时间ToolStripMenuItem
@@ -1264,14 +1264,14 @@ namespace Welling_Motor_Debug_Tool
             this.累计运行时间ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripMenuItem_RunTime});
             this.累计运行时间ToolStripMenuItem.Name = "累计运行时间ToolStripMenuItem";
-            this.累计运行时间ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
-            this.累计运行时间ToolStripMenuItem.Text = "累计运行时间";
+            this.累计运行时间ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.累计运行时间ToolStripMenuItem.Text = "运行时间";
             this.累计运行时间ToolStripMenuItem.MouseHover += new System.EventHandler(this.累计运行时间ToolStripMenuItem_MouseHover);
             // 
             // toolStripMenuItem_RunTime
             // 
             this.toolStripMenuItem_RunTime.Name = "toolStripMenuItem_RunTime";
-            this.toolStripMenuItem_RunTime.Size = new System.Drawing.Size(142, 26);
+            this.toolStripMenuItem_RunTime.Size = new System.Drawing.Size(180, 26);
             this.toolStripMenuItem_RunTime.Text = "00:00:00";
             // 
             // statusStrip1
@@ -3703,7 +3703,7 @@ namespace Welling_Motor_Debug_Tool
             this.button_ScanCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
             this.button_ScanCode.Location = new System.Drawing.Point(704, 248);
             this.button_ScanCode.Name = "button_ScanCode";
-            this.button_ScanCode.Size = new System.Drawing.Size(68, 60);
+            this.button_ScanCode.Size = new System.Drawing.Size(65, 60);
             this.button_ScanCode.TabIndex = 34;
             this.button_ScanCode.Text = "扫码\r\n写入";
             this.button_ScanCode.UseVisualStyleBackColor = false;
@@ -3714,7 +3714,7 @@ namespace Welling_Motor_Debug_Tool
             this.Button_FacModePowerOff.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
             this.Button_FacModePowerOff.Location = new System.Drawing.Point(917, 248);
             this.Button_FacModePowerOff.Name = "Button_FacModePowerOff";
-            this.Button_FacModePowerOff.Size = new System.Drawing.Size(68, 60);
+            this.Button_FacModePowerOff.Size = new System.Drawing.Size(65, 60);
             this.Button_FacModePowerOff.TabIndex = 33;
             this.Button_FacModePowerOff.Text = "关机";
             this.Button_FacModePowerOff.UseVisualStyleBackColor = false;
@@ -3725,9 +3725,9 @@ namespace Welling_Motor_Debug_Tool
             this.Button_FacModeSaveResult.BackColor = System.Drawing.Color.Lime;
             this.Button_FacModeSaveResult.Location = new System.Drawing.Point(846, 248);
             this.Button_FacModeSaveResult.Name = "Button_FacModeSaveResult";
-            this.Button_FacModeSaveResult.Size = new System.Drawing.Size(68, 60);
+            this.Button_FacModeSaveResult.Size = new System.Drawing.Size(65, 60);
             this.Button_FacModeSaveResult.TabIndex = 1;
-            this.Button_FacModeSaveResult.Text = "保存\r\n数据";
+            this.Button_FacModeSaveResult.Text = "保存数据";
             this.Button_FacModeSaveResult.UseVisualStyleBackColor = false;
             this.Button_FacModeSaveResult.Click += new System.EventHandler(this.Button_FacModeSaveResult_Click);
             // 
@@ -3736,9 +3736,9 @@ namespace Welling_Motor_Debug_Tool
             this.Button_FacModeSetMacDate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
             this.Button_FacModeSetMacDate.Location = new System.Drawing.Point(775, 248);
             this.Button_FacModeSetMacDate.Name = "Button_FacModeSetMacDate";
-            this.Button_FacModeSetMacDate.Size = new System.Drawing.Size(68, 60);
+            this.Button_FacModeSetMacDate.Size = new System.Drawing.Size(65, 60);
             this.Button_FacModeSetMacDate.TabIndex = 33;
-            this.Button_FacModeSetMacDate.Text = "写入生\r\n产信息";
+            this.Button_FacModeSetMacDate.Text = "生产日期";
             this.Button_FacModeSetMacDate.UseVisualStyleBackColor = false;
             this.Button_FacModeSetMacDate.Click += new System.EventHandler(this.Button_FacModeSetMacDate_Click);
             // 
@@ -3770,9 +3770,9 @@ namespace Welling_Motor_Debug_Tool
             // button_FacModeSetName
             // 
             this.button_FacModeSetName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.button_FacModeSetName.Location = new System.Drawing.Point(227, 29);
+            this.button_FacModeSetName.Location = new System.Drawing.Point(213, 29);
             this.button_FacModeSetName.Name = "button_FacModeSetName";
-            this.button_FacModeSetName.Size = new System.Drawing.Size(54, 29);
+            this.button_FacModeSetName.Size = new System.Drawing.Size(65, 29);
             this.button_FacModeSetName.TabIndex = 28;
             this.button_FacModeSetName.Text = "写入";
             this.button_FacModeSetName.UseVisualStyleBackColor = false;
@@ -3792,7 +3792,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeGit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeGit.Location = new System.Drawing.Point(54, 174);
             this.textBox_FacModeGit.Name = "textBox_FacModeGit";
-            this.textBox_FacModeGit.Size = new System.Drawing.Size(227, 28);
+            this.textBox_FacModeGit.Size = new System.Drawing.Size(153, 28);
             this.textBox_FacModeGit.TabIndex = 26;
             // 
             // label86
@@ -3809,7 +3809,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeSP.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeSP.Location = new System.Drawing.Point(54, 145);
             this.textBox_FacModeSP.Name = "textBox_FacModeSP";
-            this.textBox_FacModeSP.Size = new System.Drawing.Size(227, 28);
+            this.textBox_FacModeSP.Size = new System.Drawing.Size(223, 28);
             this.textBox_FacModeSP.TabIndex = 24;
             // 
             // label68
@@ -3838,15 +3838,15 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeFW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeFW.Location = new System.Drawing.Point(54, 116);
             this.textBox_FacModeFW.Name = "textBox_FacModeFW";
-            this.textBox_FacModeFW.Size = new System.Drawing.Size(227, 28);
+            this.textBox_FacModeFW.Size = new System.Drawing.Size(223, 28);
             this.textBox_FacModeFW.TabIndex = 13;
             // 
             // Button_FacModeReadVer
             // 
             this.Button_FacModeReadVer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
-            this.Button_FacModeReadVer.Location = new System.Drawing.Point(213, 202);
+            this.Button_FacModeReadVer.Location = new System.Drawing.Point(213, 174);
             this.Button_FacModeReadVer.Name = "Button_FacModeReadVer";
-            this.Button_FacModeReadVer.Size = new System.Drawing.Size(68, 34);
+            this.Button_FacModeReadVer.Size = new System.Drawing.Size(65, 60);
             this.Button_FacModeReadVer.TabIndex = 11;
             this.Button_FacModeReadVer.Text = "查询";
             this.Button_FacModeReadVer.UseVisualStyleBackColor = false;
@@ -3866,15 +3866,15 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeHW.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeHW.Location = new System.Drawing.Point(54, 87);
             this.textBox_FacModeHW.Name = "textBox_FacModeHW";
-            this.textBox_FacModeHW.Size = new System.Drawing.Size(227, 28);
+            this.textBox_FacModeHW.Size = new System.Drawing.Size(223, 28);
             this.textBox_FacModeHW.TabIndex = 10;
             // 
             // Button_FacModeSetNum
             // 
             this.Button_FacModeSetNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            this.Button_FacModeSetNum.Location = new System.Drawing.Point(227, 58);
+            this.Button_FacModeSetNum.Location = new System.Drawing.Point(213, 58);
             this.Button_FacModeSetNum.Name = "Button_FacModeSetNum";
-            this.Button_FacModeSetNum.Size = new System.Drawing.Size(54, 29);
+            this.Button_FacModeSetNum.Size = new System.Drawing.Size(65, 29);
             this.Button_FacModeSetNum.TabIndex = 8;
             this.Button_FacModeSetNum.Text = "写入";
             this.Button_FacModeSetNum.UseVisualStyleBackColor = false;
@@ -3894,7 +3894,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeNum.Location = new System.Drawing.Point(54, 58);
             this.textBox_FacModeNum.Name = "textBox_FacModeNum";
-            this.textBox_FacModeNum.Size = new System.Drawing.Size(167, 28);
+            this.textBox_FacModeNum.Size = new System.Drawing.Size(153, 28);
             this.textBox_FacModeNum.TabIndex = 7;
             // 
             // label81
@@ -3911,7 +3911,7 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.textBox_FacModeName.Location = new System.Drawing.Point(54, 29);
             this.textBox_FacModeName.Name = "textBox_FacModeName";
-            this.textBox_FacModeName.Size = new System.Drawing.Size(167, 28);
+            this.textBox_FacModeName.Size = new System.Drawing.Size(153, 28);
             this.textBox_FacModeName.TabIndex = 4;
             // 
             // groupBox22
@@ -3963,6 +3963,7 @@ namespace Welling_Motor_Debug_Tool
             // 
             // trackBar_FacModeMotorSpeedAdj
             // 
+            this.trackBar_FacModeMotorSpeedAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
             this.trackBar_FacModeMotorSpeedAdj.Location = new System.Drawing.Point(204, 48);
             this.trackBar_FacModeMotorSpeedAdj.Maximum = 100;
             this.trackBar_FacModeMotorSpeedAdj.Name = "trackBar_FacModeMotorSpeedAdj";
@@ -3993,6 +3994,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox21.Controls.Add(this.checkBox_FacModeCheckMotor);
             this.groupBox21.Controls.Add(this.checkBox_FacModeCheckNTC);
             this.groupBox21.Controls.Add(this.checkBox_FacModeCheckVol);
+            this.groupBox21.Enabled = false;
             this.groupBox21.Location = new System.Drawing.Point(190, 3);
             this.groupBox21.Name = "groupBox21";
             this.groupBox21.Size = new System.Drawing.Size(508, 96);
@@ -4283,7 +4285,8 @@ namespace Welling_Motor_Debug_Tool
             // 
             // button_FacModeInit
             // 
-            this.button_FacModeInit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
+            this.button_FacModeInit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.button_FacModeInit.ForeColor = System.Drawing.Color.White;
             this.button_FacModeInit.Location = new System.Drawing.Point(26, 29);
             this.button_FacModeInit.Name = "button_FacModeInit";
             this.button_FacModeInit.Size = new System.Drawing.Size(126, 51);
@@ -4304,7 +4307,7 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_ProductMode_Write.Controls.Add(this.textBox_FacModeScan);
             this.tabPage_ProductMode_Write.Controls.Add(this.label112);
             this.tabPage_ProductMode_Write.Controls.Add(this.label_FacModeStatus);
-            this.tabPage_ProductMode_Write.Controls.Add(this.checkBox_FacLocal);
+            this.tabPage_ProductMode_Write.Controls.Add(this.checkBox_OffLineFacMode);
             this.tabPage_ProductMode_Write.Controls.Add(this.label_FacModeResult);
             this.tabPage_ProductMode_Write.Controls.Add(this.label111);
             this.tabPage_ProductMode_Write.Location = new System.Drawing.Point(4, 30);
@@ -4884,6 +4887,8 @@ namespace Welling_Motor_Debug_Tool
             // checkBox_FacModeBMS
             // 
             this.checkBox_FacModeBMS.AutoSize = true;
+            this.checkBox_FacModeBMS.Checked = true;
+            this.checkBox_FacModeBMS.CheckState = System.Windows.Forms.CheckState.Checked;
             this.checkBox_FacModeBMS.Enabled = false;
             this.checkBox_FacModeBMS.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.checkBox_FacModeBMS.Location = new System.Drawing.Point(6, 80);
@@ -4995,7 +5000,7 @@ namespace Welling_Motor_Debug_Tool
             // tabPage_ProductMode_Read
             // 
             this.tabPage_ProductMode_Read.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
-            this.tabPage_ProductMode_Read.Controls.Add(this.checkBox1);
+            this.tabPage_ProductMode_Read.Controls.Add(this.checkBox_OffLineCheckMode);
             this.tabPage_ProductMode_Read.Controls.Add(this.comboBox_CheckModeCfgFile);
             this.tabPage_ProductMode_Read.Controls.Add(this.groupBox31);
             this.tabPage_ProductMode_Read.Controls.Add(this.comboBox_CheckModeCfgDate);
@@ -6233,29 +6238,31 @@ namespace Welling_Motor_Debug_Tool
             this.屏幕键盘ToolStripMenuItem.Text = "屏幕键盘";
             this.屏幕键盘ToolStripMenuItem.Click += new System.EventHandler(this.屏幕键盘ToolStripMenuItem_Click);
             // 
-            // checkBox_FacLocal
-            // 
-            this.checkBox_FacLocal.AutoSize = true;
-            this.checkBox_FacLocal.Enabled = false;
-            this.checkBox_FacLocal.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox_FacLocal.Location = new System.Drawing.Point(920, 8);
-            this.checkBox_FacLocal.Name = "checkBox_FacLocal";
-            this.checkBox_FacLocal.Size = new System.Drawing.Size(61, 25);
-            this.checkBox_FacLocal.TabIndex = 0;
-            this.checkBox_FacLocal.Text = "本地";
-            this.checkBox_FacLocal.UseVisualStyleBackColor = true;
-            // 
-            // checkBox1
-            // 
-            this.checkBox1.AutoSize = true;
-            this.checkBox1.Enabled = false;
-            this.checkBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.checkBox1.Location = new System.Drawing.Point(920, 8);
-            this.checkBox1.Name = "checkBox1";
-            this.checkBox1.Size = new System.Drawing.Size(61, 25);
-            this.checkBox1.TabIndex = 21;
-            this.checkBox1.Text = "本地";
-            this.checkBox1.UseVisualStyleBackColor = true;
+            // checkBox_OffLineFacMode
+            // 
+            this.checkBox_OffLineFacMode.AutoSize = true;
+            this.checkBox_OffLineFacMode.Enabled = false;
+            this.checkBox_OffLineFacMode.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.checkBox_OffLineFacMode.Location = new System.Drawing.Point(920, 8);
+            this.checkBox_OffLineFacMode.Name = "checkBox_OffLineFacMode";
+            this.checkBox_OffLineFacMode.Size = new System.Drawing.Size(61, 25);
+            this.checkBox_OffLineFacMode.TabIndex = 0;
+            this.checkBox_OffLineFacMode.Text = "本地";
+            this.checkBox_OffLineFacMode.UseVisualStyleBackColor = true;
+            this.checkBox_OffLineFacMode.CheckedChanged += new System.EventHandler(this.checkBox_OffLineFacMode_CheckedChanged);
+            // 
+            // checkBox_OffLineCheckMode
+            // 
+            this.checkBox_OffLineCheckMode.AutoSize = true;
+            this.checkBox_OffLineCheckMode.Enabled = false;
+            this.checkBox_OffLineCheckMode.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.checkBox_OffLineCheckMode.Location = new System.Drawing.Point(920, 8);
+            this.checkBox_OffLineCheckMode.Name = "checkBox_OffLineCheckMode";
+            this.checkBox_OffLineCheckMode.Size = new System.Drawing.Size(61, 25);
+            this.checkBox_OffLineCheckMode.TabIndex = 21;
+            this.checkBox_OffLineCheckMode.Text = "本地";
+            this.checkBox_OffLineCheckMode.UseVisualStyleBackColor = true;
+            this.checkBox_OffLineCheckMode.CheckedChanged += new System.EventHandler(this.checkBox_OffLineCheckMode_CheckedChanged);
             // 
             // mainForm
             // 
@@ -6912,7 +6919,7 @@ namespace Welling_Motor_Debug_Tool
         private PictureBox pictureBox_WriteLock;
         private PictureBox pictureBox_ReadLock;
         private ToolStripMenuItem 屏幕键盘ToolStripMenuItem;
-        private CheckBox checkBox_FacLocal;
-        private CheckBox checkBox1;
+        private CheckBox checkBox_OffLineFacMode;
+        private CheckBox checkBox_OffLineCheckMode;
     }
 }

+ 135 - 43
Welling_Motor_Debug_Tool/mainForm.cs

@@ -141,10 +141,6 @@ namespace Welling_Motor_Debug_Tool
             {
                 Directory.CreateDirectory(localInfo.LocalPath);
             }
-            if (!Directory.Exists(localInfo.ConfigFilePath))
-            {
-                Directory.CreateDirectory(localInfo.ConfigFilePath);
-            }
             if (!Directory.Exists(localInfo.LocalDataPath))
             {
                 Directory.CreateDirectory(localInfo.LocalDataPath);
@@ -181,6 +177,20 @@ namespace Welling_Motor_Debug_Tool
                     写入存储ToolStripMenuItem.Checked = (array_CfgInfo[8].ToString().Split(':')[1] == "True");
                     允许ToolStripMenuItem.Checked = (array_CfgInfo[9].ToString().Split(':')[1] == "True");
                     不允许ToolStripMenuItem.Checked = (array_CfgInfo[9].ToString().Split(':')[1] == "False");
+                    if (array_CfgInfo[9].ToString().Split(':')[1] == "False")
+                    {
+                        checkBox_OffLineFacMode.Checked = false;
+                        checkBox_OffLineFacMode.Enabled = false;
+                        checkBox_OffLineCheckMode.Checked = false;
+                        checkBox_OffLineCheckMode.Enabled = false;
+                    }
+                    else
+                    {
+                        checkBox_OffLineFacMode.Checked = false;
+                        checkBox_OffLineFacMode.Enabled = true;
+                        checkBox_OffLineCheckMode.Checked = false;
+                        checkBox_OffLineCheckMode.Enabled = true;
+                    }
                     //Server Set
                     toolStripTextBox_ServerIP.Text = array_CfgInfo[12].ToString().Split(':')[1];
                     toolStripTextBox_ServerPort.Text = array_CfgInfo[13].ToString().Split(':')[1];
@@ -1561,7 +1571,7 @@ namespace Welling_Motor_Debug_Tool
                                         textBox_SP.Text += ((char)Data[i]).ToString();
                                         textBox_OBC_ReadSP.Text += ((char)Data[i]).ToString();
                                         textBox_FacModeSP.Text += ((char)Data[i]).ToString();
-                                    }
+                                    }                                    
                                     //Git提交版本信息
                                     textBox_FacModeGit.Text = "";
                                     for (ushort i = 0; i < 9; i++)
@@ -1569,8 +1579,7 @@ namespace Welling_Motor_Debug_Tool
                                         textBox_SP.Text += ((char)Data[23 + i]).ToString();
                                         textBox_FacModeGit.Text += ((char)Data[23 + i]).ToString();
                                     }
-
-                                    Class_Motor_Ver.Special = textBox_SP.Text + " " + textBox_FacModeGit.Text;
+                                    Class_Motor_Ver.Special = textBox_SP.Text;
                                 }));
                             }
                             break;
@@ -4156,7 +4165,7 @@ namespace Welling_Motor_Debug_Tool
                 }
 
                 //设置文件存储路径
-                string Save_Path = localInfo.LocalPath + DateTime.Now.ToString("yyyy-MM-dd") + "\\"; ;
+                string Save_Path = localInfo.LocalPath + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
                 string PD_PathName = textBox_FacModeName.Text + "_" + textBox_FacModeNum.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_"); ;
                 Save_Path += PD_PathName;
                 if (!Directory.Exists(Save_Path))
@@ -4241,7 +4250,7 @@ namespace Welling_Motor_Debug_Tool
                     {
                         myFtp.MakeDir(toolStripTextBox_ServerPath.Text);
                     }
-                    if (myFtp.DirectoryExist("\\", toolStripTextBox_ServerPath.Text + "\\Samples") == false)
+                    if (myFtp.DirectoryExist(toolStripTextBox_ServerPath.Text, "Samples") == false)
                     {
                         myFtp.MakeDir(toolStripTextBox_ServerPath.Text + "\\Samples");
                     }
@@ -5104,8 +5113,18 @@ namespace Welling_Motor_Debug_Tool
         private void GetDateList(bool DisAll)
         {
             string[] DateList = { "" };
+
             //从服务器更新日期列表
-            DateList = myFtp.GetDirectoryList(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName);
+            if ((checkBox_OffLineFacMode.Checked == false) && (checkBox_OffLineCheckMode.Checked == false))
+            {
+                DateList = myFtp.GetDirectoryList(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName);
+            }
+            //从本地更新日期列表
+            else
+            {
+                DateList = Directory.GetDirectories(localInfo.LocalPath + "\\" + localInfo.CfgPathName);
+            }
+            
             comboBox_FacModeCfgDate.Items.Clear();
             comboBox_CheckModeCfgDate.Items.Clear();
 
@@ -5146,11 +5165,20 @@ namespace Welling_Motor_Debug_Tool
         private void GetFileListFrom(string date)
         {
             string[] FileList = { "" };
+
             //从服务器更新文件列表
-            FileList = myFtp.GetFileNameList(toolStripTextBox_ServerPath.Text + "/cfg/" + date);
+            if ((checkBox_OffLineFacMode.Checked == false) && (checkBox_OffLineCheckMode.Checked == false))
+            {                
+                FileList = myFtp.GetFileNameList(toolStripTextBox_ServerPath.Text + "/cfg/" + date);
+            }
+            else
+            {
+                FileList = Directory.GetFiles(localInfo.LocalPath + "\\" + localInfo.CfgPathName + "\\" + date);
+            }                
 
             comboBox_CheckModeCfgFile.Items.Clear();
             comboBox_FacModeCfgFile.Items.Clear();
+
             foreach (var file in FileList)
             {
                 if (file.Contains(".ttcfg"))
@@ -5558,7 +5586,7 @@ namespace Welling_Motor_Debug_Tool
                     }
                     catch
                     {
-                        richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "标签格式错误" + BootInfo + "\r\n");
+                        richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "标签格式错误"  + "\r\n");
                         label_FacModeStatus.Text = "存在故障!";
                         label_FacModeResult.BackColor = Color.Red;
                         label_FacModeResult.Text = "标签格式错误";
@@ -5664,26 +5692,48 @@ namespace Welling_Motor_Debug_Tool
                     //配置文件
                     List<byte[]> CmdList = new List<byte[]>();
                     //从服务器下载文件
-                    string SelectFile = "";
-                    SelectFile = comboBox_FacModeCfgDate.SelectedItem.ToString() + "/" + comboBox_FacModeCfgFile.SelectedItem.ToString();
-                    if (File.Exists(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString()))//本地存在选定文件,先删除本地
+                    if ((checkBox_OffLineFacMode.Checked == false) && (checkBox_OffLineCheckMode.Checked == false))
                     {
-                        File.Delete(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString());
+                        string SelectFile = "";
+                        SelectFile = comboBox_FacModeCfgDate.SelectedItem.ToString() + "/" + comboBox_FacModeCfgFile.SelectedItem.ToString();
+                        if (File.Exists(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString()))//本地存在选定文件,先删除本地
+                        {
+                            File.Delete(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString());
+                        }
+                        myFtp.DownloadFile(toolStripTextBox_ServerPath.Text + "/" + localInfo.CfgPathName + SelectFile, localInfo.LocalPath);
+                        //打开文件
+                        StreamReader streamReader = new StreamReader(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString());
+                        CmdList.Clear();
+                        while (streamReader.Peek() != -1)
+                        {
+                            string fileLineInfo = streamReader.ReadLine();
+                            if (fileLineInfo.IndexOf("[") != -1)
+                            {
+                                continue;
+                            }
+                            CmdList.Add(mySerialProcess.HexStringToBytes(fileLineInfo, true));
+                        }
+                        streamReader.Close();
                     }
-                    myFtp.DownloadFile(toolStripTextBox_ServerPath.Text + "/" + localInfo.CfgPathName + SelectFile, localInfo.LocalPath);
-                    //打开文件
-                    StreamReader streamReader = new StreamReader(localInfo.LocalPath + comboBox_FacModeCfgFile.SelectedItem.ToString());
-                    CmdList.Clear();
-                    while (streamReader.Peek() != -1)
+                    //加载本地文件
+                    else
                     {
-                        string fileLineInfo = streamReader.ReadLine();
-                        if (fileLineInfo.IndexOf("[") != -1)
+                        string SelectFile = "";
+                        SelectFile = comboBox_FacModeCfgDate.SelectedItem.ToString() + "\\" + comboBox_FacModeCfgFile.SelectedItem.ToString();
+                        StreamReader streamReader = new StreamReader(localInfo.LocalPath + "\\" + localInfo.CfgPathName + "\\" + SelectFile);
+                        CmdList.Clear();
+                        while (streamReader.Peek() != -1)
                         {
-                            continue;
+                            string fileLineInfo = streamReader.ReadLine();
+                            if (fileLineInfo.IndexOf("[") != -1)
+                            {
+                                continue;
+                            }
+                            CmdList.Add(mySerialProcess.HexStringToBytes(fileLineInfo, true));
                         }
-                        CmdList.Add(mySerialProcess.HexStringToBytes(fileLineInfo, true));
+                        streamReader.Close();
                     }
-                    streamReader.Close();
+                    
                     int CmdNum = CmdList.Count(); //指令个数
                     Delay_ms(500);
                     richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取完成," + "共" + CmdNum.ToString() + "条指令," + "开始写入" + "\r\n");
@@ -6890,31 +6940,57 @@ namespace Welling_Motor_Debug_Tool
                 richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取配置文件" + "\r\n");
                 //配置文件
                 List<byte[]> CmdList = new List<byte[]>();
+                Dictionary<string, string> ConfigCmd = new Dictionary<string, string>();//配置文件格式
                 //从服务器下载文件
-                string SelectFile = "";
-                SelectFile = comboBox_CheckModeCfgDate.SelectedItem.ToString() + "/" + comboBox_CheckModeCfgFile.SelectedItem.ToString();
-                if (File.Exists(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString()))//本地存在选定文件,先删除本地
+                if ((checkBox_OffLineFacMode.Checked == false) && (checkBox_OffLineCheckMode.Checked == false))
                 {
-                    File.Delete(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
+                    string SelectFile = "";
+                    SelectFile = comboBox_CheckModeCfgDate.SelectedItem.ToString() + "/" + comboBox_CheckModeCfgFile.SelectedItem.ToString();
+                    if (File.Exists(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString()))//本地存在选定文件,先删除本地
+                    {
+                        File.Delete(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
+                    }
+                    myFtp.DownloadFile(toolStripTextBox_ServerPath.Text + "/" + localInfo.CfgPathName + SelectFile, localInfo.LocalPath);
+                    //打开文件                    
+                    StreamReader streamReader = new StreamReader(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
+                    ConfigCmd.Clear();
+                    while (streamReader.Peek() != -1)
+                    {
+                        string fileLineInfo = streamReader.ReadLine(); //读指令名称
+                        if (fileLineInfo.Contains("["))
+                        {
+                            if (fileLineInfo.Contains("助力参数"))
+                            {
+                                fileLineInfo = streamReader.ReadLine();
+                            }
+                            ConfigCmd.Add(fileLineInfo, streamReader.ReadLine()); //指令名称和指令内容加入字典
+                        }
+                    }
+                    streamReader.Close();
                 }
-                myFtp.DownloadFile(toolStripTextBox_ServerPath.Text + "/" + localInfo.CfgPathName + SelectFile, localInfo.LocalPath);
-                //打开文件
-                Dictionary<string, string> ConfigCmd = new Dictionary<string, string>();//配置文件格式
-                StreamReader streamReader = new StreamReader(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
-                ConfigCmd.Clear();
-                while (streamReader.Peek() != -1)
+                //从本地加载文件
+                else
                 {
-                    string fileLineInfo = streamReader.ReadLine(); //读指令名称
-                    if (fileLineInfo.Contains("["))
+                    string SelectFile = "";
+                    SelectFile = comboBox_CheckModeCfgDate.SelectedItem.ToString() + "\\" + comboBox_CheckModeCfgFile.SelectedItem.ToString();
+                    //打开文件                    
+                    StreamReader streamReader = new StreamReader(localInfo.LocalPath + "\\" + localInfo.CfgPathName + "\\" + SelectFile);
+                    ConfigCmd.Clear();
+                    while (streamReader.Peek() != -1)
                     {
-                        if (fileLineInfo.Contains("助力参数"))
+                        string fileLineInfo = streamReader.ReadLine(); //读指令名称
+                        if (fileLineInfo.Contains("["))
                         {
-                            fileLineInfo = streamReader.ReadLine();
-                        }                        
-                        ConfigCmd.Add(fileLineInfo, streamReader.ReadLine()); //指令名称和指令内容加入字典
+                            if (fileLineInfo.Contains("助力参数"))
+                            {
+                                fileLineInfo = streamReader.ReadLine();
+                            }
+                            ConfigCmd.Add(fileLineInfo, streamReader.ReadLine()); //指令名称和指令内容加入字典
+                        }
                     }
+                    streamReader.Close();
                 }
-                streamReader.Close();
+                
                 int CmdNum = ConfigCmd.Count(); //指令个数
                 Delay_ms(500);
                 richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取完成," + "共" + CmdNum.ToString() + "条指令," + "\r\n");
@@ -7323,5 +7399,21 @@ namespace Welling_Motor_Debug_Tool
         {
             System.Diagnostics.Process.Start("osk.exe");
         }
+
+        private void checkBox_OffLineCheckMode_CheckedChanged(object sender, EventArgs e)
+        {
+            comboBox_CheckModeCfgDate.SelectedIndex = -1;
+            comboBox_CheckModeCfgFile.SelectedIndex = -1;
+            checkBox_OffLineFacMode.Checked = checkBox_OffLineCheckMode.Checked;
+        }
+
+        private void checkBox_OffLineFacMode_CheckedChanged(object sender, EventArgs e)
+        {
+            comboBox_FacModeCfgDate.SelectedIndex = -1;
+            comboBox_FacModeCfgFile.SelectedIndex = -1;
+            checkBox_OffLineCheckMode.Checked = checkBox_OffLineFacMode.Checked;
+        }
+
+
     }
 }

+ 3 - 3
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.FileListAbsolute.txt

@@ -54,6 +54,9 @@ D:\Documents\Work\SoftDesign\Welling-MidMotor\Welling_Motor_Debug_Tool\obj\Debug
 D:\Documents\Work\SoftDesign\Welling-MidMotor\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.CoreCompileInputs.cache
 D:\Documents\Work\SoftDesign\Welling-MidMotor\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.exe
 D:\Documents\Work\SoftDesign\Welling-MidMotor\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.pdb
+D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.exe.config
+D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.exe
+D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.pdb
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.AssemblyReference.cache
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.SuggestedBindingRedirects.cache
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.GenerateParams.resources
@@ -64,8 +67,5 @@ D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.TorqueParams.resources
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.GenerateResource.cache
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.csproj.CoreCompileInputs.cache
-D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.exe.config
-D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.exe
-D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\bin\Debug\Welling_Motor_Debug_Tool.pdb
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.exe
 D:\笔记本20221223\zhouxiong9\Documents\Tools\motor-debug\Welling_Motor_Debug_Tool\obj\Debug\Welling_Motor_Debug_Tool.pdb

二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


二進制
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb