|
|
@@ -19,6 +19,8 @@ using Prism.Events;
|
|
|
using VehicleControlSystem.ControlLayer.Actuator.Cylinder;
|
|
|
using VehicleControlSystem.ControlLayer.IO;
|
|
|
using VehicleControlSystem.ControlLayer.Motion;
|
|
|
+using VehicleControlSystem.ControlLayer.Serial.BatteryTabos;
|
|
|
+using VehicleControlSystem.ControlLayer.Serial.DataModel;
|
|
|
using VehicleControlSystem.Managers;
|
|
|
|
|
|
namespace VehicleControlSystem.ControlLayer
|
|
|
@@ -49,13 +51,13 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
/// <summary>
|
|
|
/// Tag 위치
|
|
|
/// </summary>
|
|
|
- private string currentTag;
|
|
|
+ private string currentTag = "0000";
|
|
|
public string CurrentTag
|
|
|
{
|
|
|
get { return currentTag; }
|
|
|
- set
|
|
|
- {
|
|
|
- if ( SetField(ref this.currentTag, value))
|
|
|
+ set
|
|
|
+ {
|
|
|
+ if (SetField(ref this.currentTag, value))
|
|
|
this.OnCurrentTagChanged?.Invoke(value);
|
|
|
}
|
|
|
}
|
|
|
@@ -107,8 +109,8 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
public eObstacleState ObstacleStateProperty
|
|
|
{
|
|
|
get { return obstacleState; }
|
|
|
- set
|
|
|
- {
|
|
|
+ set
|
|
|
+ {
|
|
|
if (SetField(ref this.obstacleState, value))
|
|
|
{
|
|
|
if (value == eObstacleState.Blocked)
|
|
|
@@ -124,6 +126,13 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
set { SetField(ref this.vehicleState, value); }
|
|
|
}
|
|
|
|
|
|
+ private double batteryVolte;
|
|
|
+ public double BatteryVolt
|
|
|
+ {
|
|
|
+ get { return batteryVolte; }
|
|
|
+ set { SetField(ref this.batteryVolte, value); }
|
|
|
+ }
|
|
|
+
|
|
|
//이동
|
|
|
public bool Busy
|
|
|
{
|
|
|
@@ -135,7 +144,6 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
}
|
|
|
|
|
|
public bool IsMoving { get; set; }
|
|
|
- public double BatteryVolt { get; set; }
|
|
|
public bool IsError { get; set; }
|
|
|
|
|
|
public SubCmd CurrentSubCommand { get; private set; }
|
|
|
@@ -180,9 +188,11 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
Clamp clamp = null;
|
|
|
Steering steering = null;
|
|
|
AutoManager autoManager = null;
|
|
|
+ BMUManager bMUManager = null;
|
|
|
|
|
|
ThreadCancel cancel = new ThreadCancel();
|
|
|
TaskCancel taskCancel = new TaskCancel();
|
|
|
+ TaskCancel moveTaskCancel = new TaskCancel(); // 이동 중에 필요한 사항들을 체크
|
|
|
|
|
|
IEventAggregator eventAggregator;
|
|
|
|
|
|
@@ -205,23 +215,23 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
this.eventAggregator = ea;
|
|
|
|
|
|
/*Drive*/
|
|
|
- this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe( ReceiveDriveControlEvent );
|
|
|
- this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe( ReceiveDriveControlEvent );
|
|
|
+ this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe(ReceiveDriveControlEvent);
|
|
|
+ this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe(ReceiveDriveControlEvent);
|
|
|
|
|
|
/*IO*/
|
|
|
- this.eventAggregator.GetEvent<IOControlPubSubEvent>().Unsubscribe( ReceiveIOControlEvent );
|
|
|
- this.eventAggregator.GetEvent<IOControlPubSubEvent>().Subscribe( ReceiveIOControlEvent );
|
|
|
+ this.eventAggregator.GetEvent<IOControlPubSubEvent>().Unsubscribe(ReceiveIOControlEvent);
|
|
|
+ this.eventAggregator.GetEvent<IOControlPubSubEvent>().Subscribe(ReceiveIOControlEvent);
|
|
|
}
|
|
|
|
|
|
- private void ReceiveIOControlEvent( IOControlEventArgs _args )
|
|
|
+ private void ReceiveIOControlEvent(IOControlEventArgs _args)
|
|
|
{
|
|
|
- if ( this.autoManager.OperationModeProperty != eOperatationMode.ManualMode )
|
|
|
+ if (this.autoManager.OperationModeProperty != eOperatationMode.ManualMode)
|
|
|
return;
|
|
|
|
|
|
var msg = _args;
|
|
|
- if(msg.EventDir == IOControlEventArgs.eEventDir.ToBack)
|
|
|
+ if (msg.EventDir == IOControlEventArgs.eEventDir.ToBack)
|
|
|
{
|
|
|
- switch ( msg.ControlKind )
|
|
|
+ switch (msg.ControlKind)
|
|
|
{
|
|
|
case IOControlEventArgs.eControlKind.USE:
|
|
|
break;
|
|
|
@@ -306,6 +316,7 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
this.CreateClamp();
|
|
|
this.CreateSteering();
|
|
|
CreateDrive();
|
|
|
+ this.CreateBMUManager();
|
|
|
|
|
|
ThreadStart();
|
|
|
|
|
|
@@ -330,6 +341,14 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
{
|
|
|
this.cancel.Cancel();
|
|
|
this.cancel.StopWaitAll();
|
|
|
+
|
|
|
+ this.taskCancel.Cancel();
|
|
|
+ this.taskCancel.WaitAll();
|
|
|
+
|
|
|
+ moveTaskCancel.Cancel();
|
|
|
+ moveTaskCancel.WaitAll();
|
|
|
+
|
|
|
+ this.bMUManager.Disconnect();
|
|
|
}
|
|
|
|
|
|
#region Request Method
|
|
|
@@ -349,7 +368,7 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
DriveControlEventPublish(msg);
|
|
|
}
|
|
|
|
|
|
- private void ReqMoveToPos( DriveControlEventArgs args )
|
|
|
+ private void ReqMoveToPos(DriveControlEventArgs args)
|
|
|
{
|
|
|
//var result = drive.Move( args.PositionTag );
|
|
|
//this.MoveTo( "1111" );
|
|
|
@@ -357,7 +376,7 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
int targetTag = args.TargetRouteID;
|
|
|
var route = sql.RouteDal.GetK(targetTag);
|
|
|
- if ( route == null)
|
|
|
+ if (route == null)
|
|
|
{
|
|
|
reply.Result = Results.Fail("Not Found Route");
|
|
|
this.DriveControlEventPublish(reply);
|
|
|
@@ -365,7 +384,7 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
}
|
|
|
|
|
|
this.MoveTo(route.Name);
|
|
|
- reply.Result = Results.Ok( "Position Move" );
|
|
|
+ reply.Result = Results.Ok("Position Move");
|
|
|
this.DriveControlEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
@@ -406,15 +425,15 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
{
|
|
|
LockUtils.Wait(500);
|
|
|
|
|
|
- var msg = new DriveControlEventArgs
|
|
|
- {
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToFront ,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.ReqCurrentPos ,
|
|
|
- CurrentPosition = new Random().Next(0, 1000),
|
|
|
- };
|
|
|
-
|
|
|
- this.DriveControlEventPublish( msg );
|
|
|
- }
|
|
|
+ var msg = new DriveControlEventArgs
|
|
|
+ {
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToFront,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.ReqCurrentPos,
|
|
|
+ CurrentPosition = new Random().Next(0, 1000),
|
|
|
+ };
|
|
|
+
|
|
|
+ this.DriveControlEventPublish(msg);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
this.taskCancel.Add(task);
|
|
|
@@ -454,6 +473,8 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
{
|
|
|
this.cancel.AddGo(new Action(this._ThSubCmdWorker));
|
|
|
this.cancel.AddGo(new Action(this._ThObstacleChecker));
|
|
|
+
|
|
|
+ this.bMUManager.Connect();
|
|
|
}
|
|
|
|
|
|
//장애물 감지 Thread
|
|
|
@@ -562,6 +583,8 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
void Move(SubCmd sub)
|
|
|
{
|
|
|
+ //Todo: 이동 중 브레이크를 풀어야 함. 평소에는 풀고 있다가 Load Unload 시에만 잡아줘야 하는건가??
|
|
|
+ // 브레이크 플어 주기 B접 this.iO.OutputOn("OUT_DRIVE_BRAKE_OFF");
|
|
|
if (this.MoveTo(sub.TargetID))
|
|
|
{
|
|
|
sql.SubCmdDAL.Delete(sub);
|
|
|
@@ -650,7 +673,9 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ this.iO.OutputOn("OUT_PIO_SENSOR_ONOFF");
|
|
|
result = this.PIOAndLoad(sub.TargetID);
|
|
|
+ this.iO.OutputOff("OUT_PIO_SENSOR_ONOFF");
|
|
|
if (result != 0)
|
|
|
{
|
|
|
this.OccurVehicleAlarm(result);
|
|
|
@@ -692,7 +717,9 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ this.iO.OutputOn("OUT_PIO_SENSOR_ONOFF");
|
|
|
result = this.PIOAndUnload(sub.TargetID);
|
|
|
+ this.iO.OutputOff("OUT_PIO_SENSOR_ONOFF");
|
|
|
if (result != 0)
|
|
|
{
|
|
|
this.OccurVehicleAlarm(result);
|
|
|
@@ -940,100 +967,100 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
Thread.Sleep(1000);
|
|
|
this.OnConveyorStop?.Invoke(true);
|
|
|
#else
|
|
|
- var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
|
|
|
+ var pioTimeout = sql.ConfigDal.GetValueToInt(ConstString.PIOTimeOut);
|
|
|
|
|
|
- if ( this.IsInverterError() )
|
|
|
+ if (this.IsInverterError())
|
|
|
return 16;
|
|
|
|
|
|
- if ( this.IsLifterPositinCheck() )
|
|
|
+ if (this.IsLifterPositinCheck())
|
|
|
return 14;
|
|
|
|
|
|
- if ( !this.IsLifterDuplication() )
|
|
|
+ if (!this.IsLifterDuplication())
|
|
|
{
|
|
|
- this.OnFailReport?.Invoke( eFailCode.Load_PortHasNotCarrier );
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.Load_PortHasNotCarrier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if ( this.IsDetectedCenter() )
|
|
|
+ if (this.IsDetectedCenter())
|
|
|
{
|
|
|
- this.OnFailReport?.Invoke( eFailCode.Load_VehicleHasCarrier );
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.Load_VehicleHasCarrier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
PIOClear();
|
|
|
- loggerPIO.I( $"Start Load PIO - [{targetName}]" );
|
|
|
- this.OnPIOStart?.Invoke( true );
|
|
|
+ loggerPIO.I($"Start Load PIO - [{targetName}]");
|
|
|
+ this.OnPIOStart?.Invoke(true);
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN", true );
|
|
|
- loggerPIO.I( "[Vehicle] - 4 Receive Run On" );
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_RECEIVE_RUN", true);
|
|
|
+ loggerPIO.I("[Vehicle] - 4 Receive Run On");
|
|
|
|
|
|
- if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_SENDABLE" ) )
|
|
|
+ if (!this.iO.WaitChangeInputIO(true, pioTimeout, "IN_PIO_SENDABLE"))
|
|
|
{
|
|
|
PIOClear();
|
|
|
- loggerPIO.E( "[Port] - 4 Ready Time Out" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.LoadPIOInterlockTimeout );
|
|
|
+ loggerPIO.E("[Port] - 4 Ready Time Out");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.LoadPIOInterlockTimeout);
|
|
|
return 0;
|
|
|
}
|
|
|
- loggerPIO.E( "[Port] - 4 Ready On" );
|
|
|
+ loggerPIO.E("[Port] - 4 Ready On");
|
|
|
|
|
|
- this.SetConveyorSpeed( true );
|
|
|
- this.OnOffConveyor( true, true );
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN", true );
|
|
|
- loggerPIO.I( "[Vehicle] - Conveyor Run" );
|
|
|
- this.OnConveyorStart?.Invoke( true );
|
|
|
+ this.SetConveyorSpeed(true);
|
|
|
+ this.OnOffConveyor(true, true);
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_RECEIVE_RUN", true);
|
|
|
+ loggerPIO.I("[Vehicle] - Conveyor Run");
|
|
|
+ this.OnConveyorStart?.Invoke(true);
|
|
|
|
|
|
- if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_SEND_RUN" ) )
|
|
|
+ if (!this.iO.WaitChangeInputIO(true, pioTimeout, "IN_PIO_SEND_RUN"))
|
|
|
{
|
|
|
- this.OnOffConveyor( false, true );
|
|
|
+ this.OnOffConveyor(false, true);
|
|
|
PIOClear();
|
|
|
- loggerPIO.E( "[Port] - 5 Sending Run Time Out" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.LoadPIOInterlockTimeout );
|
|
|
+ loggerPIO.E("[Port] - 5 Sending Run Time Out");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.LoadPIOInterlockTimeout);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
bool isStartDetected = false;
|
|
|
var sTime = SwUtils.CurrentTimeMillis;
|
|
|
- while ( true )
|
|
|
+ while (true)
|
|
|
{
|
|
|
- if ( SwUtils.Gt( sTime, 20 * ConstUtils.ONE_SECOND ) )
|
|
|
+ if (SwUtils.Gt(sTime, 20 * ConstUtils.ONE_SECOND))
|
|
|
{
|
|
|
PIOClear();
|
|
|
- this.OnOffConveyor( false, true );
|
|
|
- loggerPIO.E( "[Vehicle] Conveyor Wait Time Out" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.LoadPIOInterlockTimeout );
|
|
|
+ this.OnOffConveyor(false, true);
|
|
|
+ loggerPIO.E("[Vehicle] Conveyor Wait Time Out");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.LoadPIOInterlockTimeout);
|
|
|
|
|
|
- if ( this.IsDetectedLoadStart() ) // 감지가 시작 되었으면 이동중 Error 로 판단 설비를 정지 상태로
|
|
|
+ if (this.IsDetectedLoadStart()) // 감지가 시작 되었으면 이동중 Error 로 판단 설비를 정지 상태로
|
|
|
return 10; //Conveyor Moving Timeout
|
|
|
else
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if ( this.IsDetectedLoadStart() && !isStartDetected )
|
|
|
+ if (this.IsDetectedLoadStart() && !isStartDetected)
|
|
|
isStartDetected = true;
|
|
|
|
|
|
- if ( !this.IsDetectedLoadStart() && isStartDetected )
|
|
|
- this.SetConveyorSpeed( false );
|
|
|
+ if (!this.IsDetectedLoadStart() && isStartDetected)
|
|
|
+ this.SetConveyorSpeed(false);
|
|
|
|
|
|
- if ( this.IsDetectedLoadStop() ) break;
|
|
|
+ if (this.IsDetectedLoadStop()) break;
|
|
|
|
|
|
- if ( this.IsPIOInterLockOn() )
|
|
|
+ if (this.IsPIOInterLockOn())
|
|
|
{
|
|
|
PIOClear();
|
|
|
- this.OnOffConveyor( false ); //Stop
|
|
|
- loggerPIO.E( "[Port] PIO InterLock On " );
|
|
|
+ this.OnOffConveyor(false); //Stop
|
|
|
+ loggerPIO.E("[Port] PIO InterLock On ");
|
|
|
return 19; //
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ( this.IsDetectedCenter() )
|
|
|
- this.OnCarrierDetected?.Invoke( true );
|
|
|
+ if (this.IsDetectedCenter())
|
|
|
+ this.OnCarrierDetected?.Invoke(true);
|
|
|
|
|
|
- this.OnOffConveyor( false ); //Stop
|
|
|
+ this.OnOffConveyor(false); //Stop
|
|
|
PIOClear();
|
|
|
- this.OnConveyorStop?.Invoke( true );
|
|
|
+ this.OnConveyorStop?.Invoke(true);
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", true );
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_RECIVE_COMPLITE", false, 1000 );
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_RECIVE_COMPLITE", true);
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_RECIVE_COMPLITE", false, 1000);
|
|
|
|
|
|
this.OnLoadComplete?.Invoke();
|
|
|
#endif
|
|
|
@@ -1063,84 +1090,84 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
|
|
|
this.OnUnloadComplete?.Invoke();
|
|
|
#else
|
|
|
- var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
|
|
|
+ var pioTimeout = sql.ConfigDal.GetValueToInt(ConstString.PIOTimeOut);
|
|
|
|
|
|
- if ( this.IsInverterError() )
|
|
|
+ if (this.IsInverterError())
|
|
|
return 16;
|
|
|
|
|
|
- if ( this.IsLifterDuplication() )
|
|
|
+ if (this.IsLifterDuplication())
|
|
|
{
|
|
|
- this.OnFailReport?.Invoke( eFailCode.Unload_PortHasCarrier );
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.Unload_PortHasCarrier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if ( !this.IsDetectedCenter() )
|
|
|
+ if (!this.IsDetectedCenter())
|
|
|
{
|
|
|
- this.OnFailReport?.Invoke( eFailCode.Unload_VehicleHasNotCarrier );
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.Unload_VehicleHasNotCarrier);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if ( this.IsLifterPositinCheck() )
|
|
|
+ if (this.IsLifterPositinCheck())
|
|
|
return 13;
|
|
|
|
|
|
PIOClear();
|
|
|
- loggerPIO.I( $"Start Unload PIO - [{targetName}]" );
|
|
|
- this.OnPIOStart?.Invoke( false );
|
|
|
+ loggerPIO.I($"Start Unload PIO - [{targetName}]");
|
|
|
+ this.OnPIOStart?.Invoke(false);
|
|
|
|
|
|
- if ( !this.iO.IsOn( "IN_PIO_READY" ) )
|
|
|
+ if (!this.iO.IsOn("IN_PIO_READY"))
|
|
|
{
|
|
|
- loggerPIO.E( "[Port] - 1 Ready not On" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
|
|
|
+ loggerPIO.E("[Port] - 1 Ready not On");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.UnlaodPIOInterlockTimeout);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_READY", true );
|
|
|
- loggerPIO.I( "[Vehicle] - 1 Ready On" );
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_READY", true);
|
|
|
+ loggerPIO.I("[Vehicle] - 1 Ready On");
|
|
|
|
|
|
- if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_RECEIVE_RUN" ) )
|
|
|
+ if (!this.iO.WaitChangeInputIO(true, pioTimeout, "IN_PIO_RECEIVE_RUN"))
|
|
|
{
|
|
|
PIOClear();
|
|
|
- loggerPIO.E( "[Port] - 2 Receive CV Run Timeout" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
|
|
|
+ loggerPIO.E("[Port] - 2 Receive CV Run Timeout");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.UnlaodPIOInterlockTimeout);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_SENDING_RUN", true );
|
|
|
- loggerPIO.I( "[Vehicle] - 2 Send Run On" );
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_SENDING_RUN", true);
|
|
|
+ loggerPIO.I("[Vehicle] - 2 Send Run On");
|
|
|
|
|
|
- this.SetConveyorSpeed( true );
|
|
|
- this.OnOffConveyor( true );
|
|
|
- this.OnConveyorStart?.Invoke( false );
|
|
|
+ this.SetConveyorSpeed(true);
|
|
|
+ this.OnOffConveyor(true);
|
|
|
+ this.OnConveyorStart?.Invoke(false);
|
|
|
|
|
|
var sTime = SwUtils.CurrentTimeMillis;
|
|
|
- while ( true )
|
|
|
+ while (true)
|
|
|
{
|
|
|
- if ( SwUtils.Gt( sTime, 20 * ConstUtils.ONE_SECOND ) )
|
|
|
+ if (SwUtils.Gt(sTime, 20 * ConstUtils.ONE_SECOND))
|
|
|
{
|
|
|
PIOClear();
|
|
|
- this.OnOffConveyor( false, true );
|
|
|
- loggerPIO.E( "[Port] Conveyor Wait Time Out" );
|
|
|
- this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
|
|
|
+ this.OnOffConveyor(false, true);
|
|
|
+ loggerPIO.E("[Port] Conveyor Wait Time Out");
|
|
|
+ this.OnFailReport?.Invoke(eFailCode.UnlaodPIOInterlockTimeout);
|
|
|
|
|
|
- if ( IsDetectedLoadStart() || IsDetectedCenter() ) //중간에 걸려 있다고 생각해서 알람 처리.
|
|
|
+ if (IsDetectedLoadStart() || IsDetectedCenter()) //중간에 걸려 있다고 생각해서 알람 처리.
|
|
|
return 12; //Conveyor Moving Timeout
|
|
|
else
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if ( this.iO.IsOn( "IN_PIO_RECEIVE_COMPLITE" ) )
|
|
|
+ if (this.iO.IsOn("IN_PIO_RECEIVE_COMPLITE"))
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if ( !IsDetectedCenter() )
|
|
|
- this.OnCarrierDetected?.Invoke( false );
|
|
|
+ if (!IsDetectedCenter())
|
|
|
+ this.OnCarrierDetected?.Invoke(false);
|
|
|
|
|
|
- this.OnOffConveyor( false ); //Stop
|
|
|
- this.OnConveyorStop?.Invoke( false );
|
|
|
+ this.OnOffConveyor(false); //Stop
|
|
|
+ this.OnConveyorStop?.Invoke(false);
|
|
|
PIOClear();
|
|
|
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE", true );
|
|
|
- this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE", false, 1000 );
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_SEND_COMPLITE", true);
|
|
|
+ this.iO.WriteOutputIO("OUT_PIO_SEND_COMPLITE", false, 1000);
|
|
|
|
|
|
this.OnUnloadComplete?.Invoke();
|
|
|
#endif
|
|
|
@@ -1175,6 +1202,15 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
this.motion = new GSIMotion(this.sql);
|
|
|
this.motion.PropertyChanged += Motion_PropertyChanged;
|
|
|
}
|
|
|
+ void CreateBMUManager()
|
|
|
+ {
|
|
|
+ this.bMUManager = new BMUManager();
|
|
|
+ this.bMUManager.BMUConfig = new Serial.BatteryTabos.Config() { ID = "1" };
|
|
|
+ this.bMUManager.OnConnect += BMUManager_OnConnect;
|
|
|
+ this.bMUManager.OnDisconnect += BMUManager_OnDisconnect;
|
|
|
+ this.bMUManager.OnFirstColtd += BMUManager_OnFirstColtd;
|
|
|
+ this.bMUManager.OnChangedReceivedData += BMUManager_OnChangedReceivedData;
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
@@ -1246,6 +1282,58 @@ namespace VehicleControlSystem.ControlLayer
|
|
|
#endregion
|
|
|
|
|
|
#region Event Subscribe
|
|
|
+
|
|
|
+ #region Battery
|
|
|
+ private void BMUManager_OnChangedReceivedData( Serial.DataModel.ReceivedData obj )
|
|
|
+ {
|
|
|
+ var data = obj as ReceivedData;
|
|
|
+ if ( null == data )
|
|
|
+ logger.E( "[Battery Data] Null" );
|
|
|
+
|
|
|
+ var kind = CastTo<eDataKind>.From<Enum>( data.DataKind );
|
|
|
+ switch ( kind )
|
|
|
+ {
|
|
|
+ case eDataKind.Volte:
|
|
|
+ this.BatteryVolt = data.Value;
|
|
|
+ break;
|
|
|
+ case eDataKind.Current:
|
|
|
+ break;
|
|
|
+ case eDataKind.BatteryState:
|
|
|
+ break;
|
|
|
+ case eDataKind.ChargeCompleteTime:
|
|
|
+ break;
|
|
|
+ case eDataKind.DisChargeCompleteTime:
|
|
|
+ break;
|
|
|
+ case eDataKind.SOC:
|
|
|
+ break;
|
|
|
+ case eDataKind.SOH:
|
|
|
+ break;
|
|
|
+ case eDataKind.ResidualCapacity:
|
|
|
+ break;
|
|
|
+ case eDataKind.ResidualEnergy:
|
|
|
+ break;
|
|
|
+ case eDataKind.Temperature:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BMUManager_OnFirstColtd( List<Serial.DataModel.ReceivedData> obj )
|
|
|
+ {
|
|
|
+ logger.I( "[Battery Data] First Collected" );
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BMUManager_OnDisconnect( string obj )
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BMUManager_OnConnect( string obj )
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
private void Motion_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
{
|
|
|
var property = sender.GetType().GetProperty(e.PropertyName);
|