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

Remove itemIndex dependency from renderer #234

Merged

Conversation

forntoh
Copy link
Owner

@forntoh forntoh commented Oct 6, 2024

Description

Remove itemIndex dependency from renderer as it is internal information of MenuScreen
Reported by @ShishkinDmitriy


Checklist

General Requirements

  • I have kept this PR in draft until all the required tasks are completed.
  • I have reviewed the contributing guidelines for this project.
  • I have checked that this PR does not introduce any breaking changes unless explicitly stated.
  • I have checked that changes generate no new warnings.
  • I have performed a self-review of my own code

Feature/Enhancement

  • This PR is a new feature/enhancement
  • I have tagged this PR with enhancement.
  • I have included an example sketch file.
  • I have commented my code thoroughly.
  • I have added documentation for the new feature.
  • I have generated and reviewed the documentation locally.
  • I have created a functionality test to validate the new feature.

@forntoh forntoh force-pushed the patch/remove-item-index-from-renderer branch from e75280a to 93f7368 Compare October 6, 2024 21:35
Simplify scroll marking logic by updating functions for hidden items.
@forntoh forntoh force-pushed the patch/remove-item-index-from-renderer branch from e626f50 to 52a2436 Compare October 6, 2024 21:42
- Updated scroll indicator methods in MenuScreen class
- Refactored padding function in CharacterDisplayRenderer class
@forntoh forntoh mentioned this pull request Oct 6, 2024
13 tasks
@forntoh forntoh marked this pull request as ready for review October 6, 2024 22:27
@forntoh forntoh enabled auto-merge October 6, 2024 22:50
@forntoh forntoh added the enhancement Improve readability/performance/maintainability label Oct 6, 2024
@forntoh forntoh added this to the LcdMenu v5.1.0 milestone Oct 6, 2024
Repository owner deleted a comment from github-actions bot Oct 6, 2024
Repository owner deleted a comment from github-actions bot Oct 6, 2024
Repository owner deleted a comment from github-actions bot Oct 6, 2024
Repository owner deleted a comment from github-actions bot Oct 6, 2024
Repository owner deleted a comment from github-actions bot Oct 6, 2024
Copy link
Contributor

github-actions bot commented Oct 6, 2024

Memory usage change @ 036ea4f

Board flash % RAM for global variables %
arduino:avr:uno 🔺 +66 - +114 +0.2 - +0.35 🔺 +1 - +1 +0.05 - +0.05
Click for full report table
Board examples/Basic
flash
% examples/Basic
RAM for global variables
% examples/ButtonAdapter
flash
% examples/ButtonAdapter
RAM for global variables
% examples/ButtonWithRotaryAdapter
flash
% examples/ButtonWithRotaryAdapter
RAM for global variables
% examples/Callbacks
flash
% examples/Callbacks
RAM for global variables
% examples/CharsetInput
flash
% examples/CharsetInput
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 114 0.35 1 0.05 84 0.26 1 0.05 66 0.2 1 0.05 98 0.3 1 0.05 68 0.21 1 0.05 68 0.21 1 0.05 90 0.28 1 0.05 114 0.35 1 0.05 68 0.21 1 0.05 112 0.35 1 0.05 114 0.35 1 0.05 94 0.29 1 0.05 68 0.21 1 0.05 96 0.3 1 0.05 110 0.34 1 0.05
Click for full report CSV
Board,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%,examples/ButtonAdapter<br>flash,%,examples/ButtonAdapter<br>RAM for global variables,%,examples/ButtonWithRotaryAdapter<br>flash,%,examples/ButtonWithRotaryAdapter<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/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,114,0.35,1,0.05,84,0.26,1,0.05,66,0.2,1,0.05,98,0.3,1,0.05,68,0.21,1,0.05,68,0.21,1,0.05,90,0.28,1,0.05,114,0.35,1,0.05,68,0.21,1,0.05,112,0.35,1,0.05,114,0.35,1,0.05,94,0.29,1,0.05,68,0.21,1,0.05,96,0.3,1,0.05,110,0.34,1,0.05

…r class.

This change removes the itemCount variable from both the draw method in MenuScreen and the MenuRenderer class.
Copy link
Contributor

github-actions bot commented Oct 6, 2024

Memory usage change @ 35b26a3

Board flash % RAM for global variables %
arduino:avr:uno 🔺 +70 - +118 +0.22 - +0.37 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Basic
flash
% examples/Basic
RAM for global variables
% examples/ButtonAdapter
flash
% examples/ButtonAdapter
RAM for global variables
% examples/ButtonWithRotaryAdapter
flash
% examples/ButtonWithRotaryAdapter
RAM for global variables
% examples/Callbacks
flash
% examples/Callbacks
RAM for global variables
% examples/CharsetInput
flash
% examples/CharsetInput
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 118 0.37 0 0.0 88 0.27 0 0.0 70 0.22 0 0.0 102 0.32 0 0.0 72 0.22 0 0.0 72 0.22 0 0.0 94 0.29 0 0.0 118 0.37 0 0.0 72 0.22 0 0.0 116 0.36 0 0.0 118 0.37 0 0.0 98 0.3 0 0.0 72 0.22 0 0.0 100 0.31 0 0.0 114 0.35 0 0.0
Click for full report CSV
Board,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%,examples/ButtonAdapter<br>flash,%,examples/ButtonAdapter<br>RAM for global variables,%,examples/ButtonWithRotaryAdapter<br>flash,%,examples/ButtonWithRotaryAdapter<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/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,118,0.37,0,0.0,88,0.27,0,0.0,70,0.22,0,0.0,102,0.32,0,0.0,72,0.22,0,0.0,72,0.22,0,0.0,94,0.29,0,0.0,118,0.37,0,0.0,72,0.22,0,0.0,116,0.36,0,0.0,118,0.37,0,0.0,98,0.3,0,0.0,72,0.22,0,0.0,100,0.31,0,0.0,114,0.35,0,0.0

@forntoh forntoh merged commit 30659da into feature/menu-renderer Oct 7, 2024
16 checks passed
@forntoh forntoh deleted the patch/remove-item-index-from-renderer branch October 7, 2024 06:52
@github-actions github-actions bot mentioned this pull request Oct 7, 2024
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve readability/performance/maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants