summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Layout/LayoutSurveyFailure.cpp40
-rw-r--r--Layout/LayoutSurveyFailure.h13
-rw-r--r--Layout/LayoutSurveySuccess.cpp15
-rw-r--r--Layout/LayoutSurveySuccess.h2
-rw-r--r--Layout/LayoutSweepProgress.cpp15
-rw-r--r--Layout/LayoutSweepProgress.h4
-rw-r--r--Mode/ModeSingle.cpp6
-rw-r--r--Mode/ModeSweep.cpp7
8 files changed, 69 insertions, 33 deletions
diff --git a/Layout/LayoutSurveyFailure.cpp b/Layout/LayoutSurveyFailure.cpp
index d443098..aa2ce7c 100644
--- a/Layout/LayoutSurveyFailure.cpp
+++ b/Layout/LayoutSurveyFailure.cpp
@@ -2,18 +2,19 @@
LayoutSurveyFailure::LayoutSurveyFailure(DOGS102* lcd)
: Layout(lcd),
- _lTitle(0, 2, "Survey Failed"),
+ _lTitle(0, 1, "Survey Failed"),
_lId(0, 0, "ID"),
_lDr(8, 0, "DR"),
_lPwr(13, 0, "P"),
- _lSw1(12, 7, "Power"),
- _lSw2(0, 7, "Survey"),
_fId(2, 0, 5),
_fDr(10, 0, 2),
_fPwr(14, 0, 2),
- _fMsg1(0, 4, 17),
- _fMsg2(0, 5, 17),
- _fInfo(0, 6, 17)
+ _fMsg1(0, 2, 17),
+ _fMsg2(0, 3, 17),
+ _fInfo1(0, 5, 17),
+ _fInfo2(0, 6, 17),
+ _fSw1(9, 7, 8),
+ _fSw2(0, 7, 8)
{}
LayoutSurveyFailure::~LayoutSurveyFailure() {}
@@ -26,8 +27,6 @@ void LayoutSurveyFailure::display() {
writeLabel(_lId);
writeLabel(_lDr);
writeLabel(_lPwr);
- writeLabel(_lSw1);
- writeLabel(_lSw2);
endUpdate();
}
@@ -52,7 +51,28 @@ void LayoutSurveyFailure::updatePower(uint32_t power) {
writeField(_fPwr, buf, size, true);
}
-void LayoutSurveyFailure::updateInfo(std::string info) {
- writeField(_fInfo, info, true);
+void LayoutSurveyFailure::updateInfo1(std::string info) {
+ writeField(_fInfo1, info, true);
+}
+
+void LayoutSurveyFailure::updateInfo2(std::string info) {
+ writeField(_fInfo2, info, true);
+}
+
+void LayoutSurveyFailure::updatePassFail(uint8_t pass, uint8_t fail) {
+ char buf[32];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ size = snprintf(buf, sizeof(buf), "Pass %u Fail %u", pass, fail);
+ writeField(_fInfo1, buf, size, true);
+}
+
+void LayoutSurveyFailure::updateSw1(std::string sw1) {
+ writeField(_fSw1, sw1, true);
+}
+
+void LayoutSurveyFailure::updateSw2(std::string sw2) {
+ writeField(_fSw2, sw2, true);
}
diff --git a/Layout/LayoutSurveyFailure.h b/Layout/LayoutSurveyFailure.h
index 473fd9f..ca6aebd 100644
--- a/Layout/LayoutSurveyFailure.h
+++ b/Layout/LayoutSurveyFailure.h
@@ -12,22 +12,27 @@ class LayoutSurveyFailure : public Layout {
void updateId(uint32_t id);
void updateRate(std::string rate);
void updatePower(uint32_t power);
- void updateInfo(std::string msg);
+ void updateInfo1(std::string msg);
+ void updateInfo2(std::string msg);
+ void updatePassFail(uint8_t pass, uint8_t fail);
+ void updateSw1(std::string sw1);
+ void updateSw2(std::string sw2);
private:
Label _lTitle;
Label _lId;
Label _lDr;
Label _lPwr;
- Label _lSw1;
- Label _lSw2;
Field _fId;
Field _fDr;
Field _fPwr;
Field _fMsg1;
Field _fMsg2;
- Field _fInfo;
+ Field _fInfo1;
+ Field _fInfo2;
+ Field _fSw1;
+ Field _fSw2;
};
#endif
diff --git a/Layout/LayoutSurveySuccess.cpp b/Layout/LayoutSurveySuccess.cpp
index 68ef1dc..38edb5c 100644
--- a/Layout/LayoutSurveySuccess.cpp
+++ b/Layout/LayoutSurveySuccess.cpp
@@ -85,6 +85,10 @@ void LayoutSurveySuccess::updateStats(LoRaHandler::LoRaPing ping) {
void LayoutSurveySuccess::updateGpsLatitude(GPSPARSER::latitude lat) {
}
+void LayoutSurveySuccess::updateGpsLatitude(std::string msg) {
+ writeField(_fGpsLat, msg, true);
+}
+
void LayoutSurveySuccess::updateGpsLongitude(GPSPARSER::longitude lon) {
}
@@ -104,7 +108,7 @@ void LayoutSurveySuccess::updateSw2(std::string sw2) {
}
void LayoutSurveySuccess::updateCountdown(uint32_t seconds) {
- char buf[16];
+ char buf[32];
size_t size;
memset(buf, 0, sizeof(buf));
@@ -115,3 +119,12 @@ void LayoutSurveySuccess::updateCountdown(uint32_t seconds) {
writeField(_fSw2, buf, size, true);
}
+void LayoutSurveySuccess::updatePassFail(uint8_t pass, uint8_t fail) {
+ char buf[32];
+ size_t size;
+
+ memset(buf, 0, sizeof(buf));
+ size = snprintf(buf, sizeof(buf), "Pass %u Fail %u", pass, fail);
+ writeField(_fGpsTime, buf, size, true);
+}
+
diff --git a/Layout/LayoutSurveySuccess.h b/Layout/LayoutSurveySuccess.h
index dd7e740..49113cb 100644
--- a/Layout/LayoutSurveySuccess.h
+++ b/Layout/LayoutSurveySuccess.h
@@ -16,12 +16,14 @@ class LayoutSurveySuccess : public Layout {
void updatePower(uint32_t power);
void updateStats(LoRaHandler::LoRaPing ping);
void updateGpsLatitude(GPSPARSER::latitude lat);
+ void updateGpsLatitude(std::string msg);
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);
+ void updatePassFail(uint8_t pass, uint8_t fail);
private:
Label _lId;
diff --git a/Layout/LayoutSweepProgress.cpp b/Layout/LayoutSweepProgress.cpp
index 9ec77cc..ec4bbc9 100644
--- a/Layout/LayoutSweepProgress.cpp
+++ b/Layout/LayoutSweepProgress.cpp
@@ -2,12 +2,10 @@
LayoutSweepProgress::LayoutSweepProgress(DOGS102* lcd)
: Layout(lcd),
- _lSlash(8, 1, "/"),
- _lMsg1(5, 2, "Sweep"),
+ _lMsg1(6, 2, "Sweep"),
_lMsg2(7, 3, "in"),
_lMsg3(4, 4, "Progress"),
- _fComplete(6, 1, 2),
- _fTotal(9, 1, 2),
+ _fProgress(6, 1, 5),
_fCountdownLabel(0, 6, 17),
_fCountdown(0, 7, 9)
{}
@@ -18,7 +16,6 @@ void LayoutSweepProgress::display() {
clear();
startUpdate();
- writeLabel(_lSlash);
writeLabel(_lMsg1);
writeLabel(_lMsg2);
writeLabel(_lMsg3);
@@ -31,12 +28,8 @@ void LayoutSweepProgress::updateProgress(uint8_t complete, uint8_t total) {
size_t size;
memset(buf, 0, sizeof(buf));
- size = snprintf(buf, sizeof(buf), "%2u", complete);
- writeField(_fComplete, buf, size, true);
-
- memset(buf, 0, sizeof(buf));
- size = snprintf(buf, sizeof(buf), "%u", total);
- writeField(_fTotal, buf, size, true);
+ size = snprintf(buf, sizeof(buf), "%u/%u", complete, total);
+ writeField(_fProgress, buf, size, true);
}
void LayoutSweepProgress::updateCountdown(uint32_t seconds) {
diff --git a/Layout/LayoutSweepProgress.h b/Layout/LayoutSweepProgress.h
index 82c8081..d8e8720 100644
--- a/Layout/LayoutSweepProgress.h
+++ b/Layout/LayoutSweepProgress.h
@@ -14,13 +14,11 @@ class LayoutSweepProgress : public Layout {
void updateCountdown(uint32_t seconds);
private:
- Label _lSlash;
Label _lMsg1;
Label _lMsg2;
Label _lMsg3;
- Field _fComplete;
- Field _fTotal;
+ Field _fProgress;
Field _fCountdownLabel;
Field _fCountdown;
};
diff --git a/Mode/ModeSingle.cpp b/Mode/ModeSingle.cpp
index 6150128..083b72d 100644
--- a/Mode/ModeSingle.cpp
+++ b/Mode/ModeSingle.cpp
@@ -80,7 +80,7 @@ bool ModeSingle::start() {
break;
case failure:
incrementRatePower();
- _failure.updateInfo(formatNewRatePower());
+ _failure.updateInfo2(formatNewRatePower());
logInfo("new data rate %u, power %lu", _data_rate, _power);
break;
}
@@ -189,6 +189,8 @@ bool ModeSingle::start() {
updateData(_data, single, false);
appendDataFile(_data);
_failure.updatePower(_power);
+ _failure.updateSw1(" Power");
+ _failure.updateSw2("Survey");
logInfo("ping failed");
break;
case success:
@@ -311,7 +313,7 @@ void ModeSingle::displaySuccess() {
// display GPS latitude, longitude, and time
// else
// display "no lock"
- _success.updateInfo("No GPS Lock");
+ _success.updateGpsLatitude("No GPS Lock");
}
std::string ModeSingle::formatNewRatePower() {
diff --git a/Mode/ModeSweep.cpp b/Mode/ModeSweep.cpp
index a62d79c..938ec83 100644
--- a/Mode/ModeSweep.cpp
+++ b/Mode/ModeSweep.cpp
@@ -226,9 +226,11 @@ bool ModeSweep::start() {
_failure.updateId(_index);
// mDot::DataRateStr returns format SF_XX - we only want to display the XX part
_failure.updateRate(_dot->DataRateStr(_data_rate).substr(3));
+ _failure.updatePower(_power);
+ _failure.updatePassFail(_survey_success, _survey_failure);
+ _failure.updateSw1(" Cancel");
updateData(_data, sweep, false);
appendDataFile(_data);
- _failure.updatePower(_power);
logInfo("ping failed");
_display_timer.start();
break;
@@ -383,7 +385,8 @@ void ModeSweep::displaySuccess() {
// display GPS latitude, longitude, and time
// else
// display "no lock"
- _success.updateInfo("No GPS Lock");
+ _success.updateGpsLatitude("No GPS Lock");
+ _success.updatePassFail(_survey_success, _survey_failure);
}
std::vector<point> ModeSweep::generatePoints() {