From 7d9f03b41b51befc4b433281c609a4fd6bb948f3 Mon Sep 17 00:00:00 2001 From: wittend99 Date: Sun, 25 Nov 2012 02:38:37 +0000 Subject: [PATCH] Work on PTT control dialog. Not finished... git-svn-id: https://svn.code.sf.net/p/freetel/code@1062 01035d8c-6547-0410-b346-abe4f91aad63 --- fdmdv2/build/fdmdv2.mk | 31 ++++---- fdmdv2/build/fdmdv2.txt | 2 +- fdmdv2/build/fdmdv2.workspace | 4 +- fdmdv2/build/fdmdv2_wsp.mk | 6 +- fdmdv2/src/Makefile.win32.dmw | 46 +++++++++++ fdmdv2/src/dlg_comports.cpp | 132 +++++++++++++++++++++++++------- fdmdv2/src/dlg_comports.h | 15 ++-- fdmdv2/src/fdmdv2_main.cpp | 6 +- fdmdv2/src/fdmdv2_main.h | 1 + fdmdv2/src/topFrame.cpp | 14 +--- fdmdv2/src/topFrame.h | 8 +- fdmdv2/tests/pa_enum/pa_enum.mk | 52 ++++++------- 12 files changed, 213 insertions(+), 104 deletions(-) create mode 100644 fdmdv2/src/Makefile.win32.dmw diff --git a/fdmdv2/build/fdmdv2.mk b/fdmdv2/build/fdmdv2.mk index 3a51438d..d977bee3 100644 --- a/fdmdv2/build/fdmdv2.mk +++ b/fdmdv2/build/fdmdv2.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=fdmdv2 -ConfigurationName :=Release +ConfigurationName :=Debug WorkspacePath := "D:\Projects\Radio\fdmdv2\build" ProjectPath := "D:\Projects\Radio\fdmdv2\build" -IntermediateDirectory :=./Release +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=11/23/2012 +Date :=11/24/2012 CodeLitePath :="D:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC @@ -27,8 +27,8 @@ OutputSwitch :=-o LibraryPathSwitch :=-L PreprocessorSwitch :=-D SourceSwitch :=-c -OutputFile :=$(IntermediateDirectory)/freeDV -Preprocessors :=$(PreprocessorSwitch)__WX__ $(PreprocessorSwitch)DMW=1 +OutputFile :=$(IntermediateDirectory)/$(ProjectName) +Preprocessors :=$(PreprocessorSwitch)__WX__ ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E @@ -37,12 +37,12 @@ PCHCompileFlags := MakeDirCommand :=makedir RcCmpOptions := $(shell wx-config --rcflags) RcCompilerName :=windres -LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes) -IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)../../../Audio/portaudio/include $(IncludeSwitch)../../../Audio/libsndfile/include $(IncludeSwitch)../../../Audio/libsamplerate-0.1.8/src +LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes) +IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/include IncludePCH := RcIncludePath := -Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll -ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" +Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate +ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.a" LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/Radio/codec2-dev/src/.libs $(LibraryPathSwitch)d:/bin/MinGW-4.6.1/msys/1.0/local/lib $(LibraryPathSwitch)d:/Projects/Audio/libsndfile/lib ## @@ -52,8 +52,8 @@ LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)d:/Projects/ AR := ar rcus CXX := g++ CC := gcc -CXXFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1048\" $(Preprocessors) -CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1048\" $(Preprocessors) +CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1048\" $(Preprocessors) +CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1048\" $(Preprocessors) ## @@ -80,12 +80,9 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: - @echo Executing Pre Build commands ... - D:\bin\TortiseSVN\bin\svnversion -c D:\Projects\Radio\fdmdv2 - @echo Done ## @@ -220,6 +217,6 @@ clean: $(RM) $(IntermediateDirectory)/src_dlg_audiooptions$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\fdmdv2" + $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\fdmdv2" diff --git a/fdmdv2/build/fdmdv2.txt b/fdmdv2/build/fdmdv2.txt index ee31e47e..f9ea5e7f 100644 --- a/fdmdv2/build/fdmdv2.txt +++ b/fdmdv2/build/fdmdv2.txt @@ -1 +1 @@ -./Release/src_dlg_comports.o ./Release/src_fdmdv2_main.o ./Release/src_fdmdv2_plot.o ./Release/src_topFrame.o ./Release/src_fdmdv2_plot_scatter.o ./Release/src_fdmdv2_plot_spectrum.o ./Release/src_fdmdv2_pa_wrapper.o ./Release/src_fdmdv2_plot_scalar.o ./Release/src_fdmdv2_hdw_ports.o ./Release/src_fdmdv2_plot_waterfall_linux.o ./Release/src_dlg_audiooptions.o +./Debug/src_dlg_comports.o ./Debug/src_fdmdv2_main.o ./Debug/src_fdmdv2_plot.o ./Debug/src_topFrame.o ./Debug/src_fdmdv2_plot_scatter.o ./Debug/src_fdmdv2_plot_spectrum.o ./Debug/src_fdmdv2_pa_wrapper.o ./Debug/src_fdmdv2_plot_scalar.o ./Debug/src_fdmdv2_hdw_ports.o ./Debug/src_fdmdv2_plot_waterfall_linux.o ./Debug/src_dlg_audiooptions.o diff --git a/fdmdv2/build/fdmdv2.workspace b/fdmdv2/build/fdmdv2.workspace index 22799746..8cea0b70 100644 --- a/fdmdv2/build/fdmdv2.workspace +++ b/fdmdv2/build/fdmdv2.workspace @@ -6,13 +6,13 @@ - + - + diff --git a/fdmdv2/build/fdmdv2_wsp.mk b/fdmdv2/build/fdmdv2_wsp.mk index f156d21d..df903b41 100644 --- a/fdmdv2/build/fdmdv2_wsp.mk +++ b/fdmdv2/build/fdmdv2_wsp.mk @@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo "----------Building project:[ fdmdv2 - Release ]----------" - @"$(MAKE)" -f "fdmdv2.mk" PreBuild && "$(MAKE)" -f "fdmdv2.mk" + @echo "----------Building project:[ fdmdv2 - Debug ]----------" + @"$(MAKE)" -f "fdmdv2.mk" clean: - @echo "----------Cleaning project:[ fdmdv2 - Release ]----------" + @echo "----------Cleaning project:[ fdmdv2 - Debug ]----------" @"$(MAKE)" -f "fdmdv2.mk" clean diff --git a/fdmdv2/src/Makefile.win32.dmw b/fdmdv2/src/Makefile.win32.dmw new file mode 100644 index 00000000..86c7fde3 --- /dev/null +++ b/fdmdv2/src/Makefile.win32.dmw @@ -0,0 +1,46 @@ +# src/Makefile.win32 +# David Witten Nov 31 2012 +# +# Makefile for Win32 on msys/Mingw to help David +# +# $ make -f Makefile.Win32.dmw + +CODEC2_PATH=D:/Projects/Radio/codec2-dev +INCLUDE_PATH=d:/bin/MinGW-4.6.1/msys/1.0/local/lib + +WX_CONFIG=wx-config +WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__ +WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net) +SVN_REVISION=$(shell svnversion -c /fdmdv2) +CODEC2_INC=$(CODEC2_PATH)/src +CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a + +CPP_FLAGS = -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REV=\"$(SVN_REVISION)\" +LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate + +OBJS = topFrame.o \ +fdmdv2_main.o \ +fdmdv2_plot.o \ +fdmdv2_plot_scalar.o \ +fdmdv2_plot_scatter.o \ +fdmdv2_plot_spectrum.o \ +fdmdv2_plot_waterfall_linux.o \ +fdmdv2_pa_wrapper.o \ +dlg_about.o \ +dlg_audiooptions.o \ +dlg_comports.o \ +dlg_options.o + +HDRS = fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h + +all: freedv + +freedv: $(OBJS) + g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS) + +%.o: %.cpp $(HDRS) Makefile.win32 + g++ $(CPP_FLAGS) -c $< -o $@ + +clean: + rm -f *.o fdmdv2 + diff --git a/fdmdv2/src/dlg_comports.cpp b/fdmdv2/src/dlg_comports.cpp index 578a2593..420db3b7 100644 --- a/fdmdv2/src/dlg_comports.cpp +++ b/fdmdv2/src/dlg_comports.cpp @@ -29,8 +29,13 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, { this->SetSizeHints(wxDefaultSize, wxDefaultSize); this->SetSizeHints(wxDefaultSize, wxDefaultSize); -// m_serialports = HdwPortList(); -// m_serialports.setType(PORT_TYPE_SERIAL); + wxStaticText* m_staticText8; + wxStaticText* m_staticText9; + wxStaticText* m_staticText91; + wxStaticText* m_staticText911; + wxStaticText* m_staticText912; + wxStaticText* m_staticText913; + wxStdDialogButtonSizer* m_sdbSizer5; wxBoxSizer* bSizer30; bSizer30 = new wxBoxSizer(wxVERTICAL); @@ -42,22 +47,23 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, m_staticText8->Wrap(-1); gSizer3->Add(m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2); - m_listCtrlPortSelect = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ICON|wxLC_SINGLE_SEL); - gSizer3->Add(m_listCtrlPortSelect, 2, wxALL|wxEXPAND, 2); - + m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); + gSizer3->Add(m_listCtrlPorts, 2, wxALL|wxEXPAND, 2); +/* m_staticText9 = new wxStaticText(this, wxID_ANY, _("Use Port:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_staticText9->Wrap(-1); gSizer3->Add(m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2); m_textRigCtrlPort = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); gSizer3->Add(m_textRigCtrlPort, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2); +*/ m_staticText91 = new wxStaticText(this, wxID_ANY, _("Buad Rate:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_staticText91->Wrap(-1); gSizer3->Add(m_staticText91, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2); - m_textRigCtrlBaud = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); - gSizer3->Add(m_textRigCtrlBaud, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2); + m_listCtrlBaudrates = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); + gSizer3->Add(m_listCtrlBaudrates, 2, wxALL|wxEXPAND, 2); m_staticText911 = new wxStaticText(this, wxID_ANY, _("Data Bits:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_staticText911->Wrap(-1); @@ -72,7 +78,7 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, m_textRigCtrlStopbits = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); gSizer3->Add(m_textRigCtrlStopbits, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2); - + m_staticText913 = new wxStaticText(this, wxID_ANY, _("Parity:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_staticText913->Wrap(-1); gSizer3->Add(m_staticText913, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 2); @@ -80,7 +86,6 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, m_textRigCtrlParity = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); gSizer3->Add(m_textRigCtrlParity, 1, wxALIGN_CENTER_VERTICAL|wxALL, 2); - bSizer30->Add(gSizer3, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5); m_sdbSizer5 = new wxStdDialogButtonSizer(); @@ -94,7 +99,6 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, bSizer30->Add(m_sdbSizer5, 0, wxEXPAND, 5); - this->SetSizer(bSizer30); this->Layout(); @@ -106,7 +110,8 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, m_sdbSizer5Apply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this); m_sdbSizer5Cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this); m_sdbSizer5OK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this); - m_listCtrlPortSelect->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnListItemSelected), NULL, this); + m_listCtrlPorts->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnPortItemSelected), NULL, this); + m_listCtrlBaudrates->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnBaudrateItemSelected), NULL, this); } //------------------------------------------------------------------------- @@ -116,18 +121,73 @@ ComPortsDlg::~ComPortsDlg() { // Disconnect Events this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog)); - m_listCtrlPortSelect->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnListItemSelected), NULL, this); + m_listCtrlPorts->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnPortItemSelected), NULL, this); + m_listCtrlBaudrates->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ComPortsDlg::OnBaudrateItemSelected), NULL, this); m_sdbSizer5Apply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this); m_sdbSizer5Cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this); m_sdbSizer5OK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this); } //------------------------------------------------------------------------- -// OnListItemSelected() +// OnInitDialog() //------------------------------------------------------------------------- -void ComPortsDlg::OnListItemSelected(wxListEvent& event) +void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event) { - // TODO: Implement OnListItemSelected + populatePortList(); + ExchangeData(EXCHANGE_DATA_IN); +} + +//------------------------------------------------------------------------- +// populatePortList() +//------------------------------------------------------------------------- +void ComPortsDlg::populatePortList() +{ + int i = 0; + wxListItem inf; + wxString buf; + long idx; + long baudrates[] = { 110, 300, 1200, 2400, 9600, 19200, 38400, 57600, 115200 }; + + m_listCtrlPorts->Clear(); + m_listCtrlBaudrates->Clear(); + for(i = 0; i < 9; i++) + { + buf.Printf("%u", baudrates[i]); + m_listCtrlBaudrates->Append(buf); + } + +#ifdef __WXMSW__ +#define PREDICATE + for(i = 1; i <= 32; i++) + { + buf.Printf("COM%u:", i); + idx = m_listCtrlPorts->Append(buf); + } + for(i = 33; i <= 128; i++) + { + buf.Printf("\\\\.\\com%u:", i); + idx = m_listCtrlPorts->Append(buf); + } + +#endif + +#ifdef __WXGTK__ + for(i = 0; i < 32; i++) + { + buf.Printf("/dev/ttyS%u", i); + idx = m_listCtrlPorts->Append(buf); + } + for(i = 0; i < 32; i++) + { + buf.Printf("/dev/ttyUSB%u", i); + idx = m_listCtrlPorts->Append(buf); + } +#endif + +#ifdef __WXOSX__ +#define MAXPORTS 20 +#endif + } //------------------------------------------------------------------------- @@ -136,18 +196,27 @@ void ComPortsDlg::OnListItemSelected(wxListEvent& event) void ComPortsDlg::ExchangeData(int inout) { wxConfigBase *pConfig = wxConfigBase::Get(); + wxString str; + long l; + int i; + if(inout == EXCHANGE_DATA_IN) { - m_textRigCtrlPort->SetValue(wxGetApp().m_strRigCtrlPort); - m_textRigCtrlBaud->SetValue(wxGetApp().m_strRigCtrlBaud); + str = wxGetApp().m_strRigCtrlPort; + m_listCtrlPorts->SetStringSelection(str); + + str = wxGetApp().m_strRigCtrlBaud; + m_listCtrlBaudrates->SetStringSelection(str); + m_textRigCtrlDatabits->SetValue(wxGetApp().m_strRigCtrlDatabits); m_textRigCtrlStopbits->SetValue(wxGetApp().m_strRigCtrlStopbits); m_textRigCtrlParity->SetValue(wxGetApp().m_strRigCtrlParity); } if(inout == EXCHANGE_DATA_OUT) { - wxGetApp().m_strRigCtrlPort = m_textRigCtrlPort->GetValue(); - wxGetApp().m_strRigCtrlBaud = m_textRigCtrlBaud->GetValue(); + wxGetApp().m_strRigCtrlPort = m_listCtrlPorts->GetStringSelection(); + wxGetApp().m_strRigCtrlBaud = m_listCtrlBaudrates->GetStringSelection(); + wxGetApp().m_strRigCtrlDatabits = m_textRigCtrlDatabits->GetValue(); wxGetApp().m_strRigCtrlStopbits = m_textRigCtrlStopbits->GetValue(); wxGetApp().m_strRigCtrlParity = m_textRigCtrlParity->GetValue(); @@ -164,6 +233,22 @@ void ComPortsDlg::ExchangeData(int inout) delete wxConfigBase::Set((wxConfigBase *) NULL); } +//------------------------------------------------------------------------- +// OnPortItemSelected() +//------------------------------------------------------------------------- +void ComPortsDlg::OnPortItemSelected(wxListEvent& event) +{ + // TODO: Implement OnListItemSelected +} + +//------------------------------------------------------------------------- +// OnBaudrateItemSelected() +//------------------------------------------------------------------------- +void ComPortsDlg::OnBaudrateItemSelected(wxListEvent& event) +{ + // TODO: Implement OnListItemSelected +} + //------------------------------------------------------------------------- // OnCancel() //------------------------------------------------------------------------- @@ -196,15 +281,6 @@ void ComPortsDlg::OnClose(wxCloseEvent& event) this->EndModal(wxID_OK); } -//------------------------------------------------------------------------- -// OnInitDialog() -//------------------------------------------------------------------------- -void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event) -{ - ExchangeData(EXCHANGE_DATA_IN); -// populateAudioInfo(); -} - /* //------------------------------------------------------------------------- // serial_parity_handler() diff --git a/fdmdv2/src/dlg_comports.h b/fdmdv2/src/dlg_comports.h index 29cf8b30..fb11a80f 100644 --- a/fdmdv2/src/dlg_comports.h +++ b/fdmdv2/src/dlg_comports.h @@ -38,30 +38,25 @@ class ComPortsDlg : public wxDialog ~ComPortsDlg(); void ExchangeData(int inout); + void populatePortList(void); //ArrayOfPorts m_serialports; protected: // Handlers for events. - void OnListItemSelected(wxListEvent& event); + void OnPortItemSelected(wxListEvent& event); + void OnBaudrateItemSelected(wxListEvent& event); void OnCancel(wxCommandEvent& event); void OnOK(wxCommandEvent& event); void OnClose(wxCloseEvent& event); void OnInitDialog(wxInitDialogEvent& event); void OnApply(wxCommandEvent& event); - wxStaticText* m_staticText8; - wxListCtrl* m_listCtrlPortSelect; - wxStaticText* m_staticText9; + wxListBox* m_listCtrlPorts; wxTextCtrl* m_textRigCtrlPort; - wxStaticText* m_staticText91; - wxTextCtrl* m_textRigCtrlBaud; - wxStaticText* m_staticText911; + wxListBox* m_listCtrlBaudrates; wxTextCtrl* m_textRigCtrlDatabits; - wxStaticText* m_staticText912; wxTextCtrl* m_textRigCtrlStopbits; - wxStaticText* m_staticText913; wxTextCtrl* m_textRigCtrlParity; - wxStdDialogButtonSizer* m_sdbSizer5; wxButton* m_sdbSizer5OK; wxButton* m_sdbSizer5Apply; wxButton* m_sdbSizer5Cancel; diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 29464566..b45b652d 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -256,8 +256,8 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent) // Add Speech Output window m_panelSpeechOut = new PlotScalar((wxFrame*) m_auiNbookCtrl, WAVEFORM_PLOT_TIME, 1.0/WAVEFORM_PLOT_FS, -1, 1, 1, 0.2, "%2.1f", 0); - m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap); - g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF); + m_auiNbookCtrl->AddPage(m_panelSpeechOut, _("To Spkr/Hdphns"), true, wxNullBitmap); + g_plotSpeechOutFifo = fifo_create(2*WAVEFORM_PLOT_BUF); } if(wxGetApp().m_show_timing) @@ -1125,7 +1125,7 @@ void MainFrame::OnHelpAbout(wxCommandEvent& event) wxT("http://freedv.org\n\n") wxT("GNU Public License V2.1\n\n") wxT("Copyright (c) David Witten KD0EAG and David Rowe VK5DGR\n\n") - wxT("svn revision: %s\n") + svnLatestRev, SVN_REV); + wxT("svn revision: %s\n") + svnLatestRev, SVN_REVISION); wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); diff --git a/fdmdv2/src/fdmdv2_main.h b/fdmdv2/src/fdmdv2_main.h index bdbe0af0..4b47dd37 100644 --- a/fdmdv2/src/fdmdv2_main.h +++ b/fdmdv2/src/fdmdv2_main.h @@ -42,6 +42,7 @@ #include #include #include +#include #include diff --git a/fdmdv2/src/topFrame.cpp b/fdmdv2/src/topFrame.cpp index fad2342d..8abe6535 100644 --- a/fdmdv2/src/topFrame.cpp +++ b/fdmdv2/src/topFrame.cpp @@ -56,19 +56,19 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const tools->Append(m_menuItemFilter); wxMenuItem* m_menuItemRigCtrlCfg; - m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("Rig Control Config")) , wxEmptyString, wxITEM_NORMAL); + m_menuItemRigCtrlCfg = new wxMenuItem(tools, wxID_ANY, wxString(_("&PTT Config")) , wxEmptyString, wxITEM_NORMAL); tools->Append(m_menuItemRigCtrlCfg); wxMenuItem* m_menuItemCaptTxInStream; - m_menuItemCaptTxInStream = new wxMenuItem(tools, wxID_ANY, wxString(_("Capture Tx Input Stream")), wxEmptyString, wxITEM_NORMAL); + m_menuItemCaptTxInStream = new wxMenuItem(tools, wxID_ANY, wxString(_("&Capture Tx Input Stream")), wxEmptyString, wxITEM_NORMAL); wxMenuItem* m_menuItemPlayFileToMicIn; - m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Play File to Mic In")) , wxEmptyString, wxITEM_NORMAL); + m_menuItemPlayFileToMicIn = new wxMenuItem(tools, wxID_ANY, wxString(_("&Start/Stop Play File to Mic In")) , wxEmptyString, wxITEM_NORMAL); g_playFileToMicInEventId = m_menuItemPlayFileToMicIn->GetId(); tools->Append(m_menuItemPlayFileToMicIn); wxMenuItem* m_menuItemRecFileFromRadio; - m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("Start/Stop Record File from Radio")) , wxEmptyString, wxITEM_NORMAL); + m_menuItemRecFileFromRadio = new wxMenuItem(tools, wxID_ANY, wxString(_("S&tart/Stop Record File from Radio")) , wxEmptyString, wxITEM_NORMAL); g_recFileFromRadioEventId = m_menuItemRecFileFromRadio->GetId(); tools->Append(m_menuItemRecFileFromRadio); @@ -110,14 +110,12 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const //------------------------------ // Box for S/N ratio (Numeric) //------------------------------ - m_textSNR = new wxStaticText(this, wxID_ANY, wxT(" 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); snrSizer->Add(m_textSNR, 0, wxALIGN_CENTER_HORIZONTAL, 1); //------------------------------ // S/N ratio slow Checkbox //------------------------------ - m_ckboxSNR = new wxCheckBox(this, wxID_ANY, _("Slow"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); m_ckboxSNR->SetToolTip(_("Smooth but slow SNR estimation")); snrSizer->Add(m_ckboxSNR, 0, wxALIGN_CENTER_HORIZONTAL, 5); @@ -204,7 +202,6 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const //------------------------------ // Squelch Level static text box //------------------------------ - m_textSQ = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); sbSizer3->Add(m_textSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0); @@ -212,13 +209,10 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const //------------------------------ // Squelch Toggle Checkbox //------------------------------ - m_ckboxSQ = new wxCheckBox(this, wxID_ANY, _(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); m_ckboxSQ->SetToolTip(_("Activate/Deactivate Squelch")); sbSizer3->Add(m_ckboxSQ, 0, wxALIGN_CENTER_HORIZONTAL, 0); - - rightSizer->Add(sbSizer3, 2, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 0); //------------------------------ diff --git a/fdmdv2/src/topFrame.h b/fdmdv2/src/topFrame.h index fd4a474f..5fe18a4c 100644 --- a/fdmdv2/src/topFrame.h +++ b/fdmdv2/src/topFrame.h @@ -22,9 +22,9 @@ #ifndef __TOPFRAME_H__ #define __TOPFRAME_H__ -#ifdef DMW - #define SVN_REV SVN_REVISION -#endif +//#ifdef DMW +// #define SVN_REV SVN_REVISION +//#endif #include #include @@ -153,7 +153,7 @@ class TopFrame : public wxFrame wxAuiNotebook* m_auiNbookCtrl; - TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV svn " SVN_REV), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 761,500 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); + TopFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV svn " SVN_REVISION), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 761,500 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL ); ~TopFrame(); diff --git a/fdmdv2/tests/pa_enum/pa_enum.mk b/fdmdv2/tests/pa_enum/pa_enum.mk index 1cf0edf1..aa2a1137 100644 --- a/fdmdv2/tests/pa_enum/pa_enum.mk +++ b/fdmdv2/tests/pa_enum/pa_enum.mk @@ -2,19 +2,19 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=pa_enum -ConfigurationName :=Release -WorkspacePath := "C:\bin\Projects\Radio\fdmdv2\build" -ProjectPath := "C:\bin\Projects\Radio\fdmdv2\tests\pa_enum" -IntermediateDirectory :=./Release +ConfigurationName :=Debug +WorkspacePath := "D:\Projects\Radio\fdmdv2\build" +ProjectPath := "D:\Projects\Radio\fdmdv2\tests\pa_enum" +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := -User :=OFA-Staff -Date :=11/7/2012 -CodeLitePath :="C:\bin\CodeLite" +User :=wittend +Date :=11/24/2012 +CodeLitePath :="D:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC ObjectSuffix :=.o @@ -32,12 +32,12 @@ Preprocessors :=$(PreprocessorSwitch)__WX__ ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E -ObjectsFileList :="C:\bin\Projects\Radio\fdmdv2\tests\pa_enum\pa_enum.txt" +ObjectsFileList :="D:\Projects\Radio\fdmdv2\tests\pa_enum\pa_enum.txt" PCHCompileFlags := MakeDirCommand :=makedir RcCmpOptions := $(shell wx-config --rcflags) RcCompilerName :=windres -LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes) +LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unicode=yes) IncludePath := $(IncludeSwitch). $(IncludeSwitch)/bin/MinGW-4.6.1/msys/1.0/local/include $(IncludeSwitch)../../codec2-dev/src $(IncludeSwitch)/bin/Projects/Audio/libsndfile/ IncludePCH := RcIncludePath := @@ -52,18 +52,18 @@ LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch)/bin/MinGW-4 AR := ar rcus CXX := g++ CC := gcc -CXXFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"938\" $(Preprocessors) -CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"938\" $(Preprocessors) +CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1048\" $(Preprocessors) +CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1048\" $(Preprocessors) ## ## User defined environment variables ## -CodeLiteDir:=C:\bin\CodeLite -WXWIN:=C:\bin\wxWidgets-2.9.4 +CodeLiteDir:=D:\bin\CodeLite +WXWIN:=D:\bin\wxWidgets-2.9.4 PATH:=$(WXWIN)\lib\gcc_dll;$(PATH) WXCFG:=gcc_dll\mswu -UNIT_TEST_PP_SRC_DIR:=C:\bin\UnitTest++-1.3 +UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3 Objects=$(IntermediateDirectory)/gui$(ObjectSuffix) $(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix) ## @@ -79,7 +79,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -88,28 +88,28 @@ PreBuild: ## Objects ## $(IntermediateDirectory)/gui$(ObjectSuffix): gui.cpp $(IntermediateDirectory)/gui$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/gui$(ObjectSuffix) $(IncludePath) + $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/gui$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/gui$(DependSuffix): gui.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/gui$(ObjectSuffix) -MF$(IntermediateDirectory)/gui$(DependSuffix) -MM "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/gui$(ObjectSuffix) -MF$(IntermediateDirectory)/gui$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" $(IntermediateDirectory)/gui$(PreprocessSuffix): gui.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/gui$(PreprocessSuffix) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/gui$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/tests/pa_enum/gui.cpp" $(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath) + $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/main$(DependSuffix): main.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" $(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/tests/pa_enum/main.cpp" $(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix): AudioOptsDialog.cpp $(IntermediateDirectory)/AudioOptsDialog$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix) $(IncludePath) + $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/AudioOptsDialog$(DependSuffix): AudioOptsDialog.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix) -MF$(IntermediateDirectory)/AudioOptsDialog$(DependSuffix) -MM "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/AudioOptsDialog$(ObjectSuffix) -MF$(IntermediateDirectory)/AudioOptsDialog$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix): AudioOptsDialog.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix) "C:/bin/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/tests/pa_enum/AudioOptsDialog.cpp" -include $(IntermediateDirectory)/*$(DependSuffix) @@ -128,6 +128,6 @@ clean: $(RM) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "C:\bin\Projects\Radio\fdmdv2\build\.build-release\pa_enum" + $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\pa_enum" -- 2.25.1