summaryrefslogtreecommitdiff
path: root/Layout
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-11-19 09:16:44 -0600
committerMike Fiore <mfiore@multitech.com>2015-11-19 09:16:44 -0600
commita683f4689264f85953c246ac15492bad25974197 (patch)
treeb35489d769204cea05d19ce1c255f62fcb227ef3 /Layout
parent8167e5ad0453f2e6855f9622c2acddb9cf55c941 (diff)
downloadmtdot-box-evb-factory-firmware-a683f4689264f85953c246ac15492bad25974197.tar.gz
mtdot-box-evb-factory-firmware-a683f4689264f85953c246ac15492bad25974197.tar.bz2
mtdot-box-evb-factory-firmware-a683f4689264f85953c246ac15492bad25974197.zip
use a single layout for help screens as they're basically all the same, misc tweaks and fixes
Diffstat (limited to 'Layout')
-rw-r--r--Layout/LayoutDemoHelp.cpp28
-rw-r--r--Layout/LayoutDemoHelp.h22
-rw-r--r--Layout/LayoutHelp.cpp40
-rw-r--r--Layout/LayoutHelp.h28
-rw-r--r--Layout/LayoutJoin.cpp2
5 files changed, 69 insertions, 51 deletions
diff --git a/Layout/LayoutDemoHelp.cpp b/Layout/LayoutDemoHelp.cpp
deleted file mode 100644
index dab907e..0000000
--- a/Layout/LayoutDemoHelp.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "LayoutDemoHelp.h"
-
-LayoutDemoHelp::LayoutDemoHelp(DOGS102* lcd)
- : Layout(lcd),
- _lMode(0, 0, "LoRa Demo"),
- _lDesc(0, 1, "Select TX Method"),
- _lIns1(0, 4, "Hold SW1 any time"),
- _lIns2(0, 5, "for Main Menu"),
- _lSw1(10, 7, "Trigger"),
- _lSw2(0, 7, "Interval")
-{}
-
-LayoutDemoHelp::~LayoutDemoHelp() {}
-
-void LayoutDemoHelp::display() {
- clear();
- startUpdate();
-
- writeLabel(_lMode);
- writeLabel(_lDesc);
- writeLabel(_lIns1);
- writeLabel(_lIns2);
- writeLabel(_lSw1);
- writeLabel(_lSw2);
-
- endUpdate();
-}
-
diff --git a/Layout/LayoutDemoHelp.h b/Layout/LayoutDemoHelp.h
deleted file mode 100644
index 3e20df9..0000000
--- a/Layout/LayoutDemoHelp.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __LAYOUTDEMOHELP_H__
-#define __LAYOUTDEMOHELP_H__
-
-#include "Layout.h"
-
-class LayoutDemoHelp : public Layout {
- public:
- LayoutDemoHelp(DOGS102* lcd);
- ~LayoutDemoHelp();
-
- void display();
-
- private:
- Label _lMode;
- Label _lDesc;
- Label _lIns1;
- Label _lIns2;
- Label _lSw1;
- Label _lSw2;
-};
-
-#endif
diff --git a/Layout/LayoutHelp.cpp b/Layout/LayoutHelp.cpp
new file mode 100644
index 0000000..0e029de
--- /dev/null
+++ b/Layout/LayoutHelp.cpp
@@ -0,0 +1,40 @@
+#include "LayoutHelp.h"
+
+LayoutHelp::LayoutHelp(DOGS102* lcd)
+ : Layout(lcd),
+ _lIns1(0, 4, "Hold SW1 any time"),
+ _lIns2(0, 5, "for Main Menu"),
+ _fMode(0, 0, 17),
+ _fDesc(0, 1, 17),
+ _fSw1(9, 7, 8),
+ _fSw2(0, 7, 8)
+{}
+
+LayoutHelp::~LayoutHelp() {}
+
+void LayoutHelp::display() {
+ clear();
+ startUpdate();
+
+ writeLabel(_lIns1);
+ writeLabel(_lIns2);
+
+ endUpdate();
+}
+
+void LayoutHelp::updateMode(std::string mode) {
+ writeField(_fMode, mode);
+}
+
+void LayoutHelp::updateDescription(std::string description) {
+ writeField(_fDesc, description);
+}
+
+void LayoutHelp::updateSw1(std::string s) {
+ writeField(_fSw1, s);
+}
+
+void LayoutHelp::updateSw2(std::string s) {
+ writeField(_fSw2, s);
+}
+
diff --git a/Layout/LayoutHelp.h b/Layout/LayoutHelp.h
new file mode 100644
index 0000000..58ddf7c
--- /dev/null
+++ b/Layout/LayoutHelp.h
@@ -0,0 +1,28 @@
+#ifndef __LAYOUTHELP_H__
+#define __LAYOUTHELP_H__
+
+#include "Layout.h"
+
+class LayoutHelp : public Layout {
+ public:
+ LayoutHelp(DOGS102* lcd);
+ ~LayoutHelp();
+
+ void display();
+ void updateMode(std::string mode);
+ void updateDescription(std::string description);
+ void updateSw1(std::string s);
+ void updateSw2(std::string s);
+
+ private:
+ Label _lIns1;
+ Label _lIns2;
+
+ Field _fMode;
+ Field _fDesc;
+ Field _fSw1;
+ Field _fSw2;
+
+};
+
+#endif
diff --git a/Layout/LayoutJoin.cpp b/Layout/LayoutJoin.cpp
index 3b67c28..6a2e3be 100644
--- a/Layout/LayoutJoin.cpp
+++ b/Layout/LayoutJoin.cpp
@@ -85,7 +85,7 @@ void LayoutJoin::updateCountdown(uint32_t seconds) {
char buf[16];
size_t size;
- writeField(_fCountdownLabel, "No Free Channel");
+ writeField(_fCountdownLabel, "No Free Channel", true);
size = snprintf(buf, sizeof(buf), "%lu", seconds);
writeField(_fPower, buf, size, true);
}