Compare commits
65 Commits
Author | SHA1 | Date | |
---|---|---|---|
b123bc553d | |||
80a775322a | |||
983f26e70a | |||
8a28084a0a | |||
63e466c926 | |||
6e9fc74361 | |||
49b575251c | |||
d5ebbcdd24 | |||
351c40fce7 | |||
3f0baddcb1 | |||
16b81ee300 | |||
65a77fee44 | |||
f48bf8b6b6 | |||
1ce42674d3 | |||
32d57e4f6a | |||
5cdf650627 | |||
138412e2ae | |||
7b1c64c08e | |||
27863b2bf0 | |||
9d09c9ceaf | |||
39f80e2bda | |||
2021e308e4 | |||
a8b64aa608 | |||
9e3532e457 | |||
b3d03989d7 | |||
9145853649 | |||
d12c943f89 | |||
f7bae3fe91 | |||
3403c65987 | |||
39a6a7df71 | |||
9ac12cec05 | |||
1a3fb0a0a9 | |||
31fdbae77b | |||
bee30e4bfb | |||
530970ca44 | |||
2e63d06661 | |||
811b28ce8a | |||
6415448f9b | |||
3b701ff258 | |||
013a0617cf | |||
9d1cf7d8d2 | |||
b147e802f8 | |||
1b59251a99 | |||
99f1517db5 | |||
83007d55c1 | |||
6693adc1ef | |||
3c61012161 | |||
ba12e18874 | |||
287bd2bec0 | |||
6f37344d5a | |||
e22b4ace9c | |||
8d7e94958a | |||
4779d02a9e | |||
e85375bb80 | |||
e4d1bec58a | |||
5ca3c6df3b | |||
b341daefa5 | |||
86daa1a8cb | |||
b551d5a88d | |||
8c839469f3 | |||
d11955448d | |||
31a0caabba | |||
5b75a01777 | |||
1d2edee3db | |||
89e4c64e2c |
106
.github/workflows/main.yml
vendored
106
.github/workflows/main.yml
vendored
@ -1,106 +0,0 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
# pull_request:
|
||||
# types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "config_name"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SONAR_SCANNER_VERSION: 4.4.0.2170
|
||||
SONAR_SERVER_URL: "https://sonarcloud.io"
|
||||
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
||||
SONAR_CACHE_DIR: sonar_cache
|
||||
environment: deploy
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node: [feedc0de, comred, peter, mick]
|
||||
steps:
|
||||
|
||||
- name: Checkout (without submodules)
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
|
||||
- name: Set up JDK 11 (for Sonar)
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
|
||||
- name: Download and set up sonar-scanner
|
||||
env:
|
||||
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
|
||||
run: |
|
||||
mkdir -p $HOME/.sonar
|
||||
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
|
||||
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
||||
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Download and set up build-wrapper (for Sonar)
|
||||
env:
|
||||
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
|
||||
run: |
|
||||
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
|
||||
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
|
||||
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
|
||||
|
||||
- name: Checkout and install esp-idf
|
||||
uses: 0xFEEDC0DE64/checkout_install_esp_idf@main
|
||||
|
||||
- name: Fast Submodule Checkout components/arduino-esp32
|
||||
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
|
||||
with:
|
||||
submodule: components/arduino-esp32
|
||||
|
||||
- name: Checkout remaining submodules
|
||||
run: git submodule update --init --recursive $(git submodule | awk '{ if ($2 != "esp-idf" && $2 != "components/arduino-esp32") print $2 }')
|
||||
|
||||
- name: Setup ccache
|
||||
uses: 0xFEEDC0DE64/setup_ccache@main
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.node }}
|
||||
|
||||
|
||||
- name: Build firmware
|
||||
run: |
|
||||
export CCACHE_MAXSIZE=400M CCACHE_BASEDIR="$(pwd)"
|
||||
. export.sh
|
||||
./switchconf.sh ${{ matrix.node }}
|
||||
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} idf.py --ccache build
|
||||
ccache -s
|
||||
|
||||
- name: Cache sonar
|
||||
uses: 0xFEEDC0DE64/cache-with-update@update-cache-on-cachehit
|
||||
with:
|
||||
path: ${{ env.SONAR_SERVER_URL }}
|
||||
key: ${{ runner.os }}-sonar-${{ matrix.node }}
|
||||
|
||||
- name: Run sonar-scanner
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: |
|
||||
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.cache.path="${{ env.SONAR_CACHE_DIR }}"
|
||||
|
||||
- name: Set outputs
|
||||
id: vars
|
||||
run: |
|
||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
with:
|
||||
name: bobbyquad_${{ matrix.node }}
|
||||
path: |
|
||||
build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.bin
|
||||
build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.elf
|
||||
build_${{ matrix.node }}/bootloader/bootloader.bin
|
||||
build_${{ matrix.node }}/bootloader/bootloader.elf
|
||||
build_${{ matrix.node }}/partition_table/partition-table.bin
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ desktop.ini
|
||||
/.ccache
|
||||
/main/certs/*
|
||||
/.vscode/*
|
||||
/ignore.tar.gz
|
||||
|
@ -4,7 +4,8 @@
|
||||
|
||||
| Service | Status |
|
||||
| :--- | ---: |
|
||||
| Actions |  |
|
||||
| Actions (Build) |  |
|
||||
| Actions (Analysis) |  |
|
||||
| Sonar | [](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware) |
|
||||
## How to clone ? (READ THIS OR YOU WILL FAIL)
|
||||
|
||||
|
Submodule components/FastLED-idf updated: 151565bee4...5a3c3866d1
Submodule components/TFT_eSPI updated: aa7279cb29...7f378c458f
Submodule components/arduino-esp32 updated: aa9f5dc65a...6c49028af8
Submodule components/cpputils updated: 3ae9aab977...92c54c9dbb
Submodule components/esp-gui-lib updated: 9ce52a1901...3d01a04aa4
Submodule components/espchrono updated: 4d02e16f4c...eff113c393
Submodule components/espwifistack updated: 65908208d4...ea56b58a23
123
config_allfeatures.cmake
Normal file
123
config_allfeatures.cmake
Normal file
@ -0,0 +1,123 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_allfeatures)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
-DFEATURE_ADC_IN
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=7
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
-DDEVICE_PREFIX=bobbyquad
|
||||
-DAP_PASSWORD=Passwort_123
|
||||
-DFEATURE_WEBSERVER
|
||||
-DFEATURE_OTA
|
||||
-DOTA_USERNAME="allfeatures"
|
||||
# -DFEATURE_DPAD_5WIRESW
|
||||
# -DPINS_DPAD_5WIRESW_OUT=4
|
||||
# -DPINS_DPAD_5WIRESW_IN1=5
|
||||
# -DPINS_DPAD_5WIRESW_IN2=27
|
||||
# -DPINS_DPAD_5WIRESW_IN3=18
|
||||
# -DPINS_DPAD_5WIRESW_IN4=19
|
||||
# -DPINS_DPAD_EXTRASW_IN5=25
|
||||
-DFEATURE_DPAD_6WIRESW
|
||||
-DPINS_DPAD_6WIRESW_OUT=4
|
||||
-DPINS_DPAD_6WIRESW_IN1=5
|
||||
-DPINS_DPAD_6WIRESW_IN2=27
|
||||
-DPINS_DPAD_6WIRESW_IN3=18
|
||||
-DPINS_DPAD_6WIRESW_IN4=19
|
||||
-DPINS_DPAD_6WIRESW_IN5=26
|
||||
|
||||
# -DDPAD_5WIRESW_UP=1
|
||||
# -DDPAD_5WIRESW_DOWN=5
|
||||
# -DDPAD_5WIRESW_CONFIRM=2
|
||||
# -DDPAD_5WIRESW_BACK=6
|
||||
# -DDPAD_5WIRESW_PROFILE0=4
|
||||
# -DDPAD_5WIRESW_PROFILE1=0
|
||||
# -DDPAD_5WIRESW_PROFILE2=7
|
||||
# -DDPAD_5WIRESW_PROFILE3=3
|
||||
# -DDPAD_5WIRESW_DEBUG
|
||||
|
||||
-DDPAD_6WIRESW_UP=1
|
||||
-DDPAD_6WIRESW_DOWN=5
|
||||
-DDPAD_6WIRESW_CONFIRM=2
|
||||
-DDPAD_6WIRESW_BACK=6
|
||||
-DDPAD_6WIRESW_PROFILE0=4
|
||||
-DDPAD_6WIRESW_PROFILE1=0
|
||||
-DDPAD_6WIRESW_PROFILE2=7
|
||||
-DDPAD_6WIRESW_PROFILE3=3
|
||||
-DDPAD_6WIRESW_BLINK_LEFT=8
|
||||
-DDPAD_6WIRESW_BLINK_RIGHT=9
|
||||
# -DDPAD_6WIRESW_DEBUG
|
||||
-DFEATURE_GSCHISSENE_DIODE
|
||||
|
||||
-DDEFAULT_GASMIN=842
|
||||
-DDEFAULT_GASMAX=2480
|
||||
-DDEFAULT_BREMSMIN=826
|
||||
-DDEFAULT_BREMSMAX=2502
|
||||
-DFEATURE_BLE
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
# -DDEFAULT_GAMETRAKXMIN=0
|
||||
# -DDEFAULT_GAMETRAKXMAX=4095
|
||||
# -DDEFAULT_GAMETRAKYMIN=0
|
||||
# -DDEFAULT_GAMETRAKYMAX=4095
|
||||
# -DDEFAULT_GAMETRAKDISTMIN=0
|
||||
# -DDEFAULT_GAMETRAKDISTMAX=4095
|
||||
-DFEATURE_POWERSUPPLY
|
||||
-DFEATURE_CLOUD
|
||||
-DFEATURE_UDPCLOUD
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
-DFEATURE_GARAGE
|
||||
-DFEATURE_NTP
|
||||
-DFEATURE_WIRELESS_CONFIG
|
||||
-DFEATURE_LEDSTRIP
|
||||
-DPINS_LEDSTRIP=33
|
||||
-DLEDSTRIP_LENGTH=288
|
||||
-DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
-DLEDSTRIP_WRONG_DIRECTION
|
||||
-DLEDSTRIP_ANIMATION_DEFAULT=1
|
||||
-DLEDS_PER_METER=144
|
||||
-DOLD_NVS
|
||||
-DFEATURE_DNS_NS
|
||||
-DSWITCH_BLINK
|
||||
-DFEATURE_ESPNOW
|
||||
)
|
@ -119,7 +119,7 @@ set(BOBBYCAR_BUILDFLAGS
|
||||
-DOLD_NVS
|
||||
-DFEATURE_DNS_NS
|
||||
-DSWITCH_BLINK
|
||||
# -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_FUNKTIONIERT
|
||||
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
|
||||
-DFEATURE_ESPNOW
|
||||
)
|
||||
|
||||
|
@ -100,6 +100,5 @@ set(BOBBYCAR_BUILDFLAGS
|
||||
-DOLD_NVS
|
||||
# -DFEATURE_DNS_NS
|
||||
# -DSWITCH_BLINK
|
||||
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_FUNKTIONIERT
|
||||
# -DFEATURE_ESPNOW
|
||||
)
|
||||
|
124
config_nofeatures.cmake
Normal file
124
config_nofeatures.cmake
Normal file
@ -0,0 +1,124 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_nofeatures)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
-DFEATURE_ADC_IN
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=7
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
-DDEVICE_PREFIX=bobbyquad
|
||||
-DAP_PASSWORD=Passwort_123
|
||||
# -DFEATURE_WEBSERVER
|
||||
# -DFEATURE_OTA
|
||||
-DOTA_USERNAME="nofeatures"
|
||||
# -DFEATURE_DPAD_5WIRESW
|
||||
# -DPINS_DPAD_5WIRESW_OUT=4
|
||||
# -DPINS_DPAD_5WIRESW_IN1=5
|
||||
# -DPINS_DPAD_5WIRESW_IN2=27
|
||||
# -DPINS_DPAD_5WIRESW_IN3=18
|
||||
# -DPINS_DPAD_5WIRESW_IN4=19
|
||||
# -DPINS_DPAD_EXTRASW_IN5=25
|
||||
-DFEATURE_DPAD_6WIRESW
|
||||
-DPINS_DPAD_6WIRESW_OUT=4
|
||||
-DPINS_DPAD_6WIRESW_IN1=5
|
||||
-DPINS_DPAD_6WIRESW_IN2=27
|
||||
-DPINS_DPAD_6WIRESW_IN3=18
|
||||
-DPINS_DPAD_6WIRESW_IN4=19
|
||||
-DPINS_DPAD_6WIRESW_IN5=26
|
||||
|
||||
# -DDPAD_5WIRESW_UP=1
|
||||
# -DDPAD_5WIRESW_DOWN=5
|
||||
# -DDPAD_5WIRESW_CONFIRM=2
|
||||
# -DDPAD_5WIRESW_BACK=6
|
||||
# -DDPAD_5WIRESW_PROFILE0=4
|
||||
# -DDPAD_5WIRESW_PROFILE1=0
|
||||
# -DDPAD_5WIRESW_PROFILE2=7
|
||||
# -DDPAD_5WIRESW_PROFILE3=3
|
||||
# -DDPAD_5WIRESW_DEBUG
|
||||
|
||||
-DDPAD_6WIRESW_UP=1
|
||||
-DDPAD_6WIRESW_DOWN=5
|
||||
-DDPAD_6WIRESW_CONFIRM=2
|
||||
-DDPAD_6WIRESW_BACK=6
|
||||
-DDPAD_6WIRESW_PROFILE0=4
|
||||
-DDPAD_6WIRESW_PROFILE1=0
|
||||
-DDPAD_6WIRESW_PROFILE2=7
|
||||
-DDPAD_6WIRESW_PROFILE3=3
|
||||
-DDPAD_6WIRESW_BLINK_LEFT=8
|
||||
-DDPAD_6WIRESW_BLINK_RIGHT=9
|
||||
# -DDPAD_6WIRESW_DEBUG
|
||||
# -DFEATURE_GSCHISSENE_DIODE
|
||||
|
||||
-DDEFAULT_GASMIN=842
|
||||
-DDEFAULT_GASMAX=2480
|
||||
-DDEFAULT_BREMSMIN=826
|
||||
-DDEFAULT_BREMSMAX=2502
|
||||
# -DFEATURE_BLE
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
# -DDEFAULT_GAMETRAKXMIN=0
|
||||
# -DDEFAULT_GAMETRAKXMAX=4095
|
||||
# -DDEFAULT_GAMETRAKYMIN=0
|
||||
# -DDEFAULT_GAMETRAKYMAX=4095
|
||||
# -DDEFAULT_GAMETRAKDISTMIN=0
|
||||
# -DDEFAULT_GAMETRAKDISTMAX=4095
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
# -DFEATURE_CLOUD
|
||||
# -DFEATURE_UDPCLOUD
|
||||
# -DFEATURE_LEDBACKLIGHT
|
||||
# -DPINS_LEDBACKLIGHT=23
|
||||
# -DLEDBACKLIGHT_INVERTED
|
||||
# -DFEATURE_GARAGE
|
||||
# -DFEATURE_NTP
|
||||
# -DFEATURE_WIRELESS_CONFIG
|
||||
# -DFEATURE_LEDSTRIP
|
||||
# -DPINS_LEDSTRIP=33
|
||||
# -DLEDSTRIP_LENGTH=288
|
||||
# -DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
# -DLEDSTRIP_ANIMATION_DEFAULT=1
|
||||
# -DLEDS_PER_METER=144
|
||||
-DOLD_NVS
|
||||
# -DFEATURE_DNS_NS
|
||||
# -DSWITCH_BLINK
|
||||
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
|
||||
# -DFEATURE_ESPNOW
|
||||
)
|
@ -1,103 +1,105 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_peter)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
-DFEATURE_ADC_IN
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=7
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
-DDEVICE_PREFIX=peter_bobbyquad
|
||||
-DAP_PASSWORD=Passwort_123
|
||||
-DFEATURE_WEBSERVER
|
||||
-DFEATURE_OTA
|
||||
-DOTA_USERNAME="peter"
|
||||
-DFEATURE_DPAD_5WIRESW_2OUT
|
||||
-DPINS_DPAD_5WIRESW_OUT1=18
|
||||
-DPINS_DPAD_5WIRESW_OUT2=19
|
||||
-DPINS_DPAD_5WIRESW_IN1=4
|
||||
-DPINS_DPAD_5WIRESW_IN2=5
|
||||
-DPINS_DPAD_5WIRESW_IN3=27
|
||||
-DDPAD_5WIRESW_UP=4
|
||||
-DDPAD_5WIRESW_DOWN=7
|
||||
-DDPAD_5WIRESW_CONFIRM=1
|
||||
-DDPAD_5WIRESW_BACK=10
|
||||
-DDPAD_5WIRESW_PROFILE0=11
|
||||
-DDPAD_5WIRESW_PROFILE1=8
|
||||
-DDPAD_5WIRESW_PROFILE2=5
|
||||
-DDPAD_5WIRESW_PROFILE3=2
|
||||
-DDPAD_5WIRESW_BLINK_LEFT=9
|
||||
-DDPAD_5WIRESW_BLINK_RIGHT=0
|
||||
-DDPAD_5WIRESW_QUICKACTION_DOWN=3
|
||||
-DDPAD_5WIRESW_QUICKACTION_UP=6
|
||||
# -DDPAD_5WIRESW_DEBUG
|
||||
-DDEFAULT_GASMIN=842
|
||||
-DDEFAULT_GASMAX=2480
|
||||
-DDEFAULT_BREMSMIN=826
|
||||
-DDEFAULT_BREMSMAX=2502
|
||||
-DFEATURE_BLE
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
# -DDEFAULT_GAMETRAKXMIN=0
|
||||
# -DDEFAULT_GAMETRAKXMAX=4095
|
||||
# -DDEFAULT_GAMETRAKYMIN=0
|
||||
# -DDEFAULT_GAMETRAKYMAX=4095
|
||||
# -DDEFAULT_GAMETRAKDISTMIN=0
|
||||
# -DDEFAULT_GAMETRAKDISTMAX=4095
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
# -DFEATURE_CLOUD
|
||||
-DFEATURE_UDPCLOUD
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
-DFEATURE_GARAGE
|
||||
-DFEATURE_NTP
|
||||
-DFEATURE_WIRELESS_CONFIG
|
||||
-DFEATURE_LEDSTRIP
|
||||
-DPINS_LEDSTRIP=33
|
||||
-DLEDSTRIP_LENGTH=288
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DLEDSTRIP_ANIMATION_DEFAULT=2
|
||||
-DLEDS_PER_METER=144
|
||||
-DOLD_NVS
|
||||
-DFEATURE_DNS_NS
|
||||
-DFEATURE_ADC_IN
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=7
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
-DDEVICE_PREFIX=peter_bobbyquad
|
||||
-DAP_PASSWORD=Passwort_123
|
||||
-DFEATURE_WEBSERVER
|
||||
-DFEATURE_OTA
|
||||
-DOTA_USERNAME="peter"
|
||||
-DFEATURE_DPAD_5WIRESW_2OUT
|
||||
-DPINS_DPAD_5WIRESW_OUT1=18
|
||||
-DPINS_DPAD_5WIRESW_OUT2=19
|
||||
-DPINS_DPAD_5WIRESW_IN1=4
|
||||
-DPINS_DPAD_5WIRESW_IN2=5
|
||||
-DPINS_DPAD_5WIRESW_IN3=27
|
||||
-DDPAD_5WIRESW_UP=4
|
||||
-DDPAD_5WIRESW_DOWN=7
|
||||
-DDPAD_5WIRESW_CONFIRM=1
|
||||
-DDPAD_5WIRESW_BACK=10
|
||||
-DDPAD_5WIRESW_PROFILE0=11
|
||||
-DDPAD_5WIRESW_PROFILE1=8
|
||||
-DDPAD_5WIRESW_PROFILE2=5
|
||||
-DDPAD_5WIRESW_PROFILE3=2
|
||||
-DDPAD_5WIRESW_BLINK_LEFT=9
|
||||
-DDPAD_5WIRESW_BLINK_RIGHT=0
|
||||
-DDPAD_5WIRESW_QUICKACTION_DOWN=3
|
||||
-DDPAD_5WIRESW_QUICKACTION_UP=6
|
||||
# -DDPAD_5WIRESW_DEBUG
|
||||
-DDEFAULT_GASMIN=842
|
||||
-DDEFAULT_GASMAX=2480
|
||||
-DDEFAULT_BREMSMIN=826
|
||||
-DDEFAULT_BREMSMAX=2502
|
||||
-DFEATURE_BLE
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
# -DDEFAULT_GAMETRAKXMIN=0
|
||||
# -DDEFAULT_GAMETRAKXMAX=4095
|
||||
# -DDEFAULT_GAMETRAKYMIN=0
|
||||
# -DDEFAULT_GAMETRAKYMAX=4095
|
||||
# -DDEFAULT_GAMETRAKDISTMIN=0
|
||||
# -DDEFAULT_GAMETRAKDISTMAX=4095
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
# -DFEATURE_CLOUD
|
||||
-DFEATURE_UDPCLOUD
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
-DFEATURE_GARAGE
|
||||
#-DFEATURE_NTP
|
||||
-DFEATURE_WIRELESS_CONFIG
|
||||
-DFEATURE_LEDSTRIP
|
||||
-DPINS_LEDSTRIP=33
|
||||
-DLEDSTRIP_LENGTH=288
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DLEDSTRIP_ANIMATION_DEFAULT=2
|
||||
-DLEDS_PER_METER=144
|
||||
-DOLD_NVS
|
||||
-DFEATURE_DNS_NS
|
||||
-DFEATURE_ESPNOW
|
||||
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
|
||||
)
|
||||
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
|
||||
|
85
config_relay.cmake
Normal file
85
config_relay.cmake
Normal file
@ -0,0 +1,85 @@
|
||||
set(BOBBY_APP_NAME bobby_relay)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=5
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
-DFEATURE_ADC_IN
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
#-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=7
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
-DDEVICE_PREFIX=bobby_relay
|
||||
-DAP_PASSWORD=Passwort_123
|
||||
-DFEATURE_WEBSERVER
|
||||
#-DFEATURE_OTA
|
||||
-DOTA_USERNAME="relay"
|
||||
# -DDPAD_5WIRESW_DEBUG
|
||||
-DDEFAULT_GASMIN=842
|
||||
-DDEFAULT_GASMAX=2480
|
||||
-DDEFAULT_BREMSMIN=826
|
||||
-DDEFAULT_BREMSMAX=2502
|
||||
#-DFEATURE_BLE
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
# -DDEFAULT_GAMETRAKXMIN=0
|
||||
# -DDEFAULT_GAMETRAKXMAX=4095
|
||||
# -DDEFAULT_GAMETRAKYMIN=0
|
||||
# -DDEFAULT_GAMETRAKYMAX=4095
|
||||
# -DDEFAULT_GAMETRAKDISTMIN=0
|
||||
# -DDEFAULT_GAMETRAKDISTMAX=4095
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
# -DFEATURE_CLOUD
|
||||
-DFEATURE_UDPCLOUD
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
-DFEATURE_GARAGE
|
||||
-DFEATURE_NTP
|
||||
-DFEATURE_WIRELESS_CONFIG
|
||||
-DFEATURE_LEDSTRIP
|
||||
-DPINS_LEDSTRIP=33
|
||||
-DLEDSTRIP_LENGTH=288
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DLEDSTRIP_ANIMATION_DEFAULT=2
|
||||
-DLEDS_PER_METER=144
|
||||
-DOLD_NVS
|
||||
-DFEATURE_DNS_NS
|
||||
-DFEATURE_ESPNOW
|
||||
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
|
||||
)
|
@ -1,5 +1,4 @@
|
||||
BOBBY_ROOT="$(dirname "$BASH_SOURCE")"
|
||||
export PS1="\033[1;32m(bobby-sourced)\033[;0m$PS1"
|
||||
|
||||
if [[ ! -f "${BOBBY_ROOT}/esp-idf/export.sh" ]]
|
||||
then
|
||||
@ -54,3 +53,4 @@ export PATH=$PATH:$(pwd)/tools
|
||||
alias open-ide=open_ide
|
||||
alias switchconf=./switchconf.sh
|
||||
alias bobby-build="idf.py build"
|
||||
export PS1="\033[1;32m(bobby-sourced)\033[;0m$PS1"
|
||||
|
BIN
icons/statistics.png
Normal file
BIN
icons/statistics.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
ignore.tar.gz.gpg
Normal file
BIN
ignore.tar.gz.gpg
Normal file
Binary file not shown.
@ -36,6 +36,7 @@ set(headers
|
||||
bmsutils.h
|
||||
buildserver.h
|
||||
buttons.h
|
||||
bobbybuttons.h
|
||||
can.h
|
||||
changevaluedisplay_bluetoothmode.h
|
||||
changevaluedisplay_controlmode.h
|
||||
@ -52,6 +53,12 @@ set(headers
|
||||
debuginputhandler.h
|
||||
debugtexthelpers.h
|
||||
displays/bmsdisplay.h
|
||||
displays/bobbychangevaluedisplay.h
|
||||
displays/bobbydisplay.h
|
||||
displays/bobbydisplaywithtitle.h
|
||||
displays/bobbygraphdisplay.h
|
||||
displays/bobbymenudisplay.h
|
||||
displays/bobbysplitgraphdisplay.h
|
||||
displays/calibratedisplay.h
|
||||
displays/calibratevoltagedisplay.h
|
||||
displays/qrdisplay.h
|
||||
@ -60,9 +67,9 @@ set(headers
|
||||
displays/dpad6wiredebugdisplay.h
|
||||
displays/gameoflifedisplay.h
|
||||
displays/gametrakcalibratedisplay.h
|
||||
displays/garagedisplay.h
|
||||
displays/ledstripcolorsdisplay.h
|
||||
displays/lockscreen.h
|
||||
displays/menudisplaywithtime.cpp
|
||||
displays/menus/aboutmenu.h
|
||||
displays/menus/accesspointwifisettingsmenu.h
|
||||
displays/menus/batterydebugmenu.h
|
||||
@ -84,6 +91,7 @@ set(headers
|
||||
displays/menus/espnowmenu.h
|
||||
displays/menus/espnowsettingsmenu.h
|
||||
displays/menus/feedbackdebugmenu.h
|
||||
displays/menus/garagenmenu.h
|
||||
displays/menus/gametrakmodesettingsmenu.h
|
||||
displays/menus/genericwifisettingsmenu.h
|
||||
displays/menus/graphsmenu.h
|
||||
@ -210,8 +218,9 @@ set(headers
|
||||
webserver_ota.h
|
||||
webserver_settings.h
|
||||
webserver_stringsettings.h
|
||||
webserver_newsettings.h
|
||||
widgets/doubleprogressbar.h
|
||||
widgets/menudisplaywithtime.h
|
||||
displays/menudisplaywithtime.h
|
||||
wifi_bobbycar.h
|
||||
wifitexthelpers.h
|
||||
)
|
||||
@ -254,6 +263,7 @@ set(sources
|
||||
bmsutils.cpp
|
||||
buildserver.cpp
|
||||
buttons.cpp
|
||||
bobbybuttons.cpp
|
||||
can.cpp
|
||||
changevaluedisplay_bluetoothmode.cpp
|
||||
changevaluedisplay_controlmode.cpp
|
||||
@ -270,6 +280,12 @@ set(sources
|
||||
debuginputhandler.cpp
|
||||
debugtexthelpers.cpp
|
||||
displays/bmsdisplay.cpp
|
||||
displays/bobbychangevaluedisplay.cpp
|
||||
displays/bobbydisplay.cpp
|
||||
displays/bobbydisplaywithtitle.cpp
|
||||
displays/bobbygraphdisplay.cpp
|
||||
displays/bobbymenudisplay.cpp
|
||||
displays/bobbysplitgraphdisplay.cpp
|
||||
displays/calibratedisplay.cpp
|
||||
displays/calibratevoltagedisplay.cpp
|
||||
displays/qrdisplay.cpp
|
||||
@ -278,7 +294,6 @@ set(sources
|
||||
displays/dpad6wiredebugdisplay.cpp
|
||||
displays/gameoflifedisplay.cpp
|
||||
displays/gametrakcalibratedisplay.cpp
|
||||
displays/garagedisplay.cpp
|
||||
displays/ledstripcolorsdisplay.cpp
|
||||
displays/lockscreen.cpp
|
||||
displays/menus/aboutmenu.cpp
|
||||
@ -302,6 +317,7 @@ set(sources
|
||||
displays/menus/espnowmenu.cpp
|
||||
displays/menus/espnowsettingsmenu.cpp
|
||||
displays/menus/feedbackdebugmenu.cpp
|
||||
displays/menus/garagenmenu.cpp
|
||||
displays/menus/gametrakmodesettingsmenu.cpp
|
||||
displays/menus/genericwifisettingsmenu.cpp
|
||||
displays/menus/graphsmenu.cpp
|
||||
@ -429,8 +445,8 @@ set(sources
|
||||
webserver_ota.cpp
|
||||
webserver_settings.cpp
|
||||
webserver_stringsettings.cpp
|
||||
webserver_newsettings.cpp
|
||||
widgets/doubleprogressbar.cpp
|
||||
widgets/menudisplaywithtime.cpp
|
||||
wifi_bobbycar.cpp
|
||||
wifitexthelpers.cpp
|
||||
)
|
||||
|
65
main/bobbybuttons.cpp
Normal file
65
main/bobbybuttons.cpp
Normal file
@ -0,0 +1,65 @@
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
void BobbyButtons::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyButtons::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyButtons::buttonPressed(espgui::Button button)
|
||||
{
|
||||
//Base::buttonPressed(button);
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyButtons::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
28
main/bobbybuttons.h
Normal file
28
main/bobbybuttons.h
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "buttonsinterface.h"
|
||||
|
||||
enum BobbyButton
|
||||
{
|
||||
Profile0 = espgui::Button::ButtonMax + 1,
|
||||
Profile1,
|
||||
Profile2,
|
||||
Profile3,
|
||||
Left2,
|
||||
Right2,
|
||||
Up2,
|
||||
Down2,
|
||||
Confirm = espgui::Button::Right,
|
||||
Back = espgui::Button::Left
|
||||
};
|
||||
|
||||
class BobbyButtons : public virtual espgui::ButtonsInterface
|
||||
{
|
||||
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;
|
||||
};
|
@ -1,10 +1,15 @@
|
||||
#include "debuginputhandler.h"
|
||||
|
||||
// Arduino includes
|
||||
#include <HardwareSerial.h>
|
||||
// system includes
|
||||
#include <string_view>
|
||||
|
||||
// esp-idf includes
|
||||
#include <driver/uart.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <esp32-hal-gpio.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
@ -12,117 +17,121 @@
|
||||
#include "screens.h"
|
||||
#include "buttons.h"
|
||||
|
||||
using namespace espgui;
|
||||
namespace {
|
||||
constexpr const char * const TAG = "DEBUG";
|
||||
|
||||
//wl_status_t last_status;
|
||||
//IPAddress last_ip;
|
||||
uint8_t consoleControlCharsReceived{};
|
||||
bool uart0Initialized{};
|
||||
} // namespace
|
||||
|
||||
void initDebugInput()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
//Serial.setDebugOutput(true);
|
||||
pinMode(3, INPUT_PULLUP);
|
||||
if (const auto result = uart_set_pin(UART_NUM_0, UART_PIN_NO_CHANGE, 3, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); result != ESP_OK)
|
||||
{
|
||||
ESP_LOGE(TAG, "uart_set_pin() failed with %s", esp_err_to_name(result));
|
||||
}
|
||||
|
||||
if (const auto result = uart_driver_install(UART_NUM_0, SOC_UART_FIFO_LEN + 1, 0, 10, nullptr, 0); result != ESP_OK)
|
||||
ESP_LOGE(TAG, "uart_driver_install() failed with %s", esp_err_to_name(result));
|
||||
else
|
||||
uart0Initialized = true;
|
||||
}
|
||||
|
||||
void handleDebugInput()
|
||||
{
|
||||
//const auto status = WiFi.status();
|
||||
//if (last_status != status)
|
||||
//{
|
||||
//Serial.print("Status changed to: ");
|
||||
//Serial.println(to_string(status).c_str());
|
||||
//last_status = status;
|
||||
//}
|
||||
if (!uart0Initialized)
|
||||
return;
|
||||
|
||||
//const auto ip = WiFi.localIP();
|
||||
//if (last_ip != ip)
|
||||
//{
|
||||
//Serial.print("IP changed to: ");
|
||||
//Serial.println(to_string(ip).c_str());
|
||||
//last_ip = ip;
|
||||
//}
|
||||
|
||||
while(Serial.available())
|
||||
size_t length{};
|
||||
if (const auto result = uart_get_buffered_data_len(UART_NUM_0, &length); result != ESP_OK)
|
||||
{
|
||||
const auto c = Serial.read();
|
||||
ESP_LOGW(TAG, "uart_get_buffered_data_len() failed with %s", esp_err_to_name(result));
|
||||
}
|
||||
else if (length)
|
||||
{
|
||||
char data[length];
|
||||
length = uart_read_bytes(UART_NUM_0, data, length, 0);
|
||||
|
||||
switch (c)
|
||||
for (char c : std::string_view{data, length})
|
||||
{
|
||||
case 'i':
|
||||
case 'I':
|
||||
tft.init();
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
{
|
||||
const auto firstPower = controllers.front.command.poweroff;
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.poweroff = !firstPower;
|
||||
break;
|
||||
}
|
||||
case 'l':
|
||||
case 'L':
|
||||
{
|
||||
const auto firstLed = controllers.front.command.led;
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.led = !firstLed;
|
||||
break;
|
||||
}
|
||||
case 'r':
|
||||
case 'R':
|
||||
loadSettings();
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
saveSettings();
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.buzzer.freq = c-'0';
|
||||
break;
|
||||
case 'A':
|
||||
InputDispatcher::rotate(-1);
|
||||
break;
|
||||
case 'B':
|
||||
InputDispatcher::rotate(1);
|
||||
break;
|
||||
case 'C':
|
||||
InputDispatcher::confirmButton(true);
|
||||
InputDispatcher::confirmButton(false);
|
||||
break;
|
||||
case 'D':
|
||||
InputDispatcher::backButton(true);
|
||||
InputDispatcher::backButton(false);
|
||||
break;
|
||||
case 'z':
|
||||
case 'Z':
|
||||
switch (c)
|
||||
{
|
||||
case 'i':
|
||||
case 'I':
|
||||
espgui::tft.init();
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
{
|
||||
const auto firstPower = controllers.front.command.poweroff;
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.poweroff = !firstPower;
|
||||
break;
|
||||
}
|
||||
case 'l':
|
||||
case 'L':
|
||||
{
|
||||
const auto firstLed = controllers.front.command.led;
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.led = !firstLed;
|
||||
break;
|
||||
}
|
||||
case 'r':
|
||||
case 'R':
|
||||
loadSettings();
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
saveSettings();
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
for (Controller &controller : controllers)
|
||||
controller.command.buzzer.freq = c-'0';
|
||||
break;
|
||||
case 'A':
|
||||
InputDispatcher::rotate(-1);
|
||||
break;
|
||||
case 'B':
|
||||
InputDispatcher::rotate(1);
|
||||
break;
|
||||
case 'C':
|
||||
InputDispatcher::confirmButton(true);
|
||||
InputDispatcher::confirmButton(false);
|
||||
break;
|
||||
case 'D':
|
||||
InputDispatcher::backButton(true);
|
||||
InputDispatcher::backButton(false);
|
||||
break;
|
||||
case 'z':
|
||||
case 'Z':
|
||||
#ifndef LEDSTRIP_WRONG_DIRECTION
|
||||
InputDispatcher::blinkLeftButton(true);
|
||||
InputDispatcher::blinkLeftButton(false);
|
||||
InputDispatcher::blinkLeftButton(true);
|
||||
InputDispatcher::blinkLeftButton(false);
|
||||
#else
|
||||
InputDispatcher::blinkRightButton(true);
|
||||
InputDispatcher::blinkRightButton(false);
|
||||
InputDispatcher::blinkRightButton(true);
|
||||
InputDispatcher::blinkRightButton(false);
|
||||
#endif
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
#ifndef LEDSTRIP_WRONG_DIRECTION
|
||||
InputDispatcher::blinkRightButton(true);
|
||||
InputDispatcher::blinkRightButton(false);
|
||||
InputDispatcher::blinkRightButton(true);
|
||||
InputDispatcher::blinkRightButton(false);
|
||||
#else
|
||||
InputDispatcher::blinkLeftButton(true);
|
||||
InputDispatcher::blinkLeftButton(false);
|
||||
InputDispatcher::blinkLeftButton(true);
|
||||
InputDispatcher::blinkLeftButton(false);
|
||||
#endif
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ using namespace espgui;
|
||||
|
||||
void BmsDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
@ -43,6 +45,8 @@ void BmsDisplay::initScreen()
|
||||
|
||||
void BmsDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
if (bluetoothSerial.hasClient())
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
else
|
||||
@ -90,16 +94,15 @@ void BmsDisplay::redraw()
|
||||
m_cycleLabel.clear();
|
||||
}
|
||||
|
||||
void BmsDisplay::rotate(int offset)
|
||||
void BmsDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
if (offset < 0)
|
||||
switchScreen<MetersDisplay>();
|
||||
else if (offset > 0)
|
||||
switchScreen<StatusDisplay>();
|
||||
}
|
||||
Base::buttonPressed(button);
|
||||
|
||||
void BmsDisplay::confirm()
|
||||
{
|
||||
switchScreen<MainMenu>();
|
||||
switch (button)
|
||||
{
|
||||
case Button::Right: switchScreen<MainMenu>(); break;
|
||||
case Button::Up: switchScreen<MetersDisplay>(); break;
|
||||
case Button::Down: switchScreen<StatusDisplay>();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -3,24 +3,26 @@
|
||||
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <actions/switchscreenaction.h>
|
||||
#include <widgets/label.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "display.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
#include "globals.h"
|
||||
#include "bmsutils.h"
|
||||
#include "widgets/label.h"
|
||||
#include "screenmanager.h"
|
||||
#include "bobbydisplay.h"
|
||||
|
||||
class BmsDisplay :
|
||||
public espgui::Display,
|
||||
public espgui::DummyBack
|
||||
public BobbyDisplay,
|
||||
public espgui::DummyBack
|
||||
{
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void confirm() override;
|
||||
void rotate(int offset) override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
espgui::Label m_statusLabel{200, 0};
|
||||
|
||||
|
1
main/displays/bobbychangevaluedisplay.cpp
Normal file
1
main/displays/bobbychangevaluedisplay.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "bobbychangevaluedisplay.h"
|
89
main/displays/bobbychangevaluedisplay.h
Normal file
89
main/displays/bobbychangevaluedisplay.h
Normal file
@ -0,0 +1,89 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <changevaluedisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
template<typename Tvalue>
|
||||
class BobbyChangeValueDisplay : public espgui::ChangeValueDisplay<Tvalue>
|
||||
{
|
||||
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;
|
||||
};
|
||||
|
||||
template<typename Tvalue>
|
||||
void BobbyChangeValueDisplay<Tvalue>::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Tvalue>
|
||||
void BobbyChangeValueDisplay<Tvalue>::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Tvalue>
|
||||
void BobbyChangeValueDisplay<Tvalue>::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Tvalue>
|
||||
void BobbyChangeValueDisplay<Tvalue>::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
66
main/displays/bobbydisplay.cpp
Normal file
66
main/displays/bobbydisplay.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
#include "bobbydisplay.h"
|
||||
|
||||
void BobbyDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplay::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
//Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplay::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
19
main/displays/bobbydisplay.h
Normal file
19
main/displays/bobbydisplay.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <display.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
class BobbyDisplay : public espgui::Display
|
||||
{
|
||||
using Base = espgui::Display;
|
||||
|
||||
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;
|
||||
};
|
66
main/displays/bobbydisplaywithtitle.cpp
Normal file
66
main/displays/bobbydisplaywithtitle.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
|
||||
void BobbyDisplayWithTitle::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplayWithTitle::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplayWithTitle::buttonPressed(espgui::Button button)
|
||||
{
|
||||
//Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyDisplayWithTitle::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
19
main/displays/bobbydisplaywithtitle.h
Normal file
19
main/displays/bobbydisplaywithtitle.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <displaywithtitle.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
class BobbyDisplayWithTitle : public espgui::DisplayWithTitle
|
||||
{
|
||||
using Base = espgui::DisplayWithTitle;
|
||||
|
||||
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;
|
||||
};
|
1
main/displays/bobbygraphdisplay.cpp
Normal file
1
main/displays/bobbygraphdisplay.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "bobbygraphdisplay.h"
|
89
main/displays/bobbygraphdisplay.h
Normal file
89
main/displays/bobbygraphdisplay.h
Normal file
@ -0,0 +1,89 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <graphdisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
template<size_t COUNT>
|
||||
class BobbyGraphDisplay : public espgui::GraphDisplay<COUNT>
|
||||
{
|
||||
using Base = espgui::GraphDisplay<COUNT>;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
66
main/displays/bobbymenudisplay.cpp
Normal file
66
main/displays/bobbymenudisplay.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
#include "bobbymenudisplay.h"
|
||||
|
||||
void BobbyMenuDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyMenuDisplay::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyMenuDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void BobbyMenuDisplay::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
19
main/displays/bobbymenudisplay.h
Normal file
19
main/displays/bobbymenudisplay.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
class BobbyMenuDisplay : public espgui::MenuDisplay
|
||||
{
|
||||
using Base = espgui::MenuDisplay;
|
||||
|
||||
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;
|
||||
};
|
1
main/displays/bobbysplitgraphdisplay.cpp
Normal file
1
main/displays/bobbysplitgraphdisplay.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "bobbysplitgraphdisplay.h"
|
90
main/displays/bobbysplitgraphdisplay.h
Normal file
90
main/displays/bobbysplitgraphdisplay.h
Normal file
@ -0,0 +1,90 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <splitgraphdisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
class BobbySplitGraphDisplay : public espgui::SplitGraphDisplay<COUNT0, COUNT1>
|
||||
{
|
||||
using Base = espgui::SplitGraphDisplay<COUNT0, COUNT1>;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
void BobbySplitGraphDisplay<COUNT0, COUNT1>::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonPressed(Button::Left); break;
|
||||
case 1: buttonPressed(Button::Right); break;
|
||||
case 2: buttonPressed(Button::Up); break;
|
||||
case 3: buttonPressed(Button::Down); break;
|
||||
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
void BobbySplitGraphDisplay<COUNT0, COUNT1>::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case 0: buttonReleased(Button::Left); break;
|
||||
case 1: buttonReleased(Button::Right); break;
|
||||
case 2: buttonReleased(Button::Up); break;
|
||||
case 3: buttonReleased(Button::Down); break;
|
||||
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
|
||||
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
|
||||
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
|
||||
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
|
||||
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
|
||||
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
|
||||
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
|
||||
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
|
||||
}
|
||||
}
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
void BobbySplitGraphDisplay<COUNT0, COUNT1>::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (BobbyButton(button))
|
||||
{
|
||||
case BobbyButton::Profile0: /* TODO */ break;
|
||||
case BobbyButton::Profile1: /* TODO */ break;
|
||||
case BobbyButton::Profile2: /* TODO */ break;
|
||||
case BobbyButton::Profile3: /* TODO */ break;
|
||||
case BobbyButton::Left2: /* TODO */ break;
|
||||
case BobbyButton::Right2: /* TODO */ break;
|
||||
case BobbyButton::Up2: /* TODO */ break;
|
||||
case BobbyButton::Down2: /* TODO */ break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
template<std::size_t COUNT0, std::size_t COUNT1>
|
||||
void BobbySplitGraphDisplay<COUNT0, COUNT1>::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
||||
|
@ -168,97 +168,107 @@ void CalibrateDisplay::stop()
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrateDisplay::rotate(int offset)
|
||||
void CalibrateDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::rotate(offset);
|
||||
Base::buttonPressed(button);
|
||||
|
||||
m_selectedButton += offset;
|
||||
|
||||
if (m_selectedButton < 0)
|
||||
m_selectedButton = 1;
|
||||
if (m_selectedButton > 1)
|
||||
m_selectedButton = 0;
|
||||
}
|
||||
|
||||
void CalibrateDisplay::confirm()
|
||||
{
|
||||
switch (m_selectedButton)
|
||||
switch (button)
|
||||
{
|
||||
case 0: // left button pressed
|
||||
if (!raw_gas || !raw_brems || !m_gas || !m_brems)
|
||||
return;
|
||||
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:
|
||||
m_status = Status::GasMin;
|
||||
break;
|
||||
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();
|
||||
saveSettings();
|
||||
if (m_bootup)
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
else if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked)
|
||||
{
|
||||
espgui::switchScreen<MainMenu>();
|
||||
settings.lockscreen.locked = false;
|
||||
saveSettings();
|
||||
}
|
||||
else
|
||||
espgui::switchScreen<BoardcomputerHardwareSettingsMenu>();
|
||||
break;
|
||||
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 1: // right button pressed
|
||||
back();
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrateDisplay::back()
|
||||
{
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin:
|
||||
if (m_bootup)
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
else if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked)
|
||||
{
|
||||
espgui::switchScreen<MainMenu>();
|
||||
settings.lockscreen.locked = false;
|
||||
saveSettings();
|
||||
}
|
||||
else
|
||||
espgui::switchScreen<BoardcomputerHardwareSettingsMenu>();
|
||||
break;
|
||||
case Status::GasMin:
|
||||
case Status::GasMax:
|
||||
case Status::BremsMin:
|
||||
case Status::BremsMax:
|
||||
case Status::Confirm:
|
||||
m_selectedButton = 0;
|
||||
m_status = Status::Begin;
|
||||
copyFromSettings();
|
||||
case Button::Right:
|
||||
switch (m_selectedButton)
|
||||
{
|
||||
case 0: // left button pressed
|
||||
if (!raw_gas || !raw_brems || !m_gas || !m_brems)
|
||||
return;
|
||||
|
||||
switch (m_status)
|
||||
{
|
||||
case Status::Begin:
|
||||
m_status = Status::GasMin;
|
||||
break;
|
||||
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();
|
||||
saveSettings();
|
||||
if (m_bootup)
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
else
|
||||
espgui::switchScreen<BoardcomputerHardwareSettingsMenu>();
|
||||
}
|
||||
break;
|
||||
case 1: // right button pressed
|
||||
goto back;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,24 +7,24 @@
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <cpputils.h>
|
||||
#include <displaywithtitle.h>
|
||||
#include <actions/switchscreenaction.h>
|
||||
#include <widgets/label.h>
|
||||
#include <widgets/progressbar.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
#include "globals.h"
|
||||
#include "utils.h"
|
||||
#include "texts.h"
|
||||
#include "modes/ignoreinputmode.h"
|
||||
|
||||
class CalibrateDisplay : public espgui::DisplayWithTitle
|
||||
class CalibrateDisplay : public BobbyDisplayWithTitle
|
||||
{
|
||||
using Base = espgui::DisplayWithTitle;
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
CalibrateDisplay() = default;
|
||||
CalibrateDisplay(bool bootup);
|
||||
explicit CalibrateDisplay(bool bootup);
|
||||
|
||||
std::string text() const override;
|
||||
void start() override;
|
||||
@ -33,10 +33,7 @@ public:
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void rotate(int offset) override;
|
||||
|
||||
void confirm() override;
|
||||
void back() override;
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
void copyFromSettings();
|
||||
|
@ -1,21 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menuitem.h>
|
||||
#include <icons/back.h>
|
||||
#include <actions/dummyaction.h>
|
||||
#include <actions/switchscreenaction.h>
|
||||
#include <widgets/label.h>
|
||||
|
||||
// Local includes
|
||||
#include "menudisplay.h"
|
||||
#include "bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "menuitem.h"
|
||||
#include "icons/back.h"
|
||||
#include "icons/settings.h"
|
||||
#include "texts.h"
|
||||
#include "actions/dummyaction.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
#include "battery.h"
|
||||
#include "menus/batterymenu.h"
|
||||
#include "widgets/label.h"
|
||||
#include "globals.h"
|
||||
|
||||
class CalibrateVoltageDisplay :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BATTERY_CALIBRATE>
|
||||
{
|
||||
public:
|
||||
|
@ -11,18 +11,24 @@
|
||||
|
||||
void GameOfLifeDisplay::start()
|
||||
{
|
||||
Base::start();
|
||||
|
||||
m_grid = std::make_unique<std::bitset<GRIDX*GRIDY>>();
|
||||
m_newgrid = std::make_unique<std::bitset<GRIDX*GRIDY>>();
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
espgui::tft.setRotation(3);
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
if (gen == 0)
|
||||
{
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
@ -40,19 +46,26 @@ void GameOfLifeDisplay::redraw()
|
||||
|
||||
void GameOfLifeDisplay::stop()
|
||||
{
|
||||
Base::stop();
|
||||
|
||||
espgui::tft.setRotation(0);
|
||||
m_grid = nullptr;
|
||||
m_newgrid = nullptr;
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::confirm()
|
||||
void GameOfLifeDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
espgui::switchScreen<DemosMenu>();
|
||||
}
|
||||
Base::buttonPressed(button);
|
||||
|
||||
void GameOfLifeDisplay::back()
|
||||
{
|
||||
espgui::switchScreen<DemosMenu>();
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Left:
|
||||
case Button::Right:
|
||||
espgui::switchScreen<DemosMenu>();
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::drawGrid()
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include <memory>
|
||||
|
||||
// local includes
|
||||
#include "display.h"
|
||||
#include "bobbydisplay.h"
|
||||
|
||||
class GameOfLifeDisplay : public espgui::Display
|
||||
class GameOfLifeDisplay : public BobbyDisplay
|
||||
{
|
||||
using Base = espgui::Display;
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void start() override;
|
||||
@ -17,8 +17,7 @@ public:
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void confirm() override;
|
||||
void back() override;
|
||||
void buttonPressed(espgui::Button button);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1,20 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
#include "display.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
// 3rdparty lib includes
|
||||
#include <actions/switchscreenaction.h>
|
||||
#include <widgets/label.h>
|
||||
#include <widgets/progressbar.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplay.h"
|
||||
#include "globals.h"
|
||||
#include "texts.h"
|
||||
#include "widgets/label.h"
|
||||
#include "widgets/progressbar.h"
|
||||
#include "modes/ignoreinputmode.h"
|
||||
|
||||
namespace {
|
||||
#ifdef FEATURE_GAMETRAK
|
||||
class GametrakCalibrateDisplay : public Display, public ConfirmActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, public BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>
|
||||
class GametrakCalibrateDisplay : public BobbyDisplay, public ConfirmActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, public BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>
|
||||
{
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
@ -38,6 +44,8 @@ private:
|
||||
|
||||
void GametrakCalibrateDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextFont(4);
|
||||
tft.setTextColor(TFT_YELLOW);
|
||||
@ -57,6 +65,8 @@ void GametrakCalibrateDisplay::initScreen()
|
||||
|
||||
void GametrakCalibrateDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
m_labels[0].redraw(fmt::format("{:.02f}", gametrakX));
|
||||
m_labels[1].redraw(std::to_string(raw_gametrakX));
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
#include "garagedisplay.h"
|
||||
|
||||
// system includes
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "globals.h"
|
||||
#include "texts.h"
|
||||
#include "espnowfunctions.h"
|
||||
|
||||
#ifdef FEATURE_GARAGE
|
||||
void GarageDisplay::start()
|
||||
{
|
||||
}
|
||||
|
||||
void GarageDisplay::initScreen()
|
||||
{
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextFont(4);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
espgui::tft.drawString(TEXT_GARAGE, 5, 5, 4);
|
||||
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
espgui::tft.drawString("Garage", 20, 100);
|
||||
}
|
||||
|
||||
void GarageDisplay::redraw()
|
||||
{
|
||||
}
|
||||
|
||||
void GarageDisplay::confirm()
|
||||
{
|
||||
#ifdef FEATURE_ESPNOW
|
||||
if (const auto error = espnow::send_espnow_message(fmt::format("BOBBYOPEN:garage:{}", "TOKEN")); error != ESP_OK)
|
||||
{
|
||||
ESP_LOGE("BOBBY", "send_espnow_message() failed with: %s", esp_err_to_name(error));
|
||||
return;
|
||||
}
|
||||
espgui::switchScreen<MainMenu>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void GarageDisplay::back()
|
||||
{
|
||||
espgui::switchScreen<MainMenu>();
|
||||
}
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "display.h"
|
||||
|
||||
#ifdef FEATURE_GARAGE
|
||||
class GarageDisplay : public espgui::Display
|
||||
{
|
||||
public:
|
||||
void start() override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void confirm() override;
|
||||
void back() override;
|
||||
|
||||
private:
|
||||
};
|
||||
#endif
|
@ -23,6 +23,7 @@
|
||||
#include "displays/menus/ledstripmenu.h"
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
namespace {
|
||||
int8_t selected_side = 7;
|
||||
int8_t selected_color;
|
||||
bool state_select_color{false};
|
||||
@ -49,25 +50,13 @@ const std::array<uint16_t, 8> tft_colors = {
|
||||
TFT_BLUE,
|
||||
TFT_MAGENTA
|
||||
};
|
||||
} // namespace
|
||||
|
||||
std::string LedstripColorsDisplay::text() const
|
||||
{
|
||||
return TEXT_LEDSTRIPCOLORMENU;
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::back()
|
||||
{
|
||||
if(!state_select_color)
|
||||
{
|
||||
espgui::switchScreen<LedstripMenu>();
|
||||
}
|
||||
else
|
||||
{
|
||||
state_select_color = false;
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
@ -102,10 +91,42 @@ void LedstripColorsDisplay::redraw()
|
||||
}
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::rotate(int offset)
|
||||
void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
if (offset < 0)
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Left:
|
||||
if(!state_select_color)
|
||||
{
|
||||
espgui::switchScreen<LedstripMenu>();
|
||||
}
|
||||
else
|
||||
{
|
||||
state_select_color = false;
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
}
|
||||
|
||||
break;
|
||||
case Button::Right:
|
||||
if(!state_select_color)
|
||||
{
|
||||
state_select_color = true;
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
ledstrip_custom_colors[selected_side] = Colors[selected_color];
|
||||
// Uncomment to close select color menu on color select
|
||||
/*
|
||||
state_select_color = false;
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
*/
|
||||
}
|
||||
break;
|
||||
case Button::Up:
|
||||
if (state_select_color)
|
||||
{
|
||||
selected_color++;
|
||||
@ -122,9 +143,21 @@ void LedstripColorsDisplay::rotate(int offset)
|
||||
selected_side = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (offset > 0)
|
||||
{
|
||||
|
||||
/* TODO commander: move into redraw method */
|
||||
if (state_select_color)
|
||||
{
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
clearSides();
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
}
|
||||
|
||||
break;
|
||||
case Button::Down:
|
||||
if (state_select_color)
|
||||
{
|
||||
selected_color--;
|
||||
@ -141,35 +174,20 @@ void LedstripColorsDisplay::rotate(int offset)
|
||||
selected_side = 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state_select_color)
|
||||
{
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
clearSides();
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
}
|
||||
}
|
||||
/* TODO commander: move into redraw method */
|
||||
if (state_select_color)
|
||||
{
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
clearSides();
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::confirm()
|
||||
{
|
||||
if(!state_select_color)
|
||||
{
|
||||
state_select_color = true;
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
ledstrip_custom_colors[selected_side] = Colors[selected_color];
|
||||
// Uncomment to close select color menu on color select
|
||||
/*
|
||||
state_select_color = false;
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,33 +4,32 @@
|
||||
#include <array>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <displaywithtitle.h>
|
||||
#include <FastLED.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplaywithtitle.h"
|
||||
#include "ledstrip.h"
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
extern int8_t selected_side;
|
||||
extern int8_t selected_color;
|
||||
extern bool state_select_color;
|
||||
extern bool last_state;
|
||||
//extern int8_t selected_side;
|
||||
//extern int8_t selected_color;
|
||||
//extern bool state_select_color;
|
||||
//extern bool last_state;
|
||||
|
||||
extern const std::array<CRGB, 8> Colors;
|
||||
//extern const std::array<CRGB, 8> Colors;
|
||||
|
||||
extern const std::array<uint16_t, 8> tft_colors;
|
||||
//extern const std::array<uint16_t, 8> tft_colors;
|
||||
|
||||
class LedstripColorsDisplay : public espgui::DisplayWithTitle
|
||||
class LedstripColorsDisplay : public BobbyDisplayWithTitle
|
||||
{
|
||||
using Base = espgui::DisplayWithTitle;
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string text() const override;
|
||||
void back() override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void rotate(int offset) override;
|
||||
void confirm() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
void drawColors();
|
||||
void drawSide(Bobbycar_Side side, unsigned int color);
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
void Lockscreen::start()
|
||||
{
|
||||
Base::start();
|
||||
|
||||
m_numbers = {0,0,0,0};
|
||||
m_currentIndex = 0;
|
||||
m_pressed = false;
|
||||
@ -33,6 +35,8 @@ void Lockscreen::start()
|
||||
|
||||
void Lockscreen::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextFont(4);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
@ -66,12 +70,16 @@ void Lockscreen::initScreen()
|
||||
|
||||
void Lockscreen::update()
|
||||
{
|
||||
Base::update();
|
||||
|
||||
// just in case someone changes that settings somehow
|
||||
profileButtonDisabled = !settings.lockscreen.allowPresetSwitch;
|
||||
}
|
||||
|
||||
void Lockscreen::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
if (m_pressed || m_back_pressed)
|
||||
{
|
||||
drawRect(m_currentIndex, 1, TFT_BLACK);
|
||||
@ -151,21 +159,28 @@ void Lockscreen::stop()
|
||||
}
|
||||
}
|
||||
|
||||
void Lockscreen::confirm()
|
||||
void Lockscreen::buttonPressed(espgui::Button button)
|
||||
{
|
||||
m_pressed = true;
|
||||
}
|
||||
Base::buttonPressed(button);
|
||||
|
||||
void Lockscreen::back()
|
||||
{
|
||||
if (m_currentIndex > 0)
|
||||
m_currentIndex--;
|
||||
m_back_pressed = true;
|
||||
}
|
||||
|
||||
void Lockscreen::rotate(int offset)
|
||||
{
|
||||
m_rotated += offset;
|
||||
switch (button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Left:
|
||||
if (m_currentIndex > 0)
|
||||
m_currentIndex--;
|
||||
m_back_pressed = true;
|
||||
break;
|
||||
case Button::Right:
|
||||
m_pressed = true;
|
||||
break;
|
||||
case Button::Up:
|
||||
m_rotated--;
|
||||
break;
|
||||
case Button::Down:
|
||||
m_rotated++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Lockscreen::drawRect(int index, int offset, uint32_t color) const
|
||||
|
@ -3,18 +3,20 @@
|
||||
// system includes
|
||||
#include <array>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <widgets/label.h>
|
||||
|
||||
// local includes
|
||||
#include "display.h"
|
||||
#include "widgets/label.h"
|
||||
#include "bobbydisplay.h"
|
||||
#include "modes/ignoreinputmode.h"
|
||||
|
||||
#ifdef LOCKSCREEN_PLUGIN
|
||||
#include "ledstrip.h"
|
||||
#endif
|
||||
|
||||
class Lockscreen : public espgui::Display
|
||||
class Lockscreen : public BobbyDisplay
|
||||
{
|
||||
using Base = espgui::Display;
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
static constexpr auto boxWidth = 35;
|
||||
static constexpr auto boxHeight = 50;
|
||||
@ -27,9 +29,7 @@ public:
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void confirm() override;
|
||||
void back() override;
|
||||
void rotate(int offset) override;
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
void drawRect(int index, int offset, uint32_t color) const;
|
||||
|
@ -1,5 +1,10 @@
|
||||
#include "menudisplaywithtime.h"
|
||||
#include "tftinstance.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
||||
using namespace espgui;
|
@ -1,20 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <cstdint>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
|
||||
namespace bobbygui {
|
||||
class MenuDisplayWithTime :
|
||||
public espgui::MenuDisplay
|
||||
public BobbyMenuDisplay
|
||||
{
|
||||
using Base = espgui::MenuDisplay;
|
||||
using Base = BobbyMenuDisplay;
|
||||
|
||||
public:
|
||||
void start() override;
|
||||
void redraw() override;
|
||||
espgui::Label m_label_currentTime{145, 6};
|
||||
|
||||
private:
|
||||
virtual bool use_big_font() const
|
||||
{
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class AboutMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_ABOUT>
|
||||
{
|
||||
public:
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class AccessPointWifiSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_ACCESSPOINTWIFISETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -1,20 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
#include <menuitem.h>
|
||||
#include <icons/back.h>
|
||||
#include <actions/dummyaction.h>
|
||||
#include <actions/switchscreenaction.h>
|
||||
|
||||
// Local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "icons/settings.h"
|
||||
#include "texts.h"
|
||||
#include "battery.h"
|
||||
|
||||
class BatteryDebugMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BATTERYDEBUG>
|
||||
{
|
||||
public:
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <changevaluedisplay.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "mainmenu.h"
|
||||
#include "displays/calibratevoltagedisplay.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
@ -13,7 +14,7 @@
|
||||
class CurrentBatteryStatusText : public virtual espgui::TextInterface { public: std::string text() const override { return getBatteryPercentageString(); } };
|
||||
|
||||
using BatteryCellSeriesChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_CELL_SERIES>,
|
||||
BatterySeriesCellsAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BatteryMenu>>,
|
||||
@ -21,7 +22,7 @@ using BatteryCellSeriesChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using BatteryCellParallelChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_CELL_PARALLEL>,
|
||||
BatteryParallelCellsAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BatteryMenu>>,
|
||||
@ -29,7 +30,7 @@ using BatteryCellParallelChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using BatteryWHperKMChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint16_t>,
|
||||
BobbyChangeValueDisplay<uint16_t>,
|
||||
espgui::StaticText<TEXT_BATTERY_WHKM>,
|
||||
BatteryWHperKMAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BatteryMenu>>,
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <menudisplay.h>
|
||||
#include <menuitem.h>
|
||||
#include <icons/back.h>
|
||||
#include <actions/dummyaction.h>
|
||||
#include <actions/switchscreenaction.h>
|
||||
|
||||
// Local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "icons/settings.h"
|
||||
#include "texts.h"
|
||||
@ -16,10 +16,11 @@
|
||||
#include "widgets/doubleprogressbar.h"
|
||||
|
||||
class BatteryMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BATTERY>
|
||||
{
|
||||
using Base = espgui::MenuDisplay;
|
||||
using Base = BobbyMenuDisplay;
|
||||
|
||||
public:
|
||||
BatteryMenu();
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
#ifdef FEATURE_BLE
|
||||
|
||||
class BleSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BLESETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifdef FEATURE_BLUETOOTH
|
||||
#include "changevaluedisplay_bluetoothmode.h"
|
||||
#endif
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/dummyaction.h"
|
||||
#ifdef FEATURE_BLUETOOTH
|
||||
@ -37,7 +37,7 @@ using AutoBluetoothModeChangeDisplay = makeComponent<
|
||||
>;
|
||||
|
||||
class BluetoothSettingsMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<TEXT_BLUETOOTHSETTINGS>,
|
||||
public BackActionInterface<SwitchScreenAction<SettingsMenu>>
|
||||
{
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class BmsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BMS>
|
||||
{
|
||||
public:
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <checkboxicon.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "icons/lock.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
@ -43,35 +44,35 @@ public:
|
||||
};
|
||||
|
||||
using SampleCountChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SAMPLECOUNT>,
|
||||
SampleCountAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GasMinChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_GASMIN>,
|
||||
GasMinAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GasMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_GASMAX>,
|
||||
GasMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using BremsMinChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_BREMSMIN>,
|
||||
BremsMinAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using BremsMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_BREMSMAX>,
|
||||
BremsMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
@ -80,7 +81,7 @@ using BremsMaxChangeScreen = espgui::makeComponent<
|
||||
|
||||
#if defined(FEATURE_DPAD) || defined(FEATURE_DPAD_3WIRESW) || defined(FEATURE_DPAD_5WIRESW) || defined(FEATURE_DPAD_5WIRESW_2OUT) || defined (FEATURE_DPAD_6WIRESW)
|
||||
using DPadDebounceChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_DPADDEBOUNCE>,
|
||||
DPadDebounceAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
@ -103,42 +104,42 @@ public:
|
||||
};
|
||||
|
||||
using GametrakXMinChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKXMIN>,
|
||||
GametrakXMinAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GametrakXMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKXMAX>,
|
||||
GametrakXMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GametrakYMinChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKYMIN>,
|
||||
GametrakYMinAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GametrakYMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKYMAX>,
|
||||
GametrakYMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GametrakDistMinChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKDISTMIN>,
|
||||
GametrakDistMinAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
|
||||
>;
|
||||
using GametrakDistMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKDISTMAX>,
|
||||
GametrakDistMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class BoardcomputerHardwareSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BOARDCOMPUTERHARDWARESETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "globals.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
@ -17,7 +18,7 @@
|
||||
namespace {
|
||||
struct FrontFreqAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.freq; } };
|
||||
using FrontFreqChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_FRONTFREQ>,
|
||||
FrontFreqAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
@ -26,7 +27,7 @@ using FrontFreqChangeScreen = espgui::makeComponent<
|
||||
|
||||
struct FrontPatternAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.pattern; } };
|
||||
using FrontPatternChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_FRONTPATTERN>,
|
||||
FrontPatternAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
@ -35,7 +36,7 @@ using FrontPatternChangeScreen = espgui::makeComponent<
|
||||
|
||||
struct BackFreqAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.back.command.buzzer.freq; } };
|
||||
using BackFreqChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_BACKFREQ>,
|
||||
BackFreqAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
@ -44,7 +45,7 @@ using BackFreqChangeScreen = espgui::makeComponent<
|
||||
|
||||
struct BackPatternAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.back.command.buzzer.pattern; } };
|
||||
using BackPatternChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_BACKPATTERN>,
|
||||
BackPatternAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
@ -52,28 +53,28 @@ using BackPatternChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using ReverseBeepFreq0ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPFREQ0>,
|
||||
ReverseBeepFreq0Accessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
espgui::SwitchScreenAction<BuzzerMenu>
|
||||
>;
|
||||
using ReverseBeepFreq1ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPFREQ1>,
|
||||
ReverseBeepFreq1Accessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
espgui::SwitchScreenAction<BuzzerMenu>
|
||||
>;
|
||||
using ReverseBeepDuration0ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPDURATION0>,
|
||||
ReverseBeepDuration0Accessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
espgui::SwitchScreenAction<BuzzerMenu>
|
||||
>;
|
||||
using ReverseBeepDuration1ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPDURATION1>,
|
||||
ReverseBeepDuration1Accessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<BuzzerMenu>>,
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class BuzzerMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BUZZER>
|
||||
{
|
||||
public:
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "cloudtexthelpers.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "cloud.h"
|
||||
@ -20,7 +21,7 @@
|
||||
namespace {
|
||||
|
||||
using CloudTransmitTimeoutChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CLOUDTRANSMITTIMEOUT>,
|
||||
CloudTransmitTimeoutAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<CloudSettingsMenu>>,
|
||||
@ -37,7 +38,7 @@ public:
|
||||
};
|
||||
|
||||
using CloudCollectRateChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CLOUDCOLLECTRATE>,
|
||||
CloudCollectRateAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<CloudSettingsMenu>>,
|
||||
@ -45,7 +46,7 @@ using CloudCollectRateChangeDisplay = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using CloudSendRateChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CLOUDSENDRATE>,
|
||||
CloudSendRateAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<CloudSettingsMenu>>,
|
||||
|
@ -1,14 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
#ifdef FEATURE_CLOUD
|
||||
class CloudSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_CLOUDSETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/dummyaction.h"
|
||||
@ -15,7 +15,7 @@ using namespace espgui;
|
||||
namespace {
|
||||
template<const char *Ttext, typename Ttexts>
|
||||
class CommandDebugMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<Ttext>,
|
||||
public BackActionInterface<SwitchScreenAction<DebugMenu>>
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "globals.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
@ -20,14 +21,14 @@
|
||||
|
||||
namespace {
|
||||
using WheelDiameterMmChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_WHEELDIAMETERMM>,
|
||||
WheelDiameterMmAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>
|
||||
>;
|
||||
using WheelDiameterInchChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<float>,
|
||||
BobbyChangeValueDisplay<float>,
|
||||
espgui::StaticText<TEXT_WHEELDIAMETERINCH>,
|
||||
WheelDiameterInchAccessor,
|
||||
espgui::RatioNumberStep<float, std::ratio<1,10>>,
|
||||
@ -35,7 +36,7 @@ using WheelDiameterInchChangeScreen = espgui::makeComponent<
|
||||
espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>
|
||||
>;
|
||||
using NumMagnetPolesChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_NUMMAGNETPOLES>,
|
||||
NumMagnetPolesAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>>,
|
||||
@ -43,14 +44,14 @@ using NumMagnetPolesChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
#ifdef FEATURE_CAN
|
||||
using CanTransmitTimeoutChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CANTRANSMITTIMEOUT>,
|
||||
CanTransmitTimeoutAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>
|
||||
>;
|
||||
using CanReceiveTimeoutChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CANRECEIVETIMEOUT>,
|
||||
CanReceiveTimeoutAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<ControllerHardwareSettingsMenu>>,
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class ControllerHardwareSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_CONTROLLERHARDWARESETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
class CrashMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<TEXT_CRASHMENU>
|
||||
{
|
||||
public:
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class DebugMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_DEBUG>
|
||||
{
|
||||
public:
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
@ -18,91 +19,91 @@
|
||||
|
||||
namespace {
|
||||
using DefaultModeModelModeChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<UnifiedModelMode>,
|
||||
BobbyChangeValueDisplay<UnifiedModelMode>,
|
||||
espgui::StaticText<TEXT_MODELMODE>,
|
||||
DefaultModeModelModeAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeHybridModelModeChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<UnifiedModelMode>,
|
||||
BobbyChangeValueDisplay<UnifiedModelMode>,
|
||||
espgui::StaticText<TEXT_HYBRIDMODE>,
|
||||
DefaultModeHybridModelModeAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeSmoothingChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SMOOTHINGVAL>,
|
||||
DefaultModeSmoothingAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeFwSmoothingLowerLimitChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_FWSMOOTHING_LIMIT>,
|
||||
DefaultModeEnableFieldWeakSmoothingLowerLimitAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeFrontPercentageChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_FRONTPERCENTAGE>,
|
||||
DefaultModeFrontPercentageAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeBackPercentageChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_BACKPERCENTAGE>,
|
||||
DefaultModeBackPercentageAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeAddSchwelleChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_ADDSCHWELLE>,
|
||||
DefaultModeAddSchwelleAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeGas1WertChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_ADDGASVAL>,
|
||||
DefaultModeGas1WertAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeGas2WertChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SUBGASVAL>,
|
||||
DefaultModeGas2WertAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeBrems1WertChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_ADDBRAKEVAL>,
|
||||
DefaultModeBrems1WertAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeBrems2WertChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SUBBRAKEVAL>,
|
||||
DefaultModeBrems2WertAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeHybridActivationLimitChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_HYBRIDACTIVATIONLIMIT>,
|
||||
DefaultModeHybridActivationLimitAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<DefaultModeSettingsMenu>
|
||||
>;
|
||||
using DefaultModeHybridDeactivationLimitChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_HYBRIDDEACTIVATIONLIMIT>,
|
||||
DefaultModeHybridDeactivationLimitAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<DefaultModeSettingsMenu>>,
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class DefaultModeSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_DEFAULTMODESETTIGNS>
|
||||
{
|
||||
public:
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class DemosMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_DEMOS>
|
||||
{
|
||||
public:
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <esprandom.h>
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
@ -125,7 +125,7 @@ constexpr char TEXT_STATICICON[] = "Static icon";
|
||||
constexpr char TEXT_DEBUGTOGGLE[] = "Toggle";
|
||||
|
||||
class DynamicDebugMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public RandomText,
|
||||
public BackActionInterface<SwitchScreenAction<DebugMenu>>
|
||||
{
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
class EnableMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<TEXT_SETENABLED>
|
||||
{
|
||||
public:
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#ifdef FEATURE_ESPNOW
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
#include <actioninterface.h>
|
||||
#include <espchrono.h>
|
||||
@ -10,6 +11,8 @@
|
||||
#include <textinterface.h>
|
||||
#include <texts.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "espnowfunctions.h"
|
||||
|
||||
using namespace espgui;
|
||||
@ -31,8 +34,8 @@ public:
|
||||
} // namespace
|
||||
|
||||
class EspNowMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public espgui::StaticText<TEXT_ESPNOW_MENU>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_ESPNOW_MENU>
|
||||
{
|
||||
public:
|
||||
EspNowMenu();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#ifdef FEATURE_ESPNOW
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
#include <actioninterface.h>
|
||||
#include <espchrono.h>
|
||||
@ -10,6 +11,8 @@
|
||||
#include <textinterface.h>
|
||||
#include <texts.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "espnowfunctions.h"
|
||||
|
||||
using namespace espgui;
|
||||
@ -18,8 +21,8 @@ namespace espnowsettingsmenu {
|
||||
} // namespace
|
||||
|
||||
class EspNowSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public espgui::StaticText<TEXT_ESPNOW_SETTINGS>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_ESPNOW_SETTINGS>
|
||||
{
|
||||
public:
|
||||
EspNowSettingsMenu();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/dummyaction.h"
|
||||
@ -17,7 +17,7 @@ using namespace espgui;
|
||||
namespace {
|
||||
template<const char *Ttext, typename Ttexts, template<int> class ColorInterface>
|
||||
class FeedbackDebugMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<Ttext>,
|
||||
public BackActionInterface<SwitchScreenAction<DebugMenu>>
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "utils.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
@ -13,7 +13,7 @@ using namespace espgui;
|
||||
namespace {
|
||||
#ifdef FEATURE_GAMETRAK
|
||||
class ContainerModeSettingsMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<TEXT_GAMETRAKMODESETTINGS>,
|
||||
public BackActionInterface<SwitchScreenAction<ModesSettingsMenu>>
|
||||
{
|
||||
|
23
main/displays/menus/garagenmenu.cpp
Normal file
23
main/displays/menus/garagenmenu.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#if defined(FEATURE_GARAGE) && defined (FEATURE_ESPNOW)
|
||||
#include "garagenmenu.h"
|
||||
|
||||
// 3rd party libs
|
||||
#include <icons/back.h>
|
||||
#include <menuitem.h>
|
||||
|
||||
// local includes
|
||||
#include "actions/switchscreenaction.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
GarageMenu::GarageMenu()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GarageMenu::back()
|
||||
{
|
||||
switchScreen<MainMenu>();
|
||||
}
|
||||
#endif
|
36
main/displays/menus/garagenmenu.h
Normal file
36
main/displays/menus/garagenmenu.h
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#if defined(FEATURE_GARAGE) && defined (FEATURE_ESPNOW)
|
||||
// 3rd party lib
|
||||
#include <actioninterface.h>
|
||||
#include <esp_log.h>
|
||||
#include <menuitem.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "espnowfunctions.h"
|
||||
#include "texts.h"
|
||||
#include "globals.h"
|
||||
|
||||
namespace garagenmenu {
|
||||
class SendEspNowMessageAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
SendEspNowMessageAction(uint8_t index) : m_index{index} {}
|
||||
void triggered() override
|
||||
{
|
||||
|
||||
}
|
||||
private:
|
||||
uint8_t m_index;
|
||||
};
|
||||
} // namespace garagenmenu
|
||||
|
||||
class GarageMenu :
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_GARAGE>
|
||||
{
|
||||
public:
|
||||
GarageMenu();
|
||||
void back() override;
|
||||
};
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "changevaluedisplay.h"
|
||||
#include "menuitem.h"
|
||||
#include "actions/dummyaction.h"
|
||||
@ -17,7 +17,7 @@ using namespace espgui;
|
||||
|
||||
namespace {
|
||||
class GenericWifiSettingsMenu :
|
||||
public MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public StaticText<TEXT_GENERICWIFISETTINGS>,
|
||||
public BackActionInterface<SwitchScreenAction<WifiSettingsMenu>>
|
||||
{
|
||||
|
@ -7,34 +7,36 @@
|
||||
#include "splitgraphdisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbygraphdisplay.h"
|
||||
#include "displays/bobbysplitgraphdisplay.h"
|
||||
#include "utils.h"
|
||||
#include "statistics.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
|
||||
namespace {
|
||||
using GasGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_GAS>,
|
||||
espgui::SingleGraphAccessor<GasStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using BremsGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_BREMS>,
|
||||
espgui::SingleGraphAccessor<BremsStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using PotisGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<2>,
|
||||
BobbyGraphDisplay<2>,
|
||||
espgui::StaticText<TEXT_POTIS>,
|
||||
espgui::DualGraphAccessor<GasStatistics, BremsStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using PotisSplitGraphDisplay = espgui::makeComponent<
|
||||
espgui::SplitGraphDisplay<1, 1>,
|
||||
BobbySplitGraphDisplay<1, 1>,
|
||||
espgui::StaticText<TEXT_POTIS>,
|
||||
espgui::SingleTopGraphAccessor<GasStatistics>,
|
||||
espgui::SingleBottomGraphAccessor<BremsStatistics>,
|
||||
@ -43,14 +45,14 @@ using PotisSplitGraphDisplay = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using AvgSpeedGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_AVGSPEED>,
|
||||
espgui::SingleGraphAccessor<AvgSpeedStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using AvgSpeedKmhGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_AVGSPEEDKMH>,
|
||||
espgui::SingleGraphAccessor<AvgSpeedKmhStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
@ -58,7 +60,7 @@ using AvgSpeedKmhGraphDisplay = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using SumCurrentGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_SUMCURRENT>,
|
||||
espgui::SingleGraphAccessor<SumCurrentStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
@ -66,28 +68,28 @@ using SumCurrentGraphDisplay = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using FrontVoltageGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_FRONTVOLTAGE>,
|
||||
espgui::SingleGraphAccessor<FrontVoltageStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using BackVoltageGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_BACKVOLTAGE>,
|
||||
espgui::SingleGraphAccessor<BackVoltageStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using VoltagesGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<2>,
|
||||
BobbyGraphDisplay<2>,
|
||||
espgui::StaticText<TEXT_VOLTAGES>,
|
||||
espgui::DualGraphAccessor<FrontVoltageStatistics, BackVoltageStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using VoltagesSplitGraphDisplay = espgui::makeComponent<
|
||||
espgui::SplitGraphDisplay<1, 1>,
|
||||
BobbySplitGraphDisplay<1, 1>,
|
||||
espgui::StaticText<TEXT_VOLTAGES>,
|
||||
espgui::SingleTopGraphAccessor<FrontVoltageStatistics>,
|
||||
espgui::SingleBottomGraphAccessor<BackVoltageStatistics>,
|
||||
@ -97,28 +99,28 @@ using VoltagesSplitGraphDisplay = espgui::makeComponent<
|
||||
|
||||
#ifdef FEATURE_BMS
|
||||
using BmsVoltageGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_BMSVOLTAGE>,
|
||||
espgui::SingleGraphAccessor<BmsVoltageStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using BmsCurrentGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_BMSCURRENT>,
|
||||
espgui::SingleGraphAccessor<BmsCurrentStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using BmsPowerGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_BMSPOWER>,
|
||||
espgui::SingleGraphAccessor<BmsPowerStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<GraphsMenu>>
|
||||
>;
|
||||
using SumCurrentsComparisonGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<2>,
|
||||
BobbyGraphDisplay<2>,
|
||||
espgui::StaticText<TEXT_SUMCURRENTSCOMPARISON>,
|
||||
DualGraphAccessor<SumCurrentStatistics, BmsCurrentStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
@ -134,7 +136,7 @@ class MotorCurrentsStatistics : public virtual espgui::GraphAccessorInterface<4>
|
||||
}
|
||||
};
|
||||
using MotorCurrentsGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<4>,
|
||||
BobbyGraphDisplay<4>,
|
||||
espgui::StaticText<TEXT_MOTORCURRENTS>,
|
||||
MotorCurrentsStatistics,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
@ -142,7 +144,7 @@ using MotorCurrentsGraphDisplay = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using RssiGraphDisplay = espgui::makeComponent<
|
||||
espgui::GraphDisplay<1>,
|
||||
BobbyGraphDisplay<1>,
|
||||
espgui::StaticText<TEXT_RSSI>,
|
||||
espgui::SingleGraphAccessor<RssiStatistics>,
|
||||
espgui::ConfirmActionInterface<espgui::SwitchScreenAction<GraphsMenu>>,
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class GraphsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_GRAPHS>
|
||||
{
|
||||
public:
|
||||
|
@ -1,17 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
#include <qrcode.h>
|
||||
|
||||
// local includes
|
||||
#include "accessorinterface.h"
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class GreenPassMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_GREENPASS>
|
||||
{
|
||||
using Base = espgui::MenuDisplay;
|
||||
public:
|
||||
GreenPassMenu();
|
||||
void back() override;
|
||||
|
@ -2,36 +2,35 @@
|
||||
|
||||
// 3rd party libs
|
||||
#include <fmt/core.h>
|
||||
|
||||
// local includes
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "actions/switchscreenaction.h"
|
||||
#include "actions/toggleboolaction.h"
|
||||
#include "changevaluedisplay.h"
|
||||
#include "changevaluedisplay_handbremsmode.h"
|
||||
#include "checkboxicon.h"
|
||||
#include "displays/menus/defaultmodesettingsmenu.h"
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "changevaluedisplay_handbremsmode.h"
|
||||
#include "displays/menus/defaultmodesettingsmenu.h"
|
||||
#include "texts.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
namespace {
|
||||
using HandBremsTriggerTimeoutChangeValueDisplay = makeComponent<
|
||||
ChangeValueDisplay<uint16_t>,
|
||||
StaticText<TEXT_HANDBREMSE_TRIGGERTIMEOUT>,
|
||||
using HandBremsTriggerTimeoutChangeValueDisplay = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint16_t>,
|
||||
espgui::StaticText<TEXT_HANDBREMSE_TRIGGERTIMEOUT>,
|
||||
HandbremsTimeoutAccessor,
|
||||
BackActionInterface<SwitchScreenAction<HandbremsSettingsMenu>>,
|
||||
SwitchScreenAction<HandbremsSettingsMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<HandbremsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<HandbremsSettingsMenu>
|
||||
>;
|
||||
using HandBremsModeChangeValueDisplay = makeComponent<
|
||||
ChangeValueDisplay<HandbremseMode>,
|
||||
StaticText<TEXT_HANDBREMSE_MODE>,
|
||||
using HandBremsModeChangeValueDisplay = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<HandbremseMode>,
|
||||
espgui::StaticText<TEXT_HANDBREMSE_MODE>,
|
||||
HandbremsModeAccessor,
|
||||
BackActionInterface<SwitchScreenAction<HandbremsSettingsMenu>>,
|
||||
SwitchScreenAction<HandbremsSettingsMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<HandbremsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<HandbremsSettingsMenu>
|
||||
>;
|
||||
class HandBremsModeText : public virtual TextInterface
|
||||
class HandBremsModeText : public virtual espgui::TextInterface
|
||||
{
|
||||
public:
|
||||
std::string text() const override
|
||||
@ -43,6 +42,7 @@ public:
|
||||
|
||||
HandbremsSettingsMenu::HandbremsSettingsMenu()
|
||||
{
|
||||
using namespace espgui;
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_HANDBREMSE_ENABLE>, ToggleBoolAction, CheckboxIcon, HandbremsEnabledAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_HANDBREMSE_AUTOMATIC>, ToggleBoolAction, CheckboxIcon, HandbremsAutomaticAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_HANDBREMSE_VISUALIZE>, ToggleBoolAction, CheckboxIcon, HandbremsVisualizeAccessor>>();
|
||||
@ -53,5 +53,5 @@ HandbremsSettingsMenu::HandbremsSettingsMenu()
|
||||
|
||||
void HandbremsSettingsMenu::back()
|
||||
{
|
||||
switchScreen<DefaultModeSettingsMenu>();
|
||||
espgui::switchScreen<DefaultModeSettingsMenu>();
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "menudisplay.h"
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class HandbremsSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_DEBUG>
|
||||
{
|
||||
public:
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
InvertMenu::InvertMenu()
|
||||
{
|
||||
using namespace espgui;
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTFRONTLEFT>, ToggleBoolAction, CheckboxIcon, FrontLeftInvertedAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTFRONTRIGHT>, ToggleBoolAction, CheckboxIcon, FrontRightInvertedAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTBACKLEFT>, ToggleBoolAction, CheckboxIcon, BackLeftInvertedAccessor>>();
|
||||
@ -20,5 +21,5 @@ InvertMenu::InvertMenu()
|
||||
|
||||
void InvertMenu::back()
|
||||
{
|
||||
switchScreen<ControllerHardwareSettingsMenu>();
|
||||
espgui::switchScreen<ControllerHardwareSettingsMenu>();
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
class InvertMenu :
|
||||
public MenuDisplay,
|
||||
public StaticText<TEXT_SETINVERTED>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_SETINVERTED>
|
||||
{
|
||||
public:
|
||||
InvertMenu();
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "changevaluedisplay_larsmmode_mode.h"
|
||||
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||
@ -15,21 +16,21 @@
|
||||
|
||||
namespace {
|
||||
using LarsmModeModelModeChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<UnifiedModelMode>,
|
||||
BobbyChangeValueDisplay<UnifiedModelMode>,
|
||||
espgui::StaticText<TEXT_MODELMODE>,
|
||||
LarsmModeModelModeAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LarsmModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LarsmModeSettingsMenu>
|
||||
>;
|
||||
using LarsmModeModeChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<LarsmModeMode>,
|
||||
BobbyChangeValueDisplay<LarsmModeMode>,
|
||||
espgui::StaticText<TEXT_SETMODE>,
|
||||
LarsmModeModeAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LarsmModeSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LarsmModeSettingsMenu>
|
||||
>;
|
||||
using LarsmModeIterationsChangeDisplay = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<uint8_t>,
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_SETITERATIONS>,
|
||||
LarsmModeIterationsAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LarsmModeSettingsMenu>>,
|
||||
|
@ -3,11 +3,11 @@
|
||||
// 3rdparty lib includes
|
||||
|
||||
// local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class LarsmModeSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_LARSMMODESETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <menuitem.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "displays/ledstripcolorsdisplay.h"
|
||||
#include "displays/menus/ledstripselectotamode.h"
|
||||
@ -23,82 +24,80 @@
|
||||
|
||||
// clang-format off
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
namespace {
|
||||
using LedsCountChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_LEDSCOUNT>,
|
||||
using LedsCountChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_LEDSCOUNT>,
|
||||
LedsCountAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using CenterOffsetChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_CENTEROFFSET>,
|
||||
using CenterOffsetChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_CENTEROFFSET>,
|
||||
CenterOffsetAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using SmallOffsetChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_SMALLOFFSET>,
|
||||
using SmallOffsetChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_SMALLOFFSET>,
|
||||
SmallOffsetAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using BigOffsetChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_BIGOFFSET>,
|
||||
using BigOffsetChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_BIGOFFSET>,
|
||||
BigOffsetAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using DeziampereChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_LEDSTRIP_MILLIAMP>,
|
||||
using DeziampereChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_LEDSTRIP_MILLIAMP>,
|
||||
DeziampereAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using StVOOffsetChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_STVO_FRONTOFFSET>,
|
||||
using StVOOffsetChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_STVO_FRONTOFFSET>,
|
||||
LedsStVOFrontOffsetAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using StVOLengthChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_STVO_FRONTLENGTH>,
|
||||
using StVOLengthChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_STVO_FRONTLENGTH>,
|
||||
LedsStVOFrontLengthAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using animationMultiplierChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<int16_t>,
|
||||
StaticText<TEXT_ANIMATION_MULTIPLIER>,
|
||||
using animationMultiplierChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_ANIMATION_MULTIPLIER>,
|
||||
AnimationMultiplierAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
using ledstripBrightnessChangeScreen = makeComponent<
|
||||
ChangeValueDisplay<uint8_t>,
|
||||
StaticText<TEXT_LEDSTRIP_BRIGHTNESS>,
|
||||
using ledstripBrightnessChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticText<TEXT_LEDSTRIP_BRIGHTNESS>,
|
||||
LedstripBrightnessAccessor,
|
||||
BackActionInterface<SwitchScreenAction<LedstripMenu>>,
|
||||
SwitchScreenAction<LedstripMenu>
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LedstripMenu>>,
|
||||
espgui::SwitchScreenAction<LedstripMenu>
|
||||
>;
|
||||
|
||||
class AllCustomLedsOffAction : public virtual ActionInterface
|
||||
class AllCustomLedsOffAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override
|
||||
@ -113,35 +112,36 @@ public:
|
||||
|
||||
LedstripMenu::LedstripMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDSTRIPCOLORMENU>, SwitchScreenAction<LedstripColorsDisplay>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDANIMATION>, ToggleBoolAction, CheckboxIcon, EnableLedAnimationAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BRAKELIGHTS>, ToggleBoolAction, CheckboxIcon, EnableBrakeLightsAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLINKBEEP>, ToggleBoolAction, CheckboxIcon, EnableBeepWhenBlinkAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_FULLBLINK>, ToggleBoolAction, CheckboxIcon, EnableFullBlinkAccessor>>();
|
||||
using namespace espgui;
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDSTRIPCOLORMENU>, espgui::SwitchScreenAction<LedstripColorsDisplay>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDANIMATION>, ToggleBoolAction, CheckboxIcon, EnableLedAnimationAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_BRAKELIGHTS>, ToggleBoolAction, CheckboxIcon, EnableBrakeLightsAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_BLINKBEEP>, ToggleBoolAction, CheckboxIcon, EnableBeepWhenBlinkAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_FULLBLINK>, ToggleBoolAction, CheckboxIcon, EnableFullBlinkAccessor>>();
|
||||
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDSTRIP_STVO>, ToggleBoolAction, CheckboxIcon, EnableLedstripStVOAccessor>>(); }
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_STVO_ENABLEFRONTLIGHT>, ToggleBoolAction, CheckboxIcon, EnableLedstripStVOFrontlight>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDSTRIP_ALLCUSTOMOFF>, AllCustomLedsOffAction>>();
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_STVO_FRONTOFFSET, LedsStVOFrontOffsetAccessor>, SwitchScreenAction<StVOOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_STVO_FRONTLENGTH, LedsStVOFrontLengthAccessor>, SwitchScreenAction<StVOLengthChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDSTRIP_STVO>, ToggleBoolAction, CheckboxIcon, EnableLedstripStVOAccessor>>(); }
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_STVO_ENABLEFRONTLIGHT>, ToggleBoolAction, CheckboxIcon, EnableLedstripStVOFrontlight>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDSTRIP_ALLCUSTOMOFF>, AllCustomLedsOffAction>>();
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_STVO_FRONTOFFSET, LedsStVOFrontOffsetAccessor>, espgui::SwitchScreenAction<StVOOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_STVO_FRONTLENGTH, LedsStVOFrontLengthAccessor>, espgui::SwitchScreenAction<StVOLengthChangeScreen>>>(); }
|
||||
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTANIMATION>, SwitchScreenAction<LedstripSelectAnimationMenu>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLINKANIMATION>, SwitchScreenAction<LedstripSelectBlinkMenu>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_SELECTANIMATION>, espgui::SwitchScreenAction<LedstripSelectAnimationMenu>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_BLINKANIMATION>, espgui::SwitchScreenAction<LedstripSelectBlinkMenu>>>();
|
||||
#ifdef FEATURE_OTA
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDSTRIP_CHANGE_OTA_ANIM>, SwitchScreenAction<ledstripOtaAnimationChangeMenu>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDSTRIP_CHANGE_OTA_ANIM>, espgui::SwitchScreenAction<ledstripOtaAnimationChangeMenu>>>(); }
|
||||
#endif
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_MULTIPLIER>, SwitchScreenAction<animationMultiplierChangeScreen>>>();
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_LEDSCOUNT, LedsCountAccessor>, SwitchScreenAction<LedsCountChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_CENTEROFFSET, CenterOffsetAccessor>, SwitchScreenAction<CenterOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SMALLOFFSET, SmallOffsetAccessor>, SwitchScreenAction<SmallOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_BIGOFFSET, BigOffsetAccessor>, SwitchScreenAction<BigOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LEDSTRIP_BRIGHTNESS>, SwitchScreenAction<ledstripBrightnessChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_LEDSTRIP_MILLIAMP, DeziampereAccessor>, SwitchScreenAction<DeziampereChangeScreen>>>(); }
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_ANIMATION_MULTIPLIER>, espgui::SwitchScreenAction<animationMultiplierChangeScreen>>>();
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_LEDSCOUNT, LedsCountAccessor>, espgui::SwitchScreenAction<LedsCountChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_CENTEROFFSET, CenterOffsetAccessor>, espgui::SwitchScreenAction<CenterOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SMALLOFFSET, SmallOffsetAccessor>, espgui::SwitchScreenAction<SmallOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_BIGOFFSET, BigOffsetAccessor>, espgui::SwitchScreenAction<BigOffsetChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_LEDSTRIP_BRIGHTNESS>, espgui::SwitchScreenAction<ledstripBrightnessChangeScreen>>>(); }
|
||||
if (!simplified) { constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_LEDSTRIP_MILLIAMP, DeziampereAccessor>, espgui::SwitchScreenAction<DeziampereChangeScreen>>>(); }
|
||||
constructMenuItem<makeComponent<MenuItem, espgui::StaticText<TEXT_BACK>, espgui::SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
void LedstripMenu::back()
|
||||
{
|
||||
switchScreen<MainMenu>();
|
||||
espgui::switchScreen<MainMenu>();
|
||||
}
|
||||
#endif
|
||||
|
@ -1,9 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "widgets/menudisplaywithtime.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/menudisplaywithtime.h"
|
||||
#include "texts.h"
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
|
@ -10,9 +10,36 @@
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
std::string currentSelectedAnimationText::text() const
|
||||
namespace {
|
||||
|
||||
class CurrentSelectedAnimationText : public virtual espgui::TextInterface
|
||||
{
|
||||
public:
|
||||
std::string text() const override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
LedstripSelectAnimationMenu::LedstripSelectAnimationMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, CurrentSelectedAnimationText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_DEFAULTRAINBOW>, LedStripSetAnimationAction<LedstripAnimation::DefaultRainbow>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_BETTERRAINBOW>, LedStripSetAnimationAction<LedstripAnimation::BetterRainbow>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_SPEEDSYNCANIMATION>, LedStripSetAnimationAction<LedstripAnimation::SpeedSync>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_CUSTOMCOLOR>, LedStripSetAnimationAction<LedstripAnimation::CustomColor>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<LedstripMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
void LedstripSelectAnimationMenu::back()
|
||||
{
|
||||
switchScreen<LedstripMenu>();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
std::string CurrentSelectedAnimationText::text() const
|
||||
{
|
||||
switch (animation_type) {
|
||||
case LedstripAnimation::DefaultRainbow:
|
||||
@ -28,19 +55,5 @@ std::string currentSelectedAnimationText::text() const
|
||||
}
|
||||
}
|
||||
|
||||
LedstripSelectAnimationMenu::LedstripSelectAnimationMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, currentSelectedAnimationText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_DEFAULTRAINBOW>, LedStripSetAnimationAction<LedstripAnimation::DefaultRainbow>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_BETTERRAINBOW>, LedStripSetAnimationAction<LedstripAnimation::BetterRainbow>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_SPEEDSYNCANIMATION>, LedStripSetAnimationAction<LedstripAnimation::SpeedSync>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ANIMATION_CUSTOMCOLOR>, LedStripSetAnimationAction<LedstripAnimation::CustomColor>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<LedstripMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
void LedstripSelectAnimationMenu::back()
|
||||
{
|
||||
switchScreen<LedstripMenu>();
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
@ -1,19 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// Local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
#ifdef FEATURE_LEDSTRIP
|
||||
|
||||
class currentSelectedAnimationText : public virtual espgui::TextInterface {
|
||||
public:
|
||||
std::string text() const override;
|
||||
};
|
||||
|
||||
class LedstripSelectAnimationMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public espgui::StaticText<TEXT_SELECTANIMATION>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_SELECTANIMATION>
|
||||
{
|
||||
public:
|
||||
LedstripSelectAnimationMenu();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
#include "ledstrip.h"
|
||||
#include "ledstripdefines.h"
|
||||
@ -13,8 +13,8 @@ public: std::string text() const override;
|
||||
};
|
||||
|
||||
class LedstripSelectBlinkMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public espgui::StaticText<TEXT_BLINKANIMATION>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BLINKANIMATION>
|
||||
{
|
||||
public:
|
||||
LedstripSelectBlinkMenu();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Local includes
|
||||
#include "menudisplay.h"
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
#include "ledstrip.h"
|
||||
#include "globals.h"
|
||||
@ -21,8 +21,8 @@ public:
|
||||
};
|
||||
|
||||
class ledstripOtaAnimationChangeMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public espgui::StaticText<TEXT_BLINKANIMATION>
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_BLINKANIMATION>
|
||||
{
|
||||
public:
|
||||
ledstripOtaAnimationChangeMenu();
|
||||
|
@ -7,48 +7,49 @@
|
||||
#include "icons/back.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "utils.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "displays/menus/settingsmenu.h"
|
||||
|
||||
namespace {
|
||||
using IMotMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_IMOTMAX>,
|
||||
IMotMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LimitsSettingsMenu>
|
||||
>;
|
||||
using IDcMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_IDCMAX>,
|
||||
IDcMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LimitsSettingsMenu>
|
||||
>;
|
||||
using NMotMaxKmhChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_NMOTMAXKMH>,
|
||||
NMotMaxKmhAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LimitsSettingsMenu>
|
||||
>;
|
||||
using NMotMaxRpmChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_NMOTMAX>,
|
||||
NMotMaxRpmAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LimitsSettingsMenu>
|
||||
>;
|
||||
using FieldWeakMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_FIELDWEAKMAX>,
|
||||
FieldWeakMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
espgui::SwitchScreenAction<LimitsSettingsMenu>
|
||||
>;
|
||||
using PhaseAdvMaxChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int16_t>,
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticText<TEXT_PHASEADVMAX>,
|
||||
PhaseAdvMaxAccessor,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LimitsSettingsMenu>>,
|
||||
|
@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "menudisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
#include "texts.h"
|
||||
|
||||
class LimitsSettingsMenu :
|
||||
public espgui::MenuDisplay,
|
||||
public BobbyMenuDisplay,
|
||||
public espgui::StaticText<TEXT_LIMITSSETTINGS>
|
||||
{
|
||||
public:
|
||||
|
@ -9,13 +9,14 @@
|
||||
#include "changevaluedisplay.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "globals.h"
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "displays/menus/boardcomputerhardwaresettingsmenu.h"
|
||||
|
||||
namespace {
|
||||
using LockscreenPinDigit0ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int8_t>,
|
||||
BobbyChangeValueDisplay<int8_t>,
|
||||
espgui::StaticText<TEXT_PINDIGIT0>,
|
||||
LockscreenPinDigitAccessor<0>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LockscreenSettingsMenu>>,
|
||||
@ -23,7 +24,7 @@ using LockscreenPinDigit0ChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using LockscreenPinDigit1ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int8_t>,
|
||||
BobbyChangeValueDisplay<int8_t>,
|
||||
espgui::StaticText<TEXT_PINDIGIT1>,
|
||||
LockscreenPinDigitAccessor<1>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LockscreenSettingsMenu>>,
|
||||
@ -31,7 +32,7 @@ using LockscreenPinDigit1ChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using LockscreenPinDigit2ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int8_t>,
|
||||
BobbyChangeValueDisplay<int8_t>,
|
||||
espgui::StaticText<TEXT_PINDIGIT2>,
|
||||
LockscreenPinDigitAccessor<2>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LockscreenSettingsMenu>>,
|
||||
@ -39,7 +40,7 @@ using LockscreenPinDigit2ChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
|
||||
using LockscreenPinDigit3ChangeScreen = espgui::makeComponent<
|
||||
espgui::ChangeValueDisplay<int8_t>,
|
||||
BobbyChangeValueDisplay<int8_t>,
|
||||
espgui::StaticText<TEXT_PINDIGIT3>,
|
||||
LockscreenPinDigitAccessor<3>,
|
||||
espgui::BackActionInterface<espgui::SwitchScreenAction<LockscreenSettingsMenu>>,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user