Esempio n. 1
0
 private void Parameters_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case nameof(GrblViewModel.MachinePosition):
         if (!(awaitCoord = double.IsNaN(parameters.MachinePosition.Values[0])))
         {
             offset.Set(parameters.MachinePosition);
             parameters.Position.SuspendNotifications = parameters.WorkPositionOffset.SuspendNotifications = true;
             parameters.Clear();
             parameters.WorkPositionOffset.SuspendNotifications = parameters.Position.SuspendNotifications = false;
         }
         break;
     }
 }
Esempio n. 2
0
 private void Parameters_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "Z":
         if (parameters.IsMachinePosition)
         {
             for (int i = 0; i < offset.Values.Length; i++)
             {
                 offset.Values[i] = parameters.MachinePosition.Values[i];
             }
         }
         else
         {
             for (int i = 0; i < offset.Values.Length; i++)
             {
                 offset.Values[i] = parameters.WorkPosition.Values[i] + parameters.WorkPositionOffset.Values[i];
             }
         }
         parameters.WorkPositionOffset.SuspendNotifications = true;
         parameters.Clear();
         parameters.WorkPositionOffset.SuspendNotifications = false;
         awaitCoord = false;
         break;
     }
 }