mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #396 move Blackmisc PQ classes into subfolder
This commit is contained in:
committed by
Roland Winklmeier
parent
0ab755d510
commit
2363fab8c1
@@ -17,7 +17,7 @@
|
|||||||
#include "samplesalgorithm.h"
|
#include "samplesalgorithm.h"
|
||||||
#include "samplesconcurrent.h"
|
#include "samplesconcurrent.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMiscTest;
|
using namespace BlackMiscTest;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sampleschangeobject.h"
|
#include "sampleschangeobject.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/aviation/heading.h"
|
#include "blackmisc/aviation/heading.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/aviation/navsystem.h"
|
#include "blackmisc/aviation/navsystem.h"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "samplesvariant.h"
|
#include "samplesvariant.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "blackmisc/aviation/aviation.h"
|
#include "blackmisc/aviation/aviation.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "blackmisc/aviation/aviation.h"
|
#include "blackmisc/aviation/aviation.h"
|
||||||
#include "blackmisc/networkallclasses.h"
|
#include "blackmisc/networkallclasses.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
#include "blackmisc/math/math.h"
|
#include "blackmisc/math/math.h"
|
||||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "samplesaviation.h"
|
#include "samplesaviation.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/aviation/heading.h"
|
#include "blackmisc/aviation/heading.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/aviation/navsystem.h"
|
#include "blackmisc/aviation/navsystem.h"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
#ifndef BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
||||||
#define BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
#define BLACKMISCTEST_SAMPLESPHYSICALQUANTITIES_H
|
||||||
|
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKCORE_AIRSPACE_WATCHDOG_H
|
#ifndef BLACKCORE_AIRSPACE_WATCHDOG_H
|
||||||
#define BLACKCORE_AIRSPACE_WATCHDOG_H
|
#define BLACKCORE_AIRSPACE_WATCHDOG_H
|
||||||
|
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#include "blackmisc/aviation/airportlist.h"
|
#include "blackmisc/aviation/airportlist.h"
|
||||||
#include "blackmisc/project.h"
|
#include "blackmisc/project.h"
|
||||||
#include "blackmisc/pixmap.h"
|
#include "blackmisc/pixmap.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||||
#include "blackmisc/aviation/aircraft.h"
|
#include "blackmisc/aviation/aircraft.h"
|
||||||
#include "blackmisc/pqfrequency.h"
|
#include "blackmisc/pq/frequency.h"
|
||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
#include "blackmisc/pqlength.h"
|
#include "blackmisc/pq/length.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include "blackmisc/nwserverlist.h"
|
#include "blackmisc/nwserverlist.h"
|
||||||
#include "blackmisc/nwtextmessagelist.h"
|
#include "blackmisc/nwtextmessagelist.h"
|
||||||
#include "blackmisc/aviation/informationmessage.h"
|
#include "blackmisc/aviation/informationmessage.h"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#ifndef BLACKCORE_TOKENBUCKET_H
|
#ifndef BLACKCORE_TOKENBUCKET_H
|
||||||
#define BLACKCORE_TOKENBUCKET_H
|
#define BLACKCORE_TOKENBUCKET_H
|
||||||
|
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define BLACKGUI_COLUMNFORMATTERS_H
|
#define BLACKGUI_COLUMNFORMATTERS_H
|
||||||
|
|
||||||
#include "blackgui/led.h"
|
#include "blackgui/led.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/icon.h"
|
#include "blackmisc/icon.h"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "blackmisc/aviation/aircraft.h"
|
#include "blackmisc/aviation/aircraft.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/icon.h"
|
#include "blackmisc/icon.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "blackmisc/aviation/altitude.h"
|
#include "blackmisc/aviation/altitude.h"
|
||||||
#include "blackmisc/aviation/heading.h"
|
#include "blackmisc/aviation/heading.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "blackmisc/pqspeed.h"
|
#include "blackmisc/pq/speed.h"
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmisc/aviation/altitude.h"
|
#include "blackmisc/aviation/altitude.h"
|
||||||
#include "blackmisc/pqstring.h"
|
#include "blackmisc/pq/pqstring.h"
|
||||||
#include "blackmisc/iconlist.h"
|
#include "blackmisc/iconlist.h"
|
||||||
|
|
||||||
using BlackMisc::PhysicalQuantities::CLength;
|
using BlackMisc::PhysicalQuantities::CLength;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_AVIATION_ALTITUDE_H
|
#ifndef BLACKMISC_AVIATION_ALTITUDE_H
|
||||||
#define BLACKMISC_AVIATION_ALTITUDE_H
|
#define BLACKMISC_AVIATION_ALTITUDE_H
|
||||||
|
|
||||||
#include "blackmisc/pqlength.h"
|
#include "blackmisc/pq/length.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "blackmisc/nwuser.h"
|
#include "blackmisc/nwuser.h"
|
||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
#include "blackmisc/pqfrequency.h"
|
#include "blackmisc/pq/frequency.h"
|
||||||
#include "blackmisc/pqlength.h"
|
#include "blackmisc/pq/length.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/aviation/altitude.h"
|
#include "blackmisc/aviation/altitude.h"
|
||||||
#include "blackmisc/aviation/airporticao.h"
|
#include "blackmisc/aviation/airporticao.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include "blackmisc/pqspeed.h"
|
#include "blackmisc/pq/speed.h"
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_AVIATION_HEADING_H
|
#ifndef BLACKMISC_AVIATION_HEADING_H
|
||||||
#define BLACKMISC_AVIATION_HEADING_H
|
#define BLACKMISC_AVIATION_HEADING_H
|
||||||
|
|
||||||
#include "blackmisc/pqangle.h"
|
#include "blackmisc/pq/angle.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_AVIATION_SELCAL_H
|
#ifndef BLACKMISC_AVIATION_SELCAL_H
|
||||||
#define BLACKMISC_AVIATION_SELCAL_H
|
#define BLACKMISC_AVIATION_SELCAL_H
|
||||||
|
|
||||||
#include "blackmisc/pqfrequency.h"
|
#include "blackmisc/pq/frequency.h"
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_AVIATION_TRACK_H
|
#ifndef BLACKMISC_AVIATION_TRACK_H
|
||||||
#define BLACKMISC_AVIATION_TRACK_H
|
#define BLACKMISC_AVIATION_TRACK_H
|
||||||
|
|
||||||
#include "blackmisc/pqangle.h"
|
#include "blackmisc/pq/angle.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,11 +23,6 @@
|
|||||||
* \brief Position handling as geo locations and coordinates systems.
|
* \brief Position handling as geo locations and coordinates systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
* \namespace BlackMisc::PhysicalQuantities
|
|
||||||
* \brief Classes for physical quantities and units such as length, mass, speed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \namespace BlackMisc::Network
|
* \namespace BlackMisc::Network
|
||||||
* \brief Classes related to the traffic network such as VATSIM user etc.
|
* \brief Classes related to the traffic network such as VATSIM user etc.
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ TRANSLATIONS += translations/blackmisc_i18n_de.ts \
|
|||||||
translations/blackmisc_i18n_en.ts
|
translations/blackmisc_i18n_en.ts
|
||||||
|
|
||||||
HEADERS += *.h \
|
HEADERS += *.h \
|
||||||
|
$$PWD/pq/*.h \
|
||||||
$$PWD/aviation/*.h \
|
$$PWD/aviation/*.h \
|
||||||
$$PWD/math/*.h \
|
$$PWD/math/*.h \
|
||||||
$$PWD/geo/*.h \
|
$$PWD/geo/*.h \
|
||||||
@@ -33,6 +34,7 @@ HEADERS += *.h \
|
|||||||
$$PWD/simulation/fsx\*.h
|
$$PWD/simulation/fsx\*.h
|
||||||
|
|
||||||
SOURCES += *.cpp \
|
SOURCES += *.cpp \
|
||||||
|
$$PWD/pq/*.cpp \
|
||||||
$$PWD/aviation/*.cpp \
|
$$PWD/aviation/*.cpp \
|
||||||
$$PWD/math/*.cpp \
|
$$PWD/math/*.cpp \
|
||||||
$$PWD/geo/*.cpp \
|
$$PWD/geo/*.cpp \
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "blackmiscfreefunctions.h"
|
#include "blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/aviation/aviation.h"
|
#include "blackmisc/aviation/aviation.h"
|
||||||
#include "pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "math/math.h"
|
#include "math/math.h"
|
||||||
#include "geo/geo.h"
|
#include "geo/geo.h"
|
||||||
#include "networkallclasses.h"
|
#include "networkallclasses.h"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmiscfreefunctions.h"
|
#include "blackmiscfreefunctions.h"
|
||||||
#include "pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Metadata for PQs
|
* Metadata for PQs
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "blackmisc/geo/latitude.h"
|
#include "blackmisc/geo/latitude.h"
|
||||||
#include "blackmisc/geo/longitude.h"
|
#include "blackmisc/geo/longitude.h"
|
||||||
#include "blackmisc/pqlength.h"
|
#include "blackmisc/pq/length.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_GEO_EARTHANGLE_H
|
#ifndef BLACKMISC_GEO_EARTHANGLE_H
|
||||||
#define BLACKMISC_GEO_EARTHANGLE_H
|
#define BLACKMISC_GEO_EARTHANGLE_H
|
||||||
|
|
||||||
#include "blackmisc/pqangle.h"
|
#include "blackmisc/pq/angle.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include "pqangle.h"
|
#include "blackmisc/pq/angle.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "nwtextmessage.h"
|
#include "nwtextmessage.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "blackmisc/aviation/selcal.h"
|
#include "blackmisc/aviation/selcal.h"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define BLACKMISC_TEXTMESSAGE_H
|
#define BLACKMISC_TEXTMESSAGE_H
|
||||||
|
|
||||||
#include "blackmisc/timestampbased.h"
|
#include "blackmisc/timestampbased.h"
|
||||||
#include "pqfrequency.h"
|
#include "blackmisc/pq/frequency.h"
|
||||||
#include "blackmisc/aviation/callsign.h"
|
#include "blackmisc/aviation/callsign.h"
|
||||||
#include "statusmessage.h"
|
#include "statusmessage.h"
|
||||||
#include "valueobject.h"
|
#include "valueobject.h"
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQACCELERATION_H
|
#ifndef BLACKMISC_PQ_ACCELERATION_H
|
||||||
#define BLACKMISC_PQACCELERATION_H
|
#define BLACKMISC_PQ_ACCELERATION_H
|
||||||
|
|
||||||
#include "blackmisc/pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "iconlist.h"
|
#include "blackmisc/iconlist.h"
|
||||||
#include "pqangle.h"
|
#include "blackmisc/pq/angle.h"
|
||||||
#include "blackmisc/aviation/heading.h"
|
#include "blackmisc/aviation/heading.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQANGLE_H
|
#ifndef BLACKMISC_PQ_ANGLE_H
|
||||||
#define BLACKMISC_PQANGLE_H
|
#define BLACKMISC_PQ_ANGLE_H
|
||||||
|
|
||||||
#include "blackmisc/pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
#include "blackmisc/math/mathutils.h"
|
#include "blackmisc/math/mathutils.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQCONSTANTS_H
|
#ifndef BLACKMISC_PQ_CONSTANTS_H
|
||||||
#define BLACKMISC_PQCONSTANTS_H
|
#define BLACKMISC_PQ_CONSTANTS_H
|
||||||
|
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQFREQUENCY_H
|
#ifndef BLACKMISC_PQ_FREQUENCY_H
|
||||||
#define BLACKMISC_PQFREQUENCY_H
|
#define BLACKMISC_PQ_FREQUENCY_H
|
||||||
|
|
||||||
#include "pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQLENGTH_H
|
#ifndef BLACKMISC_PQ_LENGTH_H
|
||||||
#define BLACKMISC_PQLENGTH_H
|
#define BLACKMISC_PQ_LENGTH_H
|
||||||
|
|
||||||
#include "blackmisc/pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQMASS_H
|
#ifndef BLACKMISC_PQ_MASS_H
|
||||||
#define BLACKMISC_PQMASS_H
|
#define BLACKMISC_PQ_MASS_H
|
||||||
|
|
||||||
#include "blackmisc/pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#include "blackmisc/pqbase.h"
|
#include "blackmisc/pq/measurementunit.h"
|
||||||
#include "blackmisc/math/mathutils.h"
|
#include "blackmisc/math/mathutils.h"
|
||||||
|
|
||||||
using namespace BlackMisc::Math;
|
using namespace BlackMisc::Math;
|
||||||
@@ -18,26 +18,18 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace PhysicalQuantities
|
namespace PhysicalQuantities
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Equal operator
|
|
||||||
*/
|
|
||||||
bool CMeasurementUnit::operator ==(const CMeasurementUnit &other) const
|
bool CMeasurementUnit::operator ==(const CMeasurementUnit &other) const
|
||||||
{
|
{
|
||||||
if (this == &other) return true;
|
if (this == &other) return true;
|
||||||
return this->m_name == other.m_name;
|
return this->m_name == other.m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Unequal operator
|
|
||||||
*/
|
|
||||||
bool CMeasurementUnit::operator !=(const CMeasurementUnit &other) const
|
bool CMeasurementUnit::operator !=(const CMeasurementUnit &other) const
|
||||||
{
|
{
|
||||||
return !(other == *this);
|
return !(other == *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Conversion
|
|
||||||
*/
|
|
||||||
double CMeasurementUnit::convertFrom(double value, const CMeasurementUnit &unit) const
|
double CMeasurementUnit::convertFrom(double value, const CMeasurementUnit &unit) const
|
||||||
{
|
{
|
||||||
if (this->isNull() || unit.isNull()) return 0;
|
if (this->isNull() || unit.isNull()) return 0;
|
||||||
@@ -45,27 +37,17 @@ namespace BlackMisc
|
|||||||
return this->m_converter->fromDefault(unit.m_converter->toDefault(value));
|
return this->m_converter->fromDefault(unit.m_converter->toDefault(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value to QString with unit, e.g. "5.00m"
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
QString CMeasurementUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
QString CMeasurementUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
||||||
{
|
{
|
||||||
return this->makeRoundedQString(value, digits).append(this->getSymbol(i18n));
|
return this->makeRoundedQString(value, digits).append(this->getSymbol(i18n));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value rounded
|
|
||||||
*/
|
|
||||||
double CMeasurementUnit::roundValue(double value, int digits) const
|
double CMeasurementUnit::roundValue(double value, int digits) const
|
||||||
{
|
{
|
||||||
if (digits < 0) digits = this->m_displayDigits;
|
if (digits < 0) digits = this->m_displayDigits;
|
||||||
return CMathUtils::round(value, digits);
|
return CMathUtils::round(value, digits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Rounded to QString
|
|
||||||
*/
|
|
||||||
QString CMeasurementUnit::makeRoundedQString(double value, int digits, bool /* i18n */) const
|
QString CMeasurementUnit::makeRoundedQString(double value, int digits, bool /* i18n */) const
|
||||||
{
|
{
|
||||||
if (digits < 0) digits = this->m_displayDigits;
|
if (digits < 0) digits = this->m_displayDigits;
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQBASE_H
|
#ifndef BLACKMISC_PQ_MEASUREMENTUNIT_H
|
||||||
#define BLACKMISC_PQBASE_H
|
#define BLACKMISC_PQ_MEASUREMENTUNIT_H
|
||||||
|
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/math/mathutils.h"
|
#include "blackmisc/math/mathutils.h"
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -16,18 +16,10 @@ namespace BlackMisc
|
|||||||
namespace PhysicalQuantities
|
namespace PhysicalQuantities
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
|
||||||
* Constructor by double
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ>::CPhysicalQuantity(double value, const MU &unit) :
|
template <class MU, class PQ> CPhysicalQuantity<MU, PQ>::CPhysicalQuantity(double value, const MU &unit) :
|
||||||
m_value(unit.isNull() ? 0.0 : value), m_unit(unit)
|
m_value(unit.isNull() ? 0.0 : value), m_unit(unit)
|
||||||
{
|
{ }
|
||||||
// void
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Equal operator ==
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator ==(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator ==(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
if (this == &other) return true;
|
if (this == &other) return true;
|
||||||
@@ -39,26 +31,17 @@ namespace BlackMisc
|
|||||||
return diff <= this->m_unit.getEpsilon();
|
return diff <= this->m_unit.getEpsilon();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Not equal
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator !=(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator !=(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
return !((*this) == other);
|
return !((*this) == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Plus operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator +=(const CPhysicalQuantity<MU, PQ> &other)
|
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator +=(const CPhysicalQuantity<MU, PQ> &other)
|
||||||
{
|
{
|
||||||
this->m_value += other.value(this->m_unit);
|
this->m_value += other.value(this->m_unit);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Plus operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator +(const PQ &other) const
|
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator +(const PQ &other) const
|
||||||
{
|
{
|
||||||
PQ copy(other);
|
PQ copy(other);
|
||||||
@@ -66,34 +49,22 @@ namespace BlackMisc
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Explicit plus
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::addValueSameUnit(double value)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::addValueSameUnit(double value)
|
||||||
{
|
{
|
||||||
this->m_value += value;
|
this->m_value += value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Explicit minus
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::substractValueSameUnit(double value)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::substractValueSameUnit(double value)
|
||||||
{
|
{
|
||||||
this->m_value -= value;
|
this->m_value -= value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Minus operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator -=(const CPhysicalQuantity<MU, PQ> &other)
|
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator -=(const CPhysicalQuantity<MU, PQ> &other)
|
||||||
{
|
{
|
||||||
this->m_value -= other.value(this->m_unit);
|
this->m_value -= other.value(this->m_unit);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Minus operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator -(const PQ &other) const
|
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator -(const PQ &other) const
|
||||||
{
|
{
|
||||||
PQ copy = *derived();
|
PQ copy = *derived();
|
||||||
@@ -101,9 +72,6 @@ namespace BlackMisc
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Marshall
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::marshallToDbus(QDBusArgument &argument) const
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::marshallToDbus(QDBusArgument &argument) const
|
||||||
{
|
{
|
||||||
argument << this->value(UnitClass::defaultUnit());
|
argument << this->value(UnitClass::defaultUnit());
|
||||||
@@ -111,9 +79,6 @@ namespace BlackMisc
|
|||||||
argument << this->m_unit;
|
argument << this->m_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Unmarshall
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::unmarshallFromDbus(const QDBusArgument &argument)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::unmarshallFromDbus(const QDBusArgument &argument)
|
||||||
{
|
{
|
||||||
double ignore;
|
double ignore;
|
||||||
@@ -122,18 +87,12 @@ namespace BlackMisc
|
|||||||
argument >> this->m_unit;
|
argument >> this->m_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Multiply operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator *=(double factor)
|
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator *=(double factor)
|
||||||
{
|
{
|
||||||
this->m_value *= factor;
|
this->m_value *= factor;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Multiply operator
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator *(double factor) const
|
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator *(double factor) const
|
||||||
{
|
{
|
||||||
PQ copy = *derived();
|
PQ copy = *derived();
|
||||||
@@ -141,18 +100,12 @@ namespace BlackMisc
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Divide operator /=
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator /=(double divisor)
|
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::operator /=(double divisor)
|
||||||
{
|
{
|
||||||
this->m_value /= divisor;
|
this->m_value /= divisor;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Divide operator /
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator /(double divisor) const
|
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator /(double divisor) const
|
||||||
{
|
{
|
||||||
PQ copy = *derived();
|
PQ copy = *derived();
|
||||||
@@ -160,9 +113,6 @@ namespace BlackMisc
|
|||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Less operator <
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator <(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator <(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
if (*this == other) return false;
|
if (*this == other) return false;
|
||||||
@@ -171,35 +121,23 @@ namespace BlackMisc
|
|||||||
return (this->m_value < other.value(this->m_unit));
|
return (this->m_value < other.value(this->m_unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Greater than
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator >(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator >(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
return other < *this;
|
return other < *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Greater / Equal
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator >=(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator >=(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
if (*this == other) return true;
|
if (*this == other) return true;
|
||||||
return *this > other;
|
return *this > other;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Less equal
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator <=(const CPhysicalQuantity<MU, PQ> &other) const
|
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator <=(const CPhysicalQuantity<MU, PQ> &other) const
|
||||||
{
|
{
|
||||||
if (*this == other) return true;
|
if (*this == other) return true;
|
||||||
return *this < other;
|
return *this < other;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Switch to another unit
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> PQ &CPhysicalQuantity<MU, PQ>::switchUnit(const MU &newUnit)
|
template <class MU, class PQ> PQ &CPhysicalQuantity<MU, PQ>::switchUnit(const MU &newUnit)
|
||||||
{
|
{
|
||||||
if (this->m_unit != newUnit)
|
if (this->m_unit != newUnit)
|
||||||
@@ -210,33 +148,21 @@ namespace BlackMisc
|
|||||||
return *derived();
|
return *derived();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Init by double
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::setValueSameUnit(double baseValue)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::setValueSameUnit(double baseValue)
|
||||||
{
|
{
|
||||||
this->m_value = baseValue;
|
this->m_value = baseValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value rounded in unit
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> QString CPhysicalQuantity<MU, PQ>::valueRoundedWithUnit(const MU &unit, int digits, bool i18n) const
|
template <class MU, class PQ> QString CPhysicalQuantity<MU, PQ>::valueRoundedWithUnit(const MU &unit, int digits, bool i18n) const
|
||||||
{
|
{
|
||||||
return unit.makeRoundedQStringWithUnit(this->value(unit), digits, i18n);
|
return unit.makeRoundedQStringWithUnit(this->value(unit), digits, i18n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value rounded in unit
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> double CPhysicalQuantity<MU, PQ>::valueRounded(const MU &unit, int digits) const
|
template <class MU, class PQ> double CPhysicalQuantity<MU, PQ>::valueRounded(const MU &unit, int digits) const
|
||||||
{
|
{
|
||||||
return unit.roundValue(this->value(unit), digits);
|
return unit.roundValue(this->value(unit), digits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value rounded as integer
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> int CPhysicalQuantity<MU, PQ>::valueInteger(const MU &unit) const
|
template <class MU, class PQ> int CPhysicalQuantity<MU, PQ>::valueInteger(const MU &unit) const
|
||||||
{
|
{
|
||||||
double v = unit.roundValue(this->value(unit), 0);
|
double v = unit.roundValue(this->value(unit), 0);
|
||||||
@@ -248,17 +174,11 @@ namespace BlackMisc
|
|||||||
return this->valueRounded(this->m_unit, digits);
|
return this->valueRounded(this->m_unit, digits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Value in unit
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> double CPhysicalQuantity<MU, PQ>::value(const MU &unit) const
|
template <class MU, class PQ> double CPhysicalQuantity<MU, PQ>::value(const MU &unit) const
|
||||||
{
|
{
|
||||||
return unit.convertFrom(this->m_value, this->m_unit);
|
return unit.convertFrom(this->m_value, this->m_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert to string
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> QString CPhysicalQuantity<MU, PQ>::convertToQString(bool i18n) const
|
template <class MU, class PQ> QString CPhysicalQuantity<MU, PQ>::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
if (this->isNull())
|
if (this->isNull())
|
||||||
@@ -268,9 +188,6 @@ namespace BlackMisc
|
|||||||
return this->valueRoundedWithUnit(this->getUnit(), -1, i18n);
|
return this->valueRoundedWithUnit(this->getUnit(), -1, i18n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Hash
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> uint CPhysicalQuantity<MU, PQ>::getValueHash() const
|
template <class MU, class PQ> uint CPhysicalQuantity<MU, PQ>::getValueHash() const
|
||||||
{
|
{
|
||||||
QList<uint> hashs;
|
QList<uint> hashs;
|
||||||
@@ -280,9 +197,6 @@ namespace BlackMisc
|
|||||||
return BlackMisc::calculateHash(hashs, "PQ");
|
return BlackMisc::calculateHash(hashs, "PQ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* JSON Object
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> QJsonObject CPhysicalQuantity<MU, PQ>::toJson() const
|
template <class MU, class PQ> QJsonObject CPhysicalQuantity<MU, PQ>::toJson() const
|
||||||
{
|
{
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
@@ -291,9 +205,6 @@ namespace BlackMisc
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* JSON Object
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::convertFromJson(const QJsonObject &json)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::convertFromJson(const QJsonObject &json)
|
||||||
{
|
{
|
||||||
const QString unitSymbol = json.value("unit").toString();
|
const QString unitSymbol = json.value("unit").toString();
|
||||||
@@ -301,9 +212,6 @@ namespace BlackMisc
|
|||||||
this->m_value = json.value("value").toDouble();
|
this->m_value = json.value("value").toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Property
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> CVariant CPhysicalQuantity<MU, PQ>::propertyByIndex(const CPropertyIndex &index) const
|
template <class MU, class PQ> CVariant CPhysicalQuantity<MU, PQ>::propertyByIndex(const CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { return this->toCVariant(); }
|
if (index.isMyself()) { return this->toCVariant(); }
|
||||||
@@ -329,9 +237,6 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Property
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||||
{
|
{
|
||||||
if (index.isMyself())
|
if (index.isMyself())
|
||||||
@@ -361,9 +266,6 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare
|
|
||||||
*/
|
|
||||||
template <class MU, class PQ> int CPhysicalQuantity<MU, PQ>::compareImpl(const PQ &a, const PQ &b)
|
template <class MU, class PQ> int CPhysicalQuantity<MU, PQ>::compareImpl(const PQ &a, const PQ &b)
|
||||||
{
|
{
|
||||||
if (a.isNull() > b.isNull()) { return -1; }
|
if (a.isNull() > b.isNull()) { return -1; }
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQPHYSICALQUANTITY_H
|
#ifndef BLACKMISC_PQ_PHYSICALQUANTITY_H
|
||||||
#define BLACKMISC_PQPHYSICALQUANTITY_H
|
#define BLACKMISC_PQ_PHYSICALQUANTITY_H
|
||||||
|
|
||||||
#include "blackmisc/pqbase.h"
|
#include "blackmisc/pq/measurementunit.h"
|
||||||
#include "blackmisc/pqunits.h"
|
#include "blackmisc/pq/units.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
#include "blackmisc/math/mathutils.h"
|
#include "blackmisc/math/mathutils.h"
|
||||||
#include "blackmisc/pqstring.h"
|
#include "blackmisc/pq/pqstring.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include <QtDBus/QDBusMetaType>
|
#include <QtDBus/QDBusMetaType>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
34
src/blackmisc/pq/pq.h
Normal file
34
src/blackmisc/pq/pq.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* Copyright (C) 2013
|
||||||
|
* swift project Community / Contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BLACKMISC_PQ_PQ_H
|
||||||
|
#define BLACKMISC_PQ_PQ_H
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \namespace BlackMisc::PhysicalQuantities
|
||||||
|
* \brief Classes for physical quantities and units such as length, mass, speed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// All units / quantities, required for the instantiations of the template
|
||||||
|
// especially as CRTP (Curiously recurring template pattern) is used.
|
||||||
|
// http://www.parashift.com/c++-faq-lite/separate-template-fn-defn-from-decl.html
|
||||||
|
// http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
|
||||||
|
|
||||||
|
#include "blackmisc/pq/length.h"
|
||||||
|
#include "blackmisc/pq/frequency.h"
|
||||||
|
#include "blackmisc/pq/pressure.h"
|
||||||
|
#include "blackmisc/pq/mass.h"
|
||||||
|
#include "blackmisc/pq/speed.h"
|
||||||
|
#include "blackmisc/pq/temperature.h"
|
||||||
|
#include "blackmisc/pq/angle.h"
|
||||||
|
#include "blackmisc/pq/time.h"
|
||||||
|
#include "blackmisc/pq/acceleration.h"
|
||||||
|
#include "blackmisc/pq/pqstring.h"
|
||||||
|
|
||||||
|
#endif // guard
|
||||||
@@ -7,26 +7,21 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pqstring.h"
|
#include "blackmisc/pq/pqstring.h"
|
||||||
#include "tuple.h"
|
#include "blackmisc/tuple.h"
|
||||||
#include "pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include <QThreadStorage>
|
#include <QThreadStorage>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
namespace PhysicalQuantities
|
namespace PhysicalQuantities
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Convert to string
|
|
||||||
*/
|
|
||||||
QString CPqString::convertToQString(bool /** i18n **/) const
|
QString CPqString::convertToQString(bool /** i18n **/) const
|
||||||
{
|
{
|
||||||
return this->m_string;
|
return this->m_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Parse
|
|
||||||
*/
|
|
||||||
CVariant CPqString::parseToVariant(const QString &value, SeparatorMode mode)
|
CVariant CPqString::parseToVariant(const QString &value, SeparatorMode mode)
|
||||||
{
|
{
|
||||||
CVariant v;
|
CVariant v;
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQSTRING_H
|
#ifndef BLACKMISC_PQ_PQSTRING_H
|
||||||
#define BLACKMISC_PQSTRING_H
|
#define BLACKMISC_PQ_PQSTRING_H
|
||||||
|
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQPRESSURE_H
|
#ifndef BLACKMISC_PQ_PRESSURE_H
|
||||||
#define BLACKMISC_PQPRESSURE_H
|
#define BLACKMISC_PQ_PRESSURE_H
|
||||||
|
|
||||||
#include "pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_CSPEED_H
|
#ifndef BLACKMISC_PQ_SPEED_H
|
||||||
#define BLACKMISC_CSPEED_H
|
#define BLACKMISC_PQ_SPEED_H
|
||||||
|
|
||||||
#include "pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_CTEMPERATURE_H
|
#ifndef BLACKMISC_PQ_TEMPERATURE_H
|
||||||
#define BLACKMISC_CTEMPERATURE_H
|
#define BLACKMISC_PQ_TEMPERATURE_H
|
||||||
|
|
||||||
#include "pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQTIME_H
|
#ifndef BLACKMISC_PQ_TIME_H
|
||||||
#define BLACKMISC_PQTIME_H
|
#define BLACKMISC_PQ_TIME_H
|
||||||
|
|
||||||
#include "pqphysicalquantity.h"
|
#include "blackmisc/pq/physicalquantity.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmisc/pqunits.h"
|
#include "blackmisc/pq/units.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -15,9 +15,6 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
using BlackMisc::Math::CMathUtils;
|
using BlackMisc::Math::CMathUtils;
|
||||||
|
|
||||||
/*
|
|
||||||
* Rounded to QString
|
|
||||||
*/
|
|
||||||
QString CAngleUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
QString CAngleUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
||||||
{
|
{
|
||||||
if (digits < 0) digits = this->getDisplayDigits();
|
if (digits < 0) digits = this->getDisplayDigits();
|
||||||
@@ -50,9 +47,6 @@ namespace BlackMisc
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Rounded to QString
|
|
||||||
*/
|
|
||||||
QString CTimeUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
QString CTimeUnit::makeRoundedQStringWithUnit(double value, int digits, bool i18n) const
|
||||||
{
|
{
|
||||||
if (digits < 0) digits = this->getDisplayDigits();
|
if (digits < 0) digits = this->getDisplayDigits();
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
/* Copyright (C) 2013
|
/* Copyright (C) 2013
|
||||||
//! swift project Community / Contributors
|
* swift project Community / Contributors
|
||||||
*
|
*
|
||||||
//! This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
//! directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||||
//! including this file, may be copied, modified, propagated, or distributed except according to the terms
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
//! contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQUNITS_H
|
#ifndef BLACKMISC_PQ_UNITS_H
|
||||||
#define BLACKMISC_PQUNITS_H
|
#define BLACKMISC_PQ_UNITS_H
|
||||||
|
|
||||||
#pragma push_macro("min")
|
#pragma push_macro("min")
|
||||||
#undef min
|
#undef min
|
||||||
|
|
||||||
#include "blackmisc/pqbase.h"
|
#include "blackmisc/pq/measurementunit.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include <QtDBus/QDBusArgument>
|
#include <QtDBus/QDBusArgument>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
/* Copyright (C) 2013 VATSIM Community / contributors
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef BLACKMISC_PQUNITSALL_H
|
|
||||||
#define BLACKMISC_PQUNITSALL_H
|
|
||||||
|
|
||||||
// All units / quantities, required for the instantiations of the template
|
|
||||||
// especially as CRTP (Curiously recurring template pattern) is used.
|
|
||||||
// http://www.parashift.com/c++-faq-lite/separate-template-fn-defn-from-decl.html
|
|
||||||
// http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
|
|
||||||
|
|
||||||
#include "blackmisc/pqlength.h"
|
|
||||||
#include "blackmisc/pqfrequency.h"
|
|
||||||
#include "blackmisc/pqpressure.h"
|
|
||||||
#include "blackmisc/pqmass.h"
|
|
||||||
#include "blackmisc/pqspeed.h"
|
|
||||||
#include "blackmisc/pqtemperature.h"
|
|
||||||
#include "blackmisc/pqangle.h"
|
|
||||||
#include "blackmisc/pqtime.h"
|
|
||||||
#include "blackmisc/pqacceleration.h"
|
|
||||||
#include "blackmisc/pqunits.h"
|
|
||||||
#include "blackmisc/pqstring.h"
|
|
||||||
|
|
||||||
#endif // guard
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "simplecommandparser.h"
|
#include "simplecommandparser.h"
|
||||||
#include "pqstring.h"
|
#include "blackmisc/pq/pqstring.h"
|
||||||
|
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#ifndef BLACKMISC_SIMULATION_FSCOMMON_BCDCONVERSIONS_H
|
#ifndef BLACKMISC_SIMULATION_FSCOMMON_BCDCONVERSIONS_H
|
||||||
#define BLACKMISC_SIMULATION_FSCOMMON_BCDCONVERSIONS_H
|
#define BLACKMISC_SIMULATION_FSCOMMON_BCDCONVERSIONS_H
|
||||||
|
|
||||||
#include "blackmisc/pqfrequency.h"
|
#include "blackmisc/pq/frequency.h"
|
||||||
#include "blackmisc/aviation/transponder.h"
|
#include "blackmisc/aviation/transponder.h"
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/settingutilities.h"
|
#include "blackmisc/settingutilities.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include "simulatorplugininfo.h"
|
#include "simulatorplugininfo.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "blackmisc/aviation/selcal.h"
|
#include "blackmisc/aviation/selcal.h"
|
||||||
#include "blackmisc/audio/audiodeviceinfo.h"
|
#include "blackmisc/audio/audiodeviceinfo.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include "blackmisc/notificationsounds.h"
|
#include "blackmisc/notificationsounds.h"
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "directplay_peer.h"
|
#include "directplay_peer.h"
|
||||||
#include "blackcore/interpolator.h"
|
#include "blackcore/interpolator.h"
|
||||||
#include "blackmisc/aviation/aircraftsituation.h"
|
#include "blackmisc/aviation/aircraftsituation.h"
|
||||||
#include "blackmisc/pqtime.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "blackcore/context_all_interfaces.h"
|
#include "blackcore/context_all_interfaces.h"
|
||||||
#include "blackmisc/propertyindexallclasses.h"
|
#include "blackmisc/propertyindexallclasses.h"
|
||||||
#include "blackmisc/aviation/aviation.h"
|
#include "blackmisc/aviation/aviation.h"
|
||||||
#include "blackmisc/pqallquantities.h"
|
#include "blackmisc/pq/pq.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
#include "blackmisc/worker.h"
|
#include "blackmisc/worker.h"
|
||||||
#include "blacksound/soundgenerator.h"
|
#include "blacksound/soundgenerator.h"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "testaviation.h"
|
#include "testaviation.h"
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/aviation/heading.h"
|
#include "blackmisc/aviation/heading.h"
|
||||||
#include "blackmisc/aviation/informationmessage.h"
|
#include "blackmisc/aviation/informationmessage.h"
|
||||||
#include "blackmisc/aviation/aircraftsituation.h"
|
#include "blackmisc/aviation/aircraftsituation.h"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define BLACKMISCTEST_TESTPHYSICALQUANTITIESBASE_H
|
#define BLACKMISCTEST_TESTPHYSICALQUANTITIESBASE_H
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
|
|
||||||
namespace BlackMiscTest
|
namespace BlackMiscTest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef BLACKMISCTEST_TESTVARIANTANDMAP_H
|
#ifndef BLACKMISCTEST_TESTVARIANTANDMAP_H
|
||||||
#define BLACKMISCTEST_TESTVARIANTANDMAP_H
|
#define BLACKMISCTEST_TESTVARIANTANDMAP_H
|
||||||
|
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pq/constants.h"
|
||||||
#include "blackmisc/aviation/atcstation.h"
|
#include "blackmisc/aviation/atcstation.h"
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user