mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 09:45:44 +08:00
refs #875, adjusted using classes to use new namespaces
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ed820da20d
commit
7917769802
@@ -25,8 +25,8 @@
|
|||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
#include "blackmisc/pq/units.h"
|
#include "blackmisc/pq/units.h"
|
||||||
#include "blackmisc/simulation/distributorlist.h"
|
#include "blackmisc/simulation/distributorlist.h"
|
||||||
|
#include "blackmisc/test/testing.h"
|
||||||
#include "blackmisc/stringutils.h"
|
#include "blackmisc/stringutils.h"
|
||||||
#include "blackmisc/testing.h"
|
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
@@ -49,6 +49,7 @@ using namespace BlackMisc::Aviation;
|
|||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
using namespace BlackMisc::Simulation;
|
using namespace BlackMisc::Simulation;
|
||||||
|
using namespace BlackMisc::Test;
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
using namespace BlackCore::Db;
|
using namespace BlackCore::Db;
|
||||||
|
|
||||||
@@ -58,27 +59,27 @@ namespace BlackSample
|
|||||||
{
|
{
|
||||||
QTime timer;
|
QTime timer;
|
||||||
int ms, number;
|
int ms, number;
|
||||||
BlackMisc::Aviation::CTesting::copy10kStations(1); // init
|
CTesting::copy10kStations(1); // init
|
||||||
|
|
||||||
// ATC stations, tradionally created
|
// ATC stations, tradionally created
|
||||||
timer.start();
|
timer.start();
|
||||||
CAtcStationList atcs1 = BlackMisc::Aviation::CTesting::createAtcStations(10000);
|
CAtcStationList atcs1 = CTesting::createAtcStations(10000);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "created (copy) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "created (copy) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
CAtcStationList atcs2 = BlackMisc::Aviation::CTesting::createAtcStations(100000);
|
CAtcStationList atcs2 = CTesting::createAtcStations(100000);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "created (copy) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "created (copy) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
// ATC stations, property index created
|
// ATC stations, property index created
|
||||||
timer.start();
|
timer.start();
|
||||||
CAtcStationList atcs3 = BlackMisc::Aviation::CTesting::createAtcStations(10000, true);
|
CAtcStationList atcs3 = CTesting::createAtcStations(10000, true);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "created (propertyIndex) " << atcs3.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "created (propertyIndex) " << atcs3.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
CAtcStationList atcs4 = BlackMisc::Aviation::CTesting::createAtcStations(100000, true);
|
CAtcStationList atcs4 = CTesting::createAtcStations(100000, true);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "created (propertyIndex) " << atcs4.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "created (propertyIndex) " << atcs4.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
@@ -95,55 +96,55 @@ namespace BlackSample
|
|||||||
|
|
||||||
// Read data, this is what all our models do when displaying in a table view
|
// Read data, this is what all our models do when displaying in a table view
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::readStations(atcs1, false);
|
CTesting::readStations(atcs1, false);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Read (getters) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "Read (getters) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::readStations(atcs2, false);
|
CTesting::readStations(atcs2, false);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Read (getters) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "Read (getters) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::readStations(atcs1, true);
|
CTesting::readStations(atcs1, true);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Read (propertyIndex) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "Read (propertyIndex) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::readStations(atcs2, true);
|
CTesting::readStations(atcs2, true);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Read (propertyIndex) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
out << "Read (propertyIndex) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl;
|
||||||
|
|
||||||
// calculate
|
// calculate
|
||||||
number = 10000;
|
number = 10000;
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::calculateDistance(number);
|
CTesting::calculateDistance(number);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Calculated distances " << number << " in " << ms << "ms" << endl;
|
out << "Calculated distances " << number << " in " << ms << "ms" << endl;
|
||||||
|
|
||||||
number = 100000;
|
number = 100000;
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::calculateDistance(number);
|
CTesting::calculateDistance(number);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Calculated distances " << number << "in " << ms << "ms" << endl;
|
out << "Calculated distances " << number << "in " << ms << "ms" << endl;
|
||||||
|
|
||||||
// parse
|
// parse
|
||||||
number = 100000;
|
number = 100000;
|
||||||
timer.start();
|
timer.start();
|
||||||
BlackMisc::Aviation::CTesting::parseWgs(number);
|
CTesting::parseWgs(number);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Parse WGS coordinates " << number << " in " << ms << "ms" << endl;
|
out << "Parse WGS coordinates " << number << " in " << ms << "ms" << endl;
|
||||||
|
|
||||||
// copy
|
// copy
|
||||||
timer.start();
|
timer.start();
|
||||||
number = 20;
|
number = 20;
|
||||||
BlackMisc::Aviation::CTesting::copy10kStations(number);
|
CTesting::copy10kStations(number);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl;
|
out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
number = 100;
|
number = 100;
|
||||||
BlackMisc::Aviation::CTesting::copy10kStations(number);
|
CTesting::copy10kStations(number);
|
||||||
ms = timer.elapsed();
|
ms = timer.elapsed();
|
||||||
out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl;
|
out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "blackmisc/dbusserver.h"
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/registermetadata.h"
|
#include "blackmisc/registermetadata.h"
|
||||||
#include "blackmisc/network/networkutils.h"
|
#include "blackmisc/network/networkutils.h"
|
||||||
#include "blackcore/test/testutils.h"
|
#include "blackmisc/test/testutils.h"
|
||||||
#include "servicetool.h"
|
#include "servicetool.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
if (mode.startsWith("2"))
|
if (mode.startsWith("2"))
|
||||||
{
|
{
|
||||||
out << "---------------------------------" << endl;
|
out << "---------------------------------" << endl;
|
||||||
BlackCore::Test::CTestUtils::showDBusSignatures(out);
|
BlackMisc::Test::CTestUtils::showDBusSignatures(out);
|
||||||
out << "---------------------------------" << endl;
|
out << "---------------------------------" << endl;
|
||||||
goto Menu;
|
goto Menu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
#include "servicetool.h"
|
#include "servicetool.h"
|
||||||
#include "blackcore/application.h"
|
#include "blackcore/application.h"
|
||||||
#include "blackcore/test/testservice.h"
|
#include "blackmisc/test/testservice.h"
|
||||||
#include "blackcore/test/testserviceinterface.h"
|
#include "blackmisc/test/testserviceinterface.h"
|
||||||
#include "blackcore/test/testutils.h"
|
#include "blackmisc/test/testutils.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/network/server.h"
|
#include "blackmisc/network/server.h"
|
||||||
|
|
||||||
@@ -51,8 +51,8 @@ using namespace BlackMisc::Math;
|
|||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackMisc::Simulation::FsCommon;
|
using namespace BlackMisc::Simulation::FsCommon;
|
||||||
|
using namespace BlackMisc::Test;
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
using namespace BlackCore::Test;
|
|
||||||
|
|
||||||
namespace BlackSample
|
namespace BlackSample
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "blackmisc/network/user.h"
|
#include "blackmisc/network/user.h"
|
||||||
#include "blackmisc/network/voicecapabilities.h"
|
#include "blackmisc/network/voicecapabilities.h"
|
||||||
#include "blackmisc/pq/units.h"
|
#include "blackmisc/pq/units.h"
|
||||||
|
#include "blackmisc/test/testing.h"
|
||||||
#include "blackmisc/compare.h"
|
#include "blackmisc/compare.h"
|
||||||
#include "blackmisc/iterator.h"
|
#include "blackmisc/iterator.h"
|
||||||
#include "blackmisc/json.h"
|
#include "blackmisc/json.h"
|
||||||
@@ -35,7 +36,6 @@
|
|||||||
#include "blackmisc/sequence.h"
|
#include "blackmisc/sequence.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/testing.h"
|
|
||||||
#include "blackmisc/threadutils.h"
|
#include "blackmisc/threadutils.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
#include "blackmisc/verify.h"
|
#include "blackmisc/verify.h"
|
||||||
@@ -54,8 +54,9 @@
|
|||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Audio;
|
using namespace BlackMisc::Audio;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Simulation;
|
|
||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
|
using namespace BlackMisc::Simulation;
|
||||||
|
using namespace BlackMisc::Test;
|
||||||
using namespace BlackMisc::Json;
|
using namespace BlackMisc::Json;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
@@ -481,7 +482,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
if (number < 1) { return; }
|
if (number < 1) { return; }
|
||||||
this->m_atcStationsOnline.push_back(
|
this->m_atcStationsOnline.push_back(
|
||||||
BlackMisc::Aviation::CTesting::createAtcStations(number)
|
CTesting::createAtcStations(number)
|
||||||
);
|
);
|
||||||
emit this->changedAtcStationsOnline();
|
emit this->changedAtcStationsOnline();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user