From: wittend99 Date: Tue, 4 Dec 2012 03:39:40 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freetel/code@1115 01035d8c-6547-0410-b346-abe4f... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=31d7776c33c1990bfe76812729d434786a30c21f;p=freetel-svn-tracking.git git-svn-id: https://svn.code.sf.net/p/freetel/code@1115 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/README.Win32 b/fdmdv2/README.Win32 index 5259f754..406cabf0 100644 --- a/fdmdv2/README.Win32 +++ b/fdmdv2/README.Win32 @@ -54,9 +54,7 @@ $ mingw32-make -f makefile.gcc DEBUG=0 GPIB=0 $ wget http://sourceforge.net/projects/sox/files/sox/14.4.0/sox-14.4.0.tar.gz/ download $ tar xvzf sox-14.4.0.tar.gz -$ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp - --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with- -waveaudio=no +$ ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-waveaudio=no $ make && make install I couldn't find an install command line that worked, so manually copied the libs and include files. diff --git a/fdmdv2/build/fdmdv2.mk b/fdmdv2/build/fdmdv2.mk index c8f1ff8a..e71d76a6 100644 --- a/fdmdv2/build/fdmdv2.mk +++ b/fdmdv2/build/fdmdv2.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=11/30/2012 +Date :=12/3/2012 CodeLitePath :="D:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC @@ -41,8 +41,8 @@ LinkOptions := -mwindows $(shell wx-config --debug=yes --libs --unic 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 $(LibrarySwitch)ctb-0.16 -ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" +Libs := $(LibrarySwitch)sndfile-1 $(LibrarySwitch)codec2 $(LibrarySwitch)portaudio $(LibrarySwitch)portaudiocpp $(LibrarySwitch)samplerate.dll $(LibrarySwitch)ctb-0.16 $(LibrarySwitch)sox +ArLibs := "libsndfile-1.dll" "codec2" "libportaudio.a" "libportaudiocpp.a" "libsamplerate.dll.a" "ctb-0.16.dll" "libsox" 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 := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1101\" $(Preprocessors) -CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1101\" $(Preprocessors) +CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors) +CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors) ## @@ -64,8 +64,8 @@ WXWIN:=D:\bin\wxWidgets-2.9.4 PATH:=$(WXWIN)\lib\gcc_dll;$(PATH) WXCFG:=gcc_dll\mswu UNIT_TEST_PP_SRC_DIR:=D:\bin\UnitTest++-1.3 -Objects=$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) \ - $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) +Objects=$(IntermediateDirectory)/src_dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/src_topFrame$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scatter$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_spectrum$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_pa_wrapper$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IntermediateDirectory)/src_dlg_audiooptions$(ObjectSuffix) \ + $(IntermediateDirectory)/src_dlg_filter$(ObjectSuffix) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) ## ## Main Build Targets @@ -152,14 +152,6 @@ $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix): ../src/fdmdv2_pl $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix): ../src/fdmdv2_plot_scalar.cpp @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_scalar.cpp" -$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix): ../src/fdmdv2_hdw_ports.cpp $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix): ../src/fdmdv2_hdw_ports.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) -MF$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp" - -$(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix): ../src/fdmdv2_hdw_ports.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/fdmdv2_hdw_ports.cpp" - $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix): ../src/fdmdv2_plot_waterfall_linux.cpp $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix) $(CXX) $(IncludePCH) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix): ../src/fdmdv2_plot_waterfall_linux.cpp @@ -192,6 +184,14 @@ $(IntermediateDirectory)/src_varicode$(DependSuffix): ../src/varicode.c $(IntermediateDirectory)/src_varicode$(PreprocessSuffix): ../src/varicode.c @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/varicode.c" +$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix): ../src/sox_biquad.c $(IntermediateDirectory)/src_sox_biquad$(DependSuffix) + $(CC) $(SourceSwitch) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/src_sox_biquad$(DependSuffix): ../src/sox_biquad.c + @$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) -MF$(IntermediateDirectory)/src_sox_biquad$(DependSuffix) -MM "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" + +$(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix): ../src/sox_biquad.c + @$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) "D:/Projects/Radio/fdmdv2/src/sox_biquad.c" + -include $(IntermediateDirectory)/*$(DependSuffix) ## @@ -222,9 +222,6 @@ clean: $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(ObjectSuffix) $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(DependSuffix) $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_scalar$(PreprocessSuffix) - $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(ObjectSuffix) - $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(DependSuffix) - $(RM) $(IntermediateDirectory)/src_fdmdv2_hdw_ports$(PreprocessSuffix) $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(ObjectSuffix) $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(DependSuffix) $(RM) $(IntermediateDirectory)/src_fdmdv2_plot_waterfall_linux$(PreprocessSuffix) @@ -237,6 +234,9 @@ clean: $(RM) $(IntermediateDirectory)/src_varicode$(ObjectSuffix) $(RM) $(IntermediateDirectory)/src_varicode$(DependSuffix) $(RM) $(IntermediateDirectory)/src_varicode$(PreprocessSuffix) + $(RM) $(IntermediateDirectory)/src_sox_biquad$(ObjectSuffix) + $(RM) $(IntermediateDirectory)/src_sox_biquad$(DependSuffix) + $(RM) $(IntermediateDirectory)/src_sox_biquad$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\fdmdv2" diff --git a/fdmdv2/build/fdmdv2.project b/fdmdv2/build/fdmdv2.project index fe4f795b..bb22eca6 100644 --- a/fdmdv2/build/fdmdv2.project +++ b/fdmdv2/build/fdmdv2.project @@ -16,11 +16,11 @@ - + @@ -39,7 +39,6 @@ - @@ -47,6 +46,9 @@ + + + @@ -80,6 +82,7 @@ + @@ -133,6 +136,7 @@ + diff --git a/fdmdv2/build/fdmdv2.txt b/fdmdv2/build/fdmdv2.txt index 858e45e8..1a68a0e7 100644 --- a/fdmdv2/build/fdmdv2.txt +++ b/fdmdv2/build/fdmdv2.txt @@ -1 +1 @@ -./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 ./Debug/src_dlg_filter.o ./Debug/src_varicode.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_plot_waterfall_linux.o ./Debug/src_dlg_audiooptions.o ./Debug/src_dlg_filter.o ./Debug/src_varicode.o ./Debug/src_sox_biquad.o diff --git a/fdmdv2/build/fdmdv2.workspace b/fdmdv2/build/fdmdv2.workspace index 34c1d312..3d94d014 100644 --- a/fdmdv2/build/fdmdv2.workspace +++ b/fdmdv2/build/fdmdv2.workspace @@ -7,6 +7,8 @@ + + @@ -15,14 +17,18 @@ + + - + + + diff --git a/fdmdv2/src/dlg_audiooptions.cpp b/fdmdv2/src/dlg_audiooptions.cpp index 91ce2749..ccf34836 100644 --- a/fdmdv2/src/dlg_audiooptions.cpp +++ b/fdmdv2/src/dlg_audiooptions.cpp @@ -582,7 +582,6 @@ int AudioOptsDialog::ExchangeData(int inout) // we have to be soundcard oriented at run time rather than // Tx/Rx oriented as in this dialog. // --------------------------------------------------------------- - g_nSoundCards = 0; g_soundCard1InDeviceNum = g_soundCard1OutDeviceNum = g_soundCard2InDeviceNum = g_soundCard2OutDeviceNum = -1; @@ -630,19 +629,6 @@ int AudioOptsDialog::ExchangeData(int inout) return 0; } -/* -//------------------------------------------------------------------------- -// OnDeviceSelect() -//------------------------------------------------------------------------- -void AudioOptsDialog::OnDeviceSelect(wxListEvent& event) -{ - wxListItem info; - long item; - item = m_listCtrlRxInDevices->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - wxMessageBox(m_listCtrlRxInDevices->GetItemText(item, 2), wxT("Item"), wxOK); -} -*/ - //------------------------------------------------------------------------- // buildListOfSupportedSampleRates() //------------------------------------------------------------------------- diff --git a/fdmdv2/src/dlg_comports.cpp b/fdmdv2/src/dlg_comports.cpp index b7635e30..8d6ae4c7 100644 --- a/fdmdv2/src/dlg_comports.cpp +++ b/fdmdv2/src/dlg_comports.cpp @@ -21,21 +21,14 @@ //========================================================================== #include "dlg_comports.h" #include "fdmdv2_main.h" +#include +#include //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= // Class ComPortsDlg //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { -/* - if(!bBitmapLoaded) - { - // We need to initialise the default bitmap handler - wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); - wxC9ED9InitBitmapResources(); - bBitmapLoaded = true; - } -*/ wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); this->SetSizer(mainSizer); @@ -55,11 +48,20 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0); m_ckUseSerialPTT->SetValue(false); staticBoxSizer31->Add(m_ckUseSerialPTT, 0, wxALIGN_LEFT, 20); - +#ifdef __WXMSW__ wxArrayString m_listCtrlPortsArr; m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE); staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0); - +#endif +#ifdef __WXGTK__ + wxBoxSizer* bSizer83; + bSizer83 = new wxBoxSizer(wxHORIZONTAL); + m_staticText12 = new wxStaticText(this, wxID_ANY, _("Device:"), wxDefaultPosition, wxDefaultSize, 0); + m_staticText12->Wrap(-1); + staticBoxSizer31->Add(m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5); + m_txtCtlDevicePath = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); + staticBoxSizer31->Add(m_txtCtlDevicePath, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1); +#endif wxBoxSizer* boxSizer19 = new wxBoxSizer(wxVERTICAL); staticBoxSizer17->Add(boxSizer19, 1, wxEXPAND, 5); wxStaticBoxSizer* staticBoxSizer16 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Signal polarity")), wxHORIZONTAL); @@ -161,20 +163,48 @@ void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event) //------------------------------------------------------------------------- void ComPortsDlg::populatePortList() { - int i = 0; - wxListItem inf; - wxString buf; - +#ifdef __WXMSW__ m_listCtrlPorts->Clear(); - std::vectorresult; wxArrayString aStr; - - ctb::GetAvailablePorts(result, false); - for(int i = 0; i < result.size(); i++) + wxRegKey key(wxRegKey::HKLM, _T("HARDWARE\\DEVICEMAP\\SERIALCOMM")); + if(!key.Exists()) + { + return; + } + else { - aStr.Add(result[i], 1); + // Get the number of subkeys and enumerate them. + if(!key.Open(wxRegKey::Read)) + { + return; + } + size_t subkeys; + size_t values; + if(!key.GetKeyInfo(&subkeys, NULL, &values, NULL)) + { + return; + } + if(!key.HasValues()) + { + return; + } + wxString key_name; + long el = 1; + key.GetFirstValue(key_name, el); + wxString valType; + wxString key_data; + for(unsigned int i = 0; i < values; i++) + { + key.QueryValue(key_name, key_data); + wxPrintf("Value: %s Data: %s\n", key_name, key_data); + aStr.Add(key_data, 1); + key.GetNextValue(key_name, el); + } } m_listCtrlPorts->Append(aStr); +#endif +#ifdef __WXGTK__ +#endif } //------------------------------------------------------------------------- @@ -184,15 +214,18 @@ void ComPortsDlg::ExchangeData(int inout) { wxConfigBase *pConfig = wxConfigBase::Get(); wxString str; - long l; - int i; if(inout == EXCHANGE_DATA_IN) { // m_ckUsePTTRtChan->SetValue(wxGetApp().m_boolUseTonePTT); m_ckUseSerialPTT->SetValue(wxGetApp().m_boolUseSerialPTT); str = wxGetApp().m_strRigCtrlPort; +#ifdef __WXMSW__ m_listCtrlPorts->SetStringSelection(str); +#endif +#ifdef __WXGTK__ + m_txtCtlDevicePath->SetValue(str); +#endif str = wxGetApp().m_strRigCtrlBaud; // m_listCtrlBaudrates->SetStringSelection(str); @@ -209,7 +242,12 @@ void ComPortsDlg::ExchangeData(int inout) { wxGetApp().m_boolUseSerialPTT = m_ckUseSerialPTT->IsChecked(); // wxGetApp().m_boolUseTonePTT = m_ckUsePTTRtChan->IsChecked(); +#ifdef __WXMSW__ wxGetApp().m_strRigCtrlPort = m_listCtrlPorts->GetStringSelection(); +#endif +#ifdef __WXGTK__ + wxGetApp().m_strRigCtrlPort = m_txtCtlDevicePath->GetValue(); +#endif wxGetApp().m_boolUseRTS = m_rbUseRTS->GetValue(); wxGetApp().m_boolRTSPos = m_ckRTSPos->IsChecked(); wxGetApp().m_boolUseDTR = m_rbUseDTR->GetValue(); @@ -232,8 +270,7 @@ void ComPortsDlg::ExchangeData(int inout) // pConfig->Write(wxT("/Rig/DataBits"), wxGetApp().m_strRigCtrlDatabits); // pConfig->Write(wxT("/Rig/StopBits"), wxGetApp().m_strRigCtrlStopbits); // pConfig->Write(wxT("/Rig/Parity"), wxGetApp().m_strRigCtrlParity); - //m_textRigCtrlFlowControl - pConfig->Flush(); + pConfig->Flush(); } delete wxConfigBase::Set((wxConfigBase *) NULL); } @@ -243,7 +280,6 @@ void ComPortsDlg::ExchangeData(int inout) //------------------------------------------------------------------------- void ComPortsDlg::DTRVPlusClicked(wxCommandEvent& event) { - //wxMessageBox(wxT("DTRVPlusClicked")); } //------------------------------------------------------------------------- diff --git a/fdmdv2/src/dlg_comports.h b/fdmdv2/src/dlg_comports.h index ec62d1b6..70594ea8 100644 --- a/fdmdv2/src/dlg_comports.h +++ b/fdmdv2/src/dlg_comports.h @@ -48,6 +48,7 @@ class ComPortsDlg : public wxDialog wxCheckBox* m_ckUsePTTRtChan; wxListBox* m_listCtrlPorts; wxCheckBox* m_ckUseSerialPTT; + wxTextCtrl *m_txtCtlDevicePath; wxRadioButton* m_rbUseDTR; wxCheckBox* m_ckRTSPos; wxRadioButton* m_rbUseRTS; @@ -56,7 +57,9 @@ class ComPortsDlg : public wxDialog wxButton* m_buttonCancel; wxButton* m_buttonApply; - protected: +protected: + void ListAllPorts(); + void populatePortList(void); void PTTAudioClick(wxCommandEvent& event); // void PTTPortSlelcted(wxCommandEvent& event); diff --git a/fdmdv2/src/dlg_filter.cpp b/fdmdv2/src/dlg_filter.cpp index 98aa8377..100ee796 100644 --- a/fdmdv2/src/dlg_filter.cpp +++ b/fdmdv2/src/dlg_filter.cpp @@ -157,7 +157,7 @@ FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool this->Layout(); this->Centre(wxBOTH); - + // Connect Events ------------------------------------------------------- this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(FilterDlg::OnInitDialog)); diff --git a/fdmdv2/src/fdmdv2_hdw_ports.cpp b/fdmdv2/src/fdmdv2_hdw_ports.cpp deleted file mode 100644 index c7498ca7..00000000 --- a/fdmdv2/src/fdmdv2_hdw_ports.cpp +++ /dev/null @@ -1,134 +0,0 @@ -//========================================================================== -// Name: fdmdv2_enum_ports.cpp -// Purpose: Tools to enumerate hardware ports (other than audio). -// Created: Oct 2, 2012 -// Authors: David Rowe, David Witten -// -// License: -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General License version 2.1, -// as published by the Free Software Foundation. This program is -// distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -// License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, see . -// -//========================================================================== -#include "fdmdv2_hdw_ports.h" - -//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= -// class HdwPort() -//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= -HdwPort::HdwPort() -{ - m_device_type = -1; -} - -//#include // This is a magic incantation which must be done! -//WX_DEFINE_OBJARRAY(ArrayOfPorts); - -//------------------------------------------------------------------------- -// OnClose() -//------------------------------------------------------------------------- -HdwPort::~HdwPort() -{ -} - -//------------------------------------------------------------------------- -// OnClose() -//------------------------------------------------------------------------- -void HdwPort::setType(int portType) -{ - m_device_type = portType; -} - -//------------------------------------------------------------------------- -// OnClose() -//------------------------------------------------------------------------- -int HdwPort::getList() -{ - int rv = 0; - - if(m_device_type != -1) - { - switch(m_device_type) - { - case PORT_TYPE_SERIAL: - rv = getSerialPorts(); - break; - - case PORT_TYPE_USB: - rv = getUSBPorts(); - break; - - case PORT_TYPE_VIRTUAL: - rv = getVirtualPorts(); - break; - - case PORT_TYPE_PARALLEL: - rv = getParallelPorts(); - break; - - case PORT_TYPE_IEEE1394: - rv = getIEEE1394Ports(); - break; - - case PORT_TYPE_UNKNOWN: - default: - rv = 0; - break; - } - } - return rv; -} - -//------------------------------------------------------------------------- -// getSerialPorts() -//------------------------------------------------------------------------- -int HdwPort::getSerialPorts() -{ - int rv = 0; - return rv; -} - -//------------------------------------------------------------------------- -// getUSBPorts() -//------------------------------------------------------------------------- -int HdwPort::getUSBPorts() -{ - int rv = 0; - return rv; -} - -//------------------------------------------------------------------------- -// OnClose() -//------------------------------------------------------------------------- -int HdwPort::getVirtualPorts() -{ - int rv = 0; - return rv; -} - -//------------------------------------------------------------------------- -// getParallelPorts() -//------------------------------------------------------------------------- -int HdwPort::getParallelPorts() -{ - int rv = 0; - return rv; -} - -//------------------------------------------------------------------------- -// getIEEE1394Ports() -//------------------------------------------------------------------------- -int HdwPort::getIEEE1394Ports() -{ - int rv = 0; - return rv; -} - - diff --git a/fdmdv2/src/fdmdv2_hdw_ports.h b/fdmdv2/src/fdmdv2_hdw_ports.h deleted file mode 100644 index 8d2ff9c7..00000000 --- a/fdmdv2/src/fdmdv2_hdw_ports.h +++ /dev/null @@ -1,98 +0,0 @@ -//========================================================================== -// Name: fdmdv2_enum_ports.h -// Purpose: Tools to enumerate hardware ports (other than audio). -// Created: Oct 2, 2012 -// Authors: David Rowe, David Witten -// -// License: -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2.1, -// as published by the Free Software Foundation. This program is -// distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -// License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, see . -// -//========================================================================== -#ifndef __FDMDV2_HDW_PORTS__ -#define __FDMDV2_HDW_PORTS__ - -#include -#include "wx/wx.h" -#include -#include "fdmdv2_main.h" - -enum -{ - SER_PAR_NONE, - SER_PAR_ODD, - SER_PAR_EVEN, - SER_PAR_MARK, - SER_PAR_SPACE -}; - -enum -{ - SER_FLOW_NONE, - SER_FLOW_XONXOFF, - SER_FLOW_RTSCTS, - SER_FLOW_DSRDTR -}; - -enum -{ - PORT_TYPE_SERIAL, - PORT_TYPE_USB, - PORT_TYPE_VIRTUAL, - PORT_TYPE_PARALLEL, - PORT_TYPE_IEEE1394, - PORT_TYPE_UNKNOWN -}; - -enum -{ - DEVICE_TYPE_SERIAL, - DEVICE_TYPE_USB, - DEVICE_TYPE_VIRTUAL, - DEVICE_TYPE_PARALLEL, - DEVICE_TYPE_BLUETOOTH, - DEVICE_TYPE_NETWORK, - DEVICE_TYPE_IEEE1394, - DEVICE_TYPE_UNKNOWN -}; - -class HdwPort; - -WX_DECLARE_OBJARRAY(HdwPort, ArrayOfPorts); - -//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= -// Class PortList -//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= -class HdwPort -{ - public: - HdwPort(); - ~HdwPort(); - - protected: - wxString m_name; - - private: - int m_device_type; - int m_device_emulation; - - void setType(int portType); - int getList(); - int getSerialPorts(); - int getUSBPorts(); - int getVirtualPorts(); - int getParallelPorts(); - int getIEEE1394Ports(); -}; - - -#endif // __FDMDV2_HDW_PORTS__ diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 4f8bd4e9..50beb336 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -312,7 +312,7 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent) wxGetApp().m_strRigCtrlStopbits = pConfig->Read(wxT("/Rig/StopBits"), wxT("1")); wxGetApp().m_strRigCtrlParity = pConfig->Read(wxT("/Rig/Parity"), wxT("n")); wxGetApp().m_boolUseTonePTT = pConfig->ReadBool(wxT("/Rig/UseTonePTT"), false); - wxGetApp().m_boolUseSerialPTT = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"), true); + wxGetApp().m_boolUseSerialPTT = pConfig->ReadBool(wxT("/Rig/UseSerialPTT"), false); wxGetApp().m_boolUseRTS = pConfig->ReadBool(wxT("/Rig/UseRTS"), true); wxGetApp().m_boolRTSPos = pConfig->ReadBool(wxT("/Rig/RTSPolarity"), false); wxGetApp().m_boolUseDTR = pConfig->ReadBool(wxT("/Rig/UseDTR"), false); @@ -371,9 +371,9 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent) m_togTxID->Disable(); m_togBtnAnalog->Disable(); //m_togBtnALC->Disable(); - - SetupSerialPort(); + SetupSerialPort(); + // squelch settings char sqsnr[15]; m_sliderSQ->SetValue((int)(g_SquelchLevel*2.0)); @@ -736,7 +736,6 @@ void MainFrame::OnTimer(wxTimerEvent &evt) //---------------------------------------------------------------- void MainFrame::OnIdle(wxIdleEvent& event) { - } #endif // _USE_TIMER @@ -902,62 +901,60 @@ void MainFrame::OnTogBtnTXClick(wxCommandEvent& event) } g_tx = m_btnTogPTT->GetValue(); - - // The following sets and clears may be exactly inverted. - // I don't know and I'm not set up to tell yet. - // If so, one just needs to invert the polarity selection - // on the Tools>PTT configuration page. - if(event.IsChecked()) - { - if(wxGetApp().m_boolUseRTS) // Use RTS - { - if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH - { - m_serialPort->SetLineState(ctb::LinestateRts); - } - else // RTS asserted LOW - { - m_serialPort->ClrLineState(ctb::LinestateRts); - } - } - else // Use DTR - { - if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH - { - m_serialPort->SetLineState(ctb::LinestateDtr); - } - else // DTR asserted LOW - { - m_serialPort->ClrLineState(ctb::LinestateDtr); - } - } - } - else // !isChecked() - so Clear + // Tortured and tortuous logic, it seems to me... + if(wxGetApp().m_boolUseSerialPTT && m_serialPort != NULL) { - if(wxGetApp().m_boolUseRTS) // Use RTS + if(event.IsChecked()) { - if(wxGetApp().m_boolRTSPos) // RTS cleared LOW + if(wxGetApp().m_boolUseRTS) // Use RTS { - m_serialPort->ClrLineState(ctb::LinestateRts); + if(wxGetApp().m_boolRTSPos) // RTS asserted HIGH + { + m_serialPort->SetLineState(ctb::LinestateRts); + } + else // RTS asserted LOW + { + m_serialPort->ClrLineState(ctb::LinestateRts); + } } - else // RTS cleared HIGH + else // Use DTR { - m_serialPort->SetLineState(ctb::LinestateRts); + if(wxGetApp().m_boolDTRPos) // DTR asserted HIGH + { + m_serialPort->SetLineState(ctb::LinestateDtr); + } + else // DTR asserted LOW + { + m_serialPort->ClrLineState(ctb::LinestateDtr); + } } - } - else // Use DTR + } + else // !isChecked() - so Clear { - if(wxGetApp().m_boolDTRPos) // DTR cleared LOW + if(wxGetApp().m_boolUseRTS) // Use RTS { - m_serialPort->ClrLineState(ctb::LinestateDtr); + if(wxGetApp().m_boolRTSPos) // RTS cleared LOW + { + m_serialPort->ClrLineState(ctb::LinestateRts); + } + else // RTS cleared HIGH + { + m_serialPort->SetLineState(ctb::LinestateRts); + } } - else // DTR cleared HIGH + else // Use DTR { - m_serialPort->SetLineState(ctb::LinestateDtr); + if(wxGetApp().m_boolDTRPos) // DTR cleared LOW + { + m_serialPort->ClrLineState(ctb::LinestateDtr); + } + else // DTR cleared HIGH + { + m_serialPort->SetLineState(ctb::LinestateDtr); + } } - } - } - + } + } // reset level gauge m_maxLevel = 0; m_textLevel->SetLabel(wxT("")); @@ -1345,7 +1342,7 @@ void MainFrame::OnExit(wxCommandEvent& event) m_togTxID->Disable(); m_togBtnAnalog->Disable(); //m_togBtnALC->Disable(); - m_btnTogPTT->Disable(); + //m_btnTogPTT->Disable(); CloseSerialPort(); Pa_Terminate(); Destroy(); @@ -1547,10 +1544,12 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) //m_togRxID->Enable(); //m_togTxID->Enable(); m_togBtnAnalog->Enable(); +/* if(m_serialPort != NULL) { m_btnTogPTT->Enable(); } +*/ m_togBtnOnOff->SetLabel(wxT("Stop")); // init modem and codec states @@ -1612,7 +1611,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) m_togRxID->Disable(); m_togTxID->Disable(); m_togBtnAnalog->Disable(); - m_btnTogPTT->Disable(); + //m_btnTogPTT->Disable(); m_togBtnOnOff->SetLabel(wxT("Start")); } } @@ -2669,7 +2668,7 @@ void MainFrame::SetupSerialPort(void) wxGetApp().m_strRigCtrlBaud.ToLong(&baudrate, 10); if(!wxGetApp().m_strRigCtrlPort.IsEmpty()) { - wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits; //"8N1"; + wxString protocol = wxGetApp().m_strRigCtrlDatabits + wxGetApp().m_strRigCtrlParity + wxGetApp().m_strRigCtrlStopbits; m_serialPort = new ctb::SerialPort(); if(m_serialPort->Open(wxGetApp().m_strRigCtrlPort.c_str(), baudrate, protocol.c_str(), ctb::SerialPort::NoFlowControl ) >= 0 ) { @@ -2691,14 +2690,14 @@ void MainFrame::SetupSerialPort(void) { m_serialPort->SetLineState(ctb::LinestateDtr); } - m_btnTogPTT->Enable(true); + //m_btnTogPTT->Enable(true); m_btnTogPTT->SetValue(false); } else { m_serialPort = NULL; m_device = NULL; - m_btnTogPTT->Disable(); + //m_btnTogPTT->Disable(); } } /* diff --git a/fdmdv2/tests/pa_enum/pa_enum.mk b/fdmdv2/tests/pa_enum/pa_enum.mk index a969d786..2b026722 100644 --- a/fdmdv2/tests/pa_enum/pa_enum.mk +++ b/fdmdv2/tests/pa_enum/pa_enum.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=pa_enum -ConfigurationName :=Release +ConfigurationName :=Debug WorkspacePath := "D:\Projects\Radio\fdmdv2\build" ProjectPath := "D:\Projects\Radio\fdmdv2\tests\pa_enum" -IntermediateDirectory :=./Release +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=wittend -Date :=11/29/2012 +Date :=12/2/2012 CodeLitePath :="D:\bin\CodeLite" LinkerName :=g++ SharedObjectLinkerName :=g++ -shared -fPIC @@ -37,7 +37,7 @@ 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,8 +52,8 @@ 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=\"1083\" $(Preprocessors) -CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) -DSVN_REVISION=\"1083\" $(Preprocessors) +CXXFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors) +CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) -DSVN_REVISION=\"1111\" $(Preprocessors) ## @@ -79,7 +79,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -128,6 +128,6 @@ clean: $(RM) $(IntermediateDirectory)/AudioOptsDialog$(PreprocessSuffix) $(RM) $(OutputFile) $(RM) $(OutputFile).exe - $(RM) "D:\Projects\Radio\fdmdv2\build\.build-release\pa_enum" + $(RM) "D:\Projects\Radio\fdmdv2\build\.build-debug\pa_enum"