Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/refactor items #221

Conversation

ShishkinDmitriy
Copy link
Collaborator

@ShishkinDmitriy ShishkinDmitriy commented Sep 20, 2024

I tried to rename methods from up/down/left/right into specific for item, something like more 'domain specific':

  • changeScreen for ItemBack and ItemSubMenu insted of enter.
  • commitCharEdit for ItemInputCharset instead of enter.

image

Also signature of process simplified and instead of Context pass only LcdMenu and char.
All required dependencies (display and current screen) can be obtained from menu.

Also true/false result for process method is controlled inside process method. Also simplified repeated if's

Also need somehow separate value update and draw.

Copy link
Contributor

Memory usage change @ 742f050

Board flash % RAM for global variables %
arduino:avr:uno 💚 -336 - -40 -1.04 - -0.12 💚 -8 - -2 -0.39 - -0.1
Click for full report table
Board examples/Basic
flash
% examples/Basic
RAM for global variables
% examples/Callbacks
flash
% examples/Callbacks
RAM for global variables
% examples/CharsetInput
flash
% examples/CharsetInput
RAM for global variables
% examples/DigitalInputAdapter
flash
% examples/DigitalInputAdapter
RAM for global variables
% examples/DigitalInputWithRotaryAdapter
flash
% examples/DigitalInputWithRotaryAdapter
RAM for global variables
% examples/InputRotary
flash
% examples/InputRotary
RAM for global variables
% examples/IntFloatValues
flash
% examples/IntFloatValues
RAM for global variables
% examples/ItemBack
flash
% examples/ItemBack
RAM for global variables
% examples/KeyboardAdapter
flash
% examples/KeyboardAdapter
RAM for global variables
% examples/List
flash
% examples/List
RAM for global variables
% examples/MenuTimeout
flash
% examples/MenuTimeout
RAM for global variables
% examples/RTOS
flash
% examples/RTOS
RAM for global variables
% examples/SimpleInput
flash
% examples/SimpleInput
RAM for global variables
% examples/SimpleRotary
flash
% examples/SimpleRotary
RAM for global variables
% examples/SubMenu
flash
% examples/SubMenu
RAM for global variables
%
arduino:avr:uno -44 -0.14 -2 -0.1 -52 -0.16 -4 -0.2 -300 -0.93 -4 -0.2 -40 -0.12 -4 -0.2 -336 -1.04 -8 -0.39 -328 -1.02 -8 -0.39 -128 -0.4 -4 -0.2 -72 -0.22 -6 -0.29 -300 -0.93 -4 -0.2 -118 -0.37 -4 -0.2 -44 -0.14 -2 -0.1 -72 -0.22 -6 -0.29 -146 -0.45 -4 -0.2 -188 -0.58 -8 -0.39 -64 -0.2 -4 -0.2
Click for full report CSV
Board,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%,examples/Callbacks<br>flash,%,examples/Callbacks<br>RAM for global variables,%,examples/CharsetInput<br>flash,%,examples/CharsetInput<br>RAM for global variables,%,examples/DigitalInputAdapter<br>flash,%,examples/DigitalInputAdapter<br>RAM for global variables,%,examples/DigitalInputWithRotaryAdapter<br>flash,%,examples/DigitalInputWithRotaryAdapter<br>RAM for global variables,%,examples/InputRotary<br>flash,%,examples/InputRotary<br>RAM for global variables,%,examples/IntFloatValues<br>flash,%,examples/IntFloatValues<br>RAM for global variables,%,examples/ItemBack<br>flash,%,examples/ItemBack<br>RAM for global variables,%,examples/KeyboardAdapter<br>flash,%,examples/KeyboardAdapter<br>RAM for global variables,%,examples/List<br>flash,%,examples/List<br>RAM for global variables,%,examples/MenuTimeout<br>flash,%,examples/MenuTimeout<br>RAM for global variables,%,examples/RTOS<br>flash,%,examples/RTOS<br>RAM for global variables,%,examples/SimpleInput<br>flash,%,examples/SimpleInput<br>RAM for global variables,%,examples/SimpleRotary<br>flash,%,examples/SimpleRotary<br>RAM for global variables,%,examples/SubMenu<br>flash,%,examples/SubMenu<br>RAM for global variables,%
arduino:avr:uno,-44,-0.14,-2,-0.1,-52,-0.16,-4,-0.2,-300,-0.93,-4,-0.2,-40,-0.12,-4,-0.2,-336,-1.04,-8,-0.39,-328,-1.02,-8,-0.39,-128,-0.4,-4,-0.2,-72,-0.22,-6,-0.29,-300,-0.93,-4,-0.2,-118,-0.37,-4,-0.2,-44,-0.14,-2,-0.1,-72,-0.22,-6,-0.29,-146,-0.45,-4,-0.2,-188,-0.58,-8,-0.39,-64,-0.2,-4,-0.2

src/ItemList.h Outdated Show resolved Hide resolved
src/ItemList.h Outdated Show resolved Hide resolved
src/ItemSubMenu.h Outdated Show resolved Hide resolved
src/MenuItem.h Outdated Show resolved Hide resolved
forntoh
forntoh previously approved these changes Sep 21, 2024
@forntoh forntoh enabled auto-merge (squash) September 21, 2024 08:52
@forntoh forntoh added this to the LcdMenu 5.0.0 milestone Sep 21, 2024
@forntoh forntoh merged commit 830fbf4 into forntoh:feature/move-control-to-items Sep 21, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Oct 7, 2024
17 tasks
@forntoh forntoh added the feature New feature label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants