2018-01-20 23:51:39 +01:00
|
|
|
#include "linearunits.h"
|
|
|
|
|
|
|
|
LinearUnits::LinearUnits(int code)
|
|
|
|
{
|
|
|
|
switch (code) {
|
|
|
|
case 9001:
|
|
|
|
_f = 1.0;
|
|
|
|
break;
|
|
|
|
case 9002:
|
|
|
|
_f = 0.3048;
|
|
|
|
break;
|
|
|
|
case 9003:
|
|
|
|
_f = 12.0 / 39.37;
|
|
|
|
break;
|
|
|
|
case 9040:
|
|
|
|
_f = 36.0 / 39.370147;
|
|
|
|
break;
|
2018-05-14 00:37:19 +02:00
|
|
|
case 9041:
|
|
|
|
_f = 12.0 / 39.370147;
|
|
|
|
break;
|
|
|
|
case 9042:
|
|
|
|
_f = 792.0 / 39.370147;
|
|
|
|
break;
|
|
|
|
case 9094:
|
|
|
|
_f = 6378300.0 / 20926201.0;
|
|
|
|
break;
|
2018-01-20 23:51:39 +01:00
|
|
|
default:
|
|
|
|
_f = NAN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-20 23:51:39 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const LinearUnits &lu)
|
|
|
|
{
|
|
|
|
dbg.nospace() << "LinearUnits(" << lu._f << ")";
|
2018-01-21 11:19:46 +01:00
|
|
|
return dbg.space();
|
2018-01-20 23:51:39 +01:00
|
|
|
}
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|