コード例 #1
0
ファイル: Waterfall.cs プロジェクト: AnuoF/sdrsharp
        private void UpdateCenterFrequency(long f)
        {
            if (f < 0)
            {
                f = 0;
            }

            if (_useSnap)
            {
                f = (f + Math.Sign(f) * _stepSize / 2) / _stepSize * _stepSize;
            }

            if (f != _centerFrequency)
            {
                var args = new FrequencyEventArgs(f, FrequencyChangeSource.Scroll);
                OnCenterFrequencyChanged(args);
                if (!args.Cancel)
                {
                    var delta = args.Frequency - _centerFrequency;
                    _displayCenterFrequency += delta;
                    _centerFrequency         = args.Frequency;
                    _performNeeded           = true;
                }
            }
        }
コード例 #2
0
ファイル: Waterfall.cs プロジェクト: AnuoF/sdrsharp
 protected virtual void OnCenterFrequencyChanged(FrequencyEventArgs e)
 {
     if (CenterFrequencyChanged != null)
     {
         CenterFrequencyChanged(this, e);
     }
 }
コード例 #3
0
ファイル: Waterfall.cs プロジェクト: yi520520/SDRSharp-1
 private bool UpdateCenterFrequency(long f, FrequencyChangeSource source)
 {
     if (f < 0)
     {
         f = 0L;
     }
     if (this._useSnap)
     {
         f = (long)((float)f + (float)(Math.Sign(f) * this._stepSize) * 0.5f) / this._stepSize * this._stepSize;
     }
     if (f != this._centerFrequency)
     {
         FrequencyEventArgs frequencyEventArgs = new FrequencyEventArgs(f, source);
         this.OnCenterFrequencyChanged(frequencyEventArgs);
         if (!frequencyEventArgs.Cancel)
         {
             long num = frequencyEventArgs.Frequency - this._centerFrequency;
             this._displayCenterFrequency += num;
             this._centerFrequency         = frequencyEventArgs.Frequency;
             this._performNeeded           = true;
         }
         return(true);
     }
     return(false);
 }
コード例 #4
0
ファイル: Waterfall.cs プロジェクト: AnuoF/sdrsharp
        private void UpdateFrequency(long f, FrequencyChangeSource source)
        {
            var min = (long)(_displayCenterFrequency - _spectrumWidth / _scale / 2);

            if (f < min)
            {
                f = min;
            }
            var max = (long)(_displayCenterFrequency + _spectrumWidth / _scale / 2);

            if (f > max)
            {
                f = max;
            }

            if (_useSnap)
            {
                f = (f + Math.Sign(f) * _stepSize / 2) / _stepSize * _stepSize;
            }

            if (f != _frequency)
            {
                var args = new FrequencyEventArgs(f, source);
                OnFrequencyChanged(args);
                if (!args.Cancel)
                {
                    _frequency     = args.Frequency;
                    _performNeeded = true;
                }
            }
        }
コード例 #5
0
ファイル: Waterfall.cs プロジェクト: yi520520/SDRSharp-1
        protected virtual void OnFrequencyChanged(FrequencyEventArgs e)
        {
            ManualFrequencyChangeEventHandler frequencyChanged = this.FrequencyChanged;

            if (frequencyChanged != null)
            {
                frequencyChanged(this, e);
            }
        }
コード例 #6
0
ファイル: Waterfall.cs プロジェクト: yi520520/SDRSharp-1
        protected virtual void OnCenterFrequencyChanged(FrequencyEventArgs e)
        {
            ManualFrequencyChangeEventHandler centerFrequencyChanged = this.CenterFrequencyChanged;

            if (centerFrequencyChanged != null)
            {
                centerFrequencyChanged(this, e);
            }
        }
コード例 #7
0
ファイル: Waterfall.cs プロジェクト: yi520520/SDRSharp-1
        private bool UpdateFrequency(long f, FrequencyChangeSource source)
        {
            if (this._useSnap)
            {
                f = (long)((float)f + (float)(Math.Sign(f) * this._stepSize) * 0.5f) / this._stepSize * this._stepSize;
            }
            long num  = (long)((float)this._displayCenterFrequency - (float)this._spectrumWidth / this._scale * 0.5f);
            long num2 = (long)((float)this._displayCenterFrequency + (float)this._spectrumWidth / this._scale * 0.5f);

            if (source == FrequencyChangeSource.Scroll)
            {
                long num3 = 0L;
                if (f < num)
                {
                    num3 = f - num;
                }
                else if (f > num2)
                {
                    num3 = f - num2;
                }
                if (num3 != 0L && !this.UpdateCenterFrequency(this._centerFrequency + num3, source))
                {
                    return(false);
                }
            }
            else if (f < num)
            {
                f = num;
            }
            else if (f > num2)
            {
                f = num2;
            }
            if (f != this._frequency)
            {
                FrequencyEventArgs frequencyEventArgs = new FrequencyEventArgs(f, source);
                this.OnFrequencyChanged(frequencyEventArgs);
                if (!frequencyEventArgs.Cancel)
                {
                    this._frequency     = frequencyEventArgs.Frequency;
                    this._performNeeded = true;
                }
                return(true);
            }
            return(false);
        }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: taozhengbo/sdrsharp
 private void panview_CenterFrequencyChanged(object sender, FrequencyEventArgs e)
 {
     if (SourceIsWaveFile || SourceIsSoundCard)
     {
         e.Cancel = true;
     }
     else
     {
         var f = e.Frequency - _frequencyShift;
         if (f < 0)
         {
             f = 0;
             e.Cancel = true;
         }
         SetCenterFrequency(f);
     }
 }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: taozhengbo/sdrsharp
 private void panview_FrequencyChanged(object sender, FrequencyEventArgs e)
 {
     _changingFrequencyByScroll = e.Source == FrequencyChangeSource.Scroll;
     _changingFrequencyByDirectSelection = true;
     vfoFrequencyEdit.Frequency = e.Frequency;
     if (vfoFrequencyEdit.Frequency != e.Frequency)
     {
         e.Cancel = true;
     }
     _changingFrequencyByDirectSelection = false;
     _changingFrequencyByScroll = false;
 }
コード例 #10
0
        private void UpdateCenterFrequency(long f, FrequencyChangeSource source)
        {
            if (f < 0)
            {
                f = 0;
            }

            if (_useSnap)
            {
                f = (f + Math.Sign(f) * _stepSize / 2) / _stepSize * _stepSize;
            }

            if (f != _centerFrequency)
            {
                var args = new FrequencyEventArgs(f, source);
                OnCenterFrequencyChanged(args);
                if (!args.Cancel)
                {
                    var delta = args.Frequency - _centerFrequency;
                    _displayCenterFrequency += delta;

                    _centerFrequency = args.Frequency;
                    _drawBackgroundNeeded = true;
                }
            }
        }
コード例 #11
0
 protected virtual void OnFrequencyChanged(FrequencyEventArgs e)
 {
     if (FrequencyChanged != null)
     {
         FrequencyChanged(this, e);
     }
 }
コード例 #12
0
        private void UpdateFrequency(long f, FrequencyChangeSource source)
        {
            var min = (long) (_displayCenterFrequency - _spectrumWidth / _scale / 2);
            if (f < min)
            {
                f = min;
            }
            var max = (long) (_displayCenterFrequency + _spectrumWidth / _scale / 2);
            if (f > max)
            {
                f = max;
            }

            if (_useSnap)
            {
                f = (f + Math.Sign(f) * _stepSize / 2) / _stepSize * _stepSize;
            }

            if (f != _frequency)
            {
                var args = new FrequencyEventArgs(f, source);
                OnFrequencyChanged(args);
                if (!args.Cancel)
                {
                    _frequency = args.Frequency;
                    _performNeeded = true;
                }
            }
        }
コード例 #13
0
ファイル: MPXProcessor.cs プロジェクト: zloiia/sdrsrc
 private void spectrumAnalyzer_FrequencyChanged(object sender, FrequencyEventArgs e)
 {
     e.Cancel = true;
 }
コード例 #14
0
 private void spectrumAnalyzer_FrequencyChanged(object sender, FrequencyEventArgs e)
 {
     e.Cancel = true;
     _control.Frequency += e.Frequency - _spectrumAnalyzer.Frequency;
 }
コード例 #15
0
 private void spectrumAnalyzer_CenterFrequencyChanged(object sender, FrequencyEventArgs e)
 {
     e.Cancel = true;
     _control.Frequency = e.Frequency - GetFrequencyOffset();
 }
コード例 #16
0
ファイル: MainForm.cs プロジェクト: zloiia/sdrsrc
 private void panview_CenterFrequencyChanged(object sender, FrequencyEventArgs e)
 {
     if (!this.SourceIsTunable)
       {
     e.Cancel = true;
       }
       else
       {
     long newCenterFreq = e.Frequency - this._frequencyShift;
     if (newCenterFreq < 0L)
     {
       newCenterFreq = 0L;
       e.Cancel = true;
     }
     this.SetCenterFrequency(newCenterFreq);
       }
 }
コード例 #17
0
ファイル: MainForm.cs プロジェクト: zloiia/sdrsrc
 private void panview_FrequencyChanged(object sender, FrequencyEventArgs e)
 {
     if (this.SourceIsTunable && e.Source == FrequencyChangeSource.Click && this._tuningStyle == MainForm.TuningStyle.Center)
       {
     this.SetCenterFrequency(e.Frequency + this._frequencyShift);
     this.Frequency = e.Frequency;
     e.Cancel = true;
       }
       else
       {
     this._changingFrequencyByScroll = e.Source == FrequencyChangeSource.Scroll;
     this._changingFrequencyByDirectSelection = true;
     this.vfoFrequencyEdit.Frequency = e.Frequency;
     if (this.vfoFrequencyEdit.Frequency != e.Frequency)
       e.Cancel = true;
     this._changingFrequencyByDirectSelection = false;
     this._changingFrequencyByScroll = false;
       }
 }
コード例 #18
0
ファイル: SpectrumAnalyzer.cs プロジェクト: zloiia/sdrsrc
 protected virtual void OnFrequencyChanged(FrequencyEventArgs e)
 {
     ManualFrequencyChangeEventHandler changeEventHandler = this.FrequencyChanged;
       if (changeEventHandler == null)
     return;
       changeEventHandler((object) this, e);
 }
コード例 #19
0
ファイル: SpectrumAnalyzer.cs プロジェクト: zloiia/sdrsrc
 private void UpdateFrequency(long f, FrequencyChangeSource source)
 {
     long num1 = (long) ((double) this._displayCenterFrequency - (double) this._spectrumWidth / (double) this._scale / 2.0);
       if (f < num1)
     f = num1;
       long num2 = (long) ((double) this._displayCenterFrequency + (double) this._spectrumWidth / (double) this._scale / 2.0);
       if (f > num2)
     f = num2;
       if (this._useSnap)
     f = (f + (long) (Math.Sign(f) * this._stepSize / 2)) / (long) this._stepSize * (long) this._stepSize;
       if (f == this._frequency)
     return;
       FrequencyEventArgs e = new FrequencyEventArgs(f, source);
       this.OnFrequencyChanged(e);
       if (e.Cancel)
     return;
       this._frequency = e.Frequency;
       this._performNeeded = true;
 }
コード例 #20
0
ファイル: SpectrumAnalyzer.cs プロジェクト: zloiia/sdrsrc
 private void UpdateCenterFrequency(long f, FrequencyChangeSource source)
 {
     if (f < 0L)
     f = 0L;
       if (this._useSnap)
     f = (f + (long) (Math.Sign(f) * this._stepSize / 2)) / (long) this._stepSize * (long) this._stepSize;
       if (f == this._centerFrequency)
     return;
       FrequencyEventArgs e = new FrequencyEventArgs(f, source);
       this.OnCenterFrequencyChanged(e);
       if (e.Cancel)
     return;
       this._displayCenterFrequency += e.Frequency - this._centerFrequency;
       this._centerFrequency = e.Frequency;
       this._drawBackgroundNeeded = true;
 }