Omitted InheritSettingsScreen.cpp/.h
This commit is contained in:
parent
c10d8c4204
commit
220657956f
129
Arduino/BTCDieselHeater/src/OLED/InheritSettingsScreen.cpp
Normal file
129
Arduino/BTCDieselHeater/src/OLED/InheritSettingsScreen.cpp
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// CSettingsScreen
|
||||||
|
//
|
||||||
|
// This screen allows the fuel mixture endpoints to be adjusted
|
||||||
|
//
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "InheritSettingsScreen.h"
|
||||||
|
#include "KeyPad.h"
|
||||||
|
#include "../Protocol/helpers.h"
|
||||||
|
// #include "../Wifi/BTCWifi.h"
|
||||||
|
|
||||||
|
|
||||||
|
CInheritSettingsScreen::CInheritSettingsScreen(C128x64_OLED& display, CScreenManager& mgr) : CPasswordScreen(display, mgr)
|
||||||
|
{
|
||||||
|
_initUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CInheritSettingsScreen::onSelect()
|
||||||
|
{
|
||||||
|
// ensure standard entry to screen - especially after a dimming timeout
|
||||||
|
CPasswordScreen::onSelect();
|
||||||
|
_nAdoptSettings = hasOEMLCDcontroller() ? 1 : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CInheritSettingsScreen::_initUI()
|
||||||
|
{
|
||||||
|
// ensure standard entry to screen - especially after a dimming timeout
|
||||||
|
_nAdoptSettings = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CInheritSettingsScreen::show()
|
||||||
|
{
|
||||||
|
CScreenHeader::show();
|
||||||
|
|
||||||
|
_display.writeFillRect(0, 16, 96, 12, WHITE);
|
||||||
|
_printInverted(3, 18, "Inherit Settings", true);
|
||||||
|
|
||||||
|
if(!CPasswordScreen::show()) {
|
||||||
|
|
||||||
|
switch(_nAdoptSettings) {
|
||||||
|
case 0:
|
||||||
|
_ScreenManager.selectInheritScreen(false); // force return to main menu
|
||||||
|
_ScreenManager.reqUpdate();
|
||||||
|
return false;
|
||||||
|
case 1:
|
||||||
|
_display.clearDisplay();
|
||||||
|
_display.writeFillRect(0, 0, 128, 24, WHITE);
|
||||||
|
_printInverted(_display.xCentre(), 4, "ADOPT LCD controller", true, eCentreJustify);
|
||||||
|
_printInverted(_display.xCentre(), 13, "settings? ", true, eCentreJustify);
|
||||||
|
_printMenuText(_display.xCentre(), 35, "Press RIGHT to", false, eCentreJustify);
|
||||||
|
_printMenuText(_display.xCentre(), 45, "inherit and save", false, eCentreJustify);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_display.clearDisplay();
|
||||||
|
_display.writeFillRect(0, 0, 128, 24, WHITE);
|
||||||
|
_printInverted(_display.xCentre(), 4, " CANNOT inherit knob ", true, eCentreJustify);
|
||||||
|
_printInverted(_display.xCentre(), 13, " controller settings ", true, eCentreJustify);
|
||||||
|
_printMenuText(_display.xCentre(), 35, "Press any key", false, eCentreJustify);
|
||||||
|
_printMenuText(_display.xCentre(), 45, "to abort", false, eCentreJustify);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CInheritSettingsScreen::keyHandler(uint8_t event)
|
||||||
|
{
|
||||||
|
if(CPasswordScreen::keyHandler(event)) {
|
||||||
|
if(_isPasswordOK()) {
|
||||||
|
setPumpMin(getHeaterInfo().getPump_Min());
|
||||||
|
setPumpMax(getHeaterInfo().getPump_Max());
|
||||||
|
setFanMin(getHeaterInfo().getFan_Min());
|
||||||
|
setFanMax(getHeaterInfo().getFan_Max());
|
||||||
|
setFanSensor(getHeaterInfo().getFan_Sensor());
|
||||||
|
setSystemVoltage(getHeaterInfo().getSystemVoltage());
|
||||||
|
saveNV();
|
||||||
|
_showStoringMessage();
|
||||||
|
_nAdoptSettings = 0; // will cause return to main menu after storing message expires
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
if(event & keyPressed) {
|
||||||
|
// press RIGHT
|
||||||
|
if(event & key_Right) {
|
||||||
|
if(hasOEMLCDcontroller()) { // inheritance only valid for LCD controllers
|
||||||
|
_getPassword();
|
||||||
|
_ScreenManager.reqUpdate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_nAdoptSettings = 0; // will cause return to main menu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ScreenManager.reqUpdate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
41
Arduino/BTCDieselHeater/src/OLED/InheritSettingsScreen.h
Normal file
41
Arduino/BTCDieselHeater/src/OLED/InheritSettingsScreen.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* 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 __INHERITSETTINGSSCREEN_H__
|
||||||
|
#define __INHERITSETTINGSSCREEN_H__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "PasswordScreen.h"
|
||||||
|
|
||||||
|
class C128x64_OLED;
|
||||||
|
class CScreenManager;
|
||||||
|
|
||||||
|
class CInheritSettingsScreen : public CPasswordScreen {
|
||||||
|
int _nAdoptSettings;
|
||||||
|
void _initUI();
|
||||||
|
public:
|
||||||
|
CInheritSettingsScreen(C128x64_OLED& display, CScreenManager& mgr);
|
||||||
|
bool show();
|
||||||
|
bool keyHandler(uint8_t event);
|
||||||
|
void onSelect();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -33,7 +33,11 @@ Working so far:
|
||||||
* WiFi Connection to existing network or Standalone Access Point Mode (Passwd: thereisnospoon)
|
* WiFi Connection to existing network or Standalone Access Point Mode (Passwd: thereisnospoon)
|
||||||
* Wifi control
|
* Wifi control
|
||||||
* DebugPort data sent via Telnet if/when available on the network.
|
* DebugPort data sent via Telnet if/when available on the network.
|
||||||
* Two timers - including selectable day and repeat functionality
|
* 14 timers - including selectable day and repeat functionality
|
||||||
|
Simplisticly this allows each day to have 2 individual start stop regimes, but
|
||||||
|
a single timer can be set to repeat every day if desired, or on certain days.
|
||||||
|
Timers can also be set to be one-shot.
|
||||||
|
This is an extremely flexible system!
|
||||||
* Battery backed Real Time Clock - DS3231
|
* Battery backed Real Time Clock - DS3231
|
||||||
* Prototype "Green PCB" in production, using naked ESP32 and HC-05 modules
|
* Prototype "Green PCB" in production, using naked ESP32 and HC-05 modules
|
||||||
* Temperature readout in Celcius or Farenheit
|
* Temperature readout in Celcius or Farenheit
|
||||||
|
@ -44,7 +48,6 @@ To be implemented
|
||||||
* Implement narrow hysteresis to trick heater into a tighter thermostat temperature range. eg tell heater it is 23 degrees when it really is only 22.25 degrees (only 0.25 above set point).
|
* Implement narrow hysteresis to trick heater into a tighter thermostat temperature range. eg tell heater it is 23 degrees when it really is only 22.25 degrees (only 0.25 above set point).
|
||||||
* MQTT pub/sub
|
* MQTT pub/sub
|
||||||
* "fuel gauge" - Integrate pump frequency, assuming a repeatable dose of fuel per pump cycle...
|
* "fuel gauge" - Integrate pump frequency, assuming a repeatable dose of fuel per pump cycle...
|
||||||
* Proper 7 day timer with each day settable for at least 2 times (eg morning/evening)
|
|
||||||
* Expand hardware compatability with different MCU setups. IE Arduino Due/Mega/Pro ESP8266 & ESP32
|
* Expand hardware compatability with different MCU setups. IE Arduino Due/Mega/Pro ESP8266 & ESP32
|
||||||
* Documentation
|
* Documentation
|
||||||
* Regular Hot Burn cycle (DPF mode!)
|
* Regular Hot Burn cycle (DPF mode!)
|
||||||
|
|
Loading…
Reference in a new issue