private void StartButton_Click(object sender, System.Windows.RoutedEventArgs e) { // Get all idle cameras var experimentsNotRunning = Cameras.FindAll(p => !p.Experiment.IsRunning); foreach (var experiment in experimentsNotRunning) { // Run worker asynchronously to start acquisition experiment.StartAcquisitionWorker.RunWorkerAsync(); } }
private void StopButton_Click(object sender, System.Windows.RoutedEventArgs e) { // Get all running cameras var runningExperiments = Cameras.FindAll(p => p.Experiment.IsRunning); // Stop acquisition for all running cameras foreach (var experiment in runningExperiments) { experiment.EndAcquisition(); } }