From: drowe67 Date: Mon, 10 Dec 2012 05:09:11 +0000 (+0000) Subject: first pass at half duplex, still testing X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=8ad8e6cdeb41316c0ad4bf0e0f69a5e9e853bd48;p=freetel-svn-tracking.git first pass at half duplex, still testing git-svn-id: https://svn.code.sf.net/p/freetel/code@1126 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/src/dlg_audiooptions.h b/fdmdv2/src/dlg_audiooptions.h index 3b6c5a5b..a550b3ae 100644 --- a/fdmdv2/src/dlg_audiooptions.h +++ b/fdmdv2/src/dlg_audiooptions.h @@ -169,7 +169,7 @@ class AudioOptsDialog : public wxDialog public: - AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + AudioOptsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Audio Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~AudioOptsDialog(); int ExchangeData(int inout); }; diff --git a/fdmdv2/src/dlg_comports.cpp b/fdmdv2/src/dlg_comports.cpp index 3fffeab1..e0ffddc0 100644 --- a/fdmdv2/src/dlg_comports.cpp +++ b/fdmdv2/src/dlg_comports.cpp @@ -1,7 +1,7 @@ //========================================================================== // Name: dlg_comports.cpp -// Purpose: Creates simple wxWidgets dialog GUI to select -// real/virtual Comm ports. +// 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 // @@ -32,6 +32,12 @@ ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); this->SetSizer(mainSizer); + wxStaticBoxSizer* staticBoxSizer28 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("VOX PTT Settings")), wxVERTICAL); + m_ckHalfDuplex = new wxCheckBox(this, wxID_ANY, _("Half Duplex"), wxDefaultPosition, wxSize(-1,-1), 0); + m_ckHalfDuplex->SetToolTip(_("Should be checked for VOX operated Tx/Rx switching")); + 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); @@ -236,6 +242,7 @@ void ComPortsDlg::ExchangeData(int inout) 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__ @@ -258,6 +265,7 @@ void ComPortsDlg::ExchangeData(int inout) } 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__ diff --git a/fdmdv2/src/dlg_comports.h b/fdmdv2/src/dlg_comports.h index 28b65588..952d4b50 100644 --- a/fdmdv2/src/dlg_comports.h +++ b/fdmdv2/src/dlg_comports.h @@ -1,7 +1,7 @@ //========================================================================== -// Name: dlg_options.h -// Purpose: Subclasses dialog GUI for general program options. -// (DlgOptions from topFrame.h) +// Name: dlg_comports.h +// Purpose: Subclasses dialog GUI for PTT Config. +// // Created: May. 11, 2012 // Authors: David Rowe, David Witten // @@ -40,11 +40,12 @@ class ComPortsDlg : public wxDialog { public: - ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hardware PTT"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); + ComPortsDlg(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PTT Config"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(450,300), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); virtual ~ComPortsDlg(); void ExchangeData(int inout); protected: + wxCheckBox* m_ckHalfDuplex; wxCheckBox* m_ckUsePTTRtChan; wxListBox* m_listCtrlPorts; wxCheckBox* m_ckUseSerialPTT; diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 23c25662..906ea674 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -48,6 +48,7 @@ int g_analog; int g_split; int g_tx; float g_snr; +bool g_half_duplex; // sending and receiving Call Sign data struct FIFO *g_txDataInFifo; @@ -312,6 +313,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_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); @@ -493,6 +495,7 @@ MainFrame::~MainFrame() 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(wxT("/File/playFileToMicInPath"), wxGetApp().m_playFileToMicInPath); pConfig->Write(wxT("/File/recFileFromRadioPath"), wxGetApp().m_recFileFromRadioPath); @@ -1583,6 +1586,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) g_State = 0; g_snr = 0.0; + g_half_duplex = wxGetApp().m_boolHalfDuplex; m_pcallsign = m_callsign; @@ -2210,7 +2214,7 @@ void txRxProcessing() // TX side processing -------------------------------------------- // - if (g_nSoundCards == 2 ) { + if ((g_nSoundCards == 2) && ((g_half_duplex && g_tx) || !g_half_duplex)) { // Make sure we have at least 6 frames of modulator output // samples. This also locks the modulator to the sample rate diff --git a/fdmdv2/src/fdmdv2_main.h b/fdmdv2/src/fdmdv2_main.h index 3ed7acf9..b897fdf2 100644 --- a/fdmdv2/src/fdmdv2_main.h +++ b/fdmdv2/src/fdmdv2_main.h @@ -133,6 +133,7 @@ class MainApp : public wxApp wxString m_strRigCtrlDatabits; wxString m_strRigCtrlStopbits; wxString m_strRigCtrlParity; + bool m_boolHalfDuplex; bool m_boolUseSerialPTT; bool m_boolUseTonePTT; bool m_boolUseRTS;