disabled short varicode, callsign info only updates on gd checksum in checksum mode
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 30 Jun 2015 01:34:36 +0000 (01:34 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 30 Jun 2015 01:34:36 +0000 (01:34 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2228 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/README.txt
fdmdv2-dev/src/dlg_options.cpp
fdmdv2-dev/src/fdmdv2_main.cpp

index 542ab478ba5d455103362a0f93742ac0987798aa..dcf2f57187eabefe899e408bed4799dc628b37aa 100644 (file)
@@ -163,11 +163,10 @@ TODO
 
     [X] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
         Stop/Start toggle and then starts working.
-    [X] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
+    [ ] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
     [X] space bar keys PTT when entering text info box
-    [ ] checksum based txt reception can't be verified
-        + too many bit errors
-        + add FEC?  Would this need frame sync?
+    [ ] checksum based txt reception
+        + only print if valid
     [ ] short varicode doesn't work
         + cld be broken in freedv_api
 
index 2ddfe5e229a4a4144176d42a069dbd2c521966a6..9189febaad45c40f78e0772f16cd52b7c75b1981 100644 (file)
@@ -85,11 +85,13 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
 
     wxStaticBoxSizer* sbSizer_encoding = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Text Encoding")), wxHORIZONTAL);
 
+#ifdef SHORT_VARICODE
     m_rb_textEncoding1 = new wxRadioButton( this, wxID_ANY, wxT("Long varicode"), wxDefaultPosition, wxDefaultSize, 0);
     m_rb_textEncoding1->SetValue(true);
     sbSizer_encoding->Add(m_rb_textEncoding1, 0, wxALIGN_LEFT|wxALL, 1);
     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);
+#endif
 
     m_ckboxEnableChecksum = new wxCheckBox(this, wxID_ANY, _("Use Checksum on Rx"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
     sbSizer_encoding->Add(m_ckboxEnableChecksum, 0, wxALIGN_LEFT, 0);
@@ -235,10 +237,12 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
         m_ckbox_udp_enable->SetValue(wxGetApp().m_udp_enable);
         m_txt_udp_port->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_udp_port));
 
+#ifdef SHORT_VARICODE
         if (wxGetApp().m_textEncoding == 1)
             m_rb_textEncoding1->SetValue(true);
         if (wxGetApp().m_textEncoding == 2)
             m_rb_textEncoding2->SetValue(true);
+#endif
         m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
 
         m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
@@ -271,17 +275,21 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
         m_txt_udp_port->GetValue().ToLong(&port);
         wxGetApp().m_udp_port       = (int)port;
 
+#ifdef SHORT_VARICODE
         if (m_rb_textEncoding1->GetValue())
             wxGetApp().m_textEncoding = 1;
         if (m_rb_textEncoding2->GetValue())
             wxGetApp().m_textEncoding = 2;
+#endif
         wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
 
         wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
 
         if (storePersistent) {
             pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
+#ifdef SHORT_VARICODE
             pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
+#endif
             pConfig->Write(wxT("/Data/EnableChecksumOnMsgRx"), wxGetApp().m_enable_checksum);
 
             pConfig->Write(wxT("/Events/enable"), wxGetApp().m_events);
index 10c9346bafee8504aedaa37d88533557b82245ad..fd66a30bd283f38e9a6759c5d7cc1f0f836a9135 100644 (file)
@@ -970,7 +970,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
     if ((unsigned)fifo_used(g_txDataInFifo) < strlen(callsign)) {
         unsigned int  i;
 
-        //printf("callsign: %s\n", callsign);
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
 
         /* optionally append checksum */
 
@@ -991,6 +991,8 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
             callsign[strlen(callsign)+1] = 0;
         }
 
+        //fprintf(g_logfile, "tx callsign: %s.\n", callsign);
+
         // write chars to tx data fifo
 
         for(i=0; i<strlen(callsign); i++) {
@@ -1003,18 +1005,17 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
 
     short ashort;
     while (fifo_read(g_rxDataOutFifo, &ashort, 1) == 0) {
+
         if ((ashort == 13) || ((m_pcallsign - m_callsign) > MAX_CALLSIGN-1)) {
             // CR completes line
             *m_pcallsign = 0;
+            
+            /* 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 checksums enabled, only print
+               out when checksum is good. */
 
-            // 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);
-            }
-            else {
+            if (wxGetApp().m_enable_checksum) {
                 // lets see if checksum is OK
             
                 unsigned char checksum_rx = 0;
@@ -1024,7 +1025,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
                 }
                 unsigned int checksum_tx;
                 int ret = sscanf(&m_callsign[strlen(m_callsign)-2], "%2x", &checksum_tx);
-                //printf("m_callsign: %s checksums: %2x %2x\n", m_callsign, checksum_tx, checksum_rx);
+                //fprintf(g_logfile, "rx callsign: %s.\n  checksum tx: %02x checksum rx: %02x\n", m_callsign, checksum_tx, checksum_rx);
 
                 wxString s;
                 if (ret && (checksum_tx == checksum_rx)) {
@@ -1047,14 +1048,18 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
                 }
             }
 
-            //fprintf(stderr,"resetting callsign %s %d\n", m_callsign, m_pcallsign-m_callsign);
+            //fprintf(g_logfile,"resetting callsign %s %ld\n", m_callsign, m_pcallsign-m_callsign);
             // reset ptr to start of string
             m_pcallsign = m_callsign;
         }
-        else
-        {
-            //printf("new char %d %c\n", ashort, (char)ashort);
+        else {
+            //fprintf(g_logfile, "new char %d %c\n", ashort, (char)ashort);
             *m_pcallsign++ = (char)ashort;
+        }
+
+        /* If checksums disabled, display txt chars as they arrive */
+
+        if (!wxGetApp().m_enable_checksum) {
             m_txtCtrlCallSign->SetValue(m_callsign);
         }
     }