first pass at half duplex, still testing
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 10 Dec 2012 05:09:11 +0000 (05:09 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 10 Dec 2012 05:09:11 +0000 (05:09 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1126 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/dlg_audiooptions.h
fdmdv2/src/dlg_comports.cpp
fdmdv2/src/dlg_comports.h
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_main.h

index 3b6c5a5b083ffd31350129f4729127b1ae3ee2e4..a550b3aea0da2d918f3cef87ea0dc4187bde428d 100644 (file)
@@ -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);
 };
index 3fffeab1d5c89083519dcfdd0a49254046219032..e0ffddc009f23838427d2b7d8c091db6a42f29e1 100644 (file)
@@ -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__
index 28b655887faacda047f7741065b8ed64659224be..952d4b50da14fa1d77b7f42f6d6a4b9f781c67ce 100644 (file)
@@ -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
 // 
 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;
index 23c25662a5efa7ef90bdabb9bb8fbe76e188b7c6..906ea6742aa9570fa48c9410bccca3960be58e9b 100644 (file)
@@ -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
index 3ed7acf93eb836e35de8b4d8797198b656649841..b897fdf206ba41f439745400bf1caa32442f85e1 100644 (file)
@@ -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;