added extra GUI elements for 700D, still to hook up
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 4 May 2018 06:24:07 +0000 (06:24 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 4 May 2018 06:24:07 +0000 (06:24 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3572 01035d8c-6547-0410-b346-abe4f91aad63

freedv-dev/src/dlg_options.cpp
freedv-dev/src/dlg_options.h
freedv-dev/src/fdmdv2_main.cpp
freedv-dev/src/fdmdv2_main.h
freedv-dev/src/topFrame.cpp
freedv-dev/src/topFrame.h

index f636971deefe69c7d3a0da83f1be346fbe07b222..798bac9e230d55eff41bca8dd41f25b3229244d2 100644 (file)
@@ -112,9 +112,17 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
 
     m_ckboxFreeDV700txClip = new wxCheckBox(this, wxID_ANY, _("Clipping"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
     sbSizer_freedv700->Add(m_ckboxFreeDV700txClip, 0, wxALIGN_LEFT, 0);
-    m_ckboxFreeDV700Combine = new wxCheckBox(this, wxID_ANY, _("700C Diversity Combine for plots"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    m_ckboxFreeDV700Combine = new wxCheckBox(this, wxID_ANY, _("700C Diversity Combine for plots   700D Interleaver:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
     sbSizer_freedv700->Add(m_ckboxFreeDV700Combine, 0, wxALIGN_LEFT, 0);
 
+    //wxStaticText *m_staticTexttb = new wxStaticText(this, wxID_ANY, _("   700D Interleave: "), wxDefaultPosition, wxDefaultSize, 0);
+    //sbSizer_freedv700->Add(m_staticTexttb, 0, wxALIGN_CENTRE_VERTICAL, 5);    
+    m_txtInterleave = new wxTextCtrl(this, wxID_ANY,  wxString("1"), wxDefaultPosition, wxSize(30,-1), 0, wxTextValidator(wxFILTER_DIGITS));
+    sbSizer_freedv700->Add(m_txtInterleave, 0, wxALIGN_CENTRE_VERTICAL, 0);
+
+    m_ckboxFreeDV700ManualUnSync = new wxCheckBox(this, wxID_ANY, _("700D Manual UnSync"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_freedv700->Add(m_ckboxFreeDV700ManualUnSync, 0, wxALIGN_LEFT, 0);
+
     bSizer30->Add(sbSizer_freedv700, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
 
     //------------------------------
@@ -410,6 +418,8 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
 
         m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
         m_ckboxFreeDV700Combine->SetValue(wxGetApp().m_FreeDV700Combine);
+        m_txtInterleave->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_FreeDV700Interleave));
+        m_ckboxFreeDV700ManualUnSync->SetValue(wxGetApp().m_FreeDV700ManualUnSync);
 
 #ifdef __WXMSW__
         m_ckboxDebugConsole->SetValue(wxGetApp().m_debug_console);
@@ -488,6 +498,10 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
 
         wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
         wxGetApp().m_FreeDV700Combine = m_ckboxFreeDV700Combine->GetValue();
+        long interleave;
+        m_txtInterleave->GetValue().ToLong(&interleave);
+        wxGetApp().m_FreeDV700Interleave = (int)interleave;
+        wxGetApp().m_FreeDV700ManualUnSync = m_ckboxFreeDV700ManualUnSync->GetValue();
 
 #ifdef __WXMSW__
         wxGetApp().m_debug_console = m_ckboxDebugConsole->GetValue();
@@ -511,6 +525,8 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
             pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
 
             pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
+            pConfig->Write(wxT("/FreeDV700/interleave"), wxGetApp().m_FreeDV700Interleave);
+            pConfig->Write(wxT("/FreeDV700/manualUnSync"), wxGetApp().m_FreeDV700ManualUnSync);
 
             pConfig->Write(wxT("/Noise/noise_snr"),  wxGetApp().m_noise_snr);
 
index 9c954513ab2c873ed662cb92066462523b0192ca..0d1d179d268c4a5a3d211190f51c036a9311d9f8 100644 (file)
@@ -109,7 +109,9 @@ class OptionsDlg : public wxDialog
 
         wxCheckBox   *m_ckboxFreeDV700txClip;
         wxCheckBox   *m_ckboxFreeDV700Combine;
-
+        wxTextCtrl   *m_txtInterleave;
+        wxCheckBox   *m_ckboxFreeDV700ManualUnSync;
+        
         wxRadioButton *m_rb_textEncoding1;
         wxRadioButton *m_rb_textEncoding2;
         wxCheckBox    *m_ckboxEnableChecksum;
index 5dc4421b75dc32942264fa954d8e7b6ea79fe9e0..edea1b9477fffca4d4cf86dcf983c2de9b3bc3f1 100644 (file)
@@ -511,6 +511,9 @@ MainFrame::MainFrame(wxString plugInName, wxWindow *parent) : TopFrame(plugInNam
 
     wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
     wxGetApp().m_FreeDV700Combine = 1;
+    wxGetApp().m_FreeDV700Interleave = (int)pConfig->Read(wxT("/FreeDV700/ninterleave"), 1);
+    wxGetApp().m_FreeDV700ManualUnSync = (float)pConfig->Read(wxT("/FreeDV700/manualUnSync"), f);
+
     wxGetApp().m_noise_snr = (float)pConfig->Read(wxT("/Noise/noise_snr"), 2);
  
     wxGetApp().m_debug_console = (float)pConfig->Read(wxT("/Debug/console"), f);
@@ -1002,11 +1005,11 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
         if (g_prev_State == 0) {
             g_resyncs++;
         }
-        m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
+        //m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
         m_rbSync->SetValue(true);        
     }
     else {
-        m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
+        //m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
         m_rbSync->SetValue(false);
     }
     g_prev_State = g_State;
@@ -2338,7 +2341,14 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
         if (g_mode != -1) { 
             // init freedv states
 
-            g_pfreedv = freedv_open(g_mode);
+            if (g_mode == FREEDV_MODE_700D) {
+                struct freedv_advanced adv;
+                adv.interleave_frames = wxGetApp().m_FreeDV700Interleave;
+                g_pfreedv = freedv_open_advanced(g_mode, &adv);
+            } else {
+                g_pfreedv = freedv_open(g_mode);
+            }
+            
             freedv_set_callback_txt(g_pfreedv, &my_put_next_rx_char, &my_get_next_tx_char, NULL);
 
             freedv_set_callback_error_pattern(g_pfreedv, my_freedv_put_error_pattern, (void*)m_panelTestFrameErrors);
index e07406925e12ac17d609303fd2cf891e4db60cd2..5078ba159207c2a8f5142822fa31ef46003ec00b 100644 (file)
@@ -294,7 +294,9 @@ class MainApp : public wxApp
 
         bool       m_FreeDV700txClip;
         bool       m_FreeDV700Combine;
-
+        int        m_FreeDV700Interleave;
+        bool       m_FreeDV700ManualUnSync;
+        
         // Noise simulation
 
         int        m_noise_snr;
index 69bdfc7b0aa740ff57d6942b010f95755278020a..06da0d2c1f3fdd38f33a0a04f95ac835f538fd55 100644 (file)
@@ -144,9 +144,17 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     wxStaticBoxSizer* sbSizer3_33;
     sbSizer3_33 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sync")), wxVERTICAL);
 
-    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
-    m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
-    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_CENTER|wxALL, 1);
+    m_rbSync = new wxRadioButton( this, wxID_ANY, wxT("Modem"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    //m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbSync, 0, wxALIGN_LEFT, 1);
+
+    m_rbInterleaverSync = new wxRadioButton( this, wxID_ANY, wxT("Interleaver"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
+    //m_rbInterleaverSync->SetForegroundColour( wxColour( 255, 0, 0 ) );
+    sbSizer3_33->Add(m_rbInterleaverSync, 0, wxALIGN_LEFT , 1);
+
+    m_BtnReSync = new wxButton(this, wxID_ANY, _("ReSync"), wxDefaultPosition, wxDefaultSize, 0);
+    sbSizer3_33->Add(m_BtnReSync, 0, wxALIGN_CENTRE , 1);
+
     leftSizer->Add(sbSizer3_33,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
 
     //------------------------------
index fe97b0cc4943b939a7548f9ef75fbe7b12a512d8..ee49040709e0a9ad6ed8355b5d136b2317e6330f 100644 (file)
@@ -105,6 +105,9 @@ class TopFrame : public wxFrame
         wxStaticText  *m_textResyncs;
 
         wxRadioButton *m_rbSync;
+        wxRadioButton *m_rbInterleaverSync;
+        wxButton      *m_BtnReSync;
+       
         wxRadioButton *m_rb1400old;
         wxRadioButton *m_rb1400;
         wxRadioButton *m_rb700;