Ejemplo n.º 1
0
 private void SDRIQControllerDialog_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;
         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.deviceComboBox.SelectedIndex = num;
         }
     }
 }
Ejemplo n.º 2
0
        public void Open()
        {
            NativeMethods.sdriq_destroy();
            NativeMethods.sdriq_initialise();
            var devices = DeviceDisplay.GetActiveDevices();

            foreach (var device in devices)
            {
                try
                {
                    SelectDevice(device.Index);
                    return;
                }
                catch (ApplicationException)
                {
                    // Just ignore it
                }
            }
            NativeMethods.sdriq_destroy();
            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");
        }
        private void SDRIQControllerDialog_VisibleChanged(object sender, EventArgs e)
        {
            refreshTimer.Enabled = Visible;
            if (Visible)
            {
                samplerateComboBox.Enabled = !_owner.Device.IsStreaming;
                deviceComboBox.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)
                        {
                            deviceComboBox.SelectedIndex = i;
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public SDRIQControllerDialog(SdrIqIO owner)
 {
     this.InitializeComponent();
     this._owner = owner;
     DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
     this.deviceComboBox.Items.Clear();
     this.deviceComboBox.Items.AddRange(activeDevices);
     this.samplerateComboBox.SelectedIndex = Utils.GetIntSetting("SDRIQSampleRate", 5);
     this.ifGainTrackBar.Value             = Utils.GetIntSetting("SDRIQIFGain", 5);
     this.rfGainTrackBar.Value             = Utils.GetIntSetting("SDRIQRFGain", 2);
     this._initialized = true;
 }
Ejemplo n.º 5
0
 public void Open()
 {
     NativeMethods.sdriq_destroy();
     NativeMethods.sdriq_initialise();
     DeviceDisplay[] activeDevices = DeviceDisplay.GetActiveDevices();
     DeviceDisplay[] array         = activeDevices;
     foreach (DeviceDisplay deviceDisplay in array)
     {
         try
         {
             this.SelectDevice(deviceDisplay.Index);
             return;
         }
         catch (ApplicationException)
         {
         }
     }
     NativeMethods.sdriq_destroy();
     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");
 }