|
@@ -169,9 +169,9 @@ namespace TeamAAS_VP.ViewModels.Product
|
|
|
public DelegateCommand<object> JogCommand =>
|
|
public DelegateCommand<object> JogCommand =>
|
|
|
_JogCommand ?? (_JogCommand = new DelegateCommand<object>(ExecuteJogCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
|
|
_JogCommand ?? (_JogCommand = new DelegateCommand<object>(ExecuteJogCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
|
|
|
|
|
|
|
|
- private DelegateCommand<RPoint> _TechPointCommand;
|
|
|
|
|
- public DelegateCommand<RPoint> TechPointCommand =>
|
|
|
|
|
- _TechPointCommand ?? (_TechPointCommand = new DelegateCommand<RPoint>(ExecuteTechPointCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
|
|
|
|
|
|
|
+ private DelegateCommand _TechPointCommand;
|
|
|
|
|
+ public DelegateCommand TechPointCommand =>
|
|
|
|
|
+ _TechPointCommand ?? (_TechPointCommand = new DelegateCommand(ExecuteTechPointCommand).ObservesCanExecute(() => CanExecute).ObservesProperty(() => Robot).ObservesProperty(() => Robot.CanExecute));
|
|
|
|
|
|
|
|
private DelegateCommand<string> _MotorCommand;
|
|
private DelegateCommand<string> _MotorCommand;
|
|
|
public DelegateCommand<string> MotorCommand =>
|
|
public DelegateCommand<string> MotorCommand =>
|
|
@@ -351,29 +351,24 @@ namespace TeamAAS_VP.ViewModels.Product
|
|
|
/// 示教点位
|
|
/// 示教点位
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="point"></param>
|
|
/// <param name="point"></param>
|
|
|
- async void ExecuteTechPointCommand(RPoint point)
|
|
|
|
|
|
|
+ async void ExecuteTechPointCommand()
|
|
|
{
|
|
{
|
|
|
- //if (Robot == null || !Robot.IsConnected) return;
|
|
|
|
|
- //try
|
|
|
|
|
- //{
|
|
|
|
|
- // var curpos = await Robot.GetRobotPosAsync();
|
|
|
|
|
- // var p0 = SelectedRobot.Points.FirstOrDefault(x => x.Number == point.Number);
|
|
|
|
|
- // p0.X = curpos.X;
|
|
|
|
|
- // p0.Y = curpos.Y;
|
|
|
|
|
- // p0.Z = curpos.Z;
|
|
|
|
|
- // p0.U = curpos.U;
|
|
|
|
|
- // p0.V = curpos.V;
|
|
|
|
|
- // p0.W = curpos.W;
|
|
|
|
|
- // p0.Hand = curpos.Hand;
|
|
|
|
|
- // p0.Local = curpos.Local;
|
|
|
|
|
- // p0.Tool = curpos.Tool;
|
|
|
|
|
- // _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 0.4 });
|
|
|
|
|
- //}
|
|
|
|
|
- //catch (Exception ex)
|
|
|
|
|
- //{
|
|
|
|
|
- // LogHelper.WriteLogError("机器人点位-示教点位时出错", ex);
|
|
|
|
|
- // _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ if (Robot == null || !Robot.IsConnected) return;
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ var curpos = await Robot.GetRobotPosAsync();
|
|
|
|
|
+ SelectedPoint.X_Position = curpos.X;
|
|
|
|
|
+ SelectedPoint.Y_Position = curpos.Y;
|
|
|
|
|
+ SelectedPoint.Z_Position_Start = curpos.Z;
|
|
|
|
|
+ SelectedPoint.U_Position = curpos.U;
|
|
|
|
|
+ SelectedPoint.R_Position = curpos.V;
|
|
|
|
|
+ _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.完成}!", Duration = 0.4 });
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (Exception ex)
|
|
|
|
|
+ {
|
|
|
|
|
+ LogHelper.WriteLogError("机器人点位-示教点位时出错", ex);
|
|
|
|
|
+ _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = ex.Message, Duration = 1 });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ExecuteLoadedCommand()
|
|
void ExecuteLoadedCommand()
|