summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Klaassen <ryan.klaassen@multitech.com>2016-08-16 14:10:00 -0500
committerRyan Klaassen <ryan.klaassen@multitech.com>2016-08-16 14:10:00 -0500
commitda0143627375761a5cb07a1f315aae3135f18b9e (patch)
treed660a6293db12ba6c1058284be1276c2ea8f140a
parentb3bccc99b3e9a1403ad000c06d7786832e71251c (diff)
downloadmtdot-box-evb-factory-firmware-da0143627375761a5cb07a1f315aae3135f18b9e.tar.gz
mtdot-box-evb-factory-firmware-da0143627375761a5cb07a1f315aae3135f18b9e.tar.bz2
mtdot-box-evb-factory-firmware-da0143627375761a5cb07a1f315aae3135f18b9e.zip
Replace Layout.h
-rw-r--r--Layout/Layout.h84
1 files changed, 48 insertions, 36 deletions
diff --git a/Layout/Layout.h b/Layout/Layout.h
index c493ce2..90ffe8d 100644
--- a/Layout/Layout.h
+++ b/Layout/Layout.h
@@ -16,49 +16,61 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef __LAYOUTJOIN_H__
-#define __LAYOUTJOIN_H__
+#ifndef __LAYOUT_H__
+#define __LAYOUT_H__
-#include "Layout.h"
-#include "mDot.h"
+#include "DOGS102.h"
+#include <string>
-class LayoutJoin : public Layout {
+class Label {
public:
- LayoutJoin(DOGS102* lcd, uint8_t band);
- ~LayoutJoin();
+ Label(uint8_t col, uint8_t row, std::string value);
- void display();
- void displayEditFsb(uint8_t rate, uint32_t power, uint8_t band, string key, string id);
+ uint8_t _col;
+ uint8_t _row;
+ std::string _value;
+};
+
+class Field {
+ public:
+ Field(uint8_t col, uint8_t row, uint8_t maxSize);
+
+ uint8_t _col;
+ uint8_t _row;
+ uint8_t _maxSize;
+};
+
+class Image {
+ public:
+ Image(uint8_t col, uint8_t row, const uint8_t* bmp);
+
+ uint8_t _col;
+ uint8_t _row;
+ const uint8_t* _bmp;
+};
- void updateId(std::string id);
- void updateKey(std::string key);
- void updateFsb(uint8_t band);
- void updateJoinFsb(uint8_t band);
- void updateRate(uint8_t rate);
- void updatePower(uint32_t power);
- void updateAttempt(uint32_t attempt);
- void updateStatus(std::string status);
- void updateCountdown(uint32_t seconds);
- void displayCancel(bool display = true);
+class Layout {
+ public:
+ Layout(DOGS102* lcd);
+ ~Layout();
+
+ virtual void display() = 0;
+
+ protected:
+ void clear();
+ void startUpdate();
+ void endUpdate();
+ bool writeLabel(const Label& label);
+ bool writeField(const Field& field, const std::string& value, bool apply = false);
+ bool writeField(const Field& field, const char* value, size_t size, bool apply = false);
+ bool writeImage(const Image& image, bool apply = false);
+ void removeField(const Field& field);
private:
- Label _lId;
- Label _lKey;
- Label _lFsb;
- Label _lRate;
- Label _lPower;
- Label _lAttempt;
+ bool writeText(uint8_t col, uint8_t row, const char* value, size_t size);
+ bool writeBmp(uint8_t col, uint8_t row, const uint8_t* bmp);
- Field _fStatus;
- Field _fId;
- Field _fKey;
- Field _fFsb;
- Field _fRate;
- Field _fPower;
- Field _fAttempt;
- Field _fCountdown;
- Field _fCountdownLabel;
- Field _fCancel;
- uint8_t _band;
+ DOGS102* _lcd;
};
+
#endif