private void Start(object sender, RoutedEventArgs e) { try { if (!optiTrack.IsInitialized()) { optiTrack.Initialize(); } if (!robot1.IsInitialized()) { robot1.Initialize(); } if ((bool)copyMovementsCheck.IsChecked && !robot2.IsInitialized()) { robot2.Initialize(); } startBtn.IsEnabled = false; stopBtn.IsEnabled = true; copyMovementsCheck.IsEnabled = false; } catch (Exception ex) { MainWindow.ShowErrorDialog("Cannot start application.", ex); } }
public void Calibrate(int pointsPerLine, int samplesPerPoint) { if (worker.IsBusy) { return; } if (!optiTrack.IsInitialized()) { throw new InvalidOperationException("OptiTrack system is not initialized"); } if (!robot.IsInitialized()) { throw new InvalidOperationException("KUKA robot is not initialized"); } this.samplesPerPoint = samplesPerPoint; CalculateCalibrationPoints(pointsPerLine); worker.RunWorkerAsync(); }