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/avionavsystem.h"
#include "blackmisc/aviotransponder.h" #include "blackmisc/aviotransponder.h"
#include "blackmisc/avatcstationlist.h" #include "blackmisc/avatcstationlist.h"
#include "blackmisc/avflightplan.h"
#include "blackmisc/avaircrafticao.h"
#include "blackmisc/avairporticao.h"
#include <QDebug> #include <QDebug>
@@ -38,17 +42,6 @@ namespace BlackMiscTest
qDebug() << c1; qDebug() << c1;
c1.setActiveUnicom(); c1.setActiveUnicom();
qDebug() << c1; 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 // NAV system
CNavSystem nav1; CNavSystem nav1;
@@ -92,9 +85,18 @@ namespace BlackMiscTest
atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz())); atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz()));
atcList = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName); atcList = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName);
qDebug() << atcList; qDebug() << atcList;
qDebug() << "-----------------------------------------------"; qDebug() << "-----------------------------------------------";
// flight plan
CAltitude alt("FL110");
CAltitude altMsl(alt);
altMsl.toMeanSeaLevel();
qDebug() << alt << altMsl;
CAirportIcao frankfurt("eddf");
qDebug() << frankfurt;
qDebug() << "-----------------------------------------------";
return 0; return 0;
} }
} // namespace } // namespace

View File

@@ -6,19 +6,16 @@
#ifndef BLACKMISCTEST_SAMPLESAVIATION_H #ifndef BLACKMISCTEST_SAMPLESAVIATION_H
#define BLACKMISCTEST_SAMPLESAVIATION_H #define BLACKMISCTEST_SAMPLESAVIATION_H
namespace BlackMiscTest { namespace BlackMiscTest
/*!
* \brief Samples for physical quantities
*/
class CSamplesAviation
{ {
public:
/*! //! Samples for aviation
* \brief Run the samples class CSamplesAviation
*/ {
static int samples(); public:
}; //! Run the samples
static int samples();
};
} // namespace } // namespace
#endif #endif

View File

@@ -15,9 +15,9 @@ namespace BlackMiscTest
*/ */
int CSamplesPhysicalQuantities::samples() int CSamplesPhysicalQuantities::samples()
{ {
QVariant parsedPq = CPqString::parse("100 km/h"); QVariant parsedPq = CPqString::parseToVariant("100 km/h");
parsedPq = CPqString::parse("-33ft"); parsedPq = CPqString::parseToVariant("-33ft");
parsedPq = CPqString::parse("666"); parsedPq = CPqString::parseToVariant("666");
CSpeed speedParsed = CPqString::parse<CSpeed>("111.33ft/s"); CSpeed speedParsed = CPqString::parse<CSpeed>("111.33ft/s");
CFrequency frequencyParsed = CPqString::parse<CFrequency>("122.8MHz"); CFrequency frequencyParsed = CPqString::parse<CFrequency>("122.8MHz");
qDebug() << "parsed" << speedParsed << speedParsed.valueRoundedWithUnit(2, true) << frequencyParsed << frequencyParsed.valueRoundedWithUnit(2, true); qDebug() << "parsed" << speedParsed << speedParsed.valueRoundedWithUnit(2, true) << frequencyParsed << frequencyParsed.valueRoundedWithUnit(2, true);