Procházet zdrojové kódy

1、生产模式和检验模式获取配置文件时,默认显示最近10组日期,点击选择全部可以获取全部文件;
2、增加屏幕键盘;
3、增加系统清除是否执行的设置项,兼容先标定测功、后写参数的工序。

dail před 3 roky
rodič
revize
875e0a2f7e

+ 69 - 60
CheckForm.Designer.cs

@@ -31,10 +31,8 @@
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CheckForm));
             this.menuStrip1 = new System.Windows.Forms.MenuStrip();
-            this.toolStripMenuIte_PortSet = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem_PowerKey = 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.groupBox4 = new System.Windows.Forms.GroupBox();
             this.comboBox_cfgFileDate = new System.Windows.Forms.ComboBox();
             this.checkBox_LocalFile = new System.Windows.Forms.CheckBox();
@@ -73,8 +71,11 @@
             this.groupBox8 = new System.Windows.Forms.GroupBox();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            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();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -93,8 +94,7 @@
             this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.menuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F);
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripMenuIte_PortSet,
-            this.ToolStripMenuItem_PowerKey,
+            this.设置ToolStripMenuItem,
             this.工具箱ToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
@@ -103,41 +103,22 @@
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             // 
-            // toolStripMenuIte_PortSet
-            // 
-            this.toolStripMenuIte_PortSet.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.toolStripMenuIte_PortSet.Name = "toolStripMenuIte_PortSet";
-            this.toolStripMenuIte_PortSet.Size = new System.Drawing.Size(86, 25);
-            this.toolStripMenuIte_PortSet.Text = "端口设置";
-            this.toolStripMenuIte_PortSet.Click += new System.EventHandler(this.toolStripMenuIte_PortSet_Click);
-            // 
-            // ToolStripMenuItem_PowerKey
-            // 
-            this.ToolStripMenuItem_PowerKey.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.开ToolStripMenuItem,
-            this.关ToolStripMenuItem});
-            this.ToolStripMenuItem_PowerKey.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.ToolStripMenuItem_PowerKey.Name = "ToolStripMenuItem_PowerKey";
-            this.ToolStripMenuItem_PowerKey.Size = new System.Drawing.Size(86, 25);
-            this.ToolStripMenuItem_PowerKey.Text = "系统开关";
-            // 
-            // 开ToolStripMenuItem
+            // 工具箱ToolStripMenuItem
             // 
-            this.开ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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);
+            this.工具箱ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.屏幕键盘ToolStripMenuItem});
+            this.工具箱ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.工具箱ToolStripMenuItem.Name = "工具箱ToolStripMenuItem";
+            this.工具箱ToolStripMenuItem.Size = new System.Drawing.Size(70, 25);
+            this.工具箱ToolStripMenuItem.Text = "工具箱";
             // 
-            // ToolStripMenuItem
+            // 屏幕键盘ToolStripMenuItem
             // 
-            this.关ToolStripMenuItem.Checked = true;
-            this.关ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.关ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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);
+            this.屏幕键盘ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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_1);
             // 
             // groupBox4
             // 
@@ -168,7 +149,7 @@
             // checkBox_LocalFile
             // 
             this.checkBox_LocalFile.AutoSize = true;
-            this.checkBox_LocalFile.Location = new System.Drawing.Point(891, 26);
+            this.checkBox_LocalFile.Location = new System.Drawing.Point(891, 28);
             this.checkBox_LocalFile.Name = "checkBox_LocalFile";
             this.checkBox_LocalFile.Size = new System.Drawing.Size(61, 25);
             this.checkBox_LocalFile.TabIndex = 2;
@@ -224,7 +205,7 @@
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(423, 21);
             this.label2.TabIndex = 13;
-            this.label2.Text = "Copyright © 2021 MOTINOVA Inc. All Rights Reserved";
+            this.label2.Text = "Copyright © 2022 MOTINOVA Inc. All Rights Reserved";
             // 
             // label6
             // 
@@ -370,7 +351,7 @@
             this.label_error_code.Name = "label_error_code";
             this.label_error_code.Size = new System.Drawing.Size(105, 30);
             this.label_error_code.TabIndex = 3;
-            this.label_error_code.Text = "20000000H";
+            this.label_error_code.Text = "无故障";
             this.label_error_code.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             this.label_error_code.MouseHover += new System.EventHandler(this.label_error_code_MouseHover);
             // 
@@ -574,22 +555,49 @@
             this.pictureBox1.TabIndex = 30;
             this.pictureBox1.TabStop = false;
             // 
-            // 工具箱ToolStripMenuItem
+            // 设置ToolStripMenuItem
             // 
-            this.工具箱ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.屏幕键盘ToolStripMenuItem});
-            this.工具箱ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.工具箱ToolStripMenuItem.Name = "工具箱ToolStripMenuItem";
-            this.工具箱ToolStripMenuItem.Size = new System.Drawing.Size(70, 25);
-            this.工具箱ToolStripMenuItem.Text = "工具箱";
+            this.设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.端口设置ToolStripMenuItem,
+            this.系统开关ToolStripMenuItem});
+            this.设置ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem";
+            this.设置ToolStripMenuItem.Size = new System.Drawing.Size(54, 25);
+            this.设置ToolStripMenuItem.Text = "设置";
             // 
-            // 屏幕键盘ToolStripMenuItem
+            // 端口设置ToolStripMenuItem
             // 
-            this.屏幕键盘ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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_1);
+            this.端口设置ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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.开ToolStripMenuItem,
+            this.关ToolStripMenuItem});
+            this.系统开关ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.系统开关ToolStripMenuItem.Name = "系统开关ToolStripMenuItem";
+            this.系统开关ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.系统开关ToolStripMenuItem.Text = "系统开关";
+            // 
+            // 开ToolStripMenuItem
+            // 
+            this.开ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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);
             // 
             // CheckForm
             // 
@@ -648,8 +656,6 @@
         #endregion
 
         private System.Windows.Forms.MenuStrip menuStrip1;
-        private System.Windows.Forms.ToolStripMenuItem toolStripMenuIte_PortSet;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_PowerKey;
         private System.Windows.Forms.GroupBox groupBox4;
         private System.Windows.Forms.ComboBox comboBox_File;
         private System.Windows.Forms.Label label_SystemTime;
@@ -667,8 +673,6 @@
         private System.Windows.Forms.RichTextBox richTextBox_CfgFile;
         private System.Windows.Forms.RichTextBox richTextBox_ReadCfg;
         private System.Windows.Forms.RichTextBox richTextBox_TestRecord;
-        private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
         private System.Windows.Forms.Label label_error_code;
         private System.Windows.Forms.Timer timer2;
         private System.Windows.Forms.ComboBox comboBox_cfgFileDate;
@@ -693,5 +697,10 @@
         private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.ToolStripMenuItem 工具箱ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 屏幕键盘ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 设置ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 端口设置ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 系统开关ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
     }
 }

+ 45 - 8
CheckForm.cs

@@ -684,7 +684,7 @@ namespace MOTINOVA_Motor_Factory_Set
         #endregion
 
         #region 获取配置文件日期
-        private void GetDateList()
+        private void GetDateList(bool DisAll)
         {
             string[] DateList = { "" };
             if (checkBox_LocalFile.Checked == true)//从本地更新日期列表
@@ -696,9 +696,23 @@ namespace MOTINOVA_Motor_Factory_Set
                 DateList = StartForm.myFtp.GetDirectoryList(StartForm.myServerCfg.RootPath + "/cfg");
             }
             comboBox_cfgFileDate.Items.Clear();
-            foreach (var file in DateList)
+            //日期列表加载
+            if (DisAll == true)
             {
-                comboBox_cfgFileDate.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+                comboBox_cfgFileDate.Items.Add("显示近期");
+                comboBox_cfgFileDate.Items.Add("---");
+                foreach (var file in DateList)
+                    comboBox_cfgFileDate.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+            }
+            else
+            {
+                if (DateList.Length > 10)
+                {
+                    comboBox_cfgFileDate.Items.Add("显示全部");
+                    comboBox_cfgFileDate.Items.Add("---");
+                }
+                for (int i = (DateList.Length > 10) ? (DateList.Length - 10) : 0; i < DateList.Length; i++)//显示最近10个日期
+                    comboBox_cfgFileDate.Items.Add(DateList[i].Substring(DateList[i].LastIndexOf("\\") + 1));
             }
         }
         #endregion
@@ -726,8 +740,19 @@ namespace MOTINOVA_Motor_Factory_Set
         #region 选择文件日期后更新文件列表
         private void comboBox_cfgFileDate_SelectionChangeCommitted(object sender, EventArgs e)
         {
-            comboBox_File.Text = "";
-            GetFileListFrom(comboBox_cfgFileDate.SelectedItem.ToString());
+            if (comboBox_cfgFileDate.SelectedItem.ToString() == "显示全部")
+            {
+                GetDateList(true);
+            }
+            else if (comboBox_cfgFileDate.SelectedItem.ToString() == "显示近期")
+            {
+                GetDateList(false);
+            }
+            else
+            {
+                comboBox_File.Text = "";
+                GetFileListFrom(comboBox_cfgFileDate.SelectedItem.ToString());
+            }
         }
         #endregion
 
@@ -788,7 +813,7 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             comboBox_cfgFileDate.Text = "";
             comboBox_File.Text = "";
-            GetDateList();
+            GetDateList(false);
         }
         #endregion
 
@@ -909,7 +934,6 @@ namespace MOTINOVA_Motor_Factory_Set
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开始测试" + "\r\n";
             label_Result.Text = "不合格";
             label_Result.BackColor = Color.Red;
-            label_Step.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
 
             //公有变量
             var Code = new byte[32];//发送的指令数据
@@ -1295,7 +1319,7 @@ namespace MOTINOVA_Motor_Factory_Set
             timer2.Enabled = true;
 
             //窗口加载时,从FTP服务器或本地获取文件日期列表
-            GetDateList();
+            GetDateList(false);
             //装载序列号文件
             string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
             StreamReader objReader = new StreamReader(cfg_file);
@@ -1355,11 +1379,13 @@ namespace MOTINOVA_Motor_Factory_Set
             if (comboBox_File.Items.Count == 0) //配置文件目录为空
             {
                 label_Step.Text = "无可用配置文件!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
             if (comboBox_File.Text.Trim().Length == 0)//未选择配置文件
             {
                 label_Step.Text = "请选择配置文件!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
             #endregion
@@ -1389,9 +1415,15 @@ namespace MOTINOVA_Motor_Factory_Set
             if (portsettings_form.openPort() == false)
             {
                 label_Step.Text = "串口连接失败!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
 
+            //测试状态更新
+            label_Step.Text = "准备开始测试";
+            label_Step.ForeColor = Color.Red;
+            Delay_ms(500);
+
             //流水号累加和存储
             label_SerialNum.Text = (Convert.ToInt32(label_SerialNum.Text) + 1).ToString();
             string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
@@ -1467,5 +1499,10 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             System.Diagnostics.Process.Start("osk.exe");
         }
+
+        private void 端口设置ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            portsettings_form.Show();
+        }
     }
 }

+ 7 - 3
Enter.Designer.cs

@@ -61,6 +61,7 @@
             this.textBox_Passwd.Size = new System.Drawing.Size(171, 29);
             this.textBox_Passwd.TabIndex = 2;
             this.textBox_Passwd.UseSystemPasswordChar = true;
+            this.textBox_Passwd.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox_Passwd_KeyUp);
             // 
             // textBox_User
             // 
@@ -111,12 +112,15 @@
             // 
             // button_keyboard
             // 
-            this.button_keyboard.Location = new System.Drawing.Point(281, 217);
+            this.button_keyboard.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.button_keyboard.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_keyboard.ForeColor = System.Drawing.Color.White;
+            this.button_keyboard.Location = new System.Drawing.Point(281, 207);
             this.button_keyboard.Name = "button_keyboard";
-            this.button_keyboard.Size = new System.Drawing.Size(75, 33);
+            this.button_keyboard.Size = new System.Drawing.Size(91, 43);
             this.button_keyboard.TabIndex = 34;
             this.button_keyboard.Text = "屏幕键盘";
-            this.button_keyboard.UseVisualStyleBackColor = true;
+            this.button_keyboard.UseVisualStyleBackColor = false;
             this.button_keyboard.Click += new System.EventHandler(this.button_keyboard_Click);
             // 
             // Enter

+ 6 - 0
Enter.cs

@@ -30,5 +30,11 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             System.Diagnostics.Process.Start("osk.exe");
         }
+
+        private void textBox_Passwd_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter) 
+                this.Close();
+        }
     }
 }

+ 1 - 1
ExportForm.Designer.cs

@@ -190,7 +190,7 @@
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(423, 21);
             this.label2.TabIndex = 5;
-            this.label2.Text = "Copyright © 2021 MOTINOVA Inc. All Rights Reserved";
+            this.label2.Text = "Copyright © 2022 MOTINOVA Inc. All Rights Reserved";
             // 
             // groupBox2
             // 

+ 4 - 0
ExportForm.cs

@@ -609,6 +609,10 @@ namespace MOTINOVA_Motor_Factory_Set
                 {
                     MessageBox.Show("文件上传服务器成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
+                else
+                {
+                    MessageBox.Show("文件上传服务器失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
         }
 

+ 98 - 57
ImportForm.Designer.cs

@@ -33,10 +33,12 @@
             this.label2 = new System.Windows.Forms.Label();
             this.label_SystemTime = new System.Windows.Forms.Label();
             this.menuStrip1 = new System.Windows.Forms.MenuStrip();
-            this.toolStripMenuIte_PortSet = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem_PowerKey = 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();
+            this.工具箱ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.屏幕键盘ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
             this.checkBox_LocalFile = new System.Windows.Forms.CheckBox();
             this.comboBox_cfgFileDate = new System.Windows.Forms.ComboBox();
@@ -137,8 +139,10 @@
             this.label_NetStatus = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            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.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -160,7 +164,7 @@
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(423, 21);
             this.label2.TabIndex = 3;
-            this.label2.Text = "Copyright © 2021 MOTINOVA Inc. All Rights Reserved";
+            this.label2.Text = "Copyright © 2022 MOTINOVA Inc. All Rights Reserved";
             // 
             // label_SystemTime
             // 
@@ -179,8 +183,7 @@
             this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.menuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripMenuIte_PortSet,
-            this.ToolStripMenuItem_PowerKey,
+            this.设置ToolStripMenuItem,
             this.工具箱ToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
@@ -188,42 +191,59 @@
             this.menuStrip1.TabIndex = 7;
             this.menuStrip1.Text = "端口设置";
             // 
-            // toolStripMenuIte_PortSet
+            // 设置ToolStripMenuItem
             // 
-            this.toolStripMenuIte_PortSet.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.toolStripMenuIte_PortSet.Name = "toolStripMenuIte_PortSet";
-            this.toolStripMenuIte_PortSet.Size = new System.Drawing.Size(86, 25);
-            this.toolStripMenuIte_PortSet.Text = "端口设置";
-            this.toolStripMenuIte_PortSet.Click += new System.EventHandler(this.toolStripMenuIte_PortSet_Click);
+            this.设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.系统清除ToolStripMenuItem,
+            this.端口选择ToolStripMenuItem,
+            this.系统开关ToolStripMenuItem});
+            this.设置ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem";
+            this.设置ToolStripMenuItem.Size = new System.Drawing.Size(54, 25);
+            this.设置ToolStripMenuItem.Text = "设置";
             // 
-            // ToolStripMenuItem_PowerKey
+            // 系统清除ToolStripMenuItem
             // 
-            this.ToolStripMenuItem_PowerKey.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.开ToolStripMenuItem,
-            this.关ToolStripMenuItem});
-            this.ToolStripMenuItem_PowerKey.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.ToolStripMenuItem_PowerKey.ImageTransparentColor = System.Drawing.Color.White;
-            this.ToolStripMenuItem_PowerKey.Name = "ToolStripMenuItem_PowerKey";
-            this.ToolStripMenuItem_PowerKey.Size = new System.Drawing.Size(86, 25);
-            this.ToolStripMenuItem_PowerKey.Text = "系统开关";
+            this.系统清除ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.执行ToolStripMenuItem,
+            this.不执行ToolStripMenuItem});
+            this.系统清除ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.系统清除ToolStripMenuItem.Name = "系统清除ToolStripMenuItem";
+            this.系统清除ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.系统清除ToolStripMenuItem.Text = "系统清除";
             // 
-            // ToolStripMenuItem
+            // 执行ToolStripMenuItem
             // 
-            this.ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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);
+            this.执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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
+            // 不执行ToolStripMenuItem
             // 
-            this.关ToolStripMenuItem.Checked = true;
-            this.关ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.关ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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);
+            this.不执行ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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.屏幕键盘ToolStripMenuItem});
+            this.工具箱ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.工具箱ToolStripMenuItem.Name = "工具箱ToolStripMenuItem";
+            this.工具箱ToolStripMenuItem.Size = new System.Drawing.Size(70, 25);
+            this.工具箱ToolStripMenuItem.Text = "工具箱";
+            // 
+            // 屏幕键盘ToolStripMenuItem
+            // 
+            this.屏幕键盘ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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);
             // 
             // groupBox4
             // 
@@ -1289,10 +1309,10 @@
             this.label_NetStatus.BackColor = System.Drawing.Color.Red;
             this.label_NetStatus.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label_NetStatus.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_NetStatus.Location = new System.Drawing.Point(604, 791);
+            this.label_NetStatus.Location = new System.Drawing.Point(616, 791);
             this.label_NetStatus.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
             this.label_NetStatus.Name = "label_NetStatus";
-            this.label_NetStatus.Size = new System.Drawing.Size(365, 21);
+            this.label_NetStatus.Size = new System.Drawing.Size(355, 21);
             this.label_NetStatus.TabIndex = 3;
             this.label_NetStatus.Text = "网络连接失败";
             this.label_NetStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -1317,22 +1337,39 @@
             this.pictureBox1.TabIndex = 32;
             this.pictureBox1.TabStop = false;
             // 
-            // 工具箱ToolStripMenuItem
+            // 端口选择ToolStripMenuItem
             // 
-            this.工具箱ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.屏幕键盘ToolStripMenuItem});
-            this.工具箱ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.工具箱ToolStripMenuItem.Name = "工具箱ToolStripMenuItem";
-            this.工具箱ToolStripMenuItem.Size = new System.Drawing.Size(70, 25);
-            this.工具箱ToolStripMenuItem.Text = "工具箱";
+            this.端口选择ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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
+            // 系统开关ToolStripMenuItem
             // 
-            this.屏幕键盘ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            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);
+            this.系统开关ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.开ToolStripMenuItem,
+            this.关ToolStripMenuItem});
+            this.系统开关ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.系统开关ToolStripMenuItem.Name = "系统开关ToolStripMenuItem";
+            this.系统开关ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.系统开关ToolStripMenuItem.Text = "系统开关";
+            // 
+            // 开ToolStripMenuItem
+            // 
+            this.开ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            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);
             // 
             // ImportForm
             // 
@@ -1388,7 +1425,6 @@
         #endregion
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label_SystemTime;
-        private System.Windows.Forms.ToolStripMenuItem toolStripMenuIte_PortSet;
         private System.Windows.Forms.GroupBox groupBox4;
         private System.Windows.Forms.ComboBox comboBox_File;
         private System.Windows.Forms.GroupBox groupBox1;
@@ -1464,9 +1500,6 @@
         private System.Windows.Forms.Timer timer2;
         private System.Windows.Forms.MenuStrip menuStrip1;
         private System.Windows.Forms.Label label_ErrorInfo;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_PowerKey;
-        private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
         private System.Windows.Forms.RichTextBox richTextBox_CfgFile;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.GroupBox groupBox3;
@@ -1495,5 +1528,13 @@
         private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.ToolStripMenuItem 工具箱ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 屏幕键盘ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 设置ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 系统清除ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 执行ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 不执行ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 端口选择ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 系统开关ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
     }
 }

+ 104 - 44
ImportForm.cs

@@ -103,7 +103,7 @@ namespace MOTINOVA_Motor_Factory_Set
         }
 
         #region 获取配置文件日期
-        private void GetDateList()
+        private void GetDateList(bool DisAll)
          {
             string[] DateList = { "" };
             if (checkBox_LocalFile.Checked == true)//从本地更新日期列表
@@ -115,9 +115,23 @@ namespace MOTINOVA_Motor_Factory_Set
                 DateList = StartForm.myFtp.GetDirectoryList(StartForm.myServerCfg.RootPath + "/cfg");
             }
             comboBox_cfgFileDate.Items.Clear();
-            foreach (var file in DateList)
+            //日期列表加载
+            if (DisAll == true)
             {
-                comboBox_cfgFileDate.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+                comboBox_cfgFileDate.Items.Add("显示近期");
+                comboBox_cfgFileDate.Items.Add("---");
+                foreach (var file in DateList)
+                    comboBox_cfgFileDate.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+            }
+            else
+            {
+                if (DateList.Length > 10)
+                {
+                    comboBox_cfgFileDate.Items.Add("显示全部");
+                    comboBox_cfgFileDate.Items.Add("---");
+                }
+                for (int i = (DateList.Length > 10) ? (DateList.Length - 10) : 0; i < DateList.Length; i++)//显示最近10个日期
+                    comboBox_cfgFileDate.Items.Add(DateList[i].Substring(DateList[i].LastIndexOf("\\") + 1));
             }
         }
         #endregion
@@ -145,8 +159,19 @@ namespace MOTINOVA_Motor_Factory_Set
         #region 选择文件日期后更新文件列表
         private void comboBox_cfgFileDate_SelectionChangeCommitted(object sender, EventArgs e)
         {
-            comboBox_File.Text = "";
-            GetFileListFrom(comboBox_cfgFileDate.SelectedItem.ToString());
+            if (comboBox_cfgFileDate.SelectedItem.ToString() == "显示全部")
+            {
+                GetDateList(true);
+            }
+            else if (comboBox_cfgFileDate.SelectedItem.ToString() == "显示近期")
+            {
+                GetDateList(false);
+            }
+            else
+            {
+                comboBox_File.Text = "";
+                GetFileListFrom(comboBox_cfgFileDate.SelectedItem.ToString());
+            }
         }
         #endregion
 
@@ -217,7 +242,7 @@ namespace MOTINOVA_Motor_Factory_Set
             comboBox_cfgFileDate.Text = "";
             comboBox_File.Text = "";
             richTextBox_CfgFile.Text = "";
-            GetDateList();
+            GetDateList(false);
         }
         #endregion
 
@@ -227,7 +252,7 @@ namespace MOTINOVA_Motor_Factory_Set
             timer2.Enabled = true;
 
             //装载配置文件
-            GetDateList();
+            GetDateList(false);
 
             //装载序列号文件
             string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
@@ -961,46 +986,54 @@ namespace MOTINOVA_Motor_Factory_Set
             }
 
             #region Step1:发送指令,系统清除
-            TestStep = TestStep_Enum.Step_SysClear;
-            label_Step.Text = "系统清除,请等待!";
-            richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送系统清除指令" + "\r\n";
-            Array.Clear(Code, 0, 32);
-            Code[0] = (byte)'C';
-            Code[1] = (byte)'L';
-            Code[2] = (byte)'E';
-            Code[3] = (byte)'A';
-            Code[4] = (byte)'R';
-            SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2605, Code);
-            Ack_Flag = false;
-            Ack_Cnt = 0;
-            StepTestFlag = StepTestResult_Enum.StepTestResult_Testing;
-            while (StepTestFlag == StepTestResult_Enum.StepTestResult_Testing);//等待测试结束
-            if (StepTestFlag == StepTestResult_Enum.StepTestResult_OK)//成功
-            {
-                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除成功" + "\r\n";
-                label_Sta_Clear.BackColor = Color.Green;
-                label_Sta_Clear.Text = "OK";
+            if (执行ToolStripMenuItem.Checked == true)
+            {
+                TestStep = TestStep_Enum.Step_SysClear;
+                label_Step.Text = "系统清除,请等待!";
+                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送系统清除指令" + "\r\n";
+                Array.Clear(Code, 0, 32);
+                Code[0] = (byte)'C';
+                Code[1] = (byte)'L';
+                Code[2] = (byte)'E';
+                Code[3] = (byte)'A';
+                Code[4] = (byte)'R';
+                SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2605, Code);
+                Ack_Flag = false;
+                Ack_Cnt = 0;
+                StepTestFlag = StepTestResult_Enum.StepTestResult_Testing;
+                while (StepTestFlag == StepTestResult_Enum.StepTestResult_Testing) ;//等待测试结束
+                if (StepTestFlag == StepTestResult_Enum.StepTestResult_OK)//成功
+                {
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除成功" + "\r\n";
+                    label_Sta_Clear.BackColor = Color.Green;
+                    label_Sta_Clear.Text = "OK";
+                }
+                else//失败
+                {
+                    label_Step.Text = "系统清除失败,测试结束!";
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除失败,测试结束" + "\r\n";
+                    button_Start.Enabled = true;
+                    //关机
+                    Code[0] = 0xF0;
+                    SendCmd(0x7FF, 0x16, 0x2201, Code);
+                    开ToolStripMenuItem.Checked = false;
+                    关ToolStripMenuItem.Checked = true;
+                    //关闭串口
+                    portsettings_form.closePort();
+                    //存储测试数据
+                    ErrorSaveLog();
+                    return;
+                }
+                #endregion
+
+                //系统清除完成后会重启,等待3s
+                Delay_ms(2000);
             }
-            else//失败
+            else if (不执行ToolStripMenuItem.Checked == true)
             {
-                label_Step.Text = "系统清除失败,测试结束!";
-                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除失败,测试结束" + "\r\n";
-                button_Start.Enabled = true;
-                //关机
-                Code[0] = 0xF0;
-                SendCmd(0x7FF, 0x16, 0x2201, Code);
-                开ToolStripMenuItem.Checked = false;
-                关ToolStripMenuItem.Checked = true;
-                //关闭串口
-                portsettings_form.closePort();
-                //存储测试数据
-                ErrorSaveLog();
-                return;
+                label_Sta_Clear.BackColor = Color.Yellow;
+                label_Sta_Clear.Text = "N/A";
             }
-            #endregion
-
-            //系统清除完成后会重启,等待3s
-            Delay_ms(2000);
 
             #region Step2:发送指令,依次写入参数
             TestStep = TestStep_Enum.Step_Write;
@@ -2392,10 +2425,19 @@ namespace MOTINOVA_Motor_Factory_Set
             //标签初始化
             label_Init();
 
+            //检查生产地设置
+            if ((执行ToolStripMenuItem.Checked == false) && (不执行ToolStripMenuItem.Checked == false))
+            {
+                label_Step.Text = "请先选择是否执行\"系统清除\"!";
+                label_Step.ForeColor = Color.Red;
+                return;
+            }
+
             #region 检查配置文件
             if (comboBox_File.Items.Count == 0) //配置文件目录为空
             {
                 label_Step.Text = "无可用配置文件!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
             if (comboBox_File.Text.Trim().Length == 0)//未选择配置文件
@@ -2430,6 +2472,7 @@ namespace MOTINOVA_Motor_Factory_Set
             if (portsettings_form.openPort() == false)
             {
                 label_Step.Text = "串口连接失败!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
 
@@ -2622,5 +2665,22 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             System.Diagnostics.Process.Start("osk.exe");
         }
+
+        private void 执行ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            执行ToolStripMenuItem.Checked = true;
+            不执行ToolStripMenuItem.Checked = false;
+        }
+
+        private void 不执行ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            执行ToolStripMenuItem.Checked = false;
+            不执行ToolStripMenuItem.Checked = true;
+        }
+
+        private void 端口选择ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            portsettings_form.Show();
+        }
     }
 }

+ 3 - 2
MOTINOVA_Motor_Factory_Set.csproj

@@ -13,7 +13,7 @@
     <Deterministic>true</Deterministic>
     <IsWebBootstrapper>false</IsWebBootstrapper>
     <TargetFrameworkProfile />
-    <PublishUrl>D:\SoftDesign\MOTINOVA_Motor_Factory_Set\</PublishUrl>
+    <PublishUrl>D:\SoftDesign\MOTINOVA_Motor_Factory_Set\Publish\</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Disk</InstallFrom>
     <UpdateEnabled>false</UpdateEnabled>
@@ -23,7 +23,8 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>false</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>1</ApplicationRevision>
+    <AutorunEnabled>true</AutorunEnabled>
+    <ApplicationRevision>3</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
     <PublishWizardCompleted>true</PublishWizardCompleted>

+ 1 - 1
MOTINOVA_Motor_Factory_Set.csproj.user

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <PublishUrlHistory>D:\SoftDesign\MOTINOVA_Motor_Factory_Set\|publish\</PublishUrlHistory>
+    <PublishUrlHistory>D:\SoftDesign\MOTINOVA_Motor_Factory_Set\Publish\|D:\SoftDesign\MOTINOVA_Motor_Factory_Set\|publish\</PublishUrlHistory>
     <InstallUrlHistory />
     <SupportUrlHistory />
     <UpdateUrlHistory />

+ 1 - 1
ManageForm.Designer.cs

@@ -94,7 +94,7 @@
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(423, 21);
             this.label2.TabIndex = 14;
-            this.label2.Text = "Copyright © 2021 MOTINOVA Inc. All Rights Reserved";
+            this.label2.Text = "Copyright © 2022 MOTINOVA Inc. All Rights Reserved";
             // 
             // button_Delete
             // 

+ 1 - 1
StartForm.Designer.cs

@@ -81,7 +81,7 @@
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(423, 21);
             this.label1.TabIndex = 2;
-            this.label1.Text = "Copyright © 2021 MOTINOVA Inc. All Rights Reserved";
+            this.label1.Text = "Copyright © 2022 MOTINOVA Inc. All Rights Reserved";
             // 
             // button_Mang
             // 

+ 13 - 1
StartForm.cs

@@ -34,6 +34,19 @@ namespace MOTINOVA_Motor_Factory_Set
             CheckForm1.LogSavePath = UserPath + "\\qcTest\\";
             ManageForm1.FilePath = UserPath + "\\cfg\\";
             ExportForm1.FilePath = UserPath + "\\cfg\\";
+            //检查本地文件夹
+            if (!Directory.Exists(ImportForm1.LocalCfgFilePath))
+                Directory.CreateDirectory(ImportForm1.LocalCfgFilePath);
+            if (!Directory.Exists(ImportForm1.LogSavePath))
+                Directory.CreateDirectory(ImportForm1.LogSavePath);
+            if (!Directory.Exists(CheckForm1.LocalCfgFilePath))
+                Directory.CreateDirectory(CheckForm1.LocalCfgFilePath);
+            if (!Directory.Exists(CheckForm1.LogSavePath))
+                Directory.CreateDirectory(CheckForm1.LogSavePath);
+            if (!Directory.Exists(ManageForm1.FilePath))
+                Directory.CreateDirectory(ManageForm1.FilePath);
+            if (!Directory.Exists(ExportForm1.FilePath))
+                Directory.CreateDirectory(ExportForm1.FilePath);
             //创建线程,定时检测网络连接状态
             Thread th = new Thread(NetworkCheck);
             th.IsBackground = true;
@@ -410,7 +423,6 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             //显示编译时间
             label_Ver.Text += System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString();
-            
         }
 
         private void StartForm_FormClosing(object sender, FormClosingEventArgs e)

+ 3 - 3
bin/Debug/MOTINOVA_Motor_Factory_Set.application

@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
-  <assemblyIdentity name="MOTINOVA_Motor_Factory_Set.application" version="1.0.0.1" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
+  <assemblyIdentity name="MOTINOVA_Motor_Factory_Set.application" version="1.0.0.3" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
   <description asmv2:publisher="MOTINOVA_Motor_Factory_Set" asmv2:product="MOTINOVA_Motor_Factory_Set" xmlns="urn:schemas-microsoft-com:asm.v1" />
   <deployment install="true" mapFileExtensions="true" />
   <dependency>
     <dependentAssembly dependencyType="install" codebase="MOTINOVA_Motor_Factory_Set.exe.manifest" size="5061">
-      <assemblyIdentity name="MOTINOVA_Motor_Factory_Set.exe" version="1.0.0.1" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
+      <assemblyIdentity name="MOTINOVA_Motor_Factory_Set.exe" version="1.0.0.3" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>B20nVb/V1KYMymWiLQZq9bIG24Y=</dsig:DigestValue>
+        <dsig:DigestValue>3rLDV7AK0p2wd2D4+O4tOlYqZwg=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
bin/Debug/MOTINOVA_Motor_Factory_Set.exe


+ 3 - 3
bin/Debug/MOTINOVA_Motor_Factory_Set.exe.manifest

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
-  <asmv1:assemblyIdentity name="MOTINOVA_Motor_Factory_Set.exe" version="1.0.0.1" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
+  <asmv1:assemblyIdentity name="MOTINOVA_Motor_Factory_Set.exe" version="1.0.0.3" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
   <application />
   <entryPoint>
     <assemblyIdentity name="MOTINOVA_Motor_Factory_Set" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
@@ -51,14 +51,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="633224">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="634248">
       <assemblyIdentity name="MOTINOVA_Motor_Factory_Set" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
       <hash>
         <dsig:Transforms>
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
-        <dsig:DigestValue>PAP1B2XY0KBvchNeSyBRfX7srEY=</dsig:DigestValue>
+        <dsig:DigestValue>YiMxZe5GtqJlqf9Y7lZh+5dsyBk=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

binární
bin/Debug/MOTINOVA_Motor_Factory_Set.pdb


+ 1 - 1
bin/Debug/SerialNum

@@ -1,2 +1,2 @@
 流水号:
-313
+1

+ 8 - 0
bin/Debug/Server

@@ -6,6 +6,14 @@ PASSWD=ttium
 ROOT=MOTINOVA_MC_Factory_Set
 LOCAL=ENABLE
 
+#阿里云
+IP=47.105.122.91
+PORT=21
+USER=dail
+PASSWD=123456
+ROOT=/home/dail
+LOCAL=ENABLE
+
 #阿里云
 IP=47.105.122.91
 PORT=21

binární
bin/Debug/app.publish/MOTINOVA_Motor_Factory_Set.exe


binární
obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


binární
obj/Debug/MOTINOVA_Motor_Factory_Set.Properties.Resources.resources


binární
obj/Debug/MOTINOVA_Motor_Factory_Set.csproj.GenerateResource.cache


binární
obj/Debug/MOTINOVA_Motor_Factory_Set.exe


binární
obj/Debug/MOTINOVA_Motor_Factory_Set.pdb