Jump to content
Sign in to follow this  
Guest Adrian

In Flight Data Gauge

Recommended Posts

Guest Adrian

Hello everybody,I have been recently creating a gauge that displays 'in-flight data', like the screens you see on the back of seats in commercial airlines.I have a few of the aircraft variables showing on the display such as ground speed, altitude and outside temperature, but now i want to access a GPS variable based on the 'distance to destination' based on current aircraft position which I struggle to display properly (i used FlightPlanWaypointRemainingTotalDistance).This value is always showing zero no matter where I am in the world. Do I have to initialise some other variable or is my macro definition wrong?

<?xml version="1.0" encoding="UTF-8"?><SimBase.Document        Type="AceXML"        version="1,0"        id="InFlightData">    <Descr>AceXML Document</Descr>    <Filename>InFlightData.xml</Filename>    <SimGauge.Gauge id="Gauge" ArtDirectory="C:\Documents and Settings\ADRIAN\My Documents\New Gauges\Test Gauges">        <FloatPosition>0.000,0.000</FloatPosition>        <Update_When_Hidden>True</Update_When_Hidden>        <Image id="in_flight_data_screen.bmp" Name="in_flight_data_screen.bmp">            <Transparent>True</Transparent>        </Image>        <Macro id="Macro" Name="c">            <MacroValue>(C:fs9gps)</MacroValue>        </Macro>        <Element id="Display Information 1">            <FloatPosition>40.000,40.000</FloatPosition>            <GaugeText id="Ground Speed">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Ground speed: %((A:GROUND VELOCITY, kph))%!3d! km/h</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>25</Length>                <Size>220,16</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 2">            <FloatPosition>40.000,100.000</FloatPosition>            <GaugeText id="Altitude">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Altitude: %((A:PLANE ALTITUDE, meters))%!5d! m</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>19</Length>                <Size>170,16</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 3">            <FloatPosition>40.000,160.000</FloatPosition>            <GaugeText id="Outside Temperature">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Outside Temperature: %((A:AMBIENT TEMPERATURE, celsius))%!3d!\{dplo= }C</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>19</Length>                <Size>262,13</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 4">            <FloatPosition>40.000,220.000</FloatPosition>            <GaugeText id="Distance to destination">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Dist. to dest: %((@c:FlightPlanWaypointApproachRemainingTotalDistance, kilometers))%!5d! km</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>40</Length>                <Size>230,13</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>    </SimGauge.Gauge></SimBase.Document>            

A screenie has been provided with the problem shown in a "red circle". Also any tips design suggestions on this very rough gauge? Cheers Adrian

Share this post


Link to post
Share on other sites
Hello everybody,I have been recently creating a gauge that displays 'in-flight data', like the screens you see on the back of seats in commercial airlines.I have a few of the aircraft variables showing on the display such as ground speed, altitude and outside temperature, but now i want to access a GPS variable based on the 'distance to destination' based on current aircraft position which I struggle to display properly (i used FlightPlanWaypointRemainingTotalDistance).This value is always showing zero no matter where I am in the world. Do I have to initialise some other variable or is my macro definition wrong?
<?xml version="1.0" encoding="UTF-8"?><SimBase.Document        Type="AceXML"        version="1,0"        id="InFlightData">    <Descr>AceXML Document</Descr>    <Filename>InFlightData.xml</Filename>    <SimGauge.Gauge id="Gauge" ArtDirectory="C:\Documents and Settings\ADRIAN\My Documents\New Gauges\Test Gauges">        <FloatPosition>0.000,0.000</FloatPosition>        <Update_When_Hidden>True</Update_When_Hidden>        <Image id="in_flight_data_screen.bmp" Name="in_flight_data_screen.bmp">            <Transparent>True</Transparent>        </Image>        <Macro id="Macro" Name="c">            <MacroValue>(C:fs9gps)</MacroValue>        </Macro>        <Element id="Display Information 1">            <FloatPosition>40.000,40.000</FloatPosition>            <GaugeText id="Ground Speed">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Ground speed: %((A:GROUND VELOCITY, kph))%!3d! km/h</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>25</Length>                <Size>220,16</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 2">            <FloatPosition>40.000,100.000</FloatPosition>            <GaugeText id="Altitude">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Altitude: %((A:PLANE ALTITUDE, meters))%!5d! m</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>19</Length>                <Size>170,16</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 3">            <FloatPosition>40.000,160.000</FloatPosition>            <GaugeText id="Outside Temperature">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Outside Temperature: %((A:AMBIENT TEMPERATURE, celsius))%!3d!\{dplo= }C</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>19</Length>                <Size>262,13</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>        <Element id="Display Information 4">            <FloatPosition>40.000,220.000</FloatPosition>            <GaugeText id="Distance to destination">                <Bold>True</Bold>                <FontColor>yellow</FontColor>                <FontFace>Courier</FontFace>                <FontHeight>19</FontHeight>                <GaugeString>Dist. to dest: %((@c:FlightPlanWaypointApproachRemainingTotalDistance, kilometers))%!5d! km</GaugeString>                <HorizontalAlign>RIGHT</HorizontalAlign>                <Length>40</Length>                <Size>230,13</Size>                <Transparent>True</Transparent>                <VerticalAlign>CENTER</VerticalAlign>            </GaugeText>        </Element>    </SimGauge.Gauge></SimBase.Document>            

A screenie has been provided with the problem shown in a "red circle". Also any tips design suggestions on this very rough gauge? Cheers Adrian

Hello Adrian Try this <Macro Name="TotalDistRem">(A:GPS IS ACTIVE FLIGHT PLAN,bool) if{ (A:GPS FLIGHT PLAN WP Count,number) 1 - (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointRemainingTotalDistance,kilometers) } </Macro>To display it %(@TotalDistRem)%!d!KM%

Paul EGLD

Share this post


Link to post
Share on other sites

While I donot have any experience with the new FS10 syntax, I beieve the Macro value may be wrong.Change --<Macro id="Macro" Name="c"><MacroValue>(C:fs9gps)</MacroValue>To -- <Macro id="Macro" Name="c"><MacroValue>C:fs9gps</MacroValue>And then use Paul's example above.Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest Adrian

Thanks Paul and Roman for the help, I will try the code tonight after work.Did you also find that the sdk documentation provided is not very helpful in terms of they give a name of a variable and its return value without explaining the syntax or giving a useful example (apart from the FuelPressure gauge)?About the (A:GPS IS ACTIVE FLIGHT PLAN, bool) variable, I assume that variable needs to be always used in an if condition to use the "C" class GPS variables? I might start using more macros in my future projects.If this is the case isn't it a bit silly that we have to check if there is an active flight plan used because in real commercial planes, don't pilots have to submit flight plans regardless?CheersAdrian

Share this post


Link to post
Share on other sites
About the (A:GPS IS ACTIVE FLIGHT PLAN, bool) variable, I assume that variable needs to be always used in an if condition to use the "C" class GPS variables? I might start using more macros in my future projects.If this is the case isn't it a bit silly that we have to check if there is an active flight plan used because in real commercial planes, don't pilots have to submit flight plans regardless?
That isn't the reason for the check. What's the point of making a request if a flightplan isn't "active" (meaning loaded)?

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...