Skip to content

Commit 6d2f30b

Browse files
authored
Merge pull request #620 from drowe67/ms-reporter-msg
Add logic to report status message to FreeDV Reporter.
2 parents 0a3ad5f + c7c97ca commit 6d2f30b

9 files changed

+566
-113
lines changed

USER_MANUAL.md

+1
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
925925
* Add option to add a delay after starting TX and before ending TX. (PR #618)
926926
* Allow serial PTT to be enabled along with OmniRig. (PR #619)
927927
* Add 800XA to multi-RX list. (PR #617)
928+
* Add logic to report status message to FreeDV Reporter. (PR #620)
928929
* Allow display and entry of frequencies in KHz. (PR #621)
929930

930931
## V1.9.5 November 2023

src/config/ReportingConfiguration.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ ReportingConfiguration::ReportingConfiguration()
4747
, freedvReporterForceReceiveOnly("/Reporting/FreeDV/ForceReceiveOnly", false)
4848
, freedvReporterBandFilterTracksFreqBand("/Reporting/FreeDV/BandFilterTracking/TracksFreqBand", true)
4949
, freedvReporterBandFilterTracksExactFreq("/Reporting/FreeDV/BandFilterTracking/TracksExactFreq", false)
50-
50+
, freedvReporterStatusText("/Reporting/FreeDV/StatusText", _(""))
51+
, freedvReporterRecentStatusTexts("/Reporting/FreeDV/RecentStatusTexts", {})
5152
, useUTCForReporting("/CallsignList/UseUTCTime", false)
5253

5354
, reportingFrequencyList("/Reporting/FrequencyList", {
@@ -74,6 +75,8 @@ ReportingConfiguration::ReportingConfiguration()
7475
, freedvReporterTxRowForegroundColor("/Reporting/FreeDV/TxRowForegroundColor", "#000000")
7576
, freedvReporterRxRowBackgroundColor("/Reporting/FreeDV/RxRowBackgroundColor", "#379baf")
7677
, freedvReporterRxRowForegroundColor("/Reporting/FreeDV/RxRowForegroundColor", "#000000")
78+
, freedvReporterMsgRowBackgroundColor("/Reporting/FreeDV/MsgRowBackgroundColor", "#E58BE5")
79+
, freedvReporterMsgRowForegroundColor("/Reporting/FreeDV/MsgRowForegroundColor", "#000000")
7780

7881
, reportingFrequencyAsKhz("/Reporting/FrequencyAsKHz", false)
7982
{
@@ -172,7 +175,9 @@ void ReportingConfiguration::load(wxConfigBase* config)
172175
load_(config, freedvReporterForceReceiveOnly);
173176
load_(config, freedvReporterBandFilterTracksFreqBand);
174177
load_(config, freedvReporterBandFilterTracksExactFreq);
175-
178+
load_(config, freedvReporterStatusText);
179+
load_(config, freedvReporterRecentStatusTexts);
180+
176181
load_(config, useUTCForReporting);
177182

178183
// Note: this needs to be loaded before the frequency list so that
@@ -187,7 +192,9 @@ void ReportingConfiguration::load(wxConfigBase* config)
187192
load_(config, freedvReporterTxRowForegroundColor);
188193
load_(config, freedvReporterRxRowBackgroundColor);
189194
load_(config, freedvReporterRxRowForegroundColor);
190-
195+
load_(config, freedvReporterMsgRowBackgroundColor);
196+
load_(config, freedvReporterMsgRowForegroundColor);
197+
191198
// Special load handling for reporting below.
192199
wxString freqStr = config->Read(reportingFrequency.getElementName(), oldFreqStr);
193200
reportingFrequency.setWithoutProcessing(atoll(freqStr.ToUTF8()));
@@ -211,6 +218,8 @@ void ReportingConfiguration::save(wxConfigBase* config)
211218
save_(config, freedvReporterForceReceiveOnly);
212219
save_(config, freedvReporterBandFilterTracksFreqBand);
213220
save_(config, freedvReporterBandFilterTracksExactFreq);
221+
save_(config, freedvReporterStatusText);
222+
save_(config, freedvReporterRecentStatusTexts);
214223

215224
save_(config, useUTCForReporting);
216225

@@ -223,6 +232,8 @@ void ReportingConfiguration::save(wxConfigBase* config)
223232
save_(config, freedvReporterTxRowForegroundColor);
224233
save_(config, freedvReporterRxRowBackgroundColor);
225234
save_(config, freedvReporterRxRowForegroundColor);
235+
save_(config, freedvReporterMsgRowBackgroundColor);
236+
save_(config, freedvReporterMsgRowForegroundColor);
226237

227238
// Special save handling for reporting below.
228239
wxString tempFreqStr = wxString::Format(wxT("%" PRIu64), reportingFrequency.getWithoutProcessing());

src/config/ReportingConfiguration.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class ReportingConfiguration : public WxWidgetsConfigStore
5454
ConfigurationDataElement<bool> freedvReporterForceReceiveOnly;
5555
ConfigurationDataElement<bool> freedvReporterBandFilterTracksFreqBand;
5656
ConfigurationDataElement<bool> freedvReporterBandFilterTracksExactFreq;
57+
ConfigurationDataElement<wxString> freedvReporterStatusText;
58+
ConfigurationDataElement<std::vector<wxString> > freedvReporterRecentStatusTexts;
5759

5860
ConfigurationDataElement<bool> useUTCForReporting;
5961

@@ -63,11 +65,13 @@ class ReportingConfiguration : public WxWidgetsConfigStore
6365
ConfigurationDataElement<wxString> freedvReporterTxRowForegroundColor;
6466
ConfigurationDataElement<wxString> freedvReporterRxRowBackgroundColor;
6567
ConfigurationDataElement<wxString> freedvReporterRxRowForegroundColor;
68+
ConfigurationDataElement<wxString> freedvReporterMsgRowBackgroundColor;
69+
ConfigurationDataElement<wxString> freedvReporterMsgRowForegroundColor;
6670

6771
ConfigurationDataElement<bool> reportingFrequencyAsKhz;
6872

6973
virtual void load(wxConfigBase* config) override;
7074
virtual void save(wxConfigBase* config) override;
7175
};
7276

73-
#endif // REPORTING_CONFIGURATION_H
77+
#endif // REPORTING_CONFIGURATION_H

src/dlg_options.cpp

+38-15
Original file line numberDiff line numberDiff line change
@@ -265,44 +265,57 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
265265
wxStaticBox* sb_reporterColor = new wxStaticBox(m_displayTab, wxID_ANY, _("FreeDV Reporter colors"));
266266
wxStaticBoxSizer* sbSizer_reporterColor = new wxStaticBoxSizer(sb_reporterColor, wxVERTICAL);
267267

268-
wxBoxSizer* reporterTxColorSizer = new wxBoxSizer(wxHORIZONTAL);
269-
wxBoxSizer* reporterRxColorSizer = new wxBoxSizer(wxHORIZONTAL);
268+
wxFlexGridSizer* reporterColorSizer = new wxFlexGridSizer(5, wxSize(5, 5));
270269

271270
// TX colors
272271
wxStaticText* labelReporterTxStation = new wxStaticText(m_displayTab, wxID_ANY, wxT("TX Stations:"), wxDefaultPosition, wxDefaultSize, 0);
273-
reporterTxColorSizer->Add(labelReporterTxStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
272+
reporterColorSizer->Add(labelReporterTxStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
274273

275274
wxStaticText* labelReporterTxBackgroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Background"), wxDefaultPosition, wxDefaultSize, 0);
276-
reporterTxColorSizer->Add(labelReporterTxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
275+
reporterColorSizer->Add(labelReporterTxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
277276

278277
m_freedvReporterTxBackgroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
279-
reporterTxColorSizer->Add(m_freedvReporterTxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
278+
reporterColorSizer->Add(m_freedvReporterTxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
280279

281280
wxStaticText* labelReporterTxForegroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Foreground"), wxDefaultPosition, wxDefaultSize, 0);
282-
reporterTxColorSizer->Add(labelReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
281+
reporterColorSizer->Add(labelReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
283282

284283
m_freedvReporterTxForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
285-
reporterTxColorSizer->Add(m_freedvReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
286-
287-
sbSizer_reporterColor->Add(reporterTxColorSizer, 0, wxALL, 5);
284+
reporterColorSizer->Add(m_freedvReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
288285

289286
// RX colors
290287
wxStaticText* labelReporterRxStation = new wxStaticText(m_displayTab, wxID_ANY, wxT("RX Stations:"), wxDefaultPosition, wxDefaultSize, 0);
291-
reporterRxColorSizer->Add(labelReporterRxStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
288+
reporterColorSizer->Add(labelReporterRxStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
292289

293290
wxStaticText* labelReporterRxBackgroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Background"), wxDefaultPosition, wxDefaultSize, 0);
294-
reporterRxColorSizer->Add(labelReporterRxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
291+
reporterColorSizer->Add(labelReporterRxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
295292

296293
m_freedvReporterRxBackgroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
297-
reporterRxColorSizer->Add(m_freedvReporterRxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
294+
reporterColorSizer->Add(m_freedvReporterRxBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
298295

299296
wxStaticText* labelReporterRxForegroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Foreground"), wxDefaultPosition, wxDefaultSize, 0);
300-
reporterRxColorSizer->Add(labelReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
297+
reporterColorSizer->Add(labelReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
301298

302299
m_freedvReporterRxForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
303-
reporterRxColorSizer->Add(m_freedvReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
300+
reporterColorSizer->Add(m_freedvReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
301+
302+
// Message colors
303+
wxStaticText* labelReporterMsgStation = new wxStaticText(m_displayTab, wxID_ANY, wxT("Message updates:"), wxDefaultPosition, wxDefaultSize, 0);
304+
reporterColorSizer->Add(labelReporterMsgStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
305+
306+
wxStaticText* labelReporterMsgBackgroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Background"), wxDefaultPosition, wxDefaultSize, 0);
307+
reporterColorSizer->Add(labelReporterMsgBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
308+
309+
m_freedvReporterMsgBackgroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
310+
reporterColorSizer->Add(m_freedvReporterMsgBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
311+
312+
wxStaticText* labelReporterMsgForegroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Foreground"), wxDefaultPosition, wxDefaultSize, 0);
313+
reporterColorSizer->Add(labelReporterMsgForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
314+
315+
m_freedvReporterMsgForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
316+
reporterColorSizer->Add(m_freedvReporterMsgForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
304317

305-
sbSizer_reporterColor->Add(reporterRxColorSizer, 0, wxALL, 5);
318+
sbSizer_reporterColor->Add(reporterColorSizer, 0, wxALL, 5);
306319

307320
sizerDisplay->Add(sbSizer_reporterColor, 0, wxALL | wxEXPAND, 5);
308321

@@ -786,11 +799,15 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
786799
wxColour rxForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowForegroundColor);
787800
wxColour txBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowBackgroundColor);
788801
wxColour txForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowForegroundColor);
802+
wxColour msgBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowBackgroundColor);
803+
wxColour msgForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowForegroundColor);
789804

790805
m_freedvReporterRxBackgroundColor->SetColour(rxBackgroundColor);
791806
m_freedvReporterRxForegroundColor->SetColour(rxForegroundColor);
792807
m_freedvReporterTxBackgroundColor->SetColour(txBackgroundColor);
793808
m_freedvReporterTxForegroundColor->SetColour(txForegroundColor);
809+
m_freedvReporterMsgBackgroundColor->SetColour(msgBackgroundColor);
810+
m_freedvReporterMsgForegroundColor->SetColour(msgForegroundColor);
794811

795812
// Populate reporting frequency list.
796813
for (auto& item : wxGetApp().appConfiguration.reportingConfiguration.reportingFrequencyList.get())
@@ -937,6 +954,12 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
937954
wxColour txForegroundColor = m_freedvReporterTxForegroundColor->GetColour();
938955
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowForegroundColor = txForegroundColor.GetAsString(wxC2S_HTML_SYNTAX);
939956

957+
wxColour msgBackgroundColor = m_freedvReporterMsgBackgroundColor->GetColour();
958+
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowBackgroundColor = msgBackgroundColor.GetAsString(wxC2S_HTML_SYNTAX);
959+
960+
wxColour msgForegroundColor = m_freedvReporterMsgForegroundColor->GetColour();
961+
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowForegroundColor = msgForegroundColor.GetAsString(wxC2S_HTML_SYNTAX);
962+
940963
// Save new reporting frequency list.
941964
std::vector<wxString> tmpList;
942965
for (unsigned int index = 0; index < m_freqList->GetCount(); index++)

src/dlg_options.h

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ class OptionsDlg : public wxDialog
105105
wxColourPickerCtrl* m_freedvReporterTxForegroundColor;
106106
wxColourPickerCtrl* m_freedvReporterRxBackgroundColor;
107107
wxColourPickerCtrl* m_freedvReporterRxForegroundColor;
108+
wxColourPickerCtrl* m_freedvReporterMsgBackgroundColor;
109+
wxColourPickerCtrl* m_freedvReporterMsgForegroundColor;
108110

109111
/* Voice Keyer */
110112

0 commit comments

Comments
 (0)