ESP32_ChinaDieselHeater_Con.../src/OLED/ScreenManager.h

88 lines
3 KiB
C
Raw Permalink Normal View History

2018-11-26 11:58:15 +00:00
/*
* 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/>.
*
*/
#ifndef __SCREEN_MANAGER_H__
#define __SCREEN_MANAGER_H__
2018-12-07 04:53:08 +00:00
#include <vector>
#include "../Utility/UtilClasses.h"
class C128x64_OLED;
class CScreen;
class CRebootScreen;
class CScreenManager {
std::vector<std::vector<CScreen*>> _Screens;
CRebootScreen* _pRebootScreen;
C128x64_OLED* _pDisplay;
unsigned long _OTAholdoff;
int _menu;
int _subMenu;
int _rootMenu;
int _returnMenu;
int _returnSubMenu;
bool _bDimmed;
2019-09-16 22:30:49 +00:00
bool _bReload;
unsigned long _DimTime_ms;
unsigned long _MenuTimeout;
bool _bReqUpdate;
void _enterScreen();
void _leaveScreen();
void _changeSubMenu(int dir);
void _dim(bool state);
2019-09-16 22:30:49 +00:00
void _loadScreens();
void _unloadScreens();
bool _checkOTAholdoff();
public:
2019-09-15 02:51:51 +00:00
enum eUIMenuSets { RootMenuLoop, TimerMenuLoop, UserSettingsLoop, SystemSettingsLoop, TuningMenuLoop, BranchMenu };
enum eUIRootMenus { DetailedControlUI, BasicControlUI, ClockUI, ModeUI, GPIOInfoUI, TrunkUI };
enum eUITimerMenus { TimerOverviewUI, Timer1UI, Timer2UI, Timer3UI, Timer4UI, Timer5UI, Timer6UI, Timer7UI,
Timer8UI, Timer9UI, Timer10UI, Timer11UI, Timer12UI, Timer13UI, Timer14UI };
enum eUITuningMenus { MixtureUI, HeaterSettingsUI, FuelCalUI };
enum eUIUserSettingsMenus { ExThermostatUI, FrostUI, HomeMenuUI, TimeIntervalsUI, TempSensorUI, GPIOUI };
2019-11-11 07:59:49 +00:00
enum eUIBranchMenus { SetClockUI, InheritSettingsUI, HtrSettingsUI, DS18B20UI };
2019-07-27 14:28:39 +00:00
enum eUISystemSettingsMenus { SysVerUI, SysHoursUI, SysWifiUI, SysBTUI };
public:
CScreenManager();
~CScreenManager();
2019-09-16 22:30:49 +00:00
void begin();
2018-12-01 18:25:10 +00:00
bool checkUpdate();
bool animate();
void keyHandler(uint8_t event);
void refresh();
void nextMenu();
void prevMenu();
void reqUpdate();
void selectHomeMenu();
void selectMenu(eUIMenuSets menuset, int specific = -1); // use to select loop menus, including the root or branches
void returnMenu(); // use to select loop menus, including the root or branches
void showRebootMsg(const char* content[2], long delayTime);
void showBootMsg(const char* msg);
void showBootWait(int show);
void showOTAMessage(int percent, eOTAmodes updateType);
void clearDisplay();
void bumpTimeout();
void showSplash();
2019-09-16 22:30:49 +00:00
void reqReload() { _bReload = true; };
};
#endif // __SCREEN_MANAGER_H__