Board index FlightGear Development Aircraft Cockpit development

Scaling a property defined as a parameter

Discussion about creating 2d and 3d cockpits.

Scaling a property defined as a parameter

Postby Dirk7589 » Fri Apr 28, 2017 6:02 pm

Hello,

I have the following property defined as a parameter
Code: Select all
<params>
      <indicated-altitude-ft>EFIS_EICAS_Unit/ADIRU_Center_altitude_msg/altitude</indicated-altitude-ft>
      <setting-inhg>instrumentation/altimeter[0]/setting-inhg</setting-inhg>
      <setting-hpa>instrumentation/altimeter[0]/setting-hpa</setting-hpa>
   </params>

Unfortunately EFIS_EICAS_Unit/ADIRU_Center_altitude_msg/altitude is in meters as opposed to feet. The tag indicated-altitude-ft is consumed later on in the file to display the altitude. Is there a way to scale my property in this file before it gets consumed? I tried using the <expression> tags inside indicated-altitude-ft without any luck. Thank you for all your help.

Sincerely,
Dirk7589
Dirk7589
 
Posts: 6
Joined: Thu Apr 20, 2017 6:34 pm

Re: Scaling a property defined as a parameter

Postby wlbragg » Fri Apr 28, 2017 6:36 pm

I don't think you can do it in the "params" section. I've never seen it done here.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Scaling a property defined as a parameter

Postby Dirk7589 » Fri Apr 28, 2017 6:41 pm

Ok, well could I add an additional property inside the xml such as indicated-altitude-ft and have its contents populated by the scaled EFIS_EICAS_Unit/ADIRU_Center_altitude_msg/altitude property? Adding additional XML is not an issue. As it turns out I have several properties like this that need to be scaled.
Dirk7589
 
Posts: 6
Joined: Thu Apr 20, 2017 6:34 pm

Re: Scaling a property defined as a parameter

Postby Thorsten » Fri Apr 28, 2017 6:46 pm

I usually try to compute what I need as part of the systems definition (that's JSBSim) and only pick up the final value for animation/canvas/effects (i.e. almost never use any expressions or even scale factors in the animation). Generally what you can do inside an <fcs_function> tag is pretty versatile (tables, functions,...). In the unlikely case that framerate matters, you can even clock down the channel.

For YaSim you're left with property rules which should give you pretty much the same functionality.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 1 guest