mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #640, support for simulator in distributor
* changed backend (JSON) and added support for simulator data * get distributors by simulator * renamed to setSimulator / getSimulator
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "simulatorinfo.h"
|
||||
#include "buildconfig.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include "blackmisc/datastoreutility.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -204,6 +205,17 @@ namespace BlackMisc
|
||||
return sim;
|
||||
}
|
||||
|
||||
CSimulatorInfo CSimulatorInfo::fromDatabaseJson(const QJsonObject &json, const QString prefix)
|
||||
{
|
||||
bool fsx = CDatastoreUtility::dbBoolStringToBool(json.value(prefix + "simfsx").toString());
|
||||
bool fs9 = CDatastoreUtility::dbBoolStringToBool(json.value(prefix + "simfs9").toString());
|
||||
bool xp = CDatastoreUtility::dbBoolStringToBool(json.value(prefix + "simxplane").toString());
|
||||
bool p3d = CDatastoreUtility::dbBoolStringToBool(json.value(prefix + "simp3d").toString());
|
||||
|
||||
const CSimulatorInfo simInfo(fsx, fs9, xp, p3d);
|
||||
return simInfo;
|
||||
}
|
||||
|
||||
CCountPerSimulator::CCountPerSimulator()
|
||||
{
|
||||
this->m_counts.reserve(CSimulatorInfo::NumberOfSimulators + 1);
|
||||
|
||||
Reference in New Issue
Block a user