mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-07-04 01:21:32 -04:00
Now passing IQ data from SDR Thread to AppFrame
This commit is contained in:
+20
-2
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user