summaryrefslogtreecommitdiff
path: root/Layout/LayoutSurveySuccess.cpp
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-12-02 15:51:43 -0600
committerMike Fiore <mfiore@multitech.com>2015-12-02 15:51:43 -0600
commitf78db641192b31a3453591ae6a56a29c3a0d77e8 (patch)
treeb79d654ec55361819e40fc4e523d13e2e21a909c /Layout/LayoutSurveySuccess.cpp
parent10a50c37dfa08f0355ceb5664b92f50b4aba9fd2 (diff)
downloadmtdot-box-evb-factory-firmware-f78db641192b31a3453591ae6a56a29c3a0d77e8.tar.gz
mtdot-box-evb-factory-firmware-f78db641192b31a3453591ae6a56a29c3a0d77e8.tar.bz2
mtdot-box-evb-factory-firmware-f78db641192b31a3453591ae6a56a29c3a0d77e8.zip
update success and failure layouts and modes to display GPS data when available
Diffstat (limited to 'Layout/LayoutSurveySuccess.cpp')
-rw-r--r--Layout/LayoutSurveySuccess.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/Layout/LayoutSurveySuccess.cpp b/Layout/LayoutSurveySuccess.cpp
index 38edb5c..01a0c94 100644
--- a/Layout/LayoutSurveySuccess.cpp
+++ b/Layout/LayoutSurveySuccess.cpp
@@ -83,6 +83,17 @@ void LayoutSurveySuccess::updateStats(LoRaHandler::LoRaPing ping) {
}
void LayoutSurveySuccess::updateGpsLatitude(GPSPARSER::latitude lat) {
+ char buf[32];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c",
+ abs(lat.degrees),
+ lat.minutes,
+ (lat.seconds * 6) / 1000,
+ (lat.seconds * 6) % 1000,
+ (lat.degrees > 0) ? 'N' : 'S');
+ writeField(_fGpsLat, buf, size, true);
}
void LayoutSurveySuccess::updateGpsLatitude(std::string msg) {
@@ -90,9 +101,31 @@ void LayoutSurveySuccess::updateGpsLatitude(std::string msg) {
}
void LayoutSurveySuccess::updateGpsLongitude(GPSPARSER::longitude lon) {
+ char buf[32];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c",
+ abs(lon.degrees),
+ lon.minutes,
+ (lon.seconds * 6) / 1000,
+ (lon.seconds * 6) % 1000,
+ (lon.degrees > 0) ? 'E' : 'W');
+ writeField(_fGpsLon, buf, size, true);
}
void LayoutSurveySuccess::updateGpsTime(struct tm time) {
+ char buf[32];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ size = snprintf(buf, sizeof(buf), "%02d:%02d %02d/%02d/%04d",
+ time.tm_hour,
+ time.tm_min,
+ time.tm_mon + 1,
+ time.tm_mday,
+ time.tm_year + 1900);
+ writeField(_fGpsTime, buf, size, true);
}
void LayoutSurveySuccess::updateInfo(std::string info) {