diff options
author | Mike Fiore <mfiore@multitech.com> | 2015-11-30 15:50:22 -0600 |
---|---|---|
committer | Mike Fiore <mfiore@multitech.com> | 2015-11-30 15:50:22 -0600 |
commit | 37260f2ccff2793f54bfd291169d2c8d879bbc15 (patch) | |
tree | b908d697eb6f2d1ba2c305eacc3c7c7bb6203122 /Layout/LayoutSweepProgress.cpp | |
parent | 30b4f15aa70d24ec0a6b6bb1b3f5039c4921cb02 (diff) | |
download | mtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.tar.gz mtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.tar.bz2 mtdot-box-evb-factory-firmware-37260f2ccff2793f54bfd291169d2c8d879bbc15.zip |
start work on survey sweep - currently determines rates and power levels to use and prints them out
Diffstat (limited to 'Layout/LayoutSweepProgress.cpp')
-rw-r--r-- | Layout/LayoutSweepProgress.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Layout/LayoutSweepProgress.cpp b/Layout/LayoutSweepProgress.cpp new file mode 100644 index 0000000..9ec77cc --- /dev/null +++ b/Layout/LayoutSweepProgress.cpp @@ -0,0 +1,53 @@ +#include "LayoutSweepProgress.h" + +LayoutSweepProgress::LayoutSweepProgress(DOGS102* lcd) + : Layout(lcd), + _lSlash(8, 1, "/"), + _lMsg1(5, 2, "Sweep"), + _lMsg2(7, 3, "in"), + _lMsg3(4, 4, "Progress"), + _fComplete(6, 1, 2), + _fTotal(9, 1, 2), + _fCountdownLabel(0, 6, 17), + _fCountdown(0, 7, 9) +{} + +LayoutSweepProgress::~LayoutSweepProgress() {} + +void LayoutSweepProgress::display() { + clear(); + startUpdate(); + + writeLabel(_lSlash); + writeLabel(_lMsg1); + writeLabel(_lMsg2); + writeLabel(_lMsg3); + + endUpdate(); +} + +void LayoutSweepProgress::updateProgress(uint8_t complete, uint8_t total) { + char buf[8]; + 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); +} + +void LayoutSweepProgress::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(_fCountdownLabel, "No Free Channel ", true); + size = snprintf(buf, sizeof(buf), "%lu s", seconds); + writeField(_fCountdown, buf, size, true); +} + |