Grob Tutor gauges coding
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Grob Tutor gauges coding
Hi everyone,
I'm in the process of creating a full set of Grob Tutor gauges (see example below), but the script code is alien to me.
I've tried watching the youtube videos, but i'm just not getting it quick enough.
I'm hoping there's someone out there that I could work with to get these working in P3D V4, please?
Many thanks in advance,
Dan
I'm in the process of creating a full set of Grob Tutor gauges (see example below), but the script code is alien to me.
I've tried watching the youtube videos, but i'm just not getting it quick enough.
I'm hoping there's someone out there that I could work with to get these working in P3D V4, please?
Many thanks in advance,
Dan
Re: Grob Tutor gauges coding
For this instrument you might want to watch this video: https://www.youtube.com/watch?v=gfABSyd5KsA
I would also suggest giving the needle some shadow, so it doesn't disappear in the background.
I would also suggest giving the needle some shadow, so it doesn't disappear in the background.
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Re: Grob Tutor gauges coding
thanks Ralph, that's a really useful video!
I'll give it a go and see where it gets me.
P.S. ignore the needle - i meant to turn off that layer before i saved it.
I'll give it a go and see where it gets me.
P.S. ignore the needle - i meant to turn off that layer before i saved it.
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Re: Grob Tutor gauges coding
ok, so based on your video (albeit not quite the same) i have the oil pressure working fine.
What do i do on the oil temp where the scale is going in the opposite direction?
thanks in advance,
Dan
What do i do on the oil temp where the scale is going in the opposite direction?
thanks in advance,
Dan
Re: Grob Tutor gauges coding
The rotation just needs to happen in the opposite direction. So work out the starting angle at 40C and the end angle at 130C and you then have the range as before. All you do is add or subtract the delta or some fraction of it to the staring angle.CI Dan Saxton wrote: ↑Mon Nov 05, 2018 7:41 pm ok, so based on your video (albeit not quite the same) i have the oil pressure working fine.
What do i do on the oil temp where the scale is going in the opposite direction?
thanks in advance,
Dan
Tony
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Re: Grob Tutor gauges coding
sorry...no idea...maths was never my strong point...
i can get somewhere close with this, but the angles just aren't quite right.
My angles are:
i can get somewhere close with this, but the angles just aren't quite right.
Code: Select all
if degrees > 40 then
img_rotate(img_oiltemp, 71 / 90 * 53 - (degrees - 130))
Code: Select all
-- oil temp degrees
-- oil temp degrees
-- 0°C = 140
-- 40°C = 124
-- 60°C = 113.5
-- 100°C = 76.5
-- 130°C = 53
Re: Grob Tutor gauges coding
It works exactly the same:
Code: Select all
if oiltemp > 100 then
rotate(img_oiltemp, 76.5 - (23.5 / 30 * (degrees - 100)) )
elseif oiltemp > 60 then
rotate(img_oiltemp, 113.5 - (37 / 40 * (degrees - 60)) )
etc....
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Re: Grob Tutor gauges coding
ok thanks for that - it's working fine now.
What's next?
1. gauge on/off depending on battery on/off?
2. other conditions that cause the gauge to fail?
2. lighting?
looking at the Cessna 172 gauge as a comparison, they've got lots of code in there which i dont understand.
Dan
What's next?
1. gauge on/off depending on battery on/off?
2. other conditions that cause the gauge to fail?
2. lighting?
looking at the Cessna 172 gauge as a comparison, they've got lots of code in there which i dont understand.
Dan
Re: Grob Tutor gauges coding
A very simple battery on/off would be like:
Code: Select all
if battery_on then
degrees = oil_temp_from_sim
else
degrees = 0
end
- CI Dan Saxton
- Posts: 51
- Joined: Mon Apr 30, 2018 4:07 pm
Re: Grob Tutor gauges coding
thanks again Ralph,
the Cessna 172 code for the equivalent gauges says the following....it looks like it's doing something with the images depending on the condition of something...should i be doing something similar?
the Cessna 172 code for the equivalent gauges says the following....it looks like it's doing something with the images depending on the condition of something...should i be doing something similar?
Code: Select all
---------------------------------------------
-- Properties --
---------------------------------------------
prop_BG = user_prop_add_boolean("Background",true,"Hide background?")
prop_DO = user_prop_add_boolean("Dimming overlay",false,"Enable dimming overlay?")
---------------------------------------------
-- Load and display images in Z-order --
-- Loaded images selectable with prop --
---------------------------------------------
img_add_fullscreen("OilPressTempFace.png")
img_oilt = img_add("needle3.png", -150, 0, 512, 512)
img_oilp = img_add("needle3.png", 150, 0, 512, 512)
if user_prop_get(prop_BG) == false then
img_add_fullscreen("OilPressTempCover.png")
else
img_add_fullscreen("OilPressTempCoverwBG.png")
end
if user_prop_get(prop_DO) == true then
img_add_fullscreen("dimoverlay.png")
end