private void scanMarkersMenu_Click(object sender, EventArgs e)
        {
            if (!ScanFrequenciesEnabled)
            {
                ScanStartFreq = 0;
                ScanEndFreq   = 0;

                ScanFrequencies.Clear();
                foreach (FrequencyMarker marker in MarkerList.Markers)
                {
                    ScanFrequencies.AddLast(marker);
                }

                CurrentScanFreq        = ScanFrequencies.First;
                ChannelBandDetails     = new FrequencyBand();
                ScanStrongestFrequency = true;
                ScanFrequenciesEnabled = true;

                if (!FitSpectrum)
                {
                    fitSpectrumMenu_Click(null, null);
                }
            }
            else
            {
                ScanFrequenciesEnabled = false;
            }

            scanBandMenu.Checked     = false;
            scanBandMenu.Enabled     = !ScanFrequenciesEnabled;
            scanChannelsMenu.Checked = false;
            scanChannelsMenu.Enabled = !ScanFrequenciesEnabled;
            scanMarkersMenu.Checked  = ScanFrequenciesEnabled;
            scanMarkersMenu.Enabled  = true;
        }
        private void scanChannelsMenu_Click(object sender, EventArgs e)
        {
            if (!DeviceOpened)
            {
                return;
            }

            if (!ScanFrequenciesEnabled)
            {
                FrequencyBand band = new FrequencyBand();
                band.BaseFrequency   = 935014000;
                band.ChannelStart    = 2;
                band.ChannelEnd      = 124;
                band.ChannelDistance = 200000;

                FrequencyBandDetailsDialog dlg = new FrequencyBandDetailsDialog(band);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    ScanStartFreq = 0;
                    ScanEndFreq   = 0;

                    ScanFrequencies.Clear();
                    for (long channel = band.ChannelStart; channel <= band.ChannelEnd; channel++)
                    {
                        ScanFrequencies.AddLast(new FrequencyMarker("Ch. " + channel, "", band.BaseFrequency + (channel - band.ChannelStart) * band.ChannelDistance));
                    }

                    CurrentScanFreq    = ScanFrequencies.First;
                    ChannelBandDetails = band;

                    ScanStrongestFrequency = false;
                    ScanFrequenciesEnabled = true;

                    if (!FitSpectrum)
                    {
                        fitSpectrumMenu_Click(null, null);
                    }
                }
                else
                {
                    ScanFrequenciesEnabled = false;
                }
            }
            else
            {
                ScanFrequenciesEnabled = false;
            }

            scanBandMenu.Checked     = false;
            scanBandMenu.Enabled     = !ScanFrequenciesEnabled;
            scanChannelsMenu.Checked = ScanFrequenciesEnabled;
            scanChannelsMenu.Enabled = true;
            scanMarkersMenu.Checked  = false;
            scanMarkersMenu.Enabled  = !ScanFrequenciesEnabled;
        }