mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 18:25:42 +08:00
refs #844, further improvements of ATC stations display
Signal when bookings are read, but not changed
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3f2fc33b27
commit
85ca3b7a1a
@@ -45,7 +45,7 @@ namespace BlackCore
|
|||||||
CVatsimBookingReader::CVatsimBookingReader(QObject *owner) :
|
CVatsimBookingReader::CVatsimBookingReader(QObject *owner) :
|
||||||
CThreadedReader(owner, "CVatsimBookingReader")
|
CThreadedReader(owner, "CVatsimBookingReader")
|
||||||
{
|
{
|
||||||
reloadSettings();
|
settingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVatsimBookingReader::readInBackgroundThread()
|
void CVatsimBookingReader::readInBackgroundThread()
|
||||||
@@ -90,7 +90,7 @@ namespace BlackCore
|
|||||||
this->threadAssertCheck();
|
this->threadAssertCheck();
|
||||||
|
|
||||||
// Worker thread, make sure to write no members here od do it threadsafe
|
// Worker thread, make sure to write no members here od do it threadsafe
|
||||||
if (this->isAbandoned())
|
if (this->isShuttingDown())
|
||||||
{
|
{
|
||||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||||
CLogMessage(this).info("Terminated booking parsing process");
|
CLogMessage(this).info("Terminated booking parsing process");
|
||||||
@@ -107,8 +107,8 @@ namespace BlackCore
|
|||||||
QDateTime updateTimestamp = QDateTime::currentDateTimeUtc(); // default
|
QDateTime updateTimestamp = QDateTime::currentDateTimeUtc(); // default
|
||||||
if (doc.setContent(xmlData))
|
if (doc.setContent(xmlData))
|
||||||
{
|
{
|
||||||
QDomNode timestamp = doc.elementsByTagName("timestamp").at(0);
|
const QDomNode timestamp = doc.elementsByTagName("timestamp").at(0);
|
||||||
QString ts = timestamp.toElement().text().trimmed();
|
const QString ts = timestamp.toElement().text().trimmed();
|
||||||
Q_ASSERT(!ts.isEmpty());
|
Q_ASSERT(!ts.isEmpty());
|
||||||
|
|
||||||
if (!ts.isEmpty())
|
if (!ts.isEmpty())
|
||||||
@@ -124,6 +124,7 @@ namespace BlackCore
|
|||||||
if (!changed)
|
if (!changed)
|
||||||
{
|
{
|
||||||
CLogMessage(this).info("Read bookings unchanged, skipped");
|
CLogMessage(this).info("Read bookings unchanged, skipped");
|
||||||
|
emit this->atcBookingsReadUnchanged();
|
||||||
return; // stop, terminate straight away, ending thread
|
return; // stop, terminate straight away, ending thread
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,11 +202,10 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
} // method
|
} // method
|
||||||
|
|
||||||
void CVatsimBookingReader::reloadSettings()
|
void CVatsimBookingReader::settingsChanged()
|
||||||
{
|
{
|
||||||
CReaderSettings s = m_settings.get();
|
CReaderSettings s = m_settings.get();
|
||||||
setInitialAndPeriodicTime(s.getInitialTime().toMs(), s.getPeriodicTime().toMs());
|
setInitialAndPeriodicTime(s.getInitialTime().toMs(), s.getPeriodicTime().toMs());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ namespace BlackCore
|
|||||||
//! Bookings have been read and converted to BlackMisc::Aviation::CAtcStationList
|
//! Bookings have been read and converted to BlackMisc::Aviation::CAtcStationList
|
||||||
void atcBookingsRead(const BlackMisc::Aviation::CAtcStationList &bookedStations);
|
void atcBookingsRead(const BlackMisc::Aviation::CAtcStationList &bookedStations);
|
||||||
|
|
||||||
|
//! Bookings have been re-read but did not change
|
||||||
|
void atcBookingsReadUnchanged();
|
||||||
|
|
||||||
//! Data have been read
|
//! Data have been read
|
||||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||||
|
|
||||||
@@ -60,9 +63,10 @@ namespace BlackCore
|
|||||||
void ps_read();
|
void ps_read();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadSettings();
|
//! Settings changed
|
||||||
|
void settingsChanged();
|
||||||
|
|
||||||
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimBookings> m_settings { this, &CVatsimBookingReader::reloadSettings };
|
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimBookings> m_settings { this, &CVatsimBookingReader::settingsChanged };
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user