From 03bd44ae392f4a2fe1553ca0fde0aab515fc57d4 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Mon, 25 Mar 2019 09:52:35 -0400 Subject: [PATCH] Updated SpotClient to send local data at least once every 5 minutes --- SpotClient.cpp | 6 ++++-- SpotClient.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SpotClient.cpp b/SpotClient.cpp index 463cdd3..ecc7529 100644 --- a/SpotClient.cpp +++ b/SpotClient.cpp @@ -52,8 +52,8 @@ void SpotClient::setLocalStation(QString callsign, QString grid, QString info, Q changed = true; } - if(changed){ - // send local information to network + // send local information to network on change, or once every 5 minutes + if(changed || m_seq % 5 == 0){ enqueueLocalSpot(callsign, grid, info, version); } } @@ -91,6 +91,8 @@ void SpotClient::processSpots(){ while(!m_queue.isEmpty()){ sendRawSpot(m_queue.dequeue()); } + + m_seq++; } void SpotClient::sendRawSpot(QByteArray payload){ diff --git a/SpotClient.h b/SpotClient.h index d0f949d..88b4b92 100644 --- a/SpotClient.h +++ b/SpotClient.h @@ -25,6 +25,7 @@ public slots: void dnsLookupResult(QHostInfo); private: + int m_seq; QString m_call; QString m_grid; QString m_info;