|
|
@@ -434,9 +434,15 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
var reply = new DriveControlEventArgs();
|
|
|
reply.ControlKind = DriveControlEventArgs.eControlKind.SteeringState;
|
|
|
if ( this.steering.IsLeft() )
|
|
|
- reply.Result = FluentResults.Results.Ok<eSteeringState>( eSteeringState.Left );
|
|
|
+ {
|
|
|
+ reply.Args = eSteeringState.Left;
|
|
|
+ reply.Result = FluentResults.Results.Ok();
|
|
|
+ }
|
|
|
else if ( this.steering.IsRight() )
|
|
|
- reply.Result = FluentResults.Results.Ok<eSteeringState>( eSteeringState.Right );
|
|
|
+ {
|
|
|
+ reply.Args = eSteeringState.Right;
|
|
|
+ reply.Result = FluentResults.Results.Ok();
|
|
|
+ }
|
|
|
else
|
|
|
reply.Result = FluentResults.Results.Fail(new Error());
|
|
|
|
|
|
@@ -1094,9 +1100,6 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
PIOClear();
|
|
|
loggerPIO.I( $"Start Battery Charge PIO" );
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECEIVABLE", true );
|
|
|
- loggerPIO.I( "[Vehicle] - 4 Receivable" );
|
|
|
-
|
|
|
if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_SENDABLE" ) )
|
|
|
{
|
|
|
PIOClear();
|
|
|
@@ -1105,11 +1108,10 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
}
|
|
|
loggerPIO.E( "[Port] - 4 Ready On" );
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN", true, 1000 ); //1Sec 이후 On
|
|
|
- loggerPIO.I( "[Vehicle] - Conveyor Run" );
|
|
|
- this.OnConveyorStart?.Invoke( true );
|
|
|
+ this.iO.WriteOutputIO( "OUT_PIO_RECEIVABLE", true );
|
|
|
+ loggerPIO.I( "[Vehicle] - 4 Receivable" );
|
|
|
|
|
|
- if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_SEND_RUN" ) )
|
|
|
+ if ( !this.iO.WaitChangeInputIO( true, 20000, "IN_PIO_SEND_RUN" ) )
|
|
|
{
|
|
|
PIOClear();
|
|
|
loggerPIO.E( "[Port] - 5 Sending Run Time Out" );
|
|
|
@@ -1117,6 +1119,9 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
}
|
|
|
loggerPIO.I( "[Port] - 5 Sending Run On" );
|
|
|
|
|
|
+ this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN", true );
|
|
|
+ loggerPIO.I( "[Vehicle] - Receive Run On" );
|
|
|
+
|
|
|
this.VehicleStateProperty = eVehicleState.Charge;
|
|
|
|
|
|
return 0;
|
|
|
@@ -1132,7 +1137,7 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", true );
|
|
|
loggerPIO.I( "[Vehicle] Receive Complete On" );
|
|
|
- if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_SEND_COMPLITE" ) )
|
|
|
+ if ( !this.iO.WaitChangeInputIO( true, 20000, "IN_PIO_SEND_COMPLITE" ) )
|
|
|
{
|
|
|
this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", false );
|
|
|
loggerPIO.E( "[Port] IN_PIO_SEND_COMPLITE On Time Out" );
|
|
|
@@ -1184,10 +1189,10 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
if ( this.iO.IsConnectError ) return;
|
|
|
|
|
|
- if ( this.iO.IsOn( "IN_EMS_SW" ) ) this.OccurVehicleAlarm( 28 );
|
|
|
- if ( !this.iO.IsOn( "IN_CP_ON_SAFETY" ) ) this.OccurVehicleAlarm( 31 );
|
|
|
- if ( !this.iO.IsOn( "IN_CP_ON_24V" ) ) this.OccurVehicleAlarm( 30 );
|
|
|
- if ( !this.iO.IsOn( "IN_MC_ON" ) ) this.OccurVehicleAlarm( 29 );
|
|
|
+ //if ( this.iO.IsOn( "IN_EMS_SW" ) ) this.OccurVehicleAlarm( 28 );
|
|
|
+ //if ( !this.iO.IsOn( "IN_CP_ON_SAFETY" ) ) this.OccurVehicleAlarm( 31 );
|
|
|
+ //if ( !this.iO.IsOn( "IN_CP_ON_24V" ) ) this.OccurVehicleAlarm( 30 );
|
|
|
+ //if ( !this.iO.IsOn( "IN_MC_ON" ) ) this.OccurVehicleAlarm( 29 );
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
@@ -1362,13 +1367,14 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
this.OnLoadComplete?.Invoke();
|
|
|
|
|
|
loggerPIO.I( $"End Load PIO - [{targetName}]" );
|
|
|
-#endif
|
|
|
- int result = this.clamp.Lock_Sync();
|
|
|
+
|
|
|
+ result = this.clamp.Lock_Sync();
|
|
|
if ( result != 0 )
|
|
|
{
|
|
|
this.OccurVehicleAlarm( result );
|
|
|
return result;
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -1794,9 +1800,39 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
private void IO_OnChangedIO( BitBlock bit )
|
|
|
{
|
|
|
- if ( bit.Tag.Equals( "IN_CV_DETECT_01" ) )
|
|
|
+ switch ( bit.Tag )
|
|
|
{
|
|
|
- this.IsContain = bit.IsBitOn;
|
|
|
+ case "IN_CV_DETECT_01":
|
|
|
+ this.IsContain = bit.IsBitOn;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "IN_MC_ON":
|
|
|
+ if ( bit.IsBitOn )
|
|
|
+ {
|
|
|
+ if (!this.iO.IsOn( "IN_EMS_SW" ) && this.iO.IsOn( "IN_CP_ON_SAFETY" ) && this.iO.IsOn( "IN_CP_ON_24V" ) )
|
|
|
+ this.VehicleStateProperty = eVehicleState.Idle;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ this.OccurVehicleAlarm( 29 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "IN_EMS_SW":
|
|
|
+ if ( bit.IsBitOn)
|
|
|
+ this.OccurVehicleAlarm( 28 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "IN_CP_ON_SAFETY":
|
|
|
+ if ( !bit.IsBitOn)
|
|
|
+ this.OccurVehicleAlarm( 31 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "IN_CP_ON_24V":
|
|
|
+ if ( !bit.IsBitOn )
|
|
|
+ this.OccurVehicleAlarm( 30 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|