Example #1
0
 public void Close()
 {
     if (this._client != null)
     {
         this._client.Dispose();
         this._client = null;
     }
     this._control.TuningStyleFreezed = false;
     this._gui.SaveSettings();
 }
Example #2
0
 private void DestroyClient()
 {
     if (this._client != null)
     {
         this._client.Synchronized     -= this.Client_Synchronized;
         this._client.Disconnected     -= this.Client_Disconnected;
         this._client.SamplesAvailable -= this.Client_SamplesAvailable;
         this._client.FFTAvailable     -= this.Client_FFTAvailable;
         this._client.Dispose();
         this._client = null;
     }
 }
Example #3
0
        public void Connect()
        {
            if (this._client == null)
            {
                this._client = new SpyClient();
                this._client.Synchronized     += this.Client_Synchronized;
                this._client.Disconnected     += this.Client_Disconnected;
                this._client.SamplesAvailable += this.Client_SamplesAvailable;
                this._client.FFTAvailable     += this.Client_FFTAvailable;
            }
            this._client.Connect(this._gui.Host, this._gui.Port);
            this._control.FrequencyShiftEnabled = false;
            this._control.ResetFrequency(this._client.ChannelCenterFrequency);
            this.UpdateTuningBoundaries();
            bool       bandwidth = this._client.MaximumDecimationStageCount != 0;
            List <int> list      = new List <int>();

            for (int i = 0; i <= this._client.MaximumDecimationStageCount; i++)
            {
                list.Add((int)this._client.MaximumBandwidth >> i);
            }
            string deviceName       = this._client.DeviceName;
            string deviceSerial     = this._client.DeviceSerial.ToString("X8");
            int    maximumGainIndex = (int)this._client.MaximumGainIndex;
            bool   flag             = maximumGainIndex > 0;

            if (this._client.Is8bitForced)
            {
                this._gui.Force8bit();
            }
            this._gui.EnableURI(false);
            this._gui.UpdateControlOptions(deviceName, deviceSerial, this._client.ServerVersion, list.ToArray(), this._client.MinimumIQDecimation, maximumGainIndex);
            this._gui.UpdateDisplaySections(true, bandwidth, !this._client.Is8bitForced, flag);
            this.FFTEnabled = !this._gui.UseFullIQ;
            if (flag)
            {
                this._gui.UpdateGain(this._client.Gain, this._client.CanControl);
            }
        }