2014-10-27 21:22:29 -04:00
|
|
|
#pragma once
|
|
|
|
|
2015-10-25 14:09:59 -04:00
|
|
|
#include <wx/frame.h>
|
|
|
|
#include <wx/panel.h>
|
|
|
|
#include <wx/splitter.h>
|
2015-10-27 01:56:49 -04:00
|
|
|
#include <wx/sizer.h>
|
2015-10-25 14:09:59 -04:00
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
#include "PrimaryGLContext.h"
|
2014-11-23 19:39:27 -05:00
|
|
|
|
2014-11-12 21:55:11 -05:00
|
|
|
#include "ScopeCanvas.h"
|
2014-11-15 23:41:41 -05:00
|
|
|
#include "SpectrumCanvas.h"
|
|
|
|
#include "WaterfallCanvas.h"
|
2014-12-31 19:45:01 -05:00
|
|
|
#include "MeterCanvas.h"
|
2015-01-04 17:11:20 -05:00
|
|
|
#include "TuningCanvas.h"
|
2015-01-05 19:12:16 -05:00
|
|
|
#include "ModeSelectorCanvas.h"
|
2015-10-27 01:56:49 -04:00
|
|
|
#include "GainCanvas.h"
|
2015-08-14 19:17:43 -04:00
|
|
|
#include "FFTVisualDataThread.h"
|
2015-10-20 23:00:10 -04:00
|
|
|
#include "SDRDeviceInfo.h"
|
2015-11-23 21:32:50 -05:00
|
|
|
#include "ModemProperties.h"
|
2015-08-14 19:17:43 -04:00
|
|
|
//#include "UITestCanvas.h"
|
2016-02-07 21:05:49 -05:00
|
|
|
#include "FrequencyDialog.h"
|
2014-12-31 19:45:01 -05:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2014-12-31 22:38:59 -05:00
|
|
|
#define wxID_RT_AUDIO_DEVICE 1000
|
2015-01-06 00:57:57 -05:00
|
|
|
#define wxID_SET_FREQ_OFFSET 2001
|
2015-01-10 12:27:03 -05:00
|
|
|
#define wxID_RESET 2002
|
2015-04-13 21:18:45 -04:00
|
|
|
#define wxID_SET_PPM 2003
|
2016-02-08 22:43:11 -05:00
|
|
|
#define wxID_SET_TIPS 2004
|
2016-02-15 15:07:57 -05:00
|
|
|
#define wxID_SET_IQSWAP 2005
|
2015-10-04 16:07:14 -04:00
|
|
|
#define wxID_SDR_DEVICES 2008
|
2015-10-27 01:56:49 -04:00
|
|
|
#define wxID_AGC_CONTROL 2009
|
2016-02-28 23:16:56 -05:00
|
|
|
#define wxID_SDR_START_STOP 2010
|
2016-03-31 21:32:50 -04:00
|
|
|
#define wxID_LOW_PERF 2011
|
2016-10-20 21:44:33 -04:00
|
|
|
#define wxID_SET_DB_OFFSET 2012
|
2014-11-19 17:41:49 -05:00
|
|
|
|
2015-10-25 14:09:59 -04:00
|
|
|
#define wxID_MAIN_SPLITTER 2050
|
|
|
|
#define wxID_VIS_SPLITTER 2051
|
2014-11-19 17:41:49 -05:00
|
|
|
|
2015-01-11 03:09:59 -05:00
|
|
|
#define wxID_THEME_DEFAULT 2100
|
|
|
|
#define wxID_THEME_SHARP 2101
|
|
|
|
#define wxID_THEME_BW 2102
|
|
|
|
#define wxID_THEME_RAD 2103
|
|
|
|
#define wxID_THEME_TOUCH 2104
|
|
|
|
#define wxID_THEME_HD 2105
|
|
|
|
#define wxID_THEME_RADAR 2106
|
|
|
|
|
2015-10-20 23:00:10 -04:00
|
|
|
#define wxID_BANDWIDTH_BASE 2150
|
|
|
|
#define wxID_BANDWIDTH_MANUAL 2200
|
2015-01-11 17:08:16 -05:00
|
|
|
|
2016-06-15 16:21:41 -04:00
|
|
|
#define wxID_DISPLAY_BASE 2250
|
|
|
|
|
2015-11-03 19:58:42 -05:00
|
|
|
#define wxID_SETTINGS_BASE 2300
|
2015-01-11 17:08:16 -05:00
|
|
|
|
2015-01-12 00:40:43 -05:00
|
|
|
#define wxID_DEVICE_ID 3500
|
|
|
|
|
2015-03-12 19:41:50 -04:00
|
|
|
#define wxID_AUDIO_BANDWIDTH_BASE 9000
|
|
|
|
#define wxID_AUDIO_DEVICE_MULTIPLIER 50
|
|
|
|
|
2016-01-03 19:00:26 -05:00
|
|
|
#ifdef USE_HAMLIB
|
|
|
|
#define wxID_RIG_TOGGLE 11900
|
|
|
|
#define wxID_RIG_PORT 11901
|
2016-01-09 00:09:46 -05:00
|
|
|
#define wxID_RIG_SDR_IF 11902
|
2016-02-16 01:13:26 -05:00
|
|
|
#define wxID_RIG_CONTROL 11903
|
|
|
|
#define wxID_RIG_FOLLOW 11904
|
2016-02-29 23:14:23 -05:00
|
|
|
#define wxID_RIG_CENTERLOCK 11905
|
|
|
|
#define wxID_RIG_FOLLOW_MODEM 11906
|
2016-01-03 19:00:26 -05:00
|
|
|
#define wxID_RIG_SERIAL_BASE 11950
|
|
|
|
#define wxID_RIG_MODEL_BASE 12000
|
|
|
|
#endif
|
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
// Define a new frame type
|
2014-10-28 21:39:59 -04:00
|
|
|
class AppFrame: public wxFrame {
|
2014-10-27 21:22:29 -04:00
|
|
|
public:
|
|
|
|
AppFrame();
|
2014-11-04 18:39:08 -05:00
|
|
|
~AppFrame();
|
2014-11-22 22:33:32 -05:00
|
|
|
void OnThread(wxCommandEvent& event);
|
2014-10-28 21:39:59 -04:00
|
|
|
void OnEventInput(wxThreadEvent& event);
|
2015-10-20 23:00:10 -04:00
|
|
|
void initDeviceParams(SDRDeviceInfo *devInfo);
|
2015-11-02 19:27:34 -05:00
|
|
|
void updateDeviceParams();
|
2014-11-16 16:51:45 -05:00
|
|
|
|
2015-01-09 17:17:56 -05:00
|
|
|
void saveSession(std::string fileName);
|
|
|
|
bool loadSession(std::string fileName);
|
|
|
|
|
2015-10-25 00:07:01 -04:00
|
|
|
FFTVisualDataThread *getWaterfallDataThread();
|
|
|
|
|
2016-07-28 10:46:18 -04:00
|
|
|
void notifyUpdateModemProperties();
|
2015-12-29 20:52:49 -05:00
|
|
|
void setMainWaterfallFFTSize(int fftSize);
|
2016-07-28 22:50:02 -04:00
|
|
|
void setScopeDeviceName(std::string deviceName);
|
2015-12-29 20:52:49 -05:00
|
|
|
|
2016-05-18 23:12:48 -04:00
|
|
|
void gkNudgeLeft(DemodulatorInstance *demod, int snap);
|
|
|
|
void gkNudgeRight(DemodulatorInstance *demod, int snap);
|
|
|
|
|
2016-02-07 18:01:11 -05:00
|
|
|
int OnGlobalKeyDown(wxKeyEvent &event);
|
|
|
|
int OnGlobalKeyUp(wxKeyEvent &event);
|
|
|
|
|
2016-02-07 21:05:49 -05:00
|
|
|
void setWaterfallLinesPerSecond(int lps);
|
|
|
|
void setSpectrumAvgSpeed(double avg);
|
|
|
|
|
|
|
|
FrequencyDialog::FrequencyDialogTarget getFrequencyDialogTarget();
|
2016-02-07 22:19:05 -05:00
|
|
|
void refreshGainUI();
|
2016-08-15 23:53:27 -04:00
|
|
|
void setViewState(long long center_freq, int bandwidth);
|
|
|
|
void setViewState(long long center_freq);
|
|
|
|
|
2016-08-16 17:55:40 -04:00
|
|
|
bool isUserDemodBusy();
|
|
|
|
|
2016-05-30 00:17:08 -04:00
|
|
|
#ifdef _WIN32
|
2016-05-29 21:03:21 -04:00
|
|
|
bool canFocus();
|
2016-05-30 00:17:08 -04:00
|
|
|
#endif
|
|
|
|
|
2014-10-27 21:22:29 -04:00
|
|
|
private:
|
2014-12-31 21:31:37 -05:00
|
|
|
void OnMenu(wxCommandEvent& event);
|
2015-07-15 00:32:36 -04:00
|
|
|
void OnClose(wxCloseEvent& event);
|
2014-10-27 21:22:29 -04:00
|
|
|
void OnNewWindow(wxCommandEvent& event);
|
2014-10-28 21:39:59 -04:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
2015-10-25 14:09:59 -04:00
|
|
|
void OnDoubleClickSash(wxSplitterEvent& event);
|
|
|
|
void OnUnSplit(wxSplitterEvent& event);
|
2016-06-20 13:28:26 -04:00
|
|
|
|
2014-11-15 23:41:41 -05:00
|
|
|
ScopeCanvas *scopeCanvas;
|
|
|
|
SpectrumCanvas *spectrumCanvas;
|
|
|
|
WaterfallCanvas *waterfallCanvas;
|
2015-01-05 19:12:16 -05:00
|
|
|
ModeSelectorCanvas *demodModeSelector;
|
2015-11-15 13:52:54 -05:00
|
|
|
#ifdef ENABLE_DIGITAL_LAB
|
2015-06-09 11:00:05 -04:00
|
|
|
ModeSelectorCanvas *demodModeSelectorAdv;
|
2015-11-15 13:52:54 -05:00
|
|
|
#endif
|
2014-12-29 00:24:10 -05:00
|
|
|
SpectrumCanvas *demodSpectrumCanvas;
|
2014-12-28 05:13:46 -05:00
|
|
|
WaterfallCanvas *demodWaterfallCanvas;
|
2014-12-31 19:45:01 -05:00
|
|
|
MeterCanvas *demodSignalMeter;
|
2015-01-10 20:33:30 -05:00
|
|
|
MeterCanvas *demodGainMeter;
|
2015-01-04 17:11:20 -05:00
|
|
|
TuningCanvas *demodTuner;
|
2015-08-11 23:52:03 -04:00
|
|
|
// UITestCanvas *testCanvas;
|
|
|
|
MeterCanvas *spectrumAvgMeter;
|
|
|
|
MeterCanvas *waterfallSpeedMeter;
|
2016-02-15 17:43:10 -05:00
|
|
|
ModeSelectorCanvas *demodMuteButton, *peakHoldButton, *soloModeButton, *deltaLockButton;
|
2015-10-27 01:56:49 -04:00
|
|
|
GainCanvas *gainCanvas;
|
|
|
|
wxSizerItem *gainSizerItem, *gainSpacerItem;
|
2015-10-25 14:09:59 -04:00
|
|
|
wxSplitterWindow *mainVisSplitter, *mainSplitter;
|
2015-10-27 01:56:49 -04:00
|
|
|
wxBoxSizer *demodTray;
|
2015-10-25 14:09:59 -04:00
|
|
|
|
2014-12-31 19:45:01 -05:00
|
|
|
DemodulatorInstance *activeDemodulator;
|
|
|
|
|
2014-12-31 22:38:59 -05:00
|
|
|
std::vector<RtAudio::DeviceInfo> devices;
|
2015-01-03 17:07:39 -05:00
|
|
|
std::map<int,RtAudio::DeviceInfo> inputDevices;
|
|
|
|
std::map<int,RtAudio::DeviceInfo> outputDevices;
|
2015-03-12 19:41:50 -04:00
|
|
|
std::map<int, wxMenuItem *> outputDeviceMenuItems;
|
|
|
|
std::map<int, wxMenuItem *> sampleRateMenuItems;
|
|
|
|
std::map<int, wxMenuItem *> audioSampleRateMenuItems;
|
2015-07-08 01:07:39 -04:00
|
|
|
std::map<int, wxMenuItem *> directSamplingMenuItems;
|
2015-11-02 21:04:02 -05:00
|
|
|
wxMenuBar *menuBar;
|
2016-06-20 13:28:26 -04:00
|
|
|
|
2015-10-20 23:00:10 -04:00
|
|
|
wxMenu *sampleRateMenu;
|
2016-06-15 16:21:41 -04:00
|
|
|
wxMenu *displayMenu;
|
2015-10-27 01:56:49 -04:00
|
|
|
wxMenuItem *agcMenuItem;
|
2016-02-15 15:07:57 -05:00
|
|
|
wxMenuItem *iqSwapMenuItem;
|
2016-03-31 21:32:50 -04:00
|
|
|
wxMenuItem *lowPerfMenuItem;
|
2015-11-03 19:58:42 -05:00
|
|
|
wxMenu *settingsMenu;
|
2016-06-20 13:28:26 -04:00
|
|
|
|
2015-11-03 23:44:35 -05:00
|
|
|
SoapySDR::ArgInfoList settingArgs;
|
|
|
|
int settingsIdMax;
|
2015-10-20 23:00:10 -04:00
|
|
|
std::vector<long> sampleRates;
|
2015-05-31 22:13:14 -04:00
|
|
|
|
2015-01-09 17:17:56 -05:00
|
|
|
std::string currentSessionFile;
|
2015-08-08 13:26:53 -04:00
|
|
|
|
2015-08-14 19:17:43 -04:00
|
|
|
FFTVisualDataThread *waterfallDataThread;
|
2015-08-08 13:26:53 -04:00
|
|
|
|
2015-08-14 19:17:43 -04:00
|
|
|
std::thread *t_FFTData;
|
2015-11-02 19:27:34 -05:00
|
|
|
SDRDeviceInfo *devInfo;
|
|
|
|
std::atomic_bool deviceChanged;
|
2015-11-23 21:32:50 -05:00
|
|
|
|
|
|
|
ModemProperties *modemProps;
|
2015-11-23 22:03:14 -05:00
|
|
|
std::atomic_bool modemPropertiesUpdated;
|
2016-02-09 00:10:15 -05:00
|
|
|
wxMenuItem *showTipMenuItem;
|
2015-08-14 19:17:43 -04:00
|
|
|
|
2016-03-31 21:32:50 -04:00
|
|
|
bool lowPerfMode;
|
|
|
|
|
2016-01-03 19:00:26 -05:00
|
|
|
#ifdef USE_HAMLIB
|
2016-02-16 01:13:26 -05:00
|
|
|
void enableRig();
|
|
|
|
void disableRig();
|
|
|
|
|
2016-01-03 19:00:26 -05:00
|
|
|
wxMenu *rigMenu;
|
|
|
|
wxMenuItem *rigEnableMenuItem;
|
|
|
|
wxMenuItem *rigPortMenuItem;
|
2016-02-16 01:13:26 -05:00
|
|
|
wxMenuItem *rigControlMenuItem;
|
|
|
|
wxMenuItem *rigFollowMenuItem;
|
2016-02-29 23:14:23 -05:00
|
|
|
wxMenuItem *rigCenterLockMenuItem;
|
|
|
|
wxMenuItem *rigFollowModemMenuItem;
|
2016-01-09 00:09:46 -05:00
|
|
|
wxMenuItem *sdrIFMenuItem;
|
2016-01-03 19:00:26 -05:00
|
|
|
std::map<int, wxMenuItem *> rigSerialMenuItems;
|
|
|
|
std::map<int, wxMenuItem *> rigModelMenuItems;
|
|
|
|
int rigModel;
|
|
|
|
int rigSerialRate;
|
2016-01-09 00:09:46 -05:00
|
|
|
long long rigSDRIF;
|
2016-01-03 19:00:26 -05:00
|
|
|
std::vector<int> rigSerialRates;
|
|
|
|
std::string rigPort;
|
|
|
|
int numRigs;
|
2016-02-16 01:13:26 -05:00
|
|
|
bool rigInit;
|
2016-01-03 19:00:26 -05:00
|
|
|
#endif
|
|
|
|
|
2014-12-28 05:13:46 -05:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
2014-10-27 21:22:29 -04:00
|
|
|
};
|