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

Lua script : slow up/dw precision not preserved with model.insertMix #5873

Closed
1 task done
Gjeremie opened this issue Feb 7, 2025 · 6 comments · Fixed by #5874
Closed
1 task done

Lua script : slow up/dw precision not preserved with model.insertMix #5873

Gjeremie opened this issue Feb 7, 2025 · 6 comments · Fixed by #5874
Labels
bug 🪲 Something isn't working lua

Comments

@Gjeremie
Copy link

Gjeremie commented Feb 7, 2025

Is there an existing issue for this problem?

  • I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

When we copy a mixer line and insert it as a new line WITH A LUA SCRIPT (telemetry script) the precision 0.00 of the slow up/dn is resetted to 0.0 in the new mixer line.

Expected Behavior

the precision slow up/dn precision of 0.00 must be preserved

Steps To Reproduce

1- in edgetx the mixer line for slow up/dn precision is setted to 0.00

2- add a new line to the channel with a lua script

tab = model.getMix(19, 1) -- copy the first mixer line into the Table  "tab"
model.insertMix(19, 2, tab) -- Insert the mixer line ("tab") in the second line of the channel

3- in edgetx open the mixer line : the slow up/dn precision is resetted to 0.0

Version

2.10.5

Transmitter

RadioMaster MT12

Operating System (OS)

No response

OS Version

No response

Anything else?

No response

@Gjeremie Gjeremie added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Feb 7, 2025
@pfeerick pfeerick added lua and removed triage Bug report awaiting review / sorting labels Feb 7, 2025
@pfeerick
Copy link
Member

pfeerick commented Feb 7, 2025

Looks like luaModelGetMix() doesn't pull in the value of speedPrec and then luaModelInsertMix() doesn't write it.

@pfeerick
Copy link
Member

pfeerick commented Feb 7, 2025

The linked PR appears to resolve this, and will be part of 2.11 and also pushed to 2.10 so it is present in the next update forthat branch. Just some notes / clarification regarding the snippets of code provided:

tab = model.getMix(19, 1) -- copy the first mixer line into the Table  "tab"

Counting starts from 0 (i.e. CH1 = 0), not 1. So this line reads CH20, line 2.

model.insertMix(19, 2, tab) -- Insert the mixer line ("tab") in the second line of the channel

Here, we are inserting into CH20, line 3.

@Gjeremie
Copy link
Author

Gjeremie commented Feb 8, 2025

Thanks for the fix.

Yes I made a mistake in the comment for the line number.

@Gjeremie
Copy link
Author

Gjeremie commented Feb 8, 2025

And I think there is the same problem with the delay precision in the mixers

@pfeerick
Copy link
Member

pfeerick commented Feb 8, 2025

Thanks, yes, the same problem exists for main (2.11), but not for 2.10, as delay precision is not a feature included in 2.10

@Gjeremie
Copy link
Author

Thank you for the fix, I flashed the nightly of the 9 february 2025 and the precision 0.00 works perfect now.

BUT I have another issue , see : #5782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working lua
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants