summaryrefslogtreecommitdiff
path: root/Layout
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-11-23 12:25:51 -0600
committerMike Fiore <mfiore@multitech.com>2015-11-23 12:25:51 -0600
commit3ad4a2fde749077bce94115902ab9c6e9760a2f8 (patch)
treef365f002a85f374513029a78522c0037cd1ba1e9 /Layout
parent4166bbd0ff84397f31d4928c2ebe6d9a57c3694d (diff)
downloadmtdot-box-evb-factory-firmware-3ad4a2fde749077bce94115902ab9c6e9760a2f8.tar.gz
mtdot-box-evb-factory-firmware-3ad4a2fde749077bce94115902ab9c6e9760a2f8.tar.bz2
mtdot-box-evb-factory-firmware-3ad4a2fde749077bce94115902ab9c6e9760a2f8.zip
save survey data to file, start adding support for sending data packet, misc tweaks and fixes
Diffstat (limited to 'Layout')
-rw-r--r--Layout/LayoutConfirm.cpp4
-rw-r--r--Layout/LayoutSurveySuccess.cpp21
-rw-r--r--Layout/LayoutSurveySuccess.h4
3 files changed, 23 insertions, 6 deletions
diff --git a/Layout/LayoutConfirm.cpp b/Layout/LayoutConfirm.cpp
index 93fe85c..0c0e39a 100644
--- a/Layout/LayoutConfirm.cpp
+++ b/Layout/LayoutConfirm.cpp
@@ -6,8 +6,8 @@ LayoutConfirm::LayoutConfirm(DOGS102* lcd)
_lMsg2(0, 1, "Want to Erase It?"),
_lIns1(0, 4, "Hold SW1 any time"),
_lIns2(0, 5, "for Main Menu"),
- _lSw1(14, 7, "No"),
- _lSw2(1, 7, "Yes")
+ _lSw1(15, 7, "No"),
+ _lSw2(0, 7, "Yes")
{}
LayoutConfirm::~LayoutConfirm() {}
diff --git a/Layout/LayoutSurveySuccess.cpp b/Layout/LayoutSurveySuccess.cpp
index 7bcc56b..02dd197 100644
--- a/Layout/LayoutSurveySuccess.cpp
+++ b/Layout/LayoutSurveySuccess.cpp
@@ -7,7 +7,6 @@ LayoutSurveySuccess::LayoutSurveySuccess(DOGS102* lcd)
_lPwr(13, 0, "P"),
_lUp(0, 1, "UP"),
_lDown(0, 2, "DWN"),
- _lSw1(12, 7, "Power"),
_fId(2, 0, 5),
_fDr(10, 0, 2),
_fPwr(14, 0, 2),
@@ -19,6 +18,7 @@ LayoutSurveySuccess::LayoutSurveySuccess(DOGS102* lcd)
_fGpsLon(0, 3, 17),
_fGpsTime(0, 5, 17),
_fInfo(0, 6, 17),
+ _fSw1(9, 7, 8),
_fSw2(0, 7, 8)
{}
@@ -33,7 +33,6 @@ void LayoutSurveySuccess::display() {
writeLabel(_lPwr);
writeLabel(_lUp);
writeLabel(_lDown);
- writeLabel(_lSw1);
endUpdate();
}
@@ -76,7 +75,7 @@ void LayoutSurveySuccess::updateStats(LoRaHandler::LoRaPing ping) {
writeField(_fDownRssi, buf, size);
memset(buf, 0, sizeof(buf));
- size = snprintf(buf, sizeof(buf), "%2d.%1d", ping.down.snr / 4, abs(ping.up.snr) % 10 * 25);
+ size = snprintf(buf, sizeof(buf), "%2d.%1d", ping.down.snr / 4, abs(ping.down.snr) % 10 * 25);
writeField(_fDownSnr, buf, size);
endUpdate();
@@ -95,7 +94,23 @@ void LayoutSurveySuccess::updateInfo(std::string info) {
writeField(_fInfo, info, true);
}
+void LayoutSurveySuccess::updateSw1(std::string sw1) {
+ writeField(_fSw1, sw1, true);
+}
+
void LayoutSurveySuccess::updateSw2(std::string sw2) {
writeField(_fSw2, sw2, true);
}
+void LayoutSurveySuccess::updateCountdown(uint32_t seconds) {
+ char buf[16];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ // for some reason, there's a % character that gets displayed in the last column
+ // add the extra spaces to wipe it out
+ writeField(_fInfo, "No Free Channel ", true);
+ size = snprintf(buf, sizeof(buf), "%lu s", seconds);
+ writeField(_fSw2, buf, size, true);
+}
+
diff --git a/Layout/LayoutSurveySuccess.h b/Layout/LayoutSurveySuccess.h
index d5fe1af..dd7e740 100644
--- a/Layout/LayoutSurveySuccess.h
+++ b/Layout/LayoutSurveySuccess.h
@@ -19,7 +19,9 @@ class LayoutSurveySuccess : public Layout {
void updateGpsLongitude(GPSPARSER::longitude lon);
void updateGpsTime(struct tm time);
void updateInfo(std::string info);
+ void updateSw1(std::string sw1);
void updateSw2(std::string sw2);
+ void updateCountdown(uint32_t seconds);
private:
Label _lId;
@@ -27,7 +29,6 @@ class LayoutSurveySuccess : public Layout {
Label _lPwr;
Label _lUp;
Label _lDown;
- Label _lSw1;
Field _fId;
Field _fDr;
@@ -40,6 +41,7 @@ class LayoutSurveySuccess : public Layout {
Field _fGpsLon;
Field _fGpsTime;
Field _fInfo;
+ Field _fSw1;
Field _fSw2;
};