Пример #1
0
 private void RtlSdrControllerDialog_VisibleChanged(object sender, EventArgs e)
 {
     this.refreshTimer.Enabled = base.Visible;
     if (base.Visible)
     {
         this.samplerateComboBox.Enabled   = !this._owner.Device.IsStreaming;
         this.deviceComboBox.Enabled       = !this._owner.Device.IsStreaming;
         this.samplingModeComboBox.Enabled = !this._owner.Device.IsStreaming;
         if (!this._owner.Device.IsStreaming)
         {
             DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
             this.deviceComboBox.Items.Clear();
             this.deviceComboBox.Items.AddRange(activeDevices);
             int num = 0;
             while (true)
             {
                 if (num < activeDevices.Length)
                 {
                     if (activeDevices[num].Index != ((DeviceDisplay)this.deviceComboBox.Items[num]).Index)
                     {
                         num++;
                         continue;
                     }
                     break;
                 }
                 return;
             }
             this._initialized = false;
             this.deviceComboBox.SelectedIndex = num;
             this._initialized = true;
         }
     }
 }
        private void RtlSdrControllerDialog_VisibleChanged(object sender, EventArgs e)
        {
            refreshTimer.Enabled = Visible;
            if (Visible)
            {
                samplerateComboBox.Enabled   = !_owner.Device.IsStreaming;
                deviceComboBox.Enabled       = !_owner.Device.IsStreaming;
                samplingModeComboBox.Enabled = !_owner.Device.IsStreaming;

                if (!_owner.Device.IsStreaming)
                {
                    var devices = DeviceDisplay.GetActiveDevices();
                    deviceComboBox.Items.Clear();
                    deviceComboBox.Items.AddRange(devices);

                    for (var i = 0; i < devices.Length; i++)
                    {
                        if (devices[i].Index == ((DeviceDisplay)deviceComboBox.Items[i]).Index)
                        {
                            _initialized = false;
                            deviceComboBox.SelectedIndex = i;
                            _initialized = true;
                            break;
                        }
                    }
                }
            }
        }
        public RtlSdrControllerDialog(RtlSdrIO owner)
        {
            InitializeComponent();

            _owner = owner;
            var devices = DeviceDisplay.GetActiveDevices();

            deviceComboBox.Items.Clear();
            deviceComboBox.Items.AddRange(devices);

            frequencyCorrectionNumericUpDown.Value = Utils.GetIntSetting("RTLFrequencyCorrection", 0);
            samplerateComboBox.SelectedIndex       = Utils.GetIntSetting("RTLSampleRate", 3);
            samplingModeComboBox.SelectedIndex     = Utils.GetIntSetting("RTLSamplingMode", 0);
            offsetTuningCheckBox.Checked           = Utils.GetBooleanSetting("RTLOffsetTuning");
            rtlAgcCheckBox.Checked   = Utils.GetBooleanSetting("RTLChipAgc");
            tunerAgcCheckBox.Checked = Utils.GetBooleanSetting("RTLTunerAgc");
            tunerGainTrackBar.Value  = Utils.GetIntSetting("RTLTunerGain", 0);

            tunerAgcCheckBox.Enabled     = samplingModeComboBox.SelectedIndex == 0;
            gainLabel.Visible            = tunerAgcCheckBox.Enabled && !tunerAgcCheckBox.Checked;
            tunerGainTrackBar.Enabled    = tunerAgcCheckBox.Enabled && !tunerAgcCheckBox.Checked;
            offsetTuningCheckBox.Enabled = samplingModeComboBox.SelectedIndex == 0;

            _initialized = true;
        }
Пример #4
0
 public void Open()
 {
     DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
     DeviceDisplay[] array         = activeDevices;
     foreach (DeviceDisplay deviceDisplay in array)
     {
         try
         {
             this.SelectDevice(deviceDisplay.Index);
             return;
         }
         catch (ApplicationException)
         {
         }
     }
     if (activeDevices.Length > 0)
     {
         throw new ApplicationException(activeDevices.Length + " compatible devices have been found but are all busy");
     }
     throw new ApplicationException("No compatible devices found");
 }
Пример #5
0
 public RtlSdrControllerDialog(RtlSdrIO owner)
 {
     this.InitializeComponent();
     this._owner = owner;
     DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
     this.deviceComboBox.Items.Clear();
     this.deviceComboBox.Items.AddRange(activeDevices);
     this.frequencyCorrectionNumericUpDown.Value = Utils.GetIntSetting("RTLFrequencyCorrection", 0);
     this.samplerateComboBox.SelectedIndex       = Utils.GetIntSetting("RTLSampleRate", 3);
     this.samplingModeComboBox.SelectedIndex     = Utils.GetIntSetting("RTLSamplingMode", 0);
     this.offsetTuningCheckBox.Checked           = Utils.GetBooleanSetting("RTLOffsetTuning");
     this.rtlAgcCheckBox.Checked       = Utils.GetBooleanSetting("RTLChipAgc");
     this.tunerAgcCheckBox.Checked     = Utils.GetBooleanSetting("RTLTunerAgc");
     this.lnaGainTrackBar.Value        = Utils.GetIntSetting("LNAGain", 0);
     this.mixerGainTrackBar.Value      = Utils.GetIntSetting("MixerGain", 0);
     this.vgaGainTrackBar.Value        = Utils.GetIntSetting("VGAGain", 0);
     this.tunerAgcCheckBox.Enabled     = (this.samplingModeComboBox.SelectedIndex == 0);
     this.vgaGainTrackBar.Enabled      = (this.tunerAgcCheckBox.Enabled && !this.tunerAgcCheckBox.Checked);
     this.offsetTuningCheckBox.Enabled = (this.samplingModeComboBox.SelectedIndex == 0);
     this._initialized = true;
 }
Пример #6
0
        public void Open()
        {
            var devices = DeviceDisplay.GetActiveDevices();

            foreach (var device in devices)
            {
                try
                {
                    SelectDevice(device.Index);
                    return;
                }
                catch (ApplicationException)
                {
                    // Just ignore it
                }
            }
            if (devices.Length > 0)
            {
                throw new ApplicationException(devices.Length + " compatible devices have been found but are all busy");
            }
            throw new ApplicationException("No compatible devices found");
        }