#set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Work around for not using a svn working copy.
-add_definitions(-DSVN_REVISION="1248")
+add_definitions(-DSVN_REVISION="Unversioned directory")
add_definitions(-D_NO_AUTOTOOLS_)
list(APPEND FREEDV_LINK_LIBS ${PORTAUDIOCPP})
endif(PORTAUDIOCPP)
+#
+# Hamlib library
+#
+message(STATUS "Looking for hamlib...")
+find_library(LIBHAMLIB hamlib)
+if(LIBHAMLIB)
+ list(APPEND FREEDV_LINK_LIBS ${LIBHAMLIB})
+ message(STATUS " hamlib found: ${LIBHAMLIB}")
+else(LIBHAMLIB)
+ message(FATAL_ERROR "hamlib not found.
+On Linux systems try installing:
+ hamlib-devel (RPM based systems)
+ libhamlib-dev (DEB based systems)"
+ )
+endif(LIBHAMLIB)
+
#
# Samplerate Library
#
set(FREEDV_SOURCES
+ dlg_about.cpp
+ dlg_audiooptions.cpp
+ dlg_comports.cpp
+ dlg_filter.cpp
fdmdv2_main.cpp
fdmdv2_pa_wrapper.cpp
fdmdv2_plot.cpp
fdmdv2_plot_scatter.cpp
fdmdv2_plot_spectrum.cpp
fdmdv2_plot_waterfall_linux.cpp
- dlg_about.cpp
- dlg_audiooptions.cpp
- dlg_comports.cpp
- dlg_filter.cpp
- sox_biquad.c
+ hamlib.cpp
topFrame.cpp
+ sox_biquad.c
varicode.c
comp.h
+ dlg_about.h
+ dlg_audiooptions.h
+ dlg_comports.h
+ dlg_filter.h
fdmdv2_defines.h
fdmdv2_main.h
fdmdv2_pa_wrapper.h
fdmdv2_plot_scatter.h
fdmdv2_plot_spectrum.h
fdmdv2_plot_waterfall_linux.h
- dlg_about.h dlg_audiooptions.h
- dlg_comports.h
- dlg_filter.h
- sox.h
+ hamlib.h
sox_biquad.h
+ sox.h
topFrame.h
varicode.h
varicode_table.h
# The list of required libraries, we will build this as we go
LIBS_TO_BUILD :=
+SYSTEM_HAMLIB=y
+SYSTEM_PORTAUDIO=n
+
# wxWidgets ---------------------------------------------
ifneq ($(SYSTEM_WXWIDGETS),y)
# Sox ---------------------------------------------------
# (libmagic is rqd or later versions of Ubuntu)
+SOX=sox-14.4.0
ifeq ($(SYSTEM_SOX),y)
SOX_INC ?= $(shell pkg-config sox --cflags)
SOX_LIB ?= $(shell pkg-config sox --libs)
else
-SOX=sox-14.4.0
SOX_INC=-I$(SOX)/src/
SOX_LIB=$(SOX)/src/.libs/libsox.a
LIBS_TO_BUILD += $(SOX)/.built
endif
-# CTB ---------------------------------------------------
+# Hamlib ---------------------------------------------------
-CTB=libctb-0.16
-CTB_INC=-I$(CTB)/include
-CTB_LIB=$(CTB)/lib/libctb-0.16.a
+HAMLIB=hamlib-1.2.15.3
+ifeq ($(SYSTEM_HAMLIB),y)
+HAMLIB_INC ?= $(shell pkg-config hamlib --cflags)
+HAMLIB_LIB ?= $(shell pkg-config hamlib --libs)
+else
+HAMLIB_INC=-I$(HAMLIB)/include/hamlib
+# TODO: need to include all the backends too
+HAMLIB_LIB=$(HAMLIB)/src/.libs/libhamlib.a
+LIBS_TO_BUILD += $(HAMLIB)/.built
+endif
# FreeDV ------------------------------------------------
-CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) $(SOX_INC) $(CTB_INC) -I. -g -Wall -O3 -DSVN_REVISION='"$(SVN_REVISION)"' -MMD -MP
-FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
+CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) \
+ $(HAMLIB_INC) $(SOX_INC) -I. -g -Wall -O2 \
+ -DSVN_REVISION='"$(SVN_REVISION)"' -MMD -MP
+FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(HAMLIB_LIB) \
+ $(HAMLIB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
OBJS = topFrame.o \
fdmdv2_main.o \
dlg_options.o \
varicode.o \
sox_biquad.o \
-codec2-dev/src/golay23.c
-
-HDRS = ../version.h dlg_about.h dlg_audiooptions.h dlg_comports.h dlg_filter.h dlg_options.h 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 varicode.h codec2-dev/src/golay23.h
+codec2-dev/src/golay23.c \
+hamlib.o
-all: $(LIBS_TO_BUILD) $(CODEC2)/.built $(CTB)/.built freedv
+all: $(LIBS_TO_BUILD) $(CODEC2)/.built freedv
freedv: $(OBJS)
$(CXX) -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-
-%.o: %.cpp $(HDRS)
- $(CXX) $(CPP_FLAGS) -c $< -o $@
-
+
+%.o: %.cpp
+ $(CXX) -MMD -MF $(@:.o=.d) $(CPP_FLAGS) -c $< -o $@
+
+%.o: %.c
+ $(CC) -MMD -MF $(@:.o=.d) $(CPP_FLAGS) -c $< -o $@
+
+-include $(OBJ:.o=.d)
+
clean:
- rm -f *.d *.o fdmdv2
+ rm -f *.d *.o freedv
clean-lib:
rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)
- rm -f *.d *.o fdmdv2
+ rm -f *.d *.o freedv
# wxWidgets ---------------------------------------------------------
CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
CPP_FLAGS = -D_NO_AUTOTOOLS_ -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REVISION=\"$(SVN_REVISION)\"
-LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lctb-0.16 -lsox
+LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox
OBJS = topFrame.o \
fdmdv2_main.o \
dlg_filter.o \
varicode.o \
sox_biquad.o \
+hamlib.o \
../../codec2-dev/src/golay23.o
-HDRS = ../version.h dlg_audiooptions.h dlg_comports.h dlg_filter.h 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 topFrame.h varicode.h ../../codec2-dev/src/golay23.h
+HDRS = ../version.h dlg_audiooptions.h dlg_comports.h dlg_filter.h 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 topFrame.h varicode.h ../../codec2-dev/src/golay23.h hamlib.h
all: freedv
// Purpose: Subclasses dialog GUI for PTT Config. Creates simple
// wxWidgets dialog GUI to select real/virtual Comm ports.
// Date: May 11 2012
-// Authors: David Rowe, David Witten
+// Authors: David Rowe, David Witten, Joel Stanley
//
// License:
//
staticBoxSizer28->Add(m_ckHalfDuplex, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
mainSizer->Add(staticBoxSizer28, 0, wxEXPAND, 5);
-/*
- wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Audio Tone")), wxVERTICAL);
- mainSizer->Add(staticBoxSizer28, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
- m_ckPTTRtChan = new wxCheckBox(this, wxID_ANY, _("PTT tone on right audio channel"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_ckPTTRtChan->SetValue(false);
- staticBoxSizer28->Add(m_ckPTTRtChan, 0, wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 5);
-*/
+ wxStaticBoxSizer* staticBoxSizer18 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hamlib Settings")), wxVERTICAL);
+ mainSizer->Add(staticBoxSizer18, 1, wxEXPAND, 5);
- wxStaticBoxSizer* staticBoxSizer17 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Hardware PTT Settings")), wxVERTICAL);
- mainSizer->Add(staticBoxSizer17, 1, wxEXPAND, 5);
- wxStaticBoxSizer* staticBoxSizer31 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("PTT Port")), wxVERTICAL);
- staticBoxSizer17->Add(staticBoxSizer31, 1, wxEXPAND, 5);
+ wxGridSizer* gridSizer100 = new wxGridSizer(1, 5, 0, 0);
-// 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__
- 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);
-
- wxArrayString m_listCtrlPortsArr;
- m_listCtrlPorts = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,45), m_listCtrlPortsArr, wxLB_SINGLE | wxLB_SORT);
- staticBoxSizer31->Add(m_listCtrlPorts, 1, wxALIGN_CENTER, 0);
-#endif
-#ifdef __WXGTK__
- wxBoxSizer* bSizer83;
- bSizer83 = new wxBoxSizer(wxHORIZONTAL);
-
- wxGridSizer* gridSizer200 = new wxGridSizer(1, 3, 0, 0);
-
- m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_ckUseSerialPTT->SetValue(false);
- gridSizer200->Add(m_ckUseSerialPTT, 1, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-
- m_staticText12 = new wxStaticText(this, wxID_ANY, _("Device: "), wxDefaultPosition, wxDefaultSize, 0);
- m_staticText12->Wrap(-1);
- gridSizer200->Add(m_staticText12, 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
-// gridSizer200->Add(m_staticText12, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
+ /* Use Hamlib for PTT checkbox. */
+ m_ckUseHamlibPTT = new wxCheckBox(this, wxID_ANY, _("Use Hamlib PTT"), wxDefaultPosition, wxSize(-1, -1), 0);
+ m_ckUseHamlibPTT->SetValue(false);
+ gridSizer100->Add(m_ckUseHamlibPTT, 1, wxALIGN_LEFT, 2);
- m_txtCtlDevicePath = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
-// gridSizer200->Add(m_txtCtlDevicePath, 1, wxALIGN_CENTER|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
- gridSizer200->Add(m_txtCtlDevicePath, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-
- bSizer83->Add(gridSizer200, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 2);
- staticBoxSizer31->Add(bSizer83, 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);
- boxSizer19->Add(staticBoxSizer16, 1, wxEXPAND|wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
- wxGridSizer* gridSizer17 = new wxGridSizer(2, 2, 0, 0);
- staticBoxSizer16->Add(gridSizer17, 1, wxEXPAND|wxALIGN_RIGHT, 5);
+ /* Hamlib Rig Type combobox. */
+ gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Rig Model: "), wxDefaultPosition, wxDefaultSize, 0), 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+ m_cbRigName = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+ /* TODO(Joel): this is a hack. At the least, need to gaurntee that m_hamLib
+ * exists. */
+ wxGetApp().m_hamlib->populateComboBox(m_cbRigName);
+ m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+ gridSizer100->Add(m_cbRigName, 1, wxALIGN_CENTER|wxALIGN_RIGHT, 2);
-/*
- m_ckUseSerialPTT = new wxCheckBox(this, wxID_ANY, _("Use Serial Port PTT"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_ckUseSerialPTT->SetValue(false);
- gridSizer17->Add(m_ckUseSerialPTT, 0, wxALIGN_CENTER, 10);
- gridSizer17->Add(0, 0, 0, 0, 5);
-*/
- m_rbUseDTR = new wxRadioButton(this, wxID_ANY, _("Use DTR"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_rbUseDTR->SetToolTip(_("Toggle DTR line for PTT"));
- m_rbUseDTR->SetValue(1);
- gridSizer17->Add(m_rbUseDTR, 0, wxALIGN_CENTER|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
+ /* Hamlib Serial Port combobox. */
+ gridSizer100->Add(new wxStaticText(this, wxID_ANY, _("Serial Device: "), wxDefaultPosition, wxDefaultSize, 0), 1,wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 2);
+ m_cbSerialPort = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(140, -1), 0, NULL, wxCB_DROPDOWN);
+ gridSizer100->Add(m_cbSerialPort, 1, wxALIGN_CENTER|wxALIGN_RIGHT, 2);
- m_ckDTRPos = new wxCheckBox(this, wxID_ANY, _("DTR = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_ckDTRPos->SetToolTip(_("Set Polarity of the DTR line"));
- m_ckDTRPos->SetValue(false);
- gridSizer17->Add(m_ckDTRPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
- m_rbUseRTS = new wxRadioButton(this, wxID_ANY, _("Use RTS"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_rbUseRTS->SetToolTip(_("Toggle the RTS pin for PTT"));
- m_rbUseRTS->SetValue(1);
- gridSizer17->Add(m_rbUseRTS, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
-
- m_ckRTSPos = new wxCheckBox(this, wxID_ANY, _("RTS = +V"), wxDefaultPosition, wxSize(-1,-1), 0);
- m_ckRTSPos->SetValue(false);
- m_ckRTSPos->SetToolTip(_("Set Polarity of the RTS line"));
- gridSizer17->Add(m_ckRTSPos, 0, wxALIGN_CENTER|wxALIGN_RIGHT, 5);
+ staticBoxSizer18->Add(gridSizer100, 1, wxALIGN_CENTER_VERTICAL|wxALL, 1);
wxBoxSizer* boxSizer12 = new wxBoxSizer(wxHORIZONTAL);
mainSizer->Add(boxSizer12, 0, wxLEFT|wxRIGHT|wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
// Connect events
this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-// m_ckPTTRtChan->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTAudioClick), NULL, this);
-// m_listCtrlPorts->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(ComPortsDlg::PTTPortSlelcted), NULL, this);
- m_ckUseSerialPTT->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
- m_rbUseDTR->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ComPortsDlg::UseDTRCliched), NULL, this);
- m_rbUseRTS->Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ComPortsDlg::UseRTSClicked), NULL, this);
-// m_ckRTSPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::DTRVPlusClicked), NULL, this);
-// m_ckDTRPos->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::RTSVPlusClicked), NULL, this);
m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
m_buttonApply->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
{
// Disconnect Events
this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(ComPortsDlg::OnInitDialog), NULL, this);
-// m_ckPTTRtChan->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTAudioClick), NULL, this);
-// m_listCtrlPorts->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(ComPortsDlg::PTTPortSlelcted), NULL, this);
- m_ckUseSerialPTT->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::PTTUseSerialClicked), NULL, this);
- m_rbUseDTR->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ComPortsDlg::UseDTRCliched), NULL, this);
- m_rbUseRTS->Disconnect(wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler(ComPortsDlg::UseRTSClicked), NULL, this);
-// m_ckRTSPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::DTRVPlusClicked), NULL, this);
-// m_ckDTRPos->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ComPortsDlg::RTSVPlusClicked), NULL, this);
m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnOK), NULL, this);
m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnCancel), NULL, this);
m_buttonApply->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ComPortsDlg::OnApply), NULL, this);
for(unsigned int i = 0; i < values; i++)
{
key.QueryValue(key_name, key_data);
- wxPrintf("Value: %s Data: %s\n", 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);
+ m_cbSerialPort->Append(aStr);
#endif
#ifdef __WXGTK__
+ /* TODO(Joel): http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them */
+ m_cbSerialPort->Clear();
+ m_cbSerialPort->Append("/dev/ttyUSB0");
+ m_cbSerialPort->Append("/dev/ttyS0");
#endif
}
if(inout == EXCHANGE_DATA_IN)
{
-// m_ckUsePTTRtChan->SetValue(wxGetApp().m_boolUseTonePTT);
m_ckHalfDuplex->SetValue(wxGetApp().m_boolHalfDuplex);
- 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);
-// m_textRigCtrlDatabits->SetValue(wxGetApp().m_strRigCtrlDatabits);
-// m_textRigCtrlStopbits->SetValue(wxGetApp().m_strRigCtrlStopbits);
-// m_textRigCtrlParity->SetValue(wxGetApp().m_strRigCtrlParity);
-
- m_rbUseRTS->SetValue(wxGetApp().m_boolUseRTS);
- m_ckRTSPos->SetValue(wxGetApp().m_boolRTSPos);
- m_rbUseDTR->SetValue(wxGetApp().m_boolUseDTR);
- m_ckDTRPos->SetValue(wxGetApp().m_boolDTRPos);
+ m_ckUseHamlibPTT->SetValue(wxGetApp().m_boolHamlibUseForPTT);
+ m_cbRigName->SetSelection(wxGetApp().m_intHamlibRig);
+ m_cbSerialPort->SetValue(wxGetApp().m_strHamlibSerialPort);
}
if(inout == EXCHANGE_DATA_OUT)
{
- wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
- 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();
- wxGetApp().m_boolDTRPos = m_ckDTRPos->IsChecked();
-
- pConfig->Write(wxT("/Rig/UseRTS"), wxGetApp().m_boolUseRTS);
- pConfig->Write(wxT("/Rig/RTSPolarity"), wxGetApp().m_boolRTSPos);
- pConfig->Write(wxT("/Rig/UseDTR"), wxGetApp().m_boolUseDTR);
- pConfig->Write(wxT("/Rig/DTRPolarity"), wxGetApp().m_boolDTRPos);
- pConfig->Write(wxT("/Rig/UseTonePTT"), wxGetApp().m_boolUseTonePTT);
- pConfig->Write(wxT("/Rig/UseSerialPTT"), wxGetApp().m_boolUseSerialPTT);
-
-// wxGetApp().m_strRigCtrlBaud = m_listCtrlBaudrates->GetStringSelection();
-// wxGetApp().m_strRigCtrlDatabits = m_textRigCtrlDatabits->GetValue();
-// wxGetApp().m_strRigCtrlStopbits = m_textRigCtrlStopbits->GetValue();
-// wxGetApp().m_strRigCtrlParity = m_textRigCtrlParity->GetValue();
-
-// pConfig->Write(wxT("/Rig/Port"), wxGetApp().m_strRigCtrlPort);
-// pConfig->Write(wxT("/Rig/Baud"), wxGetApp().m_strRigCtrlBaud);
-// pConfig->Write(wxT("/Rig/DataBits"), wxGetApp().m_strRigCtrlDatabits);
-// pConfig->Write(wxT("/Rig/StopBits"), wxGetApp().m_strRigCtrlStopbits);
-// pConfig->Write(wxT("/Rig/Parity"), wxGetApp().m_strRigCtrlParity);
- pConfig->Flush();
+ wxGetApp().m_boolHalfDuplex = m_ckHalfDuplex->GetValue();
+ pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+
+ /* Hamlib settings. */
+ wxGetApp().m_boolHamlibUseForPTT = m_ckUseHamlibPTT->GetValue();
+ wxGetApp().m_intHamlibRig = m_cbRigName->GetSelection();
+ wxGetApp().m_strHamlibSerialPort = m_cbSerialPort->GetValue();
+
+ pConfig->Write(wxT("/Hamlib/UseForPTT"), wxGetApp().m_boolHamlibUseForPTT);
+ pConfig->Write(wxT("/Hamlib/RigName"), wxGetApp().m_intHamlibRig);
+ pConfig->Write(wxT("/Hamlib/SerialPort"), wxGetApp().m_strHamlibSerialPort);
+ pConfig->Flush();
}
delete wxConfigBase::Set((wxConfigBase *) NULL);
}
-//-------------------------------------------------------------------------
-// PTTAudioClick()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTAudioClick(wxCommandEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// PTTUseSerialClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::PTTUseSerialClicked(wxCommandEvent& event)
-{
-}
-/*
-//-------------------------------------------------------------------------
-// DTRVPlusClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::DTRVPlusClicked(wxCommandEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// RTSVPlusClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::RTSVPlusClicked(wxCommandEvent& event)
-{
-}
-*/
-
-//-------------------------------------------------------------------------
-// OnCancel()
-//-------------------------------------------------------------------------
-void ComPortsDlg::UseDTRCliched(wxCommandEvent& event)
-{
-}
-
-//-------------------------------------------------------------------------
-// UseRTSClicked()
-//-------------------------------------------------------------------------
-void ComPortsDlg::UseRTSClicked(wxCommandEvent& event)
-{
-}
-
//-------------------------------------------------------------------------
// OnApply()
//-------------------------------------------------------------------------
ExchangeData(EXCHANGE_DATA_OUT);
this->EndModal(wxID_OK);
}
-
#define __COMPORTS_DIALOG__
#include "fdmdv2_main.h"
+#include "hamlib.h"
#include <wx/settings.h>
#include <wx/xrc/xmlres.h>
#include <wx/xrc/xh_bmp.h>
#include <wx/listbox.h>
#include <wx/radiobut.h>
#include <wx/button.h>
+#include <wx/spinctrl.h>
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
// Class ComPortsDlg
protected:
wxCheckBox* m_ckHalfDuplex;
- wxCheckBox* m_ckUsePTTRtChan;
- wxListBox* m_listCtrlPorts;
- wxCheckBox* m_ckUseSerialPTT;
- wxStaticText* m_staticText12;
- wxTextCtrl *m_txtCtlDevicePath;
- wxRadioButton* m_rbUseDTR;
- wxCheckBox* m_ckRTSPos;
- wxRadioButton* m_rbUseRTS;
- wxCheckBox* m_ckDTRPos;
+
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
+ /* Hamlib settings. */
+ wxCheckBox *m_ckUseHamlibPTT;
+ wxComboBox *m_cbRigName;
+ wxComboBox *m_cbSerialPort;
+
+ Hamlib *m_hamlib;
+
protected:
- void ListAllPorts();
+ void populatePortList();
- void populatePortList(void);
- void PTTAudioClick(wxCommandEvent& event);
-// void PTTPortSlelcted(wxCommandEvent& event);
- void PTTUseSerialClicked(wxCommandEvent& event);
- void UseDTRCliched(wxCommandEvent& event);
- //void DTRVPlusClicked(wxCommandEvent& event);
- void UseRTSClicked(wxCommandEvent& event);
- //void RTSVPlusClicked(wxCommandEvent& event);
void OnOK(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
m_textVoiceOutput.Empty();
m_strSampleRate.Empty();
m_strBitrate.Empty();
- m_boolUseTonePTT = false;
- m_boolUseSerialPTT = true;
// Create the main application window
- MainFrame *frame = new MainFrame(NULL);
+ frame = new MainFrame(NULL);
SetTopWindow(frame);
// Should guarantee that the first plot tab defined is the one
// displayed. But it doesn't when built from command line. Why?
MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
{
m_zoom = 1.;
- m_serialPort = NULL;
- m_device = NULL;
+
+ /* TODO(Joel): Try making hamlib owned by MainFrame. */
+ wxGetApp().m_hamlib = new Hamlib();
tools->AppendSeparator();
wxMenuItem* m_menuItemToolsConfigDelete;
g_nSoundCards = 2;
}
- wxGetApp().m_strRigCtrlPort = pConfig->Read(wxT("/Rig/Port"), wxT("COM3"));
- wxGetApp().m_strRigCtrlBaud = pConfig->Read(wxT("/Rig/Baud"), wxT("9600"));
- wxGetApp().m_strRigCtrlDatabits = pConfig->Read(wxT("/Rig/DataBits"), wxT("8"));
- 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_boolHalfDuplex = pConfig->ReadBool(wxT("/Rig/HalfDuplex"), 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);
- wxGetApp().m_boolDTRPos = pConfig->ReadBool(wxT("/Rig/DTRPolarity"), false);
wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath", wxT(""));
wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
+ wxGetApp().m_boolHamlibUseForPTT = pConfig->ReadBool("/Hamlib/UseForPTT", false);
+ wxGetApp().m_intHamlibRig = pConfig->ReadLong("/Hamlib/RigName", 0);
+ wxGetApp().m_strHamlibSerialPort = pConfig->Read("/Hamlib/SerialPort", "");
+
bool slow = false; // prevents compile error when using default bool
wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
//m_togRxID->Disable();
//m_togTxID->Disable();
m_togBtnAnalog->Disable();
+ m_btnTogPTT->Disable();
//m_togBtnALC->Disable();
- SetupSerialPort();
+ OpenHamlibRig();
// squelch settings
char sqsnr[15];
int w;
int h;
+ /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
+ if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
+
//MainApp *pApp = wxGetApp();
wxConfigBase *pConfig = wxConfigBase::Get();
if(pConfig)
pConfig->Write(wxT("/Audio/soundCard2OutDeviceNum"), g_soundCard2OutDeviceNum);
pConfig->Write(wxT("/Audio/soundCard2SampleRate"), g_soundCard2SampleRate );
- pConfig->Write(wxT("/Rig/Port"), wxGetApp().m_strRigCtrlPort);
- pConfig->Write(wxT("/Rig/Baud"), wxGetApp().m_strRigCtrlBaud);
- pConfig->Write(wxT("/Rig/DataBits"), wxGetApp().m_strRigCtrlDatabits);
- pConfig->Write(wxT("/Rig/StopBits"), wxGetApp().m_strRigCtrlStopbits);
- pConfig->Write(wxT("/Rig/Parity"), wxGetApp().m_strRigCtrlParity);
- pConfig->Write(wxT("/Rig/UseRTS"), wxGetApp().m_boolUseRTS);
- pConfig->Write(wxT("/Rig/RTSPolarity"), wxGetApp().m_boolRTSPos);
- pConfig->Write(wxT("/Rig/UseDTR"), wxGetApp().m_boolUseDTR);
- pConfig->Write(wxT("/Rig/DTRPolarity"), wxGetApp().m_boolDTRPos);
- pConfig->Write(wxT("/Rig/UseTonePTT"), wxGetApp().m_boolUseTonePTT);
- pConfig->Write(wxT("/Rig/UseSerialPTT"), wxGetApp().m_boolUseSerialPTT);
pConfig->Write(wxT("/Rig/HalfDuplex"), wxGetApp().m_boolHalfDuplex);
+ pConfig->Write("/Hamlib/UseForPTT", wxGetApp().m_boolHamlibUseForPTT);
+ pConfig->Write("/Hamlib/RigName", wxGetApp().m_intHamlibRig);
+ pConfig->Write("/Hamlib/SerialPort", wxGetApp().m_strHamlibSerialPort);
+
pConfig->Write(wxT("/File/playFileToMicInPath"), wxGetApp().m_playFileToMicInPath);
pConfig->Write(wxT("/File/recFileFromRadioPath"), wxGetApp().m_recFileFromRadioPath);
//m_togBtnALC->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnALCClickUI), NULL, this);
//m_btnTogPTT->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnTogBtnPTT_UI), NULL, this);
- CloseSerialPort();
sox_biquad_finish();
if (m_RxRunning)
//printf("m_snrSlow: %d\n", (int)wxGetApp().m_snrSlow);
}
+// check for space bar press
+
+int MainApp::FilterEvent(wxEvent& event)
+{
+ if ((event.GetEventType() == wxEVT_KEY_DOWN) &&
+ (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE))
+ {
+ //printf("m_rxRunnng: %d\n", frame->m_RxRunning);
+ if (frame->m_RxRunning) {
+ if (frame->m_btnTogPTT->GetValue())
+ frame->m_btnTogPTT->SetValue(false);
+ else
+ frame->m_btnTogPTT->SetValue(true);
+
+ frame->togglePTT();
+ }
+ return true;
+
+ }
+
+ return -1;
+}
+
//-------------------------------------------------------------------------
// OnTogBtnPTT ()
//-------------------------------------------------------------------------
void MainFrame::OnTogBtnPTT (wxCommandEvent& event)
{
+ togglePTT();
+ event.Skip();
+}
+
+void MainFrame::togglePTT(void) {
if (g_tx)
{
// tx-> rx transition, swap to the page we were on for last rx
m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
}
g_tx = m_btnTogPTT->GetValue();
- // Tortured and tortuous logic, it seems to me...
- if(wxGetApp().m_boolUseSerialPTT && m_serialPort != NULL)
- {
- 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
- {
- if(wxGetApp().m_boolUseRTS) // Use RTS
- {
- if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateRts);
- }
- else // RTS cleared HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateRts);
- }
- }
- else // Use DTR
- {
- if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateDtr);
- }
- else // DTR cleared HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateDtr);
- }
- }
- }
+
+ // Hamlib
+ Hamlib *rig = wxGetApp().m_hamlib;
+ if (wxGetApp().m_boolHamlibUseForPTT && rig != NULL) {
+ rig->ptt(g_tx);
}
+
// reset level gauge
m_maxLevel = 0;
m_textLevel->SetLabel(wxT(""));
m_gaugeLevel->SetValue(0);
- event.Skip();
}
//-------------------------------------------------------------------------
m_togBtnAnalog->Disable();
//m_togBtnALC->Disable();
//m_btnTogPTT->Disable();
- CloseSerialPort();
Pa_Terminate();
Destroy();
}
void MainFrame::OnToolsComCfg(wxCommandEvent& event)
{
wxUnusedVar(event);
- int rv = 0;
- int iLineState = 0;
- //bool bPTTEnabled = m_btnTogPTT->IsEnabled();
- //bool bPTTState = m_btnTogPTT->GetValue();
- if(m_serialPort != NULL)
- {
- CloseSerialPort();
- }
ComPortsDlg *dlg = new ComPortsDlg(NULL);
- rv = dlg->ShowModal();
- if(rv == wxID_OK)
+ if(dlg->ShowModal() == wxID_OK)
{
dlg->ExchangeData(EXCHANGE_DATA_OUT);
- SetupSerialPort();
- }
- else if(rv == wxID_CANCEL)
- {
- SetupSerialPort();
- if(m_serialPort != NULL)
- {
- if(iLineState | ctb::LinestateRts)
- {
- m_serialPort->SetLineState(ctb::LinestateRts);
- }
- else
- {
- m_serialPort->ClrLineState(ctb::LinestateRts);
- }
- if(iLineState | ctb::LinestateDtr)
- {
- m_serialPort->SetLineState(ctb::LinestateDtr);
- }
- else
- {
- m_serialPort->ClrLineState(ctb::LinestateDtr);
- }
- // m_btnTogPTT->Enable(bPTTEnabled);
- // m_btnTogPTT->SetValue(bPTTState);
- }
+ /* Opening is done on app start. If the user has just
+ * adjusted the hamlib settings, do an open when they press
+ * okay. */
+ OpenHamlibRig();
}
delete dlg;
}
//bool wxLaunchDefaultBrowser(http:("http://freedv.org/");
+bool MainFrame::OpenHamlibRig() {
+ if (wxGetApp().m_boolHamlibUseForPTT != true)
+ return false;
+ if (wxGetApp().m_intHamlibRig == 0)
+ return false;
+ if (wxGetApp().m_hamlib == NULL)
+ return false;
+
+ int rig = wxGetApp().m_intHamlibRig;
+ wxString port = wxGetApp().m_strHamlibSerialPort;
+ bool status = wxGetApp().m_hamlib->connect(rig, port.mb_str(wxConvUTF8));
+ if (status == false)
+ wxMessageBox("Couldn't connect to Radio with hamlib", wxT("About"), wxOK | wxICON_ERROR, this);
+
+ return status;
+}
+
//-------------------------------------------------------------------------
// OnTogBtnOnOff()
//-------------------------------------------------------------------------
//m_togRxID->Enable();
//m_togTxID->Enable();
m_togBtnAnalog->Enable();
-/*
- if(m_serialPort != NULL)
- {
- m_btnTogPTT->Enable();
- }
-*/
m_togBtnOnOff->SetLabel(wxT("Stop"));
+ m_btnTogPTT->Enable();
m_rb1400old->Disable();
m_rb1600->Disable();
m_plotTimer.Stop();
#endif // _USE_TIMER
+ // ensure we are not transmitting
+ Hamlib *rig = wxGetApp().m_hamlib;
+ if (wxGetApp().m_boolHamlibUseForPTT && rig != NULL) {
+ rig->ptt(false);
+ }
+ m_btnTogPTT->SetValue(false);
+
stopRxStream();
free(g_error_pattern);
//m_togRxID->Disable();
//m_togTxID->Disable();
m_togBtnAnalog->Disable();
- //m_btnTogPTT->Disable();
+ m_btnTogPTT->Disable();
m_togBtnOnOff->SetLabel(wxT("Start"));
m_rb1400old->Enable();
m_rb1600->Enable();
g_RxFreqOffsetHz = FDMDV_FCENTRE - freq;
}
}
-
-//----------------------------------------------------------------
-// SetupSerialPort()
-//----------------------------------------------------------------
-void MainFrame::SetupSerialPort(void)
-{
- long baudrate;
-
- wxGetApp().m_strRigCtrlBaud.ToLong(&baudrate, 10);
- if(!wxGetApp().m_strRigCtrlPort.IsEmpty())
- {
- 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 )
- {
- m_device = m_serialPort;
- // always start with PTT cleared
- if(wxGetApp().m_boolRTSPos) // RTS cleared LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateRts);
- }
- else // RTS cleared HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateRts);
- }
- if(wxGetApp().m_boolDTRPos) // DTR cleared LOW
- {
- m_serialPort->ClrLineState(ctb::LinestateDtr);
- }
- else // DTR cleared HIGH
- {
- m_serialPort->SetLineState(ctb::LinestateDtr);
- }
- //m_btnTogPTT->Enable(true);
- m_btnTogPTT->SetValue(false);
- }
- else
- {
- m_serialPort = NULL;
- m_device = NULL;
- //m_btnTogPTT->Disable();
- }
- }
-/*
- else
- {
- wxMessageBox(wxT("You must select a Serial port to Open!"), wxT("Error"), wxOK);
- }
-*/
-}
-
-//----------------------------------------------------------------
-// CloseSerialPort()
-//----------------------------------------------------------------
-void MainFrame::CloseSerialPort(void)
-{
- if((m_serialPort != NULL) && m_serialPort->IsOpen())
- {
- m_serialPort->Close();
- m_serialPort = NULL;
- m_device = NULL;
- //m_btnTogPTT->SetLabel(wxT("PTT"));
- //m_btnTogPTT->Enable(false);
- }
-}
#include <samplerate.h>
+#include <hamlib.h>
+
#include "codec2.h"
#include "codec2_fdmdv.h"
#include "codec2_fifo.h"
#include "golay23.h"
-#include "ctb-0.16/ctb.h"
-#include "ctb-0.16/portscan.h"
-#include "ctb-0.16/serportx.h"
-#include "ctb-0.16/serport.h"
-
#include "topFrame.h"
#include "dlg_comports.h"
#include "fdmdv2_plot.h"
extern int g_soundCard2OutDeviceNum;
extern int g_soundCard2SampleRate;
+class MainFrame;
+
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=
// Class MainApp
//
wxString m_strSampleRate;
wxString m_strBitrate;
- wxString m_strRigCtrlPort;
- wxString m_strRigCtrlBaud;
- wxString m_strRigCtrlDatabits;
- wxString m_strRigCtrlStopbits;
- wxString m_strRigCtrlParity;
bool m_boolHalfDuplex;
- bool m_boolUseSerialPTT;
- bool m_boolUseTonePTT;
- bool m_boolUseRTS;
- bool m_boolRTSPos;
- bool m_boolUseDTR;
- bool m_boolDTRPos;
+
+ bool m_boolHamlibUseForPTT;
+ unsigned int m_intHamlibRig;
+ wxString m_strHamlibSerialPort;
+ Hamlib *m_hamlib;
wxString m_playFileToMicInPath;
wxString m_recFileFromRadioPath;
bool m_testFrames;
+ int FilterEvent(wxEvent& event);
+ MainFrame *frame;
protected:
};
txRxThread* m_txRxThread;
- void SetupSerialPort(void);
- void CloseSerialPort(void);
+ bool OpenHamlibRig();
#ifdef _USE_TIMER
wxTimer m_plotTimer;
void initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDevice,
int soundCard, int sampleRate, int inputChannels);
- protected:
+ void togglePTT(void);
- ctb::IOBase* m_device;
- ctb::SerialPort* m_serialPort;
+ protected:
void setsnrBeta(bool snrSlow);
// Shift previous bit map up one row of blocks ----------------------------
wxNativePixelData data(*m_pBmp);
- assert(data != NULL);
wxNativePixelData::Iterator bitMapStart(data);
wxNativePixelData::Iterator p = bitMapStart;
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer(wxVERTICAL);
m_btnTogPTT = new wxToggleButton(this, wxID_ANY, _("PTT"), wxDefaultPosition, wxDefaultSize, 0);
- m_btnTogPTT->SetToolTip(_("PTT Switch between Receive and Transmit"));
+ m_btnTogPTT->SetToolTip(_("Push to Talk - Switch between Receive and Transmit - you can also use the space bar "));
bSizer11->Add(m_btnTogPTT, 1, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
sbSizer5->Add(bSizer11, 2, wxEXPAND, 1);
rightSizer->Add(sbSizer5, 2, wxALIGN_CENTER|wxALL|wxEXPAND, 3);