コード例 #1
0
        private void DoEdit(MemoryEntry memoryEntry, bool isNew)
        {
            var dialog = new DialogEntryInfo(memoryEntry, _groups);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (isNew)
                {
                    _entries.Add(memoryEntry);
                    _entries.Sort((e1, e2) => e1.Frequency.CompareTo(e2.Frequency));
                }
                _settingsPersister.PersistStoredFrequencies(_entries);
                if (!_groups.Contains(memoryEntry.GroupName))
                {
                    _groups.Add(memoryEntry.GroupName);
                    ProcessGroups(memoryEntry.GroupName);
                }
                else
                {
                    if ((string)comboGroups.SelectedItem == AllGroups || (string)comboGroups.SelectedItem == memoryEntry.GroupName ||
                        ((string)comboGroups.SelectedItem == FavouriteGroup && memoryEntry.IsFavourite))
                    {
                        if (isNew)
                        {
                            _displayedEntries.Add(memoryEntry);
                        }
                    }
                    else
                    {
                        comboGroups.SelectedItem = memoryEntry.GroupName;
                    }
                }
            }
        }
コード例 #2
0
 public MemoryEntry(MemoryEntry memoryEntry)
 {
     _name = memoryEntry._name;
     _groupName = memoryEntry._groupName;
     _detectorType = memoryEntry._detectorType;
     _frequency = memoryEntry._frequency;
     _shift = memoryEntry._shift;
     _centerFrequency = memoryEntry._centerFrequency;
     _filterBandwidth = memoryEntry._filterBandwidth;
     _isFavourite = memoryEntry._isFavourite;
     _stayTunedLevel = memoryEntry._stayTunedLevel;
 }
コード例 #3
0
 public MemoryEntry(MemoryEntry memoryEntry)
 {
     _name            = memoryEntry._name;
     _groupName       = memoryEntry._groupName;
     _detectorType    = memoryEntry._detectorType;
     _frequency       = memoryEntry._frequency;
     _shift           = memoryEntry._shift;
     _centerFrequency = memoryEntry._centerFrequency;
     _filterBandwidth = memoryEntry._filterBandwidth;
     _isFavourite     = memoryEntry._isFavourite;
     _stayTunedLevel  = memoryEntry._stayTunedLevel;
 }
コード例 #4
0
 public DialogEntryInfo(MemoryEntry memoryEntry, List <string> groups)
 {
     _memoryEntry = memoryEntry;
     InitializeComponent();
     textBoxName.Text             = memoryEntry.Name;
     comboGroupName.Text          = memoryEntry.GroupName;
     frequencyNumericUpDown.Value = memoryEntry.Frequency;
     shiftNumericUpDown.Value     = memoryEntry.Shift;
     lblMode.Text = memoryEntry.DetectorType.ToString();
     comboGroupName.Items.AddRange(groups.ToArray());
     nudFilterBandwidth.Value          = memoryEntry.FilterBandwidth;
     favouriteCb.Checked               = memoryEntry.IsFavourite;
     numericUpDownStayTunedLevel.Value = memoryEntry.StayTunedLevel;
     ValidateForm();
 }
コード例 #5
0
ファイル: Scanner.cs プロジェクト: yi520520/SDRSharpPlugins
        private void DoReTuning(MemoryEntry Entry)
        {
            InitAverager();

            _controlInterface.FrequencyShiftEnabled = false;

            if (Entry.Shift != 0)
            {
                Entry.Frequency += Entry.Shift;
            }
            _controlInterface.DetectorType    = Entry.DetectorType;
            _controlInterface.FilterBandwidth = (int)Entry.FilterBandwidth;
            _controlInterface.Frequency       = Entry.Frequency;
            UpdateTimeLeft(_scanTime);
        }
コード例 #6
0
 public DialogEntryInfo(MemoryEntry memoryEntry, List<string> groups)
 {
     _memoryEntry = memoryEntry;
     InitializeComponent();
     textBoxName.Text = memoryEntry.Name;
     comboGroupName.Text = memoryEntry.GroupName;
     frequencyNumericUpDown.Value = memoryEntry.Frequency;
     shiftNumericUpDown.Value = memoryEntry.Shift;
     lblMode.Text = memoryEntry.DetectorType.ToString();
     comboGroupName.Items.AddRange(groups.ToArray());
     nudFilterBandwidth.Value = memoryEntry.FilterBandwidth;
     favouriteCb.Checked = memoryEntry.IsFavourite;
     numericUpDownStayTunedLevel.Value = memoryEntry.StayTunedLevel;
     ValidateForm();
 }
コード例 #7
0
        public void Bookmark()
        {
            //if (_controlInterface.Frequency == 0) return;
            if (!_controlInterface.IsPlaying)
            {
                return;
            }

            var memoryEntry = new MemoryEntry();

            memoryEntry.DetectorType    = _controlInterface.DetectorType;
            memoryEntry.Frequency       = _controlInterface.Frequency;
            memoryEntry.FilterBandwidth = _controlInterface.FilterBandwidth;
            memoryEntry.Shift           = _controlInterface.FrequencyShiftEnabled ? _controlInterface.FrequencyShift : 0;

            memoryEntry.GroupName = "Misc";
            if (_controlInterface.DetectorType == DetectorType.WFM)
            {
                var stationName = _controlInterface.RdsProgramService.Trim();
                memoryEntry.Name = string.Empty;
                if (!string.IsNullOrEmpty(stationName))
                {
                    memoryEntry.Name = stationName;
                }
                else
                {
                    memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType;
                }
            }
            else
            {
                memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType;
            }
            memoryEntry.IsFavourite = true;
            DoEdit(memoryEntry, true);
        }
コード例 #8
0
 public MemoryInfoEventArgs(MemoryEntry entry)
 {
     _memoryEntry = entry;
 }
コード例 #9
0
        private void DoReTuning(MemoryEntry Entry)
        {
            InitAverager();

               _controlInterface.FrequencyShiftEnabled = false;

            if (Entry.Shift != 0)
            {
            Entry.Frequency += Entry.Shift;
            }
            _controlInterface.DetectorType = Entry.DetectorType;
            _controlInterface.FilterBandwidth = (int)Entry.FilterBandwidth;
            _controlInterface.Frequency = Entry.Frequency;
            UpdateTimeLeft(_scanTime);
        }
コード例 #10
0
 public MemoryInfoEventArgs(MemoryEntry entry)
 {
     _memoryEntry = entry;
 }
コード例 #11
0
        public void Bookmark()
        {
            //if (_controlInterface.Frequency == 0) return;
            if (!_controlInterface.IsPlaying) return;

            var memoryEntry = new MemoryEntry();

            memoryEntry.DetectorType = _controlInterface.DetectorType;
            memoryEntry.Frequency = _controlInterface.Frequency;
            memoryEntry.FilterBandwidth = _controlInterface.FilterBandwidth;
            memoryEntry.Shift = _controlInterface.FrequencyShiftEnabled ? _controlInterface.FrequencyShift : 0;

            memoryEntry.GroupName = "Misc";
            if (_controlInterface.DetectorType == DetectorType.WFM)
            {
                var stationName = _controlInterface.RdsProgramService.Trim();
                memoryEntry.Name = string.Empty;
                if (!string.IsNullOrEmpty(stationName))
                {
                    memoryEntry.Name = stationName;
                }
                else
                {
                    memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType;
                }
            }
            else
            {
                memoryEntry.Name = GetFrequencyDisplay(_controlInterface.Frequency) + " " + memoryEntry.DetectorType;
            }
            memoryEntry.IsFavourite = true;
            DoEdit(memoryEntry, true);
        }
コード例 #12
0
 private void DoEdit(MemoryEntry memoryEntry, bool isNew)
 {
     var dialog = new DialogEntryInfo(memoryEntry, _groups);
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         if (isNew)
         {
             _entries.Add(memoryEntry);
             _entries.Sort((e1, e2) => e1.Frequency.CompareTo(e2.Frequency));
         }
         _settingsPersister.PersistStoredFrequencies(_entries);
         if (!_groups.Contains(memoryEntry.GroupName))
         {
             _groups.Add(memoryEntry.GroupName);
             ProcessGroups(memoryEntry.GroupName);
         }
         else
         {
             if ((string)comboGroups.SelectedItem == AllGroups || (string)comboGroups.SelectedItem == memoryEntry.GroupName ||
                 ((string)comboGroups.SelectedItem == FavouriteGroup && memoryEntry.IsFavourite))
             {
                 if (isNew)
                     _displayedEntries.Add(memoryEntry);
             }
             else
                 comboGroups.SelectedItem = memoryEntry.GroupName;
         }
     }
 }