Browse Source

该版本能实现联网测试,下面几点待更新:
1、打开关闭界面,进入下个界面后,数据重复解析,会导致异常;
2、需增加BMS通信功能检测;
3、需增加另一路断电开关检测。

dail 3 years ago
parent
commit
92303f23b4

BIN
.vs/MOTINOVA_Motor_Factory_Set/v16/.suo


+ 15 - 9
ExportForm.cs

@@ -516,7 +516,10 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             if (System.IO.Directory.Exists(FilePath) == false)
                 System.IO.Directory.CreateDirectory(FilePath);
-            string fileName = FilePath + textBox_Model.Text + "_" + textBox_Client.Text + "_" + textBox_FW_Version.Text + "_" + textBox_TE_FW_Version.Text + "_" + ((textBox_Remark.Text == string.Empty) ? "" : textBox_Remark.Text + "_") + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".ttcfg";
+            string Datenow = DateTime.Now.ToString("yyyy-MM-dd") + "\\";
+            if (System.IO.Directory.Exists(FilePath + Datenow) == false)
+                System.IO.Directory.CreateDirectory(FilePath + Datenow);
+            string fileName = FilePath + Datenow + textBox_Model.Text + "_" + textBox_Client.Text + "_" + textBox_FW_Version.Text + "_" + textBox_TE_FW_Version.Text + "_" + ((textBox_Remark.Text == string.Empty) ? "" : textBox_Remark.Text + "_") + DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".ttcfg";
             using (StreamWriter file = new StreamWriter(fileName))
             {
                 //用户参数1
@@ -562,15 +565,18 @@ namespace MOTINOVA_Motor_Factory_Set
             MessageBox.Show("参数已生成,进入文件管理页面查看!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
             //发送文件到服务器
-            string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
-            if (StartForm.myFtp.DirectoryExist("MOTINOVA_MC_Factory_Set/cfg/", DateNow) == false)
+            if (StartForm.myFtp.IsNetConnected == true)
             {
-                StartForm.myFtp.MakeDir("MOTINOVA_MC_Factory_Set/cfg/" + DateNow);
-            }
-            bool result = StartForm.myFtp.UploadFile(fileName, "MOTINOVA_MC_Factory_Set/cfg/" + DateNow);
-            if (result == true)
-            {
-                MessageBox.Show("文件上传服务器成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
+                if (StartForm.myFtp.DirectoryExist(StartForm.myServerCfg.RootPath + "/cfg/", DateNow) == false)
+                {
+                    StartForm.myFtp.MakeDir(StartForm.myServerCfg.RootPath + "/cfg/" + DateNow);
+                }
+                bool result = StartForm.myFtp.UploadFile(fileName, StartForm.myServerCfg.RootPath + "/cfg/" + DateNow);
+                if (result == true)
+                {
+                    MessageBox.Show("文件上传服务器成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                }
             }
         }
     }

+ 119 - 81
ImportForm.Designer.cs

@@ -38,7 +38,7 @@
             this.开ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.关ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
-            this.button_CheckCfg = new System.Windows.Forms.Button();
+            this.comboBox_cfgFileDate = new System.Windows.Forms.ComboBox();
             this.comboBox_File = new System.Windows.Forms.ComboBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.label_ErrorInfo = new System.Windows.Forms.Label();
@@ -60,6 +60,7 @@
             this.label_sensor_PCB_temp = new System.Windows.Forms.Label();
             this.label_sensor_cur = new System.Windows.Forms.Label();
             this.label_sensor_speed = new System.Windows.Forms.Label();
+            this.label22 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label16 = new System.Windows.Forms.Label();
             this.label_sensor_vol = new System.Windows.Forms.Label();
@@ -67,6 +68,7 @@
             this.label_Sensor_Gas = new System.Windows.Forms.Label();
             this.label_sensor_motor = new System.Windows.Forms.Label();
             this.label_Sensor_Break = new System.Windows.Forms.Label();
+            this.label_BMS_COM = new System.Windows.Forms.Label();
             this.label_FW_Version = new System.Windows.Forms.Label();
             this.label_sta_light = new System.Windows.Forms.Label();
             this.label_Sta_Write = new System.Windows.Forms.Label();
@@ -140,13 +142,14 @@
             this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.timer2 = new System.Windows.Forms.Timer(this.components);
-            this.richTextBox_Cfg = new System.Windows.Forms.RichTextBox();
+            this.richTextBox_CfgFile = new System.Windows.Forms.RichTextBox();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
             this.richTextBox_TestRecord = new System.Windows.Forms.RichTextBox();
             this.label_Step = new System.Windows.Forms.Label();
             this.label_Result = new System.Windows.Forms.Label();
             this.label_NetStatus = new System.Windows.Forms.Label();
             this.label34 = new System.Windows.Forms.Label();
+            this.checkBox_LocalFile = new System.Windows.Forms.CheckBox();
             this.menuStrip1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -190,7 +193,7 @@
             this.ToolStripMenuItem_PowerKey});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(980, 29);
+            this.menuStrip1.Size = new System.Drawing.Size(1230, 29);
             this.menuStrip1.TabIndex = 7;
             this.menuStrip1.Text = "端口设置";
             // 
@@ -233,7 +236,8 @@
             // 
             // groupBox4
             // 
-            this.groupBox4.Controls.Add(this.button_CheckCfg);
+            this.groupBox4.Controls.Add(this.checkBox_LocalFile);
+            this.groupBox4.Controls.Add(this.comboBox_cfgFileDate);
             this.groupBox4.Controls.Add(this.comboBox_File);
             this.groupBox4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.groupBox4.Location = new System.Drawing.Point(12, 32);
@@ -243,17 +247,17 @@
             this.groupBox4.TabStop = false;
             this.groupBox4.Text = "配置文件";
             // 
-            // button_CheckCfg
+            // comboBox_cfgFileDate
             // 
-            this.button_CheckCfg.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.button_CheckCfg.ForeColor = System.Drawing.Color.White;
-            this.button_CheckCfg.Location = new System.Drawing.Point(887, 25);
-            this.button_CheckCfg.Name = "button_CheckCfg";
-            this.button_CheckCfg.Size = new System.Drawing.Size(63, 31);
-            this.button_CheckCfg.TabIndex = 2;
-            this.button_CheckCfg.Text = "查看";
-            this.button_CheckCfg.UseVisualStyleBackColor = false;
-            this.button_CheckCfg.Click += new System.EventHandler(this.button_CheckCfg_Click);
+            this.comboBox_cfgFileDate.BackColor = System.Drawing.SystemColors.Window;
+            this.comboBox_cfgFileDate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.comboBox_cfgFileDate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.comboBox_cfgFileDate.FormattingEnabled = true;
+            this.comboBox_cfgFileDate.Location = new System.Drawing.Point(6, 26);
+            this.comboBox_cfgFileDate.Name = "comboBox_cfgFileDate";
+            this.comboBox_cfgFileDate.Size = new System.Drawing.Size(144, 29);
+            this.comboBox_cfgFileDate.TabIndex = 4;
+            this.comboBox_cfgFileDate.SelectionChangeCommitted += new System.EventHandler(this.comboBox_cfgFileDate_SelectionChangeCommitted);
             // 
             // comboBox_File
             // 
@@ -261,9 +265,9 @@
             this.comboBox_File.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.comboBox_File.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.comboBox_File.FormattingEnabled = true;
-            this.comboBox_File.Location = new System.Drawing.Point(10, 26);
+            this.comboBox_File.Location = new System.Drawing.Point(156, 26);
             this.comboBox_File.Name = "comboBox_File";
-            this.comboBox_File.Size = new System.Drawing.Size(871, 29);
+            this.comboBox_File.Size = new System.Drawing.Size(725, 29);
             this.comboBox_File.TabIndex = 1;
             this.comboBox_File.SelectionChangeCommitted += new System.EventHandler(this.comboBox_File_SelectionChangeCommitted);
             // 
@@ -288,6 +292,7 @@
             this.groupBox1.Controls.Add(this.label_sensor_PCB_temp);
             this.groupBox1.Controls.Add(this.label_sensor_cur);
             this.groupBox1.Controls.Add(this.label_sensor_speed);
+            this.groupBox1.Controls.Add(this.label22);
             this.groupBox1.Controls.Add(this.label6);
             this.groupBox1.Controls.Add(this.label16);
             this.groupBox1.Controls.Add(this.label_sensor_vol);
@@ -295,6 +300,7 @@
             this.groupBox1.Controls.Add(this.label_Sensor_Gas);
             this.groupBox1.Controls.Add(this.label_sensor_motor);
             this.groupBox1.Controls.Add(this.label_Sensor_Break);
+            this.groupBox1.Controls.Add(this.label_BMS_COM);
             this.groupBox1.Controls.Add(this.label_FW_Version);
             this.groupBox1.Controls.Add(this.label_sta_light);
             this.groupBox1.Controls.Add(this.label_Sta_Write);
@@ -312,9 +318,9 @@
             // 
             // label_ErrorInfo
             // 
-            this.label_ErrorInfo.Location = new System.Drawing.Point(262, 33);
+            this.label_ErrorInfo.Location = new System.Drawing.Point(262, 28);
             this.label_ErrorInfo.Name = "label_ErrorInfo";
-            this.label_ErrorInfo.Size = new System.Drawing.Size(197, 119);
+            this.label_ErrorInfo.Size = new System.Drawing.Size(197, 102);
             this.label_ErrorInfo.TabIndex = 2;
             this.label_ErrorInfo.Text = "无故障";
             // 
@@ -330,7 +336,7 @@
             // label24
             // 
             this.label24.AutoSize = true;
-            this.label24.Location = new System.Drawing.Point(7, 317);
+            this.label24.Location = new System.Drawing.Point(7, 280);
             this.label24.Name = "label24";
             this.label24.Size = new System.Drawing.Size(74, 21);
             this.label24.TabIndex = 0;
@@ -339,7 +345,7 @@
             // label20
             // 
             this.label20.AutoSize = true;
-            this.label20.Location = new System.Drawing.Point(145, 285);
+            this.label20.Location = new System.Drawing.Point(145, 252);
             this.label20.Name = "label20";
             this.label20.Size = new System.Drawing.Size(74, 21);
             this.label20.TabIndex = 0;
@@ -348,7 +354,7 @@
             // label18
             // 
             this.label18.AutoSize = true;
-            this.label18.Location = new System.Drawing.Point(7, 131);
+            this.label18.Location = new System.Drawing.Point(7, 112);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(90, 21);
             this.label18.TabIndex = 0;
@@ -357,7 +363,7 @@
             // label37
             // 
             this.label37.AutoSize = true;
-            this.label37.Location = new System.Drawing.Point(307, 161);
+            this.label37.Location = new System.Drawing.Point(307, 140);
             this.label37.Name = "label37";
             this.label37.Size = new System.Drawing.Size(74, 21);
             this.label37.TabIndex = 0;
@@ -366,7 +372,7 @@
             // label35
             // 
             this.label35.AutoSize = true;
-            this.label35.Location = new System.Drawing.Point(307, 192);
+            this.label35.Location = new System.Drawing.Point(307, 168);
             this.label35.Name = "label35";
             this.label35.Size = new System.Drawing.Size(74, 21);
             this.label35.TabIndex = 0;
@@ -375,7 +381,7 @@
             // label46
             // 
             this.label46.AutoSize = true;
-            this.label46.Location = new System.Drawing.Point(307, 254);
+            this.label46.Location = new System.Drawing.Point(307, 224);
             this.label46.Name = "label46";
             this.label46.Size = new System.Drawing.Size(106, 21);
             this.label46.TabIndex = 0;
@@ -384,7 +390,7 @@
             // label43
             // 
             this.label43.AutoSize = true;
-            this.label43.Location = new System.Drawing.Point(145, 254);
+            this.label43.Location = new System.Drawing.Point(145, 224);
             this.label43.Name = "label43";
             this.label43.Size = new System.Drawing.Size(113, 21);
             this.label43.TabIndex = 0;
@@ -393,7 +399,7 @@
             // label41
             // 
             this.label41.AutoSize = true;
-            this.label41.Location = new System.Drawing.Point(307, 223);
+            this.label41.Location = new System.Drawing.Point(307, 196);
             this.label41.Name = "label41";
             this.label41.Size = new System.Drawing.Size(105, 21);
             this.label41.TabIndex = 0;
@@ -402,7 +408,7 @@
             // label39
             // 
             this.label39.AutoSize = true;
-            this.label39.Location = new System.Drawing.Point(145, 223);
+            this.label39.Location = new System.Drawing.Point(145, 196);
             this.label39.Name = "label39";
             this.label39.Size = new System.Drawing.Size(90, 21);
             this.label39.TabIndex = 0;
@@ -411,7 +417,7 @@
             // label33
             // 
             this.label33.AutoSize = true;
-            this.label33.Location = new System.Drawing.Point(145, 192);
+            this.label33.Location = new System.Drawing.Point(145, 168);
             this.label33.Name = "label33";
             this.label33.Size = new System.Drawing.Size(74, 21);
             this.label33.TabIndex = 0;
@@ -421,9 +427,9 @@
             // 
             this.label_sensor_coil_temp.BackColor = System.Drawing.Color.Red;
             this.label_sensor_coil_temp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_coil_temp.Location = new System.Drawing.Point(419, 249);
+            this.label_sensor_coil_temp.Location = new System.Drawing.Point(419, 224);
             this.label_sensor_coil_temp.Name = "label_sensor_coil_temp";
-            this.label_sensor_coil_temp.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_coil_temp.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_coil_temp.TabIndex = 0;
             this.label_sensor_coil_temp.Text = "NG";
             this.label_sensor_coil_temp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -432,9 +438,9 @@
             // 
             this.label_sensor_cadence.BackColor = System.Drawing.Color.Red;
             this.label_sensor_cadence.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_cadence.Location = new System.Drawing.Point(419, 156);
+            this.label_sensor_cadence.Location = new System.Drawing.Point(419, 140);
             this.label_sensor_cadence.Name = "label_sensor_cadence";
-            this.label_sensor_cadence.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_cadence.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_cadence.TabIndex = 0;
             this.label_sensor_cadence.Text = "NG";
             this.label_sensor_cadence.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -443,9 +449,9 @@
             // 
             this.label_sensor_MCU_temp.BackColor = System.Drawing.Color.Red;
             this.label_sensor_MCU_temp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_MCU_temp.Location = new System.Drawing.Point(262, 249);
+            this.label_sensor_MCU_temp.Location = new System.Drawing.Point(262, 224);
             this.label_sensor_MCU_temp.Name = "label_sensor_MCU_temp";
-            this.label_sensor_MCU_temp.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_MCU_temp.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_MCU_temp.TabIndex = 0;
             this.label_sensor_MCU_temp.Text = "NG";
             this.label_sensor_MCU_temp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -453,7 +459,7 @@
             // label28
             // 
             this.label28.AutoSize = true;
-            this.label28.Location = new System.Drawing.Point(145, 161);
+            this.label28.Location = new System.Drawing.Point(145, 140);
             this.label28.Name = "label28";
             this.label28.Size = new System.Drawing.Size(74, 21);
             this.label28.TabIndex = 0;
@@ -463,9 +469,9 @@
             // 
             this.label_sensor_PCB_temp.BackColor = System.Drawing.Color.Red;
             this.label_sensor_PCB_temp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_PCB_temp.Location = new System.Drawing.Point(419, 218);
+            this.label_sensor_PCB_temp.Location = new System.Drawing.Point(419, 196);
             this.label_sensor_PCB_temp.Name = "label_sensor_PCB_temp";
-            this.label_sensor_PCB_temp.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_PCB_temp.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_PCB_temp.TabIndex = 0;
             this.label_sensor_PCB_temp.Text = "NG";
             this.label_sensor_PCB_temp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -474,9 +480,9 @@
             // 
             this.label_sensor_cur.BackColor = System.Drawing.Color.Red;
             this.label_sensor_cur.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_cur.Location = new System.Drawing.Point(419, 187);
+            this.label_sensor_cur.Location = new System.Drawing.Point(419, 168);
             this.label_sensor_cur.Name = "label_sensor_cur";
-            this.label_sensor_cur.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_cur.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_cur.TabIndex = 0;
             this.label_sensor_cur.Text = "NG";
             this.label_sensor_cur.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -485,17 +491,26 @@
             // 
             this.label_sensor_speed.BackColor = System.Drawing.Color.Red;
             this.label_sensor_speed.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_speed.Location = new System.Drawing.Point(262, 218);
+            this.label_sensor_speed.Location = new System.Drawing.Point(262, 196);
             this.label_sensor_speed.Name = "label_sensor_speed";
-            this.label_sensor_speed.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_speed.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_speed.TabIndex = 0;
             this.label_sensor_speed.Text = "NG";
             this.label_sensor_speed.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // label22
+            // 
+            this.label22.AutoSize = true;
+            this.label22.Location = new System.Drawing.Point(7, 338);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(74, 21);
+            this.label22.TabIndex = 0;
+            this.label22.Text = "电池通讯";
+            // 
             // label6
             // 
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(7, 348);
+            this.label6.Location = new System.Drawing.Point(7, 309);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(74, 21);
             this.label6.TabIndex = 0;
@@ -504,7 +519,7 @@
             // label16
             // 
             this.label16.AutoSize = true;
-            this.label16.Location = new System.Drawing.Point(7, 161);
+            this.label16.Location = new System.Drawing.Point(7, 140);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(74, 21);
             this.label16.TabIndex = 0;
@@ -514,9 +529,9 @@
             // 
             this.label_sensor_vol.BackColor = System.Drawing.Color.Red;
             this.label_sensor_vol.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_vol.Location = new System.Drawing.Point(262, 187);
+            this.label_sensor_vol.Location = new System.Drawing.Point(262, 168);
             this.label_sensor_vol.Name = "label_sensor_vol";
-            this.label_sensor_vol.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_vol.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_vol.TabIndex = 0;
             this.label_sensor_vol.Text = "NG";
             this.label_sensor_vol.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -524,7 +539,7 @@
             // label14
             // 
             this.label14.AutoSize = true;
-            this.label14.Location = new System.Drawing.Point(7, 100);
+            this.label14.Location = new System.Drawing.Point(7, 84);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(106, 21);
             this.label14.TabIndex = 0;
@@ -534,9 +549,9 @@
             // 
             this.label_Sensor_Gas.BackColor = System.Drawing.Color.Red;
             this.label_Sensor_Gas.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_Sensor_Gas.Location = new System.Drawing.Point(145, 312);
+            this.label_Sensor_Gas.Location = new System.Drawing.Point(145, 280);
             this.label_Sensor_Gas.Name = "label_Sensor_Gas";
-            this.label_Sensor_Gas.Size = new System.Drawing.Size(42, 30);
+            this.label_Sensor_Gas.Size = new System.Drawing.Size(42, 21);
             this.label_Sensor_Gas.TabIndex = 0;
             this.label_Sensor_Gas.Text = "NG";
             this.label_Sensor_Gas.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -545,9 +560,9 @@
             // 
             this.label_sensor_motor.BackColor = System.Drawing.Color.Red;
             this.label_sensor_motor.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sensor_motor.Location = new System.Drawing.Point(262, 156);
+            this.label_sensor_motor.Location = new System.Drawing.Point(262, 140);
             this.label_sensor_motor.Name = "label_sensor_motor";
-            this.label_sensor_motor.Size = new System.Drawing.Size(42, 30);
+            this.label_sensor_motor.Size = new System.Drawing.Size(42, 21);
             this.label_sensor_motor.TabIndex = 0;
             this.label_sensor_motor.Text = "NG";
             this.label_sensor_motor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -556,20 +571,31 @@
             // 
             this.label_Sensor_Break.BackColor = System.Drawing.Color.Red;
             this.label_Sensor_Break.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_Sensor_Break.Location = new System.Drawing.Point(262, 280);
+            this.label_Sensor_Break.Location = new System.Drawing.Point(262, 252);
             this.label_Sensor_Break.Name = "label_Sensor_Break";
-            this.label_Sensor_Break.Size = new System.Drawing.Size(42, 30);
+            this.label_Sensor_Break.Size = new System.Drawing.Size(42, 21);
             this.label_Sensor_Break.TabIndex = 0;
             this.label_Sensor_Break.Text = "NG";
             this.label_Sensor_Break.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // label_BMS_COM
+            // 
+            this.label_BMS_COM.BackColor = System.Drawing.Color.Red;
+            this.label_BMS_COM.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
+            this.label_BMS_COM.Location = new System.Drawing.Point(145, 338);
+            this.label_BMS_COM.Name = "label_BMS_COM";
+            this.label_BMS_COM.Size = new System.Drawing.Size(42, 21);
+            this.label_BMS_COM.TabIndex = 0;
+            this.label_BMS_COM.Text = "NG";
+            this.label_BMS_COM.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // label_FW_Version
             // 
             this.label_FW_Version.BackColor = System.Drawing.Color.Red;
             this.label_FW_Version.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_FW_Version.Location = new System.Drawing.Point(145, 343);
+            this.label_FW_Version.Location = new System.Drawing.Point(145, 309);
             this.label_FW_Version.Name = "label_FW_Version";
-            this.label_FW_Version.Size = new System.Drawing.Size(42, 30);
+            this.label_FW_Version.Size = new System.Drawing.Size(42, 21);
             this.label_FW_Version.TabIndex = 0;
             this.label_FW_Version.Text = "NG";
             this.label_FW_Version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -578,9 +604,9 @@
             // 
             this.label_sta_light.BackColor = System.Drawing.Color.Red;
             this.label_sta_light.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_sta_light.Location = new System.Drawing.Point(145, 126);
+            this.label_sta_light.Location = new System.Drawing.Point(145, 112);
             this.label_sta_light.Name = "label_sta_light";
-            this.label_sta_light.Size = new System.Drawing.Size(42, 30);
+            this.label_sta_light.Size = new System.Drawing.Size(42, 21);
             this.label_sta_light.TabIndex = 0;
             this.label_sta_light.Text = "NG";
             this.label_sta_light.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -589,9 +615,9 @@
             // 
             this.label_Sta_Write.BackColor = System.Drawing.Color.Red;
             this.label_Sta_Write.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_Sta_Write.Location = new System.Drawing.Point(145, 95);
+            this.label_Sta_Write.Location = new System.Drawing.Point(145, 84);
             this.label_Sta_Write.Name = "label_Sta_Write";
-            this.label_Sta_Write.Size = new System.Drawing.Size(42, 30);
+            this.label_Sta_Write.Size = new System.Drawing.Size(42, 21);
             this.label_Sta_Write.TabIndex = 0;
             this.label_Sta_Write.Text = "NG";
             this.label_Sta_Write.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -600,9 +626,9 @@
             // 
             this.label_error_code.BackColor = System.Drawing.Color.Green;
             this.label_error_code.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_error_code.Location = new System.Drawing.Point(145, 33);
+            this.label_error_code.Location = new System.Drawing.Point(145, 28);
             this.label_error_code.Name = "label_error_code";
-            this.label_error_code.Size = new System.Drawing.Size(113, 30);
+            this.label_error_code.Size = new System.Drawing.Size(113, 21);
             this.label_error_code.TabIndex = 0;
             this.label_error_code.Text = "OK";
             this.label_error_code.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -611,9 +637,9 @@
             // 
             this.label_Sta_Clear.BackColor = System.Drawing.Color.Red;
             this.label_Sta_Clear.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
-            this.label_Sta_Clear.Location = new System.Drawing.Point(145, 64);
+            this.label_Sta_Clear.Location = new System.Drawing.Point(145, 56);
             this.label_Sta_Clear.Name = "label_Sta_Clear";
-            this.label_Sta_Clear.Size = new System.Drawing.Size(42, 30);
+            this.label_Sta_Clear.Size = new System.Drawing.Size(42, 21);
             this.label_Sta_Clear.TabIndex = 0;
             this.label_Sta_Clear.Text = "NG";
             this.label_Sta_Clear.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -621,7 +647,7 @@
             // label7
             // 
             this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(7, 38);
+            this.label7.Location = new System.Drawing.Point(7, 28);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(74, 21);
             this.label7.TabIndex = 0;
@@ -630,7 +656,7 @@
             // label12
             // 
             this.label12.AutoSize = true;
-            this.label12.Location = new System.Drawing.Point(7, 69);
+            this.label12.Location = new System.Drawing.Point(7, 56);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(74, 21);
             this.label12.TabIndex = 0;
@@ -1328,27 +1354,24 @@
             // 
             // timer1
             // 
-            this.timer1.Enabled = true;
             this.timer1.Interval = 20;
             this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
             // 
             // timer2
             // 
-            this.timer2.Enabled = true;
             this.timer2.Interval = 1000;
             this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
             // 
-            // richTextBox_Cfg
+            // richTextBox_CfgFile
             // 
-            this.richTextBox_Cfg.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.richTextBox_Cfg.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
-            this.richTextBox_Cfg.Location = new System.Drawing.Point(974, 43);
-            this.richTextBox_Cfg.Name = "richTextBox_Cfg";
-            this.richTextBox_Cfg.ReadOnly = true;
-            this.richTextBox_Cfg.Size = new System.Drawing.Size(250, 745);
-            this.richTextBox_Cfg.TabIndex = 11;
-            this.richTextBox_Cfg.Text = "";
-            this.richTextBox_Cfg.Visible = false;
+            this.richTextBox_CfgFile.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.richTextBox_CfgFile.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.richTextBox_CfgFile.Location = new System.Drawing.Point(974, 43);
+            this.richTextBox_CfgFile.Name = "richTextBox_CfgFile";
+            this.richTextBox_CfgFile.ReadOnly = true;
+            this.richTextBox_CfgFile.Size = new System.Drawing.Size(250, 745);
+            this.richTextBox_CfgFile.TabIndex = 11;
+            this.richTextBox_CfgFile.Text = "";
             // 
             // groupBox3
             // 
@@ -1422,14 +1445,25 @@
             this.label34.TabIndex = 12;
             this.label34.Text = "label34";
             // 
+            // checkBox_LocalFile
+            // 
+            this.checkBox_LocalFile.AutoSize = true;
+            this.checkBox_LocalFile.Location = new System.Drawing.Point(889, 28);
+            this.checkBox_LocalFile.Name = "checkBox_LocalFile";
+            this.checkBox_LocalFile.Size = new System.Drawing.Size(61, 25);
+            this.checkBox_LocalFile.TabIndex = 13;
+            this.checkBox_LocalFile.Text = "本地";
+            this.checkBox_LocalFile.UseVisualStyleBackColor = true;
+            this.checkBox_LocalFile.CheckedChanged += new System.EventHandler(this.checkBox_LocalFile_CheckedChanged);
+            // 
             // ImportForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
-            this.ClientSize = new System.Drawing.Size(980, 813);
+            this.ClientSize = new System.Drawing.Size(1230, 813);
             this.Controls.Add(this.label34);
-            this.Controls.Add(this.richTextBox_Cfg);
+            this.Controls.Add(this.richTextBox_CfgFile);
             this.Controls.Add(this.groupBox4);
             this.Controls.Add(this.label_SystemTime);
             this.Controls.Add(this.label_NetStatus);
@@ -1450,12 +1484,13 @@
             this.MaximizeBox = false;
             this.Name = "ImportForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "导入参数";
+            this.Text = "生产模式";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ImportForm_FormClosing);
             this.Load += new System.EventHandler(this.ImportForm_Load);
             this.menuStrip1.ResumeLayout(false);
             this.menuStrip1.PerformLayout();
             this.groupBox4.ResumeLayout(false);
+            this.groupBox4.PerformLayout();
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
             this.groupBox2.ResumeLayout(false);
@@ -1568,8 +1603,7 @@
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_PowerKey;
         private System.Windows.Forms.ToolStripMenuItem 关ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 开ToolStripMenuItem;
-        private System.Windows.Forms.Button button_CheckCfg;
-        private System.Windows.Forms.RichTextBox richTextBox_Cfg;
+        private System.Windows.Forms.RichTextBox richTextBox_CfgFile;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.RichTextBox richTextBox_TestRecord;
@@ -1589,5 +1623,9 @@
         private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label34;
         public System.Windows.Forms.Label label_NetStatus;
+        private System.Windows.Forms.ComboBox comboBox_cfgFileDate;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label label_BMS_COM;
+        public System.Windows.Forms.CheckBox checkBox_LocalFile;
     }
 }

+ 228 - 146
ImportForm.cs

@@ -98,21 +98,133 @@ namespace MOTINOVA_Motor_Factory_Set
             System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
         }
 
-        private void ImportForm_Load(object sender, EventArgs e)
+        #region 获取配置文件日期
+        private void GetDateList()
+        {
+            string[] DateList = { "" };
+            if (checkBox_LocalFile.Checked == true)//从本地更新日期列表
+            {
+                DateList = System.IO.Directory.GetDirectories(Directory.GetCurrentDirectory() + "\\cfg");
+            }
+            else//从服务器更新日期列表
+            {
+                DateList = StartForm.myFtp.GetDirectoryList(StartForm.myServerCfg.RootPath + "/cfg");
+            }
+            comboBox_cfgFileDate.Items.Clear();
+            foreach (var file in DateList)
+            {
+                comboBox_cfgFileDate.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+            }
+        }
+        #endregion
+
+        #region 获取配置文件列表
+        private void GetFileListFrom(string date)
         {
-            //装载测试可用配置文件
-            CfgFilePath = System.IO.Directory.GetCurrentDirectory() + "\\cfg\\";
-            if (System.IO.Directory.Exists(CfgFilePath) == false)
+            string[] FileList = { "" };
+            if (checkBox_LocalFile.Checked == true)//从本地更新文件列表
             {
-                System.IO.Directory.CreateDirectory(CfgFilePath);
+                FileList = System.IO.Directory.GetFiles(Directory.GetCurrentDirectory() + "\\cfg\\" + date);
+            }
+            else//从服务器更新文件列表
+            {
+                FileList = StartForm.myFtp.GetFileNameList(StartForm.myServerCfg.RootPath + "/cfg/" + date);
             }
-            var files = Directory.GetFiles(CfgFilePath, "*.ttcfg");
             comboBox_File.Items.Clear();
-            foreach (var file in files)
+            foreach (var file in FileList)
+            {
+                comboBox_File.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+            }
+        }
+        #endregion
+
+        #region 选择文件日期后更新文件列表
+        private void comboBox_cfgFileDate_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            comboBox_File.Text = "";
+            GetFileListFrom(comboBox_cfgFileDate.SelectedItem.ToString());
+        }
+        #endregion
+
+        #region 选择文件后加载文件
+        private void comboBox_File_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            //清空原来数据
+            array_CfgInfo.Clear();
+            string SelectFile = "";
+            if (checkBox_LocalFile.Checked == false)//从服务器下载文件
+            {
+                SelectFile = comboBox_cfgFileDate.SelectedItem.ToString() + "\\" + comboBox_File.SelectedItem.ToString();
+                if (!File.Exists(Directory.GetCurrentDirectory() + "\\cfg\\" + SelectFile))//检查本地是否存在选定文件
+                {
+                    SelectFile = comboBox_cfgFileDate.SelectedItem.ToString() + "/" + comboBox_File.SelectedItem.ToString();
+                    StartForm.myFtp.DownLoadNotReName(StartForm.myServerCfg.RootPath + "/cfg/" + SelectFile, Directory.GetCurrentDirectory() + "\\cfg\\" + comboBox_cfgFileDate.SelectedItem.ToString());
+
+                }
+            }
+            SelectFile = comboBox_cfgFileDate.SelectedItem.ToString() + "\\" + comboBox_File.SelectedItem.ToString();
+            //打开选中文件
+            StreamReader objReader = new StreamReader(Directory.GetCurrentDirectory() + "\\cfg\\" + SelectFile);
+            string sLine = "";
+            while (sLine != null)
+            {
+                sLine = objReader.ReadLine();
+                array_CfgInfo.Add(sLine);
+            }
+            objReader.Close();
+            //解析显示配置文件
+            richTextBox_CfgFile.Text = "";
+            try
+            {
+                foreach (string sOutput in array_CfgInfo)
+                {
+                    richTextBox_CfgFile.AppendText(sOutput + "\r\n");
+                }
+            }
+            catch (System.Exception)
+            {
+                return;
+            }
+            //更新推行模式测试判断标准
+            MotorRadeSpeed = Convert.ToUInt16(array_CfgInfo[42].ToString().Split(',')[1]);
+            RateCadence = (ushort)(MotorRadeSpeed / 11U);
+            RateVoltage = (ushort)(Convert.ToByte(array_CfgInfo[47].ToString().Split(',')[1]) * 1000);
+
+            //更新指拨和速度传感器测试标志
+            byte temp = Convert.ToByte(array_CfgInfo[25].ToString().Split(',')[1]);
+            GasModeTest = temp == 0x55 ? false : temp == 0xAA ? true : false;
+            temp = Convert.ToByte(array_CfgInfo[26].ToString().Split(',')[1]);
+            SpeedSensorTest = temp == 0x55 || (temp == 0xAA ? false : temp == 0xEE ? false : false);
+
+            //更新空载电流和车速传感器判断阈值
+            if (array_CfgInfo.Count > 56)//旧版本无改配置项,采用默认值
             {
-                comboBox_File.Items.Add(Path.GetFileName(file));
+                No_load_Current = Convert.ToUInt16(array_CfgInfo[59].ToString().Split(',')[1]);
+                SpeedSensorThData = Convert.ToUInt16(array_CfgInfo[60].ToString().Split(',')[1]);
+                GasModeSpeed = Convert.ToUInt16(array_CfgInfo[61].ToString().Split(',')[1]);
             }
-            //装载配置参数
+        }
+        #endregion
+
+        #region 修改获取文件方式,本地或服务器
+        private void checkBox_LocalFile_CheckedChanged(object sender, EventArgs e)
+        {
+            comboBox_cfgFileDate.Text = "";
+            comboBox_File.Text = "";
+            richTextBox_CfgFile.Text = "";
+            GetDateList();
+        }
+        #endregion
+
+        private void ImportForm_Load(object sender, EventArgs e)
+        {
+            timer1.Enabled = true;
+            timer2.Enabled = true;
+
+            //装载配置文件
+            GetDateList();
+
+            //装载序列号文件
             string cfg_file = System.IO.Directory.GetCurrentDirectory() + "\\SerialNum";
             StreamReader objReader = new StreamReader(cfg_file);
             string sLine = "";
@@ -358,9 +470,9 @@ namespace MOTINOVA_Motor_Factory_Set
                                     textBox_BikeSpeed.Text = ((float)DataTemp / 10f).ToString("0.0");
 
                                     //输出转速
-                                    DataTemp = (ushort)(binary_data_1[5] * 256 + binary_data_1[4]);  
+                                    DataTemp = (ushort)(binary_data_1[5] * 256 + binary_data_1[4]);
                                     textBox_MotorSpeed.Text = Convert.ToString(DataTemp);
-                                    
+
                                     //母线电压
                                     DataTemp = (ushort)(binary_data_1[9] * 256 + binary_data_1[8]);
                                     textBox_Vol.Text = Convert.ToString(DataTemp);
@@ -370,7 +482,7 @@ namespace MOTINOVA_Motor_Factory_Set
                                     textBox_Cur.Text = Convert.ToString(DataTemp);
 
                                     //踏频
-                                    DataTemp = (ushort)(binary_data_1[12]);  
+                                    DataTemp = (ushort)(binary_data_1[12]);
                                     textBox_Cadence.Text = Convert.ToString(DataTemp);
 
                                     //踩踏力矩
@@ -410,7 +522,7 @@ namespace MOTINOVA_Motor_Factory_Set
                         {
                             unchecked
                             {
-                                _ = this.Invoke((EventHandler)(delegate
+                                this.Invoke((EventHandler)(delegate
                                   {
                                       MC_ErrorCode_Refresh = true;
                                       label_error_code.Text =
@@ -422,7 +534,7 @@ namespace MOTINOVA_Motor_Factory_Set
                                       label_error_code.BackColor = Color.Red;
                                       UInt32 ErrorCode = (UInt32)((binary_data_1[5] << 24) + (binary_data_1[4] << 16) + (binary_data_1[3] << 8) + binary_data_1[2]);
                                       ErrorInfoDisplay(ErrorCode);
-                                      
+
                                   }));
                             }
                             break;
@@ -434,7 +546,7 @@ namespace MOTINOVA_Motor_Factory_Set
                             {
                                 this.Invoke((EventHandler)(delegate
                                 {
-                                     //电机型号
+                                    //电机型号
                                     richTextBox_Ver.Text += "型号:";
                                     for (ushort i = 0; i < 16; i++)
                                     {
@@ -460,7 +572,7 @@ namespace MOTINOVA_Motor_Factory_Set
 
                                     //电机HW
                                     richTextBox_Ver.Text += "硬件版本:";
-                                    for (ushort i = 0; i < 12; i++)//后4位是MCU的ID校验码,用于识别板子的ID
+                                    for (ushort i = 0; i < 10; i++)//前10位是PCB版号,以'.'结束
                                     {
                                         if (binary_data_1[34 + i] == 0x2E)
                                         {
@@ -472,8 +584,20 @@ namespace MOTINOVA_Motor_Factory_Set
                                         }
                                         richTextBox_Ver.Text += ((char)binary_data_1[34 + i]).ToString();
                                     }
-                                    richTextBox_Ver.Text += " ";
-                                    for (ushort i = 0; i < 4; i++)
+                                    switch (binary_data_1[34 + 10])//第10位代表MCU品牌
+                                    {
+                                        case (byte)'1':
+                                            richTextBox_Ver.Text += " " + "ST" + " "; break;
+                                        case (byte)'2':
+                                            richTextBox_Ver.Text += " " + "APM" + " "; break;
+                                        case (byte)'3':
+                                            richTextBox_Ver.Text += " " + "HK" + " "; break;
+                                        case (byte)'4':
+                                            richTextBox_Ver.Text += " " + "GD" + " "; break;
+                                        default: 
+                                            richTextBox_Ver.Text += " " + "NULL" + " "; break;
+                                    }
+                                    for (ushort i = 0; i < 4; i++)//后4位是MCU的ID校验码,用于识别板子的ID
                                     {
                                         richTextBox_Ver.Text += Convert.ToString(binary_data_1[46 + i], 16).PadLeft(2, '0').ToUpper();//MCU ID 的CRC32值
                                     }
@@ -538,6 +662,7 @@ namespace MOTINOVA_Motor_Factory_Set
                 }
             }
             #endregion
+            #region TE
             else if ((ID == 0x615) || (ID == 0x610))
             {
                 switch (CmdTemp)
@@ -569,6 +694,14 @@ namespace MOTINOVA_Motor_Factory_Set
                     default: break;
                 }
             }
+            #endregion
+            #region //电池信息
+            else if ((ID == 0x725) || (ID == 0x720))
+            {
+                label_BMS_COM.BackColor = Color.Green;
+                label_BMS_COM.Text = "OK";
+            }
+            #endregion
         }
         #endregion
 
@@ -734,11 +867,15 @@ namespace MOTINOVA_Motor_Factory_Set
             label_FW_Version.BackColor = Color.Red;//版本信息
             label_FW_Version.Text = "NG";
 
+            label_BMS_COM.BackColor = Color.Red;//BMS通信
+            label_BMS_COM.Text = "NG";
+
             label_Result.BackColor = Color.Red;//测试结果
             label_Result.Text = "不合格";
 
             richTextBox_Ver.Text = "";//版本信息
             richTextBox_TestRecord.Text = "";//测试过程记录
+
         }
 
         //测试失败存储测试界面
@@ -748,18 +885,18 @@ namespace MOTINOVA_Motor_Factory_Set
             Bitmap bit = new Bitmap(this.Width, this.Height);//实例化一个和窗体一样大的bitmap
             Graphics g = Graphics.FromImage(bit);
             g.CopyFromScreen(this.Left, this.Top, 0, 0, new Size(this.Width, this.Height));//保存整个窗体为图片  
-            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\errorlog\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
+            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\walkTest\\errorlog\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
             if (System.IO.Directory.Exists(LogSaveFileName) == false)
                 System.IO.Directory.CreateDirectory(LogSaveFileName);
             LogSaveFileName += textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_") + "_测试记录" + ".png";
             bit.Save(LogSaveFileName);
             //测试页面上传服务器
             string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
-            if (StartForm.myFtp.DirectoryExist("MOTINOVA_MC_Factory_Set/errorlog/", DateNow) == false)
+            if (StartForm.myFtp.DirectoryExist(StartForm.myServerCfg.RootPath + "/walkTest/errorlog/", DateNow) == false)
             {
-                StartForm.myFtp.MakeDir("MOTINOVA_MC_Factory_Set/errorlog/" + DateNow);
+                StartForm.myFtp.MakeDir(StartForm.myServerCfg.RootPath + "/walkTest/errorlog/" + DateNow);
             }
-            bool result = StartForm.myFtp.UploadFile(LogSaveFileName, "MOTINOVA_MC_Factory_Set/errorlog/" + DateNow);
+            bool result = StartForm.myFtp.UploadFile(LogSaveFileName, StartForm.myServerCfg.RootPath + "/walkTest/errorlog/" + DateNow);
             if (result == true)
                 richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试异常页面上传服务器成功" + "\r\n";
         }
@@ -782,6 +919,7 @@ namespace MOTINOVA_Motor_Factory_Set
             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';
@@ -816,25 +954,11 @@ namespace MOTINOVA_Motor_Factory_Set
             label_Step.Text = "参数写入中,请等待!";
 
             #region Step2.1:写入电机型号和序列号
-            string Mode = "", SN = "";
-            if (textBox_PDinfo.Text.Contains("%#") == true)
-            {
-                Mode = Regex.Split(textBox_PDinfo.Text, "%#", RegexOptions.IgnoreCase)[0];
-                SN = Regex.Split(textBox_PDinfo.Text, "%#", RegexOptions.IgnoreCase)[1];
-            }
-            else if (textBox_PDinfo.Text.Contains("  ") == true)
-            {
-                Mode = Regex.Split(textBox_PDinfo.Text, "  ", RegexOptions.IgnoreCase)[0];
-                SN = Regex.Split(textBox_PDinfo.Text, "  ", RegexOptions.IgnoreCase)[1];
-            }
-            else
-            {
-                label_Step.Text = "打标信息错误,测试结束!";
-                button_Start.Enabled = true;
-                ErrorSaveLog();
-                return;
-            }
+            string Mode = textBox_PDinfo.Text.Substring(0, textBox_PDinfo.Text.LastIndexOf(' '));
+            string SN = textBox_PDinfo.Text.Remove(0, textBox_PDinfo.Text.LastIndexOf(' ') + 1); 
+
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入电机型号" + "\r\n";
+            Array.Clear(Code, 0, 32);
             for (ushort i = 0; i < ((Mode.Length > 16) ? 16 : Mode.Length); i++)
             {
                 Code[i] = (byte)Mode[i];
@@ -866,6 +990,7 @@ namespace MOTINOVA_Motor_Factory_Set
             }
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入电机序列号" + "\r\n";
+            Array.Clear(Code, 0, 32);
             for (ushort i = 0; i < ((SN.Length > 16) ? 16 : SN.Length); i++)
             {
                 Code[i] = (byte)SN[i];
@@ -900,6 +1025,7 @@ namespace MOTINOVA_Motor_Factory_Set
             #region Step2.2:写入用户参数1
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入用户参数1" + "\r\n";
+            Array.Clear(Code, 0, 32);
             //指拨模式
             Code[0] = Convert.ToByte(array_CfgInfo[25].ToString().Split(',')[1]); 
             //启动模式
@@ -988,6 +1114,7 @@ namespace MOTINOVA_Motor_Factory_Set
             #region Step2.3:写入用户参数2
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入用户参数2" + "\r\n";
+            Array.Clear(Code, 0, 32);
             //俯仰角零偏
             DataTemp_Int16 = (short)(decimal.Parse(array_CfgInfo[34].ToString().Split(',')[1]) * 10);
             Code[0] = (byte)(DataTemp_Int16 & 0xFF);
@@ -1026,6 +1153,7 @@ namespace MOTINOVA_Motor_Factory_Set
             #region Step2.4:写入马达参数
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入马达参数" + "\r\n";
+            Array.Clear(Code, 0, 32);
             //额定功率
             DataTemp = Convert.ToUInt16(array_CfgInfo[41].ToString().Split(',')[1]);
             Code[0] = (byte)(DataTemp & 0xFF);
@@ -1075,6 +1203,7 @@ namespace MOTINOVA_Motor_Factory_Set
             #region Step2.5:写入生产信息
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入生产信息" + "\r\n";
+            Array.Clear(Code, 0, 32);
             string MAC_Info = array_CfgInfo[50].ToString().Split(',')[1];
             for (ushort i = 0; i < ((MAC_Info.Length > 8) ? 8 : MAC_Info.Length); i++)
             {
@@ -1112,6 +1241,7 @@ namespace MOTINOVA_Motor_Factory_Set
             #region Step2.6:写入校验密钥
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入校验密钥" + "\r\n";
+            Array.Clear(Code, 0, 32);
             if (array_CfgInfo[53].ToString().EndsWith(",") == false)
             {
                 string KeyString = array_CfgInfo[53].ToString().Split(',')[1];
@@ -1147,6 +1277,7 @@ namespace MOTINOVA_Motor_Factory_Set
             //自定义信息1
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入自定义信息1" + "\r\n";
+            Array.Clear(Code, 0, 32);
             if (array_CfgInfo[54].ToString().EndsWith(",") == false)
             {
                 string UserInfo1String = array_CfgInfo[54].ToString().Split(',')[1];
@@ -1179,6 +1310,7 @@ namespace MOTINOVA_Motor_Factory_Set
             //自定义信息2
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入自定义信息2" + "\r\n";
+            Array.Clear(Code, 0, 32);
             if (array_CfgInfo[55].ToString().EndsWith(",") == false)
             {
                 string UserInfo2String = array_CfgInfo[55].ToString().Split(',')[1];
@@ -1211,6 +1343,7 @@ namespace MOTINOVA_Motor_Factory_Set
             //自定义信息3
             Delay_ms(200);
             richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入自定义信息3" + "\r\n";
+            Array.Clear(Code, 0, 32);
             if (array_CfgInfo[56].ToString().EndsWith(",") == false)
             {
                 string UserInfo3String = array_CfgInfo[56].ToString().Split(',')[1];
@@ -1539,6 +1672,15 @@ namespace MOTINOVA_Motor_Factory_Set
                 ErrorSaveLog();
                 return;
             }
+            //判断BMS通信是否正常
+            if (label_BMS_COM.Text != "OK")
+            {
+                label_Step.Text = "BMS通信异常,测试结束!";
+                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "推行测试失败,测试结束" + "\r\n";
+                button_Start.Enabled = true;
+                ErrorSaveLog();
+                return;
+            }
             #endregion
 
             #region Step5:转把模式测试(非必需)
@@ -1815,49 +1957,59 @@ namespace MOTINOVA_Motor_Factory_Set
             button_Start.Enabled = true;
 
             //导出的参数上传服务器
-            string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
-            if (StartForm.myFtp.DirectoryExist("MOTINOVA_MC_Factory_Set/log/", DateNow) == false)
+            if (StartForm.myFtp.IsNetConnected == true)
             {
-                StartForm.myFtp.MakeDir("MOTINOVA_MC_Factory_Set/log/" + DateNow);
+                string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
+                if (StartForm.myFtp.DirectoryExist(StartForm.myServerCfg.RootPath + "/walkTest/log/", DateNow) == false)
+                {
+                    StartForm.myFtp.MakeDir(StartForm.myServerCfg.RootPath + "/walkTest/log/" + DateNow);
+                }
+                bool result = StartForm.myFtp.UploadFile(LogSaveFileName, StartForm.myServerCfg.RootPath + "/walkTestlog/" + DateNow);
+                if (result == true)
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "电机配置参数上传服务器成功" + "\r\n";
             }
-            bool result = StartForm.myFtp.UploadFile(LogSaveFileName, "MOTINOVA_MC_Factory_Set/log/" + DateNow);
-            if (result == true)
-                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "电机配置参数上传服务器成功" + "\r\n";
 
             //保存测试信息
             //页面存储
             Bitmap bit = new Bitmap(this.Width, this.Height);//实例化一个和窗体一样大的bitmap
             Graphics g = Graphics.FromImage(bit);
             g.CopyFromScreen(this.Left, this.Top, 0, 0, new Size(this.Width, this.Height));//保存整个窗体为图片  
-            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\log\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
+            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\walkTest\\log\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
             if (System.IO.Directory.Exists(LogSaveFileName) == false)
                 System.IO.Directory.CreateDirectory(LogSaveFileName);
             LogSaveFileName += textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_") + "_测试记录" + ".png";
             bit.Save(LogSaveFileName);
             //测试页面上传服务器
-            DateNow = DateTime.Now.ToString("yyyy-MM-dd");
-            if (StartForm.myFtp.DirectoryExist("MOTINOVA_MC_Factory_Set/log/", DateNow) == false)
+            if(StartForm.myFtp.IsNetConnected==true)
             {
-                StartForm.myFtp.MakeDir("MOTINOVA_MC_Factory_Set/log/" + DateNow);
+                string DateNow = DateTime.Now.ToString("yyyy-MM-dd"); 
+                if (StartForm.myFtp.DirectoryExist(StartForm.myServerCfg.RootPath + "/walkTest/log/", DateNow) == false)
+                {
+                    StartForm.myFtp.MakeDir(StartForm.myServerCfg.RootPath + "/walkTest/log/" + DateNow);
+                }
+                bool result = StartForm.myFtp.UploadFile(LogSaveFileName, StartForm.myServerCfg.RootPath + "/walkTest/log/" + DateNow);
+                if (result == true)
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试页面上传服务器成功" + "\r\n";
             }
-            result = StartForm.myFtp.UploadFile(LogSaveFileName, "MOTINOVA_MC_Factory_Set/log/" + DateNow);
-            if (result == true)
-                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试页面上传服务器成功" + "\r\n";
-            
+
             //保存测试记录
-            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\log\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
+            LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\walkTest\\log\\" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
             if (System.IO.Directory.Exists(LogSaveFileName) == false)
                 System.IO.Directory.CreateDirectory(LogSaveFileName);
             LogSaveFileName += textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_") + "_测试记录" + ".txt";
             richTextBox_TestRecord.SaveFile(LogSaveFileName, RichTextBoxStreamType.PlainText);
             //测试记录上传服务器
-            if (StartForm.myFtp.DirectoryExist("MOTINOVA_MC_Factory_Set/log/", DateNow) == false)
+            if (StartForm.myFtp.IsNetConnected == true)
             {
-                StartForm.myFtp.MakeDir("MOTINOVA_MC_Factory_Set/log/" + DateNow);
+                string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
+                if (StartForm.myFtp.DirectoryExist(StartForm.myServerCfg.RootPath + "/walkTest/log/", DateNow) == false)
+                {
+                    StartForm.myFtp.MakeDir(StartForm.myServerCfg.RootPath + "/walkTest/log/" + DateNow);
+                }
+                bool result = StartForm.myFtp.UploadFile(LogSaveFileName, StartForm.myServerCfg.RootPath + "/walkTest/log/" + DateNow);
+                if (result == true)
+                    richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试记录上传服务器成功" + "\r\n";
             }
-            result = StartForm.myFtp.UploadFile(LogSaveFileName, "MOTINOVA_MC_Factory_Set/log/" + DateNow);
-            if (result == true)
-                richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试记录上传服务器成功" + "\r\n";
         }
 
         //开始测试
@@ -1894,9 +2046,22 @@ namespace MOTINOVA_Motor_Factory_Set
             #endregion
 
             #region 检查产品信息是否符合格式要求
-            if ((textBox_PDinfo.Text.Contains("%#") || textBox_PDinfo.Text.Contains("  ")) == false)
+            try
             {
-                label_Step.Text = "打标信息错误!";
+                string Mode = textBox_PDinfo.Text.Split(new string[] { "  " }, StringSplitOptions.None)[0];
+                string Sn = textBox_PDinfo.Text.Split(new string[] { "  " }, StringSplitOptions.None)[1];
+                Regex regex = new Regex(@"^M[12][0-9](0?[1-9]|1[0-2])((0?[1-9])|((1|2)[0-9])|30|31)[A-Z]\d{4}[A-Z]$");
+                if (regex.IsMatch(Sn) == false)
+                {
+                    label_Step.Text = "SN格式错误!";
+                    label_Step.ForeColor = Color.Red;
+                    return;
+                }
+            }
+            catch (System.Exception ex)
+            { 
+                label_Step.Text = "标签格式错误!";
+                label_Step.ForeColor = Color.Red;
                 return;
             }
             #endregion
@@ -2036,54 +2201,6 @@ namespace MOTINOVA_Motor_Factory_Set
             }
         }
 
-        //查看选定的配置文件
-        private void button_CheckCfg_Click(object sender, EventArgs e)
-        {
-            if (button_CheckCfg.Text == "查看")
-            {
-                if (comboBox_File.Items.Count == 0) //配置文件目录为空
-                {
-                    MessageBox.Show("无可用配置文件!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    return;
-                }
-                if (comboBox_File.Text.Trim().Length == 0)//未选择配置文件
-                {
-                    MessageBox.Show("请选择配置文件!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    return;
-                }
-
-                richTextBox_Cfg.Visible = true;
-                richTextBox_Cfg.Text = "";
-
-                button_CheckCfg.Text = "隐藏";
-                this.Size = new Size(this.Size.Width + 250, this.Size.Height);
-
-                //显示文件
-                string SelectFile = comboBox_File.SelectedItem.ToString();
-                StreamReader objReader = new StreamReader(CfgFilePath + "\\" + SelectFile);
-                string sLine = "";
-                ArrayList arrText = new ArrayList();//创建一个动态数组
-                while (sLine != null)
-                {
-                    sLine = objReader.ReadLine();
-                    arrText.Add(sLine);
-                }
-                objReader.Close();
-                foreach (string sOutput in arrText)
-                {
-                    richTextBox_Cfg.Text += sOutput + "\r\n";
-                }
-            }
-            else
-            {
-                richTextBox_Cfg.Visible = false;
-                richTextBox_Cfg.Text = "";
-                button_CheckCfg.Text = "查看";
-
-                this.Size = new Size(this.Size.Width - 250, this.Size.Height);
-            }
-        }
-
         //清除流水号
         private void label8_DoubleClick(object sender, EventArgs e)
         {
@@ -2115,42 +2232,6 @@ namespace MOTINOVA_Motor_Factory_Set
                 
         }
 
-        private void comboBox_File_SelectionChangeCommitted(object sender, EventArgs e)
-        {
-            //清空原来数据
-            array_CfgInfo.Clear();
-            //打开选中文件
-            string SelectFile = comboBox_File.SelectedItem.ToString();
-            StreamReader objReader = new StreamReader(CfgFilePath + "\\" + SelectFile);
-            string sLine = "";
-            while (sLine != null)
-            {
-                sLine = objReader.ReadLine();
-                array_CfgInfo.Add(sLine);
-            }
-
-            //更新推行模式测试判断标准
-            MotorRadeSpeed = Convert.ToUInt16(array_CfgInfo[42].ToString().Split(',')[1]);
-            RateCadence = (ushort)(MotorRadeSpeed / 11U);
-            RateVoltage = (ushort)(Convert.ToByte(array_CfgInfo[47].ToString().Split(',')[1]) * 1000);
-
-            //更新指拨和速度传感器测试标志
-            byte temp =  Convert.ToByte(array_CfgInfo[25].ToString().Split(',')[1]);
-            GasModeTest = temp == 0x55 ? false : temp == 0xAA ? true : false;
-            temp = Convert.ToByte(array_CfgInfo[26].ToString().Split(',')[1]);
-            SpeedSensorTest = temp == 0x55 || (temp == 0xAA ? false : temp == 0xEE ? false : false);
-
-            //更新空载电流和车速传感器判断阈值
-            if (array_CfgInfo.Count > 56)//旧版本无改配置项,采用默认值
-            {
-                No_load_Current = Convert.ToUInt16(array_CfgInfo[59].ToString().Split(',')[1]);
-                SpeedSensorThData = Convert.ToUInt16(array_CfgInfo[60].ToString().Split(',')[1]);
-                GasModeSpeed = Convert.ToUInt16(array_CfgInfo[61].ToString().Split(',')[1]);
-            }
-
-            objReader.Close();
-        }
-
         private void richTextBox_TestRecord_TextChanged(object sender, EventArgs e)
         {
             richTextBox_TestRecord.SelectionStart = richTextBox_TestRecord.Text.Length;
@@ -2161,5 +2242,6 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             textBox_PDinfo.SelectAll();
         }
+
     }
 }

+ 11 - 0
MOTINOVA_Motor_Factory_Set.csproj

@@ -74,6 +74,12 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CheckForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CheckForm.Designer.cs">
+      <DependentUpon>CheckForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="ExportForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -99,6 +105,7 @@
     <Compile Include="PortSettings.Designer.cs">
       <DependentUpon>PortSettings.cs</DependentUpon>
     </Compile>
+    <Compile Include="server_cfg.cs" />
     <Compile Include="StartForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -107,6 +114,10 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TorqueCheckParam.cs" />
+    <EmbeddedResource Include="CheckForm.resx">
+      <DependentUpon>CheckForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="ExportForm.resx">
       <DependentUpon>ExportForm.cs</DependentUpon>
     </EmbeddedResource>

+ 18 - 5
ManageForm.Designer.cs

@@ -39,6 +39,7 @@
             this.label2 = new System.Windows.Forms.Label();
             this.button_Delete = new System.Windows.Forms.Button();
             this.button_OpenFile = new System.Windows.Forms.Button();
+            this.comboBox_Date = new System.Windows.Forms.ComboBox();
             this.groupBox_Pwd.SuspendLayout();
             this.groupBox_File.SuspendLayout();
             this.SuspendLayout();
@@ -89,6 +90,7 @@
             // 
             // groupBox_File
             // 
+            this.groupBox_File.Controls.Add(this.comboBox_Date);
             this.groupBox_File.Controls.Add(this.richTextBox1);
             this.groupBox_File.Controls.Add(this.listBox_File);
             this.groupBox_File.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
@@ -102,10 +104,10 @@
             // richTextBox1
             // 
             this.richTextBox1.BackColor = System.Drawing.Color.White;
-            this.richTextBox1.Location = new System.Drawing.Point(7, 29);
+            this.richTextBox1.Location = new System.Drawing.Point(7, 70);
             this.richTextBox1.Name = "richTextBox1";
             this.richTextBox1.ReadOnly = true;
-            this.richTextBox1.Size = new System.Drawing.Size(649, 463);
+            this.richTextBox1.Size = new System.Drawing.Size(656, 422);
             this.richTextBox1.TabIndex = 1;
             this.richTextBox1.Text = "";
             this.richTextBox1.Visible = false;
@@ -116,9 +118,9 @@
             this.listBox_File.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.listBox_File.FormattingEnabled = true;
             this.listBox_File.ItemHeight = 21;
-            this.listBox_File.Location = new System.Drawing.Point(6, 28);
+            this.listBox_File.Location = new System.Drawing.Point(6, 70);
             this.listBox_File.Name = "listBox_File";
-            this.listBox_File.Size = new System.Drawing.Size(650, 464);
+            this.listBox_File.Size = new System.Drawing.Size(657, 422);
             this.listBox_File.TabIndex = 0;
             // 
             // label2
@@ -158,6 +160,16 @@
             this.button_OpenFile.Visible = false;
             this.button_OpenFile.Click += new System.EventHandler(this.button_OpenFile_Click);
             // 
+            // comboBox_Date
+            // 
+            this.comboBox_Date.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.comboBox_Date.FormattingEnabled = true;
+            this.comboBox_Date.Location = new System.Drawing.Point(6, 28);
+            this.comboBox_Date.Name = "comboBox_Date";
+            this.comboBox_Date.Size = new System.Drawing.Size(121, 29);
+            this.comboBox_Date.TabIndex = 2;
+            this.comboBox_Date.SelectionChangeCommitted += new System.EventHandler(this.comboBox_Date_SelectionChangeCommitted);
+            // 
             // ManageForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@@ -176,7 +188,7 @@
             this.MaximizeBox = false;
             this.Name = "ManageForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-            this.Text = "文件管理";
+            this.Text = "本地管理";
             this.Load += new System.EventHandler(this.ManageForm_Load);
             this.groupBox_Pwd.ResumeLayout(false);
             this.groupBox_Pwd.PerformLayout();
@@ -197,5 +209,6 @@
         private System.Windows.Forms.Button button_Delete;
         private System.Windows.Forms.RichTextBox richTextBox1;
         private System.Windows.Forms.Button button_OpenFile;
+        private System.Windows.Forms.ComboBox comboBox_Date;
     }
 }

+ 26 - 5
ManageForm.cs

@@ -12,7 +12,6 @@ namespace MOTINOVA_Motor_Factory_Set
 {
     public partial class ManageForm : Form
     {
-
         string FilePath = "cfg\\";//文件路径
 
         public ManageForm()
@@ -25,6 +24,23 @@ namespace MOTINOVA_Motor_Factory_Set
             groupBox_Pwd.Visible = true;
             groupBox_File.Visible = false;
             button_Delete.Visible = false;
+            button_OpenFile.Visible = false;
+        }
+
+        private void ListDate(string path)
+        {
+            if (System.IO.Directory.Exists(path) == false)
+            {
+                System.IO.Directory.CreateDirectory(path);
+            }
+            //装载配置文件日期列表
+            string[] DateList = { "" };
+            DateList = System.IO.Directory.GetDirectories(path);
+            comboBox_Date.Items.Clear();
+            foreach (var file in DateList)
+            {
+                comboBox_Date.Items.Add(file.Substring(file.LastIndexOf("\\") + 1));
+            }
         }
 
         private void button_Enter_Click(object sender, EventArgs e)
@@ -38,7 +54,7 @@ namespace MOTINOVA_Motor_Factory_Set
 
                 if (System.IO.Directory.Exists(FilePath) == false)
                     System.IO.Directory.CreateDirectory(FilePath);
-                ListFileRefresh(FilePath);
+                ListDate(FilePath);
             }
             else
             {
@@ -68,10 +84,10 @@ namespace MOTINOVA_Motor_Factory_Set
                 //删除选中文件
                 if (MessageBox.Show("确认删除?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                 {
-                    File.Delete(FilePath + "\\" + SelectFile);
+                    File.Delete(FilePath + "\\" + comboBox_Date.Text + "\\" + SelectFile);
                     if (System.IO.Directory.Exists(FilePath) == false)
                         System.IO.Directory.CreateDirectory(FilePath);
-                    ListFileRefresh(FilePath);
+                    ListFileRefresh(FilePath + "\\" + comboBox_Date.Text);
                 }
             }
             catch
@@ -119,7 +135,7 @@ namespace MOTINOVA_Motor_Factory_Set
                     SelectFile = listBox_File.SelectedItem.ToString();
                     richTextBox1.Text += "文件名称:" + SelectFile + "\r\n";
                     //打开选中文件
-                    StreamReader objReader = new StreamReader(FilePath + "\\" + SelectFile);
+                    StreamReader objReader = new StreamReader(FilePath + "\\" + comboBox_Date.Text + "\\" + SelectFile);
                     string sLine = "";
                     ArrayList arrText = new ArrayList();//创建一个动态数组
                     while (sLine != null)
@@ -156,5 +172,10 @@ namespace MOTINOVA_Motor_Factory_Set
                 richTextBox1.Text = "";
             }
         }
+
+        private void comboBox_Date_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            ListFileRefresh(FilePath + "\\" + comboBox_Date.SelectedItem.ToString());
+        }
     }
 }

+ 1 - 0
PortSettings.cs

@@ -90,6 +90,7 @@ namespace MOTINOVA_Motor_Factory_Set
                 });
 
                 ImportForm.buffer.AddRange(buf);//将读取的数据放入buffer中
+                CheckForm.buffer.AddRange(buf);
             }
             catch (Exception ex)
             {

+ 37 - 19
StartForm.Designer.cs

@@ -33,10 +33,11 @@
             this.button_Import = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.button_Mang = new System.Windows.Forms.Button();
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label_Ver = new System.Windows.Forms.Label();
             this.label_NetStatus = new System.Windows.Forms.Label();
+            this.button_Check = new System.Windows.Forms.Button();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -46,7 +47,7 @@
             this.button_Export.Enabled = false;
             this.button_Export.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.button_Export.ForeColor = System.Drawing.Color.White;
-            this.button_Export.Location = new System.Drawing.Point(317, 248);
+            this.button_Export.Location = new System.Drawing.Point(490, 179);
             this.button_Export.Margin = new System.Windows.Forms.Padding(5);
             this.button_Export.Name = "button_Export";
             this.button_Export.Size = new System.Drawing.Size(150, 80);
@@ -61,12 +62,12 @@
             this.button_Import.Enabled = false;
             this.button_Import.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.button_Import.ForeColor = System.Drawing.Color.White;
-            this.button_Import.Location = new System.Drawing.Point(87, 248);
+            this.button_Import.Location = new System.Drawing.Point(144, 179);
             this.button_Import.Margin = new System.Windows.Forms.Padding(5);
             this.button_Import.Name = "button_Import";
             this.button_Import.Size = new System.Drawing.Size(150, 80);
             this.button_Import.TabIndex = 0;
-            this.button_Import.Text = "产模式";
+            this.button_Import.Text = "产模式";
             this.button_Import.UseVisualStyleBackColor = false;
             this.button_Import.Click += new System.EventHandler(this.button_Import_Click);
             // 
@@ -86,33 +87,23 @@
             this.button_Mang.Enabled = false;
             this.button_Mang.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.button_Mang.ForeColor = System.Drawing.Color.White;
-            this.button_Mang.Location = new System.Drawing.Point(547, 248);
+            this.button_Mang.Location = new System.Drawing.Point(490, 294);
             this.button_Mang.Margin = new System.Windows.Forms.Padding(5);
             this.button_Mang.Name = "button_Mang";
             this.button_Mang.Size = new System.Drawing.Size(150, 80);
             this.button_Mang.TabIndex = 0;
-            this.button_Mang.Text = "文件管理";
+            this.button_Mang.Text = "本地管理";
             this.button_Mang.UseVisualStyleBackColor = false;
             this.button_Mang.Click += new System.EventHandler(this.button_Mang_Click);
             // 
-            // pictureBox1
-            // 
-            this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pictureBox1.Image = global::MOTINOVA_Motor_Factory_Set.Properties.Resources.title;
-            this.pictureBox1.Location = new System.Drawing.Point(307, 397);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(170, 25);
-            this.pictureBox1.TabIndex = 1;
-            this.pictureBox1.TabStop = false;
-            // 
             // label2
             // 
             this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
             this.label2.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.White;
-            this.label2.Location = new System.Drawing.Point(0, 0);
+            this.label2.Location = new System.Drawing.Point(-1, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(782, 100);
+            this.label2.Size = new System.Drawing.Size(781, 100);
             this.label2.TabIndex = 3;
             this.label2.Text = "MOTINOVA电机量产测试工具";
             this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -125,7 +116,7 @@
             this.label_Ver.Name = "label_Ver";
             this.label_Ver.Size = new System.Drawing.Size(185, 21);
             this.label_Ver.TabIndex = 2;
-            this.label_Ver.Text = "Ver: V1.2.0 Build Time: ";
+            this.label_Ver.Text = "Ver: V1.2.1 Build Time: ";
             // 
             // label_NetStatus
             // 
@@ -137,12 +128,38 @@
             this.label_NetStatus.TabIndex = 2;
             this.label_NetStatus.Text = "网络连接中……";
             // 
+            // button_Check
+            // 
+            this.button_Check.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(113)))), ((int)(((byte)(185)))));
+            this.button_Check.Enabled = false;
+            this.button_Check.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_Check.ForeColor = System.Drawing.Color.White;
+            this.button_Check.Location = new System.Drawing.Point(144, 294);
+            this.button_Check.Margin = new System.Windows.Forms.Padding(5);
+            this.button_Check.Name = "button_Check";
+            this.button_Check.Size = new System.Drawing.Size(150, 80);
+            this.button_Check.TabIndex = 4;
+            this.button_Check.Text = "检验模式";
+            this.button_Check.UseVisualStyleBackColor = false;
+            this.button_Check.Click += new System.EventHandler(this.button_Check_Click);
+            // 
+            // pictureBox1
+            // 
+            this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
+            this.pictureBox1.Image = global::MOTINOVA_Motor_Factory_Set.Properties.Resources.title;
+            this.pictureBox1.Location = new System.Drawing.Point(304, 434);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(170, 25);
+            this.pictureBox1.TabIndex = 1;
+            this.pictureBox1.TabStop = false;
+            // 
             // StartForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(780, 558);
+            this.Controls.Add(this.button_Check);
             this.Controls.Add(this.label_Ver);
             this.Controls.Add(this.label_NetStatus);
             this.Controls.Add(this.label1);
@@ -178,6 +195,7 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label_Ver;
         public System.Windows.Forms.Label label_NetStatus;
+        private System.Windows.Forms.Button button_Check;
     }
 }
 

+ 80 - 4
StartForm.cs

@@ -6,21 +6,26 @@ using System.Drawing;
 using System.Text;
 using System.Windows.Forms;
 using System.Threading;
+using System.IO;
 
 namespace MOTINOVA_Motor_Factory_Set
 {
     public partial class StartForm : Form
     {
         public static ftp myFtp = new ftp();
+        public static server_cfg myServerCfg = new server_cfg();
         public static ImportForm ImportForm1 = new ImportForm();
         public static ExportForm ExportForm1 = new ExportForm();
         public static ManageForm ManageForm1 = new ManageForm();
+        public static CheckForm CheckForm1 = new CheckForm();
 
         public StartForm()
         {
             InitializeComponent();
+            //配置网络服务参数
+            myServerCfg.MyServerOption(Directory.GetCurrentDirectory() + "\\Server");
             //配置FTP服务器
-            myFtp.FtpOption("192.168.1.74", "21", "factory_test", "ttium");
+            myFtp.FtpOption(myServerCfg.IP, myServerCfg.Port, myServerCfg.User, myServerCfg.PassWd);
             //创建线程,定时检测网络连接状态
             Thread th = new Thread(NetworkCheck);
             th.IsBackground = true;
@@ -40,6 +45,22 @@ namespace MOTINOVA_Motor_Factory_Set
                     label_NetStatus.ForeColor = Color.Green;
                     ImportForm1.label_NetStatus.Text = "网络连接成功";
                     ImportForm1.label_NetStatus.BackColor = Color.Green;
+                    CheckForm1.label_NetStatus.Text = "网络连接成功";
+                    CheckForm1.label_NetStatus.BackColor = Color.Green;
+                    if (myServerCfg.Local == "DISABLE")//不允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Checked = false;
+                        CheckForm1.checkBox_LocalFile.Enabled = false;
+                        ImportForm1.checkBox_LocalFile.Checked = false;
+                        ImportForm1.checkBox_LocalFile.Enabled = false;
+                    }
+                    else//允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Checked = false;
+                        CheckForm1.checkBox_LocalFile.Enabled = true;
+                        ImportForm1.checkBox_LocalFile.Checked = true;
+                        ImportForm1.checkBox_LocalFile.Enabled = false;
+                    }
                     myFtp.IsNetConnected = true;
                 }
                 else//服务器连接失败
@@ -48,6 +69,22 @@ namespace MOTINOVA_Motor_Factory_Set
                     label_NetStatus.ForeColor = Color.Red;
                     ImportForm1.label_NetStatus.Text = "网络连接失败";
                     ImportForm1.label_NetStatus.BackColor = Color.Red;
+                    CheckForm1.label_NetStatus.Text = "网络连接失败";
+                    CheckForm1.label_NetStatus.BackColor = Color.Red;
+                    if (myServerCfg.Local == "DISABLE")//不允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Checked = false;
+                        CheckForm1.checkBox_LocalFile.Enabled = false;
+                        ImportForm1.checkBox_LocalFile.Checked = false;
+                        ImportForm1.checkBox_LocalFile.Enabled = false;
+                    }
+                    else//允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Checked = true;
+                        CheckForm1.checkBox_LocalFile.Enabled = false;
+                        ImportForm1.checkBox_LocalFile.Checked = true;
+                        ImportForm1.checkBox_LocalFile.Enabled = false;
+                    }
                     myFtp.IsNetConnected = false;
                     if (MessageBox.Show("网络连接失败,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                     {
@@ -57,8 +94,9 @@ namespace MOTINOVA_Motor_Factory_Set
                 button_Export.Enabled = true;
                 button_Import.Enabled = true;
                 button_Mang.Enabled = true;
+                button_Check.Enabled = true;
             }));
-            //创建定时器,定时检查网络
+            //创建定时器,定时3s检查网络
             System.Timers.Timer timer_CheckNet = new System.Timers.Timer();
             timer_CheckNet.Enabled = true;
             timer_CheckNet.Interval = 3000;
@@ -80,6 +118,19 @@ namespace MOTINOVA_Motor_Factory_Set
                     label_NetStatus.ForeColor = Color.Green;
                     ImportForm1.label_NetStatus.Text = "网络连接成功";
                     ImportForm1.label_NetStatus.BackColor = Color.Green;
+                    CheckForm1.label_NetStatus.Text = "网络连接成功";
+                    CheckForm1.label_NetStatus.BackColor = Color.Green;
+                    if (myServerCfg.Local == "DISABLE")//不允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Enabled = false;
+                        ImportForm1.checkBox_LocalFile.Enabled = false;
+                    }
+                    else//允许本地文件
+                    {
+                        CheckForm1.checkBox_LocalFile.Enabled = true;
+                        ImportForm1.checkBox_LocalFile.Enabled = true;
+                    }
+ 
                     myFtp.IsNetConnected = true;
                 }
                 else//服务器连接失败
@@ -88,6 +139,12 @@ namespace MOTINOVA_Motor_Factory_Set
                     label_NetStatus.ForeColor = Color.Red;
                     ImportForm1.label_NetStatus.Text = "网络连接失败";
                     ImportForm1.label_NetStatus.BackColor = Color.Red;
+                    ImportForm1.checkBox_LocalFile.Checked = true;
+                    ImportForm1.checkBox_LocalFile.Enabled = false;
+                    CheckForm1.label_NetStatus.Text = "网络连接失败";
+                    CheckForm1.label_NetStatus.BackColor = Color.Red;
+                    CheckForm1.checkBox_LocalFile.Checked = true;
+                    CheckForm1.checkBox_LocalFile.Enabled = false;
                     myFtp.IsNetConnected = false;
                 }
             }));
@@ -96,10 +153,16 @@ namespace MOTINOVA_Motor_Factory_Set
         
         private void button_Import_Click(object sender, EventArgs e)
         {
-            ImportForm1.ShowDialog();
+            if (myServerCfg.Local == "DISABLE")//不允许本地文件
+            {
+                MessageBox.Show("请检查网络,或联系管理员!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            }
+            else
+            {
+                ImportForm1.ShowDialog();
+            }
         }
 
-        
         private void button_Export_Click(object sender, EventArgs e)
         {
             ExportForm1.ShowDialog();
@@ -110,6 +173,18 @@ namespace MOTINOVA_Motor_Factory_Set
             ManageForm1.ShowDialog();
         }
 
+        private void button_Check_Click(object sender, EventArgs e)
+        {
+            if (myServerCfg.Local == "DISABLE")//不允许本地文件
+            {
+                MessageBox.Show("请检查网络,或联系管理员!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            }
+            else
+            {
+                CheckForm1.ShowDialog();
+            }
+        }
+
         private void StartForm_Load(object sender, EventArgs e)
         {
             //显示编译时间
@@ -121,5 +196,6 @@ namespace MOTINOVA_Motor_Factory_Set
         {
 
         }
+
     }
 }

BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.exe


BIN
bin/Debug/MOTINOVA_Motor_Factory_Set.pdb


+ 1 - 1
bin/Debug/SerialNum

@@ -1,2 +1,2 @@
 流水号:
-109
+45

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


+ 0 - 62
bin/Debug/cfg/VS7500_TC000000_V2.1.9.0.0_20211012_V1.0.1_20191112_2021-10-27-110904.ttcfg

@@ -1,62 +0,0 @@
-[用户参数1]
-启动模式,2
-停机时间,100
-限速值,25
-下降速度,3
-前飞,14
-后飞,9
-限流,15
-温度预警,95
-温度保护,125
-码表,85,有
-轮胎周长,219
-系列号,1
-ECO增益,100
-ECO加速,100
-NORM增益,100
-NORM加速,100
-SPORT增益,100
-SPORT加速,100
-TURBO增益,100
-TURBO加速,100
-SMART增益,100
-SMART加速,100
-车速级数,1
-踏频启动,2
-指拨模式,85,不支持
-速度信号来源,85,传感器
-周长微调,0
-低压保护,3100
-推行限速,60
-推行转速,135
-
-[用户参数2]
-姿态传感器,85,不支持
-俯仰角零偏,0
-横滚角零偏,0
-尾灯模式,2
-前灯电压,12,12V
-尾灯电压,12,12V
-
-[马达参数]
-额定功率,250
-额定转速,1200
-定子电阻,10
-定子Lq,10
-定子Ld,10
-反电动势,36000
-额定电压,36
-
-[其它信息]
-生产商,TTIUM
-生产地,WUHAN
-生产日期,20200901
-校验密钥,AVONITOM
-信息1,
-信息2,
-信息3,
-
-[测试阈值]
-空载电流,1000
-车速,150
-指拨转速,1200

+ 38 - 2
ftp.cs

@@ -28,11 +28,11 @@ namespace MOTINOVA_Motor_Factory_Set
         {
             try
             {
-                Uri uri = new Uri(string.Format("ftp://{0}/{1}", serverIP, "//MOTINOVA_MC_Factory_Set"));
+                Uri uri = new Uri(string.Format("ftp://{0}/{1}", serverIP, "/"));
                 FtpWebRequest ftpRequest = (FtpWebRequest)FtpWebRequest.Create(uri);
                 ftpRequest.Credentials = new NetworkCredential(userId, passWord);
                 ftpRequest.Method = WebRequestMethods.Ftp.PrintWorkingDirectory;
-                ftpRequest.Timeout = 3000;
+                ftpRequest.Timeout = 2000;
                 FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
                 ftpResponse.Close();
                 IsNetConnected = true;
@@ -200,6 +200,42 @@ namespace MOTINOVA_Motor_Factory_Set
             }
         }
 
+        /// <summary>
+        /// 获得文件列表
+        /// </summary>
+        /// <param name="path"></param>
+        /// <returns></returns>
+        /// 
+        public string[] GetFileNameList(string dirName)
+        {
+            string[] drectory = GetFileList(dirName, WebRequestMethods.Ftp.ListDirectoryDetails);
+            List<string> strList = new List<string>();
+            if (drectory.Length > 0)
+            {
+                foreach (string str in drectory)
+                {
+                    if (str.Trim().Length == 0)
+                        continue;
+                    //会有两种格式的详细信息返回
+                    //一种包含<DIR>
+                    //一种第一个字符串是drwxerwxx这样的权限操作符号
+                    //现在写代码包容两种格式的字符串
+                    if (!str.Trim().Contains("<DIR>"))
+                    {
+                        strList.Add(str.Substring(str.LastIndexOf(" ") + 1).Trim()) ;
+                    }
+                    else
+                    {
+                        if (str.Trim().Substring(0, 1).ToUpper() != "D")
+                        {
+                            strList.Add(str.Substring(str.LastIndexOf(" ") + 1).Trim()) ;
+                        }
+                    }
+                }
+            }
+            return strList.ToArray();
+        }
+
         /// <summary>
         /// 获得文件明晰
         /// </summary>

BIN
obj/Debug/DesignTimeResolveAssemblyReferences.cache


+ 1 - 1
obj/Debug/MOTINOVA_Motor_Factory_Set.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-6949aea4cbcf636a2db4db6e76969f5240bfb8db
+aee015634c95a98a7a5555f2a5296991ed41ab41

+ 1 - 0
obj/Debug/MOTINOVA_Motor_Factory_Set.csproj.FileListAbsolute.txt

@@ -16,3 +16,4 @@ D:\SoftDesign\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\obj\Debug\MO
 D:\SoftDesign\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\obj\Debug\MOTINOVA_Motor_Factory_Set.application
 D:\SoftDesign\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\obj\Debug\MOTINOVA_Motor_Factory_Set.exe
 D:\SoftDesign\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\obj\Debug\MOTINOVA_Motor_Factory_Set.pdb
+D:\SoftDesign\MOTINOVA_Motor_Factory_Set\MOTINOVA_Motor_Factory_Set\obj\Debug\MOTINOVA_Motor_Factory_Set.CheckForm.resources

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


BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.csprojAssemblyReference.cache


BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.exe


BIN
obj/Debug/MOTINOVA_Motor_Factory_Set.pdb