Browse Source

项目文件提交

章政 8 years ago
parent
commit
7c14dfbe35
3 changed files with 21 additions and 5 deletions
  1. 1 1
      UAS_AutoPast/BaseUtil.cs
  2. 3 3
      UAS_AutoPast/Form1.Designer.cs
  3. 17 1
      UAS_AutoPast/Form1.cs

+ 1 - 1
UAS_AutoPast/BaseUtil.cs

@@ -5,7 +5,7 @@ namespace UAS_AutoPast
 {
     class BaseUtil
     {
-        static void CreateXml(string iSN, string iTestResult)
+        public static void CreateXml(string iSN, string iTestResult)
         {
             //创建XML文档
             FileStream fcaches = new FileStream(iSN + ".xml", FileMode.OpenOrCreate, FileAccess.ReadWrite);

+ 3 - 3
UAS_AutoPast/Form1.Designer.cs

@@ -80,7 +80,7 @@
             // 
             // Start
             // 
-            this.Start.Location = new System.Drawing.Point(148, 215);
+            this.Start.Location = new System.Drawing.Point(137, 197);
             this.Start.Name = "Start";
             this.Start.Size = new System.Drawing.Size(75, 37);
             this.Start.TabIndex = 4;
@@ -90,7 +90,7 @@
             // 
             // Stop
             // 
-            this.Stop.Location = new System.Drawing.Point(265, 215);
+            this.Stop.Location = new System.Drawing.Point(254, 197);
             this.Stop.Name = "Stop";
             this.Stop.Size = new System.Drawing.Size(75, 37);
             this.Stop.TabIndex = 5;
@@ -129,7 +129,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(468, 302);
+            this.ClientSize = new System.Drawing.Size(468, 267);
             this.Controls.Add(this.Status_label);
             this.Controls.Add(this.CollectTime);
             this.Controls.Add(this.CollectTime_label);

+ 17 - 1
UAS_AutoPast/Form1.cs

@@ -8,7 +8,7 @@ namespace UAS_AutoPast
     public partial class Form1 : Form
     {
         MESHelper helper;
-         
+
         DataHelper dh;
 
         List<string> Data = new List<string>();
@@ -41,6 +41,14 @@ namespace UAS_AutoPast
             if (StartCount)
             {
                 SecondCount = SecondCount + 1;
+                if (SecondCount == CollectTime.Value)
+                {
+                    //停止计数
+                    StartCount = false;
+                    //重置采集时长
+                    SecondCount = 0;
+                    CreateLocalFile();
+                }
             }
         }
 
@@ -72,5 +80,13 @@ namespace UAS_AutoPast
             AutoPastTimer.Stop();
             Status_label.Text = "未开始";
         }
+
+        private void CreateLocalFile()
+        {
+            for (int i = 0; i < Data.Count; i++)
+            {
+                BaseUtil.CreateXml(Data[i], "OK");
+            }
+        }
     }
 }