예제 #1
0
        private CaptureProperties GetFields()
        {
            CaptureProperties props = new CaptureProperties();

            // general
            Double.TryParse(minFreqTextBox.Text, out props.MinFrequency);
            Double.TryParse(maxFreqTextBox.Text, out props.MaxFrequency);
            props.IsSecondsMarked = timeMarksCheckBox.Checked;
            props.SecondMarkEvery = (int)markIntervalUpDown.Value;

            // values
            props.Palette = PaletteComboBoxItems[paletteComboBox.SelectedIndex];
            if (linearRadioButton.Checked)
            {
                LinearDisplayMethodFactory dm = new LinearDisplayMethodFactory();
                Double.TryParse(linearScaleTextBox.Text, out dm.Scale);
                Double.TryParse(linearOffsetTextBox.Text, out dm.Offset);
                props.DisplayMethod = dm;
            }
            else
            {
                Log10DisplayMethodFactory dm = new Log10DisplayMethodFactory();
                Double.TryParse(log10MinOrderTextBox.Text, out dm.MinOrder);
                Double.TryParse(log10MaxOrderTextBox.Text, out dm.MaxOrder);
                props.DisplayMethod = dm;
            }

            // marks
            foreach (ListViewItem item in marksListView.Items)
            {
                FrequencyMark mark = new FrequencyMark();
                Double.TryParse(item.Text, out mark.Frequency);
                mark.ColorName = item.SubItems[1].Text;
                mark.Label     = item.SubItems[2].Text;
                props.FrequencyMarks.Add(mark);
            }

            // capture
            Int32.TryParse(sampleRateComboBox.Text, out props.SampleRate);
            Int32.TryParse(windowTextBox.Text, out props.Window);
            Int32.TryParse(intervalTextBox.Text, out props.Delta);

            return(props);
        }
예제 #2
0
        private CaptureProperties GetFields()
        {
            CaptureProperties props = new CaptureProperties();
            // general
            Double.TryParse(minFreqTextBox.Text, out props.MinFrequency);
            Double.TryParse(maxFreqTextBox.Text, out props.MaxFrequency);
            props.IsSecondsMarked = timeMarksCheckBox.Checked;
            props.SecondMarkEvery = (int)markIntervalUpDown.Value;

            // values
            props.Palette = PaletteComboBoxItems[paletteComboBox.SelectedIndex];
            if (linearRadioButton.Checked)
            {
                LinearDisplayMethodFactory dm = new LinearDisplayMethodFactory();
                Double.TryParse(linearScaleTextBox.Text, out dm.Scale);
                Double.TryParse(linearOffsetTextBox.Text, out dm.Offset);
                props.DisplayMethod = dm;
            }
            else
            {
                Log10DisplayMethodFactory dm = new Log10DisplayMethodFactory();
                Double.TryParse(log10MinOrderTextBox.Text, out dm.MinOrder);
                Double.TryParse(log10MaxOrderTextBox.Text, out dm.MaxOrder);
                props.DisplayMethod = dm;
            }

            // marks
            foreach (ListViewItem item in marksListView.Items)
            {
                FrequencyMark mark = new FrequencyMark();
                Double.TryParse(item.Text, out mark.Frequency);
                mark.ColorName = item.SubItems[1].Text;
                mark.Label = item.SubItems[2].Text;
                props.FrequencyMarks.Add(mark);
            }

            // capture
            Int32.TryParse(sampleRateComboBox.Text, out props.SampleRate);
            Int32.TryParse(windowTextBox.Text, out props.Window);
            Int32.TryParse(intervalTextBox.Text, out props.Delta);

            return props;
        }