Archived

This topic is now archived and is closed to further replies.

Guest Adrian

In Flight Data Gauge

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

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%

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

Share this post


Link to post
Share on other sites

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)?

Share this post


Link to post
Share on other sites