PA-30 Twin Comanche Gauges

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Message
Author
Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

PA-30 Twin Comanche Gauges

#1 Post by Jdleonr »

How's it going,
Could someone help me, I'm trying to make a Fuel Flow instrument from a Piper PA-30 Twin Comanche, but I can't understand very well the process of creating an instrument, could someone help me?

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: PA-30 Twin Comanche Gauges

#2 Post by jph »

Search for an obscure new website called youtube, then search for Air Manager, then watch ALL the videos, yes yes, some are REALLY boring with too many 'errrs' in, but you will learn something. Then read through the forums here, then look at some sample instruments.. that should keep you occupied for a while
Joe. CISSP, MSc.

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

Re: PA-30 Twin Comanche Gauges

#3 Post by Ralph »

It would indeed be good to try most of it yourself, so you learn how it works. And realize that it isn't hard but just takes time ;)

What do you have so far? Images?

Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

Re: PA-30 Twin Comanche Gauges

#4 Post by Jdleonr »

ok, now i have the images and i am trying with part of the code taking as an example a normal fuel flow meter

Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

Re: PA-30 Twin Comanche Gauges

#5 Post by Jdleonr »

and if I'm watching all the videos

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: PA-30 Twin Comanche Gauges

#6 Post by SimPassion »

 
Here's a sample one from Milviz :

image.png
image.png (239.21 KiB) Viewed 984 times

a very similar from Air Manager Online Store download, is this one from William Hayes :

image.png
image.png

Code: Select all

---------------------------------------------
--   Properties                            --
---------------------------------------------
prop_BG = user_prop_add_boolean("Background Display", true, "Display background")

-------------------------------------
--     Load and display images     --
-------------------------------------
if user_prop_get(prop_BG) then
    img_add_fullscreen("fuel_flow_bg.png")
end    
img_add_fullscreen("fuel_flow_gauge.png")

pointer1 = img_add("pointer.png", 239, 60, 34, 204)
pointer2 = img_add("pointer.png", 239, 60, 34, 204)

rotate(pointer1, 188.4, 17, 194, 0)
rotate(pointer2, 171.6, 17, 194, 0)

img_add_fullscreen("black_bar_overlay.png")

-------------------------------------
--          Rotate Needles         --
-------------------------------------
function ff_data(ff_1, ff_2)

    calc_ff_1 = 188.4 + ((0.0162 * ff_1^3) - (0.0646 * ff_1^2) + (4.386 * ff_1)) 
    calc_ff_2 = 171.6 - ((0.0162 * ff_2^3) - (0.0646 * ff_2^2) + (4.386 * ff_2)) 

    rotate(pointer1, calc_ff_1, 17, 194, 0)
    rotate(pointer2, calc_ff_2, 17, 194, 0)
    
end

function ff_data_xpl(xpl_data)

    ff_1 = ((xpl_data[1] * 3600 * 2.20462) / 6.01) --convert xpl data in kg per sec to gal per hour
    ff_2 = ((xpl_data[2] * 3600 * 2.20462) / 6.01) --convert xpl data in kg per sec to gal per hour

    calc_ff_1 = 188.4 + ((0.0162 * ff_1^3) - (0.0646 * ff_1^2) + (4.386 * ff_1)) 
    calc_ff_2 = 171.6 - ((0.0162 * ff_2^3) - (0.0646 * ff_2^2) + (4.386 * ff_2))

    rotate(pointer1, calc_ff_1, 17, 194, 0)
    rotate(pointer2, calc_ff_2, 17, 194, 0)
    
end

-------------------------------------
--       Data Subscription         --
-------------------------------------

fsx_variable_subscribe("ENG FUEL FLOW GPH:1", "Gallons per hour", 
                       "ENG FUEL FLOW GPH:2", "Gallons per hour", ff_data)

fs2020_variable_subscribe("ENG FUEL FLOW GPH:1", "Gallons per hour", 
                          "ENG FUEL FLOW GPH:2", "Gallons per hour", ff_data)

xpl_dataref_subscribe("sim/flightmodel/engine/ENGN_FF_","FLOAT[8]", ff_data_xpl)

Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

Re: PA-30 Twin Comanche Gauges

#7 Post by Jdleonr »

What's up, I couldn't find the images so I started to create them in inkscape, I share them below, then I export it to PNG and when I run the images it gives me a blank instrument, any suggestion what it could be?

Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

Re: PA-30 Twin Comanche Gauges

#8 Post by Jdleonr »

path111.png

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: PA-30 Twin Comanche Gauges

#9 Post by SimPassion »

Jdleonr wrote: Sat Oct 08, 2022 7:17 pm What's up, I couldn't find the images so I started to create them in inkscape, I share them below, then I export it to PNG and when I run the images it gives me a blank instrument, any suggestion what it could be?
Could you please, post your script code between code tags, so we can help further ?

For code tags reference and usage : https://siminnovations.com/forums/viewt ... 094#p49094

Jdleonr
Posts: 13
Joined: Wed Nov 24, 2021 7:45 pm

Re: PA-30 Twin Comanche Gauges

#10 Post by Jdleonr »

Code: Select all

-- Gauge FUEL FLOW Twin Comanche (c) JDLEONR

img_add_fullscreen("FuelFlow.png")
img_add_fullscreen("NeedleLeft.png")
img_add_fullscreen("NeedleRigth.png")

function ff_data(ff_1, ff_2)

    calc_ff_1 = 188.4 - ((0.0162 * ff_1^3) - (0.0646 * ff_1^2) + (4.386 * ff_1)) 
    calc_ff_2 = 171.6 + ((0.0162 * ff_2^3) - (0.0646 * ff_2^2) + (4.386 * ff_2)) 

    rotate(NeedleLeft.png)
    rotate(NeedleRigth.png)
    
end
-------------------------------------
--       Data Subscription         --
-------------------------------------

fsx_variable_subscribe("ENG FUEL FLOW GPH:1", "Gallons per hour", 
                       "ENG FUEL FLOW GPH:2", "Gallons per hour", ff_data)

fs2020_variable_subscribe("ENG FUEL FLOW GPH:1", "Gallons per hour", 
                          "ENG FUEL FLOW GPH:2", "Gallons per hour", ff_data)

Post Reply