|
|
@@ -33,7 +33,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
get { return this._title; }
|
|
|
set
|
|
|
{
|
|
|
- this.SetProperty( ref this._title, value );
|
|
|
+ this.SetProperty( ref this._title , value );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -43,7 +43,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
get => this._selectedPosition;
|
|
|
set
|
|
|
{
|
|
|
- this.SetProperty( ref this._selectedPosition, value );
|
|
|
+ this.SetProperty( ref this._selectedPosition , value );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -51,7 +51,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public string SelectDirection
|
|
|
{
|
|
|
get => this._selectDirection;
|
|
|
- set { this.SetProperty( ref this._selectDirection, value ); }
|
|
|
+ set { this.SetProperty( ref this._selectDirection , value ); }
|
|
|
}
|
|
|
|
|
|
#region Motor Left Binding Value
|
|
|
@@ -59,7 +59,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public double DriveTargetPos
|
|
|
{
|
|
|
get { return this._driveTargetPos; }
|
|
|
- set { this.SetProperty( ref this._driveTargetPos, value ); }
|
|
|
+ set { this.SetProperty( ref this._driveTargetPos , value ); }
|
|
|
}
|
|
|
|
|
|
private double _currentPosition;
|
|
|
@@ -69,21 +69,21 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public double CurrentPosition
|
|
|
{
|
|
|
get { return this._currentPosition; }
|
|
|
- set { this.SetProperty( ref this._currentPosition, value ); }
|
|
|
+ set { this.SetProperty( ref this._currentPosition , value ); }
|
|
|
}
|
|
|
|
|
|
private double _differenceDrive;
|
|
|
public double DifferenceDrive
|
|
|
{
|
|
|
get { return this._differenceDrive; }
|
|
|
- set { this.SetProperty( ref this._differenceDrive, value ); }
|
|
|
+ set { this.SetProperty( ref this._differenceDrive , value ); }
|
|
|
}
|
|
|
|
|
|
private double _jogVelocity = 3.0;
|
|
|
public double JogVelocity
|
|
|
{
|
|
|
get { return this._jogVelocity; }
|
|
|
- set { this.SetProperty( ref this._jogVelocity, value ); }
|
|
|
+ set { this.SetProperty( ref this._jogVelocity , value ); }
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -107,7 +107,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public ICommand SteeringMoveCommand { get; set; }
|
|
|
public ICommand SelectedDirection { get; set; }
|
|
|
public ICommand JogVelPopupCommand { get; set; }
|
|
|
- public ICommand JogCommand { get; set; }
|
|
|
+ public ICommand JogCommand { get; set; }
|
|
|
#endregion
|
|
|
|
|
|
#region Brushes
|
|
|
@@ -115,36 +115,45 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public Brush SteeringLeftBrushProperty
|
|
|
{
|
|
|
get { return steeringLeftBrush; }
|
|
|
- set { SetProperty( ref this.steeringLeftBrush, value ); }
|
|
|
+ set { SetProperty( ref this.steeringLeftBrush , value ); }
|
|
|
}
|
|
|
|
|
|
private Brush steeringRightBrush = Brushes.Gray;
|
|
|
public Brush SteeringRightBrushProperty
|
|
|
{
|
|
|
get { return steeringRightBrush; }
|
|
|
- set { SetProperty( ref this.steeringRightBrush, value ); }
|
|
|
+ set { SetProperty( ref this.steeringRightBrush , value ); }
|
|
|
}
|
|
|
|
|
|
Brush driveOnStateBrush = Brushes.DodgerBlue;
|
|
|
public Brush DriveOnStateBrush
|
|
|
{
|
|
|
get { return this.driveOnStateBrush; }
|
|
|
- set { SetProperty(ref this.driveOnStateBrush, value); }
|
|
|
+ set { SetProperty( ref this.driveOnStateBrush , value ); }
|
|
|
}
|
|
|
|
|
|
Brush driveOffStateBrush = Brushes.DodgerBlue;
|
|
|
public Brush DriveOffStateBrush
|
|
|
{
|
|
|
get { return this.driveOffStateBrush; }
|
|
|
- set { SetProperty(ref this.driveOffStateBrush, value); }
|
|
|
+ set { SetProperty( ref this.driveOffStateBrush , value ); }
|
|
|
}
|
|
|
+
|
|
|
+ private Brush driveFaultStateBrush = Brushes.DodgerBlue;
|
|
|
+
|
|
|
+ public Brush DriveFaultStateBrush
|
|
|
+ {
|
|
|
+ get { return driveFaultStateBrush; }
|
|
|
+ set { SetProperty( ref this.driveFaultStateBrush , value ); }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
private ObservableCollection<Route> _routeList;
|
|
|
public ObservableCollection<Route> RouteList
|
|
|
{
|
|
|
get { return this._routeList; }
|
|
|
- set { SetProperty( ref this._routeList, value ); }
|
|
|
+ set { SetProperty( ref this._routeList , value ); }
|
|
|
}
|
|
|
|
|
|
public SqliteDAL.DAL.AxisPositionDataDAL axisPositionDataDal;
|
|
|
@@ -156,21 +165,21 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public string AutoReadyFlag
|
|
|
{
|
|
|
get { return autoReadyFlag; }
|
|
|
- set { this.SetProperty(ref this.autoReadyFlag, value); }
|
|
|
+ set { this.SetProperty( ref this.autoReadyFlag , value ); }
|
|
|
}
|
|
|
|
|
|
Brush autoReadyFlagColor = Brushes.Gray;
|
|
|
public Brush AutoReadyFlagColor
|
|
|
{
|
|
|
get { return this.autoReadyFlagColor; }
|
|
|
- set { this.SetProperty(ref this.autoReadyFlagColor, value); }
|
|
|
+ set { this.SetProperty( ref this.autoReadyFlagColor , value ); }
|
|
|
}
|
|
|
|
|
|
- private string currentMCR = "None";
|
|
|
- public string CurrentMCR
|
|
|
+ private string currentMCR = "None";
|
|
|
+ public string CurrentMCR
|
|
|
{
|
|
|
get { return currentMCR; }
|
|
|
- set { this.SetProperty(ref this.currentMCR, value); }
|
|
|
+ set { this.SetProperty( ref this.currentMCR , value ); }
|
|
|
}
|
|
|
|
|
|
private string currentTag = "None";
|
|
|
@@ -178,19 +187,19 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public string CurrentTag
|
|
|
{
|
|
|
get { return currentTag; }
|
|
|
- set { SetProperty(ref this.currentTag, value); }
|
|
|
+ set { SetProperty( ref this.currentTag , value ); }
|
|
|
}
|
|
|
|
|
|
ZmqManager zmqManager;
|
|
|
-
|
|
|
- public DriveServoViewModel( IEventAggregator _ea, SqliteManager _sql, MessageController _messageController, VCSystem system )
|
|
|
+
|
|
|
+ public DriveServoViewModel(IEventAggregator _ea , SqliteManager _sql , MessageController _messageController , VCSystem system)
|
|
|
{
|
|
|
this.eventAggregator = _ea;
|
|
|
this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe( DriveControlCallBack );
|
|
|
- this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe( DriveControlCallBack, ThreadOption.UIThread );
|
|
|
+ this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe( DriveControlCallBack , ThreadOption.UIThread );
|
|
|
|
|
|
this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallBackCommunication );
|
|
|
- this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Subscribe( UICallBackCommunication, ThreadOption.UIThread );
|
|
|
+ this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Subscribe( UICallBackCommunication , ThreadOption.UIThread );
|
|
|
|
|
|
this.sql = _sql;
|
|
|
|
|
|
@@ -227,50 +236,75 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.CurrentMCR = this.zmqManager.CurrentMCR;
|
|
|
this.CurrentTag = this.zmqManager.GetCurrentPointNo().ToString();
|
|
|
|
|
|
+ this.DriveAutoReadyState( this.zmqManager.IsCanStanbyLocation );
|
|
|
+ this.UpdateDriveState( this.zmqManager.DriveState );
|
|
|
+ }
|
|
|
|
|
|
- //TODO: Drive 상태 Update (On/Off, Fault)
|
|
|
- //if (zmqManager.IsDriveOn)
|
|
|
- // this.DriveOnStateBrush = Brushes.LimeGreen;
|
|
|
- //else
|
|
|
- // this.DriveOnStateBrush = Brushes.DodgerBlue;
|
|
|
+ void UpdateDriveState(eDriveState state)
|
|
|
+ {
|
|
|
+ switch ( state )
|
|
|
+ {
|
|
|
+ case eDriveState.ServoOff:
|
|
|
+ this.DriveOnStateBrush = Brushes.Gray;
|
|
|
+ break;
|
|
|
+ case eDriveState.ServoOn:
|
|
|
+ this.DriveOnStateBrush = Brushes.LimeGreen;
|
|
|
+ this.DriveFaultStateBrush = Brushes.DodgerBlue;
|
|
|
+ break;
|
|
|
+ case eDriveState.Fault:
|
|
|
+ this.DriveFaultStateBrush = Brushes.Red;
|
|
|
+ this.DriveOnStateBrush = Brushes.Gray;
|
|
|
+ break;
|
|
|
|
|
|
- DriveAutoReadyState(this.zmqManager.IsCanStanbyLocation);
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- private void ZmqManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
+ private void ZmqManager_PropertyChanged(object sender , System.ComponentModel.PropertyChangedEventArgs e)
|
|
|
{
|
|
|
- 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 );
|
|
|
|
|
|
- switch(e.PropertyName)
|
|
|
+ switch ( e.PropertyName )
|
|
|
{
|
|
|
case "CurrentTag":
|
|
|
- this.CurrentTag = CastTo<int>.From<object>(newValue).ToString();
|
|
|
+ this.CurrentTag = CastTo<int>.From<object>( newValue ).ToString();
|
|
|
break;
|
|
|
|
|
|
case "CurrentMCR":
|
|
|
- this.CurrentMCR = CastTo<string>.From<object>(newValue);
|
|
|
+ this.CurrentMCR = CastTo<string>.From<object>( newValue );
|
|
|
break;
|
|
|
|
|
|
case "IsCanStanbyLocation":
|
|
|
{
|
|
|
- var ll = CastTo<bool>.From<object>(newValue);
|
|
|
- DriveAutoReadyState(ll);
|
|
|
+ var ll = CastTo<bool>.From<object>( newValue );
|
|
|
+ DriveAutoReadyState( ll );
|
|
|
}
|
|
|
break;
|
|
|
- case "IsDriveOn":
|
|
|
+ //case "IsDriveOn":
|
|
|
+ // {
|
|
|
+ // var result = CastTo<bool>.From<object>( newValue );
|
|
|
+ // if ( result )
|
|
|
+ // this.DriveOnStateBrush = Brushes.LimeGreen;
|
|
|
+ // else
|
|
|
+ // this.DriveOnStateBrush = Brushes.DodgerBlue;
|
|
|
+ // }
|
|
|
+ // break;
|
|
|
+
|
|
|
+ case "DriveState":
|
|
|
{
|
|
|
- var result = CastTo<bool>.From<object>(newValue);
|
|
|
- if (result)
|
|
|
- this.DriveOnStateBrush = Brushes.LimeGreen;
|
|
|
- else
|
|
|
- this.DriveOnStateBrush = Brushes.DodgerBlue;
|
|
|
+ var ll = CastTo<eDriveState>.From<object>( newValue );
|
|
|
+ this.UpdateDriveState( ll );
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ExecuteSteeringMove( object obj )
|
|
|
+ private void ExecuteSteeringMove(object obj)
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
@@ -286,11 +320,11 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.PublishEvent( msg );
|
|
|
}
|
|
|
|
|
|
- private void UICallBackCommunication( GUIMessageEventArgs obj )
|
|
|
+ private void UICallBackCommunication(GUIMessageEventArgs obj)
|
|
|
{
|
|
|
if ( obj.Kind == GUIMessageEventArgs.eGUIMessageKind.ModelPropertyChange )
|
|
|
{
|
|
|
- if ( obj.MessageKey.Equals( MessageKey.Vehicle ) )
|
|
|
+ if ( obj.MessageKey.Equals( MessageKey.Vehicle ) )
|
|
|
{
|
|
|
switch ( obj.ModelPropertyName )
|
|
|
{
|
|
|
@@ -332,7 +366,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
void DriveAutoReadyState(bool state)
|
|
|
{
|
|
|
- if(state)
|
|
|
+ if ( state )
|
|
|
{
|
|
|
this.AutoReadyFlag = "OK";
|
|
|
this.AutoReadyFlagColor = Brushes.LimeGreen;
|
|
|
@@ -344,7 +378,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ChagneVehicleState( eVehicleState v )
|
|
|
+ private void ChagneVehicleState(eVehicleState v)
|
|
|
{
|
|
|
switch ( v )
|
|
|
{
|
|
|
@@ -369,7 +403,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void DriveControlCallBack( DriveControlEventArgs args )
|
|
|
+ private void DriveControlCallBack(DriveControlEventArgs args)
|
|
|
{
|
|
|
if ( args.EventDir == DriveControlEventArgs.eEventDir.ToFront )
|
|
|
{
|
|
|
@@ -420,14 +454,14 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ResponseVehicleState( DriveControlEventArgs args )
|
|
|
+ private void ResponseVehicleState(DriveControlEventArgs args)
|
|
|
{
|
|
|
var state = CastTo<VehicleInfo>.From<object>( args.Args );
|
|
|
|
|
|
this.CurrentPosition = state.CurrentPosition;
|
|
|
}
|
|
|
|
|
|
- private void ResponseMove( DriveControlEventArgs args )
|
|
|
+ private void ResponseMove(DriveControlEventArgs args)
|
|
|
{
|
|
|
var msg = string.Empty;
|
|
|
if ( args.Result.IsSuccess )
|
|
|
@@ -437,30 +471,30 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
else
|
|
|
{
|
|
|
var error = args.Result.Errors.FirstOrDefault();
|
|
|
- var alarm = error.Metadata["Alarm"] as Alarm;
|
|
|
+ var alarm = error.Metadata[ "Alarm" ] as Alarm;
|
|
|
msg = alarm.Name + " " + alarm.Text;
|
|
|
}
|
|
|
|
|
|
this.messageController.ShowNotificationView( msg );
|
|
|
}
|
|
|
|
|
|
- void PublishEvent( DriveControlEventArgs args )
|
|
|
+ void PublishEvent(DriveControlEventArgs args)
|
|
|
{
|
|
|
args.EventDir = DriveControlEventArgs.eEventDir.ToBack;
|
|
|
this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( args );
|
|
|
}
|
|
|
|
|
|
- void ChangeSteeringDirection( eSteeringState state )
|
|
|
+ void ChangeSteeringDirection(eSteeringState state)
|
|
|
{
|
|
|
if ( state == eSteeringState.Left )
|
|
|
{
|
|
|
- this.SteeringLeftBrushProperty = (Brush)new BrushConverter().ConvertFromString( "#FF00FFD3" );
|
|
|
+ this.SteeringLeftBrushProperty = ( Brush )new BrushConverter().ConvertFromString( "#FF00FFD3" );
|
|
|
this.SteeringRightBrushProperty = Brushes.Gray;
|
|
|
}
|
|
|
else if ( state == eSteeringState.Right )
|
|
|
{
|
|
|
this.SteeringLeftBrushProperty = Brushes.Gray;
|
|
|
- this.SteeringRightBrushProperty = (Brush)new BrushConverter().ConvertFromString( "#FF00FFD3" );
|
|
|
+ this.SteeringRightBrushProperty = ( Brush )new BrushConverter().ConvertFromString( "#FF00FFD3" );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -470,7 +504,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
|
|
|
#region Execute Method
|
|
|
- private void ExecuteJogCommand( object obj )
|
|
|
+ private void ExecuteJogCommand(object obj)
|
|
|
{
|
|
|
if ( this.JogVelocity <= 0 )
|
|
|
{
|
|
|
@@ -480,8 +514,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.JOG,
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.JOG ,
|
|
|
};
|
|
|
|
|
|
if ( obj.ToString().Equals( "+" ) )
|
|
|
@@ -500,7 +534,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.JogVelocity = result;
|
|
|
}
|
|
|
|
|
|
- private void ExecuteSelectedDirection( object obj )
|
|
|
+ private void ExecuteSelectedDirection(object obj)
|
|
|
{
|
|
|
this.SelectDirection = obj.ToString();
|
|
|
}
|
|
|
@@ -508,55 +542,55 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
private void ExecutePositionSaveCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Save To Data ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- var result = this.RouteList.Any( x => x.IsSelected != false );
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Save To Data ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ var result = this.RouteList.Any( x => x.IsSelected != false );
|
|
|
|
|
|
- if ( !result )
|
|
|
- {
|
|
|
- this.messageController.ShowNotificationView( "Pos Not Selected" );
|
|
|
- return;
|
|
|
- }
|
|
|
+ if ( !result )
|
|
|
+ {
|
|
|
+ this.messageController.ShowNotificationView( "Pos Not Selected" );
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
|
|
|
- }
|
|
|
- } );
|
|
|
+ var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
private void ExecutePositionDeleteCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Select To Delete ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- var deleteList = new List<Route>();
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Select To Delete ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ var deleteList = new List<Route>();
|
|
|
|
|
|
- foreach ( var item in this.RouteList )
|
|
|
- {
|
|
|
- if ( item.IsSelected )
|
|
|
- deleteList.Add( item );
|
|
|
- }
|
|
|
- deleteList.ForEach( x => { this.RouteList.Remove( x ); } );
|
|
|
- }
|
|
|
- } );
|
|
|
+ foreach ( var item in this.RouteList )
|
|
|
+ {
|
|
|
+ if ( item.IsSelected )
|
|
|
+ deleteList.Add( item );
|
|
|
+ }
|
|
|
+ deleteList.ForEach( x => { this.RouteList.Remove( x ); } );
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
private void ExecutePositionAddCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Position Add ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- this.RouteList.Add( new Route() );
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Position Add ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ this.RouteList.Add( new Route() );
|
|
|
|
|
|
- this.messageController.ShowNotificationView( "Create Success" );
|
|
|
- }
|
|
|
- } );
|
|
|
+ this.messageController.ShowNotificationView( "Create Success" );
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
- private void ExecuteKeyInCommadn( object obj )
|
|
|
+ private void ExecuteKeyInCommadn(object obj)
|
|
|
{
|
|
|
var numPad = new CalcuratorView();
|
|
|
var result = numPad.ShowDialog( this.DriveTargetPos );
|
|
|
@@ -565,20 +599,20 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
private void ExecuteOriginCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Origin ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- }
|
|
|
- } );
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Origin ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
private void ExecuteFaultResetCommand()
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.FaultReset,
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.FaultReset ,
|
|
|
};
|
|
|
|
|
|
this.PublishEvent( msg );
|
|
|
@@ -588,8 +622,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.DriveOFF,
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.DriveOFF ,
|
|
|
};
|
|
|
|
|
|
this.PublishEvent( msg );
|
|
|
@@ -599,8 +633,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.DriveON,
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.DriveON ,
|
|
|
};
|
|
|
|
|
|
this.PublishEvent( msg );
|
|
|
@@ -608,43 +642,43 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
private void ExecuteCurrentToTargetCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Current To Target ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- this.DriveTargetPos = this.CurrentPosition;
|
|
|
- }
|
|
|
- } );
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Current To Target ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ this.DriveTargetPos = this.CurrentPosition;
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
private void ExecuteMoveToCommand()
|
|
|
{
|
|
|
- this.messageController.ShowConfirmationPopupView( "Move To Selected Position ?", r =>
|
|
|
- {
|
|
|
- if ( r.Result == ButtonResult.OK )
|
|
|
- {
|
|
|
- var result = this.RouteList.Any( x => x.IsSelected != false );
|
|
|
- if ( !result )
|
|
|
- {
|
|
|
- this.messageController.ShowNotificationView( "Pos Not Selected" );
|
|
|
- return;
|
|
|
- }
|
|
|
+ this.messageController.ShowConfirmationPopupView( "Move To Selected Position ?" , r =>
|
|
|
+ {
|
|
|
+ if ( r.Result == ButtonResult.OK )
|
|
|
+ {
|
|
|
+ var result = this.RouteList.Any( x => x.IsSelected != false );
|
|
|
+ if ( !result )
|
|
|
+ {
|
|
|
+ this.messageController.ShowNotificationView( "Pos Not Selected" );
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
|
|
|
+ var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
|
|
|
|
|
|
- var msg = new DriveControlEventArgs
|
|
|
- {
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.MOVE,
|
|
|
- TargetRouteID = ll.Id,
|
|
|
- };
|
|
|
+ var msg = new DriveControlEventArgs
|
|
|
+ {
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.MOVE ,
|
|
|
+ TargetRouteID = ll.Id ,
|
|
|
+ };
|
|
|
|
|
|
- this.PublishEvent( msg );
|
|
|
- }
|
|
|
- } );
|
|
|
+ this.PublishEvent( msg );
|
|
|
+ }
|
|
|
+ } );
|
|
|
}
|
|
|
|
|
|
- private void ExecuteSelectPosCommand( object obj )
|
|
|
+ private void ExecuteSelectPosCommand(object obj)
|
|
|
{
|
|
|
this.SelectedPosition = obj.ToString();
|
|
|
}
|
|
|
@@ -659,23 +693,23 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
public void OnDialogClosed()
|
|
|
{
|
|
|
- this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack, ControlKind = DriveControlEventArgs.eControlKind.ReqStopCurrentPos } );
|
|
|
+ this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack , ControlKind = DriveControlEventArgs.eControlKind.ReqStopCurrentPos } );
|
|
|
this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe( DriveControlCallBack );
|
|
|
this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallBackCommunication );
|
|
|
}
|
|
|
|
|
|
- public async void OnDialogOpened( IDialogParameters parameters )
|
|
|
+ public async void OnDialogOpened(IDialogParameters parameters)
|
|
|
{
|
|
|
Task task = Task.Run( () =>
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
- EventDir = DriveControlEventArgs.eEventDir.ToBack,
|
|
|
- ControlKind = DriveControlEventArgs.eControlKind.SteeringState,
|
|
|
+ EventDir = DriveControlEventArgs.eEventDir.ToBack ,
|
|
|
+ ControlKind = DriveControlEventArgs.eControlKind.SteeringState ,
|
|
|
};
|
|
|
this.PublishEvent( msg );
|
|
|
|
|
|
- this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack, ControlKind = DriveControlEventArgs.eControlKind.VehicleState } );
|
|
|
+ this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack , ControlKind = DriveControlEventArgs.eControlKind.VehicleState } );
|
|
|
|
|
|
var vcsMsg = new VCSMessageEventArgs() { Kind = VCSMessageEventArgs.eVCSMessageKind.ReqRouteManager };
|
|
|
this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( vcsMsg );
|
|
|
@@ -688,7 +722,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
await task;
|
|
|
}
|
|
|
|
|
|
- private void CloseDialog( string parameter )
|
|
|
+ private void CloseDialog(string parameter)
|
|
|
{
|
|
|
ButtonResult result = ButtonResult.None;
|
|
|
|
|
|
@@ -700,7 +734,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
RaiseRequestClose( new DialogResult( result ) );
|
|
|
}
|
|
|
|
|
|
- public virtual void RaiseRequestClose( IDialogResult dialogResult )
|
|
|
+ public virtual void RaiseRequestClose(IDialogResult dialogResult)
|
|
|
{
|
|
|
RequestClose?.Invoke( dialogResult );
|
|
|
}
|