|
|
@@ -19,7 +19,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
{
|
|
|
private DelegateCommand<string> _closeDialogCommand;
|
|
|
public DelegateCommand<string> CloseDialogCommand =>
|
|
|
- _closeDialogCommand ?? ( _closeDialogCommand = new DelegateCommand<string>( CloseDialog ) );
|
|
|
+ _closeDialogCommand ?? (_closeDialogCommand = new DelegateCommand<string>(CloseDialog));
|
|
|
|
|
|
private string _title = "DriveServoView";
|
|
|
public string Title
|
|
|
@@ -27,7 +27,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
get { return this._title; }
|
|
|
set
|
|
|
{
|
|
|
- this.SetProperty( ref this._title , value );
|
|
|
+ this.SetProperty(ref this._title, value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -37,7 +37,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
get => this._selectedPosition;
|
|
|
set
|
|
|
{
|
|
|
- this.SetProperty( ref this._selectedPosition , value );
|
|
|
+ this.SetProperty(ref this._selectedPosition, value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -45,7 +45,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
|
|
|
@@ -53,28 +53,28 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public double TargetPosDrive
|
|
|
{
|
|
|
get { return this._targetPosDrive; }
|
|
|
- set { this.SetProperty( ref this._targetPosDrive , value ); }
|
|
|
+ set { this.SetProperty(ref this._targetPosDrive, value); }
|
|
|
}
|
|
|
|
|
|
private double _currentDrive;
|
|
|
public double CurrentDrive
|
|
|
{
|
|
|
get { return this._currentDrive; }
|
|
|
- set { this.SetProperty( ref this._currentDrive , value ); }
|
|
|
+ set { this.SetProperty(ref this._currentDrive, 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;
|
|
|
public double JogVelocity
|
|
|
{
|
|
|
get { return this._jogVelocity; }
|
|
|
- set { this.SetProperty( ref this._jogVelocity , value ); }
|
|
|
+ set { this.SetProperty(ref this._jogVelocity, value); }
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -120,14 +120,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public ObservableCollection<Route> RouteList
|
|
|
{
|
|
|
get { return this._routeList; }
|
|
|
- set { SetProperty( ref this._routeList , value ); }
|
|
|
- }
|
|
|
-
|
|
|
- private Route _selectedRow = new Route();
|
|
|
- public Route SelectedRow
|
|
|
- {
|
|
|
- get { return this._selectedRow; }
|
|
|
- set { SetProperty( ref this._selectedRow , value ); }
|
|
|
+ set { SetProperty(ref this._routeList, value); }
|
|
|
}
|
|
|
|
|
|
public SqliteDAL.DAL.AxisPositionDataDAL axisPositionDataDal;
|
|
|
@@ -135,44 +128,44 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
MessageController messageController;
|
|
|
//SelectionList selectionItems;
|
|
|
|
|
|
- public DriveServoViewModel( IEventAggregator _ea, SqliteManager _sql, MessageController _messageController )
|
|
|
+ public DriveServoViewModel(IEventAggregator _ea, SqliteManager _sql, MessageController _messageController)
|
|
|
{
|
|
|
this.eventAggregator = _ea;
|
|
|
- this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Unsubscribe( UICallbackCommunication );
|
|
|
- this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Subscribe( UICallbackCommunication , ThreadOption.UIThread );
|
|
|
+ this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Unsubscribe(UICallbackCommunication);
|
|
|
+ this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Subscribe(UICallbackCommunication, ThreadOption.UIThread);
|
|
|
|
|
|
this.sql = _sql;
|
|
|
- this.RouteList = new ObservableCollection<Route>( sql.RouteDal.All );
|
|
|
+ this.RouteList = new ObservableCollection<Route>(sql.RouteDal.All);
|
|
|
/* Route 로 변경*/
|
|
|
|
|
|
this.messageController = _messageController;
|
|
|
|
|
|
- this.SelectPosCommand = new DelegateCommand<object>( ExecuteSelectPosCommand );
|
|
|
- this.MoveToCommand = new DelegateCommand( ExecuteMoveToCommand );
|
|
|
- this.CurrentToTargetCommand = new DelegateCommand( ExecuteCurrentToTargetCommand );
|
|
|
- this.KeyInTargetPosCommand = new DelegateCommand<object>( ExecuteKeyInCommadn );
|
|
|
+ this.SelectPosCommand = new DelegateCommand<object>(ExecuteSelectPosCommand);
|
|
|
+ this.MoveToCommand = new DelegateCommand(ExecuteMoveToCommand);
|
|
|
+ this.CurrentToTargetCommand = new DelegateCommand(ExecuteCurrentToTargetCommand);
|
|
|
+ this.KeyInTargetPosCommand = new DelegateCommand<object>(ExecuteKeyInCommadn);
|
|
|
|
|
|
- this.ServoOnCommand = new DelegateCommand( ExecuteServoOnCommand );
|
|
|
- this.ServoOffCommand = new DelegateCommand( ExecuteServoOffCommand );
|
|
|
- this.FaultResetCommand = new DelegateCommand( ExecuteFaultResetCommand );
|
|
|
- this.OriginCommand = new DelegateCommand( ExecuteOriginCommand );
|
|
|
+ this.ServoOnCommand = new DelegateCommand(ExecuteServoOnCommand);
|
|
|
+ this.ServoOffCommand = new DelegateCommand(ExecuteServoOffCommand);
|
|
|
+ this.FaultResetCommand = new DelegateCommand(ExecuteFaultResetCommand);
|
|
|
+ this.OriginCommand = new DelegateCommand(ExecuteOriginCommand);
|
|
|
|
|
|
- this.PositionAddCommand = new DelegateCommand( ExecutePositionAddCommand );
|
|
|
- this.PositionDeleteCommand = new DelegateCommand( ExecutePositionDeleteCommand );
|
|
|
- this.PositionSaveCommand = new DelegateCommand( ExecutePositionSaveCommand );
|
|
|
+ this.PositionAddCommand = new DelegateCommand(ExecutePositionAddCommand);
|
|
|
+ this.PositionDeleteCommand = new DelegateCommand(ExecutePositionDeleteCommand);
|
|
|
+ this.PositionSaveCommand = new DelegateCommand(ExecutePositionSaveCommand);
|
|
|
|
|
|
- this.SelectedDirection = new DelegateCommand<object>( ExecuteSelectedDirection );
|
|
|
- this.SteeringCWCommand = new DelegateCommand<object>( ExecuteSteeringCWCommand );
|
|
|
- this.SteeringCCWCommand = new DelegateCommand<object>( ExecuteSteeringCCWCommand );
|
|
|
+ this.SelectedDirection = new DelegateCommand<object>(ExecuteSelectedDirection);
|
|
|
+ this.SteeringCWCommand = new DelegateCommand<object>(ExecuteSteeringCWCommand);
|
|
|
+ this.SteeringCCWCommand = new DelegateCommand<object>(ExecuteSteeringCCWCommand);
|
|
|
|
|
|
- this.JogVelPopupCommand = new DelegateCommand( ExecuteJogVelPopupCommand );
|
|
|
- this.JogCommand = new DelegateCommand<object>( ExecuteJogCommand );
|
|
|
+ this.JogVelPopupCommand = new DelegateCommand(ExecuteJogVelPopupCommand);
|
|
|
+ this.JogCommand = new DelegateCommand<object>(ExecuteJogCommand);
|
|
|
}
|
|
|
|
|
|
- private void UICallbackCommunication( DriveControlEventArgs args )
|
|
|
+ private void UICallbackCommunication(DriveControlEventArgs args)
|
|
|
{
|
|
|
//TODO: Drive, Steering 구분
|
|
|
- if ( args.EventDir == DriveControlEventArgs.eEventDir.ToFront )
|
|
|
+ if (args.EventDir == DriveControlEventArgs.eEventDir.ToFront)
|
|
|
{
|
|
|
switch (args.ControlKind)
|
|
|
{
|
|
|
@@ -200,9 +193,9 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void PublishEvent( DriveControlEventArgs args )
|
|
|
+ void PublishEvent(DriveControlEventArgs args)
|
|
|
{
|
|
|
- this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Publish( args );
|
|
|
+ this.eventAggregator.GetEvent<DirveControlPubSubEvent>().Publish(args);
|
|
|
}
|
|
|
|
|
|
void ChangeSteeringDirection(bool isLeft)
|
|
|
@@ -280,22 +273,22 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
{
|
|
|
if (r.Result == ButtonResult.OK)
|
|
|
{
|
|
|
- //value check
|
|
|
- //1차 검사 ID 값이 동일한게 있는지 ?
|
|
|
- //2차 검사 Value 값 변화된것들이 있으면 변화된것들 Save 후 Update 해야함.
|
|
|
- var d = this.RouteList.ToList();
|
|
|
+ //value check
|
|
|
+ //1차 검사 ID 값이 동일한게 있는지 ?
|
|
|
+ //2차 검사 Value 값 변화된것들이 있으면 변화된것들 Save 후 Update 해야함.
|
|
|
+ var d = this.RouteList.ToList();
|
|
|
var l = d.Distinct().ToList();
|
|
|
|
|
|
- //var saveData = new ObservableCollection<AxisPositionData>();
|
|
|
+ //var saveData = new ObservableCollection<AxisPositionData>();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void ExecutePositionDeleteCommand()
|
|
|
{
|
|
|
- var d = this.SelectedRow;
|
|
|
var deleteList = new List<Route>();
|
|
|
+
|
|
|
foreach (var item in this.RouteList)
|
|
|
{
|
|
|
if (item.IsSelected)
|
|
|
@@ -345,8 +338,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
{
|
|
|
await Task.Run(() =>
|
|
|
{
|
|
|
- //Axis.Move(this.SelectPosition);
|
|
|
- });
|
|
|
+ //Axis.Move(this.SelectPosition);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void ExecuteSelectPosCommand(object obj)
|
|
|
@@ -374,16 +367,16 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
#endregion
|
|
|
|
|
|
#region Dialog Function
|
|
|
- public bool CanCloseDialog( )
|
|
|
+ public bool CanCloseDialog()
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public void OnDialogClosed( )
|
|
|
+ public void OnDialogClosed()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- public void OnDialogOpened( IDialogParameters parameters )
|
|
|
+ public void OnDialogOpened(IDialogParameters parameters)
|
|
|
{
|
|
|
var msg = new DriveControlEventArgs
|
|
|
{
|
|
|
@@ -393,21 +386,21 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.PublishEvent(msg);
|
|
|
}
|
|
|
|
|
|
- private void CloseDialog( string parameter )
|
|
|
+ private void CloseDialog(string parameter)
|
|
|
{
|
|
|
ButtonResult result = ButtonResult.None;
|
|
|
|
|
|
- if ( parameter?.ToLower() == "true" )
|
|
|
+ if (parameter?.ToLower() == "true")
|
|
|
result = ButtonResult.OK;
|
|
|
- else if ( parameter?.ToLower() == "false" )
|
|
|
+ else if (parameter?.ToLower() == "false")
|
|
|
result = ButtonResult.Cancel;
|
|
|
|
|
|
- RaiseRequestClose( new DialogResult( result ) );
|
|
|
+ RaiseRequestClose(new DialogResult(result));
|
|
|
}
|
|
|
|
|
|
- public virtual void RaiseRequestClose( IDialogResult dialogResult )
|
|
|
+ public virtual void RaiseRequestClose(IDialogResult dialogResult)
|
|
|
{
|
|
|
- RequestClose?.Invoke( dialogResult );
|
|
|
+ RequestClose?.Invoke(dialogResult);
|
|
|
}
|
|
|
#endregion
|
|
|
}
|