-
Notifications
You must be signed in to change notification settings - Fork 6
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
Truncate numerical values #46
Comments
Hmm, that is right. But I can't follow why splitting up a Value would be beneficial at all? I mean what would be the Reasoning behind displaying the Transponder on 4 different Buttons instead of 1? Have you considered looking into FlyWithLua? You could run some code There that would split up that Number and write it to 4 custom DataRefs (which then can be used like any other DataRef in the Plugin). |
FlyWithLua will work and I'll implement with that - thanks! However would
be nice if some more numerical manipulation/calculation methods were
implemented.
In my case I have a Stream Deck Plug and want to show one digit of the
transponder on each dial and use the dials to change the number
…On Thu, Jan 4, 2024 at 7:06 AM Fragtality ***@***.***> wrote:
Hmm, that is right. But I can't follow why splitting up a Value would be
beneficial at all? I mean what would be the Reasoning behind displaying the
Transponder on 4 different Buttons instead of 1?
Have you considered looking into FlyWithLua? You could run some code There
that would split up that Number and write it to 4 custom DataRefs (which
then can be used like any other DataRef in the Plugin).
—
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOGK3Y4JXIDWMO65JIZ6OLYM3ANTAVCNFSM6AAAAABBMAHMZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXGI2DMMRVGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Because you want it to be such a waste of Space? You could also work with an Encoder Stack. Like with the Radio-Action, but in that Case 4 Actions stacked. |
Haha hey no need to insult my setup ;-)
I have a folder just for the transponder (ident, Ta/ra, mode c) and all the
encoders sitting there unused 😁
…On Thu, Jan 4, 2024, 12:38 Fragtality ***@***.***> wrote:
Because you want it to be such a waste of Space?
You could also work with an Encoder Stack. Like with the Radio-Action, but
in that Case 4 Actions stacked.
—
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOGK3YCOB3CTLCYMNHUXO3YM4HMJAVCNFSM6AAAAABBMAHMZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXG4ZDSNRTG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Haha that wasn't the Intention 😅 Just wanted to make you aware that you can have it smaller, if you want to 😉 |
No worries, all good!
Do you collect profiles anywhere? I've got a fairly comprehensive one for
the Q4XP
…On Fri, Jan 5, 2024 at 5:18 AM Fragtality ***@***.***> wrote:
Haha that wasn't the Intention 😅
Just wanted to make you aware that you can have it smaller, if you want to
😉
—
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOGK3Y2RXBOZKX2JGQ6GZDYM74SBAVCNFSM6AAAAABBMAHMZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYGY2DONRXGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Well apart from my own Profiles (shared here or on fs/xp.to) I've added some User Contributions whom did not want to publish it theirself. So yeah, I could add it here on GitHub, but it would be way more discoverable/noticeable for others if you publish it on x-plane.to and/or x-plane.org (The Plugin itself is also published there) 😉 |
Hey jonestristand ! Did you figure out a way to do it without LUA ? I'm trying to do the same thing. Right now I have a setup with 4 encoder stack, but I want the thousands/hundreds/etc to be separate as well, juste for the cool factor and because I have no use for the two remaining dials :p |
I use FlyWithLua and this script: dataref("transponder_code", "sim/cockpit/radios/transponder_code", "readonly")
digits = create_dataref_table("mysim/cockpit/radios/transponder_digits", "IntArray")
function get_digit(value, digit)
return math.floor(math.abs(value) / 10 ^ digit) % 10
end
function split_transponder()
digits[0] = get_digit(transponder_code, 0)
digits[1] = get_digit(transponder_code, 1)
digits[2] = get_digit(transponder_code, 2)
digits[3] = get_digit(transponder_code, 3)
end
do_every_frame("split_transponder()") |
Awesome, thank you ! I was not familiar with LUA, didn't know it was so easy to read and understand :o |
Being able to truncate values would be useful in cases where someone doesn't have a registered/paid version of FSUIPC7 which is required to use LUA scripts. It's lazy I know, but there's a potential use case. |
Please test the current Development Build: https://github.com/Fragtality/PilotsDeck/blob/master/Install-PilotsDeck-latest.exe It added Support for truncating Values as part of the "Format" Option - or more specifically: being able to get the Substring of the Value. Things to Note:
|
Closed => Fixed (Value Format or Lua Values) |
I've created a display value button with an address of (A:TRANSPONDER CODE:1, Number) and a format of 3..1 With the sim transponder set to 0123, I would have expected the output to be 3, but it's 123? |
Yeah, typical off-by-one Error 🤦♂️ Fix will be committed when I've repaired SimConnect 😩 |
It would be very useful to be able to truncate a numerical value, for instance I can retrieve the transponder code from the dataref in xplane, but there's no way I can think of to get just the ones, or just the tens, or just the hundreds digit...
The text was updated successfully, but these errors were encountered: