Now passing IQ data from SDR Thread to AppFrame

This commit is contained in:
Charles J. Cliffe
2014-10-28 21:39:59 -04:00
parent 0e25cbcc1a
commit 23f8c6a197
9 changed files with 168 additions and 35 deletions
+20 -2
View File
@@ -10,9 +10,14 @@
#error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild the library"
#endif
#include <vector>
#include "SDRThread.h"
wxBEGIN_EVENT_TABLE(AppFrame, wxFrame) EVT_MENU(wxID_NEW, AppFrame::OnNewWindow)
wxBEGIN_EVENT_TABLE(AppFrame, wxFrame)
//EVT_MENU(wxID_NEW, AppFrame::OnNewWindow)
EVT_MENU(wxID_CLOSE, AppFrame::OnClose)
EVT_THREAD(EVENT_SDR_INPUT, AppFrame::OnEventInput)
EVT_IDLE(AppFrame::OnIdle)
wxEND_EVENT_TABLE()
AppFrame::AppFrame() :
@@ -22,7 +27,7 @@ AppFrame::AppFrame() :
// SetIcon(wxICON(sample));
// Make a menubar
// Make a menubar
wxMenu *menu = new wxMenu;
// menu->Append(wxID_NEW);
// menu->AppendSeparator();
@@ -50,3 +55,16 @@ void AppFrame::OnClose(wxCommandEvent& WXUNUSED(event)) {
void AppFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) {
new AppFrame();
}
void AppFrame::OnEventInput(wxThreadEvent& event) {
std::vector<unsigned char> *new_buffer = event.GetPayload<std::vector<unsigned char> *>();
std::cout << "Got IQ buffer, length: " << new_buffer->size() << std::endl;
delete new_buffer;
}
void AppFrame::OnIdle(wxIdleEvent& event) {
event.Skip();
}