Merge pull request #558 from drowe67/ms-reporter-rx-timeout
Increase RX coloring timeout to 20s and use UTC for time comparisons.pull/560/head
commit
bd4b059c78
|
@ -925,6 +925,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
|
||||||
* Add configuration for background/foreground colors in FreeDV Reporter. (PR #545)
|
* Add configuration for background/foreground colors in FreeDV Reporter. (PR #545)
|
||||||
* Always connect to FreeDV Reporter (in view only mode if necessary), regardless of valid configuration. (PR #542, #547)
|
* Always connect to FreeDV Reporter (in view only mode if necessary), regardless of valid configuration. (PR #542, #547)
|
||||||
* Add None as a valid PTT method and make it report RX Only. (PR #556)
|
* Add None as a valid PTT method and make it report RX Only. (PR #556)
|
||||||
|
* Increase RX coloring timeout in FreeDV Reporter to 20 seconds. (PR #558)
|
||||||
3. Documentation:
|
3. Documentation:
|
||||||
* Add information about multiple audio devices and macOS. (PR #554)
|
* Add information about multiple audio devices and macOS. (PR #554)
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ extern FreeDVInterface freedvInterface;
|
||||||
#define UNKNOWN_STR "--"
|
#define UNKNOWN_STR "--"
|
||||||
#define NUM_COLS (12)
|
#define NUM_COLS (12)
|
||||||
#define RX_ONLY_STATUS "RX Only"
|
#define RX_ONLY_STATUS "RX Only"
|
||||||
|
#define RX_COLORING_TIMEOUT_SEC (20)
|
||||||
|
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
@ -362,15 +363,15 @@ void FreeDVReporterDialog::OnBandFilterChange(wxCommandEvent& event)
|
||||||
void FreeDVReporterDialog::OnTimer(wxTimerEvent& event)
|
void FreeDVReporterDialog::OnTimer(wxTimerEvent& event)
|
||||||
{
|
{
|
||||||
// Iterate across all visible rows. If a row is currently highlighted
|
// Iterate across all visible rows. If a row is currently highlighted
|
||||||
// green and it's been more than >10 seconds, clear coloring.
|
// green and it's been more than >20 seconds, clear coloring.
|
||||||
auto curDate = wxDateTime::Now();
|
auto curDate = wxDateTime::Now().ToUTC();
|
||||||
for (auto index = 0; index < m_listSpots->GetItemCount(); index++)
|
for (auto index = 0; index < m_listSpots->GetItemCount(); index++)
|
||||||
{
|
{
|
||||||
std::string* sidPtr = (std::string*)m_listSpots->GetItemData(index);
|
std::string* sidPtr = (std::string*)m_listSpots->GetItemData(index);
|
||||||
auto reportData = allReporterData_[*sidPtr];
|
auto reportData = allReporterData_[*sidPtr];
|
||||||
|
|
||||||
if (!reportData->transmitting &&
|
if (!reportData->transmitting &&
|
||||||
(!reportData->lastRxDate.IsValid() || !reportData->lastRxDate.IsEqualUpTo(curDate, wxTimeSpan(0, 0, 10))))
|
(!reportData->lastRxDate.IsValid() || !reportData->lastRxDate.ToUTC().IsEqualUpTo(curDate, wxTimeSpan(0, 0, RX_COLORING_TIMEOUT_SEC))))
|
||||||
{
|
{
|
||||||
m_listSpots->SetItemBackgroundColour(index, wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
|
m_listSpots->SetItemBackgroundColour(index, wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
|
||||||
m_listSpots->SetItemTextColour(index, wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT));
|
m_listSpots->SetItemTextColour(index, wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT));
|
||||||
|
@ -1006,7 +1007,7 @@ void FreeDVReporterDialog::addOrUpdateListIfNotFiltered_(ReporterData* data)
|
||||||
m_listSpots->SetItemBackgroundColour(itemIndex, txBackgroundColor);
|
m_listSpots->SetItemBackgroundColour(itemIndex, txBackgroundColor);
|
||||||
m_listSpots->SetItemTextColour(itemIndex, txForegroundColor);
|
m_listSpots->SetItemTextColour(itemIndex, txForegroundColor);
|
||||||
}
|
}
|
||||||
else if (data->lastRxDate.IsValid() && data->lastRxDate.IsEqualUpTo(wxDateTime::Now(), wxTimeSpan(0, 0, 10)))
|
else if (data->lastRxDate.IsValid() && data->lastRxDate.ToUTC().IsEqualUpTo(wxDateTime::Now().ToUTC(), wxTimeSpan(0, 0, RX_COLORING_TIMEOUT_SEC)))
|
||||||
{
|
{
|
||||||
wxColour rxBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowBackgroundColor);
|
wxColour rxBackgroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowBackgroundColor);
|
||||||
wxColour rxForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowForegroundColor);
|
wxColour rxForegroundColor(wxGetApp().appConfiguration.reportingConfiguration.freedvReporterRxRowForegroundColor);
|
||||||
|
|
Loading…
Reference in New Issue