added option to disable checksum checking on txt msg rx, compiles OK but haven't...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 10 Jul 2014 23:04:47 +0000 (23:04 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 10 Jul 2014 23:04:47 +0000 (23:04 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1753 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/src/dlg_options.cpp
fdmdv2-dev/src/dlg_options.h
fdmdv2-dev/src/fdmdv2_main.cpp
fdmdv2-dev/src/fdmdv2_main.h

index a2a52a78564d8a5557e026f575a7dd463ddf9636..35e5f23a4c961d556e7e979caf29c5d174abd33b 100644 (file)
@@ -38,14 +38,14 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
 
     wxStaticBoxSizer* sbSizer_testFrames;
     wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
-    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxVERTICAL);
+    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxHORIZONTAL);
 
     m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_testFrames->SetToolTip(_("Send frames of known bits instead of compressed voice"));
+    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
     sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
 
     m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sb_testFrames->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
+    m_ckboxChannelNoise->SetToolTip(_("Add simulated AWGN channel noise to received signal"));
     sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0);
 
     bSizer30->Add(sbSizer_testFrames,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
@@ -55,7 +55,8 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     //------------------------------
 
     wxStaticBoxSizer* sbSizer_callSign;
-    sbSizer_callSign = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Txt Msg")), wxVERTICAL);
+    wxStaticBox *sb_textMsg = new wxStaticBox(this, wxID_ANY, _("Txt Msg"));
+    sbSizer_callSign = new wxStaticBoxSizer(sb_textMsg, wxVERTICAL);
 
     m_txtCtrlCallSign = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
     m_txtCtrlCallSign->SetToolTip(_("Txt Msg you can send along with Voice"));
@@ -75,6 +76,9 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     m_rb_textEncoding2 = new wxRadioButton( this, wxID_ANY, wxT("Short Varicode"), wxDefaultPosition, wxDefaultSize, 0);
     sbSizer_encoding->Add(m_rb_textEncoding2, 0, wxALIGN_LEFT|wxALL, 1);
 
+    m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
+
     bSizer30->Add(sbSizer_encoding,0, wxALL|wxEXPAND, 3);
  
     //------------------------------
@@ -216,6 +220,7 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
             m_rb_textEncoding1->SetValue(true);
         if (wxGetApp().m_textEncoding == 2)
             m_rb_textEncoding2->SetValue(true);
+        m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
     }
 
     if(inout == EXCHANGE_DATA_OUT)
@@ -249,10 +254,12 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
             wxGetApp().m_textEncoding = 1;
         if (m_rb_textEncoding2->GetValue())
             wxGetApp().m_textEncoding = 2;
+        wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
 
         if (storePersistent) {
             pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
             pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+            pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
 
             pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
             pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
index 731532c4db9eadd755b337f2abead15459ce4498..2191de1a5bca8a5e420062f0415f7bc1474a2e17 100644 (file)
@@ -71,6 +71,7 @@ class OptionsDlg : public wxDialog
 
         wxRadioButton *m_rb_textEncoding1;
         wxRadioButton *m_rb_textEncoding2;
+        wxCheckBox    *m_ckboxEnableChecksum;
 
         wxCheckBox   *m_ckbox_events;
         wxTextCtrl   *m_txt_events_regexp_match;
index 72b880f0af2bd1052bfebe72769391eee8d6dfaa..013fded863465b4b7aef96f796a0ef350ac6a0e2 100644 (file)
@@ -378,6 +378,7 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
 
     wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
     wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 2);
+    wxGetApp().m_enable_checksum = pConfig->Read("/Data/EnableChecksumOnMsgRx", t);
 
     wxGetApp().m_events = pConfig->Read("/Events/enable", f);
     wxGetApp().m_events_spam_timer = (int)pConfig->Read(wxT("/Events/spam_timer"), 10);
@@ -575,6 +576,7 @@ MainFrame::~MainFrame()
 
         pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
         pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+        pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
         pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
         pConfig->Write(wxT("/Events/spam_timer"), wxGetApp().m_events_spam_timer);
         pConfig->Write(wxT("/Events/regexp_match"), wxGetApp().m_events_regexp_match);
@@ -1006,7 +1008,15 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
             else {
                 m_checksumBad++;
                 s.Printf("%d", m_checksumBad);
-                m_txtChecksumBad->SetLabel(s);              
+                m_txtChecksumBad->SetLabel(s);        
+
+                // checksums can be disabled, e.g. for compatability
+                // with older vesions.  In that case we print msg but
+                // don't do any event processing
+
+                if (!wxGetApp().m_enable_checksum) {
+                    m_txtCtrlCallSign->SetValue(m_callsign);
+                }
             }
 
             // reset ptr to start of string
index 49d4c90cbf9b5b91d9d69a4383cbc2e67326056a..782ec6e9e447b0b7c4f6dcc2757c1086668f375a 100644 (file)
@@ -179,6 +179,7 @@ class MainApp : public wxApp
         bool                m_events;
         int                 m_events_spam_timer;
         unsigned int        m_textEncoding;
+        bool                m_enable_checksum;
         wxString            m_events_regexp_match;
         wxString            m_events_regexp_replace;