Pārlūkot izejas kodu

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

SK.Kang 5 gadi atpakaļ
vecāks
revīzija
74847757d8

+ 7 - 2
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -1249,7 +1249,7 @@ namespace VehicleControlSystem.ControlLayer
 
             this.SetConveyorSpeed( true );
             this.OnOffConveyor( true , true );
-            this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN" , true );
+            this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN" , true, 1000 );
             loggerPIO.I( "[Vehicle] - Conveyor Run" );
             this.OnConveyorStart?.Invoke( true );
 
@@ -1304,7 +1304,12 @@ namespace VehicleControlSystem.ControlLayer
             this.OnConveyorStop?.Invoke( true );
 
             this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE" , true );
-            this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE" , false , 1000 );
+            if ( !this.iO.WaitChangeInputIO(true, pioTimeout, "IN_PIO_SEND_COMPLITE" ) )
+            {
+                this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", false );
+                loggerPIO.E( "[Port]  IN_PIO_SEND_COMPLITE On Time Out" );
+            }
+            this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", false );
 
             this.OnLoadComplete?.Invoke();
 #endif

+ 6 - 5
Dev/OHV/VehicleControlSystem/Managers/PhysicalCheckupLogger.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 
 namespace VehicleControlSystem.Managers
@@ -30,19 +31,19 @@ namespace VehicleControlSystem.Managers
         }
 
         //192.168.127.188 Moxa 용성 IP
-        public void UploadPhysicalCheckupLog()
+        public async Task UploadPhysicalCheckupLogAsync()
         {
+            var token = new CancellationToken();
+
             using ( var ftp = new FtpClient( "192.168.127.188") )
             {
-                ftp.Connect();
-
+                await ftp.ConnectAsync( token );
 
                 // upload a folder and all its files
-                ftp.UploadDirectory( @"C:\LOG\OHV\Vehicle\PhysicalCheckup\", @"/FTP_TEST", FtpFolderSyncMode.Update );
+                await ftp.UploadDirectoryAsync( @"C:\LOG\OHV\Vehicle\PhysicalCheckup\", @"/DriveInfo", FtpFolderSyncMode.Update );
 
                 // upload a folder and all its files, and delete extra files on the server
                 //ftp.UploadDirectory( @"C:\website\assets\", @"/public_html/assets", FtpFolderSyncMode.Mirror );
-
             }
         }
 

+ 1 - 1
Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SIMULATION</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>