mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #212, adjusted samples
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include "blackmisc/avionavsystem.h"
|
||||
#include "blackmisc/aviotransponder.h"
|
||||
#include "blackmisc/avatcstationlist.h"
|
||||
#include "blackmisc/avflightplan.h"
|
||||
#include "blackmisc/avaircrafticao.h"
|
||||
#include "blackmisc/avairporticao.h"
|
||||
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@@ -38,17 +42,6 @@ namespace BlackMiscTest
|
||||
qDebug() << c1;
|
||||
c1.setActiveUnicom();
|
||||
qDebug() << c1;
|
||||
try
|
||||
{
|
||||
// uncomment to test assert
|
||||
// CFrequency f1(-1.0, CFrequencyUnit::MHz());
|
||||
// c1 = CComSystem("ups", f1, f1);
|
||||
// qDebug() << "Why do I get here??";
|
||||
}
|
||||
catch (std::range_error &ex)
|
||||
{
|
||||
qDebug() << "As expected" << ex.what();
|
||||
}
|
||||
|
||||
// NAV system
|
||||
CNavSystem nav1;
|
||||
@@ -92,9 +85,18 @@ namespace BlackMiscTest
|
||||
atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz()));
|
||||
atcList = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName);
|
||||
qDebug() << atcList;
|
||||
|
||||
qDebug() << "-----------------------------------------------";
|
||||
|
||||
// flight plan
|
||||
CAltitude alt("FL110");
|
||||
CAltitude altMsl(alt);
|
||||
altMsl.toMeanSeaLevel();
|
||||
|
||||
qDebug() << alt << altMsl;
|
||||
CAirportIcao frankfurt("eddf");
|
||||
qDebug() << frankfurt;
|
||||
qDebug() << "-----------------------------------------------";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -6,19 +6,16 @@
|
||||
#ifndef BLACKMISCTEST_SAMPLESAVIATION_H
|
||||
#define BLACKMISCTEST_SAMPLESAVIATION_H
|
||||
|
||||
namespace BlackMiscTest {
|
||||
|
||||
/*!
|
||||
* \brief Samples for physical quantities
|
||||
*/
|
||||
class CSamplesAviation
|
||||
namespace BlackMiscTest
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Run the samples
|
||||
*/
|
||||
static int samples();
|
||||
};
|
||||
|
||||
//! Samples for aviation
|
||||
class CSamplesAviation
|
||||
{
|
||||
public:
|
||||
//! Run the samples
|
||||
static int samples();
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace BlackMiscTest
|
||||
*/
|
||||
int CSamplesPhysicalQuantities::samples()
|
||||
{
|
||||
QVariant parsedPq = CPqString::parse("100 km/h");
|
||||
parsedPq = CPqString::parse("-33ft");
|
||||
parsedPq = CPqString::parse("666");
|
||||
QVariant parsedPq = CPqString::parseToVariant("100 km/h");
|
||||
parsedPq = CPqString::parseToVariant("-33ft");
|
||||
parsedPq = CPqString::parseToVariant("666");
|
||||
CSpeed speedParsed = CPqString::parse<CSpeed>("111.33ft/s");
|
||||
CFrequency frequencyParsed = CPqString::parse<CFrequency>("122.8MHz");
|
||||
qDebug() << "parsed" << speedParsed << speedParsed.valueRoundedWithUnit(2, true) << frequencyParsed << frequencyParsed.valueRoundedWithUnit(2, true);
|
||||
|
||||
Reference in New Issue
Block a user