From: drowe67 Date: Thu, 10 Jul 2014 23:04:47 +0000 (+0000) Subject: added option to disable checksum checking on txt msg rx, compiles OK but haven't... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=820b33c81f531fd4c531aabbc28ee8dd22b24d02;p=freetel-svn-tracking.git added option to disable checksum checking on txt msg rx, compiles OK but haven't tested with an older version git-svn-id: https://svn.code.sf.net/p/freetel/code@1753 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2-dev/src/dlg_options.cpp b/fdmdv2-dev/src/dlg_options.cpp index a2a52a78..35e5f23a 100644 --- a/fdmdv2-dev/src/dlg_options.cpp +++ b/fdmdv2-dev/src/dlg_options.cpp @@ -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); diff --git a/fdmdv2-dev/src/dlg_options.h b/fdmdv2-dev/src/dlg_options.h index 731532c4..2191de1a 100644 --- a/fdmdv2-dev/src/dlg_options.h +++ b/fdmdv2-dev/src/dlg_options.h @@ -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; diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp index 72b880f0..013fded8 100644 --- a/fdmdv2-dev/src/fdmdv2_main.cpp +++ b/fdmdv2-dev/src/fdmdv2_main.cpp @@ -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 diff --git a/fdmdv2-dev/src/fdmdv2_main.h b/fdmdv2-dev/src/fdmdv2_main.h index 49d4c90c..782ec6e9 100644 --- a/fdmdv2-dev/src/fdmdv2_main.h +++ b/fdmdv2-dev/src/fdmdv2_main.h @@ -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;