Browse Source

1、优化参数写入步骤,解决部分电机生产日期写入未保存的问题;
2、识别到力矩传感器标定系数为1.00时,提示“力矩传感器未标定”,结束测试;
3、生成参数时,TE软件版本可填写"N_A",用于对单MCU主控板的兼容;
4、修改登陆账户的设置,如下图所示:其中账户权限如下:
“工程”:密码123456,可用于生产模式、检验模式、参数生成、本地管理,及生产模式下测试功能的设置
“操作员1”:密码1,“操作员2”:密码22,“操作员3”:密码333,“操作员4”:密码4444,分别仅限于生产模式和检验模式。

dail 3 năm trước cách đây
mục cha
commit
36fb796526

BIN
.vs/MOTINOVA_Motor_Factory_Set/v17/.suo


+ 52 - 27
CheckForm.Designer.cs

@@ -38,6 +38,9 @@
             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.comboBox_cfgFileDate = new System.Windows.Forms.ComboBox();
             this.checkBox_LocalFile = new System.Windows.Forms.CheckBox();
@@ -76,9 +79,8 @@
             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.label_TestUser = new System.Windows.Forms.Label();
+            this.label31 = new System.Windows.Forms.Label();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -139,7 +141,7 @@
             // 
             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.Size = new System.Drawing.Size(96, 26);
             this.开ToolStripMenuItem.Text = "开";
             this.开ToolStripMenuItem.Click += new System.EventHandler(this.开ToolStripMenuItem_Click);
             // 
@@ -149,7 +151,7 @@
             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.Size = new System.Drawing.Size(96, 26);
             this.关ToolStripMenuItem.Text = "关";
             this.关ToolStripMenuItem.Click += new System.EventHandler(this.关ToolStripMenuItem_Click);
             // 
@@ -170,6 +172,32 @@
             this.屏幕键盘ToolStripMenuItem.Text = "屏幕键盘";
             this.屏幕键盘ToolStripMenuItem.Click += new System.EventHandler(this.屏幕键盘ToolStripMenuItem_Click_1);
             // 
+            // 查看文件ToolStripMenuItem
+            // 
+            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(86, 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);
+            // 
+            // 不合格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
             // 
             this.groupBox4.Controls.Add(this.comboBox_cfgFileDate);
@@ -605,31 +633,24 @@
             this.pictureBox1.TabIndex = 30;
             this.pictureBox1.TabStop = false;
             // 
-            // 查看文件ToolStripMenuItem
+            // label_TestUser
             // 
-            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(86, 25);
-            this.查看文件ToolStripMenuItem.Text = "查看记录";
+            this.label_TestUser.AutoSize = true;
+            this.label_TestUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label_TestUser.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.label_TestUser.Location = new System.Drawing.Point(869, 6);
+            this.label_TestUser.Name = "label_TestUser";
+            this.label_TestUser.Size = new System.Drawing.Size(114, 21);
+            this.label_TestUser.TabIndex = 36;
+            this.label_TestUser.Text = "测试员:XXXX";
             // 
-            // 合格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);
+            // label31
             // 
-            // 不合格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.label31.BackColor = System.Drawing.Color.Silver;
+            this.label31.Location = new System.Drawing.Point(861, 6);
+            this.label31.Name = "label31";
+            this.label31.Size = new System.Drawing.Size(1, 20);
+            this.label31.TabIndex = 37;
             // 
             // CheckForm
             // 
@@ -637,6 +658,8 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(1234, 817);
+            this.Controls.Add(this.label31);
+            this.Controls.Add(this.label_TestUser);
             this.Controls.Add(this.pictureBox2);
             this.Controls.Add(this.pictureBox1);
             this.Controls.Add(this.label_error_code);
@@ -737,5 +760,7 @@
         private System.Windows.Forms.ToolStripMenuItem 查看文件ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 合格ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 不合格ToolStripMenuItem;
+        private System.Windows.Forms.Label label_TestUser;
+        private System.Windows.Forms.Label label31;
     }
 }

+ 40 - 17
CheckForm.cs

@@ -1005,26 +1005,29 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             else
             {
-                if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
+                if (TE_FW_Ver_Check != "N_A")//单MCU主控板不检测TE版本
                 {
-                    if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
+                    if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
                     {
-                        richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE版本错误" + "\r\n";
-                        label_Step.Text = "TE软件版本错误,测试结束!";
-                        label_Step.ForeColor = Color.Red;
-                        button_Start.Enabled = true;
-                        ErrorSaveLog();
-                        //关机
-                        Code[0] = 0xF0;
-                        SendCmd(0x7FF, 0x16, 0x2201, Code);
-                        开ToolStripMenuItem.Checked = false;
-                        关ToolStripMenuItem.Checked = true;
-                        Delay_ms(500);
-                        //关闭串口
-                        portsettings_form.closePort();
-                        return;
+                        if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
+                        {
+                            richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE版本错误" + "\r\n";
+                            label_Step.Text = "TE软件版本错误,测试结束!";
+                            label_Step.ForeColor = Color.Red;
+                            button_Start.Enabled = true;
+                            ErrorSaveLog();
+                            //关机
+                            Code[0] = 0xF0;
+                            SendCmd(0x7FF, 0x16, 0x2201, Code);
+                            开ToolStripMenuItem.Checked = false;
+                            关ToolStripMenuItem.Checked = true;
+                            Delay_ms(500);
+                            //关闭串口
+                            portsettings_form.closePort();
+                            return;
+                        }
                     }
-                }
+                }                
                 try
                 {
                     string mode1 = "", mode2 = ""; 
@@ -1168,6 +1171,23 @@ namespace MOTINOVA_Motor_Factory_Set
                                 portsettings_form.closePort();
                                 return;
                             }
+                            if (k == 100)
+                            {
+                                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "传感器未标定" + "\r\n";
+                                label_Step.Text = "传感器未标定,测试结束!";
+                                label_Step.ForeColor = Color.Red;
+                                button_Start.Enabled = true;
+                                ErrorSaveLog();
+                                //关机
+                                Code[0] = 0xF0;
+                                SendCmd(0x7FF, 0x16, 0x2201, Code);
+                                开ToolStripMenuItem.Checked = false;
+                                关ToolStripMenuItem.Checked = true;
+                                Delay_ms(500);
+                                //关闭串口
+                                portsettings_form.closePort();
+                                return;
+                            }
                             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + richTextBox_TQ.Lines[i].Split(':')[0] + "正常" + "\r\n";
                             break;
                         }
@@ -1370,6 +1390,9 @@ namespace MOTINOVA_Motor_Factory_Set
             timer1.Enabled = true;
             timer2.Enabled = true;
 
+            //显示测试员信息
+            label_TestUser.Text = "测试员:" + StartForm.EnterForm1.comboBox_User.Text;
+
             //窗口加载时,从FTP服务器或本地获取文件日期列表
             GetDateList(false);
             //装载序列号文件

+ 14 - 12
Enter.Designer.cs

@@ -31,12 +31,12 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Enter));
             this.button1 = new System.Windows.Forms.Button();
             this.textBox_Passwd = new System.Windows.Forms.TextBox();
-            this.textBox_User = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.button_keyboard = new System.Windows.Forms.Button();
+            this.comboBox_User = new System.Windows.Forms.ComboBox();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
@@ -55,6 +55,7 @@
             // textBox_Passwd
             // 
             this.textBox_Passwd.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.textBox_Passwd.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.textBox_Passwd.ImeMode = System.Windows.Forms.ImeMode.Disable;
             this.textBox_Passwd.Location = new System.Drawing.Point(104, 118);
             this.textBox_Passwd.Name = "textBox_Passwd";
@@ -63,15 +64,6 @@
             this.textBox_Passwd.UseSystemPasswordChar = true;
             this.textBox_Passwd.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox_Passwd_KeyUp);
             // 
-            // textBox_User
-            // 
-            this.textBox_User.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.textBox_User.ImeMode = System.Windows.Forms.ImeMode.Disable;
-            this.textBox_User.Location = new System.Drawing.Point(104, 83);
-            this.textBox_User.Name = "textBox_User";
-            this.textBox_User.Size = new System.Drawing.Size(171, 29);
-            this.textBox_User.TabIndex = 2;
-            // 
             // label1
             // 
             this.label1.AutoSize = true;
@@ -123,18 +115,28 @@
             this.button_keyboard.UseVisualStyleBackColor = false;
             this.button_keyboard.Click += new System.EventHandler(this.button_keyboard_Click);
             // 
+            // comboBox_User
+            // 
+            this.comboBox_User.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.comboBox_User.FormattingEnabled = true;
+            this.comboBox_User.Location = new System.Drawing.Point(104, 86);
+            this.comboBox_User.Name = "comboBox_User";
+            this.comboBox_User.Size = new System.Drawing.Size(171, 28);
+            this.comboBox_User.TabIndex = 35;
+            this.comboBox_User.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            // 
             // Enter
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(384, 262);
+            this.Controls.Add(this.comboBox_User);
             this.Controls.Add(this.button_keyboard);
             this.Controls.Add(this.pictureBox2);
             this.Controls.Add(this.pictureBox1);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
-            this.Controls.Add(this.textBox_User);
             this.Controls.Add(this.textBox_Passwd);
             this.Controls.Add(this.button1);
             this.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -159,11 +161,11 @@
 
         private System.Windows.Forms.Button button1;
         public System.Windows.Forms.TextBox textBox_Passwd;
-        public System.Windows.Forms.TextBox textBox_User;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.PictureBox pictureBox2;
         private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.Button button_keyboard;
+        public System.Windows.Forms.ComboBox comboBox_User;
     }
 }

+ 38 - 1
Enter.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Text;
 using System.Windows.Forms;
 
@@ -20,9 +21,45 @@ namespace MOTINOVA_Motor_Factory_Set
             this.Close();
         }
 
+        public Dictionary<string, string> UserAccount = new Dictionary<string, string>();
         private void Enter_Load(object sender, EventArgs e)
         {
-            textBox_User.Text = "";
+            UserAccount.Clear();
+            //读取账户信息
+            try
+            {
+                //加载配置文件
+                StreamReader objReader = new StreamReader("UserAccount");
+                string sLine = "";
+                List<string> userInfo = new List<string>();
+                while (sLine != null)
+                {
+                    sLine = objReader.ReadLine();
+                    userInfo.Add(sLine);
+                }
+                objReader.Close();
+                foreach(string info in userInfo)
+                {
+                    if (info != null)
+                    {
+                        UserAccount.Add(info.Split(',')[0].Split('=')[1], info.Split(',')[1].Split('=')[1]);
+                    }                    
+                }
+            }
+            catch (System.Exception)
+            {
+                MessageBox.Show("无账户信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                UserAccount.Add("未知用户", "");
+            }
+
+            //账户名下拉列表更新
+            comboBox_User.Items.Clear();
+            foreach (string key in UserAccount.Keys)
+            {
+                comboBox_User.Items.Add(key);
+            }
+
+            //密码框清空
             textBox_Passwd.Text = "";
         }
 

+ 3 - 3
Enter.resx

@@ -112,12 +112,12 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAB

+ 7 - 4
ExportForm.cs

@@ -549,11 +549,14 @@ namespace MOTINOVA_Motor_Factory_Set
                 MessageBox.Show("主控软件版本格式不正确,例如V1.0.0.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
-            Reg = new Regex(@"[V][0-9].[0-9].[0-9]_20\d{6}"); //判断TE软件版本是否填写
-            if (Reg.IsMatch(textBox_TE_FW_Version.Text) == false) //判断TE软件版本是否填写
+            if (textBox_TE_FW_Version.Text != "N_A")//兼容单MCU主控板,无TE时填写N_A
             {
-                MessageBox.Show("TE软件版本格式不正确,例如V1.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                return;
+                Reg = new Regex(@"[V][0-9].[0-9].[0-9]_20\d{6}"); //判断TE软件版本是否填写
+                if (Reg.IsMatch(textBox_TE_FW_Version.Text) == false) //判断TE软件版本是否填写
+                {
+                    MessageBox.Show("TE软件版本格式不正确,例如N_A或V1.0.0_20210101 !", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                    return;
+                }
             }
             if (System.IO.Directory.Exists(FilePath) == false)
                 System.IO.Directory.CreateDirectory(FilePath);

+ 53 - 39
ImportForm.Designer.cs

@@ -52,6 +52,9 @@
             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();
@@ -153,10 +156,8 @@
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label_TestFun = new System.Windows.Forms.Label();
-            this.label30 = new System.Windows.Forms.Label();
-            this.查看文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.合格ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.不合格ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.label_TestUser = new System.Windows.Forms.Label();
+            this.label31 = new System.Windows.Forms.Label();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -239,7 +240,7 @@
             // 
             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.Size = new System.Drawing.Size(96, 26);
             this.开ToolStripMenuItem.Text = "开";
             this.开ToolStripMenuItem.Click += new System.EventHandler(this.开ToolStripMenuItem_Click);
             // 
@@ -249,7 +250,7 @@
             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.Size = new System.Drawing.Size(96, 26);
             this.关ToolStripMenuItem.Text = "关";
             this.关ToolStripMenuItem.Click += new System.EventHandler(this.关ToolStripMenuItem_Click);
             // 
@@ -380,6 +381,32 @@
             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)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.查看文件ToolStripMenuItem.Name = "查看文件ToolStripMenuItem";
+            this.查看文件ToolStripMenuItem.Size = new System.Drawing.Size(86, 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);
+            // 
+            // 不合格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
             // 
             this.groupBox4.Controls.Add(this.checkBox_LocalFile);
@@ -1477,45 +1504,30 @@
             this.label_TestFun.AutoSize = true;
             this.label_TestFun.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.label_TestFun.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_TestFun.Location = new System.Drawing.Point(741, 4);
+            this.label_TestFun.Location = new System.Drawing.Point(775, 4);
             this.label_TestFun.Name = "label_TestFun";
             this.label_TestFun.Size = new System.Drawing.Size(429, 21);
             this.label_TestFun.TabIndex = 34;
             this.label_TestFun.Text = "测试项目:系统清除、参数写入、推行测试,BMS通信检测";
             // 
-            // label30
-            // 
-            this.label30.BackColor = System.Drawing.Color.Silver;
-            this.label30.Location = new System.Drawing.Point(734, 4);
-            this.label30.Name = "label30";
-            this.label30.Size = new System.Drawing.Size(1, 20);
-            this.label30.TabIndex = 11;
-            // 
-            // 查看文件ToolStripMenuItem
-            // 
-            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(86, 25);
-            this.查看文件ToolStripMenuItem.Text = "查看记录";
-            // 
-            // 合格ToolStripMenuItem
+            // label_TestUser
             // 
-            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.label_TestUser.AutoSize = true;
+            this.label_TestUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.label_TestUser.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.label_TestUser.Location = new System.Drawing.Point(620, 4);
+            this.label_TestUser.Name = "label_TestUser";
+            this.label_TestUser.Size = new System.Drawing.Size(114, 21);
+            this.label_TestUser.TabIndex = 35;
+            this.label_TestUser.Text = "测试员:XXXX";
             // 
-            // 不合格ToolStripMenuItem
+            // label31
             // 
-            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.label31.BackColor = System.Drawing.Color.Silver;
+            this.label31.Location = new System.Drawing.Point(612, 4);
+            this.label31.Name = "label31";
+            this.label31.Size = new System.Drawing.Size(1, 20);
+            this.label31.TabIndex = 36;
             // 
             // ImportForm
             // 
@@ -1523,7 +1535,8 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(1230, 813);
-            this.Controls.Add(this.label30);
+            this.Controls.Add(this.label31);
+            this.Controls.Add(this.label_TestUser);
             this.Controls.Add(this.label_TestFun);
             this.Controls.Add(this.pictureBox2);
             this.Controls.Add(this.pictureBox1);
@@ -1682,7 +1695,6 @@
         private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
         private System.Windows.Forms.Label label_TestFun;
-        private System.Windows.Forms.Label label30;
         private System.Windows.Forms.ToolStripMenuItem 功能设置ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 推行测试ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 推行测试执行ToolStripMenuItem;
@@ -1698,5 +1710,7 @@
         private System.Windows.Forms.ToolStripMenuItem 查看文件ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 合格ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 不合格ToolStripMenuItem;
+        private System.Windows.Forms.Label label_TestUser;
+        private System.Windows.Forms.Label label31;
     }
 }

+ 116 - 44
ImportForm.cs

@@ -251,6 +251,9 @@ namespace MOTINOVA_Motor_Factory_Set
             timer1.Enabled = true;
             timer2.Enabled = true;
 
+            //显示测试员信息
+            label_TestUser.Text = "测试员:" + StartForm.EnterForm1.comboBox_User.Text;
+
             //装载配置文件
             GetDateList(false);
 
@@ -552,6 +555,9 @@ namespace MOTINOVA_Motor_Factory_Set
                                     //MCU温度
                                     DataTemp = (ushort)(binary_data_1[25]);
                                     textBox_MCU.Text = Convert.ToString((int)(DataTemp - 40));
+
+                                    Ack_Flag = true;
+                                    StepTestFlag = StepTestResult_Enum.StepTestResult_OK;
                                 }));
                             }
                             break;
@@ -1038,6 +1044,41 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             #endregion
 
+            //初始化助力档位为OFF,避免配置无仪表时默认为SMART,导致参数不保存
+            do
+            {
+                Code[0] = 0x00;
+                Code[1] = 0xF0;
+                SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2802, 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") + "->" + "助力档位设置为OFF成功" + "\r\n";
+                }
+                else//失败
+                {
+                    label_Step.Text = "通信失败!";
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "助力档位设置OFF失败,测试结束" + "\r\n";
+                    //关机
+                    Code[0] = 0xF0;
+                    SendCmd(0x7FF, 0x16, 0x2201, Code);
+                    开ToolStripMenuItem.Checked = false;
+                    关ToolStripMenuItem.Checked = true;
+                    button_Start.Enabled = true;
+                    Delay_ms(500);
+                    //关闭串口
+                    portsettings_form.closePort();
+                    //存储测试数据
+                    ErrorSaveLog();
+                    return;
+                }
+
+
+            } while (false);            
+
             #region Step2:发送指令,依次写入参数
             TestStep = TestStep_Enum.Step_Write;
             label_Step.Text = "参数写入中,请等待!";
@@ -1754,7 +1795,7 @@ namespace MOTINOVA_Motor_Factory_Set
                             OK_cnt++;
                         }
                     }
-                    ////母线电压
+                    ////母线电压,推行时母线电压会被抬高,放到静止是检测
                     //try
                     //{
                     //    DataTemp = Convert.ToUInt16(textBox_Vol.Text);
@@ -2228,9 +2269,9 @@ namespace MOTINOVA_Motor_Factory_Set
             label_Step.Text = "版本查询和确认";
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令查询版本信息" + "\r\n";
             richTextBox_Ver.Text = "";
-            SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1200, null);
+            SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1200, null);//查询主控版本
             Delay_ms(200);
-            SendCmd((ushort)0x651, (byte)0x11, (ushort)0x1200, null);
+            SendCmd((ushort)0x651, (byte)0x11, (ushort)0x1200, null);//查询TE版本
             Delay_ms(200);
             string FW_Version_Check = comboBox_File.Text.Split('_')[2] + "_" + comboBox_File.Text.Split('_')[3];
             string FW_Version_Result = "";
@@ -2265,24 +2306,27 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             else
             {
-                if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
+                if (TE_FW_Ver_Check != "N_A") //单MCU主控板不检测TE版本
                 {
-                    if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
+                    if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
                     {
-                        richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE软件版本错误" + "\r\n";
-                        label_Step.Text = "TE软件版本错误,测试结束!";
-                        //关机
-                        Code[0] = 0xF0;
-                        SendCmd(0x7FF, 0x16, 0x2201, Code);
-                        开ToolStripMenuItem.Checked = false;
-                        关ToolStripMenuItem.Checked = true;
-                        button_Start.Enabled = true;
-                        Delay_ms(500);
-                        //关闭串口
-                        portsettings_form.closePort();
-                        //存储测试数据
-                        ErrorSaveLog();
-                        return;
+                        if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
+                        {
+                            richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE软件版本错误" + "\r\n";
+                            label_Step.Text = "TE软件版本错误,测试结束!";
+                            //关机
+                            Code[0] = 0xF0;
+                            SendCmd(0x7FF, 0x16, 0x2201, Code);
+                            开ToolStripMenuItem.Checked = false;
+                            关ToolStripMenuItem.Checked = true;
+                            button_Start.Enabled = true;
+                            Delay_ms(500);
+                            //关闭串口
+                            portsettings_form.closePort();
+                            //存储测试数据
+                            ErrorSaveLog();
+                            return;
+                        }
                     }
                 }
                 label_FW_Version.BackColor = Color.Green;
@@ -2851,11 +2895,18 @@ namespace MOTINOVA_Motor_Factory_Set
         private void BMS检测不执行ToolStripMenuItem1_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
+            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
             {
-                BMS检测不执行ToolStripMenuItem1.Checked = true;
-                BMS检测执行ToolStripMenuItem1.Checked = false;
-                label_TestFunsUpdate();
+                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                {
+                    BMS检测不执行ToolStripMenuItem1.Checked = true;
+                    BMS检测执行ToolStripMenuItem1.Checked = false;
+                    label_TestFunsUpdate();
+                }
+                else
+                {
+                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
             else
             {
@@ -2873,11 +2924,18 @@ namespace MOTINOVA_Motor_Factory_Set
         private void 推行测试不执行ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
+            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
             {
-                推行测试不执行ToolStripMenuItem.Checked = true;
-                推行测试执行ToolStripMenuItem.Checked = false;
-                label_TestFunsUpdate();
+                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                {
+                    推行测试不执行ToolStripMenuItem.Checked = true;
+                    推行测试执行ToolStripMenuItem.Checked = false;
+                    label_TestFunsUpdate();
+                }
+                else
+                {
+                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }                
             }
             else
             {
@@ -2895,11 +2953,18 @@ namespace MOTINOVA_Motor_Factory_Set
         private void 系统清除不执行ToolStripMenuItem_Click(object sender, EventArgs e)
         {
             StartForm.EnterForm1.ShowDialog();
-            if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
+            if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
             {
-                系统清除执行ToolStripMenuItem.Checked = false;
-                系统清除不执行ToolStripMenuItem.Checked = true;
-                label_TestFunsUpdate();
+                if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                {
+                    系统清除执行ToolStripMenuItem.Checked = false;
+                    系统清除不执行ToolStripMenuItem.Checked = true;
+                    label_TestFunsUpdate();
+                }
+                else
+                {
+                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
             else
             {
@@ -2939,20 +3004,27 @@ namespace MOTINOVA_Motor_Factory_Set
             else
             {
                 StartForm.EnterForm1.ShowDialog();
-                if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
+                if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
                 {
-                    系统清除执行ToolStripMenuItem.Checked = false;
-                    系统清除不执行ToolStripMenuItem.Checked = true;
-                    推行测试执行ToolStripMenuItem.Checked = false;
-                    推行测试不执行ToolStripMenuItem.Checked = true;
-                    BMS检测执行ToolStripMenuItem1.Checked = false;
-                    BMS检测不执行ToolStripMenuItem1.Checked = true;
-
-                    只写入参数ToolStripMenuItem.Checked = true;
-                    推行测试ToolStripMenuItem.Enabled = false;
-                    bMS通信检测ToolStripMenuItem.Enabled = false;
-                    系统清除ToolStripMenuItem.Enabled = false;
-                    label_TestFunsUpdate();
+                    if (StartForm.EnterForm1.comboBox_User.Text == "工程")
+                    {
+                        系统清除执行ToolStripMenuItem.Checked = false;
+                        系统清除不执行ToolStripMenuItem.Checked = true;
+                        推行测试执行ToolStripMenuItem.Checked = false;
+                        推行测试不执行ToolStripMenuItem.Checked = true;
+                        BMS检测执行ToolStripMenuItem1.Checked = false;
+                        BMS检测不执行ToolStripMenuItem1.Checked = true;
+
+                        只写入参数ToolStripMenuItem.Checked = true;
+                        推行测试ToolStripMenuItem.Enabled = false;
+                        bMS通信检测ToolStripMenuItem.Enabled = false;
+                        系统清除ToolStripMenuItem.Enabled = false;
+                        label_TestFunsUpdate();
+                    }
+                    else
+                    {
+                        MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
                 }
                 else
                 {

+ 1 - 1
MOTINOVA_Motor_Factory_Set.csproj

@@ -67,7 +67,7 @@
     <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
   </PropertyGroup>
   <PropertyGroup>
-    <SignManifests>true</SignManifests>
+    <SignManifests>false</SignManifests>
   </PropertyGroup>
   <PropertyGroup>
     <ApplicationIcon>import.ico</ApplicationIcon>

+ 1 - 1
StartForm.Designer.cs

@@ -118,7 +118,7 @@
             this.label_Ver.Name = "label_Ver";
             this.label_Ver.Size = new System.Drawing.Size(316, 21);
             this.label_Ver.TabIndex = 2;
-            this.label_Ver.Text = "Ver: V1.3.8 Build Time: 2022-04-24 21:26";
+            this.label_Ver.Text = "Ver: V1.3.9 Build Time: 2022-05-12 21:04";
             // 
             // label_NetStatus
             // 

+ 43 - 8
StartForm.cs

@@ -373,6 +373,7 @@ namespace MOTINOVA_Motor_Factory_Set
         
         private void button_Import_Click(object sender, EventArgs e)
         {
+            //不允许离线使用时检查网络
             if (myServerCfg.Local == "DISABLE")//不允许本地文件
             {
                 if (myFtp.IsNetConnected == false)
@@ -381,16 +382,33 @@ namespace MOTINOVA_Motor_Factory_Set
                     return;
                 }
             }
-            CheckForm1.timer1.Enabled = false;
-            ImportForm1.ShowDialog();
+            //输入用户名
+            EnterForm1.ShowDialog();
+            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+            {
+                CheckForm1.timer1.Enabled = false;
+                ImportForm1.ShowDialog();
+            }
+            else
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+            
         }
 
         private void button_Export_Click(object sender, EventArgs e)
         {
             EnterForm1.ShowDialog();
-            if ((EnterForm1.textBox_User.Text == "PT") && (EnterForm1.textBox_Passwd.Text == "123456"))
+            if(EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//生成参数模式仅用户PT
             {
-                ExportForm1.ShowDialog();
+                if (EnterForm1.comboBox_User.Text == "工程")
+                {
+                    ExportForm1.ShowDialog();
+                }
+                else
+                {
+                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
             else
             {
@@ -401,9 +419,16 @@ namespace MOTINOVA_Motor_Factory_Set
         private void button_Mang_Click(object sender, EventArgs e)
         {
             EnterForm1.ShowDialog();
-            if ((EnterForm1.textBox_User.Text == "PT") && (EnterForm1.textBox_Passwd.Text == "123456"))
+            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//本地文件管理仅支持PT用户
             {
-                ManageForm1.ShowDialog();
+                if (EnterForm1.comboBox_User.Text == "工程")
+                {
+                    ManageForm1.ShowDialog();
+                }
+                else
+                {
+                    MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                }
             }
             else
             {
@@ -413,6 +438,7 @@ namespace MOTINOVA_Motor_Factory_Set
 
         private void button_Check_Click(object sender, EventArgs e)
         {
+            //不允许离线使用时,检查网络
             if (myServerCfg.Local == "DISABLE")//不允许本地文件
             {
                 if (myFtp.IsNetConnected == false)
@@ -421,8 +447,17 @@ namespace MOTINOVA_Motor_Factory_Set
                     return;
                 }
             }
-            ImportForm1.timer1.Enabled = false;
-            CheckForm1.ShowDialog();
+            //输入用户名
+            EnterForm1.ShowDialog();
+            if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//所有用户支持
+            {
+                ImportForm1.timer1.Enabled = false;
+                CheckForm1.ShowDialog();
+            }
+            else
+            {
+                MessageBox.Show("用户不存在或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
         }
 
         private void StartForm_Load(object sender, EventArgs e)

+ 1 - 1
bin/Debug/MOTINOVA_Motor_Factory_Set.application

@@ -14,7 +14,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>K1wo/GNH01a7eZjxkcL3kaDEKcQww0oLbo7T8N8eicY=</dsig:DigestValue>
+        <dsig:DigestValue>G3BFDgBzhaG6P1LJKDBcRTFjqriDoPeInbyixE8sVyA=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.exe


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

@@ -42,14 +42,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="677768">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="679936">
       <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#sha256" />
-        <dsig:DigestValue>8fImoOZe50BaCNrSd7j4FPiOa/6zxktFAEtVnwKfRnc=</dsig:DigestValue>
+        <dsig:DigestValue>3c3NTc65iqgjafBKIGYAuQ4OxlI/gFamJtSKYERP0qY=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.pdb


+ 1 - 1
bin/Debug/SerialNum

@@ -1,2 +1,2 @@
 流水号:
-122
+138

+ 8 - 8
bin/Debug/Server

@@ -1,11 +1,3 @@
-#内部服务器
-IP=192.168.1.74
-PORT=21
-USER=factory_test
-PASSWD=ttium
-ROOT=MOTINOVA_MC_Factory_Set
-LOCAL=ENABLE
-
 #虚拟机
 IP=192.168.1.246
 PORT=21
@@ -14,6 +6,14 @@ PASSWD=1229
 ROOT=/home/hero/MOTINOVA_MC_Factory_Set
 LOCAL=ENABLE
 
+#内部服务器
+IP=192.168.1.74
+PORT=21
+USER=factory_test
+PASSWD=ttium
+ROOT=MOTINOVA_MC_Factory_Set
+LOCAL=ENABLE
+
 #阿里云
 IP=47.105.122.91
 PORT=21

+ 1 - 1
bin/Debug/UserPath

@@ -1 +1 @@
-logPath =D:\SoftDesign\20171216_PC_MortorTest\MOTINOVA_MC_Test\MOTINOVA_MC_Test\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\bin\Debug
+logPath =D:\MOTINOVA_MC_Test

BIN
bin/Debug/app.publish/MOTINOVA_Motor_Factory_Set.exe


+ 1 - 1
obj/Debug/MOTINOVA_Motor_Factory_Set.application

@@ -14,7 +14,7 @@
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
-        <dsig:DigestValue>K1wo/GNH01a7eZjxkcL3kaDEKcQww0oLbo7T8N8eicY=</dsig:DigestValue>
+        <dsig:DigestValue>G3BFDgBzhaG6P1LJKDBcRTFjqriDoPeInbyixE8sVyA=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.csproj.AssemblyReference.cache


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


BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.exe


+ 2 - 2
obj/Debug/MOTINOVA_Motor_Factory_Set.exe.manifest

@@ -42,14 +42,14 @@
     </dependentAssembly>
   </dependency>
   <dependency>
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="677768">
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MOTINOVA_Motor_Factory_Set.exe" size="679936">
       <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#sha256" />
-        <dsig:DigestValue>8fImoOZe50BaCNrSd7j4FPiOa/6zxktFAEtVnwKfRnc=</dsig:DigestValue>
+        <dsig:DigestValue>3c3NTc65iqgjafBKIGYAuQ4OxlI/gFamJtSKYERP0qY=</dsig:DigestValue>
       </hash>
     </dependentAssembly>
   </dependency>

BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.pdb