• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA FlightPlanWaypoint problem.

Messages
36
Hi,
I'm trying to make a gauge to display:
FlightPlanWaypointEstimatedFuelConsumption,
FlightPlanWaypointFuelRemainedAtArrival,
FlightPlanWaypointDistanceTotal,
FlightPlanWaypointRemainingTotalDistance,
FlightPlanWaypointEstimatedTimeRemaining.
Unfortunately,it shows zero. :(
I have been struggling with it for several days.:banghead:
I searched various forums and read "GPS_GUIDEBOOK_v.2.0.1", unfortunately I can not deal with it.
I'm a graphic designer and I'm poor at writing codes (but I'm trying to learn). :oops:
I do not know where the error is.
Here's how my .xml document is built:
Code:
<Gauge Name="new 1" Version="1.0">



    <Macro Name="c">C:fs9gps</Macro>
    <Macro Name="g">C:fs9gps</Macro>
    
    
<!-- CALC -->         
<Element>
      <Visible>(L:calc, number) 1 ==</Visible>
      <Element>
         <Position X="25" Y="40"/>
     <FormattedText X="980" Y="300"  Font="Quartz" FontSize="100" LineSpacing="120" Color="greenyellow" BackgroundColor="transparent" Bright="Yes">
     <String>
            \{dn}%EFC%\{md}%((@c:FlightPlanWaypointEstimatedFuelConsumption,liters))%!d!
            %/%((@c:FlightPlanWaypointFuelRemainedAtArrival,liters))%!d!%\{dn}%RFA L%
            \n%WDT%\{md}%((@c:FlightPlanWaypointDistanceTotal,nmiles))%!d!
            %/%((@c:FlightPlanWaypointRemainingTotalDistance,nmiles))%!d!%\{dn}%WRD NM%
            \{dn}%  ETR:%\{md}%((A:FlightPlanWaypointEstimatedTimeRemaining, hours) 24 % flr)%!02d!:%((A:FlightPlanWaypointEstimatedTimeRemaining, minutes) 60 % flr)%!02d!:%((A:FlightPlanWaypointEstimatedTimeRemaining, seconds) 60 % flr)%!02d!%
            </String>
       </FormattedText>
     </Element>
 </Element>   

  
 <Mouse>
      <Area Left="517" Width="90" Top="614" Height="60">
             <Cursor Type="Hand"/>
         <Click>
           1 (&gt;L:calc, number)
         </Click>
     <Tooltip>%CALC%</Tooltip>
   </Area> 
</Mouse>   

</Gauge>
And it looks like this:
upload_2017-12-19_14-9-1.png
 
The reason they're all zero is that the FlightPlanWaypoint variables are indexed variables. You must tell the gps module which waypoint (that is, set the index number) you want information about.

Also, you have a line, ETR:%\{md}%((A:FlightPlanWaypointEstimatedTimeRemaining, hours) ... Those are gps variables, not A:Vars

The function of FlightPlanWaypointFuelRemainedAtArrival. It's the fuel that remained after a waypoint has been passed, not the estimated fuel remaining at the destination airport, which, I guess, is what you may want.

Finally, it should go without saying, but all of this works only when one is flying an active flight plan.

You're really not that far off ... take another look at the INDEX POINTER discussion in the GPS Guidebook (pages 16,17).

Bob
 
I am very grateful to you Rob.
It seems to me that the script works.:)
I was already afraid that I would have to combine something in "<Update>".
And that I could not understand (you programmers build such wonders with numbers there)... :wizard:
Now the code looks like this:
Code:
     <String>
%( 1 (&gt;@c:FlightPlanWaypointIndex,enum))     
            \{dn}%EFC%\{md}%((@c:FlightPlanWaypointEstimatedFuelConsumption,liters))%!d!
            %/%((@c:FlightPlanWaypointFuelRemainedAtArrival,liters))%!d!%\{dn}%RFA L%
            \n%WDT%\{md}%((@c:FlightPlanWaypointDistanceTotal,nmiles))%!d!
            %/%((@c:FlightPlanWaypointRemainingTotalDistance,nmiles))%!d!%\{dn}%WRD NM%
            \{dn}%  ETR:%\{md}%((A:FlightPlanWaypointEstimatedTimeRemaining, hours) 24 % flr)%!02d!:%((A:FlightPlanWaypointEstimatedTimeRemaining, minutes) 60 % flr)%!02d!:%((A:FlightPlanWaypointEstimatedTimeRemaining, seconds) 60 % flr)%!02d!%
            </String>
Merry Christmas & Happy New Year :santahat:
 
Upss, a small mistake, in the last line of code, of course, is:
Code:
    \{dn}%  ETR:%\{md}%((@c:FlightPlanWaypointEstimatedTimeRemaining, hours) 24 % flr)%!02d!:%((@c:FlightPlanWaypointEstimatedTimeRemaining, minutes) 60 % flr)%!02d!:%((@c:FlightPlanWaypointEstimatedTimeRemaining, seconds) 60 % flr)%!02d!%
So once again thank you and Merry Christmas & Happy New Year.
 
Back
Top