CAngleUnit::sexagesimalDeg(), moved conversion to virtual method in CMeasurmenetUnit, made string conversion virtual and also moved it to CMeasurmenetUnit (=>individual formatters). Time unit added.

This commit is contained in:
Klaus Basan
2013-03-31 00:35:25 +01:00
parent be34b78425
commit f77258343d
17 changed files with 542 additions and 299 deletions

43
src/blackmisc/pqtime.h Normal file
View File

@@ -0,0 +1,43 @@
#ifndef PQTIME_H
#define PQTIME_H
#include "pqphysicalquantity.h"
namespace BlackMisc {
/*!
* Time class, e.g. "ms", "hour", "s", "day"
* \author KWB
*/
class CTime : public CPhysicalQuantity<CTimeUnit, CTime>
{
public:
/*!
* \brief Default constructor
*/
CTime() : CPhysicalQuantity(0, CTimeUnit::s(), CTimeUnit::s()) {}
/**
*\brief Copy constructor
*/
CTime(const CPhysicalQuantity &time): CPhysicalQuantity(time) {}
/*!
* \brief Init by int value
* \param value
* \param unit
*/
CTime(qint32 value, const CTimeUnit &unit) : CPhysicalQuantity(value, unit, CTimeUnit::s()) {}
/*!
*\brief Init by double value
* \param value
* \param unit
*/
CTime(double value, const CTimeUnit &unit) : CPhysicalQuantity(value, unit, CTimeUnit::s()) {}
/*!
* \brief Destructor
*/
virtual ~CTime() {}
};
} // namespace
#endif // PQTIME_H