Browse Source

no message

unque781 6 years ago
parent
commit
bacee917f7
1 changed files with 10 additions and 17 deletions
  1. 10 17
      Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

+ 10 - 17
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -1023,23 +1023,14 @@ namespace VehicleControlSystem.ControlLayer
 
 
             var route = sql.RouteDal.GetRoute( sub.TargetID );
             var route = sql.RouteDal.GetRoute( sub.TargetID );
 
 
-            //if ( !CorrectPosition( route, this.CurrentPosition ) )
-            //{
-            //    this.OccurVehicleAlarm( 20 );
-            //    return false; //Alarm
-            //}
+            if ( !CorrectPosition( route, this.CurrentPosition ) )
+            {
+                this.OccurVehicleAlarm( 20 );
+                return false; //Alarm
+            }
 
 
-            //PIO 내부로 이동.
-            //int result = this.clamp.Unlock_Sync();
-            //if ( result != 0 )
-            //{
-            //    this.OccurVehicleAlarm( result );
-            //    return false;
-            //}
             int result = 0;
             int result = 0;
 
 
-            this.PIOSensorOn();
-            LockUtils.Wait( 500 );
 
 
             result = this.PIOAndLoad( sub.TargetID );
             result = this.PIOAndLoad( sub.TargetID );
             if ( result != 0 )
             if ( result != 0 )
@@ -1095,9 +1086,6 @@ namespace VehicleControlSystem.ControlLayer
             //    return false;
             //    return false;
             //}
             //}
 
 
-            this.PIOSensorOn();
-            LockUtils.Wait( 500 );
-
             int result = 0;
             int result = 0;
             result = this.PIOAndUnload( sub.TargetID );
             result = this.PIOAndUnload( sub.TargetID );
             if ( result != 0 )
             if ( result != 0 )
@@ -1440,6 +1428,8 @@ namespace VehicleControlSystem.ControlLayer
             Thread.Sleep( 1000 );
             Thread.Sleep( 1000 );
             this.OnLoadComplete?.Invoke();
             this.OnLoadComplete?.Invoke();
 #else
 #else
+            this.PIOSensorOn();
+            LockUtils.Wait( 500 );
 
 
             int result = 0;
             int result = 0;
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
@@ -1594,6 +1584,9 @@ namespace VehicleControlSystem.ControlLayer
             Thread.Sleep( 1000 );
             Thread.Sleep( 1000 );
             this.OnUnloadComplete?.Invoke();
             this.OnUnloadComplete?.Invoke();
 #else
 #else
+            this.PIOSensorOn();
+            LockUtils.Wait( 500 );
+
             int result = 0;
             int result = 0;
 
 
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );