Individual (per object) conversion as well as per unit (class) now possible, this is required for sexagesimal conversion (degrees) and will be required for geo-positions. Further classed for avionics.

This commit is contained in:
Klaus Basan
2013-04-05 02:29:52 +02:00
parent 943872ff67
commit eb102372f1
18 changed files with 622 additions and 98 deletions

66
src/blackmisc/aviobase.h Normal file
View File

@@ -0,0 +1,66 @@
#ifndef AVIOBASE_H
#define AVIOBASE_H
#include "blackmisc/pqconstants.h"
namespace BlackMisc {
/*!
* \brief Base class for avionics
*/
class CAvionicsBase
{
/*!
* Stream operator for debugging
* \brief operator <<
* \param debug
* \param avionic
* \return
* \remarks Has to be in the header files to avoid template link errors
*/
friend QDebug operator<<(QDebug debug, const CAvionicsBase &avionic) {
QString v = avionic.stringForStreamingOperator();
debug << v;
return debug;
}
/*!
* Stream operator for log messages
* \brief operator <<
* \param log
* \param avionic
* \return
* \remarks Has to be in the header files to avoid template link errors
*/
friend CLogMessage operator<<(CLogMessage log, const CAvionicsBase &avionic) {
QString v = avionic.stringForStreamingOperator();
log << v;
return log;
}
protected:
/*!
* \brief Default constructor
*/
CAvionicsBase() {}
/*!
* \brief Meaningful string representation
* \return
*/
virtual QString stringForStreamingOperator() const = 0;
/*!
* \brief Are the set values valid / in range
* \return
*/
virtual bool validValues() { return true; }
public:
/**
* @brief Virtual destructor
*/
virtual ~CAvionicsBase() {}
};
} // namespace
#endif // AVIOBASE_H