disabled rarely used UDP/msg processing stuff, which cleaned up Options menu. Added...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 9 Jul 2017 00:55:25 +0000 (00:55 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 9 Jul 2017 00:55:25 +0000 (00:55 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3284 01035d8c-6547-0410-b346-abe4f91aad63

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

index b42464084526474d99428ea8e88ebb52124b3392..b015c7fb849c4235b12b00b4db4e048b153be3af 100644 (file)
@@ -35,6 +35,50 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     wxBoxSizer* bSizer30;
     bSizer30 = new wxBoxSizer(wxVERTICAL);
 
+    //------------------------------
+    // Txt Msg Text Box
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_callSign;
+    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"));
+    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
+
+    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+#ifdef __WXMSW__
+    //------------------------------
+    // debug console, for WIndows build make console pop up for debug messages
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_console;
+    wxStaticBox *sb_console = new wxStaticBox(this, wxID_ANY, _("Debug"));
+    sbSizer_console = new wxStaticBoxSizer(sb_console, wxHORIZONTAL);
+
+    m_ckboxDebugConsole = new wxCheckBox(this, wxID_ANY, _("Show Console"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_console->Add(m_ckboxDebugConsole, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_console,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+#endif
+
+    //------------------------------
+    // FreeDV 700 Options
+    //------------------------------
+
+    wxStaticBoxSizer* sbSizer_freedv700;
+    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Options"));
+    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
+
+    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, _("Diversity Combine for plots"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
+    sbSizer_freedv700->Add(m_ckboxFreeDV700Combine, 0, wxALIGN_LEFT, 0);
+
+    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+
     //------------------------------
     // Test Frames/Channel simulation check box
     //------------------------------
@@ -77,35 +121,7 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
 
     bSizer30->Add(sbSizer_tone,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
 
-    //------------------------------
-    // FreeDV 700 Options
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_freedv700;
-    wxStaticBox *sb_freedv700 = new wxStaticBox(this, wxID_ANY, _("FreeDV 700 Options"));
-    sbSizer_freedv700 = new wxStaticBoxSizer(sb_freedv700, wxHORIZONTAL);
-
-    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, _("Diversity Combine for plots"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
-    sbSizer_freedv700->Add(m_ckboxFreeDV700Combine, 0, wxALIGN_LEFT, 0);
-
-    bSizer30->Add(sbSizer_freedv700,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
-
-    //------------------------------
-    // Txt Msg Text Box
-    //------------------------------
-
-    wxStaticBoxSizer* sbSizer_callSign;
-    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"));
-    sbSizer_callSign->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3);
-
-    bSizer30->Add(sbSizer_callSign,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+#ifdef __EXPERIMENTAL_UDP__
     //------------------------------
     // Txt Encoding 
     //------------------------------
@@ -188,6 +204,7 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     sbSizer_udp->Add(m_txt_udp_port, 0, wxALIGN_CENTER_HORIZONTAL, 5);
 
     bSizer30->Add(sbSizer_udp,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
+#endif
 
     //------------------------------
     // OK - Cancel - Apply Buttons 
@@ -204,7 +221,7 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     m_sdbSizer5Apply = new wxButton(this, wxID_APPLY);
     bSizer31->Add(m_sdbSizer5Apply, 0, wxALL, 2);
 
-    bSizer30->Add(bSizer31, 0, wxALIGN_RIGHT|wxALL, 0);
+    bSizer30->Add(bSizer31, 0, wxALIGN_CENTER_HORIZONTAL, 0);
 
     this->SetSizer(bSizer30);
     this->Layout();
@@ -226,6 +243,10 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
     m_ckboxFreeDV700txClip->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
     m_ckboxFreeDV700Combine->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700Combine), NULL, this);
 
+#ifdef __WXMSW__
+    m_ckboxDebugConsole->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnDebugConsole), NULL, this);
+#endif
+
     event_in_serial = 0;
     event_out_serial = 0;
 }
@@ -250,6 +271,10 @@ OptionsDlg::~OptionsDlg()
 
     m_ckboxFreeDV700txClip->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700txClip), NULL, this);
     m_ckboxFreeDV700Combine->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnFreeDV700Combine), NULL, this);
+
+#ifdef __WXMSW__
+    m_ckboxDebugConsole->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxScrollEventHandler(OptionsDlg::OnDebugConsole), NULL, this);
+#endif
 }
 
 
@@ -275,6 +300,7 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
         m_ckboxAttnCarrierEn->SetValue(wxGetApp().m_attn_carrier_en);
         m_txtAttnCarrier->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_attn_carrier));
 
+#ifdef __EXPERIMENTAL_UDP__
         m_ckbox_events->SetValue(wxGetApp().m_events);
         m_txt_spam_timer->SetValue(wxString::Format(wxT("%i"),wxGetApp().m_events_spam_timer));
 
@@ -291,9 +317,14 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
             m_rb_textEncoding2->SetValue(true);
 #endif
         m_ckboxEnableChecksum->SetValue(wxGetApp().m_enable_checksum);
+#endif
 
         m_ckboxFreeDV700txClip->SetValue(wxGetApp().m_FreeDV700txClip);
         m_ckboxFreeDV700Combine->SetValue(wxGetApp().m_FreeDV700Combine);
+
+#ifdef __WXMSW__
+        m_ckboxDebugConsole->SetValue(wxGetApp().m_debug_console);
+#endif
     }
 
     if(inout == EXCHANGE_DATA_OUT)
@@ -320,6 +351,7 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
         m_txtAttnCarrier->GetValue().ToLong(&attn_carrier);
         wxGetApp().m_attn_carrier = (int)attn_carrier;
 
+#ifdef __EXPERIMENTAL_UDP__
         wxGetApp().m_events        = m_ckbox_events->GetValue();
         long spam_timer;
         m_txt_spam_timer->GetValue().ToLong(&spam_timer);
@@ -348,10 +380,15 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
             wxGetApp().m_textEncoding = 2;
 #endif
         wxGetApp().m_enable_checksum = m_ckboxEnableChecksum->GetValue();
+#endif
 
         wxGetApp().m_FreeDV700txClip = m_ckboxFreeDV700txClip->GetValue();
         wxGetApp().m_FreeDV700Combine = m_ckboxFreeDV700Combine->GetValue();
 
+#ifdef __WXMSW__
+        wxGetApp().m_debug_console = m_ckboxDebugConsole->GetValue();
+#endif
+
         if (storePersistent) {
             pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
 #ifdef SHORT_VARICODE
@@ -373,6 +410,10 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
 
             pConfig->Write(wxT("/Noise/noise_snr"),  wxGetApp().m_noise_snr);
 
+#ifdef __WXMSW__
+            pConfig->Write(wxT("/Debug/console"), wxGetApp().m_debug_console);
+#endif
+
             pConfig->Flush();
         }
     }
@@ -465,3 +506,16 @@ void OptionsDlg::updateEventLog(wxString event_in, wxString event_out) {
     m_txt_events_out->AppendText(event_out_with_serial+"\n");
 }
 
+
+void OptionsDlg::OnDebugConsole(wxScrollEvent& event) {
+    wxGetApp().m_debug_console = m_ckboxDebugConsole->GetValue();
+#ifdef __WXMSW__
+    // somewhere to send printfs while developing, causes conmsole to pop up on Windows
+    if (wxGetApp().m_debug_console) {
+        int ret = AllocConsole();
+        freopen("CONOUT$", "w", stdout); 
+        freopen("CONOUT$", "w", stderr); 
+        fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().m_debug_console);
+    } 
+#endif
+}
index 7bf5c85c5b5aedbd6f7331688db70d955d14e806..e378dab854895a7c0d41a18e0d8c1e5611ebea57 100644 (file)
@@ -33,7 +33,13 @@ class OptionsDlg : public wxDialog
     public:
     OptionsDlg( wxWindow* parent,
                wxWindowID id = wxID_ANY, const wxString& title = _("Options"), 
-                const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,660), 
+                const wxPoint& pos = wxDefaultPosition, 
+#ifdef __WXMSW__
+                /* we add debug console check box for windows */
+               const wxSize& size = wxSize(600,330), 
+#else
+               const wxSize& size = wxSize(600,300), 
+#endif
                long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
         ~OptionsDlg();
 
@@ -70,6 +76,7 @@ class OptionsDlg : public wxDialog
         void    OnAttnCarrierEn(wxScrollEvent& event);
         void    OnFreeDV700txClip(wxScrollEvent& event);
         void    OnFreeDV700Combine(wxScrollEvent& event);
+        void    OnDebugConsole(wxScrollEvent& event);
 
         wxTextCtrl   *m_txtCtrlCallSign; // TODO: this should be renamed to tx_txtmsg, and rename all related incl persis strge
         wxCheckBox   *m_ckboxTestFrame;
@@ -104,6 +111,8 @@ class OptionsDlg : public wxDialog
         wxButton*     m_sdbSizer5Cancel;
         wxButton*     m_sdbSizer5Apply;
 
+        wxCheckBox   *m_ckboxDebugConsole;
+
         unsigned int  event_in_serial, event_out_serial;
 
      private:
index 0bfe0dc204cd20bd00c562bf9113fbda23a2795f..7edc14530d0d9fd9bc559c11f857903c737fc974 100644 (file)
@@ -284,6 +284,15 @@ void ComPortsDlg::OnInitDialog(wxInitDialogEvent& event)
 //-------------------------------------------------------------------------
 void ComPortsDlg::populatePortList()
 {
+
+    /* populate Hamlib serial rate combo box */
+
+    wxString serialRates[] = {"auto", "300", "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"}; 
+    fprintf(stderr, "populating serial rates...\n");
+    for(int i=0; i<WXSIZEOF(serialRates); i++) {
+        m_cbSerialRate->Append(serialRates[i]);
+    }
+
 #ifdef __WXMSW__
     m_listCtrlPorts->Clear();
     m_cbSerialPort->Clear();
@@ -368,13 +377,6 @@ void ComPortsDlg::populatePortList()
     m_cbSerialPort->Append("/dev/ttyS0");
     m_cbSerialPort->Append("/dev/ttyS1");
 
-    /* populate Hamlib serial rate combo box */
-
-    wxString serialRates[] = {"auto", "300", "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"}; 
-    for(int i=0; i<WXSIZEOF(serialRates); i++) {
-        m_cbSerialRate->Append(serialRates[i]);
-    }
-
     m_cbCtlDevicePath->Clear();
     m_cbCtlDevicePath->Append("/dev/ttyUSB0");
     m_cbCtlDevicePath->Append("/dev/ttyUSB1");
@@ -382,6 +384,8 @@ void ComPortsDlg::populatePortList()
     m_cbCtlDevicePath->Append("/dev/ttyS1");
 #endif
 #endif
+
+
 }
 
 //-------------------------------------------------------------------------
index d15a7a25850c5954efea6e59e270a1dc99d4c249..e4f6f3ebc6a2657d5e630d4525945b721f0544cb 100644 (file)
@@ -145,9 +145,7 @@ bool MainApp::OnInit()
     SetVendorName(wxT("CODEC2-Project"));
     SetAppName(wxT("FreeDV"));      // not needed, it's the default value
 
-    // DR - this is wrong define so won't be used on windows build, should be __WXMSW__
-    // So registry will be used for Win32
-#ifdef _WXMSW_
+#ifdef FILE_RATHER_THAN_REGISTRY
     // Force use of file-based configuration persistance on Windows platforma
     wxConfig *pConfig = new wxConfig();
     wxFileConfig *pFConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), wxT("FreeDV.conf"), wxT("FreeDV.conf"),  wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
@@ -502,6 +500,8 @@ MainFrame::MainFrame(wxString plugInName, wxWindow *parent) : TopFrame(plugInNam
     wxGetApp().m_FreeDV700txClip = (float)pConfig->Read(wxT("/FreeDV700/txClip"), t);
     wxGetApp().m_FreeDV700Combine = 1;
     wxGetApp().m_noise_snr = (float)pConfig->Read(wxT("/Noise/noise_snr"), 2);
+    wxGetApp().m_debug_console = (float)pConfig->Read(wxT("/Debug/console"), f);
 
     wxGetApp().m_attn_carrier_en = 0;
     wxGetApp().m_attn_carrier    = 0;
@@ -604,16 +604,30 @@ MainFrame::MainFrame(wxString plugInName, wxWindow *parent) : TopFrame(plugInNam
 
     g_modal = false;
 
+#ifdef __EXPERIMENTAL_UDP__
     // Start UDP listener thread
 
     m_UDPThread = NULL;
     startUDPThread();
+#endif
 
     optionsDlg = new OptionsDlg(NULL);
     m_schedule_restore = false;
 
     vk_state = VK_IDLE;
 
+    // Init optional Windows debug console so we can see all those printfs
+
+#ifdef __WXMSW__
+    if (wxGetApp().m_debug_console) {
+        // somewhere to send printfs while developing
+        int ret = AllocConsole();
+        freopen("CONOUT$", "w", stdout); 
+        freopen("CONOUT$", "w", stderr); 
+        fprintf(stderr, "AllocConsole: %d m_debug_console: %d\n", ret, wxGetApp().m_debug_console);
+    }
+#endif
+
     //ftest = fopen("ftest.raw", "wb");
     //assert(ftest != NULL);
 }
@@ -638,7 +652,9 @@ MainFrame::~MainFrame()
         optionsDlg = NULL;
     }
 
+#ifdef __EXPERIMENTAL_UDP__
     stopUDPThread();
+#endif
 
     /* TOOD(Joel): the ownership of m_hamlib is probably wrong. */
     if (wxGetApp().m_hamlib) delete wxGetApp().m_hamlib;
@@ -725,6 +741,8 @@ MainFrame::~MainFrame()
         pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
         pConfig->Write(wxT("/Noise/noise_snr"), wxGetApp().m_noise_snr);
 
+        pConfig->Write(wxT("/Debug/console"), wxGetApp().m_debug_console);
+
         int mode;
         if (m_rb1600->GetValue())
             mode = 0;
@@ -1225,6 +1243,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
                     s.Printf("%s", m_callsign);
                     m_txtCtrlCallSign->SetValue(s);
 
+#ifdef __UDP_EXPERIMENTAL__
                     char s1[MAX_CALLSIGN];
                     sprintf(s1,"rx_txtmsg %s", m_callsign);
                     processTxtEvent(s1);
@@ -1232,11 +1251,14 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
                     m_checksumGood++;
                     s.Printf("%d", m_checksumGood);
                     m_txtChecksumGood->SetLabel(s);              
+#endif
                 }
                 else {
+#ifdef __UDP_EXPERIMENTAL__
                     m_checksumBad++;
                     s.Printf("%d", m_checksumBad);
                     m_txtChecksumBad->SetLabel(s);        
+#endif
                 }
             }
 
@@ -1401,6 +1423,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
         m_schedule_restore = false;
     }
 
+#ifdef __UDP_EXPERIMENTAL__
     // Light Spam Timer LED if at least one timer is running
 
     int i;
@@ -1408,6 +1431,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
     for(i=0; i<MAX_EVENT_RULES; i++)
         if (spamTimer[i].IsRunning())
             optionsDlg->SetSpamTimerLight(true);        
+#endif
 
     // Blink file playback status line
 
@@ -1595,7 +1619,9 @@ void MainFrame::togglePTT(void) {
         // rx-> tx transition, swap to Mic In page to monitor speech
         wxGetApp().m_rxNbookCtrl = m_auiNbookCtrl->GetSelection();
         m_auiNbookCtrl->ChangeSelection(m_auiNbookCtrl->GetPageIndex((wxWindow *)m_panelSpeechIn));
+#ifdef __UDP_EXPERIMENTAL__
         char e[80]; sprintf(e,"ptt"); processTxtEvent(e);
+#endif
     }
 
     g_tx = m_btnTogPTT->GetValue();
@@ -1873,9 +1899,11 @@ void MainFrame::OnCallSignReset(wxCommandEvent& event)
     wxString s;
     s.Printf("%s", m_callsign);
     m_txtCtrlCallSign->SetValue(s);
+#ifdef __UDP__EXPERIMENTAL__
     m_checksumGood = m_checksumBad = 0;
     m_txtChecksumGood->SetLabel(_("0"));
     m_txtChecksumBad->SetLabel(_("0"));
+#endif
 }
 
 void MainFrame::OnBerReset(wxCommandEvent& event)
@@ -2543,12 +2571,14 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
 
         m_pcallsign = m_callsign;
         memset(m_callsign, 0, sizeof(m_callsign));
+#ifdef __UDP_EXPERIMENTAL__
         m_checksumGood = m_checksumBad = 0;
         wxString s;
         s.Printf("%d", m_checksumGood);
         m_txtChecksumGood->SetLabel(s);              
         s.Printf("%d", m_checksumBad);
         m_txtChecksumBad->SetLabel(s);        
+#endif
 
         m_maxLevel = 0;
         m_textLevel->SetLabel(wxT(""));
@@ -2575,7 +2605,9 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
             m_plotTimer.Start(_REFRESH_TIMER_PERIOD, wxTIMER_CONTINUOUS);
 #endif // _USE_TIMER
         }
+#ifdef __UDP_EXPERIMENTAL__
         char e[80]; sprintf(e,"start"); processTxtEvent(e);
+#endif
     }
 
     // Stop was pressed or start up failed
@@ -2586,7 +2618,9 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
         // Stop Running -------------------------------------------------
         //
 
+#ifdef __UDP_EXPERIMENTAL__
         optionsDlg->SetSpamTimerLight(false);
+#endif
 
 #ifdef _USE_TIMER
         m_plotTimer.Stop();
@@ -2649,7 +2683,9 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event)
         m_rb1400->Enable();
         m_rb2000->Enable();
 #endif
+#ifdef __UDP_EXPERIMENTAL__
         char e[80]; sprintf(e,"stop"); processTxtEvent(e);
+#endif
     }
 }
 
@@ -4113,7 +4149,7 @@ int MainFrame::PollUDP(void)
 }
 
 void MainFrame::startUDPThread(void) {
-    printf("starting UDP thread!\n");
+    fprintf(stderr, "starting UDP thread!\n");
     m_UDPThread = new UDPThread;
     m_UDPThread->mf = this;
     if (m_UDPThread->Create() != wxTHREAD_NO_ERROR ) {
index 585fc0c7ee9a3257fa784c2fc174f9f49f7ccdf1..4e11676add9b8b44c4ab098ea707568ca1011544 100644 (file)
@@ -316,7 +316,9 @@ class MainApp : public wxApp
         int        m_tone_freq_hz;
         int        m_tone_amplitude;
 
+        // Windows debug console
 
+        bool       m_debug_console;
     protected:
 };
 
index 6dbf8d0a7aaa4d343061bec69f306e2daff6cb1e..17c9176aec12e619492d14614ade619e6ddf3c0d 100644 (file)
@@ -43,7 +43,7 @@ Hamlib::Hamlib() : m_rig(NULL) {
     /* Reset debug output. */
     rig_set_debug(RIG_DEBUG_VERBOSE);
 
-       m_rig = NULL;
+    m_rig = NULL;
 }
 
 Hamlib::~Hamlib() {
@@ -124,18 +124,22 @@ bool Hamlib::connect(unsigned int rig_index, const char *serial_port, const int
 }
 
 bool Hamlib::ptt(bool press) {
-       if(!m_rig)
-               return false;
+    fprintf(stderr,"Hamlib::ptt: %d\n", press);
+
+    if(!m_rig)
+        return false;
     /* TODO(Joel): make ON_DATA and ON configurable. */
     ptt_t on = press ? RIG_PTT_ON : RIG_PTT_OFF;
     /* TODO(Joel): what should the VFO option be? */
-    return rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+    int status = rig_set_ptt(m_rig, RIG_VFO_CURR, on) == RIG_OK;
+    fprintf(stderr,"Hamlib::ptt: rig_set_ptt returned: %d\n", status);
+    return status;
 }
 
 void Hamlib::close(void) {
-       if(m_rig) {
-               rig_close(m_rig);
-               rig_cleanup(m_rig);
-               m_rig = NULL;
-       }
+    if(m_rig) {
+        rig_close(m_rig);
+        rig_cleanup(m_rig);
+        m_rig = NULL;
+    }
 }
index 4bc5cc6ca685d9d8eb3d604a3ade6b7dd9223b88..ee10bba5f92533dc296f5428353bc89d021b3dca 100644 (file)
@@ -225,6 +225,7 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     bSizer15->Add(m_txtCtrlCallSign, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5);
     lowerSizer->Add(bSizer15, 1, wxEXPAND, 5);
 
+#ifdef __EXPERIMENTAL_UDP__
     wxStaticBoxSizer* sbSizer_Checksum = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Checksums")), wxHORIZONTAL);
 
     wxStaticText *goodLabel = new wxStaticText(this, wxID_ANY, wxT("Good: "), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
@@ -238,6 +239,7 @@ TopFrame::TopFrame(wxString plugInName, wxWindow* parent, wxWindowID id, const w
     sbSizer_Checksum->Add(m_txtChecksumBad, 0, 0, 1);
 
     lowerSizer->Add(sbSizer_Checksum, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 1);
+#endif
 
     //=====================================================
     // These are the buttons that autosend the userid (?)