Massive 12 hour rebase
This commit is contained in:
Submodule components/esp-gui-lib updated: 0f89f6c994...cc95378d7a
@@ -23,7 +23,6 @@ set(BOBBY_HEADERS
|
||||
actions/loadsettingsaction.h
|
||||
actions/modesettingsaction.h
|
||||
actions/qraction.h
|
||||
actions/rebootaction.h
|
||||
actions/resetnvsaction.h
|
||||
actions/savesettingsaction.h
|
||||
actions/setupactions.h
|
||||
@@ -35,15 +34,11 @@ set(BOBBY_HEADERS
|
||||
actions/wifistascanclearaction.h
|
||||
battery.h
|
||||
ble_bobby.h
|
||||
bletexthelpers.h
|
||||
bluetooth_bobby.h
|
||||
bluetoothmode.h
|
||||
bluetoothtexthelpers.h
|
||||
bmsutils.h
|
||||
bobbyblinker.h
|
||||
bobbybuttons.h
|
||||
bobbycheckbox.h
|
||||
bobbyerrorhandler.h
|
||||
bobbyhupe.h
|
||||
bobbyquickactions.h
|
||||
bobbyschedulertask.h
|
||||
@@ -57,121 +52,10 @@ set(BOBBY_HEADERS
|
||||
changevaluedisplay_larsmmode_mode.h
|
||||
changevaluedisplay_unifiedmodelmode.h
|
||||
cloud.h
|
||||
cloudtexthelpers.h
|
||||
configutils_bobby.h
|
||||
controller.h
|
||||
debugcolorhelpers.h
|
||||
debuginputhandler.h
|
||||
debugtexthelpers.h
|
||||
displays/batterygraphdisplay.h
|
||||
displays/batteryinfodisplay.h
|
||||
displays/bmsdisplay.h
|
||||
displays/bobbychangevaluedisplay.h
|
||||
displays/bobbydisplay.h
|
||||
displays/bobbydisplaywithtitle.h
|
||||
displays/bobbygraphdisplay.h
|
||||
displays/bobbymenudisplay.h
|
||||
displays/bobbypopupdisplay.h
|
||||
displays/bobbysplitgraphdisplay.h
|
||||
displays/calibratevoltagedisplay.h
|
||||
displays/confiscationdisplay.h
|
||||
displays/gameoflifedisplay.h
|
||||
displays/gametrakcalibratedisplay.h
|
||||
displays/joystickdebugdisplay.h
|
||||
displays/ledstripcolorsdisplay.h
|
||||
displays/lockscreen.h
|
||||
displays/menudisplaywithtime.cpp
|
||||
displays/menudisplaywithtime.h
|
||||
displays/menus/aboutmenu.h
|
||||
displays/menus/batterydebugmenu.h
|
||||
displays/menus/batterymenu.h
|
||||
displays/menus/blesettingsmenu.h
|
||||
displays/menus/bluetoothsettingsmenu.h
|
||||
displays/menus/bmsmenu.h
|
||||
displays/menus/boardcomputerhardwaresettingsmenu.h
|
||||
displays/menus/buzzermenu.h
|
||||
displays/menus/candebugmenu.h
|
||||
displays/menus/cloudsettingsmenu.h
|
||||
displays/menus/commanddebugmenu.h
|
||||
displays/menus/controllerhardwaresettingsmenu.h
|
||||
displays/menus/crashmenu.h
|
||||
displays/menus/debugmenu.h
|
||||
displays/menus/defaultmodesettingsmenu.h
|
||||
displays/menus/demosmenu.h
|
||||
displays/menus/dynamicdebugmenu.h
|
||||
displays/menus/enablemenu.h
|
||||
displays/menus/espnowmenu.h
|
||||
displays/menus/espnowsettingsmenu.h
|
||||
displays/menus/extrabuttoncalibratemenu.h
|
||||
displays/menus/featureflagsmenu.h
|
||||
displays/menus/feedbackdebugmenu.h
|
||||
displays/menus/gametrakmodesettingsmenu.h
|
||||
displays/menus/garagemenu.h
|
||||
displays/menus/gitmenu.h
|
||||
displays/menus/graphsmenu.h
|
||||
displays/menus/greenpassmenu.h
|
||||
displays/menus/handbremssettingsmenu.h
|
||||
displays/menus/invertmenu.h
|
||||
displays/menus/larsmmodesettingsmenu.h
|
||||
displays/menus/ledstripmenu.h
|
||||
displays/menus/ledstripselectblinkmenu.h
|
||||
displays/menus/ledstripselectotamode.h
|
||||
displays/menus/limitssettingsmenu.h
|
||||
displays/menus/lockscreensettingsmenu.h
|
||||
displays/menus/mainmenu.h
|
||||
displays/menus/manageprofilesmenu.h
|
||||
displays/menus/mickmodesettingsmenu.h
|
||||
displays/menus/modessettingsmenu.h
|
||||
displays/menus/mosfetsmenu.h
|
||||
displays/menus/motorfeedbackdebugmenu.h
|
||||
displays/menus/motorstatedebugmenu.h
|
||||
displays/menus/motortestmodesettingsmenu.h
|
||||
displays/menus/networksettingsmenu.h
|
||||
displays/menus/otamenu.h
|
||||
displays/menus/profilesmenu.h
|
||||
displays/menus/recoverymenu.h
|
||||
displays/menus/remotecontrolmodesettingsmenu.h
|
||||
displays/menus/selectbuildserverbranch.h
|
||||
displays/menus/selectbuildservermenu.h
|
||||
displays/menus/selectmodemenu.h
|
||||
displays/menus/selectotabuildmenu.h
|
||||
displays/menus/settingsmenu.h
|
||||
displays/menus/setupquickactionsmenu.h
|
||||
displays/menus/statisticsmenu.h
|
||||
displays/menus/taskmanagermenu.h
|
||||
displays/menus/tempomatmodesettingsmenu.h
|
||||
displays/menus/timersmenu.h
|
||||
displays/menus/timesettingsmenu.h
|
||||
displays/menus/typesafeenumchangemenu.h
|
||||
displays/menus/udpcloudsettingsmenu.h
|
||||
displays/menus/wifiapclientsmenu.h
|
||||
displays/menus/wifiapsettingsmenu.h
|
||||
displays/menus/wifistaconfigentrymenu.h
|
||||
displays/menus/wifistaconfigsmenu.h
|
||||
displays/menus/wifistascanentrymenu.h
|
||||
displays/menus/wifistascanmenu.h
|
||||
displays/menus/wifistasettingsmenu.h
|
||||
displays/metersdisplay.h
|
||||
displays/pingpongdisplay.h
|
||||
displays/potiscalibratedisplay.h
|
||||
displays/poweroffdisplay.h
|
||||
displays/powersupplydisplay.h
|
||||
displays/qrcodedebug.h
|
||||
displays/qrdisplay.h
|
||||
displays/qrimportdisplay.h
|
||||
displays/setup/ask_calibrate_other_buttons.h
|
||||
displays/setup/ask_setup_clouds.h
|
||||
displays/setup/basic_buttons.h
|
||||
displays/setup/calibrate_potis.h
|
||||
displays/setup/final_information.h
|
||||
displays/setup/information.h
|
||||
displays/setup/setup_cloud.h
|
||||
displays/speedinfodisplay.h
|
||||
displays/spirodisplay.h
|
||||
displays/starfielddisplay.h
|
||||
displays/statusdisplay.h
|
||||
displays/updatedisplay.h
|
||||
displays/xydebugdisplay.h
|
||||
dnsannounce.h
|
||||
dpad.h
|
||||
dpad3wire.h
|
||||
@@ -181,10 +65,16 @@ set(BOBBY_HEADERS
|
||||
dpad_boardcomputer_v2.h
|
||||
drivingstatistics.h
|
||||
espnowfunctions.h
|
||||
esptexthelpers.h
|
||||
feedbackemulator.h
|
||||
feedbackparser.h
|
||||
globals.h
|
||||
guihelpers/bobbychangevaluedisplay.h
|
||||
guihelpers/bobbycheckbox.h
|
||||
guihelpers/bobbydisplay.h
|
||||
guihelpers/bobbydisplaywithtitle.h
|
||||
guihelpers/bobbyerrorhandler.h
|
||||
guihelpers/bobbymenudisplay.h
|
||||
guihelpers/bobbypopupdisplay.h
|
||||
handbremse.h
|
||||
icons/alert.h
|
||||
icons/battery.h
|
||||
@@ -215,7 +105,6 @@ set(BOBBY_HEADERS
|
||||
icons/wifi.h
|
||||
ledstrip.h
|
||||
ledstripdefines.h
|
||||
macros_bobbycar.h
|
||||
modeinterface.h
|
||||
modes.h
|
||||
modes/defaultmode.h
|
||||
@@ -237,16 +126,126 @@ set(BOBBY_HEADERS
|
||||
qrimport.h
|
||||
rotary.h
|
||||
screens.h
|
||||
screens/aboutmenu.h
|
||||
screens/batterydebugmenu.h
|
||||
screens/batterygraphdisplay.h
|
||||
screens/batteryinfodisplay.h
|
||||
screens/batterymenu.h
|
||||
screens/blesettingsmenu.h
|
||||
screens/bluetoothsettingsmenu.h
|
||||
screens/bmsdisplay.h
|
||||
screens/bmsmenu.h
|
||||
screens/boardcomputerhardwaresettingsmenu.h
|
||||
guihelpers/bobbygraphdisplay.h
|
||||
guihelpers/bobbysplitgraphdisplay.h
|
||||
screens/buzzermenu.h
|
||||
screens/calibratevoltagedisplay.h
|
||||
screens/candebugmenu.h
|
||||
screens/cloudsettingsmenu.h
|
||||
screens/commanddebugmenu.h
|
||||
screens/confiscationdisplay.h
|
||||
screens/controllerhardwaresettingsmenu.h
|
||||
screens/crashmenu.h
|
||||
screens/debugmenu.h
|
||||
screens/defaultmodesettingsmenu.h
|
||||
screens/demosmenu.h
|
||||
screens/dynamicdebugmenu.h
|
||||
screens/enablemenu.h
|
||||
screens/espnowmenu.h
|
||||
screens/espnowsettingsmenu.h
|
||||
screens/extrabuttoncalibratemenu.h
|
||||
screens/featureflagsmenu.h
|
||||
screens/feedbackdebugmenu.h
|
||||
screens/gameoflifedisplay.h
|
||||
screens/gametrakcalibratedisplay.h
|
||||
screens/gametrakmodesettingsmenu.h
|
||||
screens/garagemenu.h
|
||||
screens/gitmenu.h
|
||||
screens/graphsmenu.h
|
||||
screens/greenpassmenu.h
|
||||
screens/handbremssettingsmenu.h
|
||||
screens/invertmenu.h
|
||||
screens/joystickdebugdisplay.h
|
||||
screens/larsmmodesettingsmenu.h
|
||||
screens/ledstripcolorsdisplay.h
|
||||
screens/ledstripmenu.h
|
||||
screens/ledstripselectblinkmenu.h
|
||||
screens/ledstripselectotamode.h
|
||||
screens/limitssettingsmenu.h
|
||||
screens/lockscreen.h
|
||||
screens/lockscreensettingsmenu.h
|
||||
screens/mainmenu.h
|
||||
screens/manageprofilesmenu.h
|
||||
guihelpers/menudisplaywithtime.cpp
|
||||
guihelpers/menudisplaywithtime.h
|
||||
screens/metersdisplay.h
|
||||
screens/mickmodesettingsmenu.h
|
||||
screens/modessettingsmenu.h
|
||||
screens/mosfetsmenu.h
|
||||
screens/motorfeedbackdebugmenu.h
|
||||
screens/motorstatedebugmenu.h
|
||||
screens/motortestmodesettingsmenu.h
|
||||
screens/networksettingsmenu.h
|
||||
screens/otamenu.h
|
||||
screens/pingpongdisplay.h
|
||||
screens/poweroffdisplay.h
|
||||
screens/powersupplydisplay.h
|
||||
screens/profilesmenu.h
|
||||
screens/qrcodedebug.h
|
||||
screens/qrdisplay.h
|
||||
screens/qrimportdisplay.h
|
||||
screens/rebootscreen.h
|
||||
screens/recoverymenu.h
|
||||
screens/remotecontrolmodesettingsmenu.h
|
||||
screens/resetnvsscreen.h
|
||||
screens/selectbuildserverbranch.h
|
||||
screens/selectbuildservermenu.h
|
||||
screens/selectmodemenu.h
|
||||
screens/selectotabuildmenu.h
|
||||
screens/settingsmenu.h
|
||||
screens/setup/ask_calibrate_other_buttons.h
|
||||
screens/setup/ask_setup_clouds.h
|
||||
screens/setup/basic_buttons.h
|
||||
screens/setup/calibrate_potis.h
|
||||
screens/setup/final_information.h
|
||||
screens/setup/information.h
|
||||
screens/setup/setup_cloud.h
|
||||
screens/setupquickactionsmenu.h
|
||||
screens/speedinfodisplay.h
|
||||
screens/spirodisplay.h
|
||||
screens/starfielddisplay.h
|
||||
screens/statisticsmenu.h
|
||||
screens/statusdisplay.h
|
||||
screens/taskmanagermenu.h
|
||||
screens/tempomatmodesettingsmenu.h
|
||||
screens/timersmenu.h
|
||||
screens/timesettingsmenu.h
|
||||
screens/typesafeenumchangemenu.h
|
||||
screens/udpcloudsettingsmenu.h
|
||||
screens/updatedisplay.h
|
||||
screens/wifiapclientsmenu.h
|
||||
screens/wifiapsettingsmenu.h
|
||||
screens/wifistaconfigentrymenu.h
|
||||
screens/wifistaconfigsmenu.h
|
||||
screens/wifistascanentrymenu.h
|
||||
screens/wifistascanmenu.h
|
||||
screens/wifistasettingsmenu.h
|
||||
screens/xydebugdisplay.h
|
||||
serial_bobby.h
|
||||
settingspersister.h
|
||||
settingsutils.h
|
||||
setup.h
|
||||
softpwmlimiter.h
|
||||
statistics.h
|
||||
statustexthelper.h
|
||||
taskmanager.h
|
||||
tempomat.h
|
||||
texthelpers/bletexthelpers.h
|
||||
texthelpers/bluetoothtexthelpers.h
|
||||
texthelpers/cloudtexthelpers.h
|
||||
texthelpers/debugtexthelpers.h
|
||||
texthelpers/esptexthelpers.h
|
||||
texthelpers/networktexthelpers.h
|
||||
texthelpers/statustexthelper.h
|
||||
texthelpers/wifiaptexthelpers.h
|
||||
texthelpers/wifistatexthelpers.h
|
||||
time_bobbycar.h
|
||||
@@ -270,180 +269,47 @@ set(BOBBY_HEADERS
|
||||
set(BOBBY_SOURCES
|
||||
accessors/wifistaconfigaccessors.cpp
|
||||
actions/assertaction.cpp
|
||||
actions/bluetoothbeginaction.cpp
|
||||
actions/bluetoothbeginmasteraction.cpp
|
||||
actions/bluetoothconnectbmsaction.cpp
|
||||
actions/bluetoothdisconnectaction.cpp
|
||||
actions/bluetoothendaction.cpp
|
||||
actions/bluetoothflushaction.cpp
|
||||
actions/bmsturnoffchargeaction.cpp
|
||||
actions/bmsturnoffdischargeaction.cpp
|
||||
actions/bmsturnonchargeaction.cpp
|
||||
actions/bmsturnondischargeaction.cpp
|
||||
actions/dividebyzeroaction.cpp
|
||||
actions/erasenvsaction.cpp
|
||||
actions/ledstripanimationactions.cpp
|
||||
actions/ledstripblinkactions.cpp
|
||||
actions/loadsettingsaction.cpp
|
||||
actions/modesettingsaction.cpp
|
||||
actions/qraction.cpp
|
||||
actions/rebootaction.cpp
|
||||
actions/resetnvsaction.cpp
|
||||
actions/savesettingsaction.cpp
|
||||
actions/setupactions.cpp
|
||||
actions/switchprofileaction.cpp
|
||||
actions/tempomatmodeapplycurrentpeedaction.cpp
|
||||
actions/updateswapfrontbackaction.cpp
|
||||
actions/wifiscanaction.cpp
|
||||
actions/wifistascanaction.cpp
|
||||
actions/wifistascanclearaction.cpp
|
||||
battery.cpp
|
||||
ble_bobby.cpp
|
||||
bletexthelpers.cpp
|
||||
bluetooth_bobby.cpp
|
||||
bluetoothmode.cpp
|
||||
bluetoothtexthelpers.cpp
|
||||
bmsutils.cpp
|
||||
bobbyblinker.cpp
|
||||
bobbybuttons.cpp
|
||||
bobbyerrorhandler.cpp
|
||||
bobbyhupe.cpp
|
||||
bobbyquickactions.cpp
|
||||
buildserver.cpp
|
||||
can.cpp
|
||||
changevaluedisplay_bluetoothmode.cpp
|
||||
changevaluedisplay_bobbyquickactions.cpp
|
||||
changevaluedisplay_controlmode.cpp
|
||||
changevaluedisplay_controltype.cpp
|
||||
changevaluedisplay_larsmmode_mode.cpp
|
||||
changevaluedisplay_unifiedmodelmode.cpp
|
||||
cloud.cpp
|
||||
cloudtexthelpers.cpp
|
||||
configwrapper_bobby.cpp
|
||||
controller.cpp
|
||||
debugcolorhelpers.cpp
|
||||
debuginputhandler.cpp
|
||||
debugtexthelpers.cpp
|
||||
displays/batterygraphdisplay.cpp
|
||||
displays/batteryinfodisplay.cpp
|
||||
displays/bmsdisplay.cpp
|
||||
displays/bobbychangevaluedisplay.cpp
|
||||
displays/bobbydisplay.cpp
|
||||
displays/bobbydisplaywithtitle.cpp
|
||||
displays/bobbygraphdisplay.cpp
|
||||
displays/bobbymenudisplay.cpp
|
||||
displays/bobbypopupdisplay.cpp
|
||||
displays/bobbysplitgraphdisplay.cpp
|
||||
displays/calibratevoltagedisplay.cpp
|
||||
displays/confiscationdisplay.cpp
|
||||
displays/gameoflifedisplay.cpp
|
||||
displays/gametrakcalibratedisplay.cpp
|
||||
displays/joystickdebugdisplay.cpp
|
||||
displays/ledstripcolorsdisplay.cpp
|
||||
displays/lockscreen.cpp
|
||||
displays/menus/aboutmenu.cpp
|
||||
displays/menus/batterydebugmenu.cpp
|
||||
displays/menus/batterymenu.cpp
|
||||
displays/menus/blesettingsmenu.cpp
|
||||
displays/menus/bluetoothsettingsmenu.cpp
|
||||
displays/menus/bmsmenu.cpp
|
||||
displays/menus/boardcomputerhardwaresettingsmenu.cpp
|
||||
displays/menus/buzzermenu.cpp
|
||||
displays/menus/candebugmenu.cpp
|
||||
displays/menus/cloudsettingsmenu.cpp
|
||||
displays/menus/commanddebugmenu.cpp
|
||||
displays/menus/controllerhardwaresettingsmenu.cpp
|
||||
displays/menus/crashmenu.cpp
|
||||
displays/menus/debugmenu.cpp
|
||||
displays/menus/defaultmodesettingsmenu.cpp
|
||||
displays/menus/demosmenu.cpp
|
||||
displays/menus/dynamicdebugmenu.cpp
|
||||
displays/menus/enablemenu.cpp
|
||||
displays/menus/espnowmenu.cpp
|
||||
displays/menus/espnowsettingsmenu.cpp
|
||||
displays/menus/extrabuttoncalibratemenu.cpp
|
||||
displays/menus/featureflagsmenu.cpp
|
||||
displays/menus/feedbackdebugmenu.cpp
|
||||
displays/menus/gametrakmodesettingsmenu.cpp
|
||||
displays/menus/garagemenu.cpp
|
||||
displays/menus/gitmenu.cpp
|
||||
displays/menus/graphsmenu.cpp
|
||||
displays/menus/greenpassmenu.cpp
|
||||
displays/menus/handbremssettingsmenu.cpp
|
||||
displays/menus/invertmenu.cpp
|
||||
displays/menus/larsmmodesettingsmenu.cpp
|
||||
displays/menus/ledstripmenu.cpp
|
||||
displays/menus/ledstripselectblinkmenu.cpp
|
||||
displays/menus/ledstripselectotamode.cpp
|
||||
displays/menus/limitssettingsmenu.cpp
|
||||
displays/menus/lockscreensettingsmenu.cpp
|
||||
displays/menus/mainmenu.cpp
|
||||
displays/menus/manageprofilesmenu.cpp
|
||||
displays/menus/mickmodesettingsmenu.cpp
|
||||
displays/menus/modessettingsmenu.cpp
|
||||
displays/menus/mosfetsmenu.cpp
|
||||
displays/menus/motorfeedbackdebugmenu.cpp
|
||||
displays/menus/motorstatedebugmenu.cpp
|
||||
displays/menus/motortestmodesettingsmenu.cpp
|
||||
displays/menus/networksettingsmenu.cpp
|
||||
displays/menus/otamenu.cpp
|
||||
displays/menus/profilesmenu.cpp
|
||||
displays/menus/recoverymenu.cpp
|
||||
displays/menus/remotecontrolmodesettingsmenu.cpp
|
||||
displays/menus/selectbuildserverbranch.cpp
|
||||
displays/menus/selectbuildservermenu.cpp
|
||||
displays/menus/selectmodemenu.cpp
|
||||
displays/menus/selectotabuildmenu.cpp
|
||||
displays/menus/settingsmenu.cpp
|
||||
displays/menus/setupquickactionsmenu.cpp
|
||||
displays/menus/statisticsmenu.cpp
|
||||
displays/menus/taskmanagermenu.cpp
|
||||
displays/menus/tempomatmodesettingsmenu.cpp
|
||||
displays/menus/timersmenu.cpp
|
||||
displays/menus/timesettingsmenu.cpp
|
||||
displays/menus/typesafeenumchangemenu.cpp
|
||||
displays/menus/udpcloudsettingsmenu.cpp
|
||||
displays/menus/wifiapclientsmenu.cpp
|
||||
displays/menus/wifiapsettingsmenu.cpp
|
||||
displays/menus/wifistaconfigentrymenu.cpp
|
||||
displays/menus/wifistaconfigsmenu.cpp
|
||||
displays/menus/wifistascanentrymenu.cpp
|
||||
displays/menus/wifistascanmenu.cpp
|
||||
displays/menus/wifistasettingsmenu.cpp
|
||||
displays/metersdisplay.cpp
|
||||
displays/pingpongdisplay.cpp
|
||||
displays/potiscalibratedisplay.cpp
|
||||
displays/poweroffdisplay.cpp
|
||||
displays/powersupplydisplay.cpp
|
||||
displays/qrcodedebug.cpp
|
||||
displays/qrdisplay.cpp
|
||||
displays/qrimportdisplay.cpp
|
||||
displays/setup/ask_calibrate_other_buttons.cpp
|
||||
displays/setup/ask_setup_clouds.cpp
|
||||
displays/setup/basic_buttons.cpp
|
||||
displays/setup/calibrate_potis.cpp
|
||||
displays/setup/final_information.cpp
|
||||
displays/setup/information.cpp
|
||||
displays/setup/setup_cloud.cpp
|
||||
displays/speedinfodisplay.cpp
|
||||
displays/spirodisplay.cpp
|
||||
displays/starfielddisplay.cpp
|
||||
displays/statusdisplay.cpp
|
||||
displays/updatedisplay.cpp
|
||||
displays/xydebugdisplay.cpp
|
||||
dnsannounce.cpp
|
||||
dpad.cpp
|
||||
dpad3wire.cpp
|
||||
dpad5wire.cpp
|
||||
dpad5wire_2out.cpp
|
||||
dpad6wire.cpp
|
||||
dpad_boardcomputer_v2.cpp
|
||||
drivingstatistics.cpp
|
||||
espnowfunctions.cpp
|
||||
esptexthelpers.cpp
|
||||
feedbackemulator.cpp
|
||||
feedbackparser.cpp
|
||||
globals.cpp
|
||||
guihelpers/bobbychangevaluedisplay.cpp
|
||||
guihelpers/bobbydisplay.cpp
|
||||
guihelpers/bobbydisplaywithtitle.cpp
|
||||
guihelpers/bobbyerrorhandler.cpp
|
||||
guihelpers/bobbymenudisplay.cpp
|
||||
guihelpers/bobbypopupdisplay.cpp
|
||||
handbremse.cpp
|
||||
icons/alert.cpp
|
||||
icons/battery.cpp
|
||||
@@ -473,10 +339,7 @@ set(BOBBY_SOURCES
|
||||
icons/update.cpp
|
||||
icons/wifi.cpp
|
||||
ledstrip.cpp
|
||||
ledstripdefines.cpp
|
||||
macros_bobbycar.cpp
|
||||
main.cpp
|
||||
modeinterface.cpp
|
||||
modes.cpp
|
||||
modes/defaultmode.cpp
|
||||
modes/gametrakmode.cpp
|
||||
@@ -493,24 +356,117 @@ set(BOBBY_SOURCES
|
||||
ota.cpp
|
||||
potis.cpp
|
||||
presets.cpp
|
||||
profilesettings.cpp
|
||||
qrimport.cpp
|
||||
rotary.cpp
|
||||
screens.cpp
|
||||
screens/aboutmenu.cpp
|
||||
screens/batterydebugmenu.cpp
|
||||
screens/batterygraphdisplay.cpp
|
||||
screens/batteryinfodisplay.cpp
|
||||
screens/batterymenu.cpp
|
||||
screens/blesettingsmenu.cpp
|
||||
screens/bmsdisplay.cpp
|
||||
screens/bmsmenu.cpp
|
||||
screens/boardcomputerhardwaresettingsmenu.cpp
|
||||
guihelpers/bobbygraphdisplay.cpp
|
||||
guihelpers/bobbysplitgraphdisplay.cpp
|
||||
screens/buzzermenu.cpp
|
||||
screens/calibratevoltagedisplay.cpp
|
||||
screens/candebugmenu.cpp
|
||||
screens/cloudsettingsmenu.cpp
|
||||
screens/confiscationdisplay.cpp
|
||||
screens/controllerhardwaresettingsmenu.cpp
|
||||
screens/crashmenu.cpp
|
||||
screens/debugmenu.cpp
|
||||
screens/defaultmodesettingsmenu.cpp
|
||||
screens/demosmenu.cpp
|
||||
screens/dynamicdebugmenu.cpp
|
||||
screens/enablemenu.cpp
|
||||
screens/espnowmenu.cpp
|
||||
screens/espnowsettingsmenu.cpp
|
||||
screens/extrabuttoncalibratemenu.cpp
|
||||
screens/featureflagsmenu.cpp
|
||||
screens/gameoflifedisplay.cpp
|
||||
screens/garagemenu.cpp
|
||||
screens/gitmenu.cpp
|
||||
screens/graphsmenu.cpp
|
||||
screens/greenpassmenu.cpp
|
||||
screens/handbremssettingsmenu.cpp
|
||||
screens/invertmenu.cpp
|
||||
screens/joystickdebugdisplay.cpp
|
||||
screens/larsmmodesettingsmenu.cpp
|
||||
screens/ledstripcolorsdisplay.cpp
|
||||
screens/ledstripmenu.cpp
|
||||
screens/ledstripselectblinkmenu.cpp
|
||||
screens/ledstripselectotamode.cpp
|
||||
screens/limitssettingsmenu.cpp
|
||||
screens/lockscreen.cpp
|
||||
screens/lockscreensettingsmenu.cpp
|
||||
screens/mainmenu.cpp
|
||||
screens/manageprofilesmenu.cpp
|
||||
screens/metersdisplay.cpp
|
||||
screens/mickmodesettingsmenu.cpp
|
||||
screens/modessettingsmenu.cpp
|
||||
screens/mosfetsmenu.cpp
|
||||
screens/motortestmodesettingsmenu.cpp
|
||||
screens/networksettingsmenu.cpp
|
||||
screens/otamenu.cpp
|
||||
screens/pingpongdisplay.cpp
|
||||
screens/poweroffdisplay.cpp
|
||||
screens/powersupplydisplay.cpp
|
||||
screens/profilesmenu.cpp
|
||||
screens/qrcodedebug.cpp
|
||||
screens/qrdisplay.cpp
|
||||
screens/qrimportdisplay.cpp
|
||||
screens/rebootscreen.cpp
|
||||
screens/recoverymenu.cpp
|
||||
screens/remotecontrolmodesettingsmenu.cpp
|
||||
screens/resetnvsscreen.cpp
|
||||
screens/selectbuildserverbranch.cpp
|
||||
screens/selectbuildservermenu.cpp
|
||||
screens/selectmodemenu.cpp
|
||||
screens/selectotabuildmenu.cpp
|
||||
screens/settingsmenu.cpp
|
||||
screens/setup/ask_calibrate_other_buttons.cpp
|
||||
screens/setup/ask_setup_clouds.cpp
|
||||
screens/setup/basic_buttons.cpp
|
||||
screens/setup/calibrate_potis.cpp
|
||||
screens/setup/final_information.cpp
|
||||
screens/setup/information.cpp
|
||||
screens/setup/setup_cloud.cpp
|
||||
screens/setupquickactionsmenu.cpp
|
||||
screens/speedinfodisplay.cpp
|
||||
screens/spirodisplay.cpp
|
||||
screens/starfielddisplay.cpp
|
||||
screens/statisticsmenu.cpp
|
||||
screens/statusdisplay.cpp
|
||||
screens/taskmanagermenu.cpp
|
||||
screens/tempomatmodesettingsmenu.cpp
|
||||
screens/timersmenu.cpp
|
||||
screens/timesettingsmenu.cpp
|
||||
screens/typesafeenumchangemenu.cpp
|
||||
screens/udpcloudsettingsmenu.cpp
|
||||
screens/updatedisplay.cpp
|
||||
screens/wifiapclientsmenu.cpp
|
||||
screens/wifiapsettingsmenu.cpp
|
||||
screens/wifistaconfigentrymenu.cpp
|
||||
screens/wifistaconfigsmenu.cpp
|
||||
screens/wifistascanentrymenu.cpp
|
||||
screens/wifistascanmenu.cpp
|
||||
screens/wifistasettingsmenu.cpp
|
||||
screens/xydebugdisplay.cpp
|
||||
serial_bobby.cpp
|
||||
settingspersister.cpp
|
||||
settingsutils.cpp
|
||||
setup.cpp
|
||||
softpwmlimiter.cpp
|
||||
statistics.cpp
|
||||
statustexthelper.cpp
|
||||
taskmanager.cpp
|
||||
tempomat.cpp
|
||||
texthelpers/cloudtexthelpers.cpp
|
||||
texthelpers/networktexthelpers.cpp
|
||||
texthelpers/wifiaptexthelpers.cpp
|
||||
texthelpers/wifistatexthelpers.cpp
|
||||
time_bobbycar.cpp
|
||||
types.cpp
|
||||
udpcloud.cpp
|
||||
unifiedmodelmode.cpp
|
||||
utils.cpp
|
||||
|
@@ -1,8 +1 @@
|
||||
#include "ledstripanimationactions.h"
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
void LedStripSetAnimationAction::triggered()
|
||||
{
|
||||
if (auto result = configs.write_config(configs.ledstrip.animationType, m_animation); !result)
|
||||
BobbyErrorHandler{}.errorOccured(std::move(result).error());
|
||||
}
|
||||
#endif
|
||||
|
@@ -7,7 +7,9 @@
|
||||
#include "ledstrip.h"
|
||||
#include "ledstripdefines.h"
|
||||
#include "newsettings.h"
|
||||
#include "bobbyerrorhandler.h"
|
||||
#include "guihelpers/bobbyerrorhandler.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
template<LedstripAnimation type>
|
||||
class LedStripSetAnimationActionStatic : public virtual espgui::ActionInterface
|
||||
@@ -24,7 +26,13 @@ class LedStripSetAnimationAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
LedStripSetAnimationAction(LedstripAnimation animation) : m_animation{animation} {};
|
||||
void triggered() override;
|
||||
void triggered()
|
||||
{
|
||||
if (auto result = configs.write_config(configs.ledstrip.animationType, m_animation); !result)
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
}
|
||||
private:
|
||||
const LedstripAnimation m_animation;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
||||
|
@@ -17,15 +17,17 @@
|
||||
#include "modes/wheelchairmode.h"
|
||||
#endif
|
||||
#include "modes/remotecontrolmode.h"
|
||||
#include "displays/menus/defaultmodesettingsmenu.h"
|
||||
#include "displays/menus/tempomatmodesettingsmenu.h"
|
||||
#include "displays/menus/larsmmodesettingsmenu.h"
|
||||
#include "screens/defaultmodesettingsmenu.h"
|
||||
#include "screens/tempomatmodesettingsmenu.h"
|
||||
#include "screens/larsmmodesettingsmenu.h"
|
||||
#ifdef FEATURE_GAMETRAK
|
||||
#include "displays/menus/gametrakmodesettingsmenu.h"
|
||||
#include "screens/gametrakmodesettingsmenu.h"
|
||||
#endif
|
||||
#include "displays/menus/mickmodesettingsmenu.h"
|
||||
#include "displays/menus/motortestmodesettingsmenu.h"
|
||||
#include "displays/menus/remotecontrolmodesettingsmenu.h"
|
||||
#include "screens/mickmodesettingsmenu.h"
|
||||
#include "screens/motortestmodesettingsmenu.h"
|
||||
#include "screens/remotecontrolmodesettingsmenu.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void ModeSettingsAction::triggered()
|
||||
{
|
||||
@@ -54,3 +56,4 @@ void ModeSettingsAction::triggered()
|
||||
//Serial.println("Unknown mode, cannot open settings for it");
|
||||
}
|
||||
}
|
||||
} // namespace bobby
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "actioninterface.h"
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
namespace bobby {
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
@@ -9,3 +12,4 @@ class ModeSettingsAction : public virtual ActionInterface
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
||||
} // namespace bobby
|
||||
|
@@ -7,9 +7,8 @@
|
||||
#include <actioninterface.h>
|
||||
|
||||
// local includes
|
||||
#include "actions/qraction.h"
|
||||
#include "displays/qrdisplay.h"
|
||||
#include "displays/qrimportdisplay.h"
|
||||
#include "screens/qrdisplay.h"
|
||||
#include "screens/qrimportdisplay.h"
|
||||
|
||||
namespace qraction {
|
||||
struct QrMenu {
|
||||
@@ -26,7 +25,7 @@ public:
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
espgui::pushScreen<QrDisplay>(m_msg);
|
||||
espgui::pushScreen<bobby::QrDisplay>(m_msg);
|
||||
}
|
||||
private:
|
||||
std::string m_msg;
|
||||
@@ -40,7 +39,16 @@ public:
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
espgui::pushScreen<QrImportDisplay>(std::move(m_nvskey));
|
||||
espgui::changeScreenCallback = [&](espgui::TftInterface &tft){
|
||||
espgui::pushScreenInternal();
|
||||
|
||||
auto newDisplay = std::make_unique<bobby::QrImportDisplay>(std::move(m_nvskey), tft);
|
||||
newDisplay->start();
|
||||
newDisplay->initScreen(tft);
|
||||
newDisplay->update();
|
||||
newDisplay->redraw(tft);
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
};
|
||||
}
|
||||
private:
|
||||
std::string m_nvskey;
|
||||
|
@@ -1,22 +0,0 @@
|
||||
#include "rebootaction.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_system.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
|
||||
void RebootAction::triggered()
|
||||
{
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
espgui::tft.drawString("Reboot", 5, 5, 4);
|
||||
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE);
|
||||
espgui::tft.drawString("Rebooting now...", 0, 50, 4);
|
||||
|
||||
esp_restart();
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class RebootAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
@@ -5,36 +5,16 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
#include <tftinstance.h>
|
||||
|
||||
|
||||
// local includes
|
||||
#include "newsettings.h"
|
||||
|
||||
template<bool reboot>
|
||||
class ResetNVSAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override
|
||||
{
|
||||
if (reboot)
|
||||
{
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
espgui::tft.drawString("Reboot", 5, 5, 4);
|
||||
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE);
|
||||
espgui::tft.drawString("Rebooting now...", 0, 50, 4);
|
||||
|
||||
configs.reset();
|
||||
|
||||
esp_restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
configs.reset();
|
||||
}
|
||||
configs.reset();
|
||||
}
|
||||
};
|
||||
|
@@ -4,8 +4,10 @@
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/setup/basic_buttons.h"
|
||||
#include "displays/setup/calibrate_potis.h"
|
||||
#include "screens/setup/basic_buttons.h"
|
||||
#include "screens/setup/calibrate_potis.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
PushButtonCalibrateDisplayAction::PushButtonCalibrateDisplayAction(const bool early_return) :
|
||||
m_early_return{early_return}
|
||||
@@ -22,5 +24,6 @@ PushPotiCalibrateDisplayAction::PushPotiCalibrateDisplayAction(const bool early_
|
||||
|
||||
void PushPotiCalibrateDisplayAction::triggered()
|
||||
{
|
||||
// espgui::pushScreen<SetupCalibratePotisDisplay>(m_early_return); // commented out until implemented
|
||||
espgui::pushScreen<SetupCalibratePotisDisplay>(m_early_return);
|
||||
}
|
||||
} // namespace bobby
|
||||
|
@@ -3,6 +3,8 @@
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class PushButtonCalibrateDisplayAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
@@ -22,3 +24,4 @@ public:
|
||||
private:
|
||||
const bool m_early_return;
|
||||
};
|
||||
} // namespace bobby
|
||||
|
@@ -8,12 +8,12 @@
|
||||
#include <wifi_bobbycar.h>
|
||||
|
||||
// local includes
|
||||
#include "ledstrip.h"
|
||||
#include "globals.h"
|
||||
#include "ledstrip.h"
|
||||
#include "modes/defaultmode.h"
|
||||
#include "modes/remotecontrolmode.h"
|
||||
#include "utils.h"
|
||||
#include "newsettings.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace {
|
||||
constexpr const char * const TAG = "BOBBYBLE";
|
||||
|
@@ -1,14 +0,0 @@
|
||||
#include "bobbyerrorhandler.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbypopupdisplay.h"
|
||||
|
||||
void BobbyErrorHandler::errorOccurred(std::string &&error)
|
||||
{
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error), std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay();
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
}
|
@@ -13,15 +13,15 @@
|
||||
#include <menudisplay.h>
|
||||
#include <numberparsing.h>
|
||||
#include <screenmanager.h>
|
||||
#include <tftinstance.h>
|
||||
#include <tickchrono.h>
|
||||
#include <wrappers/websocket_client.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbyerrorhandler.h"
|
||||
#include "globals.h"
|
||||
#include "guihelpers/bobbyerrorhandler.h"
|
||||
#include "newsettings.h"
|
||||
#include "ota.h"
|
||||
#include "screens.h"
|
||||
#include "typeutils.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -770,7 +770,7 @@ std::string getLoginMessage()
|
||||
{
|
||||
using namespace espgui;
|
||||
return fmt::format(R"({{"type": "hello", "name": "{}", "res": "{}x{}", "pass": "{}", "key": "{}"}})",
|
||||
configs.otaUsername.value(), tft.width(), tft.height(), configs.webserverPassword.value(), configs.cloudSettings.cloudKey.value());
|
||||
configs.otaUsername.value(), bobby::getScreenWidth(), bobby::getScreenHeight(), configs.webserverPassword.value(), configs.cloudSettings.cloudKey.value());
|
||||
}
|
||||
|
||||
void cloudEventHandler(void *event_handler_arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
|
||||
@@ -810,7 +810,7 @@ void cloudEventHandler(void *event_handler_arg, esp_event_base_t event_base, int
|
||||
std::string id = doc["id"];
|
||||
doc.clear();
|
||||
ESP_LOGI(TAG, "popup: %s, id: %s", text.c_str(), id.c_str());
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(text));
|
||||
bobby::BobbyErrorHandler{}.errorOccurred(std::move(text));
|
||||
|
||||
if (id.empty())
|
||||
return;
|
||||
|
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "colorinterface.h"
|
||||
// 3rdparty lib includes
|
||||
#include <colorinterface.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
|
||||
namespace {
|
||||
template<typename Tcontroller, int TsuccessColor>
|
||||
class FeedbackColor : public virtual ColorInterface { public: int color() const { return Tcontroller::get().feedbackValid ? TsuccessColor : TFT_RED; } };
|
||||
class FeedbackColor : public virtual ColorInterface { public: int color() const { return Tcontroller::get().feedbackValid ? TsuccessColor : espgui::TFT_RED; } };
|
||||
|
||||
template<int TsuccessColor>
|
||||
using FrontFeedbackColor = FeedbackColor<FrontControllerGetter, TsuccessColor>;
|
||||
|
@@ -8,17 +8,17 @@
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <esp32-hal-gpio.h>
|
||||
#include <screenmanager.h>
|
||||
#include <changevaluedisplay.h>
|
||||
#include <changevaluedisplay_string.h>
|
||||
#include <esp32-hal-gpio.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
#include "utils.h"
|
||||
#include "bobbybuttons.h"
|
||||
#include "bobbyquickactions.h"
|
||||
#include "globals.h"
|
||||
#include "screens.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace {
|
||||
constexpr const char * const TAG = "DEBUG";
|
||||
@@ -117,7 +117,7 @@ void handleNormalChar(char c)
|
||||
{
|
||||
case 'i':
|
||||
case 'I':
|
||||
espgui::tft.init();
|
||||
bobby::tft_init();
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
|
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
|
||||
class BatteryGraphDisplay : public BobbyDisplayWithTitle {
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string text() const override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
static void drawBatteryCurve();
|
||||
|
||||
private:
|
||||
float m_lastBatVoltage{0};
|
||||
};
|
@@ -1,30 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <array>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <FastLED.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
#include "ledstrip.h"
|
||||
|
||||
class LedstripColorsDisplay : public BobbyDisplayWithTitle
|
||||
{
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string text() const override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
void drawColors();
|
||||
void drawSide(Bobbycar_Side side, unsigned int color);
|
||||
void clearSides();
|
||||
|
||||
private:
|
||||
bool already_drew_circle{false};
|
||||
};
|
@@ -1,26 +0,0 @@
|
||||
#include "menudisplaywithtime.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
namespace bobbygui {
|
||||
void MenuDisplayWithTime::start()
|
||||
{
|
||||
Base::start();
|
||||
m_label_currentTime.start();
|
||||
}
|
||||
|
||||
void MenuDisplayWithTime::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
tft.setTextFont(use_big_font() ? 4 : 2);
|
||||
m_label_currentTime.redraw(fmt::format("&7Time: {}", local_clock_string()));
|
||||
}
|
||||
|
||||
} // namespace
|
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "widgets/doubleprogressbar.h"
|
||||
#include "widgets/label.h"
|
||||
|
||||
class BatteryMenu : public BobbyMenuDisplay
|
||||
{
|
||||
using Base = BobbyMenuDisplay;
|
||||
|
||||
public:
|
||||
BatteryMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void initScreen() override;
|
||||
void start() override;
|
||||
void redraw() override;
|
||||
void back() override;
|
||||
|
||||
private:
|
||||
bobbygui::DoubleProgressBar m_doubleProgressBarBatPercentage{75, 68, 90, 24, 0, 100, TFT_RED, TFT_GREEN};
|
||||
espgui::Label m_batPercentNowLabel {170, 68};
|
||||
espgui::Label m_batPercentBootLabel{170, 82};
|
||||
};
|
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class FeatureFlagsMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
using Base = bobbygui::MenuDisplayWithTime;
|
||||
public:
|
||||
FeatureFlagsMenu();
|
||||
void start() override;
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class GitMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
public:
|
||||
GitMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class LedstripMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
public:
|
||||
LedstripMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class SettingsMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
public:
|
||||
SettingsMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class StatisticsMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
public:
|
||||
StatisticsMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
|
||||
class TimeSettingsMenu : public bobbygui::MenuDisplayWithTime
|
||||
{
|
||||
public:
|
||||
TimeSettingsMenu();
|
||||
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
@@ -1,72 +0,0 @@
|
||||
#include "metersdisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/batteryinfodisplay.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "globals.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
void MetersDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
|
||||
m_vuMeter.start();
|
||||
|
||||
m_dischargingBar.start();
|
||||
m_chargingBar.start();
|
||||
|
||||
m_sumCurrentLabel.start();
|
||||
|
||||
for (auto &meter : meters)
|
||||
meter.start();
|
||||
}
|
||||
|
||||
void MetersDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
m_vuMeter.redraw(avgSpeedKmh);
|
||||
|
||||
m_dischargingBar.redraw(sumCurrent<0.f?(-sumCurrent):0.f);
|
||||
m_chargingBar.redraw(sumCurrent>0.f?sumCurrent:0.f);
|
||||
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setTextFont(2);
|
||||
m_sumCurrentLabel.redraw(fmt::format("{:.02f}A", sumCurrent));
|
||||
|
||||
meters[0].redraw(controllers.front.getCalibratedVoltage(), 35, 50);
|
||||
meters[1].redraw(controllers.back.getCalibratedVoltage(), 35, 50);
|
||||
meters[2].redraw(fixCurrent(controllers.front.feedback.left.dcLink), -10, 10);
|
||||
meters[3].redraw(fixCurrent(controllers.front.feedback.right.dcLink), -10, 10);
|
||||
meters[4].redraw(fixCurrent(controllers.back.feedback.left.dcLink), -10, 10);
|
||||
meters[5].redraw(fixCurrent(controllers.back.feedback.right.dcLink), -10, 10);
|
||||
}
|
||||
|
||||
void MetersDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Right:
|
||||
pushScreen<MainMenu>();
|
||||
break;
|
||||
case Button::Up:
|
||||
switchScreen<StatusDisplay>();
|
||||
break;
|
||||
case Button::Down:
|
||||
switchScreen<BatteryInfoDisplay>();
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
@@ -1,324 +0,0 @@
|
||||
#include "potiscalibratedisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
|
||||
// local includes
|
||||
#include "actions/switchscreenaction.h"
|
||||
#include "displays/menus/boardcomputerhardwaresettingsmenu.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "globals.h"
|
||||
#include "newsettings.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace {
|
||||
constexpr char TEXT_CALIBRATE[] = "Potis Calibrate";
|
||||
} // namespace
|
||||
|
||||
/*
|
||||
std::string PotisCalibrateDisplay::text() const
|
||||
{
|
||||
return TEXT_CALIBRATE;
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::start()
|
||||
{
|
||||
Base::start();
|
||||
|
||||
m_oldMode = currentMode;
|
||||
currentMode = &m_mode;
|
||||
m_selectedButton = 0;
|
||||
m_status = Status::Begin;
|
||||
copyFromSettings();
|
||||
m_gas = std::nullopt;
|
||||
m_brems = std::nullopt;
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
espgui::tft.setTextFont(4);
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
espgui::tft.drawString("gas:", 25, 47);
|
||||
espgui::tft.drawString("brems:", 25, 147);
|
||||
|
||||
for (auto &label : m_labels)
|
||||
label.start();
|
||||
|
||||
for (auto &progressBar : m_progressBars)
|
||||
progressBar.start();
|
||||
|
||||
m_renderedButton = -1;
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::update()
|
||||
{
|
||||
Base::update();
|
||||
|
||||
if (raw_gas)
|
||||
m_gas = cpputils::mapValueClamped<float>(*raw_gas, m_gasMin, m_gasMax, 0.f, 1000.f);
|
||||
else
|
||||
m_gas = std::nullopt;
|
||||
|
||||
if (raw_brems)
|
||||
m_brems = cpputils::mapValueClamped<float>(*raw_brems, m_bremsMin, m_bremsMax, 0.f, 1000.f);
|
||||
else
|
||||
m_brems = std::nullopt;
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
m_labels[0].redraw(m_gas ? fmt::format("{:.02f}", *m_gas) : "?");
|
||||
m_labels[1].redraw(raw_gas ? std::to_string(*raw_gas) : "?");
|
||||
if (m_status == Status::GasMin)
|
||||
espgui::tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
m_labels[2].redraw(std::to_string(m_gasMin));
|
||||
if (m_status == Status::GasMin)
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
if (m_status == Status::GasMax)
|
||||
espgui::tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
m_labels[3].redraw(std::to_string(m_gasMax));
|
||||
if (m_status == Status::GasMax)
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
m_progressBars[0].redraw(m_gas ? *m_gas : 0);
|
||||
|
||||
m_labels[4].redraw(m_brems ? fmt::format("{:.02f}", *m_brems) : "?");
|
||||
m_labels[5].redraw(raw_brems ? std::to_string(*raw_brems) : "?");
|
||||
if (m_status == Status::BremsMin)
|
||||
espgui::tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
m_labels[6].redraw(std::to_string(m_bremsMin));
|
||||
if (m_status == Status::BremsMin)
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
if (m_status == Status::BremsMax)
|
||||
espgui::tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
m_labels[7].redraw(std::to_string(m_bremsMax));
|
||||
if (m_status == Status::BremsMax)
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
m_progressBars[1].redraw(m_brems ? *m_brems : 0);
|
||||
|
||||
m_labels[8].redraw([&](){
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin: return "Start calibrating?";
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
case Status::Mitte: return "Release joystick";
|
||||
#endif
|
||||
case Status::GasMin: return "Release gas";
|
||||
case Status::GasMax: return "Press gas";
|
||||
case Status::BremsMin: return "Release brems";
|
||||
case Status::BremsMax: return "Press brems";
|
||||
case Status::Confirm: return "Verify";
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}());
|
||||
|
||||
{
|
||||
const auto failed = !m_gas || !m_brems || (m_status == Status::Confirm && (*m_gas > 100 || *m_brems > 100));
|
||||
const auto color = failed ? TFT_DARKGREY : TFT_WHITE;
|
||||
espgui::tft.setTextColor(color, TFT_BLACK);
|
||||
m_labels[9].redraw([&](){
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin: return "Yes";
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
case Status::Mitte:
|
||||
#endif
|
||||
case Status::GasMin:
|
||||
case Status::GasMax:
|
||||
case Status::BremsMin:
|
||||
case Status::BremsMax: return "Next";
|
||||
case Status::Confirm: return "Save";
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}());
|
||||
|
||||
if (m_selectedButton != m_renderedButton && (m_selectedButton == 0 || m_renderedButton == 0))
|
||||
espgui::tft.drawRect(3, 275, 100, 27, m_selectedButton == 0 ? color : TFT_BLACK);
|
||||
}
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
m_labels[10].redraw([&](){
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin: return "No";
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
case Status::Mitte:
|
||||
#endif
|
||||
case Status::GasMin:
|
||||
case Status::GasMax:
|
||||
case Status::BremsMin:
|
||||
case Status::BremsMax:
|
||||
case Status::Confirm: return "Abort";
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}());
|
||||
|
||||
if (m_selectedButton != m_renderedButton && (m_selectedButton == 1 || m_renderedButton == 1))
|
||||
espgui::tft.drawRect(123, 275, 100, 27, m_selectedButton == 1 ? TFT_WHITE : TFT_BLACK);
|
||||
|
||||
m_renderedButton = m_selectedButton;
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::stop()
|
||||
{
|
||||
Base::stop();
|
||||
|
||||
if (currentMode == &m_mode)
|
||||
{
|
||||
// to avoid crash after deconstruction
|
||||
m_mode.stop();
|
||||
lastMode = nullptr;
|
||||
|
||||
currentMode = m_oldMode;
|
||||
}
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Up:
|
||||
m_selectedButton--;
|
||||
|
||||
if (m_selectedButton < 0)
|
||||
m_selectedButton = 1;
|
||||
|
||||
break;
|
||||
case Button::Down:
|
||||
m_selectedButton++;
|
||||
|
||||
if (m_selectedButton > 1)
|
||||
m_selectedButton = 0;
|
||||
|
||||
break;
|
||||
case Button::Left:
|
||||
back:
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin:
|
||||
if (m_bootup)
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
else if (configs.lockscreen.keepLockedAfterReboot.value() && configs.lockscreen.locked.value())
|
||||
{
|
||||
espgui::switchScreen<MainMenu>();
|
||||
configs.write_config(configs.lockscreen.locked, false);
|
||||
}
|
||||
else
|
||||
espgui::switchScreen<BoardcomputerHardwareSettingsMenu>();
|
||||
break;
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
case Status::Mitte:
|
||||
#endif
|
||||
case Status::GasMin:
|
||||
case Status::GasMax:
|
||||
case Status::BremsMin:
|
||||
case Status::BremsMax:
|
||||
case Status::Confirm:
|
||||
m_selectedButton = 0;
|
||||
m_status = Status::Begin;
|
||||
copyFromSettings();
|
||||
}
|
||||
|
||||
break;
|
||||
case Button::Right:
|
||||
switch (m_selectedButton)
|
||||
{
|
||||
case 0: // left button pressed
|
||||
if (!raw_gas || !raw_brems || !m_gas || !m_brems)
|
||||
return;
|
||||
|
||||
switch (m_status)
|
||||
{
|
||||
#ifndef FEATURE_JOYSTICK
|
||||
case Status::Begin:
|
||||
m_status = Status::GasMin;
|
||||
break;
|
||||
#else
|
||||
case Status::Begin:
|
||||
m_status = Status::Mitte;
|
||||
break;
|
||||
|
||||
case Status::Mitte:
|
||||
m_gasMitte = *raw_gas;
|
||||
m_bremsMitte = *raw_brems;
|
||||
m_status = Status::GasMin;
|
||||
break;
|
||||
#endif
|
||||
case Status::GasMin:
|
||||
m_gasMin = *raw_gas;
|
||||
m_status = Status::GasMax;
|
||||
break;
|
||||
case Status::GasMax:
|
||||
m_gasMax = *raw_gas;
|
||||
m_status = Status::BremsMin;
|
||||
{
|
||||
const auto dead = (m_gasMax - m_gasMin)/20;
|
||||
m_gasMin += dead;
|
||||
m_gasMax -= dead;
|
||||
}
|
||||
break;
|
||||
case Status::BremsMin:
|
||||
m_bremsMin = *raw_brems;
|
||||
m_status = Status::BremsMax;
|
||||
break;
|
||||
case Status::BremsMax:
|
||||
m_bremsMax = *raw_brems;
|
||||
m_status = Status::Confirm;
|
||||
{
|
||||
const auto dead = (m_bremsMax - m_bremsMin)/20;
|
||||
m_bremsMin += dead;
|
||||
m_bremsMax -= dead;
|
||||
}
|
||||
break;
|
||||
case Status::Confirm:
|
||||
if (*m_gas > 100 || *m_brems > 100)
|
||||
return;
|
||||
copyToSettings();
|
||||
saveProfileSettings();
|
||||
if (m_bootup)
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
else
|
||||
espgui::switchScreen<BoardcomputerHardwareSettingsMenu>();
|
||||
}
|
||||
break;
|
||||
case 1: // right button pressed
|
||||
goto back;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::copyFromSettings()
|
||||
{
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
m_gasMitte = configs.gasMitte.value();
|
||||
m_bremsMitte = configs.bremsMitte.value();
|
||||
#endif
|
||||
m_gasMin = configs.gasMin.value();
|
||||
m_gasMax = configs.gasMax.value();
|
||||
m_bremsMin = configs.bremsMin.value();
|
||||
m_bremsMax = configs.bremsMax.value();
|
||||
}
|
||||
|
||||
void PotisCalibrateDisplay::copyToSettings()
|
||||
{
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
configs.write_config(configs.gasMitte, m_gasMitte);
|
||||
configs.write_config(configs.bremsMitte, m_bremsMitte);
|
||||
#endif
|
||||
configs.write_config(configs.gasMin, m_gasMin);
|
||||
configs.write_config(configs.gasMax, m_gasMax);
|
||||
configs.write_config(configs.bremsMin, m_bremsMin);
|
||||
configs.write_config(configs.bremsMax, m_bremsMax);
|
||||
}
|
||||
*/
|
@@ -1,94 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <optional>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <cpputils.h>
|
||||
#include <widgets/label.h>
|
||||
#include <widgets/progressbar.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
#include "modeinterface.h"
|
||||
#include "modes/ignoreinputmode.h"
|
||||
|
||||
/*
|
||||
class PotisCalibrateDisplay : public BobbyDisplayWithTitle
|
||||
{
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
PotisCalibrateDisplay() = default;
|
||||
explicit PotisCalibrateDisplay(bool bootup) : m_bootup{bootup} {}
|
||||
|
||||
std::string text() const override;
|
||||
void start() override;
|
||||
void initScreen() override;
|
||||
void update() override;
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
void copyFromSettings();
|
||||
void copyToSettings();
|
||||
|
||||
const bool m_bootup{false};
|
||||
ModeInterface *m_oldMode;
|
||||
IgnoreInputMode m_mode{0, bobbycar::protocol::ControlType::FieldOrientedControl, bobbycar::protocol::ControlMode::Torque};
|
||||
|
||||
std::array<espgui::Label, 11> m_labels {{
|
||||
espgui::Label{25, 72}, // 100, 23
|
||||
espgui::Label{145, 72}, // 100, 23
|
||||
espgui::Label{25, 97}, // 100, 23
|
||||
espgui::Label{145, 97}, // 100, 23
|
||||
|
||||
espgui::Label{25, 172}, // 100, 23
|
||||
espgui::Label{145, 172}, // 100, 23
|
||||
espgui::Label{25, 197}, // 100, 23
|
||||
espgui::Label{145, 197}, // 100, 23
|
||||
|
||||
espgui::Label{25, 247}, // 190, 23
|
||||
|
||||
espgui::Label{25, 277}, // 100, 23
|
||||
espgui::Label{145, 277}, // 100, 23
|
||||
}};
|
||||
|
||||
std::array<espgui::ProgressBar, 2> m_progressBars {{
|
||||
espgui::ProgressBar{20, 129, 200, 10, 0, 1000},
|
||||
espgui::ProgressBar{20, 229, 200, 10, 0, 1000}
|
||||
}};
|
||||
|
||||
enum Status {
|
||||
Begin,
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
Mitte,
|
||||
#endif
|
||||
GasMin,
|
||||
GasMax,
|
||||
BremsMin,
|
||||
BremsMax,
|
||||
Confirm
|
||||
};
|
||||
|
||||
int8_t m_selectedButton, m_renderedButton;
|
||||
|
||||
Status m_status;
|
||||
int16_t
|
||||
m_gasMin,
|
||||
m_gasMax,
|
||||
m_bremsMin,
|
||||
m_bremsMax
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
,m_gasMitte
|
||||
,m_bremsMitte
|
||||
#endif
|
||||
;
|
||||
std::optional<float> m_gas, m_brems;
|
||||
};
|
||||
*/
|
@@ -1,50 +0,0 @@
|
||||
#include "qrcodedebug.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <tftinstance.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
#include "screenmanager.h"
|
||||
#include "newsettings.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
QrCodeDebugDisplay::QrCodeDebugDisplay()
|
||||
{
|
||||
}
|
||||
|
||||
void QrCodeDebugDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
}
|
||||
|
||||
void QrCodeDebugDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Left: popScreen(); break;
|
||||
case Button::Right:
|
||||
{
|
||||
uint8_t qrcodeBytes[qrcode_getBufferSize(7)];
|
||||
qrcode_initText(&m_qrcode, qrcodeBytes, 7, ECC_MEDIUM, fmt::format("WIFI:T:WPA;S:{};P:{};", configs.wifiApName.value(), configs.wifiApKey.value()).c_str());
|
||||
|
||||
for (uint8_t y = 0; y < m_qrcode.size; y++) {
|
||||
for (uint8_t x = 0; x < m_qrcode.size; x++) {
|
||||
if (qrcode_getModule(&m_qrcode, x, y))
|
||||
{
|
||||
tft.drawPixel(x+2,y+2, TFT_BLACK);
|
||||
} else {
|
||||
tft.drawPixel(x+2,y+2, TFT_WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// 3rd party includes
|
||||
#include <esp_log.h>
|
||||
#include <fmt/core.h>
|
||||
#include <tftinstance.h>
|
||||
#include <tl/expected.hpp>
|
||||
#include <widgets/label.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplay.h"
|
||||
#include "bobbyerrorhandler.h"
|
||||
#include "qrimport.h"
|
||||
#include "screenmanager.h"
|
||||
|
||||
class QrImportDisplay : public BobbyDisplay
|
||||
{
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
explicit QrImportDisplay(const std::string &nvs_key) : m_nvs_key{nvs_key} {}
|
||||
explicit QrImportDisplay(std::string &&nvs_key) : m_nvs_key{std::move(nvs_key)} {}
|
||||
|
||||
void start() override;
|
||||
void update() override;
|
||||
void redraw() override;
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
bool m_waitingForResult{false};
|
||||
espgui::Label m_statuslabel{5,(espgui::tft.height() / 2)-espgui::tft.fontHeight(4)};
|
||||
|
||||
tl::expected<std::string, std::string> m_result;
|
||||
std::string m_nvs_key;
|
||||
};
|
@@ -1,93 +0,0 @@
|
||||
#include "speedinfodisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/batteryinfodisplay.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "drivingstatistics.h"
|
||||
|
||||
void SpeedInfoDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
m_labelSpeed.start();
|
||||
|
||||
m_dischargingBar.start();
|
||||
m_chargingBar.start();
|
||||
|
||||
m_batteryPercentLabel.start();
|
||||
m_voltageLabel.start();
|
||||
m_distanceLabel.start();
|
||||
m_currentPowerLabel.start();
|
||||
}
|
||||
|
||||
void SpeedInfoDisplay::redraw()
|
||||
{
|
||||
using namespace espgui;
|
||||
|
||||
Base::redraw();
|
||||
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setTextFont(4);
|
||||
|
||||
tft.setTextSize(4);
|
||||
|
||||
m_labelSpeed.redraw(
|
||||
std::abs(avgSpeedKmh) < 10 ? fmt::format("{:.2f}", avgSpeedKmh) :
|
||||
(std::abs(avgSpeedKmh) < 100 ? fmt::format("{:.1f}", avgSpeedKmh) : fmt::format("{:.0f}", avgSpeedKmh)));
|
||||
|
||||
tft.setTextSize(1);
|
||||
m_batteryPercentLabel.redraw(getBatteryPercentageString());
|
||||
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
auto watt = sumCurrent * *avgVoltage;
|
||||
|
||||
m_voltageLabel.redraw(fmt::format("{:.1f} V", avgVoltage.value()));
|
||||
tft.setTextSize(2);
|
||||
m_currentPowerLabel.redraw(fmt::format("{:.0f} W", watt));
|
||||
tft.setTextSize(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_voltageLabel.redraw("No voltage");
|
||||
m_currentPowerLabel.redraw("No power");
|
||||
}
|
||||
|
||||
m_distanceLabel.redraw(
|
||||
drivingStatistics.meters_driven > 1000 ? fmt::format("{:.3f} km", drivingStatistics.meters_driven / 1000) :
|
||||
(drivingStatistics.meters_driven > 100 ? fmt::format("{:.1f} m", drivingStatistics.meters_driven) : fmt::format("{:.2f} m", drivingStatistics.meters_driven)));
|
||||
|
||||
tft.setTextSize(1);
|
||||
|
||||
m_dischargingBar.redraw(sumCurrent < 0.f ? (-sumCurrent) : 0.f);
|
||||
m_chargingBar.redraw(sumCurrent > 0.f ? sumCurrent : 0.f);
|
||||
}
|
||||
|
||||
void SpeedInfoDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Right:
|
||||
espgui::pushScreen<MainMenu>();
|
||||
break;
|
||||
case Button::Up:
|
||||
espgui::switchScreen<BatteryInfoDisplay>();
|
||||
break;
|
||||
case Button::Down:
|
||||
#ifdef FEATURE_BMS
|
||||
espgui::switchScreen<BmsDisplay>();
|
||||
#else
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
#endif
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
@@ -1,352 +0,0 @@
|
||||
#include "statusdisplay.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <espwifistack.h>
|
||||
#include <fmt/core.h>
|
||||
#include <tftinstance.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/batteryinfodisplay.h"
|
||||
#include "displays/speedinfodisplay.h"
|
||||
#ifdef FEATURE_BMS
|
||||
#include "displays/bmsdisplay.h"
|
||||
#endif
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/metersdisplay.h"
|
||||
#include "drivingstatistics.h"
|
||||
#include "modes/defaultmode.h"
|
||||
#include "newsettings.h"
|
||||
#include "taskmanager.h"
|
||||
#include "udpcloud.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using namespace espgui;
|
||||
|
||||
namespace {
|
||||
constexpr const char * const TAG = "STATUS";
|
||||
} // namespace
|
||||
|
||||
void StatusDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
tft.setTextFont(2);
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
|
||||
tft.drawString("gas", 0, 0);
|
||||
m_labelRawGas.start();
|
||||
m_labelGas.start();
|
||||
m_progressBarGas.start();
|
||||
tft.drawString("brems", 0, 15);
|
||||
m_labelRawBrems.start();
|
||||
m_labelBrems.start();
|
||||
m_progressBarBrems.start();
|
||||
|
||||
m_batterypercent.start();
|
||||
m_watthoursleft.start();
|
||||
m_kilometersleft.start();
|
||||
|
||||
m_frontStatus.start();
|
||||
m_backStatus.start();
|
||||
|
||||
tft.setTextFont(2);
|
||||
tft.drawString("WiFi:", 0, bottomLines[0]);
|
||||
m_labelWifiStatus.start();
|
||||
tft.drawString("Lim0:", 173, bottomLines[0]);
|
||||
m_labelLimit0.start();
|
||||
tft.drawString("IP:", 0, bottomLines[1]);
|
||||
m_labelIpAddress.start();
|
||||
m_labelSignal.start();
|
||||
tft.drawString("Lim1:", 173, bottomLines[1]);
|
||||
m_labelLimit1.start();
|
||||
tft.drawString("Perf:", 0, bottomLines[2]);
|
||||
m_labelPerformance.start();
|
||||
m_labelFreeMem.start();
|
||||
tft.drawString("Mode:", 125, bottomLines[2]);
|
||||
m_labelMode.start();
|
||||
tft.drawString("Name:", 0, bottomLines[3]);
|
||||
m_labelName.start();
|
||||
m_labelProfile.start();
|
||||
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
|
||||
void StatusDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
{
|
||||
const auto now = espchrono::millis_clock::now();
|
||||
if (now - lastRedraw < 50ms)
|
||||
return;
|
||||
lastRedraw = now;
|
||||
}
|
||||
|
||||
{
|
||||
static bool handbremse_fill_with_black;
|
||||
if (configs.handbremse.enable.value() && configs.handbremse.visualize.value() && handbremse::angezogen)
|
||||
{
|
||||
tft.fillRect(0, tft.height()-6, tft.width(), 6, TFT_RED);
|
||||
handbremse_fill_with_black = true;
|
||||
}
|
||||
else if (configs.handbremse.enable.value() && configs.handbremse.visualize.value() && handbremse::stateWish == handbremse::StateWish::brake)
|
||||
{
|
||||
tft.fillRect(0, tft.height()-6, tft.width(), 6, TFT_YELLOW);
|
||||
handbremse_fill_with_black = true;
|
||||
}
|
||||
else if (handbremse_fill_with_black)
|
||||
{
|
||||
handbremse_fill_with_black = false;
|
||||
tft.fillRect(0, tft.height()-6, tft.width(), 6, TFT_BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
if(configs.feature.ledstrip.isEnabled.value())
|
||||
{
|
||||
static bool blink_fill_with_black;
|
||||
if (configs.ledstrip.enableVisualizeBlink.value() && (espchrono::utc_clock::now().time_since_epoch() % 750ms < 375ms) && (blinkAnimation > 0))
|
||||
{
|
||||
if (BLINK_LEFT_EXPR)
|
||||
tft.fillRect(0, 0, tft.width() / 2, 6, TFT_YELLOW);
|
||||
if (BLINK_RIGHT_EXPR)
|
||||
tft.fillRect(tft.width() / 2, 0, tft.width() / 2, 6, TFT_YELLOW);
|
||||
|
||||
blink_fill_with_black = true;
|
||||
}
|
||||
else if (blink_fill_with_black)
|
||||
{
|
||||
blink_fill_with_black = false;
|
||||
tft.fillRect(0, 0, tft.width(), 6, TFT_BLACK);
|
||||
tft.setTextFont(2);
|
||||
tft.drawString("gas", 0, 0);
|
||||
m_labelRawGas.start();
|
||||
m_labelGas.start();
|
||||
m_progressBarGas.start();
|
||||
}
|
||||
}
|
||||
|
||||
tft.setTextFont(2);
|
||||
m_labelRawGas.redraw(raw_gas ? std::to_string(*raw_gas) : "?");
|
||||
m_labelGas.redraw(gas ? fmt::format("{:.2f}", *gas) : "?");
|
||||
m_progressBarGas.redraw(gas ? *gas : 0);
|
||||
m_labelRawBrems.redraw(raw_brems ? std::to_string(*raw_brems) : "?");
|
||||
m_labelBrems.redraw(brems ? fmt::format("{:.2f}", *brems) : "?");
|
||||
m_progressBarBrems.redraw(brems ? *brems : 0);
|
||||
|
||||
m_batterypercent.redraw(getBatteryPercentageString());
|
||||
m_watthoursleft.redraw(getBatteryRemainingWattHoursString());
|
||||
const uint16_t efficiencyColor = getEfficiencyClassColor();
|
||||
// if (abs(avgSpeedKmh) > 2)
|
||||
{
|
||||
tft.setTextColor(efficiencyColor, TFT_BLACK);
|
||||
}
|
||||
m_kilometersleft.redraw(getRemainingRangeString());
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
m_frontStatus.redraw(controllers.front);
|
||||
m_backStatus.redraw(controllers.back);
|
||||
|
||||
tft.setTextFont(2);
|
||||
|
||||
if (configs.feature.udpcloud.isEnabled.value())
|
||||
{
|
||||
if(configs.udpCloudSettings.udpCloudEnabled.value() && configs.udpCloudSettings.enableCloudDebug.value())
|
||||
{
|
||||
tft.fillRect(125, 258, 8, 8, (visualSendUdpPacket) ? TFT_DARKGREY : TFT_BLACK);
|
||||
}
|
||||
// else // is not needed because of redraw
|
||||
// {
|
||||
// tft.fillRect(125, 258, 8, 8, TFT_BLACK);
|
||||
// }
|
||||
}
|
||||
|
||||
const auto staStatus = wifi_stack::get_sta_status();
|
||||
if (staStatus == wifi_stack::WiFiStaStatus::CONNECTED)
|
||||
{
|
||||
if (const auto result = wifi_stack::get_sta_ap_info(); result)
|
||||
{
|
||||
m_labelWifiStatus.redraw(std::string_view{reinterpret_cast<const char*>(result->ssid)});
|
||||
tft.setTextColor(result->rssi < -80 ? TFT_ORANGE : TFT_WHITE, TFT_BLACK);
|
||||
m_labelSignal.redraw(fmt::format("{}dB", result->rssi));
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGW(TAG, "get_sta_ap_info() failed with %.*s", result.error().size(), result.error().data());
|
||||
goto showStaStatus;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
showStaStatus:
|
||||
m_labelWifiStatus.redraw(wifi_stack::toString(staStatus));
|
||||
m_labelSignal.clear();
|
||||
}
|
||||
|
||||
m_labelLimit0.redraw(fmt::format("{}A", controllers.front.command.left.iMotMax));
|
||||
|
||||
if (staStatus == wifi_stack::WiFiStaStatus::CONNECTED)
|
||||
{
|
||||
if (const auto result = wifi_stack::get_ip_info(wifi_stack::esp_netifs[ESP_IF_WIFI_STA]); result)
|
||||
m_labelIpAddress.redraw(wifi_stack::toString(result->ip));
|
||||
else
|
||||
{
|
||||
ESP_LOGW(TAG, "get_ip_info() failed with %.*s", result.error().size(), result.error().data());
|
||||
goto clearIp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clearIp:
|
||||
m_labelIpAddress.clear();
|
||||
}
|
||||
|
||||
m_labelLimit1.redraw(fmt::format("{}A", controllers.front.command.left.iDcMax));
|
||||
|
||||
tft.setTextColor(drivingModeTask.callCount() < 35 ? TFT_ORANGE : TFT_WHITE, TFT_BLACK);
|
||||
m_labelPerformance.redraw(std::to_string(drivingModeTask.callCount()));
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
{
|
||||
const auto freeMem = heap_caps_get_free_size(MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
|
||||
tft.setTextColor(freeMem < 70000 ? TFT_ORANGE : TFT_WHITE, TFT_BLACK);
|
||||
m_labelFreeMem.redraw(fmt::format("{}K", freeMem/1000));
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
|
||||
m_labelMode.redraw(currentMode->displayName());
|
||||
m_labelName.redraw(configs.wifiApName.value());
|
||||
const auto profile = settingsPersister.currentlyOpenProfileIndex();
|
||||
m_labelProfile.redraw(profile ? std::to_string(*profile) : "-");
|
||||
}
|
||||
|
||||
void StatusDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Right:
|
||||
pushScreen<MainMenu>();
|
||||
break;
|
||||
case Button::Up:
|
||||
if (simplified)
|
||||
return;
|
||||
#ifdef FEATURE_BMS
|
||||
switchScreen<BmsDisplay>();
|
||||
#else
|
||||
switchScreen<SpeedInfoDisplay>();
|
||||
#endif
|
||||
break;
|
||||
case Button::Down:
|
||||
if (simplified)
|
||||
return;
|
||||
switchScreen<MetersDisplay>();
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
StatusDisplay::BoardStatus::BoardStatus(int y) :
|
||||
m_y{y},
|
||||
m_labelLeftPwm{65, y}, // 80, 22
|
||||
m_labelRightPwm{155, y}, // 80, 22
|
||||
m_labelVoltage{30, y+25}, // 85, 22
|
||||
m_labelTemperature{150, y+25}, // 85, 22
|
||||
m_leftMotor{y+50},
|
||||
m_rightMotor{y+75}
|
||||
{}
|
||||
|
||||
void StatusDisplay::BoardStatus::start()
|
||||
{
|
||||
tft.setTextFont(4);
|
||||
tft.drawString("pwm:", 0, m_y);
|
||||
m_labelLeftPwm.start();
|
||||
m_labelRightPwm.start();
|
||||
m_initialRedraw = true;
|
||||
}
|
||||
|
||||
void StatusDisplay::BoardStatus::redraw(const Controller &controller)
|
||||
{
|
||||
tft.setTextFont(4);
|
||||
|
||||
m_labelLeftPwm.redraw(std::to_string(controller.command.left.pwm));
|
||||
m_labelRightPwm.redraw(std::to_string(controller.command.right.pwm));
|
||||
|
||||
if (controller.feedbackValid != m_lastFeedbackValid || m_initialRedraw)
|
||||
{
|
||||
tft.fillRect(0, m_y+25, tft.width(), 75, TFT_BLACK);
|
||||
|
||||
if (controller.feedbackValid)
|
||||
{
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
|
||||
tft.drawString("U=", 0, m_y+25, 4);
|
||||
m_labelVoltage.start();
|
||||
tft.drawString("T=", 120, m_y+25, 4);
|
||||
m_labelTemperature.start();
|
||||
tft.drawString("l:", 0, m_y+50, 4);
|
||||
m_leftMotor.start();
|
||||
tft.drawString("r:", 0, m_y+75, 4);
|
||||
m_rightMotor.start();
|
||||
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
else
|
||||
{
|
||||
tft.setTextColor(TFT_RED);
|
||||
tft.drawString("No data!", 60, m_y+50, 4);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
tft.setSwapBytes(true);
|
||||
tft.pushImage(10, m_y+40, bobbyicons::alert.WIDTH, bobbyicons::alert.HEIGHT, bobbyicons::alert.buffer);
|
||||
tft.setSwapBytes(false);
|
||||
}
|
||||
|
||||
m_lastFeedbackValid = controller.feedbackValid;
|
||||
m_initialRedraw = false;
|
||||
}
|
||||
|
||||
if (controller.feedbackValid)
|
||||
{
|
||||
m_labelVoltage.redraw(fmt::format("{:.2f}V", controller.getCalibratedVoltage()));
|
||||
m_labelTemperature.redraw(fmt::format("{:.2f}C", fixBoardTemp(controller.feedback.boardTemp)));
|
||||
m_leftMotor.redraw(controller.feedback.left);
|
||||
m_rightMotor.redraw(controller.feedback.right);
|
||||
}
|
||||
}
|
||||
|
||||
StatusDisplay::BoardStatus::MotorStatus::MotorStatus(int y) :
|
||||
m_labelError{18, y}, // 18, 22,
|
||||
m_labelCurrent{40, y}, // 85, 22
|
||||
m_labelSpeed{135, y}, // 75, 22
|
||||
m_labelHallSensors{210, y} // 30, 15
|
||||
{}
|
||||
|
||||
void StatusDisplay::BoardStatus::MotorStatus::start()
|
||||
{
|
||||
m_labelError.start();
|
||||
m_labelCurrent.start();
|
||||
m_labelSpeed.start();
|
||||
m_labelHallSensors.start();
|
||||
}
|
||||
|
||||
void StatusDisplay::BoardStatus::MotorStatus::redraw(const bobbycar::protocol::serial::MotorFeedback &motor)
|
||||
{
|
||||
tft.setTextFont(4);
|
||||
tft.setTextColor(motor.error?TFT_RED:TFT_GREEN, TFT_BLACK);
|
||||
m_labelError.redraw(std::to_string(motor.error));
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
m_labelCurrent.redraw(fmt::format("{:.2f}A", fixCurrent(motor.dcLink)));
|
||||
m_labelSpeed.redraw(fmt::format("{:.2f}", convertToKmh(motor.speed)));
|
||||
|
||||
tft.setTextFont(2);
|
||||
m_labelHallSensors.redraw(hallString(motor));
|
||||
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
@@ -1,116 +0,0 @@
|
||||
#include "updatedisplay.h"
|
||||
|
||||
// system includes
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <espasyncota.h>
|
||||
#include <esp_ota_ops.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
#include "ota.h"
|
||||
#include "newsettings.h"
|
||||
|
||||
void UpdateDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
espgui::tft.setTextFont(4);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
espgui::tft.drawString("Update", 5, 5, 4);
|
||||
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
espgui::tft.drawString("Status:", 20, m_statusLabel.y());
|
||||
m_statusLabel.start();
|
||||
|
||||
espgui::tft.drawString("Progress:", 20, m_progressLabel.y());
|
||||
m_progressLabel.start();
|
||||
|
||||
espgui::tft.drawString("Total:", 20, m_totalLabel.y());
|
||||
m_totalLabel.start();
|
||||
|
||||
m_messageLabel.start();
|
||||
|
||||
m_progressBar.start();
|
||||
|
||||
if (const esp_app_desc_t *app_desc = esp_ota_get_app_description())
|
||||
{
|
||||
espgui::tft.setTextColor(TFT_ORANGE, TFT_BLACK);
|
||||
espgui::tft.drawString(app_desc->version, 20, 250);
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
|
||||
m_newVersionLabel.start();
|
||||
}
|
||||
|
||||
void UpdateDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
if (asyncOta)
|
||||
{
|
||||
m_statusLabel.redraw(toString(asyncOta->status()));
|
||||
const auto progress = asyncOta->progress();
|
||||
m_progressLabel.redraw(std::to_string(progress));
|
||||
if (const auto totalSize = asyncOta->totalSize(); totalSize && *totalSize > 0)
|
||||
{
|
||||
m_totalLabel.redraw(std::to_string(*totalSize));
|
||||
m_progressBar.redraw(float(progress) / *totalSize * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_totalLabel.clear();
|
||||
m_progressBar.redraw(0);
|
||||
}
|
||||
m_messageLabel.redraw(asyncOta->message());
|
||||
|
||||
if (const auto &appDesc = asyncOta->appDesc())
|
||||
{
|
||||
espgui::tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
m_newVersionLabel.redraw(appDesc->version);
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
else
|
||||
m_newVersionLabel.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_statusLabel.clear();
|
||||
m_progressLabel.clear();
|
||||
m_totalLabel.clear();
|
||||
m_messageLabel.clear();
|
||||
|
||||
m_progressBar.redraw(0);
|
||||
|
||||
m_newVersionLabel.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Left:
|
||||
espgui::popScreen();
|
||||
break;
|
||||
case Button::Right:
|
||||
if (const auto result = triggerOta(configs.otaUrl.value()); !result)
|
||||
ESP_LOGE("BOBBY", "triggerOta() failed with %.*s", result.error().size(), result.error().data());
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
@@ -2,8 +2,8 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <FastLED.h>
|
||||
#include <TFT_eSPI.h>
|
||||
#include <date/date.h>
|
||||
#include <tftinterface.h>
|
||||
|
||||
// Local
|
||||
#include "globals.h"
|
||||
|
@@ -21,12 +21,10 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <espchrono.h>
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
// local includes
|
||||
#include "controller.h"
|
||||
#include "display.h"
|
||||
#include "macros_bobbycar.h"
|
||||
#include "modeinterface.h"
|
||||
#include "newsettings.h"
|
||||
#include "profilesettings.h"
|
||||
|
@@ -7,18 +7,22 @@
|
||||
#include "bobbybuttons.h"
|
||||
#include "bobbyerrorhandler.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
template<typename Tvalue>
|
||||
class BobbyChangeValueDisplay :
|
||||
public espgui::ChangeValueDisplay<Tvalue>,
|
||||
public virtual BobbyErrorHandler
|
||||
public espgui::ChangeValueDisplay<Tvalue>,
|
||||
public virtual BobbyErrorHandler
|
||||
{
|
||||
using Base = espgui::ChangeValueDisplay<Tvalue>;
|
||||
|
||||
public:
|
||||
void rawButtonPressed(uint8_t button) override;
|
||||
|
||||
void rawButtonReleased(uint8_t button) override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
||||
|
||||
@@ -51,3 +55,5 @@ void BobbyChangeValueDisplay<Tvalue>::buttonReleased(espgui::Button button)
|
||||
Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
||||
} // namespace bobby
|
@@ -1,15 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actions/toggleboolaction.h>
|
||||
#include <checkboxicon.h>
|
||||
#include "../../components/esp-gui-lib/src/actions/toggleboolaction.h"
|
||||
#include "../../components/esp-gui-lib/src/checkboxicon.h"
|
||||
|
||||
// local includes
|
||||
#include "bobbyerrorhandler.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class BobbyCheckbox :
|
||||
public virtual espgui::ToggleBoolAction,
|
||||
public virtual espgui::CheckboxIcon,
|
||||
public virtual BobbyErrorHandler
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace bobby
|
@@ -3,6 +3,8 @@
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void BobbyDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
@@ -28,3 +30,5 @@ void BobbyDisplay::buttonReleased(espgui::Button button)
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
||||
} // namespace bobby
|
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <display.h>
|
||||
#include "display.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class BobbyDisplay : public espgui::Display
|
||||
{
|
||||
@@ -14,3 +16,5 @@ public:
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
@@ -3,6 +3,8 @@
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void BobbyDisplayWithTitle::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
@@ -28,3 +30,5 @@ void BobbyDisplayWithTitle::buttonReleased(espgui::Button button)
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
||||
} // namespace bobby
|
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <displaywithtitle.h>
|
||||
#include "displaywithtitle.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class BobbyDisplayWithTitle : public espgui::DisplayWithTitle
|
||||
{
|
||||
@@ -14,3 +16,5 @@ public:
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
20
main/guihelpers/bobbyerrorhandler.cpp
Normal file
20
main/guihelpers/bobbyerrorhandler.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "bobbyerrorhandler.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
#include <tftinterface.h>
|
||||
|
||||
// local includes
|
||||
#include "guihelpers/bobbypopupdisplay.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void BobbyErrorHandler::errorOccurred(std::string &&error)
|
||||
{
|
||||
espgui::changeScreenCallback = [error_ = std::move(error)](espgui::TftInterface &tft){
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::string{error_}, std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay(tft);
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
};
|
||||
}
|
||||
} // namespace bobby
|
@@ -3,7 +3,11 @@
|
||||
// 3rdparty lib includes
|
||||
#include <errorhandlerinterface.h>
|
||||
|
||||
namespace bobby {
|
||||
|
||||
struct BobbyErrorHandler : public virtual espgui::ErrorHandlerInterface
|
||||
{
|
||||
void errorOccurred(std::string &&error) override;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
@@ -6,6 +6,8 @@
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
template<size_t COUNT>
|
||||
class BobbyGraphDisplay : public espgui::GraphDisplay<COUNT>
|
||||
{
|
||||
@@ -48,3 +50,5 @@ void BobbyGraphDisplay<COUNT>::buttonReleased(espgui::Button button)
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
||||
} // namespace bobby
|
@@ -4,6 +4,8 @@
|
||||
#include "esp_log.h"
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void BobbyMenuDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
@@ -29,3 +31,4 @@ void BobbyMenuDisplay::buttonReleased(espgui::Button button)
|
||||
Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
} // namespace bobby
|
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
#include "menudisplay.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class BobbyMenuDisplay : public espgui::MenuDisplay
|
||||
{
|
||||
@@ -14,3 +16,5 @@ public:
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
@@ -3,6 +3,8 @@
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
void BobbyPopupDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
@@ -28,3 +30,5 @@ void BobbyPopupDisplay::buttonReleased(espgui::Button button)
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
||||
} // namespace bobby
|
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <messagepopupdisplay.h>
|
||||
#include "messagepopupdisplay.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
class BobbyPopupDisplay : public espgui::MessagePopupDisplay
|
||||
{
|
||||
@@ -16,3 +18,5 @@ public:
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
||||
|
||||
} // namespace bobby
|
@@ -6,6 +6,8 @@
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
class BobbySplitGraphDisplay : public espgui::SplitGraphDisplay<COUNT0, COUNT1>
|
||||
{
|
||||
@@ -48,4 +50,5 @@ void BobbySplitGraphDisplay<COUNT0, COUNT1>::buttonReleased(espgui::Button butto
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
} // namespace bobby
|
||||
|
26
main/guihelpers/menudisplaywithtime.cpp
Normal file
26
main/guihelpers/menudisplaywithtime.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "menudisplaywithtime.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinterface.h>
|
||||
#include <tftcolors.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
void MenuDisplayWithTime::initScreen(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
m_label_currentTime.start(tft);
|
||||
}
|
||||
|
||||
void MenuDisplayWithTime::redraw(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::redraw(tft);
|
||||
m_label_currentTime.redraw(tft, fmt::format("&7Time: {}", local_clock_string()), espgui::TFT_WHITE, espgui::TFT_BLACK, use_big_font() ? 4 : 2);
|
||||
}
|
||||
} // namespace bobby
|
@@ -1,17 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "bobbymenudisplay.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
namespace bobbygui {
|
||||
class MenuDisplayWithTime :
|
||||
public BobbyMenuDisplay
|
||||
{
|
||||
using Base = BobbyMenuDisplay;
|
||||
|
||||
public:
|
||||
void start() override;
|
||||
void redraw() override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
espgui::Label m_label_currentTime{145, 6};
|
||||
|
||||
private:
|
||||
@@ -24,4 +25,5 @@ private:
|
||||
#endif
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
} // namespace bobby
|
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// macros are a shit piece of software
|
||||
#define STRING2(s) #s
|
||||
#define STRING(s) STRING2(s)
|
@@ -1,10 +1,6 @@
|
||||
constexpr const char * const TAG = "BOBBY";
|
||||
|
||||
// system includes
|
||||
#include <cstdio>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp32/pm.h>
|
||||
#include <esp_pm.h>
|
||||
#include <esp_chip_info.h>
|
||||
#include <esp_log.h>
|
||||
@@ -13,15 +9,11 @@ constexpr const char * const TAG = "BOBBY";
|
||||
#include <espchrono.h>
|
||||
using namespace std::chrono_literals;
|
||||
#include <espwifistack.h>
|
||||
#include <schedulertask.h>
|
||||
#include <screenmanager.h>
|
||||
#include <tickchrono.h>
|
||||
#include <espstrutils.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbycar-common.h"
|
||||
#include "bobbycar-serial.h"
|
||||
#include "macros_bobbycar.h"
|
||||
#include "globals.h"
|
||||
#include "screens.h"
|
||||
#include "presets.h"
|
||||
@@ -31,18 +23,17 @@ using namespace std::chrono_literals;
|
||||
#else
|
||||
#include "modes/defaultmode.h"
|
||||
#endif
|
||||
#include "displays/lockscreen.h"
|
||||
#include "displays/menus/recoverymenu.h"
|
||||
#include "displays/potiscalibratedisplay.h"
|
||||
#include "displays/setup/information.h"
|
||||
#include "displays/setup/basic_buttons.h"
|
||||
#include "displays/setup/calibrate_potis.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "screens/lockscreen.h"
|
||||
#include "screens/recoverymenu.h"
|
||||
#include "screens/setup/information.h"
|
||||
#include "screens/setup/basic_buttons.h"
|
||||
#include "screens/setup/calibrate_potis.h"
|
||||
#include "screens/statusdisplay.h"
|
||||
#include "newsettings.h"
|
||||
#include "taskmanager.h"
|
||||
|
||||
#define BOOT_PROGRESS(s) \
|
||||
bootLabel.redraw(s); \
|
||||
bobby::set_boot_msg(s); \
|
||||
ESP_LOGI("BOOT", "%s", s);
|
||||
|
||||
namespace {
|
||||
@@ -65,10 +56,10 @@ extern "C" void app_main()
|
||||
|
||||
if (recovery)
|
||||
{
|
||||
initScreen();
|
||||
bobby::initScreen();
|
||||
|
||||
ESP_LOGE(TAG, "Recovery mode (%s)", espcpputils::toString(esp_reset_reason()).c_str());
|
||||
bootLabel.redraw("Entering recovery mode");
|
||||
BOOT_PROGRESS("Entering recovery mode");
|
||||
|
||||
if (const auto result = configs.init("bobbycar"); result != ESP_OK)
|
||||
ESP_LOGE(TAG, "config_init_settings() failed with %s", esp_err_to_name(result));
|
||||
@@ -78,7 +69,7 @@ extern "C" void app_main()
|
||||
task.setup(recovery);
|
||||
}
|
||||
|
||||
espgui::switchScreen<RecoveryMenu>();
|
||||
espgui::switchScreen<bobby::RecoveryMenu>();
|
||||
|
||||
recovery = false;
|
||||
|
||||
@@ -105,7 +96,7 @@ extern "C" void app_main()
|
||||
if (const auto result = configs.init("bobbycar"); result != ESP_OK)
|
||||
ESP_LOGE(TAG, "config_init_settings() failed with %s", esp_err_to_name(result));
|
||||
|
||||
initScreen();
|
||||
bobby::initScreen();
|
||||
|
||||
profileSettings = presets::defaultProfileSettings;
|
||||
|
||||
@@ -142,14 +133,14 @@ extern "C" void app_main()
|
||||
{
|
||||
case SetupStep::INFORMATION:
|
||||
BOOT_PROGRESS("Calibtration");
|
||||
espgui::switchScreen<SetupInformationDisplay>();
|
||||
espgui::switchScreen<bobby::SetupInformationDisplay>();
|
||||
break;
|
||||
case SetupStep::BASIC_BUTTONS:
|
||||
BOOT_PROGRESS("Calibtration");
|
||||
espgui::switchScreen<SetupBasicButtonsDisplay>(true);
|
||||
espgui::switchScreen<bobby::SetupBasicButtonsDisplay>(true);
|
||||
break;
|
||||
case SetupStep::CALIBRATE_POTIS:
|
||||
espgui::switchScreen<SetupCalibratePotisDisplay>(true);
|
||||
espgui::switchScreen<bobby::SetupCalibratePotisDisplay>(true);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
@@ -157,13 +148,13 @@ extern "C" void app_main()
|
||||
else if (configs.lockscreen.keepLockedAfterReboot.value() && configs.lockscreen.locked.value())
|
||||
{
|
||||
BOOT_PROGRESS("Locked");
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
espgui::pushScreen<Lockscreen>();
|
||||
espgui::switchScreen<bobby::StatusDisplay>();
|
||||
espgui::pushScreen<bobby::Lockscreen>();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOT_PROGRESS("StatusDisplay")
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
espgui::switchScreen<bobby::StatusDisplay>();
|
||||
}
|
||||
|
||||
esp_chip_info(&chip_info);
|
||||
|
@@ -23,14 +23,11 @@
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
#include "bobbyquickactions.h"
|
||||
#include "displays/lockscreen.h"
|
||||
#include "cloud.h"
|
||||
#include "handbremse.h"
|
||||
#include "ledstrip.h"
|
||||
#include "screens/lockscreen.h"
|
||||
#include "unifiedmodelmode.h"
|
||||
#include "displays/lockscreen.h"
|
||||
#include "handbremse.h"
|
||||
#include "bobbyquickactions.h"
|
||||
#include "cloud.h"
|
||||
|
||||
using namespace espconfig;
|
||||
|
||||
|
@@ -1,40 +1,46 @@
|
||||
#include "screens.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <tftcolors.h>
|
||||
#include <tftespiimpl.h>
|
||||
|
||||
// local includes
|
||||
#include "esptexthelpers.h"
|
||||
#include "globals.h"
|
||||
#include "icons/logo.h"
|
||||
#include "texthelpers/esptexthelpers.h"
|
||||
|
||||
namespace bobby {
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
Label bootLabel{32, 250};
|
||||
espgui::Label bootLabel{32, 250};
|
||||
|
||||
namespace {
|
||||
bool disable_screen_flip{false};
|
||||
|
||||
espgui::TftESpiImpl tft;
|
||||
}
|
||||
|
||||
void tft_init()
|
||||
{
|
||||
tft.init();
|
||||
}
|
||||
|
||||
void initScreen()
|
||||
{
|
||||
// vertical screen
|
||||
tft.init();
|
||||
tft.fillScreen(TFT_WHITE);
|
||||
tft.setTextColor(TFT_BLACK, TFT_WHITE);
|
||||
tft.setTextFont(4);
|
||||
tft.fillScreen(espgui::TFT_WHITE);
|
||||
tft.setRotation(configs.boardcomputerHardware.flipScreen.value() ? 2 : 0);
|
||||
espgui::tft.setSwapBytes(true);
|
||||
tft.setSwapBytes(true);
|
||||
tft.pushImage(0, 40, bobbyicons::logo.WIDTH, bobbyicons::logo.HEIGHT, bobbyicons::logo.buffer);
|
||||
espgui::tft.setSwapBytes(false);
|
||||
tft.drawString("Bobbycar-OS", 32, 200);
|
||||
tft.drawString("booting...", 32, 225);
|
||||
tft.setTextFont(2);
|
||||
tft.drawString("last reboot reason:", 32, 275);
|
||||
tft.drawString(espcpputils::toString(esp_reset_reason()), 32, 295);
|
||||
tft.setTextFont(4);
|
||||
bootLabel.start();
|
||||
tft.setSwapBytes(false);
|
||||
tft.drawString("Bobbycar-OS", 32, 200, espgui::TFT_BLACK, espgui::TFT_WHITE, 4);
|
||||
tft.drawString("booting...", 32, 225, espgui::TFT_BLACK, espgui::TFT_WHITE, 4);
|
||||
tft.drawString("last reboot reason:", 32, 275, espgui::TFT_BLACK, espgui::TFT_WHITE, 2);
|
||||
tft.drawString(espcpputils::toString(esp_reset_reason()), 32, 295, espgui::TFT_BLACK, espgui::TFT_WHITE, 2);
|
||||
bootLabel.start(tft);
|
||||
}
|
||||
|
||||
void updateRotation()
|
||||
@@ -43,7 +49,7 @@ void updateRotation()
|
||||
{
|
||||
tft.setRotation(configs.boardcomputerHardware.flipScreen.value() ? 2 : 0);
|
||||
if (currentDisplay)
|
||||
currentDisplay->initScreen();
|
||||
currentDisplay->initScreen(tft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +60,7 @@ void updateDisplay()
|
||||
|
||||
if (changeScreenCallback)
|
||||
{
|
||||
changeScreenCallback();
|
||||
changeScreenCallback(tft);
|
||||
changeScreenCallback = {};
|
||||
}
|
||||
|
||||
@@ -78,7 +84,7 @@ void updateDisplay()
|
||||
|
||||
if (initScreenRequest && currentDisplay)
|
||||
{
|
||||
currentDisplay->initScreen();
|
||||
currentDisplay->initScreen(tft);
|
||||
initScreenRequest = false;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +93,7 @@ void redrawDisplay()
|
||||
{
|
||||
if (currentDisplay)
|
||||
{
|
||||
currentDisplay->redraw();
|
||||
currentDisplay->redraw(tft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,3 +101,19 @@ void disableScreenFlip(bool enable)
|
||||
{
|
||||
disable_screen_flip = enable;
|
||||
}
|
||||
|
||||
void set_boot_msg(std::string_view msg)
|
||||
{
|
||||
bootLabel.redraw(tft, msg, espgui::TFT_BLACK, espgui::TFT_WHITE, 4);
|
||||
}
|
||||
|
||||
uint16_t getScreenWidth()
|
||||
{
|
||||
return tft.width();
|
||||
}
|
||||
|
||||
uint16_t getScreenHeight()
|
||||
{
|
||||
return tft.height();
|
||||
}
|
||||
} // namespace bobby
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user