Add ability to hide self from FreeDV Reporter list. (#1260)

* Add ability to hide self from FreeDV Reporter list.

* Disable FreeDV Reporter control if reporting itself is disabled.

* Use Turn Off/Turn On for button labels.

* Add PR #1260 to changelog.

* FreeDV Reporter->FDV Reporting.

* Preserve FDV Reporter toggle option across restarts.
ms-linux-audio-dropouts
Mooneer Salem 2026-03-28 13:50:05 -07:00 committed by GitHub
parent 8f5090ab09
commit e4484b819e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 79 additions and 3 deletions

View File

@ -899,6 +899,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
* Optimize "From XXX" plot performance. (PR #1238, #1239)
* Logging: Send WSJT-X 'Decode' message to indicate RX'd SNR. (PR #1248)
* Remove Python from RADE implementation to improve performance. (PR #1251)
* Add ability to hide self from FreeDV Reporter list. (PR #1260)
* Add Tune button to allow tuning antennas/rigs. (PR #1259, #1265)
* Add SNR plot to main window. (PR #1250, #1261)
* Bring back RX frequency indicator for RADE. (PR #1265)

View File

@ -41,6 +41,7 @@ ReportingConfiguration::ReportingConfiguration()
, pskReporterEnabled("/Reporting/PSKReporter/Enable", true)
, freedvReporterEnabled("/Reporting/FreeDV/Enable", true)
, freedvReporterForcedOff("/Reporting/FreeDV/ForcedOff", false)
, freedvReporterHostname("/Reporting/FreeDV/Hostname", wxT(FREEDV_REPORTER_DEFAULT_HOSTNAME))
, freedvReporterBandFilter("/Reporting/FreeDV/CurrentBandFilter", 0)
, useMetricDistances("/Reporting/FreeDV/UseMetricDistances", true)
@ -181,6 +182,7 @@ void ReportingConfiguration::load(wxConfigBase* config)
load_(config, pskReporterEnabled);
load_(config, freedvReporterEnabled);
load_(config, freedvReporterForcedOff);
load_(config, freedvReporterHostname);
load_(config, freedvReporterBandFilter);
load_(config, useMetricDistances);
@ -236,6 +238,7 @@ void ReportingConfiguration::save(wxConfigBase* config)
save_(config, pskReporterEnabled);
save_(config, freedvReporterEnabled);
save_(config, freedvReporterForcedOff);
save_(config, freedvReporterHostname);
save_(config, freedvReporterBandFilter);
save_(config, useMetricDistances);

View File

@ -47,6 +47,7 @@ public:
ConfigurationDataElement<bool> pskReporterEnabled;
ConfigurationDataElement<bool> freedvReporterEnabled;
ConfigurationDataElement<bool> freedvReporterForcedOff;
ConfigurationDataElement<wxString> freedvReporterHostname;
ConfigurationDataElement<int> freedvReporterBandFilter;
ConfigurationDataElement<bool> useMetricDistances;

View File

@ -939,6 +939,21 @@ setDefaultMode:
m_cboLastReportedCallsigns->Hide();
m_txtCtrlCallSign->Show();
}
// Enable/disable FreeDV Reporter quick options
m_reporterHidden->Enable(
wxGetApp().appConfiguration.reportingConfiguration.reportingEnabled &&
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterEnabled);
m_reporterHidden->SetValue(
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterForcedOff);
if (wxGetApp().appConfiguration.reportingConfiguration.freedvReporterForcedOff)
{
m_reporterHidden->SetLabel(_("Turn On"));
}
else
{
m_reporterHidden->SetLabel(_("Turn Off"));
}
// Ensure that sound card count is correct. Otherwise the Audio Options won't show
// the correct devices prior to start.
@ -2463,7 +2478,11 @@ void MainFrame::performFreeDVOn_()
if (wxGetApp().appConfiguration.reportingConfiguration.freedvReporterEnabled)
{
wxGetApp().m_reporters.push_back(wxGetApp().m_sharedReporterObject);
wxGetApp().m_sharedReporterObject->showOurselves();
if (!m_reporterHidden->GetValue())
{
wxGetApp().m_sharedReporterObject->showOurselves();
}
}
// Enable FreeDV Reporter timer (every 5 minutes).

View File

@ -449,7 +449,8 @@ class MainFrame : public TopFrame
void OnOpenCallsignList( wxCommandEvent& event ) override;
void OnCloseCallsignList( wxCommandEvent& event ) override;
virtual void OnTogBtnTune(wxCommandEvent& event) override;
void OnToggleReporterVisibility (wxCommandEvent& event) override;
void OnTogBtnTune(wxCommandEvent& event) override;
private:
const wxString SNR_FORMAT_STR;

View File

@ -215,6 +215,11 @@ void MainFrame::OnToolsOptions(wxCommandEvent& event)
wxUnusedVar(event);
if (optionsDlg->ShowModal() == wxOK)
{
// Enable/disable FreeDV Reporter quick options
m_reporterHidden->Enable(
wxGetApp().appConfiguration.reportingConfiguration.reportingEnabled &&
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterEnabled);
// Update reporting list.
updateReportingFreqList_();
@ -1689,3 +1694,29 @@ void MainFrame::OnResetMicSpkrLevel(wxMouseEvent&)
wxString fmtString = wxString::Format(MIC_SPKR_LEVEL_FORMAT_STR, wxNumberFormatter::ToString((double)sliderLevel, 1), DECIBEL_STR);
m_txtMicSpkrLevelNum->SetLabel(fmtString);
}
void MainFrame::OnToggleReporterVisibility (wxCommandEvent&)
{
if (m_RxRunning && wxGetApp().appConfiguration.reportingConfiguration.freedvReporterEnabled)
{
if (m_reporterHidden->GetValue())
{
wxGetApp().m_sharedReporterObject->hideFromView();
}
else
{
wxGetApp().m_sharedReporterObject->showOurselves();
}
}
if (m_reporterHidden->GetValue())
{
m_reporterHidden->SetLabel("Turn On");
}
else
{
m_reporterHidden->SetLabel("Turn Off");
}
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterForcedOff = m_reporterHidden->GetValue();
}

View File

@ -526,7 +526,7 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const
sbSizerAudioRecordPlay->Add(m_audioRecord, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5);
leftSizer->Add(sbSizerAudioRecordPlay, 0, wxALL|wxEXPAND, 2);
//------------------------------
// QSO logging
//------------------------------
@ -539,6 +539,18 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const
sbSizerLogging->Add(m_logQSO, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5);
leftSizer->Add(sbSizerLogging, 0, wxALL|wxEXPAND, 2);
//------------------------------
// FreeDV Reporter quick options
//------------------------------
wxStaticBox* reporterBox = new wxStaticBox(m_panel, wxID_ANY, _("FDV Reporting"), wxDefaultPosition, wxSize(100,-1));
wxStaticBoxSizer* sbSizerReporterBox = new wxStaticBoxSizer(reporterBox, wxVERTICAL);
m_reporterHidden = new wxToggleButton(reporterBox, wxID_ANY, _("Turn Off"), wxDefaultPosition, wxDefaultSize, 0);
m_reporterHidden->SetToolTip(_("Removes self from other FreeDV Reporter users when enabled."));
sbSizerReporterBox->Add(m_reporterHidden, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5);
leftSizer->Add(sbSizerReporterBox, 0, wxALL|wxEXPAND, 2);
//------------------------------
// BER Frames box
@ -936,6 +948,8 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const
m_auiNbookCtrl->Connect(wxEVT_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebookEventHandler(TopFrame::OnNotebookPageChanging), NULL, this);
m_reporterHidden->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnToggleReporterVisibility), NULL, this);
m_btnTogTune->Connect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTune), NULL, this);
}
@ -1033,6 +1047,8 @@ TopFrame::~TopFrame()
m_cboLastReportedCallsigns->Disconnect(wxEVT_COMBOBOX_DROPDOWN, wxCommandEventHandler(TopFrame::OnOpenCallsignList), NULL, this);
m_cboLastReportedCallsigns->Disconnect(wxEVT_COMBOBOX_CLOSEUP, wxCommandEventHandler(TopFrame::OnCloseCallsignList), NULL, this);
m_reporterHidden->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnToggleReporterVisibility), NULL, this);
m_btnTogTune->Disconnect(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnTogBtnTune), NULL, this);
}

View File

@ -145,6 +145,8 @@ class TopFrame : public wxFrame
wxStaticBoxSizer* sbSizer_mode;
wxMenuItem* m_menuItemPlayFileFromRadio;
wxToggleButton *m_reporterHidden;
// Virtual event handlers, override them in your derived class
virtual void OnActivateWindow(wxActivateEvent& event) { event.Skip(); }
@ -228,6 +230,8 @@ class TopFrame : public wxFrame
virtual void OnOpenCallsignList( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCloseCallsignList( wxCommandEvent& event ) { event.Skip(); }
virtual void OnToggleReporterVisibility (wxCommandEvent& event) { event.Skip(); }
virtual void OnTogBtnTune(wxCommandEvent& event) { event.Skip(); }