1 #include "EngaugeAssert.h"
2 #include "FormatCoordsUnitsStrategyPolarTheta.h"
3 #include "FormatDegreesMinutesSecondsPolarTheta.h"
12 const QLocale &locale,
13 CoordUnitsPolarTheta coordUnits)
const
15 LOG4CPP_DEBUG_S ((*mainCat)) <<
"FormatCoordsUnitsStrategyPolarTheta::formattedToUnformatted";
20 case COORD_UNITS_POLAR_THETA_DEGREES:
21 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES:
22 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS:
23 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW:
27 value) == QValidator::Acceptable);
31 case COORD_UNITS_POLAR_THETA_GRADIANS:
32 case COORD_UNITS_POLAR_THETA_RADIANS:
33 case COORD_UNITS_POLAR_THETA_TURNS:
34 value = locale.toDouble(
string);
38 LOG4CPP_ERROR_S ((*mainCat)) <<
"FormatCoordsUnitsStrategyPolarTheta::unformattedToFormattedStrategyPolarTheta";
39 ENGAUGE_ASSERT (
false);
47 const QLocale &locale,
48 CoordUnitsPolarTheta coordUnits,
50 double valueUnformattedOther)
const
52 LOG4CPP_DEBUG_S ((*mainCat)) <<
"FormatCoordsUnitsStrategyPolarTheta::unformattedToFormatted";
54 const char FORMAT (
'g');
55 const bool IS_X_THETA =
true;
57 QString valueFormatted;
60 case COORD_UNITS_POLAR_THETA_DEGREES:
61 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES:
62 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS:
63 case COORD_UNITS_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW:
72 case COORD_UNITS_POLAR_THETA_GRADIANS:
73 case COORD_UNITS_POLAR_THETA_RADIANS:
74 case COORD_UNITS_POLAR_THETA_TURNS:
75 valueFormatted = locale.toString (valueUnformatted,
78 valueUnformattedOther,
84 LOG4CPP_ERROR_S ((*mainCat)) <<
"FormatCoordsUnitsStrategyPolarTheta::unformattedToFormattedStrategyPolarTheta";
85 ENGAUGE_ASSERT (
false);
89 return valueFormatted;