Эх сурвалжийг харах

1,生成参数界面增加整车参数2和用户骑行参数;
2,导出离线文件时,在导入样机测试记录时判断文件版本,旧版本时整车参数2和用户骑行参数不转换;
3,Config文件中取消服务器配置相关参数,改为server文件中存储;
4,修改ftp读取文件夹列表方法,解决偶尔创建文件夹时报错550问题;
5,配置菜单中去掉服务器地址配置相关控件。

Dail 9 сар өмнө
parent
commit
a39b7b0ea9

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 65 - 56
Welling_Motor_Debug_Tool/GenerateParams.cs

@@ -507,12 +507,34 @@ namespace Welling_Motor_Debug_Tool
 
                     fileInfo += "[调试参数],1\r\n";
                     fileInfo += "存储标志,1\r\n";
-                    fileInfo += array_CfgInfo[56].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";                    
+                    fileInfo += array_CfgInfo[56].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
+                    fileInfo += "\r\n";
 
+                    string FileVer = "";
+                    FileVer = array_CfgInfo[array_CfgInfo.Count - 2].ToString();
+                    if (FileVer.Contains("V2.0")) //2.0版本包含整车参数和用户骑行参数
+                    {
+                        fileInfo += "[整车参数2],1\r\n";
+                        fileInfo += "存储标志,1\r\n";
+                        fileInfo += array_CfgInfo[65].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
+                        fileInfo += "\r\n";
+
+                        fileInfo += "[用户骑行参数],1\r\n";
+                        fileInfo += "存储标志,1\r\n";
+                        fileInfo += array_CfgInfo[68].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
+                    }
+                    else //2.0版本前不包含整车参数和用户骑行参数,写0,不转换
+                    {
+                        fileInfo += "[整车参数2],0\r\n\r\n";
+                        fileInfo += "\r\n";
+                        fileInfo += "[用户骑行参数],0\r\n\r\n";
+                        fileInfo += "\r\n";
+                    }
+                    
 
                     //加载高级界面
                     richTextBox_AdvanceParams.Clear();
-                    richTextBox_AdvanceParams. AppendText(fileInfo);
+                    richTextBox_AdvanceParams.AppendText(fileInfo);
 
                     //加载简易界面
                     do //基础参数界面
@@ -668,43 +690,18 @@ namespace Welling_Motor_Debug_Tool
             label_Ver.Text = "版本: V" + mainForm.Version;
             label_BT.Text = "编译时间:" + System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString("yyyy-MM-dd HH:mm:ss");
 
-            //导入网络配置
-            if (System.IO.File.Exists(localInfo.LocalPath + localInfo.ConfigFileName)) //存在配置文件,导入配置信息
-            {
-                //打开文件
-                StreamReader objReader = new StreamReader(localInfo.LocalPath + localInfo.ConfigFileName);
-                string sLine = "";
-                ArrayList array_CfgInfo = new ArrayList();
-                array_CfgInfo.Clear();
-                while (sLine != null)
-                {
-                    sLine = objReader.ReadLine();
-                    array_CfgInfo.Add(sLine);
-                }
-                objReader.Close();
-                //解析配置文件
-                try
-                {
-                    //离线标志
-                    Offline_Flag = array_CfgInfo[9].ToString().Split(':')[1] == "True";
-                    //Server Set IP, Port, User, PassWS, ModelPath;
-                    IP = array_CfgInfo[12].ToString().Split(':')[1];
-                    Port = array_CfgInfo[13].ToString().Split(':')[1];
-                    User = array_CfgInfo[14].ToString().Split(':')[1];
-                    PassWD = array_CfgInfo[15].ToString().Split(':')[1];
-                    ModelPath = "ParamsMode";
-                    myFtp.FtpOption(IP, Port, User, PassWD, "admin", "ttium_admin");
-                }
-                catch (System.Exception)
-                {
-                    MessageBox.Show("参数格式错误,写入默认值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                }
-            }
-            else
-            {
-                MessageBox.Show("参数文件丢失!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                this.Close();
-            }
+            //离线使用标志            
+            Offline_Flag = (mainform1.OfflineFlag == true);
+
+            //模板文件服务器路径
+            ModelPath = "ParamsMode";
+
+            //FTP配置
+            IP = mainform1.ServerIP;
+            Port = mainform1.ServerPort;
+            User = mainform1.ServerUser;
+            PassWD = mainform1.ServerPassWd;
+            myFtp.FtpOption(IP, Port, User, PassWD, "admin", "ttium_admin");           
 
             //检查网络
             if (Offline_Flag != true)
@@ -1249,27 +1246,39 @@ namespace Welling_Motor_Debug_Tool
                 {
                     string filePath = saveFileDialog.FileName.Split('.')[0] + "_" + DateTime.Now.ToString("yyyyMMddHHmmss");
                     //保存src文件
-                    System.IO.File.WriteAllText(filePath + ".src", richTextBox_AdvanceParams.Text);                    
-                    //检查是否存在转换工具
-                    if (!Directory.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile"))
-                    {
-                        Directory.CreateDirectory(localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                        myFtp.DownloadFile("Tools/GenerateParamsFile/ConsoleApp2.exe", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                        myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.xml", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                        myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.dll", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                    }
-                    else
+                    System.IO.File.WriteAllText(filePath + ".src", richTextBox_AdvanceParams.Text);
+                    //转换工具检查
+                    if (Offline_Flag != true) //在线时始终保持最新版本
                     {
-                        //程序使用最新版本
-                        if (System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "ConsoleApp2.exe"))
-                            System.IO.File.Delete(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "ConsoleApp2.exe");
-                        myFtp.DownloadFile("Tools/GenerateParamsFile/ConsoleApp2.exe", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                        //库文件不更新
-                        if (!System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "Newtonsoft.Json.xml"))
+                        if (!Directory.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile"))
+                        {
+                            Directory.CreateDirectory(localInfo.ToolsPath + "\\" + "GenerateParamsFile");
+                            myFtp.DownloadFile("Tools/GenerateParamsFile/ConsoleApp2.exe", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
                             myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.xml", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
-                        if (!System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "Newtonsoft.Json.dll"))
                             myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.dll", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
+                        }
+                        else
+                        {
+                            //程序使用最新版本
+                            if (System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "ConsoleApp2.exe"))
+                                System.IO.File.Delete(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "ConsoleApp2.exe");
+                            myFtp.DownloadFile("Tools/GenerateParamsFile/ConsoleApp2.exe", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
+                            //库文件不更新
+                            if (!System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "Newtonsoft.Json.xml"))
+                                myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.xml", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
+                            if (!System.IO.File.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "Newtonsoft.Json.dll"))
+                                myFtp.DownloadFile("Tools/GenerateParamsFile/Newtonsoft.Json.dll", localInfo.ToolsPath + "\\" + "GenerateParamsFile");
+                        }
+                    }
+                    else //离线时使用本地
+                    {
+                        if (!Directory.Exists(localInfo.ToolsPath + "\\" + "GenerateParamsFile"))
+                        {
+                            MessageBoxTimeOut.Show("转换工具缺失,请连接服务器自动下载", "提示", 1000, MessageBoxButtons.OK);
+                            return;
+                        }
                     }
+                    
                     //转换.ttcfg文件
                     ProcessStartInfo startInfo = new ProcessStartInfo();
                     startInfo.FileName = localInfo.ToolsPath + "\\" + "GenerateParamsFile" + "\\" + "ConsoleApp2.exe";

+ 21 - 37
Welling_Motor_Debug_Tool/Version.cs

@@ -9,6 +9,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using static Welling_Motor_Debug_Tool.mainForm;
 
 namespace Welling_Motor_Debug_Tool
 {
@@ -17,7 +18,11 @@ namespace Welling_Motor_Debug_Tool
         //修改记录
         string ChangeLog = "修改记录:\r\n" +
             "V" + mainForm.Version + "\r\n" +
-            "" +
+            "1,针对位置磁环增加校准功能,支持手动校准和量产模式自动校准;\r\n" +
+            "2,启动时增加网络选择,勾选下次不启动时存储Server文件,下次启动从Server文件读取服务器配置,Config文件中去掉服务器配置;\r\n" +
+            "3,导出文件时增加整车参数2和用户骑行参数,修改量产文件转换工具;\r\n" +
+            "4,参数检验测试结束后,增加导出电机参数并记录的功能;\r\n" +
+            "5,解决离线模式无法进入参数生成界面问题。\r\n" +
             "\r\n" +
             "V2.2.2\r\n" +
             "1,增加自动更新按钮,解决离线使用时打开慢的问题;\r\n" +
@@ -27,7 +32,7 @@ namespace Welling_Motor_Debug_Tool
             "5,控制参数预留1低8位作为转把定速巡航开关,仪表用户参数增加转把定速巡航开关;\r\n" +
             "6, 增加指令窗口,可显示接收和发送的数据;\r\n" +
             "7,解决导入本地记录文件时,自定义字符串以\\0结尾高级参数界面异常问题,目前关闭自定义字符串指令。\r\n" +
-            "\r\n"+
+            "\r\n" +
             "V2.2.1\r\n" +
             "1,优化修改配置模式时重复发送指令的问题;\r\n" +
             "2,解决刹车检测报错的问题;\r\n" +
@@ -90,49 +95,28 @@ namespace Welling_Motor_Debug_Tool
             richTextBox_Log.Text = "";
             richTextBox_Log.AppendText(ChangeLog);
 
-            //导入网络配置
-            if (System.IO.File.Exists(localInfo.LocalPath + localInfo.ConfigFileName)) //存在配置文件,导入配置信息
-            {
-                //打开文件
-                StreamReader objReader = new StreamReader(localInfo.LocalPath + localInfo.ConfigFileName);
-                string sLine = "";
-                ArrayList array_CfgInfo = new ArrayList();
-                array_CfgInfo.Clear();
-                while (sLine != null)
-                {
-                    sLine = objReader.ReadLine();
-                    array_CfgInfo.Add(sLine);
-                }
-                objReader.Close();
-                //解析配置文件
-                try
-                {
-                    //Server Set IP, Port, User, PassWS, ModelPath;
-                    IP = array_CfgInfo[12].ToString().Split(':')[1];
-                    Port = array_CfgInfo[13].ToString().Split(':')[1];
-                    User = array_CfgInfo[14].ToString().Split(':')[1];
-                    PassWD = array_CfgInfo[15].ToString().Split(':')[1];
-                    myFtp.FtpOption(IP, Port, User, PassWD, "admin", "ttium_admin");
-                }
-                catch (System.Exception)
-                {
-                    MessageBox.Show("参数格式错误,写入默认值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                }
-            }
-            else
-            {
-                MessageBox.Show("参数文件丢失!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                this.Close();
-            }
+            //网络配置
+            IP = mainform1.ServerIP;
+            Port = mainform1.ServerPort;
+            User = mainform1.ServerUser;
+            PassWD = mainform1.ServerPassWd;
+            myFtp.FtpOption(IP, Port, User, PassWD, "admin", "ttium_admin");
 
         }
 
         private void button_CheckVersion_Click(object sender, EventArgs e)
         {
+            //离线时直接退出
+            if (mainform1.OfflineFlag == true)
+            {
+                MessageBoxTimeOut.Show("网络断开,检查失败", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
             //检查网络状态
             if (myFtp.CheckFtp() == false)
             {
-                MessageBox.Show("网络断开", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                MessageBoxTimeOut.Show("网络断开,检查失败", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
             else

+ 17 - 7
Welling_Motor_Debug_Tool/ftp.cs

@@ -363,14 +363,24 @@ namespace Welling_Motor_Debug_Tool
                 {
                     if (str.Trim().Length == 0)
                         continue;
-                    if (str.Contains("<DIR>")) //Windows服务器
-                    { 
-                    
-                    }
-                    else if (str.Trim().Substring(0, 1) == "d") //Linux服务器
+                    if (str != string.Empty)
                     {
-                        strList.Add(str.Split(':')[1].Split(' ')[1]);
-                    }
+                        int dirPos = str.IndexOf("<DIR>");
+                        if (dirPos > 0)
+                        {
+                            //判断 Windows 风格
+                            strList.Add(str.Substring(dirPos + 5).Trim());
+                        }
+                        else if (str.Trim().Substring(0, 1).ToUpper() == "D")
+                        {
+                            //判断 Unix 风格
+                            string dir = str.Substring(56).Trim();
+                            if (dir != "." && dir != "..")
+                            {
+                                strList.Add(dir);
+                            }
+                        }
+                    }                    
                 }
             }
             return strList.ToArray();

+ 22 - 146
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -54,20 +54,10 @@ namespace Welling_Motor_Debug_Tool
             this.配置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.写入存储ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
-            this.离线使用ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.允许ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.不允许ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.服务器配置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.IP地址ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripTextBox_ServerIP = new System.Windows.Forms.ToolStripTextBox();
-            this.端口ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripTextBox_ServerPort = new System.Windows.Forms.ToolStripTextBox();
-            this.用户名ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripTextBox_ServerUser = new System.Windows.Forms.ToolStripTextBox();
-            this.密码ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripTextBox_ServerPasswd = new System.Windows.Forms.ToolStripTextBox();
             this.存储路径ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripTextBox_ServerPath = new System.Windows.Forms.ToolStripTextBox();
+            this.重置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.生产信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.生产商ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -659,8 +649,6 @@ namespace Welling_Motor_Debug_Tool
             this.label124 = new System.Windows.Forms.Label();
             this.label46 = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.重置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -759,7 +747,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);
             // 
@@ -768,7 +756,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);
             // 
@@ -786,7 +774,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
@@ -805,14 +793,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
             // 
@@ -821,7 +809,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
@@ -864,14 +852,14 @@ namespace Welling_Motor_Debug_Tool
             // 开机ToolStripMenuItem
             // 
             this.开机ToolStripMenuItem.Name = "开机ToolStripMenuItem";
-            this.开机ToolStripMenuItem.Size = new System.Drawing.Size(112, 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(112, 26);
+            this.关机ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.关机ToolStripMenuItem.Text = "关机";
             this.关机ToolStripMenuItem.Click += new System.EventHandler(this.关机ToolStripMenuItem_Click);
             // 
@@ -880,7 +868,6 @@ namespace Welling_Motor_Debug_Tool
             this.配置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.写入存储ToolStripMenuItem,
             this.toolStripSeparator2,
-            this.离线使用ToolStripMenuItem,
             this.服务器配置ToolStripMenuItem,
             this.toolStripSeparator3,
             this.生产信息ToolStripMenuItem,
@@ -912,108 +899,14 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripSeparator2.Name = "toolStripSeparator2";
             this.toolStripSeparator2.Size = new System.Drawing.Size(211, 6);
             // 
-            // 离线使用ToolStripMenuItem
-            // 
-            this.离线使用ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.允许ToolStripMenuItem,
-            this.不允许ToolStripMenuItem});
-            this.离线使用ToolStripMenuItem.Name = "离线使用ToolStripMenuItem";
-            this.离线使用ToolStripMenuItem.Size = new System.Drawing.Size(214, 26);
-            this.离线使用ToolStripMenuItem.Text = "离线使用";
-            // 
-            // 允许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);
-            // 
-            // 不允许ToolStripMenuItem
-            // 
-            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.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.IP地址ToolStripMenuItem,
-            this.端口ToolStripMenuItem,
-            this.用户名ToolStripMenuItem,
-            this.密码ToolStripMenuItem,
             this.存储路径ToolStripMenuItem,
-            this.toolStripSeparator6,
             this.重置ToolStripMenuItem});
             this.服务器配置ToolStripMenuItem.Name = "服务器配置ToolStripMenuItem";
             this.服务器配置ToolStripMenuItem.Size = new System.Drawing.Size(214, 26);
-            this.服务器配置ToolStripMenuItem.Text = "FTP服务器配置";
-            // 
-            // IP地址ToolStripMenuItem
-            // 
-            this.IP地址ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_ServerIP});
-            this.IP地址ToolStripMenuItem.Name = "IP地址ToolStripMenuItem";
-            this.IP地址ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.IP地址ToolStripMenuItem.Text = "IP地址";
-            // 
-            // toolStripTextBox_ServerIP
-            // 
-            this.toolStripTextBox_ServerIP.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
-            this.toolStripTextBox_ServerIP.Name = "toolStripTextBox_ServerIP";
-            this.toolStripTextBox_ServerIP.Size = new System.Drawing.Size(200, 28);
-            this.toolStripTextBox_ServerIP.Text = "10.177.130.30";
-            this.toolStripTextBox_ServerIP.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
-            // 
-            // 端口ToolStripMenuItem
-            // 
-            this.端口ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_ServerPort});
-            this.端口ToolStripMenuItem.Name = "端口ToolStripMenuItem";
-            this.端口ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.端口ToolStripMenuItem.Text = "端口";
-            // 
-            // toolStripTextBox_ServerPort
-            // 
-            this.toolStripTextBox_ServerPort.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
-            this.toolStripTextBox_ServerPort.Name = "toolStripTextBox_ServerPort";
-            this.toolStripTextBox_ServerPort.Size = new System.Drawing.Size(200, 28);
-            this.toolStripTextBox_ServerPort.Text = "15021";
-            this.toolStripTextBox_ServerPort.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
-            // 
-            // 用户名ToolStripMenuItem
-            // 
-            this.用户名ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_ServerUser});
-            this.用户名ToolStripMenuItem.Name = "用户名ToolStripMenuItem";
-            this.用户名ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.用户名ToolStripMenuItem.Text = "用户名";
-            // 
-            // toolStripTextBox_ServerUser
-            // 
-            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";
-            this.toolStripTextBox_ServerUser.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
-            // 
-            // 密码ToolStripMenuItem
-            // 
-            this.密码ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_ServerPasswd});
-            this.密码ToolStripMenuItem.Name = "密码ToolStripMenuItem";
-            this.密码ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.密码ToolStripMenuItem.Text = "密码";
-            // 
-            // toolStripTextBox_ServerPasswd
-            // 
-            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";
-            this.toolStripTextBox_ServerPasswd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
+            this.服务器配置ToolStripMenuItem.Text = "服务器配置";
             // 
             // 存储路径ToolStripMenuItem
             // 
@@ -1031,6 +924,14 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
             this.toolStripTextBox_ServerPath.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
             // 
+            // 重置ToolStripMenuItem
+            // 
+            this.重置ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText;
+            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);
+            // 
             // toolStripSeparator3
             // 
             this.toolStripSeparator3.Name = "toolStripSeparator3";
@@ -1125,14 +1026,14 @@ namespace Welling_Motor_Debug_Tool
             this.中置电机ToolStripMenuItem.Checked = true;
             this.中置电机ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
             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 = "中置电机";
             this.中置电机ToolStripMenuItem.Click += new System.EventHandler(this.中置电机ToolStripMenuItem_Click);
             // 
             // 轮毂电机ToolStripMenuItem
             // 
             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 = "轮毂电机";
             this.轮毂电机ToolStripMenuItem.Click += new System.EventHandler(this.轮毂电机ToolStripMenuItem_Click);
             // 
@@ -1627,7 +1528,7 @@ namespace Welling_Motor_Debug_Tool
             // toolStripMenuItem_RunTime
             // 
             this.toolStripMenuItem_RunTime.Name = "toolStripMenuItem_RunTime";
-            this.toolStripMenuItem_RunTime.Size = new System.Drawing.Size(180, 26);
+            this.toolStripMenuItem_RunTime.Size = new System.Drawing.Size(142, 26);
             this.toolStripMenuItem_RunTime.Text = "00:00:00";
             // 
             // statusStrip1
@@ -2699,7 +2600,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox18.Size = new System.Drawing.Size(120, 91);
             this.groupBox18.TabIndex = 11;
             this.groupBox18.TabStop = false;
-            this.groupBox18.Text = "SIP校准";
+            this.groupBox18.Text = "SPI校准";
             // 
             // radioButton_SIP_SaveNo
             // 
@@ -7482,19 +7383,6 @@ namespace Welling_Motor_Debug_Tool
             this.pictureBox2.TabIndex = 16;
             this.pictureBox2.TabStop = false;
             // 
-            // 重置ToolStripMenuItem
-            // 
-            this.重置ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText;
-            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);
-            // 
-            // toolStripSeparator6
-            // 
-            this.toolStripSeparator6.Name = "toolStripSeparator6";
-            this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
-            // 
             // mainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -7906,14 +7794,6 @@ namespace Welling_Motor_Debug_Tool
         private ToolStripMenuItem 断开关机ToolStripMenuItem;
         private ToolStripMenuItem 识别通讯盒ToolStripMenuItem;
         private ToolStripMenuItem 服务器配置ToolStripMenuItem;
-        private ToolStripMenuItem IP地址ToolStripMenuItem;
-        private ToolStripMenuItem 端口ToolStripMenuItem;
-        private ToolStripMenuItem 用户名ToolStripMenuItem;
-        private ToolStripMenuItem 密码ToolStripMenuItem;
-        private ToolStripTextBox toolStripTextBox_ServerIP;
-        private ToolStripTextBox toolStripTextBox_ServerPort;
-        private ToolStripTextBox toolStripTextBox_ServerUser;
-        private ToolStripTextBox toolStripTextBox_ServerPasswd;
         private ToolStripSeparator toolStripSeparator1;
         private ToolStripMenuItem 存储路径ToolStripMenuItem;
         private ToolStripTextBox toolStripTextBox_ServerPath;
@@ -7921,9 +7801,6 @@ namespace Welling_Motor_Debug_Tool
         private Label label_Server_ComStatus;
         private Label label_ServerStatus;
         private Label label_PortStatus;
-        private ToolStripMenuItem 离线使用ToolStripMenuItem;
-        private ToolStripMenuItem 允许ToolStripMenuItem;
-        private ToolStripMenuItem 不允许ToolStripMenuItem;
         private ToolStripMenuItem 生产信息ToolStripMenuItem;
         private ToolStripMenuItem 生产商ToolStripMenuItem;
         private ToolStripMenuItem 生产地ToolStripMenuItem;
@@ -8262,6 +8139,5 @@ namespace Welling_Motor_Debug_Tool
         private Label label152;
         private Label label153;
         private ToolStripMenuItem 重置ToolStripMenuItem;
-        private ToolStripSeparator toolStripSeparator6;
     }
 }

+ 145 - 275
Welling_Motor_Debug_Tool/mainForm.cs

@@ -32,6 +32,11 @@ namespace Welling_Motor_Debug_Tool
         LocalInfo localInfo = new LocalInfo();
         //FTP实例
         ftp myFtp = new ftp();
+        public string ServerIP = "";
+        public string ServerPort = "";
+        public string ServerUser = "";
+        public string ServerPassWd = "";
+        public bool OfflineFlag = false;
         //MC运行信息超时计数
         bool MC_RunInfo_Refresh = false;
         ushort MC_RunInfo_Refresh_Cnt = 0;
@@ -303,9 +308,32 @@ namespace Welling_Motor_Debug_Tool
             do
             {
                 //检查是否存在配置文件
-                if (File.Exists(localInfo.LocalPath + localInfo.ServerCfgFileName))
-                    break;
-                else
+                if (File.Exists(localInfo.LocalPath + localInfo.ServerCfgFileName)) //存在配置文件从文件选择
+                {
+                    //打开文件
+                    StreamReader objReader = new StreamReader(localInfo.LocalPath + localInfo.ServerCfgFileName);
+                    string sLine = "";
+                    ArrayList array_CfgInfo = new ArrayList();
+                    array_CfgInfo.Clear();
+                    while (sLine != null)
+                    {
+                        sLine = objReader.ReadLine();
+                        array_CfgInfo.Add(sLine);
+                    }
+                    objReader.Close();
+                    //解析配置文件
+                    ServerIP = array_CfgInfo[0].ToString();
+                    ServerPort = array_CfgInfo[1].ToString();
+                    ServerUser = array_CfgInfo[2].ToString();
+                    ServerPassWd = array_CfgInfo[3].ToString();
+                    if (array_CfgInfo[4].ToString() == "True")
+                    {
+                        OfflineFlag = true;
+                        checkBox_OffLineFacMode.Checked = true;
+                        checkBox_OffLineCheckMode.Checked = true;
+                    }
+                }
+                else //不存在配置文件由用户选择
                 {
                     ServerCfgForm1.ShowDialog();
                     switch (ServerCfgForm1.comboBox_Server.SelectedIndex)
@@ -313,30 +341,29 @@ namespace Welling_Motor_Debug_Tool
                         case 0: //武汉园区                        
                         case 1: //顺德工厂
                             {
-                                toolStripTextBox_ServerIP.Text = "10.177.130.30";
-                                toolStripTextBox_ServerPort.Text = "15021";
-                                toolStripTextBox_ServerUser.Text = "factory_test";
-                                toolStripTextBox_ServerPasswd.Text = "ttium";
-                                不允许ToolStripMenuItem.Checked = true;
-                                允许ToolStripMenuItem.Checked = false;
-                                打开ToolStripMenuItem.Checked = true;
-                                关闭ToolStripMenuItem.Checked = false;
+                                ServerIP = "10.177.130.30";
+                                ServerPort = "15021";
+                                ServerUser = "factory_test";
+                                ServerPassWd = "ttium";
+                                OfflineFlag = false;                                
+                                checkBox_OffLineFacMode.Checked = false;
+                                checkBox_OffLineCheckMode.Checked = false;
                                 break;
                             }
-                        case 2: //越南工厂
-                        case 3: //公司外部
+                        case 2: //威灵园区
+                        case 3: //越南工厂
+                        case 4: //公司外部
                             {
-                                toolStripTextBox_ServerIP.Text = "8.134.109.44";
-                                toolStripTextBox_ServerPort.Text = "21";
-                                toolStripTextBox_ServerUser.Text = "ttium";
-                                toolStripTextBox_ServerPasswd.Text = "ttium123";
-                                不允许ToolStripMenuItem.Checked = true;
-                                允许ToolStripMenuItem.Checked = false;
-                                打开ToolStripMenuItem.Checked = true;
-                                关闭ToolStripMenuItem.Checked = false;
+                                ServerIP = "8.134.109.44";
+                                ServerPort = "21";
+                                ServerUser = "ttium";
+                                ServerPassWd = "ttium123";
+                                OfflineFlag = false;                                
+                                checkBox_OffLineFacMode.Checked = false;
+                                checkBox_OffLineCheckMode.Checked = false;
                                 break;
                             }
-                        case 4: //离线使用
+                        case 5: //离线使用
                             {
                                 //输入管理员密码
                                 Scan scan_form = new Scan();
@@ -345,17 +372,16 @@ namespace Welling_Motor_Debug_Tool
                                 scan_form.ShowDialog();
                                 if (scan_form.textBox_Scan.Text == "ttium.123")
                                 {
-                                    不允许ToolStripMenuItem.Checked = false;
-                                    允许ToolStripMenuItem.Checked = true;
-                                    打开ToolStripMenuItem.Checked = false;
-                                    关闭ToolStripMenuItem.Checked = true;
+                                    OfflineFlag = true;
+                                    checkBox_OffLineFacMode.Checked = true;
+                                    checkBox_OffLineCheckMode.Checked = true;
                                 }
                                 else
                                 {
                                     MessageBox.Show("密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                     System.Environment.Exit(0);
                                 }
-                                
+
                                 break;
                             }
                         default: //无效
@@ -367,8 +393,9 @@ namespace Welling_Motor_Debug_Tool
                     //保存配置文件
                     if (ServerCfgForm1.checkBox_NoticeSw.Checked)
                     {
-                        System.IO.File.WriteAllText(localInfo.LocalPath + localInfo.ServerCfgFileName, "");
-                    }                    
+                        string str = ServerIP + "\r\n" + ServerPort + "\r\n" + ServerUser + "\r\n" + ServerPassWd + "\r\n" + (OfflineFlag == true).ToString();
+                        System.IO.File.WriteAllText(localInfo.LocalPath + localInfo.ServerCfgFileName, str);
+                    }
                 }
             } while (false);
 
@@ -399,63 +426,43 @@ namespace Welling_Motor_Debug_Tool
                     识别通讯盒ToolStripMenuItem.Checked = (array_CfgInfo[5].ToString().Split(':')[1] == "True");
                     //Option
                     写入存储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 = true;
-                        checkBox_OffLineFacMode.Enabled = true;
-                        checkBox_OffLineCheckMode.Checked = true;
-                        checkBox_OffLineCheckMode.Enabled = true;
-                    }
                     //Server Set
-                    toolStripTextBox_ServerIP.Text = array_CfgInfo[12].ToString().Split(':')[1];
-                    toolStripTextBox_ServerPort.Text = array_CfgInfo[13].ToString().Split(':')[1];
-                    toolStripTextBox_ServerUser.Text = array_CfgInfo[14].ToString().Split(':')[1];
-                    toolStripTextBox_ServerPasswd.Text = array_CfgInfo[15].ToString().Split(':')[1];
-                    toolStripTextBox_ServerPath.Text = array_CfgInfo[16].ToString().Split(':')[1];
+                    toolStripTextBox_ServerPath.Text = array_CfgInfo[11].ToString().Split(':')[1];
                     //MacInfo
-                    toolStripTextBox_MAC.Text = array_CfgInfo[19].ToString().Split(':')[1];
-                    toolStripTextBoxMACAddr.Text = array_CfgInfo[20].ToString().Split(':')[1];
+                    toolStripTextBox_MAC.Text = array_CfgInfo[14].ToString().Split(':')[1];
+                    toolStripTextBoxMACAddr.Text = array_CfgInfo[15].ToString().Split(':')[1];
                     toolStripTextBox_MACDate.Text = DateTime.Now.ToString("yyyyMMdd");
-                    toolStripTextBox_MACPD.Text = array_CfgInfo[22].ToString().Split(':')[1];
+                    toolStripTextBox_MACPD.Text = array_CfgInfo[17].ToString().Split(':')[1];
                     //Log Address
-                    textBox_LogAddrBegin.Text = array_CfgInfo[25].ToString().Split(':')[1];
-                    textBox_LogAddrEnd.Text = array_CfgInfo[26].ToString().Split(':')[1];
+                    textBox_LogAddrBegin.Text = array_CfgInfo[20].ToString().Split(':')[1];
+                    textBox_LogAddrEnd.Text = array_CfgInfo[21].ToString().Split(':')[1];
                     //电机类型
-                    中置电机ToolStripMenuItem.Checked = (array_CfgInfo[29].ToString().Split(':')[1] == "True");
+                    中置电机ToolStripMenuItem.Checked = (array_CfgInfo[24].ToString().Split(':')[1] == "True");
                     轮毂电机ToolStripMenuItem.Checked = !中置电机ToolStripMenuItem.Checked;
                     //检测阈值
-                    toolStripTextBox_ThVol.Text = array_CfgInfo[33].ToString().Split(':')[1];
-                    toolStripTextBox_ThCur.Text = array_CfgInfo[34].ToString().Split(':')[1];
-                    toolStripTextBox_ThSpeed.Text = array_CfgInfo[35].ToString().Split(':')[1];
-                    toolStripTextBox_ThTor.Text = array_CfgInfo[36].ToString().Split(':')[1];
-                    toolStripTextBox_ThCad.Text = array_CfgInfo[37].ToString().Split(':')[1];
-                    toolStripTextBox_ThBikeSpeed.Text = array_CfgInfo[38].ToString().Split(':')[1];
-                    toolStripTextBox_ThT_PCB.Text = array_CfgInfo[39].ToString().Split(':')[1];
-                    toolStripTextBox_ThT_MCU.Text = array_CfgInfo[40].ToString().Split(':')[1];
-                    toolStripTextBox_ThT_Motor.Text = array_CfgInfo[41].ToString().Split(':')[1];
+                    toolStripTextBox_ThVol.Text = array_CfgInfo[28].ToString().Split(':')[1];
+                    toolStripTextBox_ThCur.Text = array_CfgInfo[29].ToString().Split(':')[1];
+                    toolStripTextBox_ThSpeed.Text = array_CfgInfo[30].ToString().Split(':')[1];
+                    toolStripTextBox_ThTor.Text = array_CfgInfo[31].ToString().Split(':')[1];
+                    toolStripTextBox_ThCad.Text = array_CfgInfo[32].ToString().Split(':')[1];
+                    toolStripTextBox_ThBikeSpeed.Text = array_CfgInfo[33].ToString().Split(':')[1];
+                    toolStripTextBox_ThT_PCB.Text = array_CfgInfo[34].ToString().Split(':')[1];
+                    toolStripTextBox_ThT_MCU.Text = array_CfgInfo[35].ToString().Split(':')[1];
+                    toolStripTextBox_ThT_Motor.Text = array_CfgInfo[36].ToString().Split(':')[1];
                     //MOS内阻校准系数
-                    toolStripTextBox_MosCalK.Text = array_CfgInfo[44].ToString().Split(':')[1];
-                    toolStripTextBox_MOS1.Text= array_CfgInfo[45].ToString().Split(':')[1];
-                    toolStripTextBox_MOS2.Text = array_CfgInfo[46].ToString().Split(':')[1];
-                    toolStripTextBox_MOS3.Text = array_CfgInfo[47].ToString().Split(':')[1];
+                    toolStripTextBox_MosCalK.Text = array_CfgInfo[39].ToString().Split(':')[1];
+                    toolStripTextBox_MOS1.Text= array_CfgInfo[40].ToString().Split(':')[1];
+                    toolStripTextBox_MOS2.Text = array_CfgInfo[41].ToString().Split(':')[1];
+                    toolStripTextBox_MOS3.Text = array_CfgInfo[42].ToString().Split(':')[1];
                     //通信协议类型
-                    cANToolStripMenuItem.Checked = (array_CfgInfo[50].ToString().Split(':')[1] == "True");
+                    cANToolStripMenuItem.Checked = (array_CfgInfo[45].ToString().Split(':')[1] == "True");
                     uARTToolStripMenuItem.Checked = !cANToolStripMenuItem.Checked;
                     //自动更新开关
-                    打开ToolStripMenuItem.Checked = (array_CfgInfo[54].ToString().Split(':')[1] == "True");
+                    打开ToolStripMenuItem.Checked = (array_CfgInfo[49].ToString().Split(':')[1] == "True");
                     关闭ToolStripMenuItem.Checked = !打开ToolStripMenuItem.Checked;
                     //位置校准偏差
-                    textBox_AngleDiffTh.Text = array_CfgInfo[57].ToString().Split(':')[1];
-                    textBox_AngleZeroTh.Text = array_CfgInfo[58].ToString().Split(':')[1];
+                    textBox_AngleDiffTh.Text = array_CfgInfo[52].ToString().Split(':')[1];
+                    textBox_AngleZeroTh.Text = array_CfgInfo[53].ToString().Split(':')[1];
                 }
                 catch (System.Exception)
                 {
@@ -538,7 +545,6 @@ namespace Welling_Motor_Debug_Tool
                             //隐藏设置项
                             其它配置项ToolStripMenuItem.Visible = false;
                             写入存储ToolStripMenuItem.Visible = false;
-                            离线使用ToolStripMenuItem.Visible = false;
                             服务器配置ToolStripMenuItem.Visible = false;
                             判断阈值ToolStripMenuItem.Visible = false;
                             mOS内阻校准系数ToolStripMenuItem.Visible = false;
@@ -626,7 +632,6 @@ namespace Welling_Motor_Debug_Tool
                             tabPage_ProductMode_Write.Parent = null;
                             //隐藏配置项
                             其它配置项ToolStripMenuItem.Visible = false;
-                            离线使用ToolStripMenuItem.Visible = false;
                             服务器配置ToolStripMenuItem.Visible = false;
                             判断阈值ToolStripMenuItem.Visible = false;
                             力矩传感器检验ToolStripMenuItem.Visible = false;
@@ -664,7 +669,6 @@ namespace Welling_Motor_Debug_Tool
                             //隐藏设置项
                             其它配置项ToolStripMenuItem.Visible = false;
                             写入存储ToolStripMenuItem.Visible = false;
-                            离线使用ToolStripMenuItem.Visible = false;
                             服务器配置ToolStripMenuItem.Visible = false;
                             判断阈值ToolStripMenuItem.Visible = false;
                             mOS内阻校准系数ToolStripMenuItem.Visible = false;
@@ -706,9 +710,6 @@ namespace Welling_Motor_Debug_Tool
                             tabPage_ProductMode_Write.Parent = tabControl1;
                             tabPage_ProductMode_Write.Select();
                             tabPage_ProductMode_Read.Parent = null;
-                            //允许离线使用
-                            允许ToolStripMenuItem.Checked = false;
-                            不允许ToolStripMenuItem.Checked = true;
                             checkBox_OffLineFacMode.Checked = false;
                             checkBox_OffLineFacMode.Enabled = true;
                             checkBox_OffLineCheckMode.Checked = false;
@@ -723,7 +724,6 @@ namespace Welling_Motor_Debug_Tool
                             //隐藏量产界面
                             tabPage_ProductMode_Read.Parent = null;
                             tabPage_ProductMode_Write.Parent = null;
-                            离线使用ToolStripMenuItem.Visible = false;
                             服务器配置ToolStripMenuItem.Visible = false;                            
                             if (uARTToolStripMenuItem.Checked)
                                 UART协议ToolStripMenuItem.Visible = true;
@@ -758,7 +758,7 @@ namespace Welling_Motor_Debug_Tool
             } while (true);                        
 
             //配置网络FTP服务器
-            myFtp.FtpOption(toolStripTextBox_ServerIP.Text, toolStripTextBox_ServerPort.Text, toolStripTextBox_ServerUser.Text, toolStripTextBox_ServerPasswd.Text, "admin", "ttium_admin");
+            myFtp.FtpOption(ServerIP, ServerPort, ServerUser, ServerPassWd, "admin", "ttium_admin");
             //创建线程,定时检测网络连接状态
             Thread th = new Thread(NetworkCheck);
             th.IsBackground = true;
@@ -774,7 +774,7 @@ namespace Welling_Motor_Debug_Tool
         private void NetworkCheck()
         {
             //允许离线使用,直接退出
-            if (允许ToolStripMenuItem.Checked == true) //允许离线使用
+            if (OfflineFlag == true) //允许离线使用
             {
                 timer_500ms.Enabled = false;
                 MessageBoxTimeOut.Show("离线使用,不检测网络状态!", "提示", 2000, MessageBoxButtons.OK, MessageBoxIcon.Information);
@@ -818,7 +818,7 @@ namespace Welling_Motor_Debug_Tool
                     }                    
                 }
 
-                //创建定时器,定时10s检查网络
+                //创建定时器,定时30s检查网络
                 System.Timers.Timer timer_CheckNet = new System.Timers.Timer();
                 timer_CheckNet.Enabled = true;
                 timer_CheckNet.Interval = 30000;
@@ -905,7 +905,7 @@ namespace Welling_Motor_Debug_Tool
             //检查版本,自动更新
             do
             {                
-                if (打开ToolStripMenuItem.Checked == false)//关闭自动更新
+                if ((打开ToolStripMenuItem.Checked == false) || OfflineFlag == true)//关闭自动更新或离线时
                 {
                     break;
                 }
@@ -4841,10 +4841,7 @@ namespace Welling_Motor_Debug_Tool
                 FileInfo += "\r\n";
                 FileInfo += "[整车参数]\r\n";
                 FileInfo += richTextBox_BikeParam.Text + "\r\n";
-                FileInfo += "\r\n";
-                FileInfo += "[整车参数2]\r\n";
-                FileInfo += richTextBox_BikeParam2.Text + "\r\n";
-                FileInfo += "\r\n";
+                FileInfo += "\r\n";                
                 FileInfo += "[控制参数]\r\n";
                 FileInfo += richTextBox_ControlParam.Text + "\r\n";
                 FileInfo += "\r\n";
@@ -4855,10 +4852,7 @@ namespace Welling_Motor_Debug_Tool
                 for(int i=0;i<15;i++)
                 {
                     FileInfo += AssistParams[i] + "\r\n";
-                }
-                FileInfo += "[用户骑行参数]\r\n";
-                FileInfo += richTextBox_UsrRidesParam.Text + "\r\n";
-                FileInfo += "\r\n";
+                }                
                 FileInfo += "[调试参数]\r\n";
                 FileInfo += richTextBox_DebugParam.Text + "\r\n";
                 FileInfo += "\r\n";
@@ -4875,6 +4869,12 @@ namespace Welling_Motor_Debug_Tool
                 FileInfo += textBox_MOS_R2.Text + ", ";
                 FileInfo += textBox_MOS_R3.Text + "\r\n";
                 FileInfo += "\r\n";
+                FileInfo += "[整车参数2]\r\n";
+                FileInfo += richTextBox_BikeParam2.Text + "\r\n";
+                FileInfo += "\r\n";
+                FileInfo += "[用户骑行参数]\r\n";
+                FileInfo += richTextBox_UsrRidesParam.Text + "\r\n";
+                FileInfo += "\r\n";
                 FileInfo += "[生产信息]\r\n";
                 FileInfo += "生产商: " + textBox_MAC.Text + "\r\n";
                 FileInfo += "生产地: " + textBox_MACAdd.Text + "\r\n";
@@ -4894,6 +4894,8 @@ namespace Welling_Motor_Debug_Tool
                 FileInfo += "SIP: " + ((radioButton_SIP_SaveYes.Checked == true) ? "已存储" : "未存储") + "\r\n";
                 FileInfo += "\r\n";
                 FileInfo += Local_HdInformation;
+                FileInfo += "\r\n";
+                FileInfo += "文件格式: V2.0\r\n";
                 System.IO.File.WriteAllText(DataFileName, FileInfo);
                 Delay_ms(1000);
 
@@ -5432,13 +5434,8 @@ namespace Welling_Motor_Debug_Tool
             CfgFileInfo += "\r\n";
             CfgFileInfo += "[Option]" + "\r\n";
             CfgFileInfo += "SaveWhenWrite:" + 写入存储ToolStripMenuItem.Checked.ToString() + "\r\n";
-            CfgFileInfo += "OfflineEnable:" + 允许ToolStripMenuItem.Checked + "\r\n";
             CfgFileInfo += "\r\n";
             CfgFileInfo += "[ServerSet]" + "\r\n";
-            CfgFileInfo += "IPAddress:" + toolStripTextBox_ServerIP.Text + "\r\n";
-            CfgFileInfo += "Port:" + toolStripTextBox_ServerPort.Text + "\r\n";
-            CfgFileInfo += "User:" + toolStripTextBox_ServerUser.Text + "\r\n";
-            CfgFileInfo += "Password:" + toolStripTextBox_ServerPasswd.Text + "\r\n";
             CfgFileInfo += "PathName:" + toolStripTextBox_ServerPath.Text + "\r\n";
             CfgFileInfo += "\r\n";
             CfgFileInfo += "[MacInfo]" + "\r\n";
@@ -5508,59 +5505,6 @@ namespace Welling_Motor_Debug_Tool
             }
         }
 
-        /// <summary>
-        /// 允许离线使用
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void 允许ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            //输入用户名
-            EnterForm1.ShowDialog();
-            try
-            {
-                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
-                {
-                    if (EnterForm1.comboBox_User.Text == "管理员")
-                    {
-                        允许ToolStripMenuItem.Checked = true;
-                        不允许ToolStripMenuItem.Checked = false;
-                        ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
-                    }
-                    else
-                    {
-                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        允许ToolStripMenuItem.Checked = false;
-                        不允许ToolStripMenuItem.Checked = true;
-                    }
-                }
-                else
-                {
-                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    允许ToolStripMenuItem.Checked = false;
-                    不允许ToolStripMenuItem.Checked = true;
-                }
-            }
-            catch (Exception)
-            {
-                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                允许ToolStripMenuItem.Checked = false;
-                不允许ToolStripMenuItem.Checked = true;
-            }
-        }
-
-        /// <summary>
-        /// 不允许离线使用
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void 不允许ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            允许ToolStripMenuItem.Checked = false;
-            不允许ToolStripMenuItem.Checked = true;
-            ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
-        }
-
         /// <summary>
         /// 弹出扫码按钮
         /// </summary>
@@ -5653,97 +5597,6 @@ namespace Welling_Motor_Debug_Tool
             scan_form.Dispose();
         }
 
-        private void 服务器配置ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            //输入用户名
-            EnterForm1.ShowDialog();
-            try
-            {
-                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
-                {
-                    if (EnterForm1.comboBox_User.Text == "管理员")
-                    {
-                        IP地址ToolStripMenuItem.Visible = true;
-                        端口ToolStripMenuItem.Visible = true;
-                        用户名ToolStripMenuItem.Visible = true;
-                        密码ToolStripMenuItem.Visible = true;
-                        存储路径ToolStripMenuItem.Visible = true;
-                    }
-                    else
-                    {
-                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        IP地址ToolStripMenuItem.Visible = false;
-                        端口ToolStripMenuItem.Visible = false;
-                        用户名ToolStripMenuItem.Visible = false;
-                        密码ToolStripMenuItem.Visible = false;
-                        存储路径ToolStripMenuItem.Visible = false;
-                    }
-                }
-                else
-                {
-                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    IP地址ToolStripMenuItem.Visible = false;
-                    端口ToolStripMenuItem.Visible = false;
-                    用户名ToolStripMenuItem.Visible = false;
-                    密码ToolStripMenuItem.Visible = false;
-                    存储路径ToolStripMenuItem.Visible = false;
-                }
-            }
-            catch (Exception)
-            {
-                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                IP地址ToolStripMenuItem.Visible = false;
-                端口ToolStripMenuItem.Visible = false;
-                用户名ToolStripMenuItem.Visible = false;
-                密码ToolStripMenuItem.Visible = false;
-                存储路径ToolStripMenuItem.Visible = false;
-            }
-        }
-
-        private void 生产信息ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            //输入用户名
-            EnterForm1.ShowDialog();
-            try
-            {
-                if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
-                {
-                    if (EnterForm1.comboBox_User.Text == "管理员")
-                    {
-                        生产商ToolStripMenuItem.Visible = true;
-                        生产地ToolStripMenuItem.Visible = true;
-                        生产日期ToolStripMenuItem.Visible = true;
-                        产品标识ToolStripMenuItem.Visible = true;
-                    }
-                    else
-                    {
-                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        生产商ToolStripMenuItem.Visible = false;
-                        生产地ToolStripMenuItem.Visible = false;
-                        生产日期ToolStripMenuItem.Visible = false;
-                        产品标识ToolStripMenuItem.Visible = false;
-                    }
-                }
-                else
-                {
-                    MessageBox.Show("密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    生产商ToolStripMenuItem.Visible = false;
-                    生产地ToolStripMenuItem.Visible = false;
-                    生产日期ToolStripMenuItem.Visible = false;
-                    产品标识ToolStripMenuItem.Visible = false;
-                }
-            }
-            catch (Exception)
-            {
-                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                生产商ToolStripMenuItem.Visible = false;
-                生产地ToolStripMenuItem.Visible = false;
-                生产日期ToolStripMenuItem.Visible = false;
-                产品标识ToolStripMenuItem.Visible = false;
-            }
-        }
-
-
         /// <summary>
         /// 切换电机类型
         /// </summary>
@@ -8087,37 +7940,38 @@ namespace Welling_Motor_Debug_Tool
             do
             {
                 if (!OK_Flag)
+                {
+                    richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试异常,停止导出" + "\r\n");
                     break;
-                richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "导出电机存储参数" + "\r\n");
+                }
+                richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "导出电机存储参数" + "\r\n");
                 //读取一次马达参数
                 richTextBox_MotorParam.Clear();
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x3A00, null)) break; ;
                 Delay_ms(100);
                 Params += "[马达参数]" + "\r\n" + richTextBox_MotorParam.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次整车参数
                 richTextBox_BikeParam.Clear();
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x3C00, null)) break;
                 Delay_ms(100);
                 Params += "[整车参数]" + "\r\n" + richTextBox_BikeParam.Text + "\r\n";
-
-                //读取一次整车参数2
-                richTextBox_BikeParam2.Clear();
-                if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4C00, null)) break;
-                Delay_ms(100);
-                Params += "[整车参数2]" + "\r\n" + richTextBox_BikeParam2.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次控制参数
                 richTextBox_ControlParam.Clear();
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x3E00, null)) break;
                 Delay_ms(100);
                 Params += "[控制参数]" + "\r\n" + richTextBox_ControlParam.Text + "\r\n";
+                Params += "\r\n";
 
                 //查询传感器
                 richTextBox_SensorParam.Clear();                
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4000, null)) break;
                 Delay_ms(100);
                 Params += "[传感器参数]" + "\r\n" + richTextBox_SensorParam.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取15次助力参数
                 Params += "[助力参数]" + "\r\n";
@@ -8131,26 +7985,50 @@ namespace Welling_Motor_Debug_Tool
                     ConfigParam[3] = (byte)(((i >= 5) ? 5 : i) >> 8);
                     if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4304, ConfigParam)) break;
                     Delay_ms(200);
-                    Params += richTextBox_AssistParam.Text + "\r\n";                    
+                    Params += richTextBox_AssistParam.Text + "\r\n";
+                    Params += "\r\n";
                 }
-
-                //读取一次用户骑行参数
-                richTextBox_UsrRidesParam.Clear();
-                mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4A00, null);
-                Delay_ms(100);
-                Params += "[用户骑行参数]" + "\r\n" + richTextBox_UsrRidesParam.Text + "\r\n";
-
+               
                 //读取一次调试信息
                 richTextBox_DebugParam.Clear();
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4500, null)) break;
                 Delay_ms(100);
                 Params += "[调试参数]" + "\r\n" + richTextBox_DebugParam.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次历史信息
                 richTextBox_Record.Clear();
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1E00, null)) break;
                 Delay_ms(100);
-                Params += "[历史信息]" + "\r\n" + richTextBox_Record.Text + "\r\n";              
+                Params += "[历史信息]" + "\r\n" + richTextBox_Record.Text + "\r\n";
+                Params += "\r\n";
+
+                //读取一次MOS内阻校准参数
+                foreach (Control c in groupBox21.Controls)
+                {
+                    if (c is TextBox)
+                        c.Text = "";
+                }
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4B00, null);
+                Delay_ms(100);
+                Params += "[MOS内阻校准参数]" + "\r\n";
+                Params += textBox_MOS_K1.Text + ", " + textBox_MOS_K2.Text + ", " + textBox_MOS_K3.Text + ", " + textBox_MOS_K4.Text + ", "
+                    + textBox_MOS_K5.Text + ", " + textBox_MOS_R1.Text + ", " + textBox_MOS_R2.Text + ", " + textBox_MOS_R3.Text + ", " + "\r\n";
+                Params += "\r\n";
+
+                //读取一次整车参数2
+                richTextBox_BikeParam2.Clear();
+                if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4C00, null)) break;
+                Delay_ms(100);
+                Params += "[整车参数2]" + "\r\n" + richTextBox_BikeParam2.Text + "\r\n";
+                Params += "\r\n";
+
+                //读取一次用户骑行参数
+                richTextBox_UsrRidesParam.Clear();
+                mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4A00, null);
+                Delay_ms(100);
+                Params += "[用户骑行参数]" + "\r\n" + richTextBox_UsrRidesParam.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次生产信息
                 textBox_MAC.Text = "";
@@ -8164,6 +8042,7 @@ namespace Welling_Motor_Debug_Tool
                 Params += "生产地: " + textBox_MACAdd.Text + "\r\n";
                 Params += "生产日期: " + textBox_MACDate.Text + "\r\n";
                 Params += "产品标识: " + textBox_PP.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次自定义信息
                 textBox_User1.Text = "---";
@@ -8179,12 +8058,14 @@ namespace Welling_Motor_Debug_Tool
                 Params += "自定义1: " + textBox_User1.Text + "\r\n";
                 Params += "自定义2: " + textBox_User2.Text + "\r\n";
                 Params += "自定义3: " + textBox_User3.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次密钥
                 textBox_Key.Text = "---";
                 if (!mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1000, null)) break;
                 Delay_ms(100);
                 Params += "[校验密钥]" + "\r\n" + textBox_Key.Text + "\r\n";
+                Params += "\r\n";
 
                 //读取一次存储标志
                 radioButton_EE_SaveYes.Checked = false;
@@ -8196,18 +8077,7 @@ namespace Welling_Motor_Debug_Tool
                 Params += "[存储标志]" + "\r\n";
                 Params += "EEPROM: " + ((radioButton_EE_SaveYes.Checked == true) ? "已存储" : "未存储") + "\r\n";
                 Params += "SIP: " + ((radioButton_SIP_SaveYes.Checked == true) ? "已存储" : "未存储") + "\r\n";
-
-                //读取一次MOS内阻校准参数
-                foreach (Control c in groupBox21.Controls)
-                {
-                    if (c is TextBox)
-                        c.Text = "";
-                }
-                mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4B00, null);
-                Delay_ms(100);
-                Params += "[MOS内阻校准参数]" + "\r\n";
-                Params += textBox_MOS_K1.Text + ", " + textBox_MOS_K2.Text + ", " + textBox_MOS_K3.Text + ", " + textBox_MOS_K4.Text + ", " 
-                    + textBox_MOS_K5.Text + ", " + textBox_MOS_R1.Text + ", " + textBox_MOS_R2.Text + ", " + textBox_MOS_R3.Text + ", " + "\r\n";
+                Params += "\r\n";
 
             } while (false);
 
@@ -8278,7 +8148,7 @@ namespace Welling_Motor_Debug_Tool
             file_str += "检验记录:\r\n" + richTextBox_CheckModeLog.Text.Replace("\n", "\r\n") + "\r\n\r\n";
             file_str += "检验结果:\r\n" + label_CheckModeResult.Text + "\r\n\r\n";
             file_str += Local_HdInformation;
-            file_str += "电机存储参数:\r\n" + Params + "\r\n";
+            file_str += "\r\n电机存储参数:\r\n" + Params + "\r\n";
             System.IO.File.WriteAllText(LogSaveFileName, file_str);
             //上传测试记录到服务器
             if (myFtp.IsNetConnected == true)
@@ -8441,15 +8311,15 @@ namespace Welling_Motor_Debug_Tool
 
             //系统开机,确保测试前先关机,发送关机指令再发送开机指令
             //确保测试前先关机,发送关机指令再发送开机指令
-            richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送关机指令" + "\r\n");
+            richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送关机指令" + "\r\n");
             Code[0] = 0xF0;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
             Delay_ms(1500);
-            richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送开机指令" + "\r\n");
+            richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送开机指令" + "\r\n");
             Code[0] = 0xF1;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
             ACK_WaitCnt = 0;
-            richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "等待控制器返回Boot信息……" + "\r\n");
+            richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "等待控制器返回Boot信息……" + "\r\n");
             while (ACK_WaitCnt <= 20) ; //10s            
 
             //检查BOOT版本
@@ -8480,7 +8350,7 @@ namespace Welling_Motor_Debug_Tool
                 Delay_ms(500);
                 mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
                 Delay_ms(500);
-                richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
+                richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
             }
 #endif
 
@@ -9420,7 +9290,7 @@ namespace Welling_Motor_Debug_Tool
            
             if (myFtp.IsNetConnected)
             {
-                toolTip1.SetToolTip(this.label_ServerStatus, "IP: " + toolStripTextBox_ServerIP.Text);//设置故障内容显示
+                toolTip1.SetToolTip(this.label_ServerStatus, "IP: " + ServerIP);//设置故障内容显示
             }
             else
             {

+ 1 - 1
Welling_Motor_Debug_Tool/mainForm.resx

@@ -148,7 +148,7 @@
     <value>275, 17</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>59</value>
+    <value>79</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


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