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

feat(cpn): Add radio sort order edit and sorting models list by any column #3659

Merged
merged 2 commits into from
Jun 22, 2023

Conversation

elecpower
Copy link
Collaborator

@elecpower elecpower commented Jun 5, 2023

Fixes #3033 #3546

Summary of changes:

  • add support for editing radio sort order (color radios only) Note: independent of models list sort order
  • add support for sorting models list by any column in ascending or descending order
  • housekeeping:
    replace depreciated macro Q_DECL_OVERRIDE with override keyword
    replace NULL with nullptr
    stubs for model list label filtering (separate PR)

New color radio model list
After

Sort by RX# indicator
after2

New B&W radio model list
after bw

Sort by name indicator
after bw2

@elecpower elecpower added enhancement ✨ New feature or request companion Related to the companion software labels Jun 5, 2023
@elecpower elecpower linked an issue Jun 5, 2023 that may be closed by this pull request
@robustini
Copy link
Contributor

robustini commented Jun 21, 2023

@elecpower thanks!
This fix your previous commits?
I have tried a recent compiled version but I see no possibility of effecting sorting.

@elecpower
Copy link
Collaborator Author

@elecpower thanks!
This fix your previous commits?
I have tried a recent compiled version but I see no possibility of effecting sorting.

This adds to previous commits.
If you mean radio sorting drop down not showing, you need to stretch the dialog horizontally to make enough space to display the drop down in the toolbar.

@robustini
Copy link
Contributor

robustini commented Jun 21, 2023

@elecpower thanks!
This fix your previous commits?
I have tried a recent compiled version but I see no possibility of effecting sorting.

This adds to previous commits. If you mean radio sorting drop down not showing, you need to stretch the dialog horizontally to make enough space to display the drop down in the toolbar.

I've tried but I don't see anything.

immagine
immagine

@elecpower
Copy link
Collaborator Author

Try dragging the Model toolbar below Radio Settings toolbar as my screenshot or keep stretching.

@robustini
Copy link
Contributor

Nothing can be moved or dragged here.

issue.mp4

@pfeerick
Copy link
Member

I not sure you're running this PR build - it says 2.9.0-main instead of 2.9.0-PR3659 in that about screen...

@robustini
Copy link
Contributor

robustini commented Jun 21, 2023

I not sure you're running this PR build - it says 2.9.0-main instead of 2.9.0-PR3659 in that about screen...

Downloaded from Actions section, does the latest version also include all other previous fixes/commits?

@pfeerick
Copy link
Member

Thank link goes to PR#3501. A build for this PR would only include fixes as of two weeks ago, since it was added then and hasn't been rebased since.

@pfeerick
Copy link
Member

pfeerick commented Jun 21, 2023

@elecpower Are you happy enough with this PR to include it in 2.9?

@robustini
Copy link
Contributor

Thank link goes to PR#3501. A build for this PR would only include fixes as of two weeks ago, since it was added then and hasn't been rebased since.

That's the arcane revealed, thank you!
I thought the build was recent.

@pfeerick
Copy link
Member

If you're on Windows, you'll be able to pick up a build shortly, as this the build for this PR expired today. Generally best to go via the Checks tab at the top of the PR you're interested in testing to make sure you get offered the right file ;) I've been known to test the wrong version of stuff by not doing that 🤭

@elecpower
Copy link
Collaborator Author

+1 to testing wrong branch

@elecpower
Copy link
Collaborator Author

@elecpower Are you happy enough with this PR to include it in 2.9?

Yes. I should be around to fix my mistakes if any pop up in RCs. If any exist they'll likely be around drag drop and cut paste combination.

@pfeerick pfeerick self-assigned this Jun 21, 2023
@pfeerick pfeerick added this to the 2.9 milestone Jun 21, 2023
@pfeerick
Copy link
Member

pfeerick commented Jun 22, 2023

I did some quick drag'n'drop testing with a T-Pro ,and after confusing myself into thinking it wasn't working since the models had never been manually named, it seems to be working fine.

For colour (TX16S), I can't, but I presume this is because we basically can't "manually" order models, only via sorting? (just double checking I'm not missing something simple 😁 ). If so LGTM! :)

@elecpower
Copy link
Collaborator Author

This PR has sort always active.
B&W has the 'luxury' of slots so you can move models between slots and sort by slot column. Colour no such 'luxury'.
Since colour radios have option for No Order then I suppose Companion should also. I'll see how cumbersome this would be to implement.

@pfeerick
Copy link
Member

pfeerick commented Jun 22, 2023

It's entirely up to you... ideally, could possibly add a "last opened" column for colorlcd, then, when you use the sort options, it would make the view match ... i.e. "Name up" would be make the name column sort ascending, "name down" make name column sort descending, etc, etc... but then that doesn't make sense given you can see all the labels, and depending on the label selected, you can only so x models... so the model list is going to be a bit of a mess whatever gets done until/if/when can also replicate the... active label view filter?

Also, I think "none" is only an option on radio atm until you actually select one of the sorts, then you're sorta stuck with them (pun not intended). So in one respect it's nice this lets you get back to that state, if for whatever reason you want to.

@elecpower
Copy link
Collaborator Author

Models list is now unsorted by default. Sorting is turned on and off by double clicking any column. When turned on the double clicked column will be sorted ascending. When turned off the model list will be returned to the unordered state.

@elecpower
Copy link
Collaborator Author

Last opened needs some thought as Companion does not read or write the Models section of the labels.yml file.

Models:
  model2.yml:
    hash: "710d00009c563938"
    name: "def"
    labels: ""
    bitmap: ""
    lastopen: 1682665936
  model3.yml:
    hash: "710d00009c563938"
    name: "xyz"
    labels: ""
    bitmap: ""
    lastopen: 1682665848

It is my understanding this section is rebuilt by the radio. Also there is the issue of the radio RTC date and time (I think it is EPOCH with no timezone or daylight savings adjustment or network time sync) so likely not much point trying to convert to display format. I feel we leave this to a later time.

@pfeerick
Copy link
Member

That seems to work just fine. And yes, definitely for a future effort.

@pfeerick pfeerick merged commit 42098ae into main Jun 22, 2023
@pfeerick pfeerick deleted the elecpower/cpn-sort-models-list branch June 22, 2023 23:07
pfeerick pushed a commit that referenced this pull request Jun 23, 2023
…olumn (#3659)

* feat(cpn): Add radio sort order edit (color) and sorting models list by any column (all)

* Add column double click to enable/disable model sorting (disabled by default)
pfeerick added a commit that referenced this pull request Jun 26, 2023
commit 865d34a
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Sat Jun 24 11:11:43 2023 +0200

    'oh boy' fix

commit c15cbf3
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Thu Jun 22 10:00:34 2023 +0200

    yaml update

commit a31e1e9
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Thu Jun 22 08:52:45 2023 +0200

    reuse !

commit d28be2d
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Thu Jun 22 08:39:32 2023 +0200

    yaml update

commit 7482fee
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Wed Jun 21 14:30:14 2023 +0200

    Fix possible muted on boot scenario

commit e51f686
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Wed Jun 21 12:27:37 2023 +0200

    compil fixes

commit fbde97f
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Wed Jun 21 12:18:11 2023 +0200

    Some compile fixes

commit fe08f71
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Wed Jun 21 11:12:19 2023 +0200

    User configurable audio mute

commit 5268ba0
Author: Peter Feerick <peter.feerick@gmail.com>
Date:   Sun Jun 25 20:37:41 2023 +1000

    chore: GH should be building 2.9 branch

commit 0f0e71e
Author: Peter Feerick <peter.feerick@gmail.com>
Date:   Sun Jun 25 20:02:14 2023 +1000

    chore: Add codename

commit 5ebd090
Author: philmoz <philmoz@users.noreply.github.com>
Date:   Sun Jun 25 15:09:46 2023 +1000

    fix: Rounding errors in ADC value calculation for 6POS switch (#3713)

commit 3ea236e
Author: Peter Feerick <peter.feerick@gmail.com>
Date:   Fri Jun 23 18:46:06 2023 +1000

    fix(sim): do not allow launching if no radio profiles found (#3712)

    * Test for existence of radio profiles and advise if not found

    * Fix message box title and move simulator name to constants

commit 41467e3
Author: Michael <mha1@users.noreply.github.com>
Date:   Fri Jun 23 05:52:54 2023 +0200

    chore: Remove rssiSource and use default value (#3643)

    * fixes #2552

    - remove edit option rssiSource
    - reset rssiOption to default (none) if carried over from OpenTX conversion

    * deleted rssiSource functional code Companion, simulator and radio

    * forgot one commented line

commit 7b509a7
Author: philmoz <philmoz@users.noreply.github.com>
Date:   Fri Jun 23 10:37:12 2023 +1000

    fix(cpn): Wrong input offset value saved to YAML if GV (#3707)

commit cee7393
Author: Neil Horne <neilh713@tpg.com.au>
Date:   Fri Jun 23 09:07:55 2023 +1000

    feat(cpn): Add radio sort order edit and sorting models list by any column (#3659)

    * feat(cpn): Add radio sort order edit (color) and sorting models list by any column (all)

    * Add column double click to enable/disable model sorting (disabled by default)

commit 470db43
Author: Michael <mha1@users.noreply.github.com>
Date:   Thu Jun 22 12:34:09 2023 +0200

    fix(color): Firmware update progress text stuck at device reset (#3704)

    * fixes #3695 flash progress

    * move init() to where it belongs (constructor)

commit 302bf3e
Author: richardclli <richard.li@ces.hk>
Date:   Thu Jun 22 13:14:12 2023 +0800

    fix: 3POS switches on certain radios not detecting all switch positions (#3568)

    * Quick and dirty fix for #3560.

    * Fixed build error.

    * Fixed problematic logic.

    * Code cleanup.

commit a1528db
Author: richardclli <richard.li@ces.hk>
Date:   Wed Jun 21 18:56:55 2023 +0800

    chore: Add EL18 specific build for v2.9 (#3539)

    * chore: Add EL18 specific firmware naming (#2609)

    * Added EL18 specific firmware naming.

    * fix: Update USB identifier

    * chore: Add to github builds

    * fix: Lowercase s in Flysky

    * chore: Reference EL18 specific firmware file

    Co-authored-by: Peter Feerick <peter.feerick@gmail.com>

    * chore(el18): Change default switch cfg to match production (#2675)

    * chore: no nightly build for this branch

commit 72c733c
Author: 3djc <lesitewebdejc@hotmail.com>
Date:   Tue Jun 20 11:32:12 2023 +0200

    fix: (re)enable time based mute for TX16S based on RM feedback (#3701)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
companion Related to the companion software enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different model-order after re-reading from TX Companion - Being able to sort models alphabetically
3 participants