mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-09-28 08:16:37 -04:00
Add bookmark panel to appframe layout, implement some methods
This commit is contained in:
parent
ba7a0d8cd3
commit
488e8ed9e7
@ -232,10 +232,13 @@ AppFrame::AppFrame() :
|
|||||||
|
|
||||||
// vbox->Add(demodTray, 12, wxEXPAND | wxALL, 0);
|
// vbox->Add(demodTray, 12, wxEXPAND | wxALL, 0);
|
||||||
// vbox->AddSpacer(1);
|
// vbox->AddSpacer(1);
|
||||||
|
bookmarkSplitter = new wxSplitterWindow( mainSplitter, wxID_VIS_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE );
|
||||||
mainVisSplitter = new wxSplitterWindow( mainSplitter, wxID_VIS_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE );
|
bookmarkSplitter->SetMinimumPaneSize(1);
|
||||||
mainVisSplitter->SetSashGravity(6.0/25.0);
|
bookmarkSplitter->SetSashGravity(1.0/20.0);
|
||||||
|
|
||||||
|
mainVisSplitter = new wxSplitterWindow( bookmarkSplitter, wxID_VIS_SPLITTER, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH | wxSP_LIVE_UPDATE );
|
||||||
mainVisSplitter->SetMinimumPaneSize(1);
|
mainVisSplitter->SetMinimumPaneSize(1);
|
||||||
|
mainVisSplitter->SetSashGravity(6.0/25.0);
|
||||||
|
|
||||||
// mainVisSplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( AppFrame::mainVisSplitterIdle ), NULL, this );
|
// mainVisSplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( AppFrame::mainVisSplitterIdle ), NULL, this );
|
||||||
|
|
||||||
@ -309,7 +312,11 @@ AppFrame::AppFrame() :
|
|||||||
// vbox->Add(wfSizer, 20, wxEXPAND | wxALL, 0);
|
// vbox->Add(wfSizer, 20, wxEXPAND | wxALL, 0);
|
||||||
|
|
||||||
mainVisSplitter->SplitHorizontally( spectrumPanel, waterfallPanel, 0 );
|
mainVisSplitter->SplitHorizontally( spectrumPanel, waterfallPanel, 0 );
|
||||||
mainSplitter->SplitHorizontally( demodPanel, mainVisSplitter );
|
|
||||||
|
bookmarkPanel = new BookmarkPanel(bookmarkSplitter, wxID_ANY, wxDefaultPosition, wxSize(120,-1));
|
||||||
|
|
||||||
|
bookmarkSplitter->SplitVertically( bookmarkPanel, mainVisSplitter );
|
||||||
|
mainSplitter->SplitHorizontally( demodPanel, bookmarkSplitter );
|
||||||
|
|
||||||
vbox->Add(mainSplitter, 1, wxEXPAND | wxALL, 0);
|
vbox->Add(mainSplitter, 1, wxEXPAND | wxALL, 0);
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "ModemProperties.h"
|
#include "ModemProperties.h"
|
||||||
//#include "UITestCanvas.h"
|
//#include "UITestCanvas.h"
|
||||||
#include "FrequencyDialog.h"
|
#include "FrequencyDialog.h"
|
||||||
#include "BookmarkMgr.h"
|
|
||||||
#include "BookmarkView.h"
|
#include "BookmarkView.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -135,8 +134,9 @@ private:
|
|||||||
ModeSelectorCanvas *demodMuteButton, *peakHoldButton, *soloModeButton, *deltaLockButton;
|
ModeSelectorCanvas *demodMuteButton, *peakHoldButton, *soloModeButton, *deltaLockButton;
|
||||||
GainCanvas *gainCanvas;
|
GainCanvas *gainCanvas;
|
||||||
wxSizerItem *gainSizerItem, *gainSpacerItem;
|
wxSizerItem *gainSizerItem, *gainSpacerItem;
|
||||||
wxSplitterWindow *mainVisSplitter, *mainSplitter;
|
wxSplitterWindow *mainVisSplitter, *mainSplitter, *bookmarkSplitter;
|
||||||
wxBoxSizer *demodTray;
|
wxBoxSizer *demodTray;
|
||||||
|
BookmarkPanel *bookmarkPanel;
|
||||||
|
|
||||||
DemodulatorInstance *activeDemodulator;
|
DemodulatorInstance *activeDemodulator;
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "BookmarkMgr.h"
|
#include "BookmarkMgr.h"
|
||||||
|
#include "CubicSDR.h"
|
||||||
|
#include "DataTree.h"
|
||||||
|
|
||||||
|
|
||||||
void BookmarkMgr::saveToFile(std::string bookmarkFn) {
|
void BookmarkMgr::saveToFile(std::string bookmarkFn) {
|
||||||
@ -12,17 +14,47 @@ void BookmarkMgr::loadFromFile(std::string bookmarkFn) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkMgr::addBookmark(std::string group, DemodulatorInstance *demod) {
|
void BookmarkMgr::addBookmark(std::string group, DemodulatorInstance *demod, std::string folder) {
|
||||||
std::lock_guard < std::mutex > lock(busy_lock);
|
std::lock_guard < std::mutex > lock(busy_lock);
|
||||||
|
|
||||||
|
BookmarkEntry *be = new BookmarkEntry;
|
||||||
|
|
||||||
|
be->bandwidth = demod->getBandwidth();
|
||||||
|
be->type = demod->getDemodulatorType();
|
||||||
|
be->label = demod->getLabel();
|
||||||
|
be->frequency = demod->getFrequency();
|
||||||
|
be->folder = folder;
|
||||||
|
|
||||||
|
wxGetApp().getDemodMgr().saveInstance(be->node, demod);
|
||||||
|
|
||||||
|
bmData[group].insert(be);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BookmarkMgr::removeBookmark(std::string group, BookmarkEntry *be) {
|
||||||
|
std::lock_guard < std::mutex > lockData(busy_lock);
|
||||||
|
std::lock_guard < std::mutex > lockEnt(be->busy_lock);
|
||||||
|
|
||||||
|
bmData[group].erase(be);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BookmarkList BookmarkMgr::getBookmarks(std::string group, std::string folder) {
|
BookmarkList BookmarkMgr::getBookmarks(std::string group, std::string folder) {
|
||||||
std::lock_guard < std::mutex > lock(busy_lock);
|
std::lock_guard < std::mutex > lock(busy_lock);
|
||||||
|
|
||||||
BookmarkList results;
|
BookmarkList results;
|
||||||
|
|
||||||
|
if (folder != "") {
|
||||||
|
for (auto be_i : bmData[group]) {
|
||||||
|
results.push_back(be_i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (auto be_i : bmData[group]) {
|
||||||
|
if (be_i->folder != folder) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
results.push_back(be_i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <set>
|
||||||
|
|
||||||
#include "DataTree.h"
|
|
||||||
#include "DemodulatorInstance.h"
|
#include "DemodulatorInstance.h"
|
||||||
|
|
||||||
|
class DataNode;
|
||||||
|
|
||||||
class BookmarkEntry {
|
class BookmarkEntry {
|
||||||
public:
|
public:
|
||||||
std::mutex busy_lock;
|
std::mutex busy_lock;
|
||||||
@ -20,15 +21,25 @@ public:
|
|||||||
DataNode *node;
|
DataNode *node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BookmarkEntryCompare : public std::binary_function<BookmarkEntry *,BookmarkEntry *,bool>
|
||||||
|
{
|
||||||
|
bool operator()(const BookmarkEntry *a, BookmarkEntry *b) const
|
||||||
|
{
|
||||||
|
return a->frequency < b->frequency;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef std::vector<BookmarkEntry *> BookmarkList;
|
typedef std::vector<BookmarkEntry *> BookmarkList;
|
||||||
typedef std::map<std::string, std::map<long long, BookmarkEntry *> > BookmarkMap;
|
typedef std::map<std::string, std::set<BookmarkEntry *, BookmarkEntryCompare> > BookmarkMap;
|
||||||
|
|
||||||
class BookmarkMgr {
|
class BookmarkMgr {
|
||||||
public:
|
public:
|
||||||
void saveToFile(std::string bookmarkFn);
|
void saveToFile(std::string bookmarkFn);
|
||||||
void loadFromFile(std::string bookmarkFn);
|
void loadFromFile(std::string bookmarkFn);
|
||||||
|
|
||||||
void addBookmark(std::string group, DemodulatorInstance *demod);
|
void addBookmark(std::string group, DemodulatorInstance *demod, std::string folder = "");
|
||||||
|
void removeBookmark(std::string group, BookmarkEntry *be);
|
||||||
BookmarkList getBookmarks(std::string group, std::string folder = "");
|
BookmarkList getBookmarks(std::string group, std::string folder = "");
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -671,6 +671,10 @@ DemodulatorMgr &CubicSDR::getDemodMgr() {
|
|||||||
return demodMgr;
|
return demodMgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BookmarkMgr &CubicSDR::getBookmarkMgr() {
|
||||||
|
return bookmarkMgr;
|
||||||
|
}
|
||||||
|
|
||||||
SDRPostThread *CubicSDR::getSDRPostThread() {
|
SDRPostThread *CubicSDR::getSDRPostThread() {
|
||||||
return sdrPostThread;
|
return sdrPostThread;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "AppFrame.h"
|
#include "AppFrame.h"
|
||||||
#include "FrequencyDialog.h"
|
#include "FrequencyDialog.h"
|
||||||
#include "DemodLabelDialog.h"
|
#include "DemodLabelDialog.h"
|
||||||
|
#include "BookmarkMgr.h"
|
||||||
|
|
||||||
#include "ScopeVisualProcessor.h"
|
#include "ScopeVisualProcessor.h"
|
||||||
#include "SpectrumVisualProcessor.h"
|
#include "SpectrumVisualProcessor.h"
|
||||||
@ -111,6 +112,7 @@ public:
|
|||||||
DemodulatorThreadInputQueue* getWaterfallVisualQueue();
|
DemodulatorThreadInputQueue* getWaterfallVisualQueue();
|
||||||
DemodulatorThreadInputQueue* getActiveDemodVisualQueue();
|
DemodulatorThreadInputQueue* getActiveDemodVisualQueue();
|
||||||
DemodulatorMgr &getDemodMgr();
|
DemodulatorMgr &getDemodMgr();
|
||||||
|
BookmarkMgr &getBookmarkMgr();
|
||||||
|
|
||||||
SDRPostThread *getSDRPostThread();
|
SDRPostThread *getSDRPostThread();
|
||||||
SDRThread *getSDRThread();
|
SDRThread *getSDRThread();
|
||||||
@ -179,6 +181,7 @@ private:
|
|||||||
std::vector<SDRDeviceInfo *> *devs = nullptr;
|
std::vector<SDRDeviceInfo *> *devs = nullptr;
|
||||||
|
|
||||||
DemodulatorMgr demodMgr;
|
DemodulatorMgr demodMgr;
|
||||||
|
BookmarkMgr bookmarkMgr;
|
||||||
|
|
||||||
std::atomic_llong frequency;
|
std::atomic_llong frequency;
|
||||||
std::atomic_llong offset;
|
std::atomic_llong offset;
|
||||||
|
@ -26,14 +26,14 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
|||||||
|
|
||||||
m_staticText1 = new wxStaticText( m_propPanel, wxID_ANY, wxT("Label"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticText1 = new wxStaticText( m_propPanel, wxID_ANY, wxT("Label"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText1->Wrap( -1 );
|
m_staticText1->Wrap( -1 );
|
||||||
fgPropSizer->Add( m_staticText1, 0, wxALIGN_RIGHT|wxALL, 5 );
|
fgPropSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
m_labelText = new wxTextCtrl( m_propPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_labelText = new wxTextCtrl( m_propPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
fgPropSizer->Add( m_labelText, 0, wxALL|wxEXPAND|wxLEFT|wxTOP, 5 );
|
fgPropSizer->Add( m_labelText, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_frequencyLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Freq"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_frequencyLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Freq"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_frequencyLabel->Wrap( -1 );
|
m_frequencyLabel->Wrap( -1 );
|
||||||
fgPropSizer->Add( m_frequencyLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
fgPropSizer->Add( m_frequencyLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
m_frequencyVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("FrequencyVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_frequencyVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("FrequencyVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_frequencyVal->Wrap( -1 );
|
m_frequencyVal->Wrap( -1 );
|
||||||
@ -41,7 +41,7 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
|||||||
|
|
||||||
m_bandwidthLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("BW"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_bandwidthLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("BW"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_bandwidthLabel->Wrap( -1 );
|
m_bandwidthLabel->Wrap( -1 );
|
||||||
fgPropSizer->Add( m_bandwidthLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
fgPropSizer->Add( m_bandwidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
m_bandwidthVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("BandwidthVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_bandwidthVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("BandwidthVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_bandwidthVal->Wrap( -1 );
|
m_bandwidthVal->Wrap( -1 );
|
||||||
@ -49,7 +49,7 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
|||||||
|
|
||||||
m_modulationLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Type"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_modulationLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Type"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_modulationLabel->Wrap( -1 );
|
m_modulationLabel->Wrap( -1 );
|
||||||
fgPropSizer->Add( m_modulationLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
fgPropSizer->Add( m_modulationLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
m_typeVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("TypeVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_typeVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("TypeVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_typeVal->Wrap( -1 );
|
m_typeVal->Wrap( -1 );
|
||||||
@ -62,10 +62,10 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
|||||||
bSizer1->Add( m_propPanel, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
|
bSizer1->Add( m_propPanel, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
|
||||||
|
|
||||||
m_bookmarkButton = new wxButton( this, wxID_ANY, wxT("Bookmark"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_bookmarkButton = new wxButton( this, wxID_ANY, wxT("Bookmark"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizer1->Add( m_bookmarkButton, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
|
bSizer1->Add( m_bookmarkButton, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_activateButton = new wxButton( this, wxID_ANY, wxT("Activate"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_activateButton = new wxButton( this, wxID_ANY, wxT("Activate"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizer1->Add( m_activateButton, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
|
bSizer1->Add( m_activateButton, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_removeButton = new wxButton( this, wxID_ANY, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_removeButton = new wxButton( this, wxID_ANY, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizer1->Add( m_removeButton, 0, wxALL|wxEXPAND, 5 );
|
bSizer1->Add( m_removeButton, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
@ -277,7 +277,7 @@
|
|||||||
<property name="vgap">0</property>
|
<property name="vgap">0</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="0">
|
<object class="wxStaticText" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -360,7 +360,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL|wxEXPAND|wxLEFT|wxTOP</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxTextCtrl" expanded="0">
|
<object class="wxTextCtrl" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -451,7 +451,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="1">
|
<object class="wxStaticText" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -617,7 +617,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="1">
|
<object class="wxStaticText" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -783,7 +783,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="1">
|
<object class="wxStaticText" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -952,7 +952,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL|wxEXPAND</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxButton" expanded="1">
|
<object class="wxButton" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
@ -1040,7 +1040,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALIGN_RIGHT|wxALL|wxEXPAND</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxButton" expanded="1">
|
<object class="wxButton" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -1,7 +1,29 @@
|
|||||||
#include "BookmarkView.h"
|
#include "BookmarkView.h"
|
||||||
|
#include "CubicSDR.h"
|
||||||
|
|
||||||
BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) {
|
BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) {
|
||||||
|
doUpdateActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BookmarkView::updateActiveList() {
|
||||||
|
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();
|
||||||
|
|
||||||
|
DemodulatorInstance *activeDemodulator = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||||
|
DemodulatorInstance *lastActiveDemodulator = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
|
||||||
|
m_treeView->Disable();
|
||||||
|
m_treeView->DeleteAllItems();
|
||||||
|
activeItems.erase(activeItems.begin(),activeItems.end());
|
||||||
|
|
||||||
|
activeBranch = m_treeView->AddRoot("Active");
|
||||||
|
|
||||||
|
for (auto demod_i : demods) {
|
||||||
|
wxTreeItemId itm = m_treeView->AppendItem(activeBranch,demod_i->getLabel());
|
||||||
|
activeItems[itm] = demod_i;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_treeView->Enable();
|
||||||
|
m_treeView->ExpandAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkView::onTreeBeginLabelEdit( wxTreeEvent& event ) {
|
void BookmarkView::onTreeBeginLabelEdit( wxTreeEvent& event ) {
|
||||||
|
@ -23,5 +23,7 @@ protected:
|
|||||||
void onActivate( wxCommandEvent& event );
|
void onActivate( wxCommandEvent& event );
|
||||||
void onRemove( wxCommandEvent& event );
|
void onRemove( wxCommandEvent& event );
|
||||||
|
|
||||||
|
bool doUpdateActive;
|
||||||
|
wxTreeItemId activeBranch;
|
||||||
|
std::map<wxTreeItemId, DemodulatorInstance *> activeItems;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user