• 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.

VERTICAL SITUATION DISPLAY

I'd start experimenting with <Polyline>, <Shift>, and <Rotate>. An XML limitation you may run into is the inability to dynamically change <Polyline> X and Y Points according to flight plan leg distance.

Anyway, you might figure something out that satisfies your vertical situation display needs.

Bob
 
Terence,

Not exactly. You could do it that way, but it is a manual process.

A much easier approach is to make use of (A:GPS WP NEXT ALT, feet) as Bjoern suggests in #9. That's what I did in the XML scripts I posted above.

Study the XML gauge below. Create a new Flight Plan using Flight Planner, or, load any saved Flight Plan, then click the square blue button in the upper left corner of the gauge display.

The cruising altitudes determined by Flight Planner will then be listed in the red column. No need to edit the .pln file*. With this, you should have all you need to create a cruising altitude profile - the XMLVAR array of cruising altitudes and the FlightPlanWaypointDistance of each leg.

Bob


The attached XML gauge is X=600 Y=400. Set it up in panel.cfg as a separate 600 x 400 window

You need XMLTOOLS installed for this to work.

* No need to edit the .pln file unless you do not like the cruising altitudes computed by Flight Planner. If that's the case, manually edit the altitdes of each waypoint in the .pln file as desired and then use FlightPlanWaypointAltitude for the altitudes.

View attachment 42567

XML:
<Gauge Name="FLIGHT PLAN DISPLAY" Version="1.0">
    <Size X="600" Y="400" />

    <Macro Name="c">C:fs9gps</Macro>
    <Macro Name="C">C:fs9gps</Macro>

    <Element Name="BACKGROUND RECTANGLE"><Position X="0" Y="0"/><Rectangle Width="600" Height="400" FillColor="gainsboro" Bright="Yes" /></Element>  
    <Element Name="BLUE BUTTON = EXTRACT CRUISING ALTITUDES"><Position X="5" Y="5"/><Rectangle Width="20" Height="20" FillColor="dodgerblue" Bright="Yes" /></Element>
    <Element Name="RELOAD BUTTON"><Position X="545" Y="5"/><Element Name="Red Square"><Position X="0" Y="0"/><Rectangle Width="20" Height="20" FillColor="firebrick" Bright="Yes" /></Element><Element Name="R"><Position X="3" Y="2"/><FormattedText X="14" Y="17" Font="aero" FontSize="18" LineSpacing="20" Color="white" BackgroundColor="firebrick" Bright="Yes"><String>R</String></FormattedText></Element></Element>

    <Element Name="F L I G H T  P L A N  D I S P L A Y">
        <Position X="10" Y="40"/>
            <FormattedText X="580" Y="350" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" BackgroundColor="gainsboro" Bright="Yes" >      
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>  
                <String>
                    \{clr2}FLIGHT PLAN: \{clr}\{fnt1}%((@c:FlightPlanTitle))%!-s!\n
                    %((@c:FlightPlanDepartureName))%!s!% to %((@c:FlightPlanDestinationName))%!s!\n\n\{fnt}

                    \{clr2}----------------------------------------------- FlightPlanWaypoint --------------------------------------------\n
                    %     ICAO     \{clr5}111\{clr2}         \{clr4}     Cruising\{clr2}       Mag                               Dist   Dist    Rem    Ttl\n
                    Idx  1\{clr4}23\{clr3}4567\{clr5}89012\{clr2}  Ident   Alt \{clr4}Altitude\{clr2} Type  Hdg       Lat        Lon   Dist    Ttl    Rem   Dist   Dist   ETE\n
                    %((@c:FlightPlanWaypointsNumber) s17 0 !=)
                    %{if}
                    %(0 sp16)
                        %{loop}
                            %(l16 (>@c:FlightPlanWaypointIndex))
                            \{clr}%((@c:FlightPlanWaypointIndex))%!-3d!%  %
                            %((@c:FlightPlanWaypointICAO))%!12s!% %
                            %((@c:FlightPlanWaypointIdent))%!6s!
                            %((@c:FlightPlanWaypointAltitude, feet))%!6d!%    %
                            %('FlightPlan_Altitude_WP_' l16 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
                            %((@c:FlightPlanWaypointType))\{clr}%!2d!%  %
                            %((@c:FlightPlanWaypointMagneticHeading, degrees))%!3d!% %
                            %((@c:FlightPlanWaypointLatitude, degrees))%!9.4f!% %
                            %((@c:FlightPlanWaypointLongitude, degrees))%!10.4f!%  %
                            %((@c:FlightPlanWaypointDistance, nmiles))%!5.1f!%  %
                            %((@c:FlightPlanWaypointDistanceTotal, nmiles))%!5.1f!%  %
                            %((@c:FlightPlanWaypointDistanceRemaining, nmiles))%!5.1f!%  %
                            %((@c:FlightPlanWaypointRemainingDistance, nmiles))%!5.1f!%  %
                            %((@c:FlightPlanWaypointRemainingTotalDistance, nmiles))%!5.1f!%  %
                            %((@c:FlightPlanWaypointETE, minutes))%!4.1f!\n
                            %(l16 ++ s16 l17 &lt;)
                        %{next}
                    %{end}
                </String>
            </FormattedText>
    </Element>  
   
    <Mouse>
        <Area Name="BLUE BUTTON" Left="5" Top="5" Width="20" Height="20">
            <Cursor Type="Hand"/>
            <Click Kind="LeftSingle">
                    (C:fs9gps:FlightPlanActiveWaypoint) (>L:FPActiveWP, enum)
                <!-- LOOPS THROUGH THE F.P., CREATING AN ARRAY OF XMLVARS AND STORING WAYPOINT FLIGHT ALTs INTO THE APPROPRIATE XMLVAR -->
                    0 sp35
                    :305
                        l35 (>C:fs9gps:FlightPlanActiveWaypoint)
                        'FlightPlan_Altitude_WP_' l35 scat (>C:XMLVARS:StoreVarName, string) (A:GPS WP NEXT ALT, feet) (>C:XMLVARS:NumberValue, number)
                        l35 ++ s35
                    l35 (C:fs9gps:FlightPlanWaypointsNumber) &lt; if{ g305 }
                <!-- RESETS ACTIVE WAYPOINT TO ORIGINAL VALUE -->
                    (L:FPActiveWP, enum) (>C:fs9gps:FlightPlanActiveWaypoint)
            </Click>
        </Area>
   
        <Area Name="RELOAD BUTTON" Left="545" Top="5" Width="20" Height="20">
            <Cursor Type="Hand"/>  
                <Click>
                    (A:Fuel weight per gallon, pounds per gallon) 0 ==
                            if{ (>K:RELOAD_USER_AIRCRAFT) }  // FSX P3D
                            els{ (>K:RELOAD_PANELS) }        // FS9
                    1 (>C:XMLVARS:Reset)              
                </Click>
        </Area>
    </Mouse>

</Gauge>
Ok Bob, I'm not having much luck here for some reason. If I understood you correctly, your gauge feeds the sim with altitudes thus giving (A:GPS WP NEXT ALT, feet) some actual content. However, try as I might, I cannot get the waypoint symbol to shift in the vertical. Maybe I'm approaching this the wrong way or something but if you have a second, could you please take a look at the following code snippet. The first <Shift> set moves the waypoints horizontally and works fine, but the second set seems to do absolutely nothing. My understanding was that the <Shift> function should move the symbol based on the (A:GPS WP NEXT ALT, feet) information fed to the sim (in this case from the gauge, you kindly provided) however, nothing happens.
XML:
          <Shift id="Shift">
            <Scale>6.600,0.000</Scale>
            <Expression id="Expression">
              <Minimum>0.000</Minimum>
              <Maximum>40.000</Maximum>
              <Script>(@c:FlightPlanWaypointRemainingDistance,nmiles)</Script>
            </Expression>
            <Scale>0.000,-0.002</Scale>
            <Expression id="Expression">
              <Minimum>-52000.000</Minimum>
              <Maximum>52000.000</Maximum>
              <Script>(A:GPS WP NEXT ALT, feet)</Script>
            </Expression>
          </Shift>
Many thanks, TJ
 
If I understood you correctly, your gauge feeds the sim with altitudes thus giving (A:GPS WP NEXT ALT, feet) some actual content ...

My understanding was that the <Shift> function should move the symbol based on the (A:GPS WP NEXT ALT, feet) information fed to the sim (in this case from the gauge, you kindly provided) however, nothing happens.

Hi TJ,

That's not what I said. The idea behind using a sequence of (A:GPS WP NEXT ALT, feet) to store values into an array of XMLVARS was discussed in #12, and because you're new to XML and gauge development, I included a fully functional XML gauge for you to carefully study to see what's going on. You'll really need to do that. Diving straight into gps module variables and complex PFD gauge work for a newcomer to both FS gauge coding as well as XML is quite ambitious. Persistence and patience are pre-requisites.

To understand the gauge posted in #19, one needs to know how to use, among other things,
  • XMLVARS (a part of XMLTOOLS. That needs to be downloaded and installed)
  • The difference between string and number variables
  • XML operators like scat
  • The concept of Indexing
  • GPS variables
  • Storage registers
  • XML loops
You're also using FSX XML schema/format rather than the less verbose and easier to use FS9 schema. My suggestion is for you to switch to FS9 schema. The preponderance of XML snippets and examples posted in this forum use FS9 schema. The gauge posted in #19 and the snippets in #14 and #16 are written using FS9 schema.

As Tom Aguilo advised me many years ago, "Test, test, and re-test". No other way to learn this stuff.

Bob
 
Ok Bob, thanks for bringing me back to Earth. I really thought I had this XML stuff licked. Lol. Much much more to learn. Thanks for being patient and apologies for being a PITA. Many thanks again. TJ
 
To answer your question regarding <Shift> as far as I know you can only have one <Expression> (either x or y) per <Shift> section. The second <Expression> would have to be a child of the parent <Expression>...
 
To answer your question regarding <Shift> as far as I know you can only have one <Expression> (either x or y) per <Shift> section. The second <Expression> would have to be a child of the parent <Expression>...
Thanks Fr. Bill, I have tried several combinations of that but can't seem to get it working. Maybe its just the syntax I am using or just my inexperience shining through. As Bob suggests above, it might also be the mixing of FS9 and FSX schema. I am continuing to experiment. If you have an example of how the shift section should look as a child of the parent, I would love to see it if possible. Many thanks. Regards, TJ.
 
If you have an example of how the shift section should look as a child of the parent, I would love to see it if possible

TJ,

Info on <Shift> ... FS9 schema

As far as your XML in #23 goes, a fundamental problem is that you're trying to use (A:GPS WP NEXT ALT, feet) rather than XMLVARS: FlightPlan_Altitude_WP_0 , FlightPlan_Altitude_WP_1, FlightPlan_Altitude_WP_2, ... FlightPlan_Altitude_WP_n

The key to this are lines 56 through 61 in the gauge I attached. You must understand exactly what's going on in that loop in order to understand how I obtain the cruising altitudes that are displayed in red in #19.

Bob
 
Ok Bob, just a quick one though, I can't seem to find a working libk for the FS9 SDK anywhere. Can you post a link of one if you have it handy. Gonna start educating myself.
Many thanks
 
Bjoern (Heretic) uploaded it into the Resources section of this site. Search for FS9 SDK Documentation.
 
Hi TJ,

That's not what I said. The idea behind using a sequence of (A:GPS WP NEXT ALT, feet) to store values into an array of XMLVARS was discussed in #12, and because you're new to XML and gauge development, I included a fully functional XML gauge for you to carefully study to see what's going on. You'll really need to do that. Diving straight into gps module variables and complex PFD gauge work for a newcomer to both FS gauge coding as well as XML is quite ambitious. Persistence and patience are pre-requisites.

To understand the gauge posted in #19, one needs to know how to use, among other things,
  • XMLVARS (a part of XMLTOOLS. That needs to be downloaded and installed)
  • The difference between string and number variables
  • XML operators like scat
  • The concept of Indexing
  • GPS variables
  • Storage registers
  • XML loops
You're also using FSX XML schema/format rather than the less verbose and easier to use FS9 schema. My suggestion is for you to switch to FS9 schema. The preponderance of XML snippets and examples posted in this forum use FS9 schema. The gauge posted in #19 and the snippets in #14 and #16 are written using FS9 schema.

As Tom Aguilo advised me many years ago, "Test, test, and re-test". No other way to learn this stuff.

Bob
Hi Bob,
After a while of testing and experimenting, as suggested, I have made some progress per-se. I have searched high and low for any info on the subjects you suggested but the only reference I came up with was in the GPS guidebook. I have been able to get roughly where I wanted, but I feel that this is only through pure guesswork on my part. What follows is a screenshot of where I am at followed by a code snippet of what got me there. Please don't cringe as this may be baby level for you but it is certainly not for me.
XML:
    <Element Name="wpalt">
        <Position X="150" Y="327"/>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(0 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
                            %((@c:FlightPlanWaypointDistance, nmiles))%!5.1f!%  %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.10243"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>   

    <Element Name="wpaltmkr">
        <Position X="140" Y="315"/>
          <Image id="wp.bmp" Name="wp.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.00243"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>

    <Element Name="wpnextalt">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(1 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.05843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>   


    <Element Name="wpnextaltmkr">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.10843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>



    <Element Name="wpnextalt2">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(2 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.30843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr2">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.30843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextalt3">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(3 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr3">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>



    <Element Name="wpnextalt4">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(4 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr4">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>



    <Element Name="wpnextalt5">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(5 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr5">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>






    <Element Name="wpnextalt6">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(6 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr6">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>






    <Element Name="wpnextalt7">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(7 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr7">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>



    <Element Name="wpnextalt8">
        <Position X="160" Y="327"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image>
            <FormattedText X="150" Y="10" Font="Consolas" FontSize="10" LineSpacing="10" Color="#101010" Bright="Yes" >       
            <Color Value="blue"/><Color Value="green"/><Color Value="red"/><Color Value="purple"/>
            <Font Name="calibri bold"/>   
                <String>
                    %((@c:FlightPlanWaypointsNumber))
                    %{if}
                    %(8 sp2)
                        %{loop}
                            %(l2 (>@c:FlightPlanWaypointIndex))
                            %('FlightPlan_Altitude_WP_' l2 scat (>C:XMLVARS:SearchVarName, string) (C:XMLVARS:NumberValue, number))\{clr4}%!5d!%   %
\n
                        %{next}
                    %{end}
                </String>
            </FormattedText>
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


    <Element Name="wpnextaltmkr8">
        <Position X="140" Y="315"/>
          <Image id="wpn.bmp" Name="wpn.bmp">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
          </Image> 
            <Shift>
                <Value>(@c:FlightPlanWaypointRemainingTotalDistance, nmiles)</Value>
                <Scale X="1.50843"/>
            </Shift>
            <Shift>
                <Value>(C:XMLVARS:NumberValue, number)</Value>
                <Scale Y="-0.00253"/>
            </Shift>
    </Element>


I have two questions at this stage.
1) Is there a way to clean up this code, i.e. create a macro to run it and increment the waypoints? If so could you nudge me in the right direction as I have not been able to find a way of doing this.
2) I need to change the waypoint symbols to pink as they become active (you will notice from the above code that only waypoint 0 is pink and will stay that way).


Again many thanks for all your help so far on this.
Kind regards, TJ
fsx 2018-07-06 22-38-29-21.jpg
 
1) Is there a way to clean up this code, i.e. create a macro to run it and increment the waypoints?
  • Create a macro to increment the waypoints? Concerning your display, No. Each bmp image-altitude text pair is a separate Element. If you have a flight plan with 50 waypoints, you'll need 50 Elements to display the image-text pairs. That is similar to the way you have it set up now. Shift the placement of the pairs in the X and Y directions as the flight progresses as you have done. Use a Mask image to hide the image-text Elements as they scroll in and out of the gauge viewing window.
  • Is there a way to clean up this code? Yes, several ways. For example, in your <String> expressions, you're using {loop}, but you're not looping anything. You have multiple Font definitions (Consolas, Calibri Bold). Why? You have multiple colors listed and use \{clr4} but that is not necessary. You include spaces (% %) and line feeds (\n) in <String>. Why?
There's no need to be guessing about this. Study the XML examples in this thread and review the many XML examples found elsewhere in this forum. Keep experimenting and cleaning up things as you go.
 
TJ,

Hang in there. Your work is looking good and you'll get this solved if you keep working the XML.

Bob
 
Thanks for the encouragement Bob, I needed that. Slowly getting there. Trying to clean up the code as you suggested and working on the xml to draw the connecting flightplan lines. Learning as I go.
TJ
 
Back
Top