gauges param

IL-2 Modding help (not 3D modding):
Forum rules
IL-2 Modding help (not 3D and mapping help).
Post Reply
Arsenal53
Posts: 7
Joined: Sun Jun 12, 2016 1:33 pm

gauges param

Post by Arsenal53 » Thu Aug 23, 2018 3:08 pm

Hello,

i'm working on some gauges but i'm lacking some informations to correctly set the move.

for exemple the manifold pressure gauge :
super.mesh.chunkSetAngles("Z_Pres1", cvt(((FlightModelMain) (super.fm)).EI.engines[0].getManifoldPressure(), 0.3386378F, 2.539784F, 0.0F, 343.5F), 0.0F, 0.0F);

I think the first two values represent angles in radians, but for what? the fourth seems to be related to the amplitude of displacement, but in what unit of measure? And finally, what are the other numbers for?
User avatar
BlackStaff
Posts: 132
Joined: Mon Jun 13, 2016 11:29 pm

Re: gauges param

Post by BlackStaff » Thu Aug 23, 2018 10:32 pm

343.5F ===> En kg !
C'est la valeur que tu trouves dans le FMD à la rubrique Fuel ! ;)
Pour info les valeurs Oil/Fuel/Nitro sont en kg !
Last edited by BlackStaff on Fri Aug 24, 2018 9:37 am, edited 1 time in total.
User avatar
ton414
Site Admin/FM Team
Posts: 1099
Joined: Wed Jun 08, 2016 10:55 pm

Re: gauges param

Post by ton414 » Thu Aug 23, 2018 10:38 pm

mesh.chunkSetAngles("Z_Pres1", cvt(fm.EI.engines[0].getManifoldPressure(), 0.3386378F, 2.539784F, 0.0F, 343.5F), 0.0F, 0.0F);

About the two values, If I'm not wrong, I think they jointly determine the initial and final position of the needle, but that is also determined by the last value you have referred ,that is, the three values are intrinsically related, I do not know if I explain myself well, but I do not know in which units this value works, I just know it's a float :lol:
And the last values "0.0F, 0.0F" refer to the y and z axis, that is, all the code that makes the needle work is written on the x-axis.
Image
Arsenal53
Posts: 7
Joined: Sun Jun 12, 2016 1:33 pm

Re: gauges param

Post by Arsenal53 » Thu Aug 23, 2018 10:44 pm

BlackStaff wrote:
Thu Aug 23, 2018 10:32 pm
343.5F ===> En kg !
C'est la valeur que tu trouves dans le FMD à la rubrique Fuel ! ;)
Pour info les valeurs Oil/Fuel/Nitro sont en kg !
De mémoire la conversion usuelle est pour le Fuel :
- 1 litre pèse 0,766kg
Donc 1 kg correspond à 1,234 litre

Je ne connais pas les autres conversions usuelles...
euh non ...

je suis pas entrain de parler du buttons mais de class java cockpit, c'est la phrase qui concerne l'affichage de la pression d'admission dans le cockpit et 343.5 c'est pas ce qu'il y a dans le buttons même en 4.09 d'origine donc...
User avatar
BlackStaff
Posts: 132
Joined: Mon Jun 13, 2016 11:29 pm

Re: gauges param

Post by BlackStaff » Fri Aug 24, 2018 9:48 am

Gloups j'ai lu trop vite ! J'avais zappé le "EI.engines[0].getManifoldPressure()" !
Désolé !
Dans ce cas alors on a des degrés (d'angle) : rotation entre 0 et 343°.
User avatar
ton414
Site Admin/FM Team
Posts: 1099
Joined: Wed Jun 08, 2016 10:55 pm

Re: gauges param

Post by ton414 » Fri Aug 24, 2018 3:16 pm

Here you can see exactly how the cvt method works, you can find it inside the Cockpit class:

Code: Select all

   
    protected float cvt(float f, float f1, float f2, float f3, float f4)
    {
        f = Math.min(Math.max(f, f1), f2);
        return f3 + ((f4 - f3) * (f - f1)) / (f2 - f1);
    }
    
Image
User avatar
dr strangelove
FM Modding Expert
Posts: 3448
Joined: Sun Dec 18, 2016 10:07 am

Re: gauges param

Post by dr strangelove » Sat Aug 25, 2018 9:00 pm

Dans ce cas alors on a des degrés (d'angle) : rotation entre 0 et 343°.
Google translate ...
In this case then we have degrees (angle): rotation between 0 and 343 °.
Yes + where you set your needle within 3ds max before export, both this & the number (343°) will decide at what point on your dial / gauge will start & stop
My IES Page : https://archive.org/details/IES_v3.5_Mods_Page
Online Servers http://il2.com.ru/en/links.php
AleXServer Dogfight Server IP = 217.78.176.50:21000 (by HL or Direct Connect)
Arsenal53
Posts: 7
Joined: Sun Jun 12, 2016 1:33 pm

Re: gauges param

Post by Arsenal53 » Wed Aug 29, 2018 2:33 pm

In fact it was more simple than i imagined:

"getManifoldPressure(), 0.3386378F, 2.539784F, 0.0F, 343.5F"

0.3386378F, 2.539784F are minimum and maximum manifold pressure written in ata

0.0F, 343.5F are degrees

so the needle move between 0° and 343,5° according to the engine manifold pressure in ata
Post Reply

Return to “Modding Help (not 3D)”

Who is online

Users browsing this forum: No registered users and 9 guests