Browse Source

老化数据上传

callm 1 year ago
parent
commit
968f31d11e
2 changed files with 14 additions and 11 deletions
  1. 1 1
      FileWatcher/AutoAnalysisDevice.Designer.cs
  2. 13 10
      FileWatcher/AutoAnalysisDevice.cs

+ 1 - 1
FileWatcher/AutoAnalysisDevice.Designer.cs

@@ -209,7 +209,7 @@
             // 
             // Timer
             // 
-            this.Timer.Interval = 10000;
+            this.Timer.Interval = 60000;
             this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
             // 
             // Device

+ 13 - 10
FileWatcher/AutoAnalysisDevice.cs

@@ -90,7 +90,7 @@ namespace FileWatcher
             InitDB = new Thread(ConnectDB);
             //添加监控事件
             XmlWatcher.Changed += new FileSystemEventHandler(XmlWatcher_Created);
-            ATEFile.Changed += new FileSystemEventHandler(XmlWatcher_Created);
+            //ATEFile.Changed += new FileSystemEventHandler(XmlWatcher_Created);
             SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
             stw.StartPosition = FormStartPosition.CenterScreen;
             stw.ShowDialog();
@@ -147,9 +147,9 @@ namespace FileWatcher
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.EnableRaisingEvents = true;
             XmlWatcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
-            ATEFile.Path = FolderPath.Text;
-            ATEFile.EnableRaisingEvents = true;
-            ATEFile.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
+            //ATEFile.Path = FolderPath.Text;
+            //ATEFile.EnableRaisingEvents = true;
+            //ATEFile.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
             //设置缓存数据
             BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
             BaseUtil.SetCacheData("Device", Device.Text);
@@ -157,7 +157,7 @@ namespace FileWatcher
             //BaseUtil.SetCacheData("BackUpFolderPath", BackUpFolderPath.Text);
             //BaseUtil.SetCacheData("Master", Master.Text);
             //BaseUtil.SetCacheData("AutoStart", AutoStart.Checked);
-            Timer.Interval = 1000 * 10;
+            Timer.Interval = 1000 * 60;
             Timer.Start();
             //设置按钮不可点击
             StartWatch.Enabled = false;
@@ -256,6 +256,9 @@ namespace FileWatcher
             }
             else if (Device.Text == "ATE设备")
             {
+                if (!FileName.Contains("ATE日志文件")) {
+                    return;
+                }
                 StreamReader sR = new StreamReader(FileName, Encoding.Default);
                 Console.WriteLine(sR.CurrentEncoding);
                 DataTable filedt = new DataTable();
@@ -426,11 +429,11 @@ namespace FileWatcher
 
         private void Timer_Tick(object sender, EventArgs e)
         {
-            //var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
-            //foreach (var Xml in AllXmls)
-            //{
-            //    TxtHandleProcess(Xml);
-            //}
+            var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
+            foreach (var Xml in AllXmls)
+            {
+                TxtHandleProcess(Xml);
+            }
         }
 
         /// <summary>