浏览代码

设备测试内容修改

callm 4 年之前
父节点
当前提交
427494dfd7

+ 26 - 1
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.Designer.cs

@@ -54,6 +54,8 @@ namespace UAS_MES_NEW.Make
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.label6 = new System.Windows.Forms.Label();
+            this.WatchPath = new System.Windows.Forms.TextBox();
             ((System.ComponentModel.ISupportInitialize)(this.CheckItemDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -262,7 +264,7 @@ namespace UAS_MES_NEW.Make
             // ReSet
             // 
             this.ReSet.AutoSize = true;
-            this.ReSet.Location = new System.Drawing.Point(1102, 788);
+            this.ReSet.Location = new System.Drawing.Point(999, 787);
             this.ReSet.Name = "ReSet";
             this.ReSet.Size = new System.Drawing.Size(186, 28);
             this.ReSet.TabIndex = 34;
@@ -306,11 +308,32 @@ namespace UAS_MES_NEW.Make
             this.OperateResult.TabIndex = 27;
             this.OperateResult.Text = "";
             // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(1261, 783);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(146, 41);
+            this.label6.TabIndex = 37;
+            this.label6.Text = "监控路径";
+            // 
+            // WatchPath
+            // 
+            this.WatchPath.Location = new System.Drawing.Point(1431, 787);
+            this.WatchPath.Name = "WatchPath";
+            this.WatchPath.Size = new System.Drawing.Size(258, 35);
+            this.WatchPath.TabIndex = 36;
+            this.WatchPath.Text = "/storage/emulated/0/elink/";
+            // 
             // Make_GetTestFileData
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1772, 866);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.WatchPath);
             this.Controls.Add(this.ReSet);
             this.Controls.Add(this.CheckItemDGV);
             this.Controls.Add(this.StepCount);
@@ -364,5 +387,7 @@ namespace UAS_MES_NEW.Make
         private System.Windows.Forms.DataGridViewTextBoxColumn std_badcode;
         private ReSetCheckBox ReSet;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.TextBox WatchPath;
     }
 }

+ 11 - 8
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.cs

@@ -68,25 +68,27 @@ namespace UAS_MES_NEW.Make
                 {
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     {
-                        string ms_prodcode = dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='"+oMsid+"'").ToString();
+                        string ms_prodcode = dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsid + "'").ToString();
                         DataTable dt = new DataTable();
-                        BaseUtil.OpenCSVFile(ref dt, @"C:\Users\callm\Desktop\品网\2019_04_04_19_59_18_788.csv");
+                        BaseUtil.GetDataFromDevice("GETFILE", WatchPath.Text + sncode.Text + ".csv");
+                        BaseUtil.OpenCSVFile(ref dt, Application.StartupPath + @"\" + sncode.Text + ".csv");
                         //移除标题行
                         dt.Rows.RemoveAt(0);
                         //设置列名绑定数据
                         dt.Columns[0].ColumnName = "std_class";
-                        dt.Columns[1].ColumnName = "std_testtimes";
-                        dt.Columns[2].ColumnName = "std_testresult";
-                        dt.Columns[3].ColumnName = "std_badcode";
+                        //dt.Columns[1].ColumnName = "std_testtimes";
+                        dt.Columns[1].ColumnName = "std_testresult";
+                        //dt.Columns[3].ColumnName = "std_badcode";
                         CheckItemDGV.DataSource = dt;
                         bool Result = true;
                         for (int i = 0; i < dt.Rows.Count; i++)
                         {
-                            if (dt.Rows[i]["std_testresult"].ToString() != "OK")
+                            if (dt.Rows[i]["std_testresult"].ToString() != "OK" || dt.Rows[i]["std_testresult"].ToString() == "NOTEST")
                             {
                                 Result = false;
                             }
-                            dh.ExecuteSql("insert into STEPTESTDETAIL(std_id,std_sn,std_indate,std_class,std_testtimes,std_testresult,std_badcode) values(STEPTESTDETAIL_seq.nextval,'" + sncode.Text + "',sysdate,'" + dt.Rows[i]["std_class"].ToString() + "','" + dt.Rows[i]["std_testtimes"].ToString() + "','" + dt.Rows[i]["std_testresult"].ToString() + "','" + dt.Rows[i]["std_badcode"].ToString() + "')", "insert");
+                            //dh.ExecuteSql("insert into STEPTESTDETAIL(std_id,std_sn,std_indate,std_class,std_testtimes,std_testresult,std_badcode) values(STEPTESTDETAIL_seq.nextval,'" + sncode.Text + "',sysdate,'" + dt.Rows[i]["std_class"].ToString() + "','" + dt.Rows[i]["std_testtimes"].ToString() + "','" + dt.Rows[i]["std_testresult"].ToString() + "','" + dt.Rows[i]["std_badcode"].ToString() + "')", "insert");
+                            dh.ExecuteSql("insert into STEPTESTDETAIL(std_id,std_sn,std_indate,std_class,std_testtimes,std_testresult,std_badcode) values(STEPTESTDETAIL_seq.nextval,'" + sncode.Text + "',sysdate,'" + dt.Rows[i]["std_class"].ToString() + "','','" + dt.Rows[i]["std_testresult"].ToString() + "','')", "insert");
                         }
                         if (Result)
                         {
@@ -104,7 +106,7 @@ namespace UAS_MES_NEW.Make
                                 BaseUtil.SetFormValue(Controls, dt);
                                 //将SN,时间,结果记录在页面
                                 //记录日志
-                                ftp.UpLoadFile(@"C:\Users\callm\Desktop\品网\", "2019_04_04_19_59_18_788.csv", "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + ms_prodcode + "/");
+                                //ftp.UpLoadFile(Application.StartupPath, sncode.Text + ".csv", "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + ms_prodcode + "/");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "标签核对", "参数核对成功", sncode.Text, "");
                                 //SN核对成功
                                 //>> 请输入SN
@@ -125,6 +127,7 @@ namespace UAS_MES_NEW.Make
                         }
                         else
                         {
+                            //ftp.UpLoadFile(Application.StartupPath, sncode.Text + ".csv", "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/" + ms_prodcode + "/");
                             OperateResult.AppendText(">>序列号" + sncode.Text + "测试不通过\n", Color.Red, sncode);
                         }
                     }

+ 54 - 18
UAS_MES_PW/FunctionCode/Make/Make_ReadWriteInfo.Designer.cs

@@ -40,15 +40,19 @@
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.CheckItemDGV = new System.Windows.Forms.DataGridView();
+            this.ms_item = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ms_info = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ms_item = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ms_info = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.FileWatcher = new System.IO.FileSystemWatcher();
+            this.WatchPath = new System.Windows.Forms.TextBox();
+            this.label6 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.CheckItemDGV)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.FileWatcher)).BeginInit();
             this.SuspendLayout();
             // 
             // pr_detail
@@ -65,7 +69,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(64, 788);
+            this.label10.Location = new System.Drawing.Point(64, 782);
             this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(53, 35);
@@ -181,6 +185,24 @@
             this.CheckItemDGV.TabIndex = 33;
             this.CheckItemDGV.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.CheckItemDGV_CellPainting);
             // 
+            // ms_item
+            // 
+            this.ms_item.DataPropertyName = "ms_item";
+            this.ms_item.HeaderText = "检测项";
+            this.ms_item.MinimumWidth = 130;
+            this.ms_item.Name = "ms_item";
+            this.ms_item.ReadOnly = true;
+            this.ms_item.Width = 150;
+            // 
+            // ms_info
+            // 
+            this.ms_info.DataPropertyName = "ms_info";
+            this.ms_info.HeaderText = "参数值";
+            this.ms_info.MinimumWidth = 300;
+            this.ms_info.Name = "ms_info";
+            this.ms_info.ReadOnly = true;
+            this.ms_info.Width = 468;
+            // 
             // dataGridViewTextBoxColumn1
             // 
             this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
@@ -215,7 +237,7 @@
             this.sncode.AllPower = null;
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(144, 788);
+            this.sncode.Location = new System.Drawing.Point(144, 782);
             this.sncode.Margin = new System.Windows.Forms.Padding(4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
@@ -244,29 +266,39 @@
             this.dataGridViewTextBoxColumn3.MinimumWidth = 460;
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             // 
-            // ms_item
+            // FileWatcher
             // 
-            this.ms_item.DataPropertyName = "ms_item";
-            this.ms_item.HeaderText = "检测项";
-            this.ms_item.MinimumWidth = 130;
-            this.ms_item.Name = "ms_item";
-            this.ms_item.ReadOnly = true;
-            this.ms_item.Width = 150;
+            this.FileWatcher.EnableRaisingEvents = true;
+            this.FileWatcher.Filter = "*.log";
+            this.FileWatcher.IncludeSubdirectories = true;
+            this.FileWatcher.SynchronizingObject = this;
             // 
-            // ms_info
+            // WatchPath
             // 
-            this.ms_info.DataPropertyName = "ms_info";
-            this.ms_info.HeaderText = "参数值";
-            this.ms_info.MinimumWidth = 300;
-            this.ms_info.Name = "ms_info";
-            this.ms_info.ReadOnly = true;
-            this.ms_info.Width = 468;
+            this.WatchPath.Location = new System.Drawing.Point(927, 782);
+            this.WatchPath.Name = "WatchPath";
+            this.WatchPath.Size = new System.Drawing.Size(258, 35);
+            this.WatchPath.TabIndex = 34;
+            this.WatchPath.Text = "C:\\SNWriter_LOG";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(757, 778);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(146, 41);
+            this.label6.TabIndex = 35;
+            this.label6.Text = "监控路径";
             // 
             // Make_ReadWriteInfo
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1772, 866);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.WatchPath);
             this.Controls.Add(this.CheckItemDGV);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.pr_detail);
@@ -289,6 +321,7 @@
             this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
             this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.CheckItemDGV)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.FileWatcher)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -315,5 +348,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_item;
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_info;
+        private System.IO.FileSystemWatcher FileWatcher;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.TextBox WatchPath;
     }
 }

+ 24 - 1
UAS_MES_PW/FunctionCode/Make/Make_ReadWriteInfo.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
@@ -45,6 +46,11 @@ namespace UAS_MES_NEW.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+
+            FileWatcher.Path = WatchPath.Text;
+            FileWatcher.Filter = "*.log";
+            FileWatcher.EnableRaisingEvents = true;
+            FileWatcher.Created += new FileSystemEventHandler(Watcher_Created);
         }
 
         private void Make_LabelCheck_SizeChanged(object sender, EventArgs e)
@@ -52,7 +58,24 @@ namespace UAS_MES_NEW.Make
             asc.controlAutoSize(this);
         }
 
+        string FullPath = "";
 
+        private void Watcher_Created(object sender, FileSystemEventArgs e)
+        {
+            string BARCODE = "";
+            string MAC = "";
+            string BT = "";
+            string IMEI0 = "";
+            string IMEI1 = "";
+            if (e.FullPath.Contains("MetaCore"))
+            {
+                return;
+            }
+            BaseUtil.GetWriteInfo(e.FullPath, out BARCODE, out MAC, out BT, out IMEI0, out IMEI1);
+            FullPath = e.FullPath;
+            sncode.Text = BARCODE;
+            sncode_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+        }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
         {
@@ -74,7 +97,7 @@ namespace UAS_MES_NEW.Make
                         string BT = "";
                         string IMEI0 = "";
                         string IMEI1 = "";
-                        BaseUtil.GetWriteInfo(@"C:\Users\callm\Desktop\品网\SN Writer(1).log", out BARCODE, out MAC, out BT, out IMEI0, out IMEI1);
+                        BaseUtil.GetWriteInfo(FullPath, out BARCODE, out MAC, out BT, out IMEI0, out IMEI1);
                         DataTable dt = new DataTable();
                         dt.Columns.Add("ms_item");
                         dt.Columns.Add("ms_info");

+ 3 - 0
UAS_MES_PW/FunctionCode/Make/Make_ReadWriteInfo.resx

@@ -123,4 +123,7 @@
   <metadata name="ms_info.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="FileWatcher.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 40 - 5
UAS_MES_PW/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -54,7 +54,7 @@ namespace UAS_MES_NEW.Make
             this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.AutoBadCode = new ReSetCheckBox();
+            this.AutoBadCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.ReSetCheckBox();
             this.ma_qty_label = new System.Windows.Forms.Label();
             this.ma_prodcode_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
@@ -96,6 +96,8 @@ namespace UAS_MES_NEW.Make
             this.bc_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_groupcode = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.ms_sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.WriteSoftWare = new UAS_MES_NEW.CustomControl.CustomCheckBox.ReSetCheckBox();
+            this.SoftWarePath = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
             this.SuspendLayout();
@@ -579,7 +581,7 @@ namespace UAS_MES_NEW.Make
             this.Lock_label.AutoSize = true;
             this.Lock_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Lock_label.ForeColor = System.Drawing.Color.Red;
-            this.Lock_label.Location = new System.Drawing.Point(1138, 1000);
+            this.Lock_label.Location = new System.Drawing.Point(575, 298);
             this.Lock_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Lock_label.Name = "Lock_label";
             this.Lock_label.Size = new System.Drawing.Size(250, 41);
@@ -766,7 +768,7 @@ namespace UAS_MES_NEW.Make
             this.CleanInfo.DownImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.DownImage")));
             this.CleanInfo.Image = ((System.Drawing.Image)(resources.GetObject("CleanInfo.Image")));
             this.CleanInfo.IsShowBorder = true;
-            this.CleanInfo.Location = new System.Drawing.Point(1436, 994);
+            this.CleanInfo.Location = new System.Drawing.Point(873, 292);
             this.CleanInfo.Margin = new System.Windows.Forms.Padding(6);
             this.CleanInfo.MoveImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.MoveImage")));
             this.CleanInfo.Name = "CleanInfo";
@@ -776,6 +778,7 @@ namespace UAS_MES_NEW.Make
             this.CleanInfo.TabIndex = 47;
             this.CleanInfo.Text = "清除内容";
             this.CleanInfo.UseVisualStyleBackColor = true;
+            this.CleanInfo.Visible = false;
             this.CleanInfo.Click += new System.EventHandler(this.CleanInfo_Click);
             // 
             // ChooseedReject
@@ -845,12 +848,42 @@ namespace UAS_MES_NEW.Make
             this.ms_sncode.Tag = "IfRead";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
             // 
+            // WriteSoftWare
+            // 
+            this.WriteSoftWare.AutoSize = true;
+            this.WriteSoftWare.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.WriteSoftWare.Location = new System.Drawing.Point(1123, 1006);
+            this.WriteSoftWare.Margin = new System.Windows.Forms.Padding(4);
+            this.WriteSoftWare.Name = "WriteSoftWare";
+            this.WriteSoftWare.Size = new System.Drawing.Size(142, 35);
+            this.WriteSoftWare.TabIndex = 195;
+            this.WriteSoftWare.Text = "烧入软件";
+            this.WriteSoftWare.UseVisualStyleBackColor = true;
+            // 
+            // SoftWarePath
+            // 
+            this.SoftWarePath.AllPower = null;
+            this.SoftWarePath.BackColor = System.Drawing.Color.White;
+            this.SoftWarePath.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SoftWarePath.ID = null;
+            this.SoftWarePath.Location = new System.Drawing.Point(1275, 1001);
+            this.SoftWarePath.Margin = new System.Windows.Forms.Padding(6);
+            this.SoftWarePath.Name = "SoftWarePath";
+            this.SoftWarePath.Power = null;
+            this.SoftWarePath.Size = new System.Drawing.Size(388, 40);
+            this.SoftWarePath.Str = null;
+            this.SoftWarePath.Str1 = null;
+            this.SoftWarePath.Str2 = null;
+            this.SoftWarePath.TabIndex = 196;
+            // 
             // Make_TestCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(1724, 1070);
+            this.Controls.Add(this.SoftWarePath);
+            this.Controls.Add(this.WriteSoftWare);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.pr_sendchecktype);
             this.Controls.Add(this.ma_salecode);
@@ -901,10 +934,10 @@ namespace UAS_MES_NEW.Make
             this.Load += new System.EventHandler(this.TestCollection_Load);
             this.SizeChanged += new System.EventHandler(this.测试采集_SizeChanged);
             this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Make_TestCollection_KeyDown);
-            this.panel1.ResumeLayout(true);
+            this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -974,5 +1007,7 @@ namespace UAS_MES_NEW.Make
         private System.Windows.Forms.Label ma_salecode;
         private System.Windows.Forms.Label pr_sendchecktype;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private ReSetCheckBox WriteSoftWare;
+        private CustomControl.TextBoxWithIcon.EnterTextBox SoftWarePath;
     }
 }

+ 71 - 17
UAS_MES_PW/PublicMethod/BaseUtil.cs

@@ -1394,12 +1394,20 @@ namespace UAS_MES_NEW.PublicMethod
                 case "IMEI":
                     p.StartInfo.Arguments = " shell \n su \n service call iphonesubinfo 1";
                     p.Start();
-                    string IMEI = p.StandardOutput.ReadToEnd();
-                    foreach (Match item in Regex.Matches(IMEI, "'\\S+"))
+                    try
+                    {
+                        p.StandardInput.Close();
+                        string IMEI = p.StandardOutput.ReadToEnd();
+                        foreach (Match item in Regex.Matches(IMEI, "'\\S+"))
+                        {
+                            value += item.Value.Replace(".", "").Replace("'", "").Replace(")", "");
+                        }
+                        p.Close();
+                    }
+                    catch (Exception ex)
                     {
-                        value += item.Value.Replace(".", "").Replace("'", "").Replace(")", "");
+                        Console.WriteLine(ex.Message);
                     }
-                    p.Close();
                     break;
                 case "POWER":
                     p.StartInfo.Arguments = "  shell dumpsys battery";
@@ -1456,6 +1464,39 @@ namespace UAS_MES_NEW.PublicMethod
             return value.Trim();
         }
 
+        public static string GetDataFromDevice(string Param, string Path)
+        {
+            String cmd = System.Windows.Forms.Application.StartupPath + "\\adb.exe";
+            Process p = new Process();
+            p.StartInfo = new System.Diagnostics.ProcessStartInfo();
+            p.StartInfo.FileName = cmd;//设定程序名
+            p.StartInfo.UseShellExecute = false; //关闭shell的使用
+            p.StartInfo.RedirectStandardInput = true; //重定向标准输入
+            p.StartInfo.RedirectStandardOutput = true; //重定向标准输出
+            p.StartInfo.RedirectStandardError = true; //重定向错误输出
+            p.StartInfo.CreateNoWindow = true;//设置不显示窗口
+            string value = "";
+            switch (Param)
+            {
+                case "GETFILE":
+                    p.StartInfo.Arguments = " pull " + Path;
+                    p.Start();
+                    value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
+                    p.Close();
+                    break;
+                case "INSTALL":
+                    p.StartInfo.Arguments = " install  " + Path;
+                    p.Start();
+                    value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
+                    p.Close();
+                    break;
+                default:
+                    break;
+            }
+            Console.WriteLine(Param + " : " + value.Trim());
+            return value.Trim();
+        }
+
         public static void GetWriteInfo(string FilePath, out string BARCODE, out string MAC, out string BT, out string IMEI0, out string IMEI1)
         {
             MAC = "";
@@ -1464,18 +1505,30 @@ namespace UAS_MES_NEW.PublicMethod
             IMEI1 = "";
             BARCODE = "";
             string txt = "";
-            StreamReader sr = new StreamReader(FilePath);
-
-            while (!sr.EndOfStream)
+        
+            while (true)
             {
-                string str = sr.ReadLine().ToUpper();
-                txt += str + "\n";
+                try
+                {
+                    StreamReader sr = new StreamReader(FilePath);
+                    while (!sr.EndOfStream)
+                    {
+                        string str = sr.ReadLine().ToUpper();
+                        txt += str + "\n";
+                    }
+                    IMEI0 = Regex.Match(txt, "IMEI[0] = \\S[0-9]{15}\\S").Value.Replace("IMEI[", "").Replace("]", "");
+                    IMEI1 = Regex.Match(txt, "IMEI[0] = \\S[0-9]{15}\\S").Value.Replace("IMEI[", "").Replace("]", "");
+                    MAC = Regex.Match(txt, "WIFIADDRESS = \\[\\S+\\]").Value.Replace("WIFIADDRESS = [", "").Replace("]", "").Replace(":", "");
+                    BT = Regex.Match(txt, "BTADDRESS = \\[\\S+\\]").Value.Replace("BTADDRESS = [", "").Replace("]", "").Replace(":", "");
+                    BARCODE = Regex.Match(txt, "BARCODE = \\[\\S+\\]").Value.Replace("BARCODE = [", "").Replace("]", "").Replace(":", "");
+                    break;
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e.Message);
+                    Thread.Sleep(1000);
+                }
             }
-            IMEI0 = Regex.Match(txt, "IMEI[0] = \\S[0-9]{15}\\S").Value.Replace("IMEI[", "").Replace("]", "");
-            IMEI1 = Regex.Match(txt, "IMEI[0] = \\S[0-9]{15}\\S").Value.Replace("IMEI[", "").Replace("]", "");
-            MAC = Regex.Match(txt, "WIFIADDRESS = \\[\\S+\\]").Value.Replace("WIFIADDRESS = [", "").Replace("]", "").Replace(":", "");
-            BT = Regex.Match(txt, "BTADDRESS = \\[\\S+\\]").Value.Replace("BTADDRESS = [", "").Replace("]", "").Replace(":", "");
-            BARCODE = Regex.Match(txt, "BARCODE = \\[\\S+\\]").Value.Replace("BARCODE = [", "").Replace("]", "").Replace(":", "");
         }
 
         public static bool OpenCSVFile(ref DataTable mycsvdt, string filepath)
@@ -1517,13 +1570,14 @@ namespace UAS_MES_NEW.PublicMethod
                     {
                         mydr[i] = aryline[i];
                     }
-                    if(mydr[0].ToString()!="")
-                    mycsvdt.Rows.Add(mydr);
+                    if (mydr[0].ToString() != "")
+                        mycsvdt.Rows.Add(mydr);
                 }
                 return true;
             }
-            catch (Exception)
+            catch (Exception ex)
             {
+                Console.WriteLine(ex.Message);
                 return false;
             }
         }

+ 21 - 0
UAS_MES_PW/PublicMethod/ftpOperater.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Net;
 using System.Text;
+using System.Threading;
 using System.Windows.Forms;
 
 namespace UAS_MES_NEW.PublicMethod
@@ -74,10 +75,30 @@ namespace UAS_MES_NEW.PublicMethod
                 }
                 fs.Close();
             }
+            Thread.Sleep(1000);
             File.Delete(filepath + "/" + filename);
         }
+
+        private static void BeginWriteCallBack(IAsyncResult ar)
+        {
+            MemoryStream stream = ar.AsyncState as MemoryStream;
+            if (stream == null) return;
+            byte[] bytes = stream.ToArray();
+            stream.EndWrite(ar);
+            string str = Encoding.UTF8.GetString(bytes);
+            Console.WriteLine(str);
+
+        }
         #endregion
 
+        public delegate string AsyncMethodCaller(int callDuration, out int threadId);
+
+        private void UploadFileContent() {
+
+
+        }
+
+
 
         //public void UpLoadFile(string filepath, string filename, string savepath)
         //{