Add basic menu Modes
This commit is contained in:
parent
d30536e939
commit
f93e5d7628
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
REM Firmware
|
REM Firmware
|
||||||
esptool.exe --chip esp32 --port COM16 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 bootloader_qio_80m.bin 0x10000 AfterburnerV3.1.2.bin 0x8000 Afterburner.partitions.bin
|
esptool.exe --chip esp32 --port COM16 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 bootloader_qio_80m.bin 0x10000 AfterburnerV3.1.3.bin 0x8000 Afterburner.partitions.bin
|
||||||
REM SPIFFS
|
REM SPIFFS
|
||||||
esptool.exe --chip esp32 --port COM16 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_size detect 0x3d0000 spiffs.bin
|
esptool.exe --chip esp32 --port COM16 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_size detect 0x3d0000 spiffs.bin
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,12 @@ board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board_build.partitions = ABpartition.csv
|
board_build.partitions = ABpartition.csv
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
;upload_port = 192.168.20.40
|
upload_port = 192.168.20.120
|
||||||
;upload_protocol = espota
|
upload_protocol = espota
|
||||||
upload_port = COM16
|
upload_flags =
|
||||||
upload_protocol = esptool
|
--port=3232
|
||||||
;upload_flags =
|
;upload_port = COM16
|
||||||
; --port=3232
|
;upload_protocol = esptool
|
||||||
;monitor_speed = 115200
|
;monitor_speed = 115200
|
||||||
extra_scripts = post:add_CRC.py
|
extra_scripts = post:add_CRC.py
|
||||||
; replace shitty Arduino millis with a linear time version
|
; replace shitty Arduino millis with a linear time version
|
||||||
|
|
|
@ -470,6 +470,7 @@ void setup() {
|
||||||
FilteredSamples.Fan.setRounding(10);
|
FilteredSamples.Fan.setRounding(10);
|
||||||
FilteredSamples.Fan.setAlpha(0.7);
|
FilteredSamples.Fan.setAlpha(0.7);
|
||||||
FilteredSamples.AmbientTemp.reset(-100.0);
|
FilteredSamples.AmbientTemp.reset(-100.0);
|
||||||
|
FilteredSamples.AmbientTemp.setAlpha(0); // no average - for test
|
||||||
FilteredSamples.FastipVolts.setRounding(0.1);
|
FilteredSamples.FastipVolts.setRounding(0.1);
|
||||||
FilteredSamples.FastipVolts.setAlpha(0.7);
|
FilteredSamples.FastipVolts.setAlpha(0.7);
|
||||||
FilteredSamples.FastGlowAmps.setRounding(0.01);
|
FilteredSamples.FastGlowAmps.setRounding(0.01);
|
||||||
|
@ -1414,7 +1415,7 @@ void checkDebugCommands()
|
||||||
bTestBTModule = !bTestBTModule;
|
bTestBTModule = !bTestBTModule;
|
||||||
Bluetooth.test(bTestBTModule ? 0xff : 0x00); // special enter or leave BT test commands
|
Bluetooth.test(bTestBTModule ? 0xff : 0x00); // special enter or leave BT test commands
|
||||||
}
|
}
|
||||||
else if(rxVal == ('s' & 0x1f)) { // CTRL-S Stripped back - no heater mode
|
/* else if(rxVal == ('s' & 0x1f)) { // CTRL-S Stripped back - no heater mode
|
||||||
sUserSettings us = NVstore.getUserSettings();
|
sUserSettings us = NVstore.getUserSettings();
|
||||||
us.NoHeater = !us.NoHeater;
|
us.NoHeater = !us.NoHeater;
|
||||||
NVstore.setUserSettings(us);
|
NVstore.setUserSettings(us);
|
||||||
|
@ -1427,7 +1428,7 @@ void checkDebugCommands()
|
||||||
DebugPort.handle();
|
DebugPort.handle();
|
||||||
delay(1000);
|
delay(1000);
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
#ifdef PROTOCOL_INVESTIGATION
|
#ifdef PROTOCOL_INVESTIGATION
|
||||||
if(bSendVal) {
|
if(bSendVal) {
|
||||||
|
|
|
@ -191,7 +191,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
if(event & key_Down) {
|
if(event & key_Down) {
|
||||||
if(repeatCount > 2) {
|
if(repeatCount > 2) {
|
||||||
repeatCount = -1; // prevent double handling
|
repeatCount = -1; // prevent double handling
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
_showModeTime = millis() + 5000;
|
_showModeTime = millis() + 5000;
|
||||||
_nModeSel = getThermostatModeActive() ? 0 : 1;
|
_nModeSel = getThermostatModeActive() ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
if(event & key_Up) {
|
if(event & key_Up) {
|
||||||
if(repeatCount > 2) {
|
if(repeatCount > 2) {
|
||||||
repeatCount = -1; // prevent double handling
|
repeatCount = -1; // prevent double handling
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
_showModeTime = millis() + 5000;
|
_showModeTime = millis() + 5000;
|
||||||
}
|
}
|
||||||
sUserSettings settings = NVstore.getUserSettings();
|
sUserSettings settings = NVstore.getUserSettings();
|
||||||
|
@ -212,7 +212,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
}
|
}
|
||||||
// hold CENTRE to turn ON or OFF
|
// hold CENTRE to turn ON or OFF
|
||||||
if(event & key_Centre) {
|
if(event & key_Centre) {
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
int runstate = getHeaterInfo().getRunStateEx();
|
int runstate = getHeaterInfo().getRunStateEx();
|
||||||
if(runstate) { // running, including cyclic mode idle
|
if(runstate) { // running, including cyclic mode idle
|
||||||
if(repeatCount > 5) {
|
if(repeatCount > 5) {
|
||||||
|
@ -238,7 +238,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
if(event & keyReleased) {
|
if(event & keyReleased) {
|
||||||
if(!_showModeTime) {
|
if(!_showModeTime) {
|
||||||
// release DOWN key to reduce set demand, provided we are not in mode select
|
// release DOWN key to reduce set demand, provided we are not in mode select
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
if(event & key_Down) {
|
if(event & key_Down) {
|
||||||
if(reqDemandDelta(-1)) {
|
if(reqDemandDelta(-1)) {
|
||||||
_showSetModeTime = millis() + 2000;
|
_showSetModeTime = millis() + 2000;
|
||||||
|
@ -297,7 +297,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
}
|
}
|
||||||
// release CENTRE to accept new mode, and/or show current setting
|
// release CENTRE to accept new mode, and/or show current setting
|
||||||
if(event & key_Centre) {
|
if(event & key_Centre) {
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
if(repeatCount != -2) { // prevent after off commands
|
if(repeatCount != -2) { // prevent after off commands
|
||||||
if(_showModeTime) {
|
if(_showModeTime) {
|
||||||
_showModeTime = millis(); // force immediate cancellation of showmode (via screen update)
|
_showModeTime = millis(); // force immediate cancellation of showmode (via screen update)
|
||||||
|
@ -317,7 +317,7 @@ CBasicScreen::keyHandler(uint8_t event)
|
||||||
void
|
void
|
||||||
CBasicScreen::showRunState()
|
CBasicScreen::showRunState()
|
||||||
{
|
{
|
||||||
if(NVstore.getUserSettings().NoHeater)
|
if(NVstore.getUserSettings().menuMode == 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int runstate = getHeaterInfo().getRunStateEx();
|
int runstate = getHeaterInfo().getRunStateEx();
|
||||||
|
|
|
@ -109,7 +109,7 @@ CClockScreen::keyHandler(uint8_t event)
|
||||||
}
|
}
|
||||||
// press DOWN
|
// press DOWN
|
||||||
if(event & key_Down) {
|
if(event & key_Down) {
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
_ScreenManager.selectMenu(CScreenManager::TimerMenuLoop); // switch to timer set screen loop
|
_ScreenManager.selectMenu(CScreenManager::TimerMenuLoop); // switch to timer set screen loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ CClockScreen::keyHandler(uint8_t event)
|
||||||
}
|
}
|
||||||
// hold CENTRE to toggle On/Off state
|
// hold CENTRE to toggle On/Off state
|
||||||
if(event & key_Centre) {
|
if(event & key_Centre) {
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
int runstate = getHeaterInfo().getRunStateEx();
|
int runstate = getHeaterInfo().getRunStateEx();
|
||||||
if(runstate) { // running, including cyclic mode idle
|
if(runstate) { // running, including cyclic mode idle
|
||||||
if(_keyRepeatCount > 5) {
|
if(_keyRepeatCount > 5) {
|
||||||
|
|
|
@ -71,10 +71,12 @@ CMenuTrunkScreen::show()
|
||||||
|
|
||||||
_printMenuText(_display.xCentre(), yPos[_rowSel], " \021 \020 ", true, eCentreJustify);
|
_printMenuText(_display.xCentre(), yPos[_rowSel], " \021 \020 ", true, eCentreJustify);
|
||||||
|
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode == 0) {
|
||||||
_printMenuText(_display.xCentre(), yPos[3], "Heater Tuning", false, eCentreJustify);
|
_printMenuText(_display.xCentre(), yPos[3], "Heater Tuning", false, eCentreJustify);
|
||||||
}
|
}
|
||||||
_printMenuText(_display.xCentre(), yPos[2], "System Settings", false, eCentreJustify);
|
if(NVstore.getUserSettings().menuMode != 1) {
|
||||||
|
_printMenuText(_display.xCentre(), yPos[2], "System Settings", false, eCentreJustify);
|
||||||
|
}
|
||||||
_printMenuText(_display.xCentre(), yPos[1], "User Settings", false, eCentreJustify);
|
_printMenuText(_display.xCentre(), yPos[1], "User Settings", false, eCentreJustify);
|
||||||
_printMenuText(_display.xCentre(), yPos[0], "Root menu", false, eCentreJustify);
|
_printMenuText(_display.xCentre(), yPos[0], "Root menu", false, eCentreJustify);
|
||||||
|
|
||||||
|
@ -128,7 +130,11 @@ CMenuTrunkScreen::keyHandler(uint8_t event)
|
||||||
// press UP
|
// press UP
|
||||||
if(event & key_Up) {
|
if(event & key_Up) {
|
||||||
_rowSel++;
|
_rowSel++;
|
||||||
int lim = NVstore.getUserSettings().NoHeater ? 2 : 3;
|
int lim = 3;
|
||||||
|
switch(NVstore.getUserSettings().menuMode) {
|
||||||
|
case 1: lim = 1; break;
|
||||||
|
case 2: lim = 2; break;
|
||||||
|
}
|
||||||
UPPERLIMIT(_rowSel, lim);
|
UPPERLIMIT(_rowSel, lim);
|
||||||
}
|
}
|
||||||
// press DOWN
|
// press DOWN
|
||||||
|
|
|
@ -309,7 +309,7 @@ CScreenHeader::showWifiIcon()
|
||||||
void
|
void
|
||||||
CScreenHeader::showBatteryIcon(float voltage)
|
CScreenHeader::showBatteryIcon(float voltage)
|
||||||
{
|
{
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
_drawBitmap(X_BATT_ICON, Y_BATT_ICON, BatteryIconInfo);
|
_drawBitmap(X_BATT_ICON, Y_BATT_ICON, BatteryIconInfo);
|
||||||
char msg[16];
|
char msg[16];
|
||||||
sprintf(msg, "%.1fV", voltage);
|
sprintf(msg, "%.1fV", voltage);
|
||||||
|
|
|
@ -393,15 +393,7 @@ CScreenManager::begin(bool bNoClock)
|
||||||
|
|
||||||
std::vector<CScreen*> menuloop;
|
std::vector<CScreen*> menuloop;
|
||||||
// create root menu loop
|
// create root menu loop
|
||||||
if(NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode == 0) {
|
||||||
menuloop.push_back(new CMenuTrunkScreen(*_pDisplay, *this));
|
|
||||||
menuloop.push_back(new CBasicScreen(*_pDisplay, *this)); // basic control
|
|
||||||
if(!bNoClock)
|
|
||||||
menuloop.push_back(new CClockScreen(*_pDisplay, *this)); // clock
|
|
||||||
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support
|
|
||||||
menuloop.push_back(new CGPIOInfoScreen(*_pDisplay, *this)); // GPIO info
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
menuloop.push_back(new CDetailedScreen(*_pDisplay, *this)); // detail control
|
menuloop.push_back(new CDetailedScreen(*_pDisplay, *this)); // detail control
|
||||||
menuloop.push_back(new CBasicScreen(*_pDisplay, *this)); // basic control
|
menuloop.push_back(new CBasicScreen(*_pDisplay, *this)); // basic control
|
||||||
if(!bNoClock)
|
if(!bNoClock)
|
||||||
|
@ -411,6 +403,20 @@ CScreenManager::begin(bool bNoClock)
|
||||||
menuloop.push_back(new CGPIOInfoScreen(*_pDisplay, *this)); // GPIO info
|
menuloop.push_back(new CGPIOInfoScreen(*_pDisplay, *this)); // GPIO info
|
||||||
menuloop.push_back(new CMenuTrunkScreen(*_pDisplay, *this));
|
menuloop.push_back(new CMenuTrunkScreen(*_pDisplay, *this));
|
||||||
}
|
}
|
||||||
|
else if(NVstore.getUserSettings().menuMode == 1) {
|
||||||
|
menuloop.push_back(new CMenuTrunkScreen(*_pDisplay, *this));
|
||||||
|
menuloop.push_back(new CBasicScreen(*_pDisplay, *this)); // basic control
|
||||||
|
if(!bNoClock)
|
||||||
|
menuloop.push_back(new CClockScreen(*_pDisplay, *this)); // clock
|
||||||
|
}
|
||||||
|
else if(NVstore.getUserSettings().menuMode == 2) {
|
||||||
|
menuloop.push_back(new CMenuTrunkScreen(*_pDisplay, *this));
|
||||||
|
menuloop.push_back(new CBasicScreen(*_pDisplay, *this)); // basic control
|
||||||
|
if(!bNoClock)
|
||||||
|
menuloop.push_back(new CClockScreen(*_pDisplay, *this)); // clock
|
||||||
|
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support
|
||||||
|
menuloop.push_back(new CGPIOInfoScreen(*_pDisplay, *this)); // GPIO info
|
||||||
|
}
|
||||||
_Screens.push_back(menuloop);
|
_Screens.push_back(menuloop);
|
||||||
|
|
||||||
// create timer screens loop
|
// create timer screens loop
|
||||||
|
@ -432,38 +438,45 @@ CScreenManager::begin(bool bNoClock)
|
||||||
menuloop.push_back(new CSetTimerScreen(*_pDisplay, *this, 13)); // set timer 14
|
menuloop.push_back(new CSetTimerScreen(*_pDisplay, *this, 13)); // set timer 14
|
||||||
_Screens.push_back(menuloop);
|
_Screens.push_back(menuloop);
|
||||||
|
|
||||||
// create heater tuning screens loop - password protected
|
|
||||||
menuloop.clear();
|
|
||||||
menuloop.push_back(new CFuelMixtureScreen(*_pDisplay, *this)); // mixture tuning
|
|
||||||
menuloop.push_back(new CHeaterSettingsScreen(*_pDisplay, *this)); // heater system tuning
|
|
||||||
menuloop.push_back(new CFuelCalScreen(*_pDisplay, *this)); // fuel pump calibration
|
|
||||||
_Screens.push_back(menuloop);
|
|
||||||
|
|
||||||
// create User Settings screens loop
|
// create User Settings screens loop
|
||||||
menuloop.clear();
|
menuloop.clear();
|
||||||
if(NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode == 0) {
|
||||||
menuloop.push_back(new CNoHeaterHomeMenuSelScreen(*_pDisplay, *this)); // No Heater Home menu settings screen
|
|
||||||
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support ?
|
|
||||||
menuloop.push_back(new CGPIOSetupScreen(*_pDisplay, *this)); // GPIO settings screen
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
menuloop.push_back(new CThermostatModeScreen(*_pDisplay, *this)); // thermostat settings screen
|
menuloop.push_back(new CThermostatModeScreen(*_pDisplay, *this)); // thermostat settings screen
|
||||||
menuloop.push_back(new CHomeMenuSelScreen(*_pDisplay, *this)); // Home menu settings screen
|
menuloop.push_back(new CHomeMenuSelScreen(*_pDisplay, *this)); // Home menu settings screen
|
||||||
menuloop.push_back(new CTimeoutsScreen(*_pDisplay, *this)); // Other options screen
|
menuloop.push_back(new CTimeoutsScreen(*_pDisplay, *this)); // Other options screen
|
||||||
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support ?
|
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support ?
|
||||||
menuloop.push_back(new CGPIOSetupScreen(*_pDisplay, *this)); // GPIO settings screen
|
menuloop.push_back(new CGPIOSetupScreen(*_pDisplay, *this)); // GPIO settings screen
|
||||||
}
|
}
|
||||||
|
else if(NVstore.getUserSettings().menuMode == 1) {
|
||||||
|
menuloop.push_back(new CThermostatModeScreen(*_pDisplay, *this)); // thermostat settings screen
|
||||||
|
menuloop.push_back(new CHomeMenuSelScreen(*_pDisplay, *this)); // Home menu settings screen
|
||||||
|
menuloop.push_back(new CTimeoutsScreen(*_pDisplay, *this)); // Other options screen
|
||||||
|
}
|
||||||
|
else if(NVstore.getUserSettings().menuMode == 2) {
|
||||||
|
menuloop.push_back(new CNoHeaterHomeMenuSelScreen(*_pDisplay, *this)); // No Heater Home menu settings screen
|
||||||
|
if(getBoardRevision() != 0 && getBoardRevision() != BRD_V2_NOGPIO) // has GPIO support ?
|
||||||
|
menuloop.push_back(new CGPIOSetupScreen(*_pDisplay, *this)); // GPIO settings screen
|
||||||
|
}
|
||||||
_Screens.push_back(menuloop);
|
_Screens.push_back(menuloop);
|
||||||
|
|
||||||
// create System Settings screens loop
|
// create System Settings screens loop
|
||||||
menuloop.clear();
|
if(NVstore.getUserSettings().menuMode == 0 || NVstore.getUserSettings().menuMode == 2) {
|
||||||
menuloop.push_back(new CVersionInfoScreen(*_pDisplay, *this)); // GPIO settings screen
|
menuloop.clear();
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
menuloop.push_back(new CVersionInfoScreen(*_pDisplay, *this)); // GPIO settings screen
|
||||||
menuloop.push_back(new CHourMeterScreen(*_pDisplay, *this)); // Hour Meter screen
|
if(NVstore.getUserSettings().menuMode == 0) {
|
||||||
|
menuloop.push_back(new CHourMeterScreen(*_pDisplay, *this)); // Hour Meter screen
|
||||||
|
}
|
||||||
|
menuloop.push_back(new CWiFiScreen(*_pDisplay, *this));
|
||||||
|
menuloop.push_back(new CMQTTScreen(*_pDisplay, *this));
|
||||||
|
menuloop.push_back(new CBTScreen(*_pDisplay, *this));
|
||||||
|
_Screens.push_back(menuloop);
|
||||||
}
|
}
|
||||||
menuloop.push_back(new CWiFiScreen(*_pDisplay, *this));
|
|
||||||
menuloop.push_back(new CMQTTScreen(*_pDisplay, *this));
|
// create heater tuning screens loop - password protected
|
||||||
menuloop.push_back(new CBTScreen(*_pDisplay, *this));
|
menuloop.clear();
|
||||||
|
menuloop.push_back(new CFuelMixtureScreen(*_pDisplay, *this)); // mixture tuning
|
||||||
|
menuloop.push_back(new CHeaterSettingsScreen(*_pDisplay, *this)); // heater system tuning
|
||||||
|
menuloop.push_back(new CFuelCalScreen(*_pDisplay, *this)); // fuel pump calibration
|
||||||
_Screens.push_back(menuloop);
|
_Screens.push_back(menuloop);
|
||||||
|
|
||||||
// create branch screens
|
// create branch screens
|
||||||
|
@ -522,7 +535,7 @@ CScreenManager::checkUpdate()
|
||||||
// Basic Control
|
// Basic Control
|
||||||
// Clock
|
// Clock
|
||||||
// return to those upon timeout, otherwise return to Basic Control screen
|
// return to those upon timeout, otherwise return to Basic Control screen
|
||||||
if((_rootMenu > 2) || ((_rootMenu == 0) && NVstore.getUserSettings().NoHeater)) {
|
if((_rootMenu > 2) || ((_rootMenu == 0) && NVstore.getUserSettings().menuMode)) {
|
||||||
uint8_t userHomeMenu = NVstore.getUserSettings().HomeMenu.onTimeout;
|
uint8_t userHomeMenu = NVstore.getUserSettings().HomeMenu.onTimeout;
|
||||||
if(userHomeMenu) { // allow user to override defualt screen
|
if(userHomeMenu) { // allow user to override defualt screen
|
||||||
userHomeMenu--;
|
userHomeMenu--;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class CScreenManager {
|
||||||
void _changeSubMenu(int dir);
|
void _changeSubMenu(int dir);
|
||||||
void _dim(bool state);
|
void _dim(bool state);
|
||||||
public:
|
public:
|
||||||
enum eUIMenuSets { RootMenuLoop, TimerMenuLoop, TuningMenuLoop, UserSettingsLoop, SystemSettingsLoop, BranchMenu };
|
enum eUIMenuSets { RootMenuLoop, TimerMenuLoop, UserSettingsLoop, SystemSettingsLoop, TuningMenuLoop, BranchMenu };
|
||||||
enum eUIRootMenus { DetailedControlUI, BasicControlUI, ClockUI, ModeUI, GPIOInfoUI, TrunkUI };
|
enum eUIRootMenus { DetailedControlUI, BasicControlUI, ClockUI, ModeUI, GPIOInfoUI, TrunkUI };
|
||||||
enum eUITimerMenus { TimerOverviewUI, Timer1UI, Timer2UI, Timer3UI, Timer4UI, Timer5UI, Timer6UI, Timer7UI,
|
enum eUITimerMenus { TimerOverviewUI, Timer1UI, Timer2UI, Timer3UI, Timer4UI, Timer5UI, Timer6UI, Timer7UI,
|
||||||
Timer8UI, Timer9UI, Timer10UI, Timer11UI, Timer12UI, Timer13UI, Timer14UI };
|
Timer8UI, Timer9UI, Timer10UI, Timer11UI, Timer12UI, Timer13UI, Timer14UI };
|
||||||
|
|
|
@ -326,6 +326,23 @@ void interpretJsonCommand(char* pLine)
|
||||||
NVstore.setHeaterTuning(ht);
|
NVstore.setHeaterTuning(ht);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(strcmp("SMenu", it->key) == 0) {
|
||||||
|
sUserSettings us = NVstore.getUserSettings();
|
||||||
|
us.menuMode = it->value.as<uint8_t>();
|
||||||
|
if(us.menuMode <=2) {
|
||||||
|
NVstore.setUserSettings(us);
|
||||||
|
NVstore.save();
|
||||||
|
NVstore.doSave();
|
||||||
|
switch(us.menuMode) {
|
||||||
|
case 0: DebugPort.println("Restarting ESP to invoke Full menu control mode"); break;
|
||||||
|
case 1: DebugPort.println("Restarting ESP to invoke Basic menu mode"); break;
|
||||||
|
case 2: DebugPort.println("Restarting ESP to invoke cut back No Heater mode"); break;
|
||||||
|
}
|
||||||
|
DebugPort.handle();
|
||||||
|
delay(1000);
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +371,7 @@ bool makeJSONString(CModerator& moderator, char* opStr, int len)
|
||||||
}
|
}
|
||||||
bSend |= moderator.addJson("TempDesired", getTemperatureDesired(), root);
|
bSend |= moderator.addJson("TempDesired", getTemperatureDesired(), root);
|
||||||
bSend |= moderator.addJson("TempMode", NVstore.getUserSettings().degF, root);
|
bSend |= moderator.addJson("TempMode", NVstore.getUserSettings().degF, root);
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
bSend |= moderator.addJson("TempMin", getHeaterInfo().getTemperature_Min(), root);
|
bSend |= moderator.addJson("TempMin", getHeaterInfo().getTemperature_Min(), root);
|
||||||
bSend |= moderator.addJson("TempMax", getHeaterInfo().getTemperature_Max(), root);
|
bSend |= moderator.addJson("TempMax", getHeaterInfo().getTemperature_Max(), root);
|
||||||
bSend |= moderator.addJson("TempBody", getHeaterInfo().getTemperature_HeatExchg(), root);
|
bSend |= moderator.addJson("TempBody", getHeaterInfo().getTemperature_HeatExchg(), root);
|
||||||
|
@ -393,7 +410,7 @@ bool makeJSONStringEx(CModerator& moderator, char* opStr, int len)
|
||||||
|
|
||||||
bool bSend = false; // reset should send flag
|
bool bSend = false; // reset should send flag
|
||||||
|
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
bSend |= moderator.addJson("ThermostatMethod", NVstore.getUserSettings().ThermostatMethod, root);
|
bSend |= moderator.addJson("ThermostatMethod", NVstore.getUserSettings().ThermostatMethod, root);
|
||||||
bSend |= moderator.addJson("ThermostatWindow", NVstore.getUserSettings().ThermostatWindow, root);
|
bSend |= moderator.addJson("ThermostatWindow", NVstore.getUserSettings().ThermostatWindow, root);
|
||||||
int stop = NVstore.getUserSettings().cyclic.Stop;
|
int stop = NVstore.getUserSettings().cyclic.Stop;
|
||||||
|
@ -513,7 +530,7 @@ bool makeJSONStringSysInfo(CModerator& moderator, char* opStr, int len)
|
||||||
bSend |= moderator.addJson("SysVer", getVersionStr(), root);
|
bSend |= moderator.addJson("SysVer", getVersionStr(), root);
|
||||||
bSend |= moderator.addJson("SysDate", getVersionDate(), root);
|
bSend |= moderator.addJson("SysDate", getVersionDate(), root);
|
||||||
bSend |= moderator.addJson("SysFreeMem", ESP.getFreeHeap(), root);
|
bSend |= moderator.addJson("SysFreeMem", ESP.getFreeHeap(), root);
|
||||||
if(!NVstore.getUserSettings().NoHeater) {
|
if(NVstore.getUserSettings().menuMode < 2) {
|
||||||
bSend |= moderator.addJson("SysRunTime", pHourMeter->getRunTime(), root);
|
bSend |= moderator.addJson("SysRunTime", pHourMeter->getRunTime(), root);
|
||||||
bSend |= moderator.addJson("SysGlowTime", pHourMeter->getGlowTime(), root);
|
bSend |= moderator.addJson("SysGlowTime", pHourMeter->getGlowTime(), root);
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,7 +386,7 @@ sUserSettings::load()
|
||||||
validatedLoad("JSONsingle", JSON.singleElement, 0, u8inBounds, 0, 1);
|
validatedLoad("JSONsingle", JSON.singleElement, 0, u8inBounds, 0, 1);
|
||||||
validatedLoad("JSONLF", JSON.LF, 0, u8inBounds, 0, 1);
|
validatedLoad("JSONLF", JSON.LF, 0, u8inBounds, 0, 1);
|
||||||
validatedLoad("JSONpad", JSON.padding, 0, u8inBounds, 0, 1);
|
validatedLoad("JSONpad", JSON.padding, 0, u8inBounds, 0, 1);
|
||||||
validatedLoad("NoHeater", NoHeater, 0, u8inBounds, 0, 1);
|
validatedLoad("menuMode", menuMode, 0, u8inBounds, 0, 2);
|
||||||
validatedLoad("Clock12hr", clock12hr, 0, u8inBounds, 0, 1);
|
validatedLoad("Clock12hr", clock12hr, 0, u8inBounds, 0, 1);
|
||||||
preferences.end();
|
preferences.end();
|
||||||
}
|
}
|
||||||
|
@ -419,7 +419,7 @@ sUserSettings::save()
|
||||||
preferences.putUChar("JSONsingle", JSON.singleElement);
|
preferences.putUChar("JSONsingle", JSON.singleElement);
|
||||||
preferences.putUChar("JSONLF", JSON.LF);
|
preferences.putUChar("JSONLF", JSON.LF);
|
||||||
preferences.putUChar("JSONpad", JSON.padding);
|
preferences.putUChar("JSONpad", JSON.padding);
|
||||||
preferences.putUChar("NoHeater", NoHeater);
|
preferences.putUChar("menuMode", menuMode);
|
||||||
preferences.putUChar("Clock12hr", clock12hr);
|
preferences.putUChar("Clock12hr", clock12hr);
|
||||||
preferences.end();
|
preferences.end();
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ struct sUserSettings : public CESP32_NVStorage {
|
||||||
sHomeMenuActions HomeMenu;
|
sHomeMenuActions HomeMenu;
|
||||||
sGPIOparams GPIO;
|
sGPIOparams GPIO;
|
||||||
sJSONoptions JSON;
|
sJSONoptions JSON;
|
||||||
uint8_t NoHeater;
|
uint8_t menuMode; // 0 normal, 1, basic, 2 no heater
|
||||||
uint8_t clock12hr;
|
uint8_t clock12hr;
|
||||||
|
|
||||||
bool valid() {
|
bool valid() {
|
||||||
|
@ -307,7 +307,7 @@ struct sUserSettings : public CESP32_NVStorage {
|
||||||
cyclic.init();
|
cyclic.init();
|
||||||
HomeMenu.init();
|
HomeMenu.init();
|
||||||
JSON.init();
|
JSON.init();
|
||||||
NoHeater = 0;
|
menuMode = 0;
|
||||||
clock12hr = 0;
|
clock12hr = 0;
|
||||||
};
|
};
|
||||||
void load();
|
void load();
|
||||||
|
@ -331,7 +331,7 @@ struct sUserSettings : public CESP32_NVStorage {
|
||||||
cyclic = rhs.cyclic;
|
cyclic = rhs.cyclic;
|
||||||
HomeMenu = rhs.HomeMenu;
|
HomeMenu = rhs.HomeMenu;
|
||||||
JSON = rhs.JSON;
|
JSON = rhs.JSON;
|
||||||
NoHeater = rhs.NoHeater;
|
menuMode = rhs.menuMode;
|
||||||
clock12hr = rhs.clock12hr;
|
clock12hr = rhs.clock12hr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue