mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T698, added remote aircraft context to network class
This commit is contained in:
committed by
Mat Sutcliffe
parent
ab83d55d7c
commit
821e7e73c9
@@ -7,13 +7,31 @@
|
||||
*/
|
||||
|
||||
#include "network.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/range.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QStringBuilder>
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
INetwork::INetwork(IClientProvider *clientProvider, IOwnAircraftProvider *ownAircraftProvider, IRemoteAircraftProvider *remoteAircraftProvider, QObject *parent) :
|
||||
QObject(parent),
|
||||
CClientAware(clientProvider),
|
||||
COwnAircraftAware(ownAircraftProvider),
|
||||
CRemoteAircraftAware(remoteAircraftProvider)
|
||||
{
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
CLogMessage("Enabled network statistics");
|
||||
m_statistics = true;
|
||||
}
|
||||
}
|
||||
int INetwork::increaseStatisticsValue(const QString &identifier, const QString &appendix)
|
||||
{
|
||||
if (identifier.isEmpty() || !m_statistics) { return -1; }
|
||||
@@ -22,6 +40,11 @@ namespace BlackCore
|
||||
return v;
|
||||
}
|
||||
|
||||
int INetwork::increaseStatisticsValue(const QString &identifier, int value)
|
||||
{
|
||||
return this->increaseStatisticsValue(identifier, QString::number(value));
|
||||
}
|
||||
|
||||
QString INetwork::getNetworkStatisticsAsText(bool reset, const QString &separator)
|
||||
{
|
||||
QMap<int, QString> transformed;
|
||||
|
||||
Reference in New Issue
Block a user