PA28-161 Piper Warrior Engine Gages
PA28-161 Piper Warrior Engine Gages
Hi All,
Building a Piper Warrior panel and this is my first gage. The "5-pack" oil and fuel gage seen on many PA28-161 piper Warriors in real life. Developed from Russ Green's PA28 gages with some graphic modifications and fixed fuel pressure pegging at 10 psi issue.
While I believe the gage behavior is realistic, I used MSPaint for 90% of the graphic mods, and zooming in close on gage graphics will show some editing artifacts. I'm welcome to comments/criticism. I'd love to get this added to community instruments since there's not a lot for piper warrior.
Tests good with JustFlight Piper Warrior and Native C172. X-plane only for now.
Greg
Building a Piper Warrior panel and this is my first gage. The "5-pack" oil and fuel gage seen on many PA28-161 piper Warriors in real life. Developed from Russ Green's PA28 gages with some graphic modifications and fixed fuel pressure pegging at 10 psi issue.
While I believe the gage behavior is realistic, I used MSPaint for 90% of the graphic mods, and zooming in close on gage graphics will show some editing artifacts. I'm welcome to comments/criticism. I'd love to get this added to community instruments since there's not a lot for piper warrior.
Tests good with JustFlight Piper Warrior and Native C172. X-plane only for now.
Greg
- Attachments
-
- Warrior Engine Cluster.siff
- (177.35 KiB) Downloaded 319 times
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: PA28-161 Piper Warrior Engine Gages
We are mainly using SkinMan which give nice results for graphics
There's tutos made by Russ and many discussions here on the forums
Gilles
There's tutos made by Russ and many discussions here on the forums
Gilles
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: PA28-161 Piper Warrior Engine Gages
I've omitted to mention I will check your gauge
Gilles
Gilles
Last edited by SimPassion on Mon Dec 12, 2022 12:03 am, edited 1 time in total.
Re: PA28-161 Piper Warrior Engine Gages
Welcome,
You have got to start somewhere so good on you for having a go. We could always do with people developing new instruments. I’ll take a look.
Tony
You have got to start somewhere so good on you for having a go. We could always do with people developing new instruments. I’ll take a look.
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
Re: PA28-161 Piper Warrior Engine Gages
Good effort Greg. The graphic editing was hardly noticeable unless the instrument is made large. I think at the sort of size you would have this on a panel It looks just fine. Everything seems to be working but I don't have that exact aircraft so was testing with the default C172.
If I could give you one tip moving forward it would be to try and make the code look a little better when viewed with the AM editor. I do a lot of my basic editing and looking at code for others with the inbuilt editor now as its so convenient. I have my 'Tab to spaces size' set to 4 to match my external editor and that ensures they look consistent. The tab to spaces size can be set by clicking the little gear wheel on the upper right side of the Create/Edit tab. It helps to indent the code as you have done, but it looks more consistent if its a single tab(4 spaces) between each indent level and any associated comments are also indented to the same level as the code, a bit like the sample below. The forum code window does make the indents look a big bigger than they actually do in the editor but you get the idea.
Great first instrument.
Tony
If I could give you one tip moving forward it would be to try and make the code look a little better when viewed with the AM editor. I do a lot of my basic editing and looking at code for others with the inbuilt editor now as its so convenient. I have my 'Tab to spaces size' set to 4 to match my external editor and that ensures they look consistent. The tab to spaces size can be set by clicking the little gear wheel on the upper right side of the Create/Edit tab. It helps to indent the code as you have done, but it looks more consistent if its a single tab(4 spaces) between each indent level and any associated comments are also indented to the same level as the code, a bit like the sample below. The forum code window does make the indents look a big bigger than they actually do in the editor but you get the idea.
Great first instrument.
Tony
Code: Select all
local var = 0
function name(input)
if input == 1 then
--true comment here
print("true")
else
--false comment here
print("false")
end
end
name(var)
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
Re: PA28-161 Piper Warrior Engine Gages
Thanks for the feedback Tony, I can cleanup my code format per above, do you think the instrument is ready for submittal then?
greg
greg
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: PA28-161 Piper Warrior Engine Gages
Hello Greg
I don't see any issue in the graphics assuming we are seeing the instrument in the distance, but nothing noticeable when watching from nearest able
I've made three modifications to simplify the script
hope it could help
Gilles
I don't see any issue in the graphics assuming we are seeing the instrument in the distance, but nothing noticeable when watching from nearest able
I've made three modifications to simplify the script
hope it could help
Gilles
Code: Select all
-----------------------------------------------------------------------
-- Author: Greg Ryan
-- Based on work by Russ Green
---------------------------------------------------------------------------
-------------------------------------
-- Load and display images --
-------------------------------------
img_add_fullscreen("EnginerCluster_Fuel.png")
img_needle_Fuel_L = img_add("Needle.png",46,50,200,200)
img_needle_OilT = img_add("Needle.png",339,50,200,200)
img_needle_Fuel_P = img_add("Needle.png",631,50,200,200)
img_needle_OilP= img_add("Needle.png",923,50,200,200)
img_needle_Fuel_R = img_add("Needle.png",1215,50,200,200)
img_add_fullscreen("EngineClusters_Bezel.png")
function new_data(batt, fuelpres, fuelq, opress_xpl, otemp_xpl)
fuelpressure = var_cap(fuelpres[1], 0, 30)
--X-plane fuelpressure dataref runs too high (20-30 psi) so increased upper limit to 30 capture the fluctuation
fuel_left = var_cap(((fuelq[1]* 2.20462) / 6.0), 0, 24)
fuel_right = var_cap(((fuelq[2]* 2.20462) / 6.0), 0, 24)
oilt = var_cap(otemp_xpl[1], 75, 260) -- Replaced variable assignment to make it simple
oilp = var_cap(opress_xpl[1], 0, 100) -- Replaced variable assignment to make it simple
fuelp = fuelpressure*.2 -- Moved line to avoid making assignment twice
--0.2 seems about right. Knocks the fuel pressure down to 4-6 psi which we can now see on the 0-10 psi gage.
if (batt[1] == 1) then
left = fuel_left
right = fuel_right
else
left = 0
right = 0
end
if fuelp >= 0 and fuelp <= 5 then
rotate(img_needle_Fuel_P, 36/5 * (fuelp) - 36)
elseif fuelp > 5 then
rotate(img_needle_Fuel_P, 42/5 * (fuelp) - 42)
end
if left >= 0 and left <= 10 then
rotate(img_needle_Fuel_L, 22/5 * (left) - 34)
elseif left > 10 then
rotate(img_needle_Fuel_L, 2 * (left) - 10)
end
if right >= 0 and right <= 10 then
rotate(img_needle_Fuel_R, 22/5 * (right) - 34)
elseif right > 10 then
rotate(img_needle_Fuel_R, 2 * (right) - 10)
end
if oilt >= 75 and oilt <= 180 then
img_rotate(img_needle_OilT, 2/5 * (oilt) - 66)
elseif oilt > 180 then
img_rotate(img_needle_OilT, 7/20 * (oilt) - 57)
end
if oilp >= 0 and oilp <= 60 then
img_rotate(img_needle_OilP, 7/10 * (oilp) - 36)
elseif oilp > 60 then
img_rotate(img_needle_OilP, 29/40 * (oilp) - 75/2)
end
end
-- Subscribe to variables and datarefs
xpl_dataref_subscribe("sim/cockpit/electrical/battery_array_on", "INT[8]",
"sim/cockpit2/engine/indicators/fuel_pressure_psi", "FLOAT[8]",
"sim/flightmodel/weight/m_fuel", "FLOAT[8]",
"sim/cockpit2/engine/indicators/oil_pressure_psi","FLOAT[8]",
"sim/cockpit2/engine/indicators/oil_temperature_deg_C","FLOAT[8]",
new_data)
Re: PA28-161 Piper Warrior Engine Gages
Go for it.
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
Re: PA28-161 Piper Warrior Engine Gages
Thanks guys, will do
Re: PA28-161 Piper Warrior Engine Gages
Good morning all and Happy New Year.
I was wondering how I can add a function and correct subscription to this panel for MSFS2020?
I would like to incorporate two panels I found on the forum by Russ Green (Fuel and Oil Temp, Pressure) designed to work on XPlane.
Any help would be much appreciated.
Kind regards
Feras
I was wondering how I can add a function and correct subscription to this panel for MSFS2020?
I would like to incorporate two panels I found on the forum by Russ Green (Fuel and Oil Temp, Pressure) designed to work on XPlane.
Any help would be much appreciated.
Kind regards
Feras