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 /Mode/ModeSweep.h | |
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 'Mode/ModeSweep.h')
-rw-r--r-- | Mode/ModeSweep.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Mode/ModeSweep.h b/Mode/ModeSweep.h new file mode 100644 index 0000000..5eebda1 --- /dev/null +++ b/Mode/ModeSweep.h @@ -0,0 +1,60 @@ +#ifndef __MODESWEEP_H__ +#define __MODESWEEP_H__ + +#include "Mode.h" +#include "LayoutHelp.h" +#include "LayoutFile.h" +#include "LayoutConfirm.h" +#include "LayoutSweepProgress.h" +#include "LayoutSurveySuccess.h" +#include "LayoutSurveyFailure.h" +#include "LayoutSweepComplete.h" + +typedef std::pair<uint8_t, uint32_t> point; + +class ModeSweep : public Mode { + public: + ModeSweep(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora); + ~ModeSweep(); + + bool start(); + + private: + void displayHelp(); + void displaySuccess(); + std::vector<point> generatePoints(); + uint8_t payloadToRate(uint8_t payload); + + typedef enum { + check_file = 0, + confirm, + show_help, + in_progress, + success, + data, + failure, + complete + } state; + + LayoutHelp _help; + LayoutFile _file; + LayoutConfirm _confirm; + LayoutSweepProgress _progress; + LayoutSurveySuccess _success; + LayoutSurveyFailure _failure; + LayoutSweepComplete _complete; + DataItem _data; + + uint8_t _min_payload; + uint8_t _max_payload; + uint32_t _min_power; + uint32_t _max_power; + uint8_t _survey_current; + uint8_t _survey_total; + uint8_t _survey_success; + uint8_t _survey_failure; + std::vector<point> _points; + Timer _display_timer; +}; + +#endif |