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

Loop selected line colour highlighting - ?

Messages
542
Country
australia
I have the following page in a MFD,
Runway_Select.jpg


The yellow boxed area lists the runways that exist for a previously selected airport.

The following is the relevant Loop that generates those lines,
Code:
 <Element>
    <Position X="28" Y="65"/>
    <FormattedText X="172" Y="110" Bright="Yes" Font="glassga" LineSpacing="9"
      Tabs="0,30,82R,110R,138R,141L" Color="#349F34" FontSize="9" Adjust="Left" >
    <String>
      %((@c:WaypointAirportRunwaysNumber) s2 0 !=)
      %{if}
        %(0 sp1)
        %{loop}
          %(l1 (&gt;@c:WaypointAirportCurrentRunway, number))
          %Rw %((@c:WaypointAirportCurrentRunway, number) 1 + )%!d!:\t
          %((@c:WaypointAirportRunwayDesignation))%!s!\t
          %((@c:WaypointAirportRunwayDirection, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo= }\t
          %((@c:WaypointAirportRunwayLength, feet))%!d!\t
          %((@c:WaypointAirportRunwayWidth, feet)) x %!d!ft\t
          %((@c:WaypointAirportRunwaySurface))%{case}%{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral
            %{:105}Gravel%{:106}Oil%{:107}Steel%{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks
            %{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}\n
          %(l1 ++ s1 l2 &lt; d)
        %{next}
      %{end}
    </String>
    </FormattedText>
  </Element>

Each line has a 'Click' hotspot as shown by the blue rectangle,
There are 12 separate switches in the Mouse section for each line , as per following example.
Code:
      <!--==== RUNWAYS    ====--> 
      <!-- select Runway from   list -->

  <Area Left="26" Top="66" Width="64" Height="8">
  <Visible>
  (L:DAT37 mode,enum) 3 ==
     (L:APT_Nrst_select, number) 9 ==
   (@c:WaypointAirportRunwaysNumber) 0 &gt; and  and
  </Visible>
  <Cursor Type="Hand"/> 
  <Click>0 (&gt;L:RWY_Line_No, number)
         (L:RWY_Line_No, number) (>@c:WaypointAirportCurrentRunway, number)</Click>   
  </Area>

  <Area Left="26" Top="75" Width="64" Height="8">
  <Visible>
  (L:DAT37 mode,enum) 3 ==
     (L:APT_Nrst_select, number) 9 == 
   (@c:WaypointAirportRunwaysNumber) 1 &gt; and  and
  </Visible>
  <Cursor Type="Hand"/>
  <Click>1 (&gt;L:RWY_Line_No, number)
         (L:RWY_Line_No, number) (>@c:WaypointAirportCurrentRunway, number)</Click>   
  </Area>

The orange boxed area reflects and indicates which specific runway has been selected,
code as follows.
Code:
<!-- Selected Runway Heading Readout -->
        <Element>
          <Position X="40" Y="166" />
            <FormattedText X="145" Y="10" Font="Tahoma" FontSize="9" LineSpacing="10" Adjust="Left" Color="#93FF72" Bright="Yes">
              <String>%((L:RWY_Line_No, number) (>@c:WaypointAirportCurrentRunway, number))%((@c:WaypointAirportRunwayDesignation))%!s!% 
              %Selected Rwy Hdg : %((@c:WaypointAirportRunwayDirection, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!%</String>
          </FormattedText> 
       </Element>

As can be seen the selection text indicator overlies the 12th line of possible runways.

I would like to have the selected runway indicated by a "Different colour line" within the loop.

ie; click a line and that line changes colour to a second colour , from green to yellow.

Any help on how to configure the loop to achieve that effect would be appreciated.

Cheers
Karol
 
Hi Karol,

LocarVarsLogger utility (included in XMLTools package) contains those effects that you want to achieve. Even it includes an example on how to manage positional clicks using a single mouse area.
You could inspect the code to find how it works.

Tom
 
Hi Tom

Thank you , I will have a look at that.
I have made various attempts to date , with some interesting technicolour results , mostly humerous.
My instrument works nicely but little refinements are always worth the effort.

Cheers
Karol
 
Just add this...
Code:
.....
<Color Value="Yellow"/>
.....
%((L:RWY_Line_No, number) l1 ==)%{if}\{clr2}%{else}\{clr}%{end}
.....
... in your code:
Code:
<FormattedText X="172" Y="110" Bright="Yes" Font="glassga" LineSpacing="9" Tabs="0,30,82R,110R,138R,141L" Color="#349F34" FontSize="9" Adjust="Left">
<Color Value="Yellow"/>
<String>
    %((@c:WaypointAirportRunwaysNumber) s2 0 !=)
    %{if}
        %(0 sp1)
        %{loop}
            %((L:RWY_Line_No, number) l1 ==)%{if}\{clr2}%{else}\{clr}%{end}
            %(l1 (>@c:WaypointAirportCurrentRunway, number))
            %Rw %((@c:WaypointAirportCurrentRunway, number) 1 + )%!d!:\t
            %((@c:WaypointAirportRunwayDesignation))%!s!\t
            %((@c:WaypointAirportRunwayDirection, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo= }\t
            %((@c:WaypointAirportRunwayLength, feet))%!d!\t
            %((@c:WaypointAirportRunwayWidth, feet)) x %!d!ft\t
            %((@c:WaypointAirportRunwaySurface))%{case}%{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral
            %{:105}Gravel%{:106}Oil%{:107}Steel%{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks
            %{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}\n
            %(l1 ++ s1 l2 &lt; d)
        %{next}
    %{end}
</String>
</FormattedText>

Edit: in FormatedText you can add BackgroundColor="#0f0f0f" or the appropriate color for your background (other than #000000) to make the text look better in Windows Vista/7/8.
 
Last edited:
Hi Luka

Thank you for the above code , it worked beautifully .
Following composite shot shows it in use,
1. Airport selection.
2. Runway selection (old text at bottom of display will be removed)
3. Initial runway heading (164) selected.
4. Other runway end heading (344) selected
( both 3 and 4 provide precise ILS style guidance , "RWY button" toggles either runway end )
5. ILS bars centred for 3 degree glideslope to runway 164 ( red spot = 17L ) , also ( yellow spot = 17R ) .

Cheers
Karol

MP4.jpg
 
Last edited:
For information.
When I removed from Page 2 the lower 'Selected runway' text line the differential colour line 'Rw 5:' still worked as required.
However, when I went to Page 3 (the page with ILS graphics) the following runway data
"17L-35R 164 4386 x 95ft"
did not update to reflect subsequent changes in runway selection made in Page 2,
the problem was resolved by adding
Code:
%((L:RWY_Line_No, number) (>@c:WaypointAirportCurrentRunway, number))%
at the very end of the loop.

The loop element is now as follows,
Code:
  <Element>
    <Position X="28" Y="65"/>
    <FormattedText X="172" Y="110" Bright="Yes" Font="glassga" LineSpacing="9"
      Tabs="0,30,82R,110R,138R,141L" Color="#349F34" BackgroundColor="#0f0f0f" FontSize="9" Adjust="Left" >
      <Color Value="Orange"/>
    <String>
      %((@c:WaypointAirportRunwaysNumber) s2 0 !=)
      %{if}
        %(0 sp1)
        %{loop}
          %((L:RWY_Line_No, number) l1 ==)%{if}\{clr2}%{else}\{clr}%{end}
          %(l1 (&gt;@c:WaypointAirportCurrentRunway, number))
          %Rw %((@c:WaypointAirportCurrentRunway, number) 1 + )%!d!:\t
          %((@c:WaypointAirportRunwayDesignation))%!s!\t
          %((@c:WaypointAirportRunwayDirection, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo= }\t
          %((@c:WaypointAirportRunwayLength, feet))%!d!\t
          %((@c:WaypointAirportRunwayWidth, feet)) x %!d!ft\t
          %((@c:WaypointAirportRunwaySurface))%{case}%{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral
            %{:105}Gravel%{:106}Oil%{:107}Steel%{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks
            %{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}\n
          %(l1 ++ s1 l2 &lt; d)
        %{next}
      %{end}
      %((L:RWY_Line_No, number) (>@c:WaypointAirportCurrentRunway, number))%
    </String>
    </FormattedText>
  </Element>

The above is probably due to the page structure that I am using in the MFD ,
both page 2 and 3 are in part dependant on a selection and data from the previous page.

The instrument now covers every airport in the Sim database ,
- the ICAO can be entered or selected from the nearest airports listing
- any airport runway can be selected
- either end of a runway can be selected/toggled
- ILS precision approaches can be made at either end
- it provides Distance , Bearing and circuit data
- glideslope is by default set at 3.00 degrees , but can be changed to suit user , ie; short field approach/landings

Airports - runways can be selected at any distance from the user aircraft

Cheers
Karol
 
Back
Top