Преглед изворни кода

1、增加备忘录,在生成参数界面可以与服务器同步;
2、增加管理员账户,用于修改配置信息
3、量产测试增加自动连接和断开串口。

Dail пре 1 година
родитељ
комит
98bca47008

BIN
.vs/Welling_Motor_Debug_Tool/FileContentIndex/b4ddea9a-3eea-4ce0-b6c5-a87e6fd277c1.vsidx


BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 133 - 73
Welling_Motor_Debug_Tool/GenerateParams.Designer.cs

@@ -101,6 +101,12 @@
             this.label5 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
+            this.label38 = new System.Windows.Forms.Label();
+            this.label37 = new System.Windows.Forms.Label();
+            this.label33 = new System.Windows.Forms.Label();
+            this.label32 = new System.Windows.Forms.Label();
+            this.label31 = new System.Windows.Forms.Label();
+            this.label30 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.label_ServerStatus = new System.Windows.Forms.Label();
             this.label_Server_ComStatus = new System.Windows.Forms.Label();
@@ -108,14 +114,12 @@
             this.comboBox_ModelFile = new System.Windows.Forms.ComboBox();
             this.button_GenerateModelFile = new System.Windows.Forms.Button();
             this.button_ModeRefresh = new System.Windows.Forms.Button();
-            this.label30 = new System.Windows.Forms.Label();
-            this.label31 = new System.Windows.Forms.Label();
-            this.label32 = new System.Windows.Forms.Label();
-            this.label33 = new System.Windows.Forms.Label();
-            this.label37 = new System.Windows.Forms.Label();
-            this.label38 = new System.Windows.Forms.Label();
             this.radioButton_MIGIC = new System.Windows.Forms.RadioButton();
             this.radioButton_HUB = new System.Windows.Forms.RadioButton();
+            this.tabPage_Note = new System.Windows.Forms.TabPage();
+            this.richTextBox_Note = new System.Windows.Forms.RichTextBox();
+            this.button_NoteWrite = new System.Windows.Forms.Button();
+            this.button_NoteRead = new System.Windows.Forms.Button();
             this.tabControl1.SuspendLayout();
             this.tabPage_Simple.SuspendLayout();
             this.groupBox5.SuspendLayout();
@@ -125,6 +129,7 @@
             this.tabPage_Advance.SuspendLayout();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            this.tabPage_Note.SuspendLayout();
             this.SuspendLayout();
             // 
             // button_ExportParams
@@ -155,12 +160,13 @@
             // 
             this.tabControl1.Controls.Add(this.tabPage_Simple);
             this.tabControl1.Controls.Add(this.tabPage_Advance);
-            this.tabControl1.Enabled = false;
+            this.tabControl1.Controls.Add(this.tabPage_Note);
             this.tabControl1.Location = new System.Drawing.Point(26, 73);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
             this.tabControl1.Size = new System.Drawing.Size(492, 676);
             this.tabControl1.TabIndex = 3;
+            this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
             // 
             // tabPage_Simple
             // 
@@ -902,6 +908,72 @@
             this.label3.TabIndex = 0;
             this.label3.Text = "客户名称/编号";
             // 
+            // label38
+            // 
+            this.label38.AutoSize = true;
+            this.label38.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label38.ForeColor = System.Drawing.Color.Silver;
+            this.label38.Location = new System.Drawing.Point(123, 495);
+            this.label38.Name = "label38";
+            this.label38.Size = new System.Drawing.Size(73, 16);
+            this.label38.TabIndex = 0;
+            this.label38.Text = "填写PCBA板号";
+            // 
+            // label37
+            // 
+            this.label37.AutoSize = true;
+            this.label37.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label37.ForeColor = System.Drawing.Color.Silver;
+            this.label37.Location = new System.Drawing.Point(123, 444);
+            this.label37.Name = "label37";
+            this.label37.Size = new System.Drawing.Size(184, 16);
+            this.label37.TabIndex = 0;
+            this.label37.Text = "参考:大牙盘:MM_MC1;轮毂:GF_250_1";
+            // 
+            // label33
+            // 
+            this.label33.AutoSize = true;
+            this.label33.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label33.ForeColor = System.Drawing.Color.Silver;
+            this.label33.Location = new System.Drawing.Point(123, 392);
+            this.label33.Name = "label33";
+            this.label33.Size = new System.Drawing.Size(73, 16);
+            this.label33.TabIndex = 0;
+            this.label33.Text = "不超过8个字符";
+            // 
+            // label32
+            // 
+            this.label32.AutoSize = true;
+            this.label32.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label32.ForeColor = System.Drawing.Color.Silver;
+            this.label32.Location = new System.Drawing.Point(123, 339);
+            this.label32.Name = "label32";
+            this.label32.Size = new System.Drawing.Size(73, 16);
+            this.label32.TabIndex = 0;
+            this.label32.Text = "不超过8个字符";
+            // 
+            // label31
+            // 
+            this.label31.AutoSize = true;
+            this.label31.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label31.ForeColor = System.Drawing.Color.Silver;
+            this.label31.Location = new System.Drawing.Point(123, 288);
+            this.label31.Name = "label31";
+            this.label31.Size = new System.Drawing.Size(73, 16);
+            this.label31.TabIndex = 0;
+            this.label31.Text = "不超过8个字符";
+            // 
+            // label30
+            // 
+            this.label30.AutoSize = true;
+            this.label30.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label30.ForeColor = System.Drawing.Color.Silver;
+            this.label30.Location = new System.Drawing.Point(123, 548);
+            this.label30.Name = "label30";
+            this.label30.Size = new System.Drawing.Size(154, 16);
+            this.label30.TabIndex = 0;
+            this.label30.Text = "参考格式:V1.0.0.0.0_20240101";
+            // 
             // label2
             // 
             this.label2.AutoSize = true;
@@ -981,72 +1053,6 @@
             this.button_ModeRefresh.UseVisualStyleBackColor = false;
             this.button_ModeRefresh.Click += new System.EventHandler(this.button_ModeRefresh_Click);
             // 
-            // label30
-            // 
-            this.label30.AutoSize = true;
-            this.label30.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label30.ForeColor = System.Drawing.Color.Silver;
-            this.label30.Location = new System.Drawing.Point(123, 548);
-            this.label30.Name = "label30";
-            this.label30.Size = new System.Drawing.Size(154, 16);
-            this.label30.TabIndex = 0;
-            this.label30.Text = "参考格式:V1.0.0.0.0_20240101";
-            // 
-            // label31
-            // 
-            this.label31.AutoSize = true;
-            this.label31.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label31.ForeColor = System.Drawing.Color.Silver;
-            this.label31.Location = new System.Drawing.Point(123, 288);
-            this.label31.Name = "label31";
-            this.label31.Size = new System.Drawing.Size(73, 16);
-            this.label31.TabIndex = 0;
-            this.label31.Text = "不超过8个字符";
-            // 
-            // label32
-            // 
-            this.label32.AutoSize = true;
-            this.label32.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label32.ForeColor = System.Drawing.Color.Silver;
-            this.label32.Location = new System.Drawing.Point(123, 339);
-            this.label32.Name = "label32";
-            this.label32.Size = new System.Drawing.Size(73, 16);
-            this.label32.TabIndex = 0;
-            this.label32.Text = "不超过8个字符";
-            // 
-            // label33
-            // 
-            this.label33.AutoSize = true;
-            this.label33.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label33.ForeColor = System.Drawing.Color.Silver;
-            this.label33.Location = new System.Drawing.Point(123, 392);
-            this.label33.Name = "label33";
-            this.label33.Size = new System.Drawing.Size(73, 16);
-            this.label33.TabIndex = 0;
-            this.label33.Text = "不超过8个字符";
-            // 
-            // label37
-            // 
-            this.label37.AutoSize = true;
-            this.label37.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label37.ForeColor = System.Drawing.Color.Silver;
-            this.label37.Location = new System.Drawing.Point(123, 444);
-            this.label37.Name = "label37";
-            this.label37.Size = new System.Drawing.Size(184, 16);
-            this.label37.TabIndex = 0;
-            this.label37.Text = "参考:大牙盘:MM_MC1;轮毂:GF_250_1";
-            // 
-            // label38
-            // 
-            this.label38.AutoSize = true;
-            this.label38.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label38.ForeColor = System.Drawing.Color.Silver;
-            this.label38.Location = new System.Drawing.Point(123, 495);
-            this.label38.Name = "label38";
-            this.label38.Size = new System.Drawing.Size(73, 16);
-            this.label38.TabIndex = 0;
-            this.label38.Text = "填写PCBA板号";
-            // 
             // radioButton_MIGIC
             // 
             this.radioButton_MIGIC.AutoSize = true;
@@ -1069,6 +1075,55 @@
             this.radioButton_HUB.Text = "HUB";
             this.radioButton_HUB.UseVisualStyleBackColor = true;
             // 
+            // tabPage_Note
+            // 
+            this.tabPage_Note.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.tabPage_Note.Controls.Add(this.button_NoteRead);
+            this.tabPage_Note.Controls.Add(this.button_NoteWrite);
+            this.tabPage_Note.Controls.Add(this.richTextBox_Note);
+            this.tabPage_Note.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.tabPage_Note.Location = new System.Drawing.Point(4, 30);
+            this.tabPage_Note.Name = "tabPage_Note";
+            this.tabPage_Note.Size = new System.Drawing.Size(484, 642);
+            this.tabPage_Note.TabIndex = 2;
+            this.tabPage_Note.Text = "备忘录";
+            // 
+            // richTextBox_Note
+            // 
+            this.richTextBox_Note.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.richTextBox_Note.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.richTextBox_Note.Location = new System.Drawing.Point(6, 6);
+            this.richTextBox_Note.Name = "richTextBox_Note";
+            this.richTextBox_Note.Size = new System.Drawing.Size(472, 578);
+            this.richTextBox_Note.TabIndex = 1;
+            this.richTextBox_Note.Text = "";
+            // 
+            // button_NoteWrite
+            // 
+            this.button_NoteWrite.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
+            this.button_NoteWrite.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_NoteWrite.ForeColor = System.Drawing.Color.White;
+            this.button_NoteWrite.Location = new System.Drawing.Point(388, 590);
+            this.button_NoteWrite.Name = "button_NoteWrite";
+            this.button_NoteWrite.Size = new System.Drawing.Size(90, 45);
+            this.button_NoteWrite.TabIndex = 2;
+            this.button_NoteWrite.Text = "保存";
+            this.button_NoteWrite.UseVisualStyleBackColor = false;
+            this.button_NoteWrite.Click += new System.EventHandler(this.button_NoteWrite_Click);
+            // 
+            // button_NoteRead
+            // 
+            this.button_NoteRead.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+            this.button_NoteRead.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_NoteRead.ForeColor = System.Drawing.Color.White;
+            this.button_NoteRead.Location = new System.Drawing.Point(292, 590);
+            this.button_NoteRead.Name = "button_NoteRead";
+            this.button_NoteRead.Size = new System.Drawing.Size(90, 45);
+            this.button_NoteRead.TabIndex = 2;
+            this.button_NoteRead.Text = "读取";
+            this.button_NoteRead.UseVisualStyleBackColor = false;
+            this.button_NoteRead.Click += new System.EventHandler(this.button_NoteRead_Click);
+            // 
             // GenerateParams
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -1111,6 +1166,7 @@
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            this.tabPage_Note.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -1204,5 +1260,9 @@
         private System.Windows.Forms.Label label30;
         private System.Windows.Forms.RadioButton radioButton_MIGIC;
         private System.Windows.Forms.RadioButton radioButton_HUB;
+        private System.Windows.Forms.TabPage tabPage_Note;
+        private System.Windows.Forms.Button button_NoteWrite;
+        private System.Windows.Forms.RichTextBox richTextBox_Note;
+        private System.Windows.Forms.Button button_NoteRead;
     }
 }

+ 79 - 2
Welling_Motor_Debug_Tool/GenerateParams.cs

@@ -31,6 +31,84 @@ namespace Welling_Motor_Debug_Tool
             InitializeComponent();
         }
 
+        private void button_NoteRead_Click(object sender, EventArgs e)
+        {
+            //检查本地文件删除            
+            if (System.IO.File.Exists(localInfo.LocalPath + localInfo.NoteFileName))
+                System.IO.File.Delete(localInfo.LocalPath + localInfo.NoteFileName);
+
+            //下载远程文件
+            myFtp.DownloadFile("/Note/Note.txt", localInfo.LocalPath);
+
+            //显示文件
+            StreamReader objReader = new StreamReader(localInfo.LocalPath + localInfo.NoteFileName);
+            string sLine = "";
+            ArrayList arrText = new ArrayList();//创建一个动态数组
+            while (sLine != null)
+            {
+                sLine = objReader.ReadLine();
+                arrText.Add(sLine);
+            }
+            objReader.Close();
+            richTextBox_Note.Clear();
+            foreach (string sOutput in arrText)
+            {
+                richTextBox_Note.AppendText(sOutput + "\r\n");
+            }
+            richTextBox_Note.Text = richTextBox_Note.Text.Remove(richTextBox_Note.Text.Length - 1);
+        }
+
+        private void button_NoteWrite_Click(object sender, EventArgs e)
+        {
+            //检查本地并删除
+            if (System.IO.File.Exists(localInfo.LocalPath + localInfo.NoteFileName))
+                System.IO.File.Delete(localInfo.LocalPath + localInfo.NoteFileName);
+
+            //保存
+            System.IO.File.WriteAllText(localInfo.LocalPath + localInfo.NoteFileName, richTextBox_Note.Text);
+
+            //上传服务器
+            if (!myFtp.DirectoryExist("/", "Note"))
+                myFtp.MakeDir("/Note");
+
+            bool result = myFtp.UploadFile(localInfo.LocalPath + localInfo.NoteFileName, "/Note");
+            if (result)
+                MessageBox.Show("上传完成", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            else
+                MessageBox.Show("上传失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+        }
+
+        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            //选中备忘录时自动读取更新
+            if (tabControl1.SelectedIndex == 2)
+            {
+                //检查本地文件删除            
+                if (System.IO.File.Exists(localInfo.LocalPath + localInfo.NoteFileName))
+                    System.IO.File.Delete(localInfo.LocalPath + localInfo.NoteFileName);
+
+                //下载远程文件
+                myFtp.DownloadFile("/Note/Note.txt", localInfo.LocalPath);
+
+                //显示文件
+                StreamReader objReader = new StreamReader(localInfo.LocalPath + localInfo.NoteFileName);
+                string sLine = "";
+                ArrayList arrText = new ArrayList();//创建一个动态数组
+                while (sLine != null)
+                {
+                    sLine = objReader.ReadLine();
+                    arrText.Add(sLine);
+                }
+                objReader.Close();
+                richTextBox_Note.Clear();
+                foreach (string sOutput in arrText)
+                {
+                    richTextBox_Note.AppendText(sOutput + "\r\n");
+                }
+                richTextBox_Note.Text = richTextBox_Note.Text.Remove(richTextBox_Note.Text.Length - 1);
+            }
+        }
+
         private void GenerateParams_Load(object sender, EventArgs e)
         {
             //导入网络配置
@@ -116,8 +194,7 @@ namespace Welling_Motor_Debug_Tool
         }
 
         private void comboBox_ModelFile_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            tabControl1.Enabled = true;
+        {            
             button_ExportParams.Enabled = true;
 
             //下载文件

+ 3 - 2
Welling_Motor_Debug_Tool/LocalInfo.cs

@@ -10,10 +10,11 @@ namespace Welling_Motor_Debug_Tool
     {
         public string LocalPath = "C:\\Temp\\MotorTestTool\\"; //本地配置文件路径
         public string LocalDataPath = "C:\\Temp\\MotorTestTool\\DataLog\\"; //本地数据文件路径
-        public string ConfigFileName = "Config.ttcfg"; //配置文件
+        public string ConfigFileName = "Config1.ttcfg"; //配置文件
+        public string NoteFileName = "Note.txt";
         public string ToolsPath = "C:\\Temp\\MotorTestTool\\Tools";//工具路径
         public string TorqueSensorFileName = "TorqueSensor.ttcfg"; //配置文件
-        public string UsrFileName = "UserAccount"; //登录配置文件
+        public string UsrFileName = "UserAccount1"; //登录配置文件
         public string CfgPathName = "cfg\\"; //配置目录
         public string WalkLogPathName = "funcTest\\"; //推行测试目录
         public string CheckPathName = "qcTest\\"; //检验目录

+ 5 - 4
Welling_Motor_Debug_Tool/Login.cs

@@ -39,10 +39,11 @@ namespace Welling_Motor_Debug_Tool
                     file.WriteLine("USER=中置量产检验,PASSWD=2");
                     file.WriteLine("USER=轮毂量产写入,PASSWD=3");
                     file.WriteLine("USER=轮毂量产检验,PASSWD=4");
-                    file.WriteLine("USER=中置样机,PASSWD=5");
-                    file.WriteLine("USER=轮毂样机,PASSWD=6");
-                    file.WriteLine("USER=工程配置,PASSWD=7");
-                    file.WriteLine("USER=研发测试,PASSWD=8");
+                    file.WriteLine("USER=中置样机测试,PASSWD=5");
+                    file.WriteLine("USER=轮毂样机测试,PASSWD=6");
+                    file.WriteLine("USER=工程参数配置,PASSWD=123456");
+                    file.WriteLine("USER=研发调试,PASSWD=123456");
+                    file.WriteLine("USER=管理员,PASSWD=ttium.123");
                     file.Close();
                 }
                 //读取配置文件

BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool.pdb


BIN
Welling_Motor_Debug_Tool/bin/Debug/Welling_Motor_Debug_Tool_202404191120.exe


+ 77 - 77
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -60,10 +60,10 @@ namespace Welling_Motor_Debug_Tool
             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_ServerPath = 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.生产商ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripTextBox_MAC = new System.Windows.Forms.ToolStripTextBox();
@@ -100,6 +100,7 @@ namespace Welling_Motor_Debug_Tool
             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.指令调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.查询ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.调试记录数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -432,9 +433,11 @@ namespace Welling_Motor_Debug_Tool
             this.textBox_FacModeScan = new System.Windows.Forms.TextBox();
             this.label112 = new System.Windows.Forms.Label();
             this.label_FacModeStatus = new System.Windows.Forms.Label();
+            this.checkBox_OffLineFacMode = new System.Windows.Forms.CheckBox();
             this.label_FacModeResult = new System.Windows.Forms.Label();
             this.label111 = new System.Windows.Forms.Label();
             this.tabPage_ProductMode_Read = new System.Windows.Forms.TabPage();
+            this.checkBox_OffLineCheckMode = new System.Windows.Forms.CheckBox();
             this.comboBox_CheckModeCfgFile = new System.Windows.Forms.ComboBox();
             this.groupBox31 = new System.Windows.Forms.GroupBox();
             this.label148 = new System.Windows.Forms.Label();
@@ -550,9 +553,6 @@ namespace Welling_Motor_Debug_Tool
             this.label107 = new System.Windows.Forms.Label();
             this.label_StarInfo = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.屏幕键盘ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            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();
@@ -752,14 +752,14 @@ namespace Welling_Motor_Debug_Tool
             // 开机ToolStripMenuItem
             // 
             this.开机ToolStripMenuItem.Name = "开机ToolStripMenuItem";
-            this.开机ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.开机ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
             this.开机ToolStripMenuItem.Text = "开机";
             this.开机ToolStripMenuItem.Click += new System.EventHandler(this.开机ToolStripMenuItem_Click);
             // 
             // 关机ToolStripMenuItem
             // 
             this.关机ToolStripMenuItem.Name = "关机ToolStripMenuItem";
-            this.关机ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.关机ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
             this.关机ToolStripMenuItem.Text = "关机";
             this.关机ToolStripMenuItem.Click += new System.EventHandler(this.关机ToolStripMenuItem_Click);
             // 
@@ -799,7 +799,7 @@ namespace Welling_Motor_Debug_Tool
             // 允许ToolStripMenuItem
             // 
             this.允许ToolStripMenuItem.Name = "允许ToolStripMenuItem";
-            this.允许ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.允许ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.允许ToolStripMenuItem.Text = "允许";
             this.允许ToolStripMenuItem.Click += new System.EventHandler(this.允许ToolStripMenuItem_Click);
             // 
@@ -808,7 +808,7 @@ 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(180, 26);
+            this.不允许ToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
             this.不允许ToolStripMenuItem.Text = "不允许";
             this.不允许ToolStripMenuItem.Click += new System.EventHandler(this.不允许ToolStripMenuItem_Click);
             // 
@@ -829,7 +829,7 @@ namespace Welling_Motor_Debug_Tool
             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.Size = new System.Drawing.Size(144, 26);
             this.IP地址ToolStripMenuItem.Text = "IP地址";
             // 
             // toolStripTextBox_ServerIP
@@ -845,7 +845,7 @@ namespace Welling_Motor_Debug_Tool
             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.Size = new System.Drawing.Size(144, 26);
             this.端口ToolStripMenuItem.Text = "端口";
             // 
             // toolStripTextBox_ServerPort
@@ -861,7 +861,7 @@ namespace Welling_Motor_Debug_Tool
             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.Size = new System.Drawing.Size(144, 26);
             this.用户名ToolStripMenuItem.Text = "用户名";
             // 
             // toolStripTextBox_ServerUser
@@ -872,28 +872,12 @@ namespace Welling_Motor_Debug_Tool
             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_ServerPath});
-            this.存储路径ToolStripMenuItem.Name = "存储路径ToolStripMenuItem";
-            this.存储路径ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.存储路径ToolStripMenuItem.Text = "存储路径";
-            // 
-            // toolStripTextBox_ServerPath
-            // 
-            this.toolStripTextBox_ServerPath.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
-            this.toolStripTextBox_ServerPath.Name = "toolStripTextBox_ServerPath";
-            this.toolStripTextBox_ServerPath.Size = new System.Drawing.Size(200, 28);
-            this.toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
-            this.toolStripTextBox_ServerPath.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.Size = new System.Drawing.Size(144, 26);
             this.密码ToolStripMenuItem.Text = "密码";
             // 
             // toolStripTextBox_ServerPasswd
@@ -904,6 +888,22 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripTextBox_ServerPasswd.Text = "ttium";
             this.toolStripTextBox_ServerPasswd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
             // 
+            // 存储路径ToolStripMenuItem
+            // 
+            this.存储路径ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripTextBox_ServerPath});
+            this.存储路径ToolStripMenuItem.Name = "存储路径ToolStripMenuItem";
+            this.存储路径ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
+            this.存储路径ToolStripMenuItem.Text = "存储路径";
+            // 
+            // toolStripTextBox_ServerPath
+            // 
+            this.toolStripTextBox_ServerPath.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
+            this.toolStripTextBox_ServerPath.Name = "toolStripTextBox_ServerPath";
+            this.toolStripTextBox_ServerPath.Size = new System.Drawing.Size(200, 28);
+            this.toolStripTextBox_ServerPath.Text = "MIGIC_TEST";
+            this.toolStripTextBox_ServerPath.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
+            // 
             // 生产信息ToolStripMenuItem
             // 
             this.生产信息ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -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(180, 26);
+            this.生产商ToolStripMenuItem.Size = new System.Drawing.Size(144, 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(180, 26);
+            this.生产地ToolStripMenuItem.Size = new System.Drawing.Size(144, 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(180, 26);
+            this.生产日期ToolStripMenuItem.Size = new System.Drawing.Size(144, 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(180, 26);
+            this.产品标识ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.产品标识ToolStripMenuItem.Text = "产品标识";
             // 
             // toolStripTextBox_MACPD
@@ -1049,7 +1049,7 @@ namespace Welling_Motor_Debug_Tool
             this.toolStripTextBox_ThCur.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.toolStripTextBox_ThCur.Name = "toolStripTextBox_ThCur";
             this.toolStripTextBox_ThCur.Size = new System.Drawing.Size(100, 28);
-            this.toolStripTextBox_ThCur.Text = "500,2500";
+            this.toolStripTextBox_ThCur.Text = "200,2500";
             this.toolStripTextBox_ThCur.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigFileSave_KeyDown);
             // 
             // 转速ToolStripMenuItem
@@ -1187,29 +1187,36 @@ namespace Welling_Motor_Debug_Tool
             // 运行信息记录ToolStripMenuItem
             // 
             this.运行信息记录ToolStripMenuItem.Name = "运行信息记录ToolStripMenuItem";
-            this.运行信息记录ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.运行信息记录ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.运行信息记录ToolStripMenuItem.Text = "自动记录";
             this.运行信息记录ToolStripMenuItem.Click += new System.EventHandler(this.记录数据ToolStripMenuItem_Click);
             // 
             // 计算器ToolStripMenuItem
             // 
             this.计算器ToolStripMenuItem.Name = "计算器ToolStripMenuItem";
-            this.计算器ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.计算器ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.计算器ToolStripMenuItem.Text = "计算器";
             this.计算器ToolStripMenuItem.Click += new System.EventHandler(this.计算器ToolStripMenuItem_Click);
             // 
             // 页面保存ToolStripMenuItem
             // 
             this.页面保存ToolStripMenuItem.Name = "页面保存ToolStripMenuItem";
-            this.页面保存ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.页面保存ToolStripMenuItem.Size = new System.Drawing.Size(144, 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.Text = "屏幕键盘";
+            this.屏幕键盘ToolStripMenuItem.Click += new System.EventHandler(this.屏幕键盘ToolStripMenuItem_Click);
+            // 
             // 指令调试ToolStripMenuItem
             // 
             this.指令调试ToolStripMenuItem.Enabled = false;
             this.指令调试ToolStripMenuItem.Name = "指令调试ToolStripMenuItem";
-            this.指令调试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.指令调试ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.指令调试ToolStripMenuItem.Text = "指令调试";
             // 
             // 查询ToolStripMenuItem
@@ -1225,14 +1232,14 @@ namespace Welling_Motor_Debug_Tool
             // 调试记录数据ToolStripMenuItem
             // 
             this.调试记录数据ToolStripMenuItem.Name = "调试记录数据ToolStripMenuItem";
-            this.调试记录数据ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.调试记录数据ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
             this.调试记录数据ToolStripMenuItem.Text = "调试记录数据";
             this.调试记录数据ToolStripMenuItem.Click += new System.EventHandler(this.调试记录数据ToolStripMenuItem_Click);
             // 
             // 生产记录数据ToolStripMenuItem
             // 
             this.生产记录数据ToolStripMenuItem.Name = "生产记录数据ToolStripMenuItem";
-            this.生产记录数据ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.生产记录数据ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
             this.生产记录数据ToolStripMenuItem.Text = "生产记录数据";
             this.生产记录数据ToolStripMenuItem.Click += new System.EventHandler(this.生产记录数据ToolStripMenuItem_Click);
             // 
@@ -1250,13 +1257,13 @@ namespace Welling_Motor_Debug_Tool
             // 帮助ToolStripMenuItem
             // 
             this.帮助ToolStripMenuItem.Name = "帮助ToolStripMenuItem";
-            this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.帮助ToolStripMenuItem.Text = "查看帮助";
             // 
             // 版本ToolStripMenuItem
             // 
             this.版本ToolStripMenuItem.Name = "版本ToolStripMenuItem";
-            this.版本ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.版本ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
             this.版本ToolStripMenuItem.Text = "版本信息";
             // 
             // 累计运行时间ToolStripMenuItem
@@ -1264,14 +1271,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(180, 26);
+            this.累计运行时间ToolStripMenuItem.Size = new System.Drawing.Size(144, 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(180, 26);
+            this.toolStripMenuItem_RunTime.Size = new System.Drawing.Size(142, 26);
             this.toolStripMenuItem_RunTime.Text = "00:00:00";
             // 
             // statusStrip1
@@ -4973,6 +4980,19 @@ namespace Welling_Motor_Debug_Tool
             this.label_FacModeStatus.Text = "测试结束";
             this.label_FacModeStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // 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);
+            // 
             // label_FacModeResult
             // 
             this.label_FacModeResult.BackColor = System.Drawing.Color.Green;
@@ -5018,6 +5038,19 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_ProductMode_Read.TabIndex = 12;
             this.tabPage_ProductMode_Read.Text = "量产检验";
             // 
+            // 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);
+            // 
             // comboBox_CheckModeCfgFile
             // 
             this.comboBox_CheckModeCfgFile.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
@@ -6231,39 +6264,6 @@ namespace Welling_Motor_Debug_Tool
             this.pictureBox2.TabIndex = 16;
             this.pictureBox2.TabStop = false;
             // 
-            // 屏幕键盘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);
-            // 
-            // 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
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);

+ 71 - 35
Welling_Motor_Debug_Tool/mainForm.cs

@@ -9,6 +9,7 @@ using System.IO.Ports;
 using System.Linq;
 using System.Reflection;
 using System.Runtime.InteropServices;
+using System.Runtime.InteropServices.ComTypes;
 using System.Text.RegularExpressions;
 using System.Threading;
 using System.Web;
@@ -136,6 +137,12 @@ namespace Welling_Motor_Debug_Tool
             mySerialProcess.Init();
             toolStripComboBox_ComNum.Items.AddRange(mySerialProcess.refreshPort());
 
+            //检查备忘录文件
+            if (!System.IO.File.Exists(localInfo.LocalPath + localInfo.NoteFileName))
+            {
+                System.IO.File.WriteAllText(localInfo.LocalPath + localInfo.NoteFileName, "");
+            }
+
             //检查配置文件
             if (!Directory.Exists(localInfo.LocalPath))
             {
@@ -303,7 +310,7 @@ namespace Welling_Motor_Debug_Tool
                         //应答指令不提示
                         ACK_DisFlag = false;
                     }
-                    else if (EnterForm1.comboBox_User.Text == "工程配置")
+                    else if (EnterForm1.comboBox_User.Text == "工程参数配置")
                     {
                         //隐藏工作台内容,新建窗口完成配置
                         groupBox1.Visible = false;
@@ -321,8 +328,19 @@ namespace Welling_Motor_Debug_Tool
                         //隐藏量产界面
                         tabPage_ProductMode_Read.Parent = null;
                         tabPage_ProductMode_Write.Parent = null;
+                        //隐藏配置项
+                        其它配置项ToolStripMenuItem.Visible = false;
+                        离线使用ToolStripMenuItem.Visible = false;
+                        服务器配置ToolStripMenuItem.Visible = false;
                         判断阈值ToolStripMenuItem.Visible = false;
                         力矩传感器检验ToolStripMenuItem.Visible = false;
+                        //显示生产信息
+                        生产信息ToolStripMenuItem.Visible = true;
+                        //显示电机类型,但不可编辑
+                        电机类型ToolStripMenuItem.Visible = true;
+                        中置电机ToolStripMenuItem.Enabled = true;
+                        轮毂电机ToolStripMenuItem.Enabled = true;
+
                         if (EnterForm1.comboBox_User.Text.Contains("中置"))
                         {
                             中置电机ToolStripMenuItem.Checked = true;
@@ -340,11 +358,17 @@ namespace Welling_Motor_Debug_Tool
                             ConfigFileSave(false, localInfo.LocalPath + localInfo.ConfigFileName);
                         }
                     }
-                    else if (EnterForm1.comboBox_User.Text == "研发试")
+                    else if (EnterForm1.comboBox_User.Text == "研发试")
                     {
                         //隐藏量产界面
                         tabPage_ProductMode_Read.Parent = null;
                         tabPage_ProductMode_Write.Parent = null;
+                        判断阈值ToolStripMenuItem.Visible = false;
+                        力矩传感器检验ToolStripMenuItem.Visible = false;
+                    }
+                    else if (EnterForm1.comboBox_User.Text == "管理员")
+                    {
+                        //不隐藏任何界面
                     }
                     else
                     {
@@ -404,10 +428,13 @@ namespace Welling_Motor_Debug_Tool
                 myFtp.IsNetConnected = false;
                 if (允许ToolStripMenuItem.Checked == false) ///不允许离线使用,自动关闭 
                 {
-                    timer_1s.Enabled = false;
-                    MessageBox.Show("网络断开,将自动关闭!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    timer_1s.Enabled = true;
-                    this.Close();
+                    if (EnterForm1.comboBox_User.Text != "管理员")
+                    {
+                        timer_1s.Enabled = false;
+                        MessageBox.Show("网络断开,将自动关闭!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                        timer_1s.Enabled = true;
+                        this.Close();
+                    }                      
                 }
                 else //离线使用
                 {
@@ -4660,7 +4687,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         连接开机ToolStripMenuItem.Checked = !连接开机ToolStripMenuItem.Checked;
                         ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
@@ -4694,7 +4721,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         断开关机ToolStripMenuItem.Checked = !断开关机ToolStripMenuItem.Checked;
                         ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
@@ -4728,7 +4755,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         识别通讯盒ToolStripMenuItem.Checked = !识别通讯盒ToolStripMenuItem.Checked;
                         ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
@@ -4829,7 +4856,7 @@ namespace Welling_Motor_Debug_Tool
                 {
                     if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                     {
-                        if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                        if (EnterForm1.comboBox_User.Text == "管理员")
                         {                            
                             ConfigFileSave(true, localInfo.LocalPath + localInfo.ConfigFileName);
                         }
@@ -4863,7 +4890,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         允许ToolStripMenuItem.Checked = true;
                         不允许ToolStripMenuItem.Checked = false;
@@ -4995,7 +5022,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         IP地址ToolStripMenuItem.Visible = true;
                         端口ToolStripMenuItem.Visible = true;
@@ -5042,7 +5069,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if ((EnterForm1.comboBox_User.Text == "工程配置") || (EnterForm1.comboBox_User.Text == "研发测试"))
+                    if (EnterForm1.comboBox_User.Text == "管理员")
                     {
                         生产商ToolStripMenuItem.Visible = true;
                         生产地ToolStripMenuItem.Visible = true;
@@ -5258,6 +5285,9 @@ namespace Welling_Motor_Debug_Tool
             Code[0] = 0xF0;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
 
+            //关闭串口
+            mySerialProcess.SerialClose(false);
+
             //路径设置
             string LocalSavePath = "";
             string ServerSavePath = "";
@@ -5356,12 +5386,7 @@ namespace Welling_Motor_Debug_Tool
                     c.Enabled = false;
             }
             WriteLockStatus = true;
-            //检查串口
-            if (!mySerialProcess.mySerial.IsOpen)
-            {
-                MessageBox.Show("请检查串口连接!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                return;
-            }
+            
             //检查配置文件
             if (comboBox_FacModeCfgFile.Text == "")
             {
@@ -5392,7 +5417,7 @@ namespace Welling_Motor_Debug_Tool
             richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "检查扫码信息" + "\r\n");
             if (textBox_FacModeScan.Text == string.Empty)
             {
-                MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);                
                 return;
             }
             try
@@ -5402,7 +5427,7 @@ namespace Welling_Motor_Debug_Tool
                     label_FacModeStatus.Text = "存在故障!";
                     label_FacModeResult.BackColor = Color.Red;
                     label_FacModeResult.Text = "标签格式错误";
-                    button__FacMode_Start.Enabled = true;
+                    button__FacMode_Start.Enabled = true;                    
                     return;
                 }                
             }
@@ -5411,7 +5436,15 @@ namespace Welling_Motor_Debug_Tool
                 label_FacModeStatus.Text = "存在故障!";
                 label_FacModeResult.BackColor = Color.Red;
                 label_FacModeResult.Text = "标签格式错误";
-                button__FacMode_Start.Enabled = true;
+                button__FacMode_Start.Enabled = true;                
+                return;
+            }
+
+            //打开串口
+            mySerialProcess.SerialOpen(toolStripComboBox_ComNum.Text, toolStripComboBox_Baudrate.Text, false, false);
+            if (!mySerialProcess.mySerial.IsOpen)
+            {
+                MessageBox.Show("请检查串口连接!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
 
@@ -5433,10 +5466,7 @@ namespace Welling_Motor_Debug_Tool
             richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开始测试" + "\r\n");
 
             //变量定义
-            var Code = new byte[255];//发送的指令数据
-            ushort DataTemp;
-            short DataTemp_Int16;
-            string ResultPathName = "";
+            var Code = new byte[255];//发送的指令数据                      
             
             label_FacModeStatus.Text = "开始测试";
             Delay_ms(500);
@@ -6572,6 +6602,9 @@ namespace Welling_Motor_Debug_Tool
             Code[0] = 0xF0;
             mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
 
+            //关闭串口
+            mySerialProcess.SerialClose(false);
+
             //路径设置
             string LocalSavePath = "";
             string ServerSavePath = "";
@@ -6662,12 +6695,7 @@ namespace Welling_Motor_Debug_Tool
                     c.Enabled = false;
             }
             ReadLockStatus = true;
-            //检查串口
-            if (!mySerialProcess.mySerial.IsOpen)
-            {
-                MessageBox.Show("请检查串口连接!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                return;
-            }
+            
             //检查配置文件
             if (comboBox_CheckModeCfgFile.Text == "")
             {
@@ -6722,6 +6750,14 @@ namespace Welling_Motor_Debug_Tool
                 return;
             }
 
+            //打开串口
+            mySerialProcess.SerialOpen(toolStripComboBox_ComNum.Text, toolStripComboBox_Baudrate.Text, false, false);
+            if (!mySerialProcess.mySerial.IsOpen)
+            {
+                MessageBox.Show("请检查串口连接!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
             //流水号计数
             //...
 
@@ -7233,7 +7269,7 @@ namespace Welling_Motor_Debug_Tool
             {
                 if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                 {
-                    if (EnterForm1.comboBox_User.Text == "工程配置")
+                    if (EnterForm1.comboBox_User.Text == "工程参数配置")
                     {
                         TorqueParamsForm.ShowDialog();
                     }
@@ -7308,7 +7344,7 @@ namespace Welling_Motor_Debug_Tool
                 {
                     if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                     {
-                        if (EnterForm1.comboBox_User.Text == "工程配置")
+                        if (EnterForm1.comboBox_User.Text == "工程参数配置")
                         {
                             pictureBox_WriteLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Unlock;
                             foreach (Control c in groupBox2.Controls)
@@ -7357,7 +7393,7 @@ namespace Welling_Motor_Debug_Tool
                 {
                     if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
                     {
-                        if (EnterForm1.comboBox_User.Text == "工程配置")
+                        if (EnterForm1.comboBox_User.Text == "工程参数配置")
                         {                            
                             pictureBox_ReadLock.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Unlock;
                             foreach (Control c in groupBox29.Controls)

BIN
Welling_Motor_Debug_Tool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.AssemblyReference.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