mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
committed by
Mathew Sutcliffe
parent
368b955c66
commit
a57b83f9de
@@ -6,6 +6,7 @@ CONFIG -= qt
|
|||||||
|
|
||||||
OTHER_FILES += share/images/flags/*.png
|
OTHER_FILES += share/images/flags/*.png
|
||||||
OTHER_FILES += share/images/airlines/*.png
|
OTHER_FILES += share/images/airlines/*.png
|
||||||
|
OTHER_FILES += share/test/*.*
|
||||||
OTHER_FILES += shared/bootstrap/*.*
|
OTHER_FILES += shared/bootstrap/*.*
|
||||||
OTHER_FILES += shared/html/*.*
|
OTHER_FILES += shared/html/*.*
|
||||||
OTHER_FILES += shared/dbdata/*.*
|
OTHER_FILES += shared/dbdata/*.*
|
||||||
@@ -14,6 +15,7 @@ OTHER_FILES += shared/updateinfo/*.*
|
|||||||
COPY_FILES += $$PWD/share/images/flags/*.png
|
COPY_FILES += $$PWD/share/images/flags/*.png
|
||||||
COPY_FILES += $$PWD/share/images/airlines/*.png
|
COPY_FILES += $$PWD/share/images/airlines/*.png
|
||||||
COPY_FILES += $$PWD/share/html/*.*
|
COPY_FILES += $$PWD/share/html/*.*
|
||||||
|
COPY_FILES += $$PWD/share/test/*.*
|
||||||
COPY_FILES += $$PWD/share/shared/bootstrap/*.*
|
COPY_FILES += $$PWD/share/shared/bootstrap/*.*
|
||||||
COPY_FILES += $$PWD/share/shared/dbdata/*.*
|
COPY_FILES += $$PWD/share/shared/dbdata/*.*
|
||||||
COPY_FILES += $$PWD/share/shared/updateinfo/*.*
|
COPY_FILES += $$PWD/share/shared/updateinfo/*.*
|
||||||
|
|||||||
15
resources/share/test/DBAircraftIcaoB737Boeing.json
Normal file
15
resources/share/test/DBAircraftIcaoB737Boeing.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"combinedType": "L2J",
|
||||||
|
"dbKey": 1777,
|
||||||
|
"designator": "B739",
|
||||||
|
"family": "B737",
|
||||||
|
"iataCode": "739",
|
||||||
|
"legacy": false,
|
||||||
|
"manufacturer": "BOEING",
|
||||||
|
"military": false,
|
||||||
|
"modelDescription": "737-900 BBJ3",
|
||||||
|
"rank": 10,
|
||||||
|
"realWorld": true,
|
||||||
|
"timestampMSecsSinceEpoch": 1454013308000,
|
||||||
|
"wtc": "M"
|
||||||
|
}
|
||||||
15
resources/share/test/DBAircraftIcaoC172Cessna.json
Normal file
15
resources/share/test/DBAircraftIcaoC172Cessna.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"combinedType": "L1P",
|
||||||
|
"dbKey": 2279,
|
||||||
|
"designator": "C172",
|
||||||
|
"family": "",
|
||||||
|
"iataCode": "CN1",
|
||||||
|
"legacy": false,
|
||||||
|
"manufacturer": "CESSNA","
|
||||||
|
"military": false,
|
||||||
|
"modelDescription": "172 Skyhawk",
|
||||||
|
"rank": 1,
|
||||||
|
"realWorld": true,
|
||||||
|
"timestampMSecsSinceEpoch": 1476144089000,
|
||||||
|
"wtc": "L"
|
||||||
|
}
|
||||||
21
resources/share/test/DBAirlineIcaoBAW.json
Normal file
21
resources/share/test/DBAirlineIcaoBAW.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"country": {
|
||||||
|
"alias1": "",
|
||||||
|
"alias2": "",
|
||||||
|
"dbKey": "GB",
|
||||||
|
"historic": false,
|
||||||
|
"iso3": "",
|
||||||
|
"loadedFromDb": false,
|
||||||
|
"name": "United Kingdom",
|
||||||
|
"simplifiedName": "",
|
||||||
|
"timestampMSecsSinceEpoch": -1
|
||||||
|
},
|
||||||
|
"dbKey": 1299,
|
||||||
|
"designator": "BAW",
|
||||||
|
"isMilitary": false,
|
||||||
|
"isOperating": true,
|
||||||
|
"isVa": false,
|
||||||
|
"name": "British Airways",
|
||||||
|
"telephonyDesignator": "SPEEDBIRD",
|
||||||
|
"timestampMSecsSinceEpoch": 1433786773000
|
||||||
|
}
|
||||||
21
resources/share/test/DBAirlineIcaoDLH.json
Normal file
21
resources/share/test/DBAirlineIcaoDLH.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"country": {
|
||||||
|
"alias1": "",
|
||||||
|
"alias2": "",
|
||||||
|
"dbKey": "DE",
|
||||||
|
"historic": false,
|
||||||
|
"iso3": "",
|
||||||
|
"loadedFromDb": false,
|
||||||
|
"name": "Germany",
|
||||||
|
"simplifiedName": "",
|
||||||
|
"timestampMSecsSinceEpoch": -1
|
||||||
|
},
|
||||||
|
"dbKey": 3221,
|
||||||
|
"designator": "DLH",
|
||||||
|
"isMilitary": false,
|
||||||
|
"isOperating": true,
|
||||||
|
"isVa": false,
|
||||||
|
"name": "Lufthansa",
|
||||||
|
"telephonyDesignator": "LUFTHANSA",
|
||||||
|
"timestampMSecsSinceEpoch": 1454179410000
|
||||||
|
}
|
||||||
38
resources/share/test/DBLiveryDLHStarAlliance.json
Normal file
38
resources/share/test/DBLiveryDLHStarAlliance.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"airline": {
|
||||||
|
"country": {
|
||||||
|
"alias1": "",
|
||||||
|
"alias2": "",
|
||||||
|
"dbKey": "DE",
|
||||||
|
"historic": false,
|
||||||
|
"iso3": "",
|
||||||
|
"loadedFromDb": false,
|
||||||
|
"name": "Germany",
|
||||||
|
"simplifiedName": "",
|
||||||
|
"timestampMSecsSinceEpoch": -1
|
||||||
|
},
|
||||||
|
"dbKey": 3221,
|
||||||
|
"designator": "DLH",
|
||||||
|
"isMilitary": false,
|
||||||
|
"isOperating": true,
|
||||||
|
"isVa": false,
|
||||||
|
"name": "Lufthansa",
|
||||||
|
"telephonyDesignator": "LUFTHANSA",
|
||||||
|
"timestampMSecsSinceEpoch": 1454179410000
|
||||||
|
},
|
||||||
|
"colorFuselage": {
|
||||||
|
"b": 255,
|
||||||
|
"g": 255,
|
||||||
|
"r": 255
|
||||||
|
},
|
||||||
|
"colorTail": {
|
||||||
|
"b": 102,
|
||||||
|
"g": 0,
|
||||||
|
"r": 1
|
||||||
|
},
|
||||||
|
"combinedCode": "DLH.STAR",
|
||||||
|
"dbKey": 7097,
|
||||||
|
"description": "LufthansaStarAlliance",
|
||||||
|
"military": false,
|
||||||
|
"timestampMSecsSinceEpoch": 1481304168000
|
||||||
|
}
|
||||||
59
resources/share/test/DBModelFSXA2ACessnaC172.json
Normal file
59
resources/share/test/DBModelFSXA2ACessnaC172.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"mod_id": 8227,
|
||||||
|
"mod_modelstring": "C172R N990CP",
|
||||||
|
"mod_name": null,
|
||||||
|
"mod_description": "A2A Cessna C172R Skyhawk",
|
||||||
|
"mod_simfsx": "Y",
|
||||||
|
"mod_simp3d": "N",
|
||||||
|
"mod_simfs9": "N",
|
||||||
|
"mod_simxplane": "N",
|
||||||
|
"mod_enabled": "Y",
|
||||||
|
"mod_mode": "I",
|
||||||
|
"mod_created": "2016-09-02 22:13:28",
|
||||||
|
"mod_lastupdated": "2016-09-02 22:13:28",
|
||||||
|
"ac_id": 2279,
|
||||||
|
"ac_designator": "C172",
|
||||||
|
"ac_family": null,
|
||||||
|
"ac_manufacturer": "CESSNA",
|
||||||
|
"ac_model": "172 Skyhawk",
|
||||||
|
"ac_rank": 1,
|
||||||
|
"ac_type": "L",
|
||||||
|
"ac_engine": "P",
|
||||||
|
"ac_enginecount": 1,
|
||||||
|
"ac_wtc": "L",
|
||||||
|
"ac_realworld": "Y",
|
||||||
|
"ac_legacy": "N",
|
||||||
|
"ac_military": "N",
|
||||||
|
"ac_created": "2013-07-31 11:38:42",
|
||||||
|
"ac_lastupdated": "2016-10-11 00:01:29",
|
||||||
|
"dist_id": "A2A",
|
||||||
|
"dist_description": "A2A Simulations",
|
||||||
|
"dist_alias1": "ACCUSIM",
|
||||||
|
"dist_alias2": null,
|
||||||
|
"dist_simfsx": "Y",
|
||||||
|
"dist_simp3d": "N",
|
||||||
|
"dist_simfs9": "N",
|
||||||
|
"dist_simxplane": "N",
|
||||||
|
"dist_created": "2016-08-26 15:26:10",
|
||||||
|
"dist_lastupdated": "2016-08-26 15:26:10",
|
||||||
|
"liv_id": 7076,
|
||||||
|
"liv_idairlineicao": null,
|
||||||
|
"liv_combinedcode": "_CC_NOCOLOR",
|
||||||
|
"liv_description": "Temp: No color, no airline",
|
||||||
|
"liv_colorfuselage": null,
|
||||||
|
"liv_colortail": null,
|
||||||
|
"liv_military": "N",
|
||||||
|
"liv_created": "2016-01-30 17:43:15",
|
||||||
|
"liv_lastupdated": "2016-01-30 17:43:15",
|
||||||
|
"al_id": null,
|
||||||
|
"al_designator": null,
|
||||||
|
"al_callsign": null,
|
||||||
|
"al_name": null,
|
||||||
|
"al_country": null,
|
||||||
|
"al_countryname": null,
|
||||||
|
"al_va": null,
|
||||||
|
"al_military": null,
|
||||||
|
"al_operating": null,
|
||||||
|
"al_created": null,
|
||||||
|
"al_lastupdated": null
|
||||||
|
}
|
||||||
59
resources/share/test/DBModelFSXAerosoftA320.json
Normal file
59
resources/share/test/DBModelFSXAerosoftA320.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"mod_id": 6651,
|
||||||
|
"mod_modelstring": "AIRBUSA321LUFTHANSAD-AISH",
|
||||||
|
"mod_name": "A321",
|
||||||
|
"mod_description": "AirbusA321-231IAE",
|
||||||
|
"mod_simfsx": "Y",
|
||||||
|
"mod_simp3d": "N",
|
||||||
|
"mod_simfs9": "N",
|
||||||
|
"mod_simxplane": "N",
|
||||||
|
"mod_enabled": "Y",
|
||||||
|
"mod_mode": "I",
|
||||||
|
"mod_created": "2016-08-1400: 18: 19",
|
||||||
|
"mod_lastupdated": "2016-12-0321: 45: 54",
|
||||||
|
"ac_id": 673,
|
||||||
|
"ac_designator": "A321",
|
||||||
|
"ac_family": "A320",
|
||||||
|
"ac_manufacturer": "AIRBUS",
|
||||||
|
"ac_model": "A-321",
|
||||||
|
"ac_rank": 0,
|
||||||
|
"ac_type": "L",
|
||||||
|
"ac_engine": "J",
|
||||||
|
"ac_enginecount": 2,
|
||||||
|
"ac_wtc": "M",
|
||||||
|
"ac_realworld": "Y",
|
||||||
|
"ac_legacy": "N",
|
||||||
|
"ac_military": "N",
|
||||||
|
"ac_created": "2013-07-3111: 38: 42",
|
||||||
|
"ac_lastupdated": "2016-01-2820: 41: 09",
|
||||||
|
"dist_id": "AEROSOFT",
|
||||||
|
"dist_description": "Aerosoft",
|
||||||
|
"dist_alias1": "AS",
|
||||||
|
"dist_alias2": "AERO",
|
||||||
|
"dist_simfsx": "Y",
|
||||||
|
"dist_simp3d": "N",
|
||||||
|
"dist_simfs9": "N",
|
||||||
|
"dist_simxplane": "N",
|
||||||
|
"dist_created": "2016-01-2320: 22: 06",
|
||||||
|
"dist_lastupdated": "2016-01-2320: 22: 06",
|
||||||
|
"liv_id": 1928,
|
||||||
|
"liv_idairlineicao": 3221,
|
||||||
|
"liv_combinedcode": "DLH._STD",
|
||||||
|
"liv_description": "StandardLufthansa",
|
||||||
|
"liv_colorfuselage": "FFFFFF",
|
||||||
|
"liv_colortail": "010066",
|
||||||
|
"liv_military": "N",
|
||||||
|
"liv_created": "2015-08-2100: 39: 49",
|
||||||
|
"liv_lastupdated": "2015-08-3119: 00: 16",
|
||||||
|
"al_id": 3221,
|
||||||
|
"al_designator": "DLH",
|
||||||
|
"al_callsign": "LUFTHANSA",
|
||||||
|
"al_name": "Lufthansa",
|
||||||
|
"al_country": "DE",
|
||||||
|
"al_countryname": "Germany",
|
||||||
|
"al_va": "N",
|
||||||
|
"al_military": "N",
|
||||||
|
"al_operating": "Y",
|
||||||
|
"al_created": "2013-07-2923: 59: 43",
|
||||||
|
"al_lastupdated": "2016-01-3018: 43: 30"
|
||||||
|
}
|
||||||
@@ -264,6 +264,21 @@ namespace BlackConfig
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getTestFilesDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CBuildConfig::getSwiftResourceDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "test"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CBuildConfig::getTestFilesDir()
|
||||||
|
{
|
||||||
|
static QString s(getTestFilesDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CBuildConfig::getHtmlTemplateFileName()
|
const QString &CBuildConfig::getHtmlTemplateFileName()
|
||||||
{
|
{
|
||||||
static const QString s(getHtmlDir() + QDir::separator() + "swifttemplate.html");
|
static const QString s(getHtmlDir() + QDir::separator() + "swifttemplate.html");
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ namespace BlackConfig
|
|||||||
//! Where HTML files are located
|
//! Where HTML files are located
|
||||||
static const QString &getHtmlDir();
|
static const QString &getHtmlDir();
|
||||||
|
|
||||||
|
//! Where test files are located
|
||||||
|
static const QString &getTestFilesDir();
|
||||||
|
|
||||||
//! Where HTML files are located
|
//! Where HTML files are located
|
||||||
static const QString &getHtmlTemplateFileName();
|
static const QString &getHtmlTemplateFileName();
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "testdata.h"
|
#include "testdata.h"
|
||||||
|
#include "blackconfig/buildconfig.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
#include "blackmisc/aviation/atcstationlist.h"
|
#include "blackmisc/aviation/atcstationlist.h"
|
||||||
#include "blackmisc/aviation/flightplan.h"
|
#include "blackmisc/aviation/flightplan.h"
|
||||||
#include "blackmisc/network/userlist.h"
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "blackmisc/network/server.h"
|
#include "blackmisc/network/server.h"
|
||||||
|
#include "blackmisc/fileutils.h"
|
||||||
#include "blackmisc/variantlist.h"
|
#include "blackmisc/variantlist.h"
|
||||||
|
|
||||||
|
using namespace BlackConfig;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
@@ -237,21 +240,23 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoB737()
|
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoB737()
|
||||||
{
|
{
|
||||||
static const QString json = "{\"combinedType\": \"L2J\", \"dbKey\": 1777, \"designator\": \"B739\", \"family\": \"B737\", \"iataCode\": \"739\", \"legacy\": false, \"manufacturer\": \"BOEING\", \"military\": false, \"modelDescription\": \"737-900 BBJ3\", \"rank\": 10, \"realWorld\": true, \"timestampMSecsSinceEpoch\": 1454013308000, \"wtc\": \"M\" }";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAircraftIcaoB737Boeing.json");
|
||||||
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
||||||
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoC172()
|
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoC172()
|
||||||
{
|
{
|
||||||
static const QString json = "{ \"combinedType\": \"L1P\", \"dbKey\": 2279, \"designator\": \"C172\", \"family\": \"\", \"iataCode\": \"CN1\", \"legacy\": false, \"manufacturer\": \"CESSNA\", \"military\": false, \"modelDescription\": \"172 Skyhawk\", \"rank\": 1, \"realWorld\": true, \"timestampMSecsSinceEpoch\": 1476144089000, \"wtc\": \"L\" }";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAircraftIcaoC172Cessna.json");
|
||||||
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
||||||
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoDLH()
|
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoDLH()
|
||||||
{
|
{
|
||||||
static const QString json = "{ \"country\": { \"alias1\": \"\", \"alias2\": \"\", \"dbKey\": \"DE\", \"historic\": false, \"iso3\": \"\", \"loadedFromDb\": false, \"name\": \"Germany\", \"simplifiedName\": \"\", \"timestampMSecsSinceEpoch\": -1 }, \"dbKey\": 3221, \"designator\": \"DLH\", \"isMilitary\": false, \"isOperating\": true, \"isVa\": false, \"name\": \"Lufthansa\", \"telephonyDesignator\": \"LUFTHANSA\", \"timestampMSecsSinceEpoch\": 1454179410000 }";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAirlineIcaoDLH.json");
|
||||||
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
@@ -259,15 +264,15 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoBAW()
|
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoBAW()
|
||||||
{
|
{
|
||||||
static const QString json = "{ \"country\": { \"alias1\": \"\", \"alias2\": \"\", \"dbKey\": \"GB\", \"historic\": false, \"iso3\": \"\", \"loadedFromDb\": false, \"name\": \"United Kingdom\", \"simplifiedName\": \"\", \"timestampMSecsSinceEpoch\": -1 }, \"dbKey\": 1299, \"designator\": \"BAW\", \"isMilitary\": false, \"isOperating\": true, \"isVa\": false, \"name\": \"British Airways\", \"telephonyDesignator\": \"SPEEDBIRD\", \"timestampMSecsSinceEpoch\": 1433786773000 }";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAirlineIcaoBAW.json");
|
||||||
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLivery &CTestData::getDbLiveryDLH()
|
const CLivery &CTestData::getDbLiveryDLHStarAlliance()
|
||||||
{
|
{
|
||||||
static const QString json = "{ \"airline\": { \"country\": { \"alias1\": \"\", \"alias2\": \"\", \"dbKey\": \"DE\", \"historic\": false, \"iso3\": \"\", \"loadedFromDb\": false, \"name\": \"Germany\", \"simplifiedName\": \"\", \"timestampMSecsSinceEpoch\": -1 }, \"dbKey\": 3221, \"designator\": \"DLH\", \"isMilitary\": false, \"isOperating\": true, \"isVa\": false, \"name\": \"Lufthansa\", \"telephonyDesignator\": \"LUFTHANSA\", \"timestampMSecsSinceEpoch\": 1454179410000 }, \"colorFuselage\": { \"b\": 255, \"g\": 255, \"r\": 255 }, \"colorTail\": { \"b\": 102, \"g\": 0, \"r\": 1 }, \"combinedCode\": \"DLH.STAR\", \"dbKey\": 7097, \"description\": \"Lufthansa Star Alliance\", \"military\": false, \"timestampMSecsSinceEpoch\": 1481304168000 }";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBLiveryDLHStarAlliance.json");
|
||||||
static const CLivery livery(CLivery::fromJson(json));
|
static const CLivery livery(CLivery::fromJson(json));
|
||||||
Q_ASSERT(livery.hasValidDbKey());
|
Q_ASSERT(livery.hasValidDbKey());
|
||||||
return livery;
|
return livery;
|
||||||
@@ -275,17 +280,19 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftModel &CTestData::getDbAircraftModelFsxA2AC172Skyhawk()
|
const CAircraftModel &CTestData::getDbAircraftModelFsxA2AC172Skyhawk()
|
||||||
{
|
{
|
||||||
static const QString json = "{\"mod_id\": 8227, \"mod_modelstring\": \"C172R N990CP\", \"mod_name\": null, \"mod_description\": \"A2A Cessna C172R Skyhawk\", \"mod_simfsx\": \"Y\", \"mod_simp3d\": \"N\", \"mod_simfs9\": \"N\", \"mod_simxplane\": \"N\", \"mod_enabled\": \"Y\", \"mod_mode\": \"I\", \"mod_created\": \"2016-09-02 22:13:28\", \"mod_lastupdated\": \"2016-09-02 22:13:28\", \"ac_id\": 2279, \"ac_designator\": \"C172\", \"ac_family\": null, \"ac_manufacturer\": \"CESSNA\", \"ac_model\": \"172 Skyhawk\", \"ac_rank\": 1, \"ac_type\": \"L\", \"ac_engine\": \"P\", \"ac_enginecount\": 1, \"ac_wtc\": \"L\", \"ac_realworld\": \"Y\", \"ac_legacy\": \"N\", \"ac_military\": \"N\", \"ac_created\": \"2013-07-31 11:38:42\", \"ac_lastupdated\": \"2016-10-11 00:01:29\", \"dist_id\": \"A2A\", \"dist_description\": \"A2A Simulations\", \"dist_alias1\": \"ACCUSIM\", \"dist_alias2\": null, \"dist_simfsx\": \"Y\", \"dist_simp3d\": \"N\", \"dist_simfs9\": \"N\", \"dist_simxplane\": \"N\", \"dist_created\": \"2016-08-26 15:26:10\", \"dist_lastupdated\": \"2016-08-26 15:26:10\", \"liv_id\": 7076, \"liv_idairlineicao\": null, \"liv_combinedcode\": \"_CC_NOCOLOR\", \"liv_description\": \"Temp: No color, no airline\", \"liv_colorfuselage\": null, \"liv_colortail\": null, \"liv_military\": \"N\", \"liv_created\": \"2016-01-30 17:43:15\", \"liv_lastupdated\": \"2016-01-30 17:43:15\", \"al_id\": null, \"al_designator\": null, \"al_callsign\": null, \"al_name\": null, \"al_country\": null, \"al_countryname\": null, \"al_va\": null, \"al_military\": null, \"al_operating\": null, \"al_created\": null, \"al_lastupdated\": null}";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBModelFSXA2ACessnaC172.json");
|
||||||
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
||||||
Q_ASSERT(model.hasValidDbKey());
|
Q_ASSERT(model.hasValidDbKey());
|
||||||
|
Q_ASSERT(!model.getModelString().isEmpty());
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CAircraftModel &CTestData::getDbAircraftModelFsxAerosoftA320()
|
const CAircraftModel &CTestData::getDbAircraftModelFsxAerosoftA320()
|
||||||
{
|
{
|
||||||
static const QString json = "{\"mod_id\": 6651, \"mod_modelstring\": \"AIRBUS A321 LUFTHANSA D-AISH\", \"mod_name\": \"A321\", \"mod_description\": \"Airbus A321-231 IAE\", \"mod_simfsx\": \"Y\", \"mod_simp3d\": \"N\", \"mod_simfs9\": \"N\", \"mod_simxplane\": \"N\", \"mod_enabled\": \"Y\", \"mod_mode\": \"I\", \"mod_created\": \"2016-08-14 00:18:19\", \"mod_lastupdated\": \"2016-12-03 21:45:54\", \"ac_id\": 673, \"ac_designator\": \"A321\", \"ac_family\": \"A320\", \"ac_manufacturer\": \"AIRBUS\", \"ac_model\": \"A-321\", \"ac_rank\": 0, \"ac_type\": \"L\", \"ac_engine\": \"J\", \"ac_enginecount\": 2, \"ac_wtc\": \"M\", \"ac_realworld\": \"Y\", \"ac_legacy\": \"N\", \"ac_military\": \"N\", \"ac_created\": \"2013-07-31 11:38:42\", \"ac_lastupdated\": \"2016-01-28 20:41:09\", \"dist_id\": \"AEROSOFT\", \"dist_description\": \"Aerosoft\", \"dist_alias1\": \"AS\", \"dist_alias2\": \"AERO\", \"dist_simfsx\": \"Y\", \"dist_simp3d\": \"N\", \"dist_simfs9\": \"N\", \"dist_simxplane\": \"N\", \"dist_created\": \"2016-01-23 20:22:06\", \"dist_lastupdated\": \"2016-01-23 20:22:06\", \"liv_id\": 1928, \"liv_idairlineicao\": 3221, \"liv_combinedcode\": \"DLH._STD\", \"liv_description\": \"Standard Lufthansa\", \"liv_colorfuselage\": \"FFFFFF\", \"liv_colortail\": \"010066\", \"liv_military\": \"N\", \"liv_created\": \"2015-08-21 00:39:49\", \"liv_lastupdated\": \"2015-08-31 19:00:16\", \"al_id\": 3221, \"al_designator\": \"DLH\", \"al_callsign\": \"LUFTHANSA\", \"al_name\": \"Lufthansa\", \"al_country\": \"DE\", \"al_countryname\": \"Germany\", \"al_va\": \"N\", \"al_military\": \"N\", \"al_operating\": \"Y\", \"al_created\": \"2013-07-29 23:59:43\", \"al_lastupdated\": \"2016-01-30 18:43:30\"}";
|
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBModelFSXAerosoftA320.json");
|
||||||
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
||||||
Q_ASSERT(model.hasValidDbKey());
|
Q_ASSERT(model.hasValidDbKey());
|
||||||
|
Q_ASSERT(!model.getModelString().isEmpty());
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace BlackMisc
|
|||||||
static const BlackMisc::Aviation::CAirlineIcaoCode &getDbAirlineIcaoBAW();
|
static const BlackMisc::Aviation::CAirlineIcaoCode &getDbAirlineIcaoBAW();
|
||||||
|
|
||||||
//! Aircraft model
|
//! Aircraft model
|
||||||
static const BlackMisc::Aviation::CLivery &getDbLiveryDLH();
|
static const BlackMisc::Aviation::CLivery &getDbLiveryDLHStarAlliance();
|
||||||
|
|
||||||
//! FSX aircraft model, a C172 Skyhawk
|
//! FSX aircraft model, a C172 Skyhawk
|
||||||
static const BlackMisc::Simulation::CAircraftModel &getDbAircraftModelFsxA2AC172Skyhawk();
|
static const BlackMisc::Simulation::CAircraftModel &getDbAircraftModelFsxA2AC172Skyhawk();
|
||||||
|
|||||||
15
src/blackmisc/test/testdata/DBAircraftIcaoC172.json
vendored
Normal file
15
src/blackmisc/test/testdata/DBAircraftIcaoC172.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"combinedType": "L1P",
|
||||||
|
"dbKey": 2279,
|
||||||
|
"designator": "C172",
|
||||||
|
"family": "",
|
||||||
|
"iataCode": "CN1",
|
||||||
|
"legacy": false,
|
||||||
|
"manufacturer": "CESSNA","
|
||||||
|
"military": false,
|
||||||
|
"modelDescription": "172 Skyhawk",
|
||||||
|
"rank": 1,
|
||||||
|
"realWorld": true,
|
||||||
|
"timestampMSecsSinceEpoch": 1476144089000,
|
||||||
|
"wtc": "L"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user