refs #93, update network data such as ATIS or pilot frequencies from time to time,

as these data are not actively pushed from network when changing
* timer in network context
* update methods, one specific method for ATIS as this can also be manually re-read(from GUI)
This commit is contained in:
Klaus Basan
2014-02-07 21:30:04 +01:00
parent 2cbddeb5ee
commit 1a72b4b691
5 changed files with 64 additions and 2 deletions

View File

@@ -33,13 +33,18 @@ namespace BlackCore
// 2. Init own aircraft
this->initOwnAircraft();
// 3. Init network access driver for XML data (bookings)
// 3a. Init network access driver for XML data (bookings)
this->m_networkManager = new QNetworkAccessManager(this);
this->m_atcBookingTimer = new QTimer(this);
this->connect(this->m_networkManager, &QNetworkAccessManager::finished, this, &CContextNetwork::psAtcBookingsRead);
this->connect(this->m_atcBookingTimer, &QTimer::timeout, this, &CContextNetwork::readAtcBookingsFromSource);
this->m_atcBookingTimer->start(10 * 1000); // will be reset in method to a longer time
// 3b. Update timer for data
this->m_dataUpdateTimer = new QTimer(this);
this->connect(this->m_dataUpdateTimer, &QTimer::timeout, this, &CContextNetwork::requestDataUpdates);
this->m_dataUpdateTimer->start(30 * 1000);
// 4. connect signals and slots
this->connect(this->m_network, &INetwork::connectionStatusChanged, this, &CContextNetwork::psFsdConnectionStatusChanged);
this->connect(this->m_network, &INetwork::atcPositionUpdate, this, &CContextNetwork::psFsdAtcPositionUpdate);