Преглед на файлове

Merge branch 'master' of http://unque781.synology.me:3000/GSI/OHV

# Conflicts:
#	Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.cs
ys-hwang преди 5 години
родител
ревизия
dba3b9a1af

BIN
Dev/OHV/Assambly/ExcelMapper/GSG.NET.Excel.dll


BIN
Dev/OHV/Assambly/GSG.NET.PLC.dll


BIN
Dev/OHV/Assambly/GSG.NET.WPF.dll


BIN
Dev/OHV/Assambly/GSG.NET.WPF.pdb


BIN
Dev/OHV/Assambly/GSG.NET.dll


BIN
Dev/OHV/Assambly/GSG.NET.pdb


+ 1 - 0
Dev/OHV/OHV.Vehicle/App.xaml.cs

@@ -81,6 +81,7 @@ namespace OHV.Vehicle
             splashScreen = animatedSplashScreenWindow;
 
             // Show it
+            animatedSplashScreenWindow.SetRange( 2 );
             animatedSplashScreenWindow.Show();
 
             // Now that the window is created, allow the rest of the startup to run

+ 1 - 0
Dev/OHV/OHV.Vehicle/Concept/D_MainWindow.xaml.cs

@@ -54,6 +54,7 @@ namespace OHV.Vehicle.Concept
             WindowExternal.MaximizeToFirstMonitor(this);
             this.Activate();
 
+            App.splashScreen.StepIt();
             App.splashScreen.AddMessage("Done !");
             App.splashScreen.LoadComplete();
 

+ 19 - 21
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.cs

@@ -31,7 +31,6 @@ namespace OHVDriveLogger
         string UploadIP = string.Empty;
         string PLCAddress = string.Empty;
         int PLCPort = 0;
-        string LOG_DIR = string.Empty;
 
         public FormMain()
         {
@@ -41,26 +40,28 @@ namespace OHVDriveLogger
             this.FormClosing += FormMain_FormClosing;
 
             //MidnightNotifier.DayChanged += MidnightNotifier_DayChanged;
-            //FixTimeNotifier.HourChanged += FixTimeNotifier_HourChanged;
+            FixTimeNotifier.HourChanged += FixTimeNotifier_HourChanged;
 
             this.vehicleID = ConfigurationManager.AppSettings["VehicleID"];
             this.UploadIP = ConfigurationManager.AppSettings["FTPUploadIP"];
             this.PLCAddress = ConfigurationManager.AppSettings["PLC_IP"];
             this.PLCPort = Convert.ToInt16( ConfigurationManager.AppSettings["PLC_PORT"] );
-            this.LOG_DIR = ConfigurationManager.AppSettings["LOG_DIR"];
 
             FTPLogger.Instance.UploadIP = this.UploadIP;
             FTPLogger.Instance.PLCAddress = this.PLCAddress;
         }
 
-        private void FixTimeNotifier_HourChanged(object sender, EventArgs e)
+        private void FixTimeNotifier_HourChanged( object sender, EventArgs e )
         {
-            logger.I("FixTime Notifier");
-            Task.Run(() => { DeleteNoBackupFiles(this.LOG_DIR, 2); });
+            logger.I( "FixTimer Event Occur" );
+            Task.Run( () => { DeleteNoBackupFiles( @"c:\LOG\OHV\DriveLogger\", 2 ); } );
         }
 
         private void MidnightNotifier_DayChanged( object sender, EventArgs e )
         {
+            logger.I( "자정 Event Occur" );
+            Task.Run( () => { DeleteNoBackupFiles( @"c:\LOG\OHV\DriveLogger\", 2 ); } );
+            Task.Run( () => { DeleteNoBackupFiles( @"c:\LOG\OHV\Vehicle\", 2 ); } );
         }
 
         private void FormMain_FormClosing( object sender, FormClosingEventArgs e )
@@ -200,12 +201,16 @@ namespace OHVDriveLogger
                     buffered.Flush();
             }
 
+
+
+
+
             this.plc.WriteBit( "DRIVE_LOGGING_ONOFF", false );
 
-            LockUtils.Wait(200);
-            FTPLogger.Instance.FTPDownload();
-            LockUtils.Wait( 100 );
-            FTPLogger.Instance.FTPUpload($"\\LOG\\{this.vehicleID}");
+            //LockUtils.Wait( 200 );
+            //FTPLogger.Instance.FTPDownload();
+            LockUtils.Wait( 500 );
+            FTPLogger.Instance.FTPUpload();
             LockUtils.Wait( 100 );
         }
 
@@ -242,11 +247,11 @@ namespace OHVDriveLogger
                     if ( fi.LastWriteTime > dt )
                         continue;
 
-                    FileUtils.DeleteFileIfExist( path );        
+                    FileUtils.DeleteFileIfExist( path );
                     delCount++;
                     logger.D( $"Deleted File - Name : [ {fi.Name} ]" );
 
-                    if ( delCount > 100 ) //한번에 지우는 파일 갯수.
+                    if ( delCount > 2 )
                         break;
                 }
 
@@ -267,17 +272,10 @@ namespace OHVDriveLogger
                 //}
 
             }
-            catch(Exception ex)
+            catch
             {
-                logger.E(ex);
-            }
-        }
 
-        private void label55_Click(object sender, EventArgs e)
-        {
-            //FTPLogger.Instance.FTPDownload();
-            //LockUtils.Wait(100);
-            //FTPLogger.Instance.FTPUpload($"\\LOG\\{this.vehicleID}");
+            }
         }
     }
 }