|
|
@@ -193,6 +193,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
public ICommand SelectedPosDataSave { get; set; }
|
|
|
public ICommand JogVelPopupCommand { get; set; }
|
|
|
|
|
|
+ public ICommand JogStopCommand { get; set; }
|
|
|
+
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
|
|
IEventAggregator eventAggregator;
|
|
|
@@ -215,6 +217,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.SelectedPosDataSave = new DelegateCommand<object>( ExecuteSelectedPosDataSave );
|
|
|
this.JogCommand = new DelegateCommand<object>( ExecuteJogCommand );
|
|
|
this.JogVelPopupCommand = new DelegateCommand( ExecuteJogVelPopup );
|
|
|
+ this.JogStopCommand = new DelegateCommand( ExecuteJogStop );
|
|
|
|
|
|
this.eventAggregator = ea;
|
|
|
this.eventAggregator.GetEvent<AxisControlPubSubEvent>().Unsubscribe( AxisUICallbackCommunication );
|
|
|
@@ -236,6 +239,18 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.PosLockBrush = Brushes.Orange;
|
|
|
}
|
|
|
|
|
|
+ public void ExecuteJogStop( )
|
|
|
+ {
|
|
|
+ var msg = new AxisControlEventArgs
|
|
|
+ {
|
|
|
+ Dir = AxisControlEventArgs.eEventDir.ToBack ,
|
|
|
+ Kind = AxisControlEventArgs.eAxisControlKind.Stop,
|
|
|
+ AxisName = this.SelectAxis ,
|
|
|
+ };
|
|
|
+
|
|
|
+ this.PublishEvent( msg );
|
|
|
+ }
|
|
|
+
|
|
|
private void ExecuteJogVelPopup( )
|
|
|
{
|
|
|
var numPad = new CalcuratorView();
|
|
|
@@ -276,7 +291,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
}
|
|
|
|
|
|
var sqlAxisLeft = dataList.Where( x => x.AxisName.Equals( ConstString.AXIS_CARRIER_LOCK_LEFT ) ).Single();
|
|
|
- sqlAxisLeft.Value = this.CurrentLockLeft;
|
|
|
+ //sqlAxisLeft.Value = this.CurrentLockLeft;
|
|
|
+ sqlAxisLeft.Value = this.TargetPosLockLeft;
|
|
|
sql.AxisPositionDataDAL.Update( sqlAxisLeft );
|
|
|
}
|
|
|
else if ( this.SelectAxis == ConstString.AXIS_CARRIER_LOCK_RIGHT )
|
|
|
@@ -291,7 +307,8 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
break;
|
|
|
}
|
|
|
var sqlAxisRight = dataList.Where( x => x.AxisName.Equals( ConstString.AXIS_CARRIER_LOCK_RIGHT ) ).Single();
|
|
|
- sqlAxisRight.Value = this.CurrentLockLeft;
|
|
|
+ //sqlAxisRight.Value = this.CurrentLockRight;
|
|
|
+ sqlAxisRight.Value = this.TargetPosLockRight;
|
|
|
sql.AxisPositionDataDAL.Update( sqlAxisRight );
|
|
|
}
|
|
|
else
|
|
|
@@ -300,7 +317,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
} );
|
|
|
}
|
|
|
|
|
|
- private void ExecuteJogCommand( object obj )
|
|
|
+ public void ExecuteJogCommand( object obj )
|
|
|
{
|
|
|
if ( this.JogVelocity <= 0 )
|
|
|
{
|
|
|
@@ -517,6 +534,7 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
|
|
|
private void ExecuteSelectPosCommand( object obj )
|
|
|
{
|
|
|
+ List<Common.Model.AxisPositionData> dataList = null;
|
|
|
this.SelectedPosition = obj.ToString();
|
|
|
|
|
|
if ( obj.Equals( ConstString.TEACH_POSITION_LOCK ) )
|
|
|
@@ -529,6 +547,35 @@ namespace OHV.Module.Interactivity.PopUp
|
|
|
this.PosLockBrush = Brushes.Gray;
|
|
|
this.PosUnlockBrush = Brushes.Orange;
|
|
|
}
|
|
|
+
|
|
|
+ if ( this.SelectAxis == ConstString.AXIS_CARRIER_LOCK_LEFT )
|
|
|
+ {
|
|
|
+ switch ( this.SelectedPosition )
|
|
|
+ {
|
|
|
+ case ConstString.TEACH_POSITION_LOCK:
|
|
|
+ dataList = sql.AxisPositionDataDAL.GetKFromPostion( ConstString.TEACH_POSITION_LOCK );
|
|
|
+ break;
|
|
|
+ case ConstString.TEACH_POSITION_UNLOCK:
|
|
|
+ dataList = sql.AxisPositionDataDAL.GetKFromPostion( ConstString.TEACH_POSITION_UNLOCK );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ var sqlAxisLeft = dataList.Where( x => x.AxisName.Equals( ConstString.AXIS_CARRIER_LOCK_LEFT ) ).Single();
|
|
|
+ this.TargetPosLockLeft = sqlAxisLeft.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ switch ( this.SelectedPosition )
|
|
|
+ {
|
|
|
+ case ConstString.TEACH_POSITION_LOCK:
|
|
|
+ dataList = sql.AxisPositionDataDAL.GetKFromPostion( ConstString.TEACH_POSITION_LOCK );
|
|
|
+ break;
|
|
|
+ case ConstString.TEACH_POSITION_UNLOCK:
|
|
|
+ dataList = sql.AxisPositionDataDAL.GetKFromPostion( ConstString.TEACH_POSITION_UNLOCK );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ var sqlAxisRight = dataList.Where( x => x.AxisName.Equals( ConstString.AXIS_CARRIER_LOCK_RIGHT ) ).Single();
|
|
|
+ this.TargetPosLockRight = sqlAxisRight.Value;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void ExecuteSelectAxisCommand( object obj )
|