Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
FormatDegreesMinutesSecondsNonPolarTheta.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "CoordSymbol.h"
8 #include "EngaugeAssert.h"
9 #include "FormatDegreesMinutesSecondsNonPolarTheta.h"
10 #include "Logger.h"
11 #include <qmath.h>
12 #include <QRegExp>
13 #include <QStringList>
14 
16 {
17 }
18 
19 QString FormatDegreesMinutesSecondsNonPolarTheta::formatOutput (CoordUnitsNonPolarTheta coordUnits,
20  double value,
21  bool isNsHemisphere) const
22 {
23  LOG4CPP_INFO_S ((*mainCat)) << "FormatDegreesMinutesSecondsNonPolarTheta::formatOutput";
24 
25  // See if similar method with hemisphere argument should have been called
26  ENGAUGE_ASSERT (coordUnits != COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW);
27 
28  switch (coordUnits) {
29  case COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS:
30  return formatOutputDegreesMinutesSeconds (value);
31 
32  case COORD_UNITS_NON_POLAR_THETA_DEGREES_MINUTES_SECONDS_NSEW:
34  isNsHemisphere);
35 
36  default:
37  break;
38  }
39 
40  LOG4CPP_ERROR_S ((*mainCat)) << "FormatDegreesMinutesSecondsNonPolarTheta::formatOutput";
41  ENGAUGE_ASSERT (false);
42  return "";
43 }
44 
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.