mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-13 13:15:47 +08:00
Formatting
This commit is contained in:
@@ -484,6 +484,8 @@ namespace BlackCore
|
||||
/*!
|
||||
* We received a reply to one of our queries.
|
||||
* \sa sendCapabilitiesQuery
|
||||
* @param callsign
|
||||
* @param capabilitiesFlags as in BlackMisc::Network::CClient
|
||||
*/
|
||||
void capabilitiesReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, int capabilitiesFlags);
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ namespace BlackCore
|
||||
|
||||
QDateTime CThreadedReader::getUpdateTimestamp() const
|
||||
{
|
||||
QReadLocker lock(&this->m_lock);
|
||||
return this->m_updateTimestamp;
|
||||
QReadLocker lock(&m_lock);
|
||||
return m_updateTimestamp;
|
||||
}
|
||||
|
||||
void CThreadedReader::setUpdateTimestamp(const QDateTime &updateTimestamp)
|
||||
{
|
||||
QWriteLocker lock(&this->m_lock);
|
||||
this->m_updateTimestamp = updateTimestamp;
|
||||
QWriteLocker lock(&m_lock);
|
||||
m_updateTimestamp = updateTimestamp;
|
||||
}
|
||||
|
||||
bool CThreadedReader::updatedWithinLastMs(qint64 timeLastMs)
|
||||
@@ -105,31 +105,31 @@ namespace BlackCore
|
||||
{
|
||||
uint oldHash = 0;
|
||||
{
|
||||
QReadLocker rl(&this->m_lock);
|
||||
oldHash = this->m_contentHash;
|
||||
QReadLocker rl(&m_lock);
|
||||
oldHash = m_contentHash;
|
||||
}
|
||||
uint newHash = qHash(startPosition < 0 ? content : content.mid(startPosition));
|
||||
if (oldHash == newHash) { return false; }
|
||||
{
|
||||
QWriteLocker wl(&this->m_lock);
|
||||
this->m_contentHash = newHash;
|
||||
QWriteLocker wl(&m_lock);
|
||||
m_contentHash = newHash;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CThreadedReader::isMarkedAsFailed() const
|
||||
{
|
||||
return this->m_markedAsFailed;
|
||||
return m_markedAsFailed;
|
||||
}
|
||||
|
||||
void CThreadedReader::setMarkedAsFailed(bool failed)
|
||||
{
|
||||
this->m_markedAsFailed = failed;
|
||||
m_markedAsFailed = failed;
|
||||
}
|
||||
|
||||
CUrlLogList CThreadedReader::getReadLog() const
|
||||
{
|
||||
QReadLocker rl(&this->m_lock);
|
||||
QReadLocker rl(&m_lock);
|
||||
return m_urlReadLog;
|
||||
}
|
||||
|
||||
@@ -165,15 +165,14 @@ namespace BlackCore
|
||||
bool CThreadedReader::doWorkCheck() const
|
||||
{
|
||||
// sApp->hasWebDataServices() cannot be used, as some readers are already used during init phase
|
||||
if (!m_unitTest && (!sApp || sApp->isShuttingDown())) { return false; }
|
||||
if (!isEnabled()) { return false; }
|
||||
if (isAbandoned()) { return false; }
|
||||
if (!m_unitTest && (!sApp || sApp->isShuttingDown())) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
QNetworkReply *CThreadedReader::getFromNetworkAndLog(const CUrl &url, const BlackMisc::CSlot<void (QNetworkReply *)> &callback)
|
||||
{
|
||||
// returned QNetworkReply normally nullptr since QAM is in different thread
|
||||
QWriteLocker wl(&m_lock);
|
||||
const CUrlLogList outdatedPendingUrls = m_urlReadLog.findOutdatedPending(OutdatedPendingCallMs);
|
||||
if (!outdatedPendingUrls.isEmpty())
|
||||
@@ -184,6 +183,8 @@ namespace BlackCore
|
||||
|
||||
const int id = m_urlReadLog.addPendingUrl(url);
|
||||
wl.unlock();
|
||||
|
||||
// returned QNetworkReply normally nullptr since QAM is in different thread
|
||||
return sApp->getFromNetwork(url, id, callback);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace BlackCore
|
||||
int m_periodicTime = -1; //!< Periodic time after which the task is repeated
|
||||
QDateTime m_updateTimestamp; //!< when file/resource was read
|
||||
uint m_contentHash = 0; //!< has of the content given
|
||||
std::atomic<bool> m_markedAsFailed { false }; //!< marker if reading failed
|
||||
std::atomic_bool m_markedAsFailed { false }; //!< marker if reading failed
|
||||
bool m_unitTest { false }; //!< mark as unit test
|
||||
BlackMisc::Network::CUrlLogList m_urlReadLog; //!< URL based reading can be logged
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace BlackCore
|
||||
{
|
||||
//! Read vatsim data file
|
||||
//! \sa http://info.vroute.net/vatsim-data.txt
|
||||
class BLACKCORE_EXPORT CVatsimDataFileReader : public BlackCore::CThreadedReader
|
||||
class BLACKCORE_EXPORT CVatsimDataFileReader : public CThreadedReader
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace BlackMisc
|
||||
|
||||
//! Value object encapsulating a list of distributors.
|
||||
class BLACKMISC_EXPORT CDistributorList :
|
||||
public BlackMisc::CSequence<CDistributor>,
|
||||
public BlackMisc::Db::IDatastoreObjectList<CDistributor, CDistributorList, QString>,
|
||||
public BlackMisc::IOrderableList<CDistributor, CDistributorList>,
|
||||
public BlackMisc::Mixin::MetaType<CDistributorList>
|
||||
public CSequence<CDistributor>,
|
||||
public Db::IDatastoreObjectList<CDistributor, CDistributorList, QString>,
|
||||
public IOrderableList<CDistributor, CDistributorList>,
|
||||
public Mixin::MetaType<CDistributorList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CDistributorList)
|
||||
|
||||
@@ -39,9 +39,11 @@ namespace BlackSimPlugin
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
CFs9Client(const BlackMisc::Aviation::CCallsign &callsign, const QString &modelName,
|
||||
CFs9Client(const BlackMisc::Aviation::CCallsign &callsign,
|
||||
const QString &modelName,
|
||||
const BlackMisc::PhysicalQuantities::CTime &updateInterval,
|
||||
BlackMisc::Simulation::CInterpolationLogger *logger, QObject *owner);
|
||||
BlackMisc::Simulation::CInterpolationLogger *logger,
|
||||
BlackCore::ISimulator *owner);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CFs9Client();
|
||||
@@ -79,11 +81,13 @@ namespace BlackSimPlugin
|
||||
//! Enumerate all FS9 session hosts
|
||||
HRESULT enumDirectPlayHosts();
|
||||
|
||||
//! Create host address
|
||||
HRESULT createHostAddress();
|
||||
|
||||
//! Start hosting session
|
||||
HRESULT connectToSession(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
//! Close the connection
|
||||
HRESULT closeConnection();
|
||||
|
||||
void sendMultiplayerPosition(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "fs9client.h"
|
||||
#include "lobbyclient.h"
|
||||
#include "../fscommon/simulatorfscommon.h"
|
||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||
#include "blackmisc/simulation/interpolator.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
@@ -33,7 +33,7 @@ namespace BlackSimPlugin
|
||||
namespace Fs9
|
||||
{
|
||||
//! FS9 Simulator Implementation
|
||||
class CSimulatorFs9 : public BlackSimPlugin::FsCommon::CSimulatorFsCommon
|
||||
class CSimulatorFs9 : public FsCommon::CSimulatorFsCommon
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user