Only report RADE RX once a second to the server.

pull/769/head
Mooneer Salem 2024-11-11 00:02:47 -08:00
parent f62345538e
commit 31efc56bb0
2 changed files with 7 additions and 2 deletions

View File

@ -228,6 +228,7 @@ bool MainApp::OnInit()
m_locale.Init();
m_reporters.clear();
m_reportCounter = 0;
if(!wxApp::OnInit())
{
@ -1648,8 +1649,10 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
// Only report if there's a valid reporting frequency and if we're not playing
// a recording through ourselves (to avoid false reports).
if (freq > 0)
wxGetApp().m_reportCounter = (wxGetApp().m_reportCounter + 1) % 10;
if (freq > 0 && wxGetApp().m_reportCounter == 0)
{
wxGetApp().m_reportCounter = 0;
if (!g_playFileFromRadio)
{
wxGetApp().m_sharedReporterObject->addReceiveRecord(

View File

@ -222,6 +222,8 @@ class MainApp : public wxApp
std::shared_ptr<LinkStep> linkStep;
wxLocale m_locale;
int m_reportCounter;
protected:
};