Exemplo n.º 1
0
        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            if (!System.IO.Directory.Exists(destinationDir))
            {
                MessageBox.Show(Properties.Strings.DirNotFound);
                return;
            }
            if (fileNameTextBox.Background == Brushes.Pink)
            {
                MessageBox.Show(Properties.Strings.FileNameInvalid);
                return;
            }

            AccumImage accumImage = AccumImage.GetInstance(parameterManager);

            if (accumImage.IsActive)
            {
                MessageBoxResult r = MessageBox.Show(
                    Properties.Strings.ShootException01, Properties.Strings.Abort + "?",
                    MessageBoxButton.YesNo);
                if (r == MessageBoxResult.Yes)
                {
                    accumImage.Abort();
                }
                else
                {
                    return;
                }
            }

            try {
                accumImage.FilePath       = destinationDir;
                accumImage.FilenamePrefix = fileName;

                double         distance = double.Parse(distanceTextBox.Text);
                MotorControler mc       = MotorControler.GetInstance(parameterManager);
                accumImage.IntervalUm = double.Parse(intervalTextBox.Text);
                accumImage.StartPoint = mc.GetPoint().Z;
                accumImage.EndPoint   = accumImage.StartPoint
                                        + ((bool)minusRadioButton.IsChecked ? -distance : distance);

                progressPanel.Visibility = Visibility.Visible;
                progressBar.Minimum      = 0;
                progressBar.Maximum      = distance / accumImage.IntervalUm;

                accumImage.Start();
                abortButton.IsEnabled = true;
                ledGroupBox.IsEnabled = false;
                Properties.Settings.Default.ShootDistance = double.Parse(distanceTextBox.Text);
                Properties.Settings.Default.ShootInterval = accumImage.IntervalUm;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void abortButton_Click(object sender, RoutedEventArgs e)
        {
            AccumImage accumImage = AccumImage.GetInstance(parameterManager);

            accumImage.Abort();
        }