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

Interactive/progressive checklist #3564

Merged
merged 22 commits into from
Aug 29, 2023
Merged

Interactive/progressive checklist #3564

merged 22 commits into from
Aug 29, 2023

Conversation

gagarinlg
Copy link
Member

@gagarinlg gagarinlg commented May 6, 2023

rebased, fixed and LVGL converted replacement for #1417

copied from #1417:
Summary of changes:
Adds an option to display check-boxes at the beginning of each checklist / model notes line.

  • Item to be currently processed has selected (active) check-box, confirmed item - selected checkbox, unconfirmed item - empty.
  • You can only advance by one in the checklist (by clicking ENTER - rotary encoder click).
  • You can normally scroll the checklist if it exceeds screen size and in addition it is automatically scrolled when currently processed item is at the bottom (or row above bottom) and there are more items available.
  • You can remove displaying and processing of some items by placing = sign as a first character in a line
  • You can mark only items, that are displayed on a screen (no off-screen item confirmation)
  • Interactive checklist loaded on model selection (and after reset flight) might be closed only when complete (additional ENTER click after last item completed), see Checkable preflight-checklist #133
  • Interactive checklist loaded from View Notes is closed by pressing EXIT/RTN, no check-boxes are displayed in the view.

Fixes #133

example checklist file

EdgeTX
=is
the
best
=and
=this
is interactive
checklist
=with some items disabled and now a very long line to test what happens then
EdgeTX
=is
the
best
=and
=this
is interactive
checklist
=with some items disabled

@gagarinlg gagarinlg added this to the 2.10 milestone May 6, 2023
@Eldenroot
Copy link
Contributor

Great! Thx for rebasing + other fixes :)

One of a long opened PR... really interesting new feature. There are more form @piotrva

@philmoz
Copy link
Collaborator

philmoz commented Jul 9, 2023

Model setup menu on B&W radios is broken. There are blank lines and the scrolling is not consistent.
The MENU_TAB array in menuModelSetup looks wrong.

Copy link
Collaborator

@philmoz philmoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be done for 212x64 as well.

@3djc
Copy link
Collaborator

3djc commented Jul 10, 2023

Needs to be done for 212x64 as well.

Indeed, was asked to fix 128, but yes, 212 was broken in several ways. Fixed it (but havent tested the feature itself at all on either platform)

@philmoz
Copy link
Collaborator

philmoz commented Jul 10, 2023

A couple of things;

  • On B&W radios the ENTER button exits the checklist after the last item is checked. On color radios the ENTER button toggles the last entry off again.
  • Long text lines do not wrap on either B&W or color radios.

I wonder if there should be a 'Close' button somewhere on the screen for color radios. It was not immediately obvious to me how to close the text viewer on a radio without hardware keys (NV14). This could trip up new users. A 'Close' button that only shows when the list is complete would also give something to focus on for the ENTER key to close the checklist.

Update: the issue with the checklist not loading on B&W radio startup is a simulator bug.

@philmoz
Copy link
Collaborator

philmoz commented Jul 11, 2023

I've made some changes to the color checklist code in PR #3787

@philmoz
Copy link
Collaborator

philmoz commented Jul 13, 2023

In PR #3787 I've indented the checkboxes for easier touch activation and also kept the 'RTN' button visible so the last checkbox is further away from the bottom of the screen.

Screenshot 2023-07-13 at 10 08 58 am

Screenshot 2023-07-13 at 10 08 31 am

@pfeerick pfeerick self-requested a review August 3, 2023 02:57
@Eldenroot
Copy link
Contributor

Maybe some graphic separation between check boxes when you use longer text?

@pfeerick
Copy link
Member

pfeerick commented Aug 3, 2023

Keeping in mind the list used to generate it was

is interactive
checklist
=with some items disabled and now a very long line to test what happens then
EdgeTX
=is

it may be better to first check what happens if there is a blank line. If that is correctly rendered, IMO it would be better to leave the formatting up to the checklist author.

@pfeerick
Copy link
Member

pfeerick commented Aug 3, 2023

i.e.
image

@Eldenroot
Copy link
Contributor

Yes, because when you have more lines and tge check box is aligned to the middle...it could be confusing.

@pfeerick
Copy link
Member

pfeerick commented Aug 5, 2023

This can be controlled by the checklist author... I added a blank line in the checklist file - at line 10, and it was correctly displayed. So if you want spaces, add them. And if you don't, don't put them in?

@raphaelcoeffic
Copy link
Member

@gagarinlg @pfeerick what is the status of this PR? Can we engage into the merge train?

@raphaelcoeffic raphaelcoeffic added enhancement ✨ New feature or request needs: rebase A git rebase on top of the latest destination branch version is required labels Aug 12, 2023
@raphaelcoeffic raphaelcoeffic marked this pull request as draft August 12, 2023 05:50
@gagarinlg
Copy link
Member Author

Should be OK after a rebase

@raphaelcoeffic
Copy link
Member

Should be OK after a rebase

will you?

@gagarinlg
Copy link
Member Author

Not this week

piotrva and others added 15 commits August 28, 2023 18:00
This is also crucial when it comes to analyse non-checkable items on a checklist, as in this way there is no need to load non-visible items from SD-card
… radios

currently no automatic line wrapping and you can always exit the checklist, even when it is not fully done
* Move checklist logic to sub-class.
Show model name instead of file name in title, show 'Preflight checks' in title2 for checklist.
Handle long line wrapping of text.
Don't indent lines without checkbox.
Add 'RTN' button when done.

* Code cleanup.

* Simplify code by storing a list of checkboxes instead of scanning LVGL object hierarchy.

* Indent checkboxes to make touch activation easier.
Keep 'RTN' button visible so last checkbox is further from bottom of screen (for touch activation).
'RTN' button is disabled until checklist complete.
@pfeerick pfeerick removed the needs: rebase A git rebase on top of the latest destination branch version is required label Aug 28, 2023
@pfeerick pfeerick marked this pull request as ready for review August 28, 2023 08:08
@pfeerick
Copy link
Member

@philmoz Did something change in the checkbox handling recently? When I did the rebase, I only needed to make two changes in preflight_checks.cpp due to the CheckBox -> ToggleSwitch name changing... i.e.

new CheckBox(line, rect_t{}, GET_SET_DEFAULT(g_model.checklistInteractive));

to

auto interactiveChkList = new ToggleSwitch(line, rect_t{}, GET_SET_DEFAULT(g_model.checklistInteractive));

But the checkboxes in the preflight checks text viewer are now not visible on TX16S 🤔

@philmoz
Copy link
Collaborator

philmoz commented Aug 28, 2023

But the checkboxes in the preflight checks text viewer are now not visible on TX16S 🤔

Needed a class constructor for the LVGL checkbox (for the libopenui refactor stuff).

For some reason the checkbox is slightly smaller with this version - still investigating as to why.

@pfeerick
Copy link
Member

Thanking you so much! :) I'll try and look at this in the morning, otherwise, it'll be tomorrow evening I'll be hoping to merge this in.

@pfeerick
Copy link
Member

Ok, is working good again. TX16S and TPro seem ok on repeat testing.

@pfeerick pfeerick merged commit 06712d9 into main Aug 29, 2023
39 checks passed
@pfeerick pfeerick deleted the bw-progressive-checklist branch August 29, 2023 09:18
3djc added a commit that referenced this pull request Sep 1, 2023
* initial version of clickable checklist

* do not display checkboxes for empty lines if checklist is shorter than screen size

* remove checklist exit after completing it
cannot exit menu from menuTextView as level above there is while loop that cannot be stopped from thic place in code

* menu entry to enable and disable interactive checklist

* only when complete interactive checklist is closed

* config updated & not display checkboxes when entered from "View Notes"

* add setup entry for colorlcd

* do not make interactive checkist when loaded from menu

* fix datastruct size after merge

* Companion support for interactive checklist

* mark checklist lines as non-checkable with '=' for B&W radios

* Process only items visible on screen
This is also crucial when it comes to analyse non-checkable items on a checklist, as in this way there is no need to load non-visible items from SD-card

* WIP fix merge problems

* update yaml datastructs

* restore most functionalities for interactive check lists on color LCD radios
currently no automatic line wrapping and you can always exit the checklist, even when it is not fully done

* finalise interactive checklists for color LCD

* fix: rebase/merge issues

* fix: model setup checklist section

* fix: fix 212 model setup

* Re-work of the some of the color lcd checklist code (#3787)

* Move checklist logic to sub-class.
Show model name instead of file name in title, show 'Preflight checks' in title2 for checklist.
Handle long line wrapping of text.
Don't indent lines without checkbox.
Add 'RTN' button when done.

* Code cleanup.

* Simplify code by storing a list of checkboxes instead of scanning LVGL object hierarchy.

* Indent checkboxes to make touch activation easier.
Keep 'RTN' button visible so last checkbox is further from bottom of screen (for touch activation).
'RTN' button is disabled until checklist complete.

* Add checkbox class constructor for preflight checks.

* Fix checkbox size.

---------

Co-authored-by: Piotr Rzeszut <[email protected]>
Co-authored-by: 3djc <[email protected]>
Co-authored-by: philmoz <[email protected]>
Co-authored-by: Phil Mitchell <[email protected]>
@pfeerick pfeerick mentioned this pull request Mar 11, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkable preflight-checklist
7 participants