Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to report status message to FreeDV Reporter. #620

Merged
merged 37 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f5367fc
Add logic to report status message to FreeDV Reporter.
tmiw Dec 10, 2023
7b0c054
Add PR #620 to changelog.
tmiw Dec 10, 2023
eee0451
Merge branch 'master' into ms-reporter-msg
tmiw Dec 16, 2023
1c2f437
Shorten a few columns in FreeDV Reporter.
tmiw Dec 16, 2023
5ea0dc7
Shorten Distance column.
tmiw Dec 19, 2023
a6f1dfc
Move Message column to the right of Status.
tmiw Dec 19, 2023
bc341e7
Swap Last TX and TX Mode and shorten Mode labels.
tmiw Dec 19, 2023
f31a574
Fix control alignment in window.
tmiw Dec 19, 2023
920e1c6
Get more space for settings line.
tmiw Dec 19, 2023
d3b142f
Add Set/Clear buttons.
tmiw Dec 19, 2023
16b8828
Implement MRU list for Msg field.
tmiw Dec 19, 2023
f18e28e
Restore sending of message to server on connect.
tmiw Dec 19, 2023
fde1db3
Change Msg->Message on bottom.
tmiw Dec 19, 2023
d9f68bf
Prevent empty status messages from being added to MRU list.
tmiw Dec 21, 2023
4ec86a5
Ensure that selection is correct when selecting previously used messa…
tmiw Dec 21, 2023
f497442
Add 15 character limit.
tmiw Dec 21, 2023
8720f28
Disable Set and Clear buttons based on whether there are pending chan…
tmiw Dec 21, 2023
96131b6
Experiment: get all the controls back on one row.
tmiw Dec 21, 2023
98a6e97
Revert status message to 175px width.
tmiw Dec 21, 2023
efc20cd
Actually suppress entry of text > character limit.
tmiw Dec 21, 2023
8faa015
Set button should also disable itself after clearing text.
tmiw Dec 21, 2023
38d0025
Additional tweaks to make Reporter window fit on 720p display.
tmiw Dec 21, 2023
ba46b7a
Resize headers after clearing entries to avoid display bug.
tmiw Dec 21, 2023
231be10
Actually fix column sizing issue this time.
tmiw Dec 22, 2023
df997ea
Slightly widen message field.
tmiw Dec 22, 2023
e81951b
Highlight row on message changes, use RX coloring and 5s timeout for …
tmiw Dec 22, 2023
97cf84c
Use light purple background color as default message color in config.
tmiw Dec 22, 2023
35f0621
Enable UI for configuring message update color.
tmiw Dec 22, 2023
3ae2fb5
Adjust positioning of color pickers in Options dialog.
tmiw Dec 22, 2023
aff6481
Don't highlight when we change our own message.
tmiw Dec 22, 2023
8c4d224
Shrink message text box to 180px.
tmiw Dec 22, 2023
0554df6
Suppress highlighting until after we get all users from the server on…
tmiw Dec 22, 2023
4c2b681
Test code to force resize of Msg column for all updates.
tmiw Dec 22, 2023
0b234b4
Use UNKNOWN_STR for empty messages for consistency.
tmiw Dec 22, 2023
44c92d9
Resolve intermittent message flashing on startup.
tmiw Dec 24, 2023
bcfa537
Force resize of all columns on disconnect.
tmiw Dec 24, 2023
c7c97ca
Force resize all columns when items are removed.
tmiw Dec 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions USER_MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
2. Enhancements:
* Allow serial PTT to be enabled along with OmniRig. (PR #619)
* Add 800XA to multi-RX list. (PR #617)
* Add logic to report status message to FreeDV Reporter. (PR #620)
* Allow display and entry of frequencies in KHz. (PR #621)

## V1.9.5 November 2023
Expand Down
17 changes: 14 additions & 3 deletions src/config/ReportingConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ ReportingConfiguration::ReportingConfiguration()
, freedvReporterForceReceiveOnly("/Reporting/FreeDV/ForceReceiveOnly", false)
, freedvReporterBandFilterTracksFreqBand("/Reporting/FreeDV/BandFilterTracking/TracksFreqBand", true)
, freedvReporterBandFilterTracksExactFreq("/Reporting/FreeDV/BandFilterTracking/TracksExactFreq", false)

, freedvReporterStatusText("/Reporting/FreeDV/StatusText", _(""))
, freedvReporterRecentStatusTexts("/Reporting/FreeDV/RecentStatusTexts", {})
, useUTCForReporting("/CallsignList/UseUTCTime", false)

, reportingFrequencyList("/Reporting/FrequencyList", {
Expand All @@ -74,6 +75,8 @@ ReportingConfiguration::ReportingConfiguration()
, freedvReporterTxRowForegroundColor("/Reporting/FreeDV/TxRowForegroundColor", "#000000")
, freedvReporterRxRowBackgroundColor("/Reporting/FreeDV/RxRowBackgroundColor", "#379baf")
, freedvReporterRxRowForegroundColor("/Reporting/FreeDV/RxRowForegroundColor", "#000000")
, freedvReporterMsgRowBackgroundColor("/Reporting/FreeDV/MsgRowBackgroundColor", "#E58BE5")
, freedvReporterMsgRowForegroundColor("/Reporting/FreeDV/MsgRowForegroundColor", "#000000")

, reportingFrequencyAsKhz("/Reporting/FrequencyAsKHz", false)
{
Expand Down Expand Up @@ -172,7 +175,9 @@ void ReportingConfiguration::load(wxConfigBase* config)
load_(config, freedvReporterForceReceiveOnly);
load_(config, freedvReporterBandFilterTracksFreqBand);
load_(config, freedvReporterBandFilterTracksExactFreq);

load_(config, freedvReporterStatusText);
load_(config, freedvReporterRecentStatusTexts);

load_(config, useUTCForReporting);

// Note: this needs to be loaded before the frequency list so that
Expand All @@ -187,7 +192,9 @@ void ReportingConfiguration::load(wxConfigBase* config)
load_(config, freedvReporterTxRowForegroundColor);
load_(config, freedvReporterRxRowBackgroundColor);
load_(config, freedvReporterRxRowForegroundColor);

load_(config, freedvReporterMsgRowBackgroundColor);
load_(config, freedvReporterMsgRowForegroundColor);

// Special load handling for reporting below.
wxString freqStr = config->Read(reportingFrequency.getElementName(), oldFreqStr);
reportingFrequency.setWithoutProcessing(atoll(freqStr.ToUTF8()));
Expand All @@ -211,6 +218,8 @@ void ReportingConfiguration::save(wxConfigBase* config)
save_(config, freedvReporterForceReceiveOnly);
save_(config, freedvReporterBandFilterTracksFreqBand);
save_(config, freedvReporterBandFilterTracksExactFreq);
save_(config, freedvReporterStatusText);
save_(config, freedvReporterRecentStatusTexts);

save_(config, useUTCForReporting);

Expand All @@ -223,6 +232,8 @@ void ReportingConfiguration::save(wxConfigBase* config)
save_(config, freedvReporterTxRowForegroundColor);
save_(config, freedvReporterRxRowBackgroundColor);
save_(config, freedvReporterRxRowForegroundColor);
save_(config, freedvReporterMsgRowBackgroundColor);
save_(config, freedvReporterMsgRowForegroundColor);

// Special save handling for reporting below.
wxString tempFreqStr = wxString::Format(wxT("%" PRIu64), reportingFrequency.getWithoutProcessing());
Expand Down
6 changes: 5 additions & 1 deletion src/config/ReportingConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class ReportingConfiguration : public WxWidgetsConfigStore
ConfigurationDataElement<bool> freedvReporterForceReceiveOnly;
ConfigurationDataElement<bool> freedvReporterBandFilterTracksFreqBand;
ConfigurationDataElement<bool> freedvReporterBandFilterTracksExactFreq;
ConfigurationDataElement<wxString> freedvReporterStatusText;
ConfigurationDataElement<std::vector<wxString> > freedvReporterRecentStatusTexts;

ConfigurationDataElement<bool> useUTCForReporting;

Expand All @@ -63,11 +65,13 @@ class ReportingConfiguration : public WxWidgetsConfigStore
ConfigurationDataElement<wxString> freedvReporterTxRowForegroundColor;
ConfigurationDataElement<wxString> freedvReporterRxRowBackgroundColor;
ConfigurationDataElement<wxString> freedvReporterRxRowForegroundColor;
ConfigurationDataElement<wxString> freedvReporterMsgRowBackgroundColor;
ConfigurationDataElement<wxString> freedvReporterMsgRowForegroundColor;

ConfigurationDataElement<bool> reportingFrequencyAsKhz;

virtual void load(wxConfigBase* config) override;
virtual void save(wxConfigBase* config) override;
};

#endif // REPORTING_CONFIGURATION_H
#endif // REPORTING_CONFIGURATION_H
53 changes: 38 additions & 15 deletions src/dlg_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,44 +255,57 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c
wxStaticBox* sb_reporterColor = new wxStaticBox(m_displayTab, wxID_ANY, _("FreeDV Reporter colors"));
wxStaticBoxSizer* sbSizer_reporterColor = new wxStaticBoxSizer(sb_reporterColor, wxVERTICAL);

wxBoxSizer* reporterTxColorSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* reporterRxColorSizer = new wxBoxSizer(wxHORIZONTAL);
wxFlexGridSizer* reporterColorSizer = new wxFlexGridSizer(5, wxSize(5, 5));

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

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

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

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

m_freedvReporterTxForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
reporterTxColorSizer->Add(m_freedvReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

sbSizer_reporterColor->Add(reporterTxColorSizer, 0, wxALL, 5);
reporterColorSizer->Add(m_freedvReporterTxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

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

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

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

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

m_freedvReporterRxForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
reporterRxColorSizer->Add(m_freedvReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
reporterColorSizer->Add(m_freedvReporterRxForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

// Message colors
wxStaticText* labelReporterMsgStation = new wxStaticText(m_displayTab, wxID_ANY, wxT("Message updates:"), wxDefaultPosition, wxDefaultSize, 0);
reporterColorSizer->Add(labelReporterMsgStation, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

wxStaticText* labelReporterMsgBackgroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Background"), wxDefaultPosition, wxDefaultSize, 0);
reporterColorSizer->Add(labelReporterMsgBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

m_freedvReporterMsgBackgroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
reporterColorSizer->Add(m_freedvReporterMsgBackgroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

wxStaticText* labelReporterMsgForegroundColor = new wxStaticText(m_displayTab, wxID_ANY, wxT("Foreground"), wxDefaultPosition, wxDefaultSize, 0);
reporterColorSizer->Add(labelReporterMsgForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

m_freedvReporterMsgForegroundColor = new wxColourPickerCtrl(m_displayTab, wxID_ANY);
reporterColorSizer->Add(m_freedvReporterMsgForegroundColor, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

sbSizer_reporterColor->Add(reporterRxColorSizer, 0, wxALL, 5);
sbSizer_reporterColor->Add(reporterColorSizer, 0, wxALL, 5);

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

Expand Down Expand Up @@ -776,11 +789,15 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
wxColour rxForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowForegroundColor);
wxColour txBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowBackgroundColor);
wxColour txForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowForegroundColor);
wxColour msgBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowBackgroundColor);
wxColour msgForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowForegroundColor);

m_freedvReporterRxBackgroundColor->SetColour(rxBackgroundColor);
m_freedvReporterRxForegroundColor->SetColour(rxForegroundColor);
m_freedvReporterTxBackgroundColor->SetColour(txBackgroundColor);
m_freedvReporterTxForegroundColor->SetColour(txForegroundColor);
m_freedvReporterMsgBackgroundColor->SetColour(msgBackgroundColor);
m_freedvReporterMsgForegroundColor->SetColour(msgForegroundColor);

// Populate reporting frequency list.
for (auto& item : wxGetApp().appConfiguration.reportingConfiguration.reportingFrequencyList.get())
Expand Down Expand Up @@ -926,6 +943,12 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent)
wxColour txForegroundColor = m_freedvReporterTxForegroundColor->GetColour();
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterTxRowForegroundColor = txForegroundColor.GetAsString(wxC2S_HTML_SYNTAX);

wxColour msgBackgroundColor = m_freedvReporterMsgBackgroundColor->GetColour();
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowBackgroundColor = msgBackgroundColor.GetAsString(wxC2S_HTML_SYNTAX);

wxColour msgForegroundColor = m_freedvReporterMsgForegroundColor->GetColour();
wxGetApp().appConfiguration.reportingConfiguration.freedvReporterMsgRowForegroundColor = msgForegroundColor.GetAsString(wxC2S_HTML_SYNTAX);

// Save new reporting frequency list.
std::vector<wxString> tmpList;
for (unsigned int index = 0; index < m_freqList->GetCount(); index++)
Expand Down
2 changes: 2 additions & 0 deletions src/dlg_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class OptionsDlg : public wxDialog
wxColourPickerCtrl* m_freedvReporterTxForegroundColor;
wxColourPickerCtrl* m_freedvReporterRxBackgroundColor;
wxColourPickerCtrl* m_freedvReporterRxForegroundColor;
wxColourPickerCtrl* m_freedvReporterMsgBackgroundColor;
wxColourPickerCtrl* m_freedvReporterMsgForegroundColor;

/* Voice Keyer */

Expand Down
Loading
Loading