コード例 #1
0
        public void Initialize(ISharpControl control)
        {
            _control         = control;
            _gui             = new SpectrumAnalyzerPanel();
            _gui.OnScanning += OnScanning;

            _drawing = new SpectrumAnalyzerDrawing();
            _drawing.SetRanges(_gui.StartFreq, _gui.EndFreq, _gui.Step);
            if (_gui.ShowSpectrum == false)
            {
                _drawing.Hide();
            }

            _timer = new System.Threading.Timer(state => OnScanning(), null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);

            _gui.OnShowSpectrum += (show) =>
            {
                if (show)
                {
                    _drawing.Show();
                }
                else
                {
                    _drawing.Hide();
                }
            };

            _gui.OnExport   += Export;
            _gui.OnAutoScan += AutoScan;

            _control.RegisterFrontControl(_drawing, PluginPosition.Bottom);
            _control.RegisterStreamHook(this, ProcessorType.RawIQ);

            AutoScan();
        }
コード例 #2
0
        public SignalFinderProcessor(ISharpControl control)
        {
            _control = control;

            _display = new SignalFinderDisplay();

            _control.RegisterStreamHook(this, Radio.ProcessorType.RawIQ);
            _control.RegisterFrontControl(_display, PluginPosition.Bottom);
            _display.Visible = true;
        }
コード例 #3
0
        public void Initialize(ISharpControl control)
        {
            _frontEndControl = new FrontEndControl(control);
            _basicProcessor  = new BasicProcessor(control, _frontEndControl);
            _settingsControl = new SettingsControl(control, _frontEndControl, _basicProcessor);

            control.RegisterStreamHook(_basicProcessor, SDRSharp.Radio.ProcessorType.FilteredAudioOutput);
            control.RegisterFrontControl(_frontEndControl, PluginPosition.Bottom);

            _basicProcessor.Enabled = true;
        }
コード例 #4
0
        public void Initialize(ISharpControl control)
        {
            _control      = control;
            _frontPanel   = new FrontPanel(_control);
            _controlPanel = new ControlPanel(_frontPanel);
            _netServer    = new SdrNetServer();
            _netServer.Start();

            _control.RegisterFrontControl(_frontPanel, PluginPosition.Top);
            _control.RegisterStreamHook(this, ProcessorType.FilteredAudioOutput);
        }
コード例 #5
0
        public void Initialize(ISharpControl control)
        {
            _frontEndControl = new FrontEndControl(control);
            _basicProcessor = new BasicProcessor(control, _frontEndControl);
            _settingsControl = new SettingsControl(control, _basicProcessor);

            control.RegisterStreamHook(_basicProcessor, Radio.ProcessorType.FilteredAudioOutput);
            control.RegisterFrontControl(_frontEndControl, PluginPosition.Bottom);

            _basicProcessor.Enabled = true;
        }
コード例 #6
0
        public void Initialize(ISharpControl control)
        {
            MainControl = control;

            control.PropertyChanged += ControlOnPropertyChanged;

            _controlPanel = new SignalRecorderPanel();
            _controlPanel.PowerMonitorChanged += OnPowerMonitorChanged;

            _powerSpectrumPanel = new PowerSpectrumPanel(_controlPanel);
            OnPowerMonitorChanged();

            control.RegisterFrontControl(_powerSpectrumPanel, PluginPosition.Bottom);
            control.RegisterStreamHook(this, ProcessorType.RawIQ);
        }
コード例 #7
0
        public IFProcessor(ISharpControl control)
        {
            _control = control;
            _control.PropertyChanged += NotifyPropertyChangedHandler;
            Enabled = true;

            #region FFT Timer

            _fftTimer          = new System.Windows.Forms.Timer();
            _fftTimer.Tick    += fftTimer_Tick;
            _fftTimer.Interval = FFTTimerInterval;
            _fftBins           = FFTBins;

            #endregion

            #region FFT Buffers / Window

            InitFFTBuffers();
            BuildFFTWindow();

            #endregion

            #region Display component

            _spectrumAnalyzer                         = new SpectrumAnalyzer();
            _spectrumAnalyzer.Dock                    = DockStyle.Fill;
            _spectrumAnalyzer.Margin                  = new Padding(0, 0, 0, 0);
            _spectrumAnalyzer.DisplayRange            = 130;
            _spectrumAnalyzer.EnableFilter            = false;
            _spectrumAnalyzer.EnableHotTracking       = false;
            _spectrumAnalyzer.EnableSideFilterResize  = true;
            _spectrumAnalyzer.EnableFilterMove        = false;
            _spectrumAnalyzer.BandType                = BandType.Center;
            _spectrumAnalyzer.StepSize                = 1000;
            _spectrumAnalyzer.UseSmoothing            = true;
            _spectrumAnalyzer.Attack                  = 0.9f;
            _spectrumAnalyzer.Decay                   = 0.6f;
            _spectrumAnalyzer.StatusText              = "IF Spectrum";
            _spectrumAnalyzer.FrequencyChanged       += spectrumAnalyzer_FrequencyChanged;
            _spectrumAnalyzer.CenterFrequencyChanged += spectrumAnalyzer_CenterFrequencyChanged;
            _spectrumAnalyzer.BandwidthChanged       += spectrumAnalyzer_BandwidthChanged;
            _spectrumAnalyzer.VisibleChanged         += spectrumAnalyzer_VisibleChanged;

            #endregion

            _control.RegisterStreamHook(this, ProcessorType.DecimatedAndFilteredIQ);
            _control.RegisterFrontControl(_spectrumAnalyzer, (PluginPosition)Utils.GetIntSetting("zoomPosition", (int)PluginPosition.Bottom));
        }
コード例 #8
0
        public AFProcessor(ISharpControl control)
        {
            _control = control;
            _control.PropertyChanged += NotifyPropertyChangedHandler;
            Enabled = true;

            #region FFT Timer

            _fftTimer          = new System.Windows.Forms.Timer();
            _fftTimer.Tick    += fftTimer_Tick;
            _fftTimer.Interval = FFTTimerInterval;
            _fftBins           = FFTBins;

            #endregion

            #region FFT Buffers / Window

            InitFFTBuffers();
            BuildFFTWindow();

            #endregion

            #region Display component

            _spectrumAnalyzer                         = new SpectrumAnalyzer();
            _spectrumAnalyzer.Dock                    = DockStyle.Fill;
            _spectrumAnalyzer.Margin                  = new Padding(0, 0, 0, 0);
            _spectrumAnalyzer.DisplayRange            = 90;
            _spectrumAnalyzer.EnableFilter            = false;
            _spectrumAnalyzer.EnableHotTracking       = false;
            _spectrumAnalyzer.EnableFrequencyMarker   = false;
            _spectrumAnalyzer.StepSize                = 5000;
            _spectrumAnalyzer.UseSmoothing            = true;
            _spectrumAnalyzer.SpectrumWidth           = Utils.GetIntSetting("minOutputSampleRate", 32000) / 2;
            _spectrumAnalyzer.Frequency               = _spectrumAnalyzer.SpectrumWidth / 2;
            _spectrumAnalyzer.CenterFrequency         = _spectrumAnalyzer.SpectrumWidth / 2;
            _spectrumAnalyzer.Attack                  = 0.9f;
            _spectrumAnalyzer.Decay                   = 0.6f;
            _spectrumAnalyzer.StatusText              = "Linear Interpolated Basis Function"; //EDIT: changed spectrum alanyzer window title to match wavelet fn
            _spectrumAnalyzer.FrequencyChanged       += spectrumAnalyzer_FrequencyChanged;
            _spectrumAnalyzer.CenterFrequencyChanged += spectrumAnalyzer_CenterFrequencyChanged;
            _spectrumAnalyzer.VisibleChanged         += spectrumAnalyzer_VisibleChanged;

            #endregion

            _control.RegisterStreamHook(this, ProcessorType.FilteredAudioOutput);
            _control.RegisterFrontControl(_spectrumAnalyzer, (PluginPosition)Utils.GetIntSetting("zoomPosition", (int)PluginPosition.Bottom));
        }
コード例 #9
0
        public void Initialize(ISharpControl control)
        {
            Control = control;

            Directory.CreateDirectory(Settings.DataFolder());

            Settings = Settings.Load();

            //put example if no heat maps found
            if (Settings.HeatMaps.Count == 0)
            {
                Resources.Example.Save(Settings.BuildFilePath("Example"));
                Settings.HeatMaps.Add((new JavaScriptSerializer()).Deserialize <HeatMapInfo>(ExampleInfoStr));
            }

            HeatMapPanel = new HeatMapPanel(this);
            Control.RegisterFrontControl(HeatMapPanel, PluginPosition.Top);
            HeatMapPanel.Visible = false;

            SettingsPanel = new SettingsPanel(this);
        }
コード例 #10
0
        public void Initialize(ISharpControl control)
        {
            _control = control;
            _gui     = new PhaseInspectorPanel();
            _drawing = new PhaseInspectorDrawing();

            if (_gui.ShowPhase)
            {
                Enabled = true;
            }
            else
            {
                _drawing.Hide();
            }
            _drawing.ScaleFactor = _gui.ScaleFactor;

            _gui.OnShowPhase += (show) =>
            {
                if (show)
                {
                    _drawing.Clear();
                    _drawing.Show();
                }
                else
                {
                    _drawing.Hide();
                }

                Enabled = show;
            };

            _gui.OnScaleChange += (scale) =>
            {
                _drawing.ScaleFactor = scale;
            };

            control.RegisterStreamHook(this, ProcessorType.RawIQ);
            control.RegisterFrontControl(_drawing, PluginPosition.Bottom);
        }
コード例 #11
0
        public IFProcessor(ISharpControl control)
        {
            _control = control;
            _control.PropertyChanged += NotifyPropertyChangedHandler;
            Enabled = true;

            #region FFT Timer

            _fftTimer = new System.Windows.Forms.Timer();
            _fftTimer.Tick += fftTimer_Tick;
            _fftTimer.Interval = FFTTimerInterval;
            _fftBins = FFTBins;

            #endregion

            #region FFT Buffers / Window

            InitFFTBuffers();
            BuildFFTWindow();

            #endregion

            #region Display component

            _spectrumAnalyzer = new SpectrumAnalyzer();
            _spectrumAnalyzer.Dock = DockStyle.Fill;
            _spectrumAnalyzer.Margin = new Padding(0, 0, 0, 0);
            _spectrumAnalyzer.DisplayRange = 130;
            _spectrumAnalyzer.EnableFilter = false;
            _spectrumAnalyzer.EnableHotTracking = false;
            _spectrumAnalyzer.EnableSideFilterResize = true;
            _spectrumAnalyzer.EnableFilterMove = false;
            _spectrumAnalyzer.BandType = BandType.Center;
            _spectrumAnalyzer.StepSize = 1000;
            _spectrumAnalyzer.UseSmoothing = true;
            _spectrumAnalyzer.Attack = 0.9f;
            _spectrumAnalyzer.Decay = 0.6f;
            _spectrumAnalyzer.StatusText = "Haar Basis Function";  //EDIT: changed spectrum alanyzer window title to match wavelet fn
            _spectrumAnalyzer.FrequencyChanged += spectrumAnalyzer_FrequencyChanged;
            _spectrumAnalyzer.CenterFrequencyChanged += spectrumAnalyzer_CenterFrequencyChanged;
            _spectrumAnalyzer.BandwidthChanged += spectrumAnalyzer_BandwidthChanged;
            _spectrumAnalyzer.VisibleChanged += spectrumAnalyzer_VisibleChanged;

            #endregion

            _control.RegisterStreamHook(this, ProcessorType.DecimatedAndFilteredIQ);
            _control.RegisterFrontControl(_spectrumAnalyzer, (PluginPosition) Utils.GetIntSetting("zoomPosition", (int) PluginPosition.Bottom));
        }
コード例 #12
0
ファイル: MainPlugin.cs プロジェクト: CaseyK9/SDR-RPC
        public void Initialize(ISharpControl control)
        {
            IConfigurationPanelProvider configurationPanelProvider;

            if (Utils.GetBooleanSetting("ShowWelcomePage", true))
            {
                new WelcomeForm().ShowDialog();
            }

            _controlPanel  = new SettingsPanel();
            windowMessages = new TopWindowMessages(); // TODO: do something when "EnableRPCInvite" is set to false
            _control       = control;
            try
            {
                if (Utils.GetBooleanSetting("EnableRPCInvite", false))
                {
                    _control.RegisterFrontControl(windowMessages, PluginPosition.Top);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            if (Utils.GetBooleanSetting("EnableRPCInvite", false))
            {
                presence.Secrets = new Secrets()
                {
                    JoinSecret = "invalid_secret"
                };
                presence.Party = new Party()
                {
                    ID   = Secrets.CreateFriendlySecret(new Random()),
                    Size = 1,
                    Max  = 100
                };
            }

            if (Utils.GetBooleanSetting("EnableRPCInvite", false))
            {
                windowMessages.Show();
            }

            if (Utils.GetBooleanSetting("EnableRPC", true))
            {
                if (RPCalreadyLoaded)
                {
                    _controlPanel.ChangeStatus = "Restart required";
                    return;
                }
                if (Utils.GetStringSetting("ClientID").Replace(" ", "").Length != 18)
                {
                    client = new DiscordRpcClient("765213507321856078", pipe: discordPipe)
                    {
                        Logger = new ConsoleLogger(logLevel, true)
                    };
                }
                else
                {
                    client = new DiscordRpcClient(Utils.GetStringSetting("ClientID"), pipe: discordPipe)
                    {
                        Logger = new ConsoleLogger(logLevel, true)
                    };
                }

                client.RegisterUriScheme();
                client.OnRpcMessage            += Client_OnRpcMessage;
                client.OnPresenceUpdate        += Client_OnPresenceUpdate;
                client.OnReady                 += OnReady;
                client.OnClose                 += OnClose;
                client.OnError                 += OnError;
                client.OnConnectionEstablished += OnConnectionEstablished;
                client.OnConnectionFailed      += OnConnectionFailed;
                client.OnSubscribe             += OnSubscribe;
                client.OnUnsubscribe           += OnUnsubscribe;
                client.OnJoin          += OnJoin;
                client.OnJoinRequested += OnJoinRequested;
                presence.Timestamps     = new Timestamps()
                {
                    Start = DateTime.UtcNow
                };

                if (Utils.GetBooleanSetting("EnableRPCInvite", false))
                {
                    client.SetSubscription(EventType.Join | EventType.JoinRequest);
                }

                client.SetPresence(presence);
                client.Initialize();
                try
                {
                    configurationPanelProvider = (IConfigurationPanelProvider)_control.Source;
                    controllerPanel            = (SDRSharp.FrontEnds.SpyServer.ControllerPanel)configurationPanelProvider.Gui;
                }
                catch (Exception ex)
                {
                    LogWriter.WriteToFile("----> " + ex);
                    MessageBox.Show($"Cannot get Spy Server Network address\n\nError:\n{ex}", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                _ = MainLoop();
            }
            else
            {
                _controlPanel.ChangeStatus = "RPC is disabled";
            }
            LogWriter.WriteToFile("EOM Initialize");
        }
コード例 #13
0
        public MPXProcessor(ISharpControl control)
        {
            _control = control;
            _control.PropertyChanged += NotifyPropertyChangedHandler;
            Enabled = true;

            #region FFT Timer

            _fftTimer = new System.Windows.Forms.Timer();
            _fftTimer.Tick += fftTimer_Tick;
            _fftTimer.Interval = FFTTimerInterval;
            _fftBins = FFTBins;

            #endregion

            #region FFT Buffers / Window

            InitFFTBuffers();
            BuildFFTWindow();

            #endregion

            #region Display component

            _spectrumAnalyzer = new SpectrumAnalyzer();
            _spectrumAnalyzer.Dock = DockStyle.Fill;
            _spectrumAnalyzer.Margin = new Padding(0, 0, 0, 0);
            _spectrumAnalyzer.DisplayRange = 90;
            _spectrumAnalyzer.EnableFilter = false;
            _spectrumAnalyzer.EnableHotTracking = false;
            _spectrumAnalyzer.EnableFrequencyMarker = false;
            _spectrumAnalyzer.StepSize = 19000;
            _spectrumAnalyzer.UseSmoothing = true;
            _spectrumAnalyzer.SpectrumWidth = 100000;//Utils.GetIntSetting("minOutputSampleRate", 32000) / 2;
            _spectrumAnalyzer.Frequency = _spectrumAnalyzer.SpectrumWidth / 2;
            _spectrumAnalyzer.CenterFrequency = _spectrumAnalyzer.SpectrumWidth / 2;
            _spectrumAnalyzer.Attack = 0.9f;
            _spectrumAnalyzer.Decay = 0.6f;
            _spectrumAnalyzer.StatusText = "FM MPX Spectrum";
            _spectrumAnalyzer.FrequencyChanged += spectrumAnalyzer_FrequencyChanged;
            _spectrumAnalyzer.CenterFrequencyChanged += spectrumAnalyzer_CenterFrequencyChanged;
            _spectrumAnalyzer.VisibleChanged += spectrumAnalyzer_VisibleChanged;

            #endregion

            _control.RegisterStreamHook(this, ProcessorType.FMMPX);
            _control.RegisterFrontControl(_spectrumAnalyzer, (PluginPosition) Utils.GetIntSetting("zoomPosition", (int) PluginPosition.Bottom));
        }