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: use any source for expo/weight/offset etc #5220

Merged
merged 49 commits into from
Jul 26, 2024
Merged

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Jun 27, 2024

Fixes #4452

Time to continue with this change, now that source invert has been implemented.

Allows any source to be used in inputs and mixes for fields like weight, offset, expo, etc (not just GVars).

TODO

Radio:

  • Data structures
  • Save and load to YAML files
  • Mix calculations
  • Color UI
  • B&W UI
  • Fix tests

Companion:

  • Data structures
  • Save and load YAML files
  • UI for settings fields
  • Binary file conversion
  • Testing

@philmoz philmoz added the enhancement ✨ New feature or request label Jun 27, 2024
@philmoz philmoz added this to the 2.11 milestone Jun 27, 2024
@philmoz philmoz self-assigned this Jun 27, 2024
@3djc
Copy link
Collaborator

3djc commented Jun 27, 2024

I guess on BW UI, we can keep the long enter used previously to switch between value and gvar, to now switch between value and source

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 27, 2024

I guess on BW UI, we can keep the long enter used previously to switch between value and gvar, to now switch between value and source

I'm not sure how best to do this.
Once you've switched to 'Source' mode then you should be able to use the long press to open the popup menu to select source type. So how to switch back to non-source mode?

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 27, 2024

There is a discrepancy with 128x64 B&W radios.
Color and 212x64 radios allow the input/mix line Curve parameter to be set to a GV when the type is Diff or Expo.
This is not available on 128x64 B&W radios.

@pfeerick
Copy link
Member

pfeerick commented Jun 27, 2024

This is not available on 128x64 B&W radios.

Yes it is. You need to have the edit field active in order for the long press to toggle between value and GV works.

image
image
image

Once you've switched to 'Source' mode then you should be able to use the long press to open the popup menu to select source type. So how to switch back to non-source mode?

How about same way the Adjust GV source menu works... add it as another option to the popup menu?

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 28, 2024

This is not available on 128x64 B&W radios.

Yes it is. You need to have the edit field active in order for the long press to toggle between value and GV works.

Ok, so different to 212x64 B&W then. Long press always works.

@3djc
Copy link
Collaborator

3djc commented Jun 29, 2024

How about using long press to bring the choice list and add "Values" as a first entry

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 29, 2024

How about using long press to bring the choice list and add "Values" as a first entry

Yeah, that's what pfeerick suggested too.
I think 'Constant' would be better as that is what is used now for the Adjust SF.

Now I just have to figure out how to do it in the B&W UI.

@3djc
Copy link
Collaborator

3djc commented Jun 29, 2024

Your are obviously much better at English than me, but as a non native speaker, I associate "constant" more to things like MAX,MIN then a value you can change, but that's a detail really

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 29, 2024

Your are obviously much better at English than me, but as a non native speaker, I associate "constant" more to things like MAX,MIN then a value you can change, but that's a detail really

I would agree that 'Constant' is probably not the best choice; but it's already used for pretty much the same purpose.
screenshot_t20v2_24-06-29_16-32-14

@pfeerick
Copy link
Member

pfeerick commented Jun 29, 2024

I agree that "Constant" is not ideal, but consistency is important, so is the best fit. It could make even more sense here if a long press brings up a popup with constant, mixer source, gvar as options... although not sure that is needed - on second thoughts, it probably is... going from two choices (fixed value, GV) to three (fixed value, mixer source, GV) so no longer a simple long press to toggle.

@philmoz philmoz force-pushed the philmoz/use-any-source branch 4 times, most recently from 53c62e9 to 4d3c59e Compare July 4, 2024 10:01
@3djc
Copy link
Collaborator

3djc commented Jul 4, 2024

Starts to look really great, that's going to be a great addition for users. I guess that will require drawSource to support RIGHT alignement on 128 😨

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 5, 2024

I guess that will require drawSource to support RIGHT alignement on 128 😨

I'm assuming you used the popup on an Input weight/offset/curve and selected Inputs 😄
I've fixed it so this should no longer be possible.

@3djc
Copy link
Collaborator

3djc commented Jul 5, 2024

It's getting there :)
I'm still seeing this:
when using POT for weight (which is most likely scenario), it looks fine
image

but when using an input, it overwrites the (i)
image

Also,
image

creates
image

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 5, 2024

I've changed the drawSource calls to be left justified (too complex to try and add right justification).

@3djc
Copy link
Collaborator

3djc commented Jul 5, 2024

Yeah, first column invert for input and mix is a very nice change @philmoz
Ok, flashing this on my MT12, I want to use pot as weight for throttle, testing report soon

@3djc
Copy link
Collaborator

3djc commented Jul 5, 2024

The feature is really nice, I have setup a input with S1 as a source, with weight 25 and offset 55, which give me an output from 30 to 80.

I then assign the input as weight for Throttle, and I can adjust how much throttle I have directly from S1, not need for any special function or gvar use !

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 6, 2024

@elecpower Your expertise with Companion would be appreciated here.

@elecpower
Copy link
Collaborator

@philmoz ok

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 6, 2024

I'm thinking to extend the RawSource class to allow a 'numeric value' type; but not sure how complex this would be or if there is a better way.

@elecpower
Copy link
Collaborator

That was my 1st thought then quickly dismissed it as the global lookup list would need to include every possible numeric value and every one would have to be listed so totally unworkable.

My initial idea is to create a new shared group widget based on the existing one that handles the value, checkbox and combo. In source mode populate combo from global rawsource with context filter.

This will break binary import but it can be cajoled to map to a rawsource. So looking forward to dropping this legacy beast.

Give me a few days to get some time to work up a poc.

@philmoz
Copy link
Collaborator Author

philmoz commented Jul 25, 2024

I've added right justification to drawSource and changed the input and mix list back to being right aligned.

Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

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

Damn... that was fast! Thanks Phil & Neil! A quick retest of TX16S, X9D+, Boxer and Cpn... nothing is jumping out at me other than some trivial cosmetics in Cpn around the inputs/mixes dialogs resizing/contents moving slightly, but can be a later cleanup once things settle down again in the UI there.

@pfeerick pfeerick merged commit 4b917b7 into main Jul 26, 2024
50 checks passed
@pfeerick pfeerick deleted the philmoz/use-any-source branch July 26, 2024 10:51
@pfeerick pfeerick added the rn: feature Feature to be highlighted in release notes label Jul 26, 2024
@pfeerick pfeerick linked an issue Aug 2, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request rn: feature Feature to be highlighted in release notes
Projects
None yet
4 participants