Beispiel #1
0
        private void frmMeasureParams_Load(object sender, EventArgs e)
        {
            int iTemp = 0;

            txtStartFreq.Text = ConfigRW.Read <int>("MeasParams", "StartFreq").ToString();
            cmbxStartFreqUnits.SelectedIndex = ConfigRW.Read <int>("MeasParams", "StartFreqUnits");
            txtStopFreq.Text = ConfigRW.Read <int>("MeasParams", "StopFreq").ToString();
            cmbxStopFreqUnits.SelectedIndex = ConfigRW.Read <int>("MeasParams", "StopFreqUnits");
            txtAmplitude.Text = ConfigRW.Read <int>("MeasParams", "Amplitude").ToString();
            cmbxAnalyzerUnits.SelectedIndex = ConfigRW.Read <int>("MeasParams", "AnalyzerUnits");
            txtTime.Text = ConfigRW.Read <int>("MeasParams", "Time", 1).ToString();
            cmbxTimeUnits.SelectedIndex           = ConfigRW.Read <int>("MeasParams", "TimeUnits", 1);
            nudPointsCount.Value                  = ConfigRW.Read <int>("MeasParams", "PointsCount");
            cmbxMonitorChannel.SelectedIndex      = ConfigRW.Read <int>("MeasParams", "MonitorChannel");
            cmbxGenMode.SelectedIndex             = ConfigRW.Read <int>("MeasParams", "GenMode");
            cmbxCorrectionImpedance.SelectedIndex = ConfigRW.Read <int>("MeasParams", "CorrectionImpedance");
            cmbxInputCoupling.SelectedIndex       = ConfigRW.Read <int>("MeasParams", "InputCoupling");
            cmbxBandWidth.SelectedIndex           = ConfigRW.Read <int>("MeasParams", "BandWidth");

            iTemp = ConfigRW.Read <int>("MeasParams", "Span");
            if (iTemp < nudSpan.Minimum)
            {
                nudSpan.Value = nudSpan.Minimum;
            }
            else if (iTemp > nudSpan.Maximum)
            {
                nudSpan.Value = nudSpan.Maximum;
            }
            else
            {
                nudSpan.Value = iTemp;
            }

            iTemp = ConfigRW.Read <int>("MeasParams", "SweepCount");
            if (iTemp < nudSweepCount.Minimum)
            {
                nudSweepCount.Value = nudSweepCount.Minimum;
            }
            else if (iTemp > nudSweepCount.Maximum)
            {
                nudSweepCount.Value = nudSweepCount.Maximum;
            }
            else
            {
                nudSweepCount.Value = iTemp;
            }

            cbxUseAnalyzer.Checked = ConfigRW.Read <bool>("MeasParams", "UseAnalyzer");
            cbxUseGen.Checked      = ConfigRW.Read <bool>("MeasParams", "UseGen");
            cbxUseAmpl.Checked     = ConfigRW.Read <bool>("MeasParams", "UseAmpl");
            cbxUseMonitor.Checked  = ConfigRW.Read <bool>("MeasParams", "UseMonitor");
        }
Beispiel #2
0
        private void frmMeasureParams_FormClosing(object sender, FormClosingEventArgs e)
        {
            int iTemp = 0;

            int.TryParse(txtStartFreq.Text, out iTemp);
            if (iTemp <= 0)
            {
                return;
            }
            ConfigRW.Write <int>("MeasParams", "StartFreq", iTemp);
            ConfigRW.Write <int>("MeasParams", "StartFreqUnits", cmbxStartFreqUnits.SelectedIndex);
            int.TryParse(txtStopFreq.Text, out iTemp);
            if (iTemp <= 0)
            {
                return;
            }
            ConfigRW.Write <int>("MeasParams", "StopFreq", iTemp);
            ConfigRW.Write <int>("MeasParams", "StopFreqUnits", cmbxStopFreqUnits.SelectedIndex);
            int.TryParse(txtAmplitude.Text, out iTemp);
            ConfigRW.Write <int>("MeasParams", "Amplitude", iTemp);
            ConfigRW.Write <int>("MeasParams", "AnalyzerUnits", cmbxAnalyzerUnits.SelectedIndex);
            int.TryParse(txtTime.Text, out iTemp);
            ConfigRW.Write <int>("MeasParams", "Time", iTemp);
            ConfigRW.Write <int>("MeasParams", "TimeUnits", cmbxTimeUnits.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "PointsCount", (int)nudPointsCount.Value);

            ConfigRW.Write <int>("MeasParams", "MonitorChannel", cmbxMonitorChannel.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "GenMode", cmbxGenMode.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "CorrectionImpedance", cmbxCorrectionImpedance.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "InputCoupling", cmbxInputCoupling.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "BandWidth", cmbxBandWidth.SelectedIndex);
            ConfigRW.Write <int>("MeasParams", "Span", (int)nudSpan.Value);
            ConfigRW.Write <int>("MeasParams", "SweepCount", (int)nudSweepCount.Value);
            ConfigRW.Write <bool>("MeasParams", "UseAnalyzer", cbxUseAnalyzer.Checked);
            ConfigRW.Write <bool>("MeasParams", "UseGen", cbxUseGen.Checked);
            ConfigRW.Write <bool>("MeasParams", "UseAmpl", cbxUseAmpl.Checked);
            ConfigRW.Write <bool>("MeasParams", "UseMonitor", cbxUseMonitor.Checked);
        }