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

FSX Toggle next waypoint leg activation

Messages
150
Is there a simple way to toggle the next waypoint activation, I'd like to have a modeled button for next and previous - I don't mind if each leg activates as they are cycled through. I was hoping there would be toggle in the SDK for that, but cannot find it.

My non-working code is as follows, I'm sure this wouldn't work even if it did something because if the switch is 'on' it'll keep incrementing up the waypoints.

<Gauge Name="GPS Button">
<Element>
<Select>
<Value> (L:switch,bool)

if{ (C:fs9gps:FlightPlanActiveWaypoint) 1 + (>C:fs9gps:FlightPlanActiveWaypoint) 0 }
</Value>
</Select>
</Element>
</Gauge>
 
Last edited:
Set a flag so that the code can't be re-run until the flag is reset. That way, if the toggle is held on, the code won't run. You could also try abusing the DirectTo method?
 
This is what I use
Code:
</Area>
<Macro Name="Button1">(L:VFDDAT mode,enum) 4 == (L:ChgWPt, number) (A:GPS FLIGHT PLAN WP COUNT, number) 0 &gt;
if{
    (A:GPS FLIGHT PLAN WP INDEX, number) -- (&gt; L:ChgWPt, number)
    (L:ChgWPt, number) (&gt; C:fs9gps:directToActivateLeg)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanWaypointIndex)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanDirectToWaypoint)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanActiveWaypoint) }</Macro>
    <Area Left="383" Top="66" Width="41" Height="18">
    <Tooltip>Set PREV Leg</Tooltip>
      <Cursor Type="DownArrow"/>
      <Click Kind="LeftSingle"> 12 (>G:Var6) @Button1</Click>
    </Area>  
<Macro Name="Button2">(L:VFDDAT mode,enum) 4 == (L:ChgWPt, number) (A:GPS FLIGHT PLAN WP COUNT, number) 0 - &lt;
if{
    (A:GPS FLIGHT PLAN WP INDEX, number) ++ (&gt; L:ChgWPt, number)
    (L:ChgWPt, number) (&gt; C:fs9gps:directToActivateLeg)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanWaypointIndex)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanDirectToWaypoint)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanActiveWaypoint) }</Macro>
    <Area Left="432" Top="66" Width="41" Height="18">
    <Tooltip>Set NEXT Leg</Tooltip>
      <Cursor Type="UpArrow"/>
      <Click Kind="LeftSingle"> 12 (>G:Var7) @Button2</Click>
    </Area>
The above mouse code is for PREV NEXT at lower right hand side of my autopilot . see following shot .
capture_06072011_212611.jpg


Cheers
Karol
 
With the PREV NEXT function provided in the previous post . these buttons increment or decrement by one waypoint per click .
that change will be from whatever leg that is currently being flown by the autopilot .
If you have a large flight plan . for example 80 waypoints , you might be flying to INDEX # 2 , and you want to take a short cut
to INDEX # 75 , you can see that it entails a very large number of NEXT clicks to enact the change .

I created the following gauge ,
fsx 2012-10-23 22-00-13-91.jpg

at each of the two thumbwheel windows you create the required number , in this instance # 75 , then click the
SELECT button and 75 becomes the active .
The code is ,
Code:
<Gauge Name="SEQ SET" Version="1.0">
//By Karol Chlebowski @ 2012 **
<Update Frequency="18"/>
<Update>
(G:Var1) 0 != if{ (G:Var1) -- (>G:Var1) }
</Update>
<Image Name="SEQ_INS.bmp" ImageSizes="75,57,0,0"/>

  <Element>
    <Visible>(A:Circuit general panel on, bool)</Visible>
      <!--SCREEN-->  
    <!--SEQ   Flight plan legs-->
<!--SEQ - Active leg number - Total legs-->  
   
            <Element>
              <Position X="10" Y="8"/>
              <FormattedText X="55" Y="12" Font="Tahoma" FontSize="9" LineSpacing="12" Adjust="Center" Color="#349F34" Bright="Yes">
                <String>%SEQ   %((A:GPS FLIGHT PLAN WP INDEX, number))%!02d!% - %((A:GPS FLIGHT PLAN WP COUNT, number) 1 -)%!02d!%</String>
              </FormattedText>
            </Element>
               
<!--Thumbwheel text display TENS and UNITS-->      
            <Element>
              <Position X="37" Y="35"/>
              <Text X="10" Y="10" Bright="Yes" Length="2" Font="Arial" Color="0xCDCDCD" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No">
                <String>%((L:F111_Leg_10s, number))%!d!%</String>
              </Text>
            </Element>
           
            <Element>
              <Position X="53" Y="35"/>
              <Text X="10" Y="10" Bright="Yes" Length="2" Font="Arial" Color="0xCDCDCD" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No">
                <String>%((L:F111_Leg_1s, number))%!d!%</String>
              </Text>
            </Element>
<!--Thumbwheel  SUM defined  for  resetting  active leg at last mouse button-->              
            <Element>
              <Position X="55" Y="3"/>
              <Text X="1" Y="1" Bright="Yes" Length="3" Font="Arial" Color="0x000000" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="No">
                <String>%((L:F111_Leg_10s, number) 10 * (L:F111_Leg_1s, number) + (&gt; L:F111_Leg_Sum, number))%!02d!%</String>
              </Text>
            </Element>
           
            <Element>
              <Position X="3" Y="31" />
               <Select>
               <Value>(G:Var1) 0 !=</Value>
                 <Case Value="1">
                    <Image Name="SEQ.bmp" Bright="1"/>
                 </Case>
               </Select>
            </Element>

    </Element>
   
<!--==== BOTTOM ROW BUTTONS====-->
<Mouse>

<Macro Name="Button1">(M:Event) 'RightSingle' scmp 0 == if{ (L:F111_Leg_10s, number) -- 0 max (&gt; L:F111_Leg_10s, number) }
        (M:Event) 'LeftSingle' scmp 0 ==  if{ (L:F111_Leg_10s, number) ++ 9 min (&gt; L:F111_Leg_10s, number) }
        (M:Event) 'WheelUp' scmp 0 == if{ (L:F111_Leg_10s, number) ++ 9 min (&gt; L:F111_Leg_10s, number) }
        (M:Event) 'WheelDown' scmp 0 == if{ (L:F111_Leg_10s, number) -- 0 max (&gt; L:F111_Leg_10s, number) }</Macro>
    <Area Left="32" Top="32" Width="21" Height="25">
  <Tooltip>Tens</Tooltip>
  <Click Kind="LeftSingle+RightSingle+WheelUp+WheelDown">@Button1</Click>
  <Cursor Type="Hand" />
  </Area>

<Macro Name="Button2">(M:Event) 'RightSingle' scmp 0 == if{ (L:F111_Leg_1s, number) -- 0 max (&gt; L:F111_Leg_1s, number) }
        (M:Event) 'LeftSingle' scmp 0 ==  if{ (L:F111_Leg_1s, number) ++ 9 min (&gt; L:F111_Leg_1s, number) }
        (M:Event) 'WheelUp' scmp 0 == if{ (L:F111_Leg_1s, number) ++ 9 min (&gt; L:F111_Leg_1s, number) }
        (M:Event) 'WheelDown' scmp 0 == if{ (L:F111_Leg_1s, number) -- 0 max (&gt; L:F111_Leg_1s, number) }</Macro>
   <Area Left="53" Top="32" Width="21" Height="25">
  <Tooltip>Units</Tooltip>
  <Click Kind="LeftSingle+RightSingle+WheelUp+WheelDown">@Button2</Click>
  <Cursor Type="Hand" />
  </Area>

   <Macro Name="Button3">(L:SACDAT mode,enum) 4 == (L:ChgWPt, number) (A:GPS FLIGHT PLAN WP COUNT, number) 0 &gt;
if{
    (L:F111_Leg_Sum, number) (&gt; L:ChgWPt, number)
    (L:ChgWPt, number) (&gt; C:fs9gps:directToActivateLeg)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanWaypointIndex)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanDirectToWaypoint)
    (L:ChgWPt, number) (&gt; C:fs9gps:FlightPlanActiveWaypoint) }</Macro>
    <Area Left="5" Top="31" Width="23" Height="25">
    <Tooltip>Set SEQ No</Tooltip>
      <Cursor Type="Hand" />
      <Click Kind="LeftSingle"> 12 (>G:Var1) @Button3</Click>
    </Area>  

</Mouse>

</Gauge>

Cheers
Karol

EDIT
Further reference see
scroll down to Reply # 11 , click to enlarge , see lower right .

Please find attached full instrument ,test with FltPln ,
 

Attachments

Last edited:
Back
Top