|
|
@@ -26,7 +26,7 @@ using VehicleControlSystem.Managers;
|
|
|
|
|
|
namespace VehicleControlSystem
|
|
|
{
|
|
|
- [Module( ModuleName = "VCSystem" )]
|
|
|
+ [Module(ModuleName = "VCSystem")]
|
|
|
public class VCSystem : IModule, IDisposable
|
|
|
{
|
|
|
Logger logger = Logger.GetLogger();
|
|
|
@@ -51,16 +51,16 @@ namespace VehicleControlSystem
|
|
|
|
|
|
public List<Alarm> Alarms { get; set; }
|
|
|
|
|
|
- public VCSystem( IEventAggregator ea, SqliteManager sql )
|
|
|
+ public VCSystem(IEventAggregator ea, SqliteManager sql)
|
|
|
{
|
|
|
this.sql = sql;
|
|
|
|
|
|
this.eventAggregator = ea;
|
|
|
|
|
|
- this.eventAggregator.GetEvent<ApplicationExitEvent>().Subscribe( ( o ) => Dispose(), true );
|
|
|
+ this.eventAggregator.GetEvent<ApplicationExitEvent>().Subscribe((o) => Dispose(), true);
|
|
|
|
|
|
- this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Unsubscribe( ReceivedMessageEvent );
|
|
|
- this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Subscribe( this.ReceivedMessageEvent, ThreadOption.BackgroundThread );
|
|
|
+ this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Unsubscribe(ReceivedMessageEvent);
|
|
|
+ this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Subscribe(this.ReceivedMessageEvent, ThreadOption.BackgroundThread);
|
|
|
}
|
|
|
|
|
|
public void Init()
|
|
|
@@ -80,17 +80,17 @@ namespace VehicleControlSystem
|
|
|
|
|
|
//var bitA = new BitArray( bs );
|
|
|
|
|
|
- QuartzUtils.Invoke( "HIS_ALARM", QuartzUtils.GetExpnHour( 5 ), this.CleanHisAlarm );
|
|
|
+ QuartzUtils.Invoke("HIS_ALARM", QuartzUtils.GetExpnHour(5), this.CleanHisAlarm);
|
|
|
|
|
|
- this.Alarms = new ExcelMapper( Path.Combine( System.Environment.CurrentDirectory ) + @"\Config\AlarmDefind.xlsx" ).Fetch<Alarm>().ToList();
|
|
|
+ this.Alarms = new ExcelMapper(Path.Combine(System.Environment.CurrentDirectory) + @"\Config\AlarmDefind.xlsx").Fetch<Alarm>().ToList();
|
|
|
|
|
|
this.RouteManager = RouteManager.Instance;
|
|
|
- RouteManager.Instance.Init( this.sql );
|
|
|
+ RouteManager.Instance.Init(this.sql);
|
|
|
|
|
|
//Create IO
|
|
|
this.IO = new EzIO();
|
|
|
- var mapPath = Path.Combine( System.Environment.CurrentDirectory ) + @"\Config\IO.xlsx";
|
|
|
- this.IO.LoadIOMap( mapPath );
|
|
|
+ var mapPath = Path.Combine(System.Environment.CurrentDirectory) + @"\Config\IO.xlsx";
|
|
|
+ this.IO.LoadIOMap(mapPath);
|
|
|
this.IO.RunIOThread();
|
|
|
|
|
|
var ezIO = this.IO as EzIO;
|
|
|
@@ -102,34 +102,34 @@ namespace VehicleControlSystem
|
|
|
//Battery
|
|
|
this.bMUManager = new BMUManager();
|
|
|
this.bMUManager.BMUConfig = new ControlLayer.Serial.BatteryTabos.Config() { ID = "0" };
|
|
|
- var setV = Convert.ToInt32( sql.ConfigDal.GetById( ConstString.BatteryCanType ).Value );
|
|
|
- var canType = CastTo<BMUManager.eCANSelect>.From<int>( setV );
|
|
|
- this.bMUManager.Connect( canType );
|
|
|
+ var setV = Convert.ToInt32(sql.ConfigDal.GetById(ConstString.BatteryCanType).Value);
|
|
|
+ var canType = CastTo<BMUManager.eCANSelect>.From<int>(setV);
|
|
|
+ this.bMUManager.Connect(canType);
|
|
|
|
|
|
//Conveyor
|
|
|
- this.conveyor = new Conveyor( this.IO as EzIO );
|
|
|
+ this.conveyor = new Conveyor(this.IO as EzIO);
|
|
|
|
|
|
//Clamp
|
|
|
- this.clamp = new Clamp( this.sql, this.eventAggregator );
|
|
|
+ this.clamp = new Clamp(this.sql, this.eventAggregator);
|
|
|
this.clamp.Init();
|
|
|
|
|
|
//Steering
|
|
|
- this.steering = new Steering( this.IO, this.sql, this.eventAggregator );
|
|
|
+ this.steering = new Steering(this.IO, this.sql, this.eventAggregator);
|
|
|
|
|
|
//ZeroMQ
|
|
|
- this.zmqManager = new ZmqManager( this.bMUManager, this.steering );
|
|
|
+ this.zmqManager = new ZmqManager(this.bMUManager, this.steering);
|
|
|
this.zmqManager.Init();
|
|
|
|
|
|
//Drive
|
|
|
- this.drive = new GSIDrive( this.sql, this.steering, this.zmqManager );
|
|
|
+ this.drive = new GSIDrive(this.sql, this.steering, this.zmqManager);
|
|
|
this.drive.Init();
|
|
|
|
|
|
//Process
|
|
|
- this.autoManager = new AutoManager( this.IO, this.eventAggregator, this.sql, this.Alarms );
|
|
|
- this.scheduler = new Scheduler( eventAggregator, this.autoManager, this.sql, this.bMUManager );
|
|
|
- this.vehicle = new Vehicle( this.eventAggregator );
|
|
|
+ this.autoManager = new AutoManager(this.IO, this.eventAggregator, this.sql, this.Alarms);
|
|
|
+ this.scheduler = new Scheduler(eventAggregator, this.autoManager, this.sql, this.bMUManager);
|
|
|
+ this.vehicle = new Vehicle(this.eventAggregator);
|
|
|
|
|
|
- this.hostManager = new HostManager( this.eventAggregator, this.vehicle, this.sql, this.autoManager, this.scheduler );
|
|
|
+ this.hostManager = new HostManager(this.eventAggregator, this.vehicle, this.sql, this.autoManager, this.scheduler);
|
|
|
|
|
|
var refObject = new VehicleRefObjects();
|
|
|
refObject.IO = this.IO as EzIO;
|
|
|
@@ -144,68 +144,68 @@ namespace VehicleControlSystem
|
|
|
refObject.AutoManager = this.autoManager;
|
|
|
refObject.HostManager = this.hostManager;
|
|
|
|
|
|
- this.vehicle.DependencyInjection( refObject );
|
|
|
+ this.vehicle.DependencyInjection(refObject);
|
|
|
this.vehicle.PropertyChanged += Vehicle_PropertyChanged;
|
|
|
|
|
|
this.hostManager.Init();
|
|
|
this.vehicle.Init();
|
|
|
this.scheduler.Init();
|
|
|
- this.autoManager.Init( this.vehicle );
|
|
|
+ this.autoManager.Init(this.vehicle);
|
|
|
}
|
|
|
|
|
|
- private void Vehicle_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )
|
|
|
+ private void Vehicle_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
{
|
|
|
var arg = new GUIMessageEventArgs();
|
|
|
arg.Kind = GUIMessageEventArgs.eGUIMessageKind.ModelPropertyChange;
|
|
|
arg.MessageKey = MessageKey.Vehicle;
|
|
|
arg.ModelPropertyName = e.PropertyName;
|
|
|
|
|
|
- var property = sender.GetType().GetProperty( e.PropertyName );
|
|
|
- var newValue = property.GetValue( sender, null );
|
|
|
+ var property = sender.GetType().GetProperty(e.PropertyName);
|
|
|
+ var newValue = property.GetValue(sender, null);
|
|
|
|
|
|
arg.ModelPropertyName = e.PropertyName;
|
|
|
arg.Args = newValue;
|
|
|
|
|
|
- GUIMessageEventPublish( arg );
|
|
|
+ GUIMessageEventPublish(arg);
|
|
|
}
|
|
|
|
|
|
public void CleanHisAlarm()
|
|
|
{
|
|
|
- var backup = DateTime.Now.AddDays( -15 );
|
|
|
- sql.HisAlarmDAL.Delete( x => x.OccurTime < backup );
|
|
|
+ var backup = DateTime.Now.AddDays(-15);
|
|
|
+ sql.HisAlarmDAL.Delete(x => x.OccurTime < backup);
|
|
|
}
|
|
|
|
|
|
#region EzIO Event
|
|
|
- private void EzIO_OnChangedIO( BitBlock bit )
|
|
|
+ private void EzIO_OnChangedIO(BitBlock bit)
|
|
|
{
|
|
|
- this.eventAggregator.GetEvent<IOChangedPubSubEvent>().Publish( new IOChangedMessageEventArgs { Args = bit } );
|
|
|
+ this.eventAggregator.GetEvent<IOChangedPubSubEvent>().Publish(new IOChangedMessageEventArgs { Args = bit });
|
|
|
}
|
|
|
- private void EzIO_OnDiscontd( string ID )
|
|
|
+ private void EzIO_OnDiscontd(string ID)
|
|
|
{
|
|
|
//throw new NotImplementedException();
|
|
|
}
|
|
|
- private void EzIO_OnContd( string ID )
|
|
|
+ private void EzIO_OnContd(string ID)
|
|
|
{
|
|
|
//IO 연결 시 할일 들을 여기서 하자.
|
|
|
- this.IO.OutputOn( "OUT_TEACH_MODE" );
|
|
|
+ this.IO.OutputOn("OUT_TEACH_MODE");
|
|
|
this.autoManager.LampStateProperty = eLampState.Alarm;
|
|
|
|
|
|
//throw new NotImplementedException();
|
|
|
}
|
|
|
- private void EzIO_OnFirstColtd( string ID )
|
|
|
+ private void EzIO_OnFirstColtd(string ID)
|
|
|
{
|
|
|
- if ( this.IO.IsOff( "IN_MC_ON" ) )
|
|
|
+ if (this.IO.IsOff("IN_MC_ON"))
|
|
|
{
|
|
|
- this.vehicle.OccurVehicleAlarm( 29 );
|
|
|
+ this.vehicle.OccurVehicleAlarm(29);
|
|
|
}
|
|
|
|
|
|
- this.steering.ControlSteering( true );//초기에 직선 주행 상태로 핸들 조정.
|
|
|
+ this.steering.ControlSteering(true);//초기에 직선 주행 상태로 핸들 조정.
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region ReqMessage Method
|
|
|
- void ReceivedMessageEvent( VCSMessageEventArgs msg )
|
|
|
+ void ReceivedMessageEvent(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
switch (msg.Kind)
|
|
|
{
|
|
|
@@ -287,27 +287,60 @@ namespace VehicleControlSystem
|
|
|
|
|
|
private void SetJogSpeed(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
- if(msg.Args.ContainsKey("JogSpeed"))
|
|
|
- {
|
|
|
- this.zmqManager.SetJogSpeed((double)msg.Args["JogSpeed"]);
|
|
|
+ var reply = new GUIMessageEventArgs
|
|
|
+ {
|
|
|
+ Kind = GUIMessageEventArgs.eGUIMessageKind.ReqJogSpeed,
|
|
|
+ Result = FluentResults.Results.Fail("Fail SetJogSpeed"),
|
|
|
+ };
|
|
|
+
|
|
|
+ if (msg.Args.ContainsKey("JogSpeed"))
|
|
|
+ {
|
|
|
+ if(this.zmqManager.SetJogSpeed((double)msg.Args["JogSpeed"]))
|
|
|
+ {
|
|
|
+ reply.Result = FluentResults.Results.Ok();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
private void SetSpeedProfile(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
- if(msg.Args.ContainsKey("Accel") && msg.Args.ContainsKey("Decel") && msg.Args.ContainsKey("Creep") && msg.Args.ContainsKey("CreepDistance"))
|
|
|
+ var reply = new GUIMessageEventArgs
|
|
|
{
|
|
|
- this.zmqManager.SetDriveSpeedProfile(msg.Args["Accel"].ToString(), msg.Args["Decel"].ToString(),
|
|
|
- msg.Args["Creep"].ToString(), msg.Args["CreepDistance"].ToString());
|
|
|
+ Kind = GUIMessageEventArgs.eGUIMessageKind.ReqSpeedProfile,
|
|
|
+ Result = FluentResults.Results.Fail("Fail SetSpeedProfile"),
|
|
|
+ };
|
|
|
+
|
|
|
+ if (msg.Args.ContainsKey("Accel") && msg.Args.ContainsKey("Decel") && msg.Args.ContainsKey("Creep") && msg.Args.ContainsKey("CreepDistance"))
|
|
|
+ {
|
|
|
+ if(this.zmqManager.SetDriveSpeedProfile(msg.Args["Accel"].ToString(), msg.Args["Decel"].ToString(),
|
|
|
+ msg.Args["Creep"].ToString(), msg.Args["CreepDistance"].ToString()))
|
|
|
+ {
|
|
|
+ reply.Result = FluentResults.Results.Ok();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
private void SetDriveSpeed(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
- if(msg.Args.ContainsKey("Linear") && msg.Args.ContainsKey("Curve"))
|
|
|
+ var reply = new GUIMessageEventArgs
|
|
|
+ {
|
|
|
+ Kind = GUIMessageEventArgs.eGUIMessageKind.ReqDirveSpeed,
|
|
|
+ Result = FluentResults.Results.Fail("Fail SetSpeedProfile"),
|
|
|
+ };
|
|
|
+
|
|
|
+ if (msg.Args.ContainsKey("Linear") && msg.Args.ContainsKey("Curve"))
|
|
|
{
|
|
|
- this.zmqManager.SetDriveSpeed(msg.Args["Linear"].ToString(), msg.Args["Curve"].ToString());
|
|
|
+ if(this.zmqManager.SetDriveSpeed(msg.Args["Linear"].ToString(), msg.Args["Curve"].ToString()))
|
|
|
+ {
|
|
|
+ reply.Result = FluentResults.Results.Ok();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
void ReqBatteryState()
|
|
|
@@ -332,13 +365,12 @@ namespace VehicleControlSystem
|
|
|
Kind = GUIMessageEventArgs.eGUIMessageKind.RspBatteryState
|
|
|
};
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
- private void ReqConveyorMove( VCSMessageEventArgs msg )
|
|
|
+ private void ReqConveyorMove(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
- var result = 0;
|
|
|
- this.vehicle.ReqConveyorMove( msg.MessageText );
|
|
|
+ this.vehicle.ReqConveyorMove(msg.MessageText);
|
|
|
}
|
|
|
|
|
|
private void ReqObsticlePatternNo()
|
|
|
@@ -347,19 +379,19 @@ namespace VehicleControlSystem
|
|
|
reply.Kind = GUIMessageEventArgs.eGUIMessageKind.RspObstaclePatternNo;
|
|
|
reply.MessageText = this.vehicle.GetObstacleDetectPattern().ToString();
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
- private void ReqObsticlePatternChange( VCSMessageEventArgs msg )
|
|
|
+ private void ReqObsticlePatternChange(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
- var patternNo = Convert.ToInt32( msg.MessageText );
|
|
|
- this.vehicle.ChgObstacleDetectPattern( patternNo );
|
|
|
+ var patternNo = Convert.ToInt32(msg.MessageText);
|
|
|
+ this.vehicle.ChgObstacleDetectPattern(patternNo);
|
|
|
|
|
|
var reply = new GUIMessageEventArgs();
|
|
|
reply.Kind = GUIMessageEventArgs.eGUIMessageKind.RspObstaclePatternChg;
|
|
|
reply.Result = FluentResults.Results.Ok();
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
private void ReqConveyorUnload()
|
|
|
@@ -368,14 +400,14 @@ namespace VehicleControlSystem
|
|
|
result = this.vehicle.ConveyorUnload();
|
|
|
}
|
|
|
|
|
|
- private void ReqConveyorLoad( VCSMessageEventArgs msg )
|
|
|
+ private void ReqConveyorLoad(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
int result = 0;
|
|
|
|
|
|
result = this.vehicle.ConveyorLoad();
|
|
|
}
|
|
|
|
|
|
- private void ReqPIOConveyor( VCSMessageEventArgs msg )
|
|
|
+ private void ReqPIOConveyor(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
int result = 0;
|
|
|
|
|
|
@@ -387,21 +419,21 @@ namespace VehicleControlSystem
|
|
|
};
|
|
|
|
|
|
/*PIO Load// Unload*/
|
|
|
- if ( msg.MessageText.Equals( "PL" ) )
|
|
|
- result = this.vehicle.PIOAndLoad( "" );
|
|
|
+ if (msg.MessageText.Equals("PL"))
|
|
|
+ result = this.vehicle.PIOAndLoad("");
|
|
|
else
|
|
|
- result = this.vehicle.PIOAndUnload( "" );
|
|
|
+ result = this.vehicle.PIOAndUnload("");
|
|
|
|
|
|
//실행 결과 확인
|
|
|
- if ( result <= 0 )
|
|
|
+ if (result <= 0)
|
|
|
reply.Result = FluentResults.Results.Ok();
|
|
|
else
|
|
|
- reply.Result = FluentResults.Results.Fail( "PIO Fail" );
|
|
|
+ reply.Result = FluentResults.Results.Fail("PIO Fail");
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
- private void ReqPIOBattery( VCSMessageEventArgs msg )
|
|
|
+ private void ReqPIOBattery(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
int result = 1;
|
|
|
|
|
|
@@ -413,14 +445,14 @@ namespace VehicleControlSystem
|
|
|
|
|
|
result = this.vehicle.StartBatteryCharge();
|
|
|
|
|
|
- if ( result <= 0 )
|
|
|
+ if (result <= 0)
|
|
|
reply.Result = FluentResults.Results.Ok();
|
|
|
else
|
|
|
- reply.Result = FluentResults.Results.Fail( "Battery Charge Start Fail" );
|
|
|
+ reply.Result = FluentResults.Results.Fail("Battery Charge Start Fail");
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
- private void ReqBatteryChargeStop( VCSMessageEventArgs msg )
|
|
|
+ private void ReqBatteryChargeStop(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
int result = 1;
|
|
|
|
|
|
@@ -432,12 +464,12 @@ namespace VehicleControlSystem
|
|
|
|
|
|
result = this.vehicle.StopBatteryCharge();
|
|
|
|
|
|
- if ( result <= 0 )
|
|
|
+ if (result <= 0)
|
|
|
reply.Result = FluentResults.Results.Ok();
|
|
|
else
|
|
|
- reply.Result = FluentResults.Results.Fail( "Battery Charge Stop Fail" );
|
|
|
+ reply.Result = FluentResults.Results.Fail("Battery Charge Stop Fail");
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
private void ReqTest()
|
|
|
@@ -449,16 +481,16 @@ namespace VehicleControlSystem
|
|
|
// logger.D( "Test - Time out" );
|
|
|
}
|
|
|
|
|
|
- private void ReqMachineModeChg( VCSMessageEventArgs msg )
|
|
|
+ private void ReqMachineModeChg(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
var reply = new GUIMessageEventArgs();
|
|
|
reply.Kind = GUIMessageEventArgs.eGUIMessageKind.RspMachineModeChg;
|
|
|
|
|
|
- var mode = CastTo<eMachineMode>.From<object>( msg.Arg );
|
|
|
- if ( mode == eMachineMode.HostMode )
|
|
|
+ var mode = CastTo<eMachineMode>.From<object>(msg.Arg);
|
|
|
+ if (mode == eMachineMode.HostMode)
|
|
|
{
|
|
|
- if ( this.autoManager.OperationModeProperty != eOperatationMode.AutoMode )
|
|
|
- reply.Result = FluentResults.Results.Fail( "Vehicle Not Start" );
|
|
|
+ if (this.autoManager.OperationModeProperty != eOperatationMode.AutoMode)
|
|
|
+ reply.Result = FluentResults.Results.Fail("Vehicle Not Start");
|
|
|
else
|
|
|
{
|
|
|
this.vehicle.MachineMode = eMachineMode.HostMode;
|
|
|
@@ -469,18 +501,18 @@ namespace VehicleControlSystem
|
|
|
else
|
|
|
{
|
|
|
this.vehicle.MachineMode = eMachineMode.LocalMode;
|
|
|
- reply.Result = FluentResults.Results.Ok<eMachineMode>( eMachineMode.LocalMode );
|
|
|
+ reply.Result = FluentResults.Results.Ok<eMachineMode>(eMachineMode.LocalMode);
|
|
|
reply.Args = eMachineMode.LocalMode;
|
|
|
}
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
private void ReqBuzzerStop()
|
|
|
{
|
|
|
- this.IO.OutputOff( "OUT_BUZZER_00" );
|
|
|
- this.IO.OutputOff( "OUT_BUZZER_01" );
|
|
|
- this.IO.OutputOff( "OUT_BUZZER_02" );
|
|
|
+ this.IO.OutputOff("OUT_BUZZER_00");
|
|
|
+ this.IO.OutputOff("OUT_BUZZER_01");
|
|
|
+ this.IO.OutputOff("OUT_BUZZER_02");
|
|
|
}
|
|
|
|
|
|
private void ReqAlarmReset()
|
|
|
@@ -488,12 +520,12 @@ namespace VehicleControlSystem
|
|
|
//this.autoManager.IsErrorProcessing = false;
|
|
|
//this.vehicle.VehicleStateProperty = eVehicleState.Idle;
|
|
|
|
|
|
- if ( !this.IO.IsOn( "IN_MC_ON" ) )
|
|
|
+ if (!this.IO.IsOn("IN_MC_ON"))
|
|
|
{
|
|
|
- this.IO.WriteOutputIO( "OUT_SAFETY_RESET", true );
|
|
|
- Thread.Sleep( 2000 );
|
|
|
- this.IO.WriteOutputIO( "OUT_SAFETY_RESET", false );
|
|
|
- Thread.Sleep( 1000 );
|
|
|
+ this.IO.WriteOutputIO("OUT_SAFETY_RESET", true);
|
|
|
+ Thread.Sleep(2000);
|
|
|
+ this.IO.WriteOutputIO("OUT_SAFETY_RESET", false);
|
|
|
+ Thread.Sleep(1000);
|
|
|
}
|
|
|
|
|
|
this.autoManager.IsErrorProcessing = false;
|
|
|
@@ -506,22 +538,22 @@ namespace VehicleControlSystem
|
|
|
//this.vehicle.EStop();
|
|
|
}
|
|
|
|
|
|
- private void ReqVehicleModeChange( VCSMessageEventArgs msg )
|
|
|
+ private void ReqVehicleModeChange(VCSMessageEventArgs msg)
|
|
|
{
|
|
|
GUIMessageEventArgs reply;
|
|
|
- if ( msg.MessageKey.Equals( MessageKey.AutoMode ) )
|
|
|
+ if (msg.MessageKey.Equals(MessageKey.AutoMode))
|
|
|
|
|
|
{
|
|
|
int result = vehicle.InitializationVehicle();
|
|
|
- if ( result != 0 )
|
|
|
+ if (result != 0)
|
|
|
{
|
|
|
- this.autoManager.ProcessAlarm( result );
|
|
|
+ this.autoManager.ProcessAlarm(result);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if ( !zmqManager.SetOperationState( eOperatationMode.AutoMode ) )
|
|
|
+ if (!zmqManager.SetOperationState(eOperatationMode.AutoMode))
|
|
|
{
|
|
|
- this.autoManager.ProcessAlarm( 38 );
|
|
|
+ this.autoManager.ProcessAlarm(38);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -531,9 +563,9 @@ namespace VehicleControlSystem
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if( !zmqManager.SetOperationState( eOperatationMode.ManualMode ) )
|
|
|
+ if (!zmqManager.SetOperationState(eOperatationMode.ManualMode))
|
|
|
{
|
|
|
- this.autoManager.ProcessAlarm( 38 );
|
|
|
+ this.autoManager.ProcessAlarm(38);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -541,13 +573,13 @@ namespace VehicleControlSystem
|
|
|
reply = new GUIMessageEventArgs { Kind = GUIMessageEventArgs.eGUIMessageKind.RspVehicleModeChange, Result = FluentResults.Results.Ok(), MessageKey = MessageKey.ManualMode };
|
|
|
}
|
|
|
|
|
|
- GUIMessageEventPublish( reply );
|
|
|
+ GUIMessageEventPublish(reply);
|
|
|
}
|
|
|
|
|
|
void ReqIOObjectMessage()
|
|
|
{
|
|
|
var rspMsg = new GUIMessageEventArgs { Kind = GUIMessageEventArgs.eGUIMessageKind.RspIOObject, Args = this.IO };
|
|
|
- this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Publish( rspMsg );
|
|
|
+ this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Publish(rspMsg);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
@@ -556,9 +588,9 @@ namespace VehicleControlSystem
|
|
|
/// GUI 로 보내는 Event
|
|
|
/// </summary>
|
|
|
/// <param name="args"></param>
|
|
|
- public void GUIMessageEventPublish( GUIMessageEventArgs args )
|
|
|
+ public void GUIMessageEventPublish(GUIMessageEventArgs args)
|
|
|
{
|
|
|
- this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Publish( args );
|
|
|
+ this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Publish(args);
|
|
|
}
|
|
|
|
|
|
public void Dispose()
|
|
|
@@ -572,16 +604,16 @@ namespace VehicleControlSystem
|
|
|
this.drive.Dispose();
|
|
|
this.zmqManager.Dispose();
|
|
|
|
|
|
- ( this.IO as IDisposable ).Dispose(); //IO 는 마지막에 정리함.
|
|
|
+ (this.IO as IDisposable).Dispose(); //IO 는 마지막에 정리함.
|
|
|
}
|
|
|
|
|
|
- public void RegisterTypes( IContainerRegistry containerRegistry )
|
|
|
+ public void RegisterTypes(IContainerRegistry containerRegistry)
|
|
|
{
|
|
|
- if ( !containerRegistry.IsRegistered<VCSystem>() )
|
|
|
+ if (!containerRegistry.IsRegistered<VCSystem>())
|
|
|
containerRegistry.RegisterSingleton<VCSystem>();
|
|
|
}
|
|
|
|
|
|
- public void OnInitialized( IContainerProvider containerProvider )
|
|
|
+ public void OnInitialized(IContainerProvider containerProvider)
|
|
|
{
|
|
|
this.Init();
|
|
|
}
|