Adding a factor to n1 gauge

Latest Information on Sim Innovation's flagship product Air Manager

Moderators: russ, Ralph

Message
Author
Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#11 Post by Jonti25 »

air manager gauges are correct as is / same data values as the sim panels. . It’s just finding an easier way to fine tune things rather than to change sim flight model which is not 100% correct.

User avatar
Sling
Posts: 5338
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Adding a factor to n1 gauge

#12 Post by Sling »

Jonti25 wrote: Thu Dec 07, 2023 3:18 pm just an idea to adjust values a few pc points as an easier way to get correct performance figures.
It’s really simple. You subscribe to say the Sim N1 data which will already be done if using an existing instrument and then just do whatever maths you want on the value before rotating the needle or displaying the value. You can even do non linear if you need to.

Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#13 Post by Jonti25 »

it might be really simple to an experienced user but someone new it’s actually not that simple (at to me). I can’t find any examples of this so even after starting to understand the concepts and methods by watching the videos (which is all good) without a code example it seems like i’m at the bottom of a mountain looking up… with no guide. If it is simple can you show me a code line that would be a starting point? That would probably help me take the first steps!

User avatar
Ralph
Posts: 8337
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Adding a factor to n1 gauge

#14 Post by Ralph »

Maybe you can start with posting a script here.

Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#15 Post by Jonti25 »

This is the gauge script I was using to learn on. I'm presuming there is a way to change the ("%.01f",n1) value....


-- Robinson R66 N1 %RPM --
--------------------------------------------
-- Load and display images --
--------------------------------------------
img_add_fullscreen("background.png")
img_needle = img_add("needle.png", 10, 10, 380, 380)
img_add_fullscreen("cap.png")

txt_n1 = txt_add( "0.0", "size:60px; color: green; halign:right;", -5, 260, 380, 380)


---------------
-- Functions --
---------------

function new_data_xpl(n1)

n1 = var_cap(n1[1], 0, 110)
rotate(img_needle, -40 + (260 / 110 * n1) )

end

function new_data_fsx(n1)

n1 = var_cap(n1, 0, 110)
rotate(img_needle, -82 + (260 / 122 * n1) )

txt_set(txt_n1, string.format ("%.01f", n1) )



end

-------------------
-- Bus subscribe --
-------------------
xpl_dataref_subscribe("sim/cockpit2/engine/indicators/N1_percent", "FLOAT[8]", new_data_xpl)
fsx_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)
fs2020_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)

User avatar
Ralph
Posts: 8337
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Adding a factor to n1 gauge

#16 Post by Ralph »

Please use </> code brackets next time. Would be nice to know which flight simulator you're using.

Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#17 Post by Jonti25 »

FSX

I just copied it from the screen - i don’t know what happened to the code brackets

Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#18 Post by Jonti25 »

Thanks to everyone for the pointers and help - I have now figured out how to do this / indeed simple once you know how... Thank you.

User avatar
Ralph
Posts: 8337
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Adding a factor to n1 gauge

#19 Post by Ralph »

It is, it's just basic math :)

Jonti25
Posts: 12
Joined: Thu Dec 07, 2023 12:40 pm

Re: Adding a factor to n1 gauge

#20 Post by Jonti25 »

yes, very basic - the problem was i did not know where to insert it - but I do now, small steps…! I think I was also overthinking what what actually was required.

Post Reply