Ejemplo n.º 1
0
        private void InitializeValueDisplayMethods()
        {
            Log10DisplayMethodFactory log10 = new Log10DisplayMethodFactory();

            log10MinOrderTextBox.Text = log10.MinOrder.ToString();
            log10MaxOrderTextBox.Text = log10.MaxOrder.ToString();
            LinearDisplayMethodFactory linear = new LinearDisplayMethodFactory();

            linearScaleTextBox.Text = linear.Scale.ToString("g");
            linearScaleTextBox.Text = linear.Offset.ToString("g");
        }
Ejemplo n.º 2
0
        private void SetFields(CaptureProperties props)
        {
            // general
            minFreqTextBox.Text = props.MinFrequency.ToString();
            maxFreqTextBox.Text = props.MaxFrequency.ToString();

            timeMarksCheckBox.Checked = props.IsSecondsMarked;
            markIntervalUpDown.Value  = props.SecondMarkEvery;

            // values
            paletteComboBox.SelectedIndex = Array.IndexOf(
                PaletteComboBoxItems, props.Palette);

            if (props.DisplayMethod is LinearDisplayMethodFactory)
            {
                LinearDisplayMethodFactory dm = (LinearDisplayMethodFactory)props.DisplayMethod;
                linearRadioButton.Checked = true;
                linearScaleTextBox.Text   = dm.Scale.ToString();
                linearOffsetTextBox.Text  = dm.Offset.ToString();
            }
            else
            {
                Log10DisplayMethodFactory dm = props.DisplayMethod as Log10DisplayMethodFactory;
                if (dm == null)
                {
                    dm = new Log10DisplayMethodFactory();
                }

                log10RadioButton.Checked  = true;
                log10MinOrderTextBox.Text = dm.MinOrder.ToString();
                log10MaxOrderTextBox.Text = dm.MaxOrder.ToString();
            }
            UpdateValueMethodView();

            // marks
            marksListView.Items.Clear();
            foreach (FrequencyMark mark in props.FrequencyMarks)
            {
                ListViewItem item = new ListViewItem();
                item.Text = mark.Frequency.ToString();
                item.SubItems.Add(mark.ColorName);
                item.SubItems.Add(mark.Label);
                marksListView.Items.Add(item);
            }

            // capture
            sampleRateComboBox.Text = props.SampleRate.ToString();
            windowTextBox.Text      = props.Window.ToString();
            intervalTextBox.Text    = props.Delta.ToString();
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        private void SetFields(CaptureProperties props)
        {
            // general
            minFreqTextBox.Text = props.MinFrequency.ToString();
            maxFreqTextBox.Text = props.MaxFrequency.ToString();

            timeMarksCheckBox.Checked = props.IsSecondsMarked;
            markIntervalUpDown.Value = props.SecondMarkEvery;

            // values
            paletteComboBox.SelectedIndex = Array.IndexOf(
                PaletteComboBoxItems, props.Palette);

            if (props.DisplayMethod is LinearDisplayMethodFactory)
            {
                LinearDisplayMethodFactory dm = (LinearDisplayMethodFactory)props.DisplayMethod;
                linearRadioButton.Checked = true;
                linearScaleTextBox.Text = dm.Scale.ToString();
                linearOffsetTextBox.Text = dm.Offset.ToString();
            }
            else
            {
                Log10DisplayMethodFactory dm = props.DisplayMethod as Log10DisplayMethodFactory;
                if (dm == null) dm = new Log10DisplayMethodFactory();

                log10RadioButton.Checked = true;
                log10MinOrderTextBox.Text = dm.MinOrder.ToString();
                log10MaxOrderTextBox.Text = dm.MaxOrder.ToString();
            }
            UpdateValueMethodView();

            // marks
            marksListView.Items.Clear();
            foreach (FrequencyMark mark in props.FrequencyMarks)
            {
                ListViewItem item = new ListViewItem();
                item.Text = mark.Frequency.ToString();
                item.SubItems.Add(mark.ColorName);
                item.SubItems.Add(mark.Label);
                marksListView.Items.Add(item);
            }

            // capture
            sampleRateComboBox.Text = props.SampleRate.ToString();
            windowTextBox.Text = props.Window.ToString();
            intervalTextBox.Text = props.Delta.ToString();
        }
Ejemplo n.º 6
0
 private void InitializeValueDisplayMethods()
 {
     Log10DisplayMethodFactory log10 = new Log10DisplayMethodFactory();
     log10MinOrderTextBox.Text = log10.MinOrder.ToString();
     log10MaxOrderTextBox.Text = log10.MaxOrder.ToString();
     LinearDisplayMethodFactory linear = new LinearDisplayMethodFactory();
     linearScaleTextBox.Text = linear.Scale.ToString("g");
     linearScaleTextBox.Text = linear.Offset.ToString("g");
 }