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

Position OSD Elements via Script #463

Merged
merged 1 commit into from
Dec 20, 2022
Merged

Position OSD Elements via Script #463

merged 1 commit into from
Dec 20, 2022

Conversation

druckgott
Copy link
Contributor

I added a new page where all osd elements are listet and you can select via the first filed by changing the number up and down each osd element.
On the lower area you can see the name of the osd element and more lower you can see the position value and the profil where this osd element is visible.

You can change the position and also the profil and then save the value and the osd will be updated.

@druckgott druckgott closed this Dec 5, 2022
@druckgott druckgott reopened this Dec 5, 2022
@druckgott
Copy link
Contributor Author

I did something wrong I think, I want to remove all commits expect the last two how descriped here:
#457 (comment)
But anyting go wrong.
I change from the 9 commits listed only the 3 one I do not want to have to fixup and then I pushed again over cmd git: git push --force-with-lease
But then I see also old comits inside?! Do I have to change the git rebase -i HEAD9 to git rebase -i HEAD5 and then change pick to fixup only for the one I want to hold anymore?

@haslinghuis
Copy link
Member

@druckgott druckgott requested review from haslinghuis and klutvott123 and removed request for haslinghuis and klutvott123 December 7, 2022 15:42
@klutvott123
Copy link
Member

I'm trying this now, and I'm not sure I understand how it's supposed to work. I can't change anything. It goes through all retries and the changes won't take effect.

@druckgott
Copy link
Contributor Author

The Adress you can change to select the osd element you want to change.
The you have to go down to the line where the on off points are if all 3 points are off you will not see the element in the osd
If one of it is one you can see the element in the osd, this the first number you can change the position, if you are if you then save the osd element should be on a mother position if you atere in the right osd page.
So my idea was at first only to move a element if you see on the field it's not fitting perfekt lx you like it and you have no pc here.

@druckgott
Copy link
Contributor Author

druckgott commented Dec 8, 2022

Here is a Video
https://youtu.be/4ZpBPOYd2qk

@druckgott
Copy link
Contributor Author

I'm trying this now, and I'm not sure I understand how it's supposed to work. I can't change anything. It goes through all retries and the changes won't take effect.

Did you see the video? What system do you have for me it works perfekt, I have a taranis x light pro.

@klutvott123
Copy link
Member

Yes, I saw the video. I have a taranis qx7. Tested with fport and tracer. FC config is minimal. Just rx and osd enabled. I can make changes in the configurator and they show up in the script. It may be that my test setup is a little too minimal.

@druckgott
Copy link
Contributor Author

What I'm not sure if the addresses are always the same or if they depend what's aktivated for example gps, but I do not know how to read out the availible elements due to the config like the betaflight editor do. If anybody can help me there maybe that's better?!

src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/pages.lua Outdated Show resolved Hide resolved
@klutvott123
Copy link
Member

What I'm not sure if the addresses are always the same or if they depend what's aktivated for example gps, but I do not know how to read out the availible elements due to the config like the betaflight editor do. If anybody can help me there maybe that's better?!

They should be the same. I got it working here by clearing the values table before preparing the payload when saving. See one of the comments above for explanation.

@klutvott123
Copy link
Member

I'll just add that this doesn't work with ELRS because MSP_OSD_CONFIG results in a huge payload spread across more than 2 CRSF frames. Not much we can do about it here as it's a ELRS limitation.

@druckgott
Copy link
Contributor Author

druckgott commented Dec 11, 2022

I did most changes expect this two:

src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
@druckgott
Copy link
Contributor Author

I changed all the things, hopefully I get everything ;-). Thx for your good Ideas it helps me to improve my programming skills ;-).

@druckgott druckgott requested review from klutvott123 and removed request for haslinghuis December 17, 2022 09:02
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
src/SCRIPTS/BF/PAGES/pos_osd.lua Outdated Show resolved Hide resolved
@klutvott123
Copy link
Member

Almost there. Just some minor things that need fixing.
There are probably more optimizations that could be done here with regard to memory use, but it's ok for now I think.

@druckgott
Copy link
Contributor Author

hopefully all is ok now ;-)

@klutvott123
Copy link
Member

Looks good 🙂 Just need to squash/fixup to one commit now

@druckgott
Copy link
Contributor Author

Hopefully all is fine now, I´m not shure if I did everything right, but I hope only on commit is visible with the right input.

klutvott123
klutvott123 previously approved these changes Dec 19, 2022
Copy link
Member

@klutvott123 klutvott123 left a comment

Choose a reason for hiding this comment

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

Looks good to me 🙂

Comment on lines 146 to 148
local fieldThirdProfile = bit32.band(bit32.rshift(profiles, 1), 1)
local fieldFourthProfile = bit32.band(bit32.rshift(profiles, 2), 1)
return fieldPos, fieldFirstProfile, fieldThirdProfile, fieldFourthProfile
Copy link
Member

Choose a reason for hiding this comment

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

Logic stays the same but guess:

FieldFourthProfile should be FieldThirdProfile
FieldThirdProfile should be FieldSecondProfile

Copy link
Member

Choose a reason for hiding this comment

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

lol good catch. 🥇
@druckgott Please fix 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix tomorrow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It´s fixed

haslinghuis
haslinghuis previously approved these changes Dec 19, 2022
@druckgott druckgott dismissed stale reviews from haslinghuis and klutvott123 via d3fbbf9 December 20, 2022 07:41
Add Page for Position OSD Elements (Betaflight 4.4 MSP)

Add osd pos Page

Update pos_osd.lua

Update pages.lua

Update pos_osd.lua
@klutvott123 klutvott123 merged commit 0d0b60c into betaflight:master Dec 20, 2022
@druckgott druckgott deleted the druckgott-osd_pos branch December 20, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants