Add ENABLE_DIGITAL_LAB def

This commit is contained in:
Charles J. Cliffe 2015-11-15 13:52:54 -05:00
parent a96a3b2234
commit 6b3467e5c8
4 changed files with 35 additions and 6 deletions

View File

@ -17,8 +17,14 @@ ADD_DEFINITIONS(
-DCUBICSDR_VERSION="${CUBICSDR_VERSION}-${VERSION_SUFFIX}"
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
SET (ENABLE_DIGITAL_LAB OFF CACHE BOOL "Enable 'Digital Lab' testing features.")
IF(ENABLE_DIGITAL_LAB)
ADD_DEFINITIONS(
-DENABLE_DIGITAL_LAB=1
)
ENDIF()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
macro(configure_files srcDir destDir globStr)
message(STATUS "Copying ${srcDir}/${globStr} to directory ${destDir}")

View File

@ -77,6 +77,7 @@ AppFrame::AppFrame() :
demodModeSelector->setHelpTip("Choose modulation type: Frequency Modulation, Amplitude Modulation and Lower, Upper or Double Side-Band.");
demodTray->Add(demodModeSelector, 2, wxEXPAND | wxALL, 0);
#ifdef ENABLE_DIGITAL_LAB
demodModeSelectorAdv = new ModeSelectorCanvas(this, attribList);
demodModeSelectorAdv->addChoice(DEMOD_TYPE_ASK, "ASK");
demodModeSelectorAdv->addChoice(DEMOD_TYPE_APSK, "APSK");
@ -103,6 +104,7 @@ AppFrame::AppFrame() :
demodModeSelectorCons->addChoice(256, "256");
demodModeSelectorCons->setHelpTip("Choose number of constallations types.");
demodTray->Add(demodModeSelectorCons, 2, wxEXPAND | wxALL, 0);
#endif
wxGetApp().getDemodSpectrumProcessor()->setup(1024);
demodSpectrumCanvas = new SpectrumCanvas(demodPanel, attribList);
@ -854,10 +856,12 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
scopeCanvas->setDeviceName(outputDevices[outputDevice].name);
outputDeviceMenuItems[outputDevice]->Check(true);
int dType = demod->getDemodulatorType();
int dCons = demod->getDemodulatorCons();
demodModeSelector->setSelection(dType);
#ifdef ENABLE_DIGITAL_LAB
int dCons = demod->getDemodulatorCons();
demodModeSelectorAdv->setSelection(dType);
demodModeSelectorCons->setSelection(dCons);
#endif
demodMuteButton->setSelection(demod->isMuted()?1:-1);
}
if (demodWaterfallCanvas->getDragState() == WaterfallCanvas::WF_DRAG_NONE) {
@ -886,6 +890,7 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
demodSpectrumCanvas->setCenterFrequency(centerFreq);
}
int dSelection = demodModeSelector->getSelection();
#ifdef ENABLE_DIGITAL_LAB
int dSelectionadv = demodModeSelectorAdv->getSelection();
int dSelectionCons = demodModeSelectorCons->getSelection();
@ -904,6 +909,12 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
if (dSelectionCons != demod->getDemodulatorCons()) {
demod->setDemodulatorCons(dSelectionCons);
}
#else
// basic demodulators
if (dSelection != -1 && dSelection != demod->getDemodulatorType()) {
demod->setDemodulatorType(dSelection);
}
#endif
int muteMode = demodMuteButton->getSelection();
if (demodMuteButton->modeChanged()) {
@ -941,6 +952,7 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
DemodulatorMgr *mgr = &wxGetApp().getDemodMgr();
int dSelection = demodModeSelector->getSelection();
#ifdef ENABLE_DIGITAL_LAB
int dSelectionadv = demodModeSelectorAdv->getSelection();
int dSelectionCons = demodModeSelectorCons->getSelection();
@ -959,7 +971,12 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
if (dSelectionCons != mgr->getLastDemodulatorCons()) {
mgr->setLastDemodulatorCons(dSelectionCons);
}
#else
// basic demodulators
if (dSelection != -1 && dSelection != mgr->getLastDemodulatorType()) {
mgr->setLastDemodulatorType(dSelection);
}
#endif
demodGainMeter->setLevel(mgr->getLastGain());
if (demodSignalMeter->inputChanged()) {
mgr->setLastSquelchLevel(demodSignalMeter->getInputValue());

View File

@ -79,8 +79,10 @@ private:
SpectrumCanvas *spectrumCanvas;
WaterfallCanvas *waterfallCanvas;
ModeSelectorCanvas *demodModeSelector;
#ifdef ENABLE_DIGITAL_LAB
ModeSelectorCanvas *demodModeSelectorAdv;
ModeSelectorCanvas *demodModeSelectorCons;
#endif
SpectrumCanvas *demodSpectrumCanvas;
WaterfallCanvas *demodWaterfallCanvas;
MeterCanvas *demodSignalMeter;

View File

@ -20,6 +20,7 @@
IMPLEMENT_APP(CubicSDR)
#ifdef ENABLE_DIGITAL_LAB
// console output buffer for windows
#ifdef _WINDOWS
class outbuf : public std::streambuf {
@ -32,6 +33,7 @@ class outbuf : public std::streambuf {
}
};
#endif
#endif
#ifdef MINGW_PATCH
FILE _iob[] = { *stdin, *stdout, *stderr };
@ -147,6 +149,7 @@ bool CubicSDR::OnInit() {
return false;
}
#ifdef ENABLE_DIGITAL_LAB
// console output for windows
#ifdef _WINDOWS
if (AllocConsole()) {
@ -157,6 +160,7 @@ bool CubicSDR::OnInit() {
std::streambuf *sb = std::cout.rdbuf(&ob);
std::cout.rdbuf(sb);
#endif
#endif
wxApp::SetAppName("CubicSDR");