Gave screens meaningful names. Set Clock and Timer screens now branch from Clock Screen.
This commit is contained in:
parent
4d12334823
commit
71abd19e52
|
@ -22,7 +22,7 @@
|
|||
#include "128x64OLED.h"
|
||||
#include "fonts/tahoma16.h"
|
||||
#include "fonts/Icons.h"
|
||||
#include "Screen2.h"
|
||||
#include "BasicScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "../Utility/UtilClasses.h"
|
||||
|
@ -32,13 +32,13 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen2
|
||||
// CBasicScreen
|
||||
//
|
||||
// This screen provides a basic control function
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CScreen2::CScreen2(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CBasicScreen::CBasicScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_showSetMode = 0;
|
||||
_showMode = 0;
|
||||
|
@ -46,7 +46,7 @@ CScreen2::CScreen2(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(d
|
|||
}
|
||||
|
||||
void
|
||||
CScreen2::show()
|
||||
CBasicScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -122,7 +122,7 @@ CScreen2::show()
|
|||
|
||||
|
||||
void
|
||||
CScreen2::keyHandler(uint8_t event)
|
||||
CBasicScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
static int repeatCount = -1;
|
||||
|
||||
|
@ -230,7 +230,7 @@ CScreen2::keyHandler(uint8_t event)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen2::showRunState()
|
||||
CBasicScreen::showRunState()
|
||||
{
|
||||
int runstate = getHeaterInfo().getRunState();
|
||||
int errstate = getHeaterInfo().getErrState();
|
|
@ -26,14 +26,14 @@ class C128x64_OLED;
|
|||
class CScreenManager;
|
||||
class CProtocolPackage;
|
||||
|
||||
class CScreen2 : public CScreenHeader
|
||||
class CBasicScreen : public CScreenHeader
|
||||
{
|
||||
unsigned long _showSetMode;
|
||||
unsigned long _showMode;
|
||||
unsigned char _nModeSel;
|
||||
void showRunState();
|
||||
public:
|
||||
CScreen2(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CBasicScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
||||
bool animate() { return CScreen::animate(); };
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "Screen8.h"
|
||||
#include "ClockScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "fonts/Tahoma16.h"
|
||||
|
@ -27,27 +27,27 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen8
|
||||
// CClockScreen
|
||||
//
|
||||
// This screen presents a large format clock
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
CScreen8::CScreen8(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CClockScreen::CClockScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_colon = false;
|
||||
}
|
||||
|
||||
void
|
||||
CScreen8::showTime(int)
|
||||
CClockScreen::showTime(int)
|
||||
{
|
||||
// override and DO NOTHING!
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CScreen8::show()
|
||||
CClockScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -72,7 +72,7 @@ CScreen8::show()
|
|||
|
||||
|
||||
void
|
||||
CScreen8::keyHandler(uint8_t event)
|
||||
CClockScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
if(event & keyPressed) {
|
||||
// press CENTRE
|
||||
|
@ -87,6 +87,14 @@ CScreen8::keyHandler(uint8_t event)
|
|||
if(event & key_Right) {
|
||||
_ScreenManager.nextScreen();
|
||||
}
|
||||
// press UP
|
||||
if(event & key_Up) {
|
||||
_ScreenManager.selectSetTimeScreen(true); // switch to clock set screen
|
||||
}
|
||||
// press DOWN
|
||||
if(event & key_Down) {
|
||||
_ScreenManager.selectTimerScreen(true); // switch to timer set screen loop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,12 +25,12 @@
|
|||
class C128x64_OLED;
|
||||
class CScreenManager;
|
||||
|
||||
class CScreen8 : public CScreenHeader {
|
||||
class CClockScreen : public CScreenHeader {
|
||||
protected:
|
||||
virtual void showTime(int numTimers);
|
||||
bool _colon;
|
||||
public:
|
||||
CScreen8(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CClockScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
||||
};
|
|
@ -23,7 +23,7 @@
|
|||
#include "fonts/MiniFont.h"
|
||||
#include "fonts/Icons.h"
|
||||
#include "../Bluetooth/BluetoothAbstract.h"
|
||||
#include "Screen1.h"
|
||||
#include "DetailedScreen.h"
|
||||
#include "../Wifi/BTCWifi.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
|
@ -54,13 +54,13 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen1
|
||||
// CDetailedScreen
|
||||
//
|
||||
// This screen provides a detailed control/status function
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CScreen1::CScreen1(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CDetailedScreen::CDetailedScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_animatePump = false;
|
||||
_animateRPM = false;
|
||||
|
@ -74,7 +74,7 @@ CScreen1::CScreen1(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(d
|
|||
|
||||
|
||||
void
|
||||
CScreen1::show()
|
||||
CDetailedScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -123,7 +123,7 @@ CScreen1::show()
|
|||
|
||||
|
||||
bool
|
||||
CScreen1::animate()
|
||||
CDetailedScreen::animate()
|
||||
{
|
||||
bool retval = CScreenHeader::animate();
|
||||
|
||||
|
@ -166,7 +166,7 @@ CScreen1::animate()
|
|||
|
||||
|
||||
void
|
||||
CScreen1::keyHandler(uint8_t event)
|
||||
CDetailedScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
|
||||
if(event & keyPressed) {
|
||||
|
@ -219,7 +219,7 @@ CScreen1::keyHandler(uint8_t event)
|
|||
|
||||
#define TEMP_YPOS(A) ((20 - int(A)) + 27) // 26 is location of 20deg tick
|
||||
void
|
||||
CScreen1::showThermometer(float desired, float actual)
|
||||
CDetailedScreen::showThermometer(float desired, float actual)
|
||||
{
|
||||
char msg[16];
|
||||
// draw bulb design
|
||||
|
@ -266,7 +266,7 @@ CScreen1::showThermometer(float desired, float actual)
|
|||
|
||||
#define BODY_YPOS(A) ((((100 - A) * 3) / 16) + 22) // 100degC centre - ticks +- 80C
|
||||
void
|
||||
CScreen1::showBodyThermometer(int actual)
|
||||
CDetailedScreen::showBodyThermometer(int actual)
|
||||
{
|
||||
// draw bulb design
|
||||
_display.drawBitmap(X_BODY_BULB, Y_BULB, bodyThermometerIcon, 8, 50, WHITE);
|
||||
|
@ -289,7 +289,7 @@ CScreen1::showBodyThermometer(int actual)
|
|||
|
||||
|
||||
void
|
||||
CScreen1::showGlowPlug(float power)
|
||||
CDetailedScreen::showGlowPlug(float power)
|
||||
{
|
||||
_display.drawBitmap(X_GLOW_ICON, Y_GLOW_ICON, GlowPlugIcon, W_GLOW_ICON, H_GLOW_ICON, WHITE);
|
||||
// _animateGlow = true;
|
||||
|
@ -304,7 +304,7 @@ CScreen1::showGlowPlug(float power)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen1::showFan(int RPM)
|
||||
CDetailedScreen::showFan(int RPM)
|
||||
{
|
||||
// NOTE: fan rotation animation performed in animateOLED
|
||||
_animateRPM = RPM != 0; // used by animation routine
|
||||
|
@ -319,7 +319,7 @@ CScreen1::showFan(int RPM)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen1::showFuel(float rate)
|
||||
CDetailedScreen::showFuel(float rate)
|
||||
{
|
||||
// NOTE: fuel drop animation performed in animateOLED
|
||||
_animatePump = rate != 0; // used by animation routine
|
||||
|
@ -334,7 +334,7 @@ CScreen1::showFuel(float rate)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen1::showRunState(int runstate, int errstate)
|
||||
CDetailedScreen::showRunState(int runstate, int errstate)
|
||||
{
|
||||
static bool toggle = false;
|
||||
const char* toPrint = NULL;
|
|
@ -25,7 +25,7 @@
|
|||
class C128x64_OLED;
|
||||
class CScreenManager;
|
||||
|
||||
class CScreen1 : public CScreenHeader
|
||||
class CDetailedScreen : public CScreenHeader
|
||||
{
|
||||
bool _animatePump;
|
||||
bool _animateRPM;
|
||||
|
@ -45,7 +45,7 @@ class CScreen1 : public CScreenHeader
|
|||
void showFuel(float rate);
|
||||
void showRunState(int state, int errstate);
|
||||
public:
|
||||
CScreen1(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CDetailedScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
bool animate();
|
||||
void keyHandler(uint8_t event);
|
|
@ -22,20 +22,20 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen5
|
||||
// CFuelMixtureScreen
|
||||
//
|
||||
// This screen allows the fuel mixture endpoints to be adjusted
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Screen5.h"
|
||||
#include "FuelMixtureScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "../Wifi/BTCWifi.h"
|
||||
#include "fonts/Arial.h"
|
||||
|
||||
|
||||
CScreen5::CScreen5(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CFuelMixtureScreen::CFuelMixtureScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_rowSel = 0;
|
||||
_colSel = 0;
|
||||
|
@ -45,7 +45,7 @@ CScreen5::CScreen5(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(d
|
|||
|
||||
|
||||
void
|
||||
CScreen5::show()
|
||||
CFuelMixtureScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -125,7 +125,7 @@ CScreen5::show()
|
|||
|
||||
|
||||
void
|
||||
CScreen5::keyHandler(uint8_t event)
|
||||
CFuelMixtureScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
|
||||
if(event & keyPressed) {
|
||||
|
@ -280,7 +280,7 @@ CScreen5::keyHandler(uint8_t event)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen5::_showPassword()
|
||||
CFuelMixtureScreen::_showPassword()
|
||||
{
|
||||
// determine metrics of character sizing
|
||||
CRect extents;
|
||||
|
@ -307,7 +307,7 @@ CScreen5::_showPassword()
|
|||
}
|
||||
|
||||
void
|
||||
CScreen5::_adjustSetting(int dir)
|
||||
CFuelMixtureScreen::_adjustSetting(int dir)
|
||||
{
|
||||
switch(_rowSel) {
|
||||
case 2:
|
|
@ -26,7 +26,7 @@ class C128x64_OLED;
|
|||
class CScreenManager;
|
||||
class CProtocol;
|
||||
|
||||
class CScreen5 : public CScreenHeader {
|
||||
class CFuelMixtureScreen : public CScreenHeader {
|
||||
int _PWdig[4];
|
||||
float adjPump[2];
|
||||
short adjFan[2];
|
||||
|
@ -36,7 +36,7 @@ class CScreen5 : public CScreenHeader {
|
|||
void _adjustSetting(int dir);
|
||||
|
||||
public:
|
||||
CScreen5(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CFuelMixtureScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
||||
bool animate() { return CScreen::animate(); };
|
|
@ -19,13 +19,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "Screen3.h"
|
||||
#include "PrimingScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen3
|
||||
// CPrimingScreen
|
||||
//
|
||||
// This screen allows the temperature control mode to be selected and
|
||||
// allows pump priming
|
||||
|
@ -33,7 +33,7 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
CScreen3::CScreen3(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CPrimingScreen::CPrimingScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_PrimeStop = 0;
|
||||
_PrimeCheck = 0;
|
||||
|
@ -43,7 +43,7 @@ CScreen3::CScreen3(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(d
|
|||
|
||||
|
||||
void
|
||||
CScreen3::show()
|
||||
CPrimingScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -103,7 +103,7 @@ CScreen3::show()
|
|||
|
||||
|
||||
void
|
||||
CScreen3::keyHandler(uint8_t event)
|
||||
CPrimingScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
|
||||
if(event & keyPressed) {
|
||||
|
@ -181,7 +181,7 @@ CScreen3::keyHandler(uint8_t event)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen3::stopPump()
|
||||
CPrimingScreen::stopPump()
|
||||
{
|
||||
reqPumpPrime(false);
|
||||
_PrimeCheck = 0;
|
|
@ -25,14 +25,14 @@
|
|||
class C128x64_OLED;
|
||||
class CScreenManager;
|
||||
|
||||
class CScreen3 : public CScreenHeader {
|
||||
class CPrimingScreen : public CScreenHeader {
|
||||
unsigned long _PrimeStop;
|
||||
unsigned long _PrimeCheck;
|
||||
int _rowSel;
|
||||
int _colSel;
|
||||
void stopPump();
|
||||
public:
|
||||
CScreen3(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CPrimingScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
||||
bool animate() { return CScreen::animate(); };
|
|
@ -1,221 +0,0 @@
|
|||
/*
|
||||
* This file is part of the "bluetoothheater" distribution
|
||||
* (https://gitlab.com/mrjones.id.au/bluetoothheater)
|
||||
*
|
||||
* Copyright (C) 2018 Ray Jones <ray@mrjones.id.au>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen5
|
||||
//
|
||||
// This screen allows the real time clock to be adjusted
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Screen6.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "fonts/Arial.h"
|
||||
#include "../RTC/Clock.h"
|
||||
|
||||
|
||||
CScreen6::CScreen6(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_rowSel = 0;
|
||||
_colSel = 0;
|
||||
_nextT = millis();
|
||||
}
|
||||
|
||||
void
|
||||
CScreen6::showTime(int)
|
||||
{
|
||||
// override and DO NOTHING!
|
||||
}
|
||||
|
||||
void
|
||||
CScreen6::show()
|
||||
{
|
||||
long deltaT = millis() - _nextT;
|
||||
if(deltaT >= 0) {
|
||||
_nextT += 1000;
|
||||
|
||||
CScreenHeader::show();
|
||||
|
||||
char str[16];
|
||||
int xPos, yPos;
|
||||
const int col2 = 90;
|
||||
const int col3 = _display.width() - border;
|
||||
|
||||
_printInverted(0, 16, " Clock ", true);
|
||||
|
||||
const BTCDateTime& now = Clock.get();
|
||||
switch(_rowSel) {
|
||||
case 0:
|
||||
// update printable values
|
||||
working = now;
|
||||
// DELIBERATE DROP THROUGH HERE
|
||||
case 1:
|
||||
yPos = 28;
|
||||
xPos = 6;
|
||||
// date
|
||||
if(_rowSel==0) {
|
||||
xPos = 20;
|
||||
_printMenuText(xPos, yPos, working.dowStr());
|
||||
}
|
||||
|
||||
sprintf(str, "%d", working.day());
|
||||
xPos += 20 + 12;
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1 && _colSel==0, eRightJustify);
|
||||
xPos += 4;
|
||||
_printMenuText(xPos, yPos, working.monthStr(), _rowSel==1 && _colSel==1);
|
||||
xPos += 22;
|
||||
sprintf(str, "%d", working.year());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1 && _colSel==2);
|
||||
// time
|
||||
yPos = 40;
|
||||
xPos = 26;
|
||||
sprintf(str, "%02d", working.hour());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1 && _colSel==3);
|
||||
xPos += 16;
|
||||
_printMenuText(xPos, yPos, ":");
|
||||
xPos += 8;
|
||||
sprintf(str, "%02d", working.minute());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1 && _colSel==4);
|
||||
xPos += 16;
|
||||
_printMenuText(xPos, yPos, ":");
|
||||
sprintf(str, "%02d", working.second());
|
||||
xPos += 8;
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1 && _colSel==5);
|
||||
if(_rowSel==1)
|
||||
_printMenuText(_display.width()-border, yPos, "SET", _colSel==6, eRightJustify);
|
||||
// navigation line
|
||||
yPos = 53;
|
||||
xPos = _display.xCentre();
|
||||
_printMenuText(xPos, yPos, "<- ->", _rowSel==0, eCentreJustify);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CScreen6::keyHandler(uint8_t event)
|
||||
{
|
||||
|
||||
if(event & keyPressed) {
|
||||
// press CENTRE
|
||||
if(event & key_Centre) {
|
||||
switch(_rowSel) {
|
||||
case 1:
|
||||
_rowSel = 0;
|
||||
if(_colSel == 6) { // set the RTC!
|
||||
Clock.set(working);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// press LEFT
|
||||
if(event & key_Left) {
|
||||
switch(_rowSel) {
|
||||
case 0:
|
||||
_ScreenManager.prevScreen();
|
||||
break;
|
||||
case 1:
|
||||
_colSel--;
|
||||
ROLLLOWERLIMIT(_colSel, 0, 6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// press RIGHT
|
||||
if(event & key_Right) {
|
||||
switch(_rowSel) {
|
||||
case 0:
|
||||
_ScreenManager.nextScreen();
|
||||
break;
|
||||
case 1:
|
||||
_colSel++;
|
||||
ROLLUPPERLIMIT(_colSel, 6, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// press UP
|
||||
if(event & key_Up) {
|
||||
switch(_rowSel) {
|
||||
case 0:
|
||||
_rowSel = 1;
|
||||
_colSel = 0;
|
||||
break;
|
||||
case 1:
|
||||
adjTimeDate(+1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// press DOWN
|
||||
if(event & key_Down) {
|
||||
switch(_rowSel) {
|
||||
case 1:
|
||||
adjTimeDate(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(event & keyRepeat) {
|
||||
if(_rowSel==1) {
|
||||
// press UP
|
||||
if(event & key_Up) {
|
||||
adjTimeDate(+1);
|
||||
}
|
||||
// press DOWN
|
||||
if(event & key_Down) {
|
||||
adjTimeDate(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_nextT = millis();
|
||||
_ScreenManager.reqUpdate();
|
||||
}
|
||||
|
||||
void
|
||||
CScreen6::adjTimeDate(int dir)
|
||||
{
|
||||
int days;
|
||||
switch(_colSel) {
|
||||
case 0:
|
||||
working.adjustDay(dir);
|
||||
break;
|
||||
case 1:
|
||||
working.adjustMonth(dir);
|
||||
break;
|
||||
case 2:
|
||||
working.adjustYear(dir);
|
||||
break;
|
||||
case 3:
|
||||
working.adjustHour(dir);
|
||||
break;
|
||||
case 4:
|
||||
working.adjustMinute(dir);
|
||||
break;
|
||||
case 5:
|
||||
working.adjustSecond(dir);
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
#include "ScreenManager.h"
|
||||
#include "Screen1.h"
|
||||
#include "Screen2.h"
|
||||
#include "Screen3.h"
|
||||
#include "Screen4.h"
|
||||
#include "Screen5.h"
|
||||
#include "Screen6.h"
|
||||
#include "Screen7.h"
|
||||
#include "Screen8.h"
|
||||
#include "DetailedScreen.h"
|
||||
#include "BasicScreen.h"
|
||||
#include "PrimingScreen.h"
|
||||
#include "WiFiScreen.h"
|
||||
#include "FuelMixtureScreen.h"
|
||||
#include "SetClockScreen.h"
|
||||
#include "SetTimerScreen.h"
|
||||
#include "ClockScreen.h"
|
||||
#include "RebootScreen.h"
|
||||
#include <Wire.h>
|
||||
#include "../cfg/pins.h"
|
||||
|
@ -95,7 +95,9 @@ CScreenManager::CScreenManager()
|
|||
{
|
||||
_pDisplay = NULL;
|
||||
_currentScreen = -1;
|
||||
_timerScreen = -1;
|
||||
_bReqUpdate = false;
|
||||
_bSetTime = false;
|
||||
_DimTime = millis() + 60000;
|
||||
_pRebootScreen = NULL;
|
||||
}
|
||||
|
@ -108,6 +110,16 @@ CScreenManager::~CScreenManager()
|
|||
_Screens[i] = NULL;
|
||||
}
|
||||
}
|
||||
for(int i=0; i < _TimerScreens.size(); i++) {
|
||||
if(_TimerScreens[i]) {
|
||||
delete _TimerScreens[i];
|
||||
_TimerScreens[i] = NULL;
|
||||
}
|
||||
}
|
||||
if(_SetTimeScreen) {
|
||||
delete _SetTimeScreen;
|
||||
_SetTimeScreen = NULL;
|
||||
}
|
||||
if(_pDisplay) {
|
||||
delete _pDisplay; _pDisplay = NULL;
|
||||
}
|
||||
|
@ -137,15 +149,15 @@ CScreenManager::begin()
|
|||
_pDisplay->display();
|
||||
|
||||
DebugPort.println("Creating Screens");
|
||||
_Screens.push_back(new CScreen1(*_pDisplay, *this)); // 0: detail control
|
||||
_Screens.push_back(new CScreen2(*_pDisplay, *this)); // 1: basic control
|
||||
_Screens.push_back(new CScreen8(*_pDisplay, *this)); // 2: clock
|
||||
_Screens.push_back(new CScreen3(*_pDisplay, *this)); // 3: mode / priming
|
||||
_Screens.push_back(new CScreen4(*_pDisplay, *this)); // 4: comms info
|
||||
_Screens.push_back(new CScreen5(*_pDisplay, *this)); // 5: tuning
|
||||
_Screens.push_back(new CScreen6(*_pDisplay, *this)); // 6: clock set
|
||||
_Screens.push_back(new CScreen7(*_pDisplay, *this, 0)); // 7: set timer 1
|
||||
_Screens.push_back(new CScreen7(*_pDisplay, *this, 1)); // 8: set timer 2
|
||||
_Screens.push_back(new CDetailedScreen(*_pDisplay, *this)); // 0: detail control
|
||||
_Screens.push_back(new CBasicScreen(*_pDisplay, *this)); // 1: basic control
|
||||
_Screens.push_back(new CClockScreen(*_pDisplay, *this)); // 2: clock
|
||||
_Screens.push_back(new CPrimingScreen(*_pDisplay, *this)); // 3: mode / priming
|
||||
_Screens.push_back(new CWiFiScreen(*_pDisplay, *this)); // 4: comms info
|
||||
_Screens.push_back(new CFuelMixtureScreen(*_pDisplay, *this)); // 5: tuning
|
||||
_SetTimeScreen = new CSetClockScreen(*_pDisplay, *this); // clock set
|
||||
_TimerScreens.push_back(new CSetTimerScreen(*_pDisplay, *this, 0)); // set timer 1
|
||||
_TimerScreens.push_back(new CSetTimerScreen(*_pDisplay, *this, 1)); // set timer 2
|
||||
|
||||
#if RTC_USE_DS3231==0 && RTC_USE_DS1307==0 && RTC_USE_PCF8523==0
|
||||
_currentScreen = 6; // bring up clock set screen first if using millis based RTC!
|
||||
|
@ -175,7 +187,17 @@ CScreenManager::checkUpdate()
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
if(_currentScreen >= 0) {
|
||||
if(_bSetTime) {
|
||||
_SetTimeScreen->show();
|
||||
_bReqUpdate = false;
|
||||
return true;
|
||||
}
|
||||
else if(_timerScreen >= 0) {
|
||||
_TimerScreens[_timerScreen]->show();
|
||||
_bReqUpdate = false;
|
||||
return true;
|
||||
}
|
||||
else if(_currentScreen >= 0) {
|
||||
_Screens[_currentScreen]->show();
|
||||
_bReqUpdate = false;
|
||||
return true;
|
||||
|
@ -194,6 +216,9 @@ CScreenManager::reqUpdate()
|
|||
bool
|
||||
CScreenManager::animate()
|
||||
{
|
||||
if(_timerScreen >= 0) {
|
||||
return _TimerScreens[_timerScreen]->animate();
|
||||
}
|
||||
if(_currentScreen >= 0) {
|
||||
return _Screens[_currentScreen]->animate();
|
||||
}
|
||||
|
@ -210,7 +235,9 @@ CScreenManager::refresh()
|
|||
void
|
||||
CScreenManager::_switchScreen()
|
||||
{
|
||||
if(_currentScreen >= 0)
|
||||
if(_timerScreen >= 0)
|
||||
_TimerScreens[_timerScreen]->onSelect();
|
||||
else if(_currentScreen >= 0)
|
||||
_Screens[_currentScreen]->onSelect();
|
||||
|
||||
reqUpdate();
|
||||
|
@ -219,9 +246,20 @@ CScreenManager::_switchScreen()
|
|||
void
|
||||
CScreenManager::nextScreen()
|
||||
{
|
||||
_currentScreen++;
|
||||
if(_currentScreen >= _Screens.size()) {
|
||||
_currentScreen = 0;
|
||||
if(_bSetTime) {
|
||||
|
||||
}
|
||||
else if(_timerScreen >= 0) {
|
||||
_timerScreen++;
|
||||
if(_timerScreen >= _TimerScreens.size()) {
|
||||
_timerScreen = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_currentScreen++;
|
||||
if(_currentScreen >= _Screens.size()) {
|
||||
_currentScreen = 0;
|
||||
}
|
||||
}
|
||||
_switchScreen();
|
||||
}
|
||||
|
@ -229,9 +267,19 @@ CScreenManager::nextScreen()
|
|||
void
|
||||
CScreenManager::prevScreen()
|
||||
{
|
||||
_currentScreen--;
|
||||
if(_currentScreen < 0) {
|
||||
_currentScreen = _Screens.size()-1;
|
||||
if(_bSetTime) {
|
||||
}
|
||||
else if(_timerScreen >=0) {
|
||||
_timerScreen--;
|
||||
if(_timerScreen < 0) {
|
||||
_timerScreen = _TimerScreens.size()-1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_currentScreen--;
|
||||
if(_currentScreen < 0) {
|
||||
_currentScreen = _Screens.size()-1;
|
||||
}
|
||||
}
|
||||
_switchScreen();
|
||||
}
|
||||
|
@ -239,7 +287,11 @@ CScreenManager::prevScreen()
|
|||
void
|
||||
CScreenManager::keyHandler(uint8_t event)
|
||||
{
|
||||
if(_currentScreen >= 0)
|
||||
if(_bSetTime)
|
||||
_SetTimeScreen->keyHandler(event);
|
||||
else if(_timerScreen >= 0)
|
||||
_TimerScreens[_timerScreen]->keyHandler(event);
|
||||
else if(_currentScreen >= 0)
|
||||
_Screens[_currentScreen]->keyHandler(event);
|
||||
|
||||
if(_DimTime == 0)
|
||||
|
@ -248,6 +300,17 @@ CScreenManager::keyHandler(uint8_t event)
|
|||
// _DimTime = (millis() + 60000) | 1;
|
||||
}
|
||||
|
||||
void
|
||||
CScreenManager::selectTimerScreen(bool showTimers)
|
||||
{
|
||||
_timerScreen = showTimers ? 0 : -1;
|
||||
}
|
||||
|
||||
void
|
||||
CScreenManager::selectSetTimeScreen(bool show)
|
||||
{
|
||||
_bSetTime = show;
|
||||
}
|
||||
|
||||
void
|
||||
CScreenManager::showRebootMsg(const char* content[2], long delayTime)
|
||||
|
@ -259,3 +322,4 @@ CScreenManager::showRebootMsg(const char* content[2], long delayTime)
|
|||
_bReqUpdate = true;
|
||||
_pDisplay->dim(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,12 @@ class CRebootScreen;
|
|||
|
||||
class CScreenManager {
|
||||
std::vector<CScreen*> _Screens;
|
||||
std::vector<CScreen*> _TimerScreens;
|
||||
CScreen* _SetTimeScreen;
|
||||
C128x64_OLED* _pDisplay;
|
||||
int _currentScreen;
|
||||
int _timerScreen;
|
||||
bool _bSetTime;
|
||||
unsigned long _DimTime;
|
||||
bool _bReqUpdate;
|
||||
void _switchScreen();
|
||||
|
@ -50,6 +54,8 @@ public:
|
|||
void keyHandler(uint8_t event);
|
||||
void reqUpdate();
|
||||
void showRebootMsg(const char* content[2], long delayTime);
|
||||
void selectTimerScreen(bool showTimers);
|
||||
void selectSetTimeScreen(bool show);
|
||||
};
|
||||
|
||||
#endif // __SCREEN_MANAGER_H__
|
||||
|
|
206
Arduino/BTCDieselHeater/src/OLED/SetClockScreen.cpp
Normal file
206
Arduino/BTCDieselHeater/src/OLED/SetClockScreen.cpp
Normal file
|
@ -0,0 +1,206 @@
|
|||
/*
|
||||
* This file is part of the "bluetoothheater" distribution
|
||||
* (https://gitlab.com/mrjones.id.au/bluetoothheater)
|
||||
*
|
||||
* Copyright (C) 2018 Ray Jones <ray@mrjones.id.au>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CSetClockScreen
|
||||
//
|
||||
// This screen allows the real time clock to be adjusted
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "SetClockScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "fonts/Arial.h"
|
||||
#include "../RTC/Clock.h"
|
||||
|
||||
|
||||
CSetClockScreen::CSetClockScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_rowSel = 0;
|
||||
_nextT = millis();
|
||||
}
|
||||
|
||||
void
|
||||
CSetClockScreen::showTime(int)
|
||||
{
|
||||
// override and DO NOTHING!
|
||||
}
|
||||
|
||||
void
|
||||
CSetClockScreen::show()
|
||||
{
|
||||
long deltaT = millis() - _nextT;
|
||||
if(deltaT >= 0) {
|
||||
_nextT += 1000;
|
||||
|
||||
CScreenHeader::show();
|
||||
|
||||
char str[16];
|
||||
int xPos, yPos;
|
||||
const int col2 = 90;
|
||||
const int col3 = _display.width() - border;
|
||||
|
||||
_printInverted(0, 16, " Set Clock ", true);
|
||||
|
||||
const BTCDateTime& now = Clock.get();
|
||||
if(_rowSel == 0) {
|
||||
// update printable values
|
||||
working = now;
|
||||
// DELIBERATE DROP THROUGH HERE
|
||||
}
|
||||
yPos = 28;
|
||||
xPos = 6;
|
||||
// date
|
||||
if(_rowSel==0) {
|
||||
xPos = 20;
|
||||
_printMenuText(xPos, yPos, working.dowStr());
|
||||
}
|
||||
|
||||
sprintf(str, "%d", working.day());
|
||||
xPos += 20 + 12;
|
||||
_printMenuText(xPos, yPos, str, _rowSel==1, eRightJustify);
|
||||
xPos += 4;
|
||||
_printMenuText(xPos, yPos, working.monthStr(), _rowSel==2);
|
||||
xPos += 22;
|
||||
sprintf(str, "%d", working.year());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==3);
|
||||
// time
|
||||
yPos = 40;
|
||||
xPos = 26;
|
||||
sprintf(str, "%02d", working.hour());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==4);
|
||||
xPos += 16;
|
||||
_printMenuText(xPos, yPos, ":");
|
||||
xPos += 8;
|
||||
sprintf(str, "%02d", working.minute());
|
||||
_printMenuText(xPos, yPos, str, _rowSel==5);
|
||||
xPos += 16;
|
||||
_printMenuText(xPos, yPos, ":");
|
||||
sprintf(str, "%02d", working.second());
|
||||
xPos += 8;
|
||||
_printMenuText(xPos, yPos, str, _rowSel==6);
|
||||
if(_rowSel>=1)
|
||||
_printMenuText(_display.width()-border, yPos, "SET", _rowSel==7, eRightJustify);
|
||||
// navigation line
|
||||
yPos = 53;
|
||||
xPos = _display.xCentre();
|
||||
_printMenuText(xPos, yPos, " return ", _rowSel==0, eCentreJustify);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CSetClockScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
|
||||
if(event & keyPressed) {
|
||||
// press CENTRE
|
||||
if(event & key_Centre) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectSetTimeScreen(false);
|
||||
}
|
||||
else {
|
||||
if(_rowSel == 7) { // set the RTC!
|
||||
Clock.set(working);
|
||||
}
|
||||
_rowSel = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// press LEFT
|
||||
if(event & key_Left) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectSetTimeScreen(false);
|
||||
}
|
||||
else {
|
||||
adjTimeDate(-1);
|
||||
}
|
||||
}
|
||||
// press RIGHT
|
||||
if(event & key_Right) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectSetTimeScreen(false);
|
||||
}
|
||||
else {
|
||||
adjTimeDate(+1);
|
||||
}
|
||||
}
|
||||
// press UP
|
||||
if(event & key_Up) {
|
||||
_rowSel++;
|
||||
ROLLUPPERLIMIT(_rowSel, 7, 1);
|
||||
}
|
||||
// press DOWN
|
||||
if(event & key_Down) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectSetTimeScreen(false); // exit: return to clock screen
|
||||
} else {
|
||||
_rowSel--;
|
||||
ROLLLOWERLIMIT(_rowSel, 1, 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(event & keyRepeat) {
|
||||
if(_rowSel>=1) {
|
||||
// hold RIGHT
|
||||
if(event & key_Right) {
|
||||
adjTimeDate(+1);
|
||||
}
|
||||
// hold LEFT
|
||||
if(event & key_Left) {
|
||||
adjTimeDate(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_nextT = millis();
|
||||
_ScreenManager.reqUpdate();
|
||||
}
|
||||
|
||||
void
|
||||
CSetClockScreen::adjTimeDate(int dir)
|
||||
{
|
||||
int days;
|
||||
switch(_rowSel) {
|
||||
case 1:
|
||||
working.adjustDay(dir);
|
||||
break;
|
||||
case 2:
|
||||
working.adjustMonth(dir);
|
||||
break;
|
||||
case 3:
|
||||
working.adjustYear(dir);
|
||||
break;
|
||||
case 4:
|
||||
working.adjustHour(dir);
|
||||
break;
|
||||
case 5:
|
||||
working.adjustMinute(dir);
|
||||
break;
|
||||
case 6:
|
||||
working.adjustSecond(dir);
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -27,16 +27,15 @@ class C128x64_OLED;
|
|||
class CScreenManager;
|
||||
class CProtocol;
|
||||
|
||||
class CScreen6 : public CScreenHeader {
|
||||
class CSetClockScreen : public CScreenHeader {
|
||||
int _rowSel;
|
||||
int _colSel;
|
||||
unsigned long _nextT;
|
||||
BTCDateTime working;
|
||||
|
||||
void adjTimeDate(int dir);
|
||||
|
||||
public:
|
||||
CScreen6(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CSetClockScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void showTime(int);
|
||||
void keyHandler(uint8_t event);
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen7
|
||||
// CSetTimerScreen
|
||||
//
|
||||
// This screen allows the timers to be adjusted
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Screen7.h"
|
||||
#include "SetTimerScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "../Utility/NVStorage.h"
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
const char* briefDOW[] = { "S", "M", "T", "W", "T", "F", "S" };
|
||||
|
||||
CScreen7::CScreen7(C128x64_OLED& display, CScreenManager& mgr, int instance) : CScreenHeader(display, mgr)
|
||||
CSetTimerScreen::CSetTimerScreen(C128x64_OLED& display, CScreenManager& mgr, int instance) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_rowSel = 0;
|
||||
_colSel = 0;
|
||||
|
@ -44,13 +44,13 @@ CScreen7::CScreen7(C128x64_OLED& display, CScreenManager& mgr, int instance) : C
|
|||
}
|
||||
|
||||
void
|
||||
CScreen7::onSelect()
|
||||
CSetTimerScreen::onSelect()
|
||||
{
|
||||
NVstore.getTimerInfo(_instance, _timer);
|
||||
}
|
||||
|
||||
void
|
||||
CScreen7::show()
|
||||
CSetTimerScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -105,12 +105,13 @@ CScreen7::show()
|
|||
// navigation line
|
||||
yPos = 53;
|
||||
xPos = _display.xCentre();
|
||||
_printMenuText(xPos, yPos, "<- ->", _rowSel==0, eCentreJustify);
|
||||
//_printMenuText(xPos, yPos, "<- ->", _rowSel==0, eCentreJustify);
|
||||
_printMenuText(xPos, yPos, "<- return ->", _rowSel==0, eCentreJustify);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CScreen7::keyHandler(uint8_t event)
|
||||
CSetTimerScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
static bool bHeld = false;
|
||||
// handle initial key press
|
||||
|
@ -118,7 +119,10 @@ CScreen7::keyHandler(uint8_t event)
|
|||
bHeld = false;
|
||||
// press CENTRE
|
||||
if(event & key_Centre) {
|
||||
if(_rowSel != 0) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectTimerScreen(false); // exit: return to clock screen
|
||||
}
|
||||
else {
|
||||
NVstore.setTimerInfo(_instance, _timer);
|
||||
NVstore.save();
|
||||
_rowSel = 0;
|
||||
|
@ -157,6 +161,12 @@ CScreen7::keyHandler(uint8_t event)
|
|||
break;
|
||||
}
|
||||
}
|
||||
// press DOWN - return - only on row 0
|
||||
if(event & key_Down) {
|
||||
if(_rowSel == 0) {
|
||||
_ScreenManager.selectTimerScreen(false); // exit: return to clock screen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// handle held down keys
|
||||
|
@ -189,12 +199,15 @@ CScreen7::keyHandler(uint8_t event)
|
|||
int maskDOW = 0x01 << _colSel;
|
||||
if(event & key_Down) {
|
||||
// adjust selected item
|
||||
if(_rowSel == 1)
|
||||
adjust(-1);
|
||||
if(_rowSel == 2) {
|
||||
// adjust selected item
|
||||
_timer.enabled ^= maskDOW;
|
||||
_timer.enabled &= 0x7f;
|
||||
switch(_rowSel) {
|
||||
case 1:
|
||||
adjust(-1);
|
||||
break;
|
||||
case 2:
|
||||
// adjust selected item
|
||||
_timer.enabled ^= maskDOW;
|
||||
_timer.enabled &= 0x7f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// released UP
|
||||
|
@ -224,7 +237,7 @@ CScreen7::keyHandler(uint8_t event)
|
|||
|
||||
|
||||
void
|
||||
CScreen7::adjust(int dir)
|
||||
CSetTimerScreen::adjust(int dir)
|
||||
{
|
||||
int days;
|
||||
int maskDOW = 0x01 << _colSel; // if doing Day of Week - (_rowSel == 2)
|
||||
|
@ -267,7 +280,7 @@ CScreen7::adjust(int dir)
|
|||
}
|
||||
|
||||
void
|
||||
CScreen7::_printEnabledTimers()
|
||||
CSetTimerScreen::_printEnabledTimers()
|
||||
{
|
||||
const int dayWidth = 8;
|
||||
int xPos = _display.width() - border;
|
|
@ -27,7 +27,7 @@ class C128x64_OLED;
|
|||
class CScreenManager;
|
||||
class CProtocol;
|
||||
|
||||
class CScreen7 : public CScreenHeader {
|
||||
class CSetTimerScreen : public CScreenHeader {
|
||||
int _rowSel;
|
||||
int _colSel;
|
||||
int _instance;
|
||||
|
@ -36,7 +36,7 @@ class CScreen7 : public CScreenHeader {
|
|||
void _printEnabledTimers();
|
||||
|
||||
public:
|
||||
CScreen7(C128x64_OLED& display, CScreenManager& mgr, int instance);
|
||||
CSetTimerScreen(C128x64_OLED& display, CScreenManager& mgr, int instance);
|
||||
void onSelect();
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "Screen4.h"
|
||||
#include "WiFiScreen.h"
|
||||
#include "KeyPad.h"
|
||||
#include "../Protocol/helpers.h"
|
||||
#include "../Wifi/BTCWifi.h"
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CScreen4
|
||||
// CWiFiScreen
|
||||
//
|
||||
// This screen presents sundry information
|
||||
// eg WiFi status
|
||||
|
@ -39,7 +39,7 @@
|
|||
|
||||
#define STA_HOLD_TIME 10
|
||||
|
||||
CScreen4::CScreen4(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
CWiFiScreen::CWiFiScreen(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(display, mgr)
|
||||
{
|
||||
_rowSel = 0;
|
||||
_bShowMAC = false;
|
||||
|
@ -47,7 +47,7 @@ CScreen4::CScreen4(C128x64_OLED& display, CScreenManager& mgr) : CScreenHeader(d
|
|||
|
||||
|
||||
void
|
||||
CScreen4::show()
|
||||
CWiFiScreen::show()
|
||||
{
|
||||
CScreenHeader::show();
|
||||
|
||||
|
@ -100,7 +100,7 @@ CScreen4::show()
|
|||
|
||||
|
||||
void
|
||||
CScreen4::keyHandler(uint8_t event)
|
||||
CWiFiScreen::keyHandler(uint8_t event)
|
||||
{
|
||||
if(event & keyPressed) {
|
||||
_repeatCount = 0;
|
|
@ -25,9 +25,9 @@
|
|||
class C128x64_OLED;
|
||||
class CScreenManager;
|
||||
|
||||
class CScreen4 : public CScreenHeader {
|
||||
class CWiFiScreen : public CScreenHeader {
|
||||
public:
|
||||
CScreen4(C128x64_OLED& display, CScreenManager& mgr);
|
||||
CWiFiScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||
void show();
|
||||
void keyHandler(uint8_t event);
|
||||
private:
|
Loading…
Reference in a new issue