refs #212, adjusted samples

This commit is contained in:
Klaus Basan
2014-04-26 16:09:34 +02:00
parent 03580b9cdc
commit ff662f21ad
3 changed files with 27 additions and 28 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);