edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

feat: add inverted sources

Open elecpower opened this issue 11 months ago • 14 comments

Summary of Changes

As a pre-requisite for #4452 add the ability to invert a 'Source'.

Currently supports Inputs, Mixes, Logical Switches and Special/Global functions.

TODO:

  • [x] B&W UI
  • [x] Companion support
  • [ ] Add other 'Sources'

Companion changes: The Companion refactor changes RawSource index from zero to one based to support negative indexes (as RawSwitch).

The opportunity was taken to undertake some overdue housekeeping of RawSource and move timers from source type Special to new Timers. Also rename legacy type SOURCE_TYPE_STICK to SOURCE_TYPE_INPUT as more appropriate.

elecpower avatar Mar 11 '24 09:03 elecpower

It might be easier for me to revert my Companion changes and rebase my PR to this PR.

I'll have a play with it later in the week.

philmoz avatar Mar 11 '24 09:03 philmoz

I need to 'merge' #4735 into this one

elecpower avatar Mar 13 '24 20:03 elecpower

Merge of 4735 done

elecpower avatar Mar 17 '24 18:03 elecpower

@elecpower When you have a chance can you rebase this to current main. I'd like to continue testing in conjunction with the radio side changes.

philmoz avatar Mar 25 '24 03:03 philmoz

@elecpower When you have a chance can you rebase this to current main. I'd like to continue testing in conjunction with the radio side changes.

Request noted

elecpower avatar Mar 25 '24 04:03 elecpower

@philmoz rebased

elecpower avatar Mar 25 '24 20:03 elecpower

Looks good, thanks. If you're ok with it, I will add the radio side changes to this PR.

philmoz avatar Mar 25 '24 23:03 philmoz

I'm okay with you adding your changes.

elecpower avatar Mar 26 '24 00:03 elecpower

I have merged the radio changes into this PR, I will close 4513 in favour of the one. I think this is ready for review.

philmoz avatar Mar 26 '24 03:03 philmoz

Might be a good idea to include the other PR's summary above and remove my what happens next.

elecpower avatar Mar 26 '24 05:03 elecpower

@elecpower - when you have a chance can you please check the rebase to make sure I haven't messed anything up.

philmoz avatar Apr 09 '24 03:04 philmoz

@elecpower - when you have a chance can you please check the rebase to make sure I haven't messed anything up.

Will check out now I have Cloudbuild in a testable state.

elecpower avatar Apr 11 '24 22:04 elecpower

@philmoz rebase okay but I have found some more areas where some fixes are required due to the +1 shift:

  • Conversion of Timers 1 - 3
  • Conversion of SF Adjust GV and when using a GV 1 - 9
  • Conversion 6 pos switches are wrong in the GUI dropdown lists due to hardware settings - this is a ADC refactor caused issue with incorrect type being set #4876. This has a flow on affect to model settings as they are imported. I'll need to create a new PR to fix v2.10-rc3 too.

I'll fix these with individual commits

elecpower avatar Apr 13 '24 22:04 elecpower

Refer PR #4890 for last part of fixes

elecpower avatar Apr 17 '24 21:04 elecpower

Thanks for the rebase @philmoz ... am I right in the assumption it is ready for review?

pfeerick avatar May 19 '24 03:05 pfeerick

Thanks for the rebase @philmoz ... am I right in the assumption it is ready for review?

I think so.

philmoz avatar May 19 '24 03:05 philmoz

Possibly issues from all the rebases - will take a look.

philmoz avatar May 23 '24 09:05 philmoz

Colorlcd (TX16S):

  • "Invert" button seems to be a couple pixels too far down and to the right, means the toolbar moves when you press the button

Generally:

  • SF -> Adjust -> GV# -> mixer source : inverted source does not survive power cycle
  • LS -> a>x seems generally broken visually - colourlcd won't let me set V2 values any more - shows !GPS instead of 0, bw128 shows wrong V1 on overview
  • bw128 EM'd when paging from curves to LS screen with above config after having written it via Companion, or after attempting to configure it on radio and exiting edit page.
  • bw212 appears to be missing implementation of showing ! but it is marked as a TODO

These should be fixed now.

philmoz avatar May 23 '24 11:05 philmoz

BW128: LS -> a<x V1 does not show invert option. That said, I'm unsure if this is an issue or not, since you can always choose your V2 accordingly. But I feel it should be there.

3djc avatar May 23 '24 13:05 3djc

BW128: LS -> a<x V1 does not show invert option. That said, I'm unsure if this is an issue or not, since you can always choose your V2 accordingly. But I feel it should be there.

It's working for me - can you share an image of where it's wrong for you.

philmoz avatar May 23 '24 21:05 philmoz

Looking a lot better, thanks! :)

I think I caught it happening... on both bw128 and bw212, the "Invert" option falls off the popup menu if "Telemetry" item is present... ie. it will work just fine with a blank model, but seems as if it has telemetry sensors the option is never visible.

Without telem

image

With telem

image

bw212 inputs screen needs to learn to show ! also... rest of the screens seem to fine (inverted but no !)

image

common to both bw128 and 212 is that with some inverted inputs the V2 field changes it's units incorrectly... i.e. I have seen it show "0.0V" for one input, and can get this to happen in simulator (V2 field is blank, but somehow editable).

image

pfeerick avatar May 23 '24 23:05 pfeerick

Looking a lot better, thanks! :)

I think I caught it happening... on both bw128 and bw212, the "Invert" option falls off the popup menu if "Telemetry" item is present... ie. it will work just fine with a blank model, but seems as if it has telemetry sensors the option is never visible.

bw212 inputs screen needs to learn to show ! also... rest of the screens seem to fine (inverted but no !)

common to both bw128 and 212 is that with some inverted inputs the V2 field changes it's units incorrectly... i.e. I have seen it show "0.0V" for one input, and can get this to happen in simulator (V2 field is blank, but somehow editable).

I think these are fixed now.

philmoz avatar May 24 '24 03:05 philmoz