mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Replace deprecated endl with Qt::endl
This commit is contained in:
committed by
Mat Sutcliffe
parent
1e633a5704
commit
9fa3221abc
@@ -105,31 +105,31 @@ namespace BlackSample
|
||||
|
||||
// We send this as a non-replying message. This is used for sending errors, replys, signals.
|
||||
// Values can be seen on the receiver side
|
||||
qtout << "----------------- receiver tests ----------------" << endl;
|
||||
qtout << "----------------- receiver tests ----------------" << Qt::endl;
|
||||
|
||||
// Low level test
|
||||
if (connection.send(m)) { qtout << "Send via low level method " << endl; }
|
||||
if (connection.send(m)) { qtout << "Send via low level method " << Qt::endl; }
|
||||
|
||||
// same as interface message
|
||||
// but call the slot
|
||||
testServiceInterface.receiveStringMessage(msg);
|
||||
qtout << "Send string via interface " << msg << endl;
|
||||
qtout << "Send string via interface " << msg << Qt::endl;
|
||||
|
||||
// a list
|
||||
testServiceInterface.receiveList(list);
|
||||
qtout << "Send list via interface " << list.size() << endl;
|
||||
qtout << "Send list via interface " << list.size() << Qt::endl;
|
||||
|
||||
// PQs
|
||||
CSpeed speed(200, CSpeedUnit::km_h());
|
||||
const CSpeed speedNull(0, nullptr);
|
||||
|
||||
testServiceInterface.receiveSpeed(speed);
|
||||
qtout << "Send speed via interface " << speed << endl;
|
||||
qtout << "Send speed via interface " << speed << Qt::endl;
|
||||
testServiceInterface.receiveSpeed(speedNull);
|
||||
qtout << "Send null speed via interface " << speedNull << endl;
|
||||
qtout << "Send null speed via interface " << speedNull << Qt::endl;
|
||||
speed.switchUnit(CSpeedUnit::kts());
|
||||
testServiceInterface.receiveSpeed(speed);
|
||||
qtout << "Send speed via interface " << speed << endl;
|
||||
qtout << "Send speed via interface " << speed << Qt::endl;
|
||||
speed.switchUnit(CSpeedUnit::km_h());
|
||||
speed.addValueSameUnit(1.0);
|
||||
|
||||
@@ -138,68 +138,68 @@ namespace BlackSample
|
||||
QVariant tsqv = QVariant::fromValue(trafficServer);
|
||||
QDBusVariant tsv(tsqv);
|
||||
testServiceInterface.receiveVariant(tsv, tsqv.userType());
|
||||
qtout << "Send server via interface and variant '" << trafficServer << QLatin1String("' ") << tsqv.userType() << endl;
|
||||
qtout << "Send server via interface and variant '" << trafficServer << QLatin1String("' ") << tsqv.userType() << Qt::endl;
|
||||
|
||||
// Aviation
|
||||
const CComSystem comSystem = CComSystem("DBUS COM1", CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress(), CPhysicalQuantitiesConstants::FrequencyUnicom());
|
||||
testServiceInterface.receiveComUnit(comSystem);
|
||||
qtout << "Send COM via interface " << comSystem << endl;
|
||||
qtout << "Send COM via interface " << comSystem << Qt::endl;
|
||||
|
||||
CAltitude altitude(1000, CAltitude::MeanSeaLevel, CLengthUnit::ft());
|
||||
QVariant qvAl = QVariant::fromValue(altitude);
|
||||
QDBusVariant qv(qvAl);
|
||||
testServiceInterface.receiveVariant(qv, qvAl.userType());
|
||||
testServiceInterface.receiveAltitude(altitude);
|
||||
qtout << "Send altitude via interface and variant " << altitude << qvAl.userType() << endl;
|
||||
qtout << "Send altitude via interface and variant " << altitude << qvAl.userType() << Qt::endl;
|
||||
altitude.addValueSameUnit(1);
|
||||
|
||||
const CTransponder transponder(7000, CTransponder::ModeC);
|
||||
testServiceInterface.receiveTransponder(transponder);
|
||||
qtout << "Send transponder via interface " << transponder << endl;
|
||||
qtout << "Send transponder via interface " << transponder << Qt::endl;
|
||||
|
||||
const CTrack track(123.45, CTrack::Magnetic, CAngleUnit::deg());
|
||||
testServiceInterface.receiveTrack(track);
|
||||
qtout << "Send track via interface " << track << endl;
|
||||
qtout << "Send track via interface " << track << Qt::endl;
|
||||
|
||||
const CLength len(33, CLengthUnit::m());
|
||||
testServiceInterface.receiveLength(len);
|
||||
qtout << "Send length via interface " << len << endl;
|
||||
qtout << "Send length via interface " << len << Qt::endl;
|
||||
|
||||
const CAltitude alt(44, CAltitude::MeanSeaLevel, CLengthUnit::m());
|
||||
testServiceInterface.receiveLength(alt);
|
||||
qtout << "Send altitude via interface " << alt << endl;
|
||||
qtout << "Send altitude via interface " << alt << Qt::endl;
|
||||
|
||||
const CCallsign callsign = CTestData::getRandomPilotCallsign();
|
||||
testServiceInterface.receiveCallsign(callsign);
|
||||
qtout << "Send callsign via interface " << callsign << endl;
|
||||
qtout << "Send callsign via interface " << callsign << Qt::endl;
|
||||
|
||||
const CAtcStation station = CTestData::getMunichTower();
|
||||
testServiceInterface.receiveAtcStation(station);
|
||||
qtout << "Send ATC " << station << endl;
|
||||
qtout << "Send ATC " << station << Qt::endl;
|
||||
|
||||
// Geo
|
||||
const CCoordinateGeodetic geoPos = CTestData::getCoordinateFrankfurtTower();
|
||||
testServiceInterface.receiveGeoPosition(geoPos);
|
||||
qtout << "Send geo position " << geoPos << endl;
|
||||
qtout << "Send geo position " << geoPos << Qt::endl;
|
||||
CApplication::processEventsFor(1000);
|
||||
|
||||
qtout << "----------------- variant tests ----------------" << endl;
|
||||
qtout << "----------------- variant tests ----------------" << Qt::endl;
|
||||
const CVariantList cvList = CTestData::getCVariantList();
|
||||
testServiceInterface.receiveVariantList(cvList);
|
||||
qtout << "Send " << cvList.size() << " variants via interface as CVariantList" << endl;
|
||||
qtout << "Send " << cvList.size() << " variants via interface as CVariantList" << Qt::endl;
|
||||
|
||||
const CPropertyIndexVariantMap valueMap = CTestData::getCPropertyIndexVariantMap();
|
||||
testServiceInterface.receiveValueMap(valueMap);
|
||||
qtout << "Send " << valueMap.size() << " index variant map entries" << endl;
|
||||
qtout << "Send " << valueMap.size() << " index variant map entries" << Qt::endl;
|
||||
CApplication::processEventsFor(1000);
|
||||
|
||||
qtout << "----------------- pings ----------------" << endl;
|
||||
qtout << "----------------- pings ----------------" << Qt::endl;
|
||||
const int errors = ITestServiceInterface::pingTests(testServiceInterface, false);
|
||||
qtout << "Ping errors " << errors << endl;
|
||||
qtout << "Ping errors " << errors << Qt::endl;
|
||||
CApplication::processEventsFor(1000);
|
||||
|
||||
// Performance tools
|
||||
qtout << "----------------- performance ----------------" << endl;
|
||||
qtout << "----------------- performance ----------------" << Qt::endl;
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
@@ -226,7 +226,7 @@ namespace BlackSample
|
||||
}
|
||||
qint64 t1000 = timer.elapsed(); // ms
|
||||
timer.invalidate();
|
||||
qtout << "Reading speed objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
qtout << "Reading speed objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl;
|
||||
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
@@ -249,52 +249,52 @@ namespace BlackSample
|
||||
Q_UNUSED(stationDummy);
|
||||
}
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading station objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
qtout << "Reading station objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl;
|
||||
|
||||
timer.restart();
|
||||
CAtcStationList atcStationList = testServiceInterface.getAtcStationList(10);
|
||||
if (atcStationList.size() != 10) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
if (atcStationList.size() != 10) qtout << "wrong list size" << atcStationList.size() << Qt::endl;
|
||||
t10 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
atcStationList = testServiceInterface.getAtcStationList(100);
|
||||
if (atcStationList.size() != 100) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
if (atcStationList.size() != 100) qtout << "wrong list size" << atcStationList.size() << Qt::endl;
|
||||
t100 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
atcStationList = testServiceInterface.getAtcStationList(1000);
|
||||
if (atcStationList.size() != 1000) qtout << "wrong list size" << atcStationList.size() << endl;
|
||||
if (atcStationList.size() != 1000) qtout << "wrong list size" << atcStationList.size() << Qt::endl;
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading station list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
qtout << "Reading station list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl;
|
||||
|
||||
// test reading model entries with a realistic size
|
||||
timer.restart();
|
||||
CAircraftCfgEntriesList entriesList = testServiceInterface.getAircraftCfgEntriesList(5000);
|
||||
if (entriesList.size() != 5000) qtout << "wrong list size" << entriesList.size() << endl;
|
||||
if (entriesList.size() != 5000) qtout << "wrong list size" << entriesList.size() << Qt::endl;
|
||||
qint64 t5000 = timer.elapsed(); // ms
|
||||
qtout << "Reading aircraft cfg entries in ms: " << t5000 << endl;
|
||||
qtout << "Reading aircraft cfg entries in ms: " << t5000 << Qt::endl;
|
||||
|
||||
// object paths
|
||||
timer.restart();
|
||||
QList<QDBusObjectPath> objectPaths = testServiceInterface.getObjectPaths(10);
|
||||
if (objectPaths.size() != 10) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
if (objectPaths.size() != 10) qtout << "wrong list size" << objectPaths.size() << Qt::endl;
|
||||
t10 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
objectPaths = testServiceInterface.getObjectPaths(100);
|
||||
if (objectPaths.size() != 100) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
if (objectPaths.size() != 100) qtout << "wrong list size" << objectPaths.size() << Qt::endl;
|
||||
t100 = timer.elapsed(); // ms
|
||||
timer.restart();
|
||||
objectPaths = testServiceInterface.getObjectPaths(1000);
|
||||
if (objectPaths.size() != 1000) qtout << "wrong list size" << objectPaths.size() << endl;
|
||||
if (objectPaths.size() != 1000) qtout << "wrong list size" << objectPaths.size() << Qt::endl;
|
||||
t1000 = timer.elapsed(); // ms
|
||||
qtout << "Reading paths list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl;
|
||||
qtout << "Reading paths list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl;
|
||||
timer.invalidate();
|
||||
|
||||
// next round?
|
||||
qtout << "---------------------------------------" << endl;
|
||||
qtout << "Key ....... x to exit" << endl;
|
||||
qtout << "---------------------------------------" << Qt::endl;
|
||||
qtout << "Key ....... x to exit" << Qt::endl;
|
||||
QString line = qtin.readLine().toLower().trimmed();
|
||||
if (line.startsWith('x'))
|
||||
{
|
||||
qtout << "Ending!" << endl;
|
||||
qtout << "Ending!" << Qt::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user