Can someone please provide a link to help me understand needle rotation formulas. As an example, my oil temperature gauge.
if oilt >= 75 and oilt <= 180 then
rotate(img_needle_OilT, 2/2.2 * (oilt) - 66)
elseif oilt > 180 then
rotate(img_needle_OilT, 7/20 * (oilt) - 57)
end
I modified one number to (2.2) to get the needle to move the correct amount but I know this is not the correct way to do this.
A link to a tutorial and or a video would be greatly appreciated.
Thank You,
vangyver
Needle Rotation
Re: Needle Rotation
This will probably work, but in my opinion it makes more sense to divide the number of rotational degrees by the amount on the scale.
So let's say the needle starts at minus 66 as in your example, and then travels an angle of 100 degrees for those 105 degrees Fahrenheit (180 - 75).
75 is subtracted from the oil temperature, so 75 degrees Fahrenheit becomes 0 degrees Fahrenheit.
So let's say the needle starts at minus 66 as in your example, and then travels an angle of 100 degrees for those 105 degrees Fahrenheit (180 - 75).
Code: Select all
rotate(img_needle_OilT, -66 + (100 / 105 * (oilt - 75)) )
Re: Needle Rotation
Thanks Ralph, now it makes more sense to me. I will have to experiment a bit. The data I need to subscribe to is "L:Eng1_OilTemp", "Celsius" so I believe that would also effect the usage if it is only in Fahrenheit.
Vangyver
Vangyver
Re: Needle Rotation
If the gauge is in Fahrenheit and the data in Celsius, then you can convert it to Fahrenheit before you use it.
Re: Needle Rotation
Found the correct LVAR for the A2A Piper Cherokee “L:Eng1_OilTemp,fahrenheit".
So now my oil temperature gauge works correctly.
Also found the correct ammeter LVAR “L:Ammeter1,amps” and this too now works correctly but:
There must be a problem in Prepar3d or the A2A programming. Starting default aircraft (A2A Piper Cherokee) ammeter works flawlessly. When switching scenarios the ammeter goes to zero. Closing Airmanager and restarting Airmanager has no effect. Switching aircraft also has no effect. I have to restart Prepar3d to get the ammeter to work again. So, not a problem with Airmanager but must be either A2A or Prepar3d. This is my last bug to fix and all my Airmanager gauges are working correctly.
Thank you Ralph for all the help.
Vangyver.
So now my oil temperature gauge works correctly.
Also found the correct ammeter LVAR “L:Ammeter1,amps” and this too now works correctly but:
There must be a problem in Prepar3d or the A2A programming. Starting default aircraft (A2A Piper Cherokee) ammeter works flawlessly. When switching scenarios the ammeter goes to zero. Closing Airmanager and restarting Airmanager has no effect. Switching aircraft also has no effect. I have to restart Prepar3d to get the ammeter to work again. So, not a problem with Airmanager but must be either A2A or Prepar3d. This is my last bug to fix and all my Airmanager gauges are working correctly.
Thank you Ralph for all the help.
Vangyver.
Re: Needle Rotation
There's indeed something in Prepar3D, it starts a new instance of Simconnect and there's doesn't seem to be a proper way to detect this. We've asked for help at their forums a couple of times, but never got any answer.
Re: Needle Rotation
Vangyver:
I posted a question to A2A Simulation on New instance of Simconnect and received a reply from Lewis:
Lewis - A2A
Starting default aircraft (A2A Piper Cherokee)
That part can lead to all kinds of frustrations in P3D and FSX. It is always advised to never set a complex 3rd party simulation aircraft as the default as it can cause load and initialisation issues in FSX and P3D. Whilst its not a binary 0/1 situation it can go from working fine for years to suddenly not working over night. Therefore advice from us and most other if not all other developers is to not use our aircraft as default to prevent potential frustrations and issues.
Vangyver:
So, I tried his suggestion and it worked. I set the default to Prepar3d scenario. I have 3 scenarios for my A2A Cherokee and no matter which one I load the ammeter always works. Hope this information is useful.
I also posted the question at the prepar3d forum but still no reply.
Vangyver
Lewis - A2A
No worries, its a royal pain in the ass issue to be frank, as it is so hit and miss with the platform that sometimes users including myself where fine for years using custom default flights and then all of a sudden with no noticible change to a users computer other than it being a new day it all of a sudden stops working and causes issues. Very strange indeed with FSX/P3D on that initial load.
I posted a question to A2A Simulation on New instance of Simconnect and received a reply from Lewis:
Lewis - A2A
Starting default aircraft (A2A Piper Cherokee)
That part can lead to all kinds of frustrations in P3D and FSX. It is always advised to never set a complex 3rd party simulation aircraft as the default as it can cause load and initialisation issues in FSX and P3D. Whilst its not a binary 0/1 situation it can go from working fine for years to suddenly not working over night. Therefore advice from us and most other if not all other developers is to not use our aircraft as default to prevent potential frustrations and issues.
Vangyver:
So, I tried his suggestion and it worked. I set the default to Prepar3d scenario. I have 3 scenarios for my A2A Cherokee and no matter which one I load the ammeter always works. Hope this information is useful.
I also posted the question at the prepar3d forum but still no reply.
Vangyver
Lewis - A2A
No worries, its a royal pain in the ass issue to be frank, as it is so hit and miss with the platform that sometimes users including myself where fine for years using custom default flights and then all of a sudden with no noticible change to a users computer other than it being a new day it all of a sudden stops working and causes issues. Very strange indeed with FSX/P3D on that initial load.