Engauge Digitizer  2
FormatDegreesMinutesSecondsNonPolarTheta.cpp
1 #include "CoordSymbol.h"
2 #include "EngaugeAssert.h"
3 #include "FormatDegreesMinutesSecondsNonPolarTheta.h"
4 #include "Logger.h"
5 #include <qmath.h>
6 #include <QRegExp>
7 #include <QStringList>
8 
9 const int DECIMAL_TO_MINUTES = 60.0;
10 const int DECIMAL_TO_SECONDS = 60.0;
11 
13 {
14 }
15 
16 QString FormatDegreesMinutesSecondsNonPolarTheta::formatOutput (CoordUnitsNonPolarTheta coordUnits,
17  double value,
18  bool isNsHemisphere) const
19 {
20  LOG4CPP_INFO_S ((*mainCat)) << "FormatDegreesMinutesSecondsNonPolarTheta::formatOutput";
21 
22  // See if similar method with hemisphere argument should have been called
23  ENGAUGE_ASSERT (coordUnits != COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW);
24 
25  switch (coordUnits) {
26  case COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS:
27  return formatOutputDegreesMinutesSeconds (value);
28 
29  case COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW:
31  isNsHemisphere);
32 
33  default:
34  break;
35  }
36 
37  LOG4CPP_ERROR_S ((*mainCat)) << "FormatDegreesMinutesSecondsNonPolarTheta::formatOutput";
38  ENGAUGE_ASSERT (false);
39  return "";
40 }
41 
QString formatOutputDegreesMinutesSeconds(double value) const
Format as degrees, minutes and seconds without hemisphere.
QString formatOutput(CoordUnitsNonPolarTheta coordUnits, double value, bool isXTheta) const
Format the degrees/minutes/seconds value. Distinguishing x/theta versus y/radius is required for N/S/...
QString formatOutputDegreesMinutesSecondsNsew(double value, bool isNsHemisphere) const
Format as degrees, minutes and seconds with hemisphere.