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

Button Not Showing

Messages
10,158
Country
us-arizona
Hey guys,

I am trying to get two different buttons to illuminate, one is NAV and one is GPS. Basically, all it is, is the GPS/NAV selector switch. In this case, its an Element floating amoung other Elements.

My issue appears that I cannot get the bitmaps to 'locate' properly in their respective (different) locations, GPS being below, and NAV being above.

I have tried a few variations, but usually only get GPS to show up. I have tried making them (the two cases) different Elements with variations on naming the strings, but that didnt do anything either.

Presently the gauge only shows up as NAV button. GPS will not illuminate.


Any idea's on what it might be?


Here is the code;

Code:
        <!--  ==========  GPS NAV BUTTON  ============  -->    

   <Element>
       <Element>
          <Position X="634" Y="167"/>
      <Select>
         <Value>(A:GPS drives nav1,bool) !</Value>
         <Case Value="0">
            <Image Name="TruTrack_Green_GPS.bmp" Bright="Yes"/>
         </Case>
      </Select>
       </Element>
       <Element>
          <Position X="632" Y="27"/>
      <Select>
         <Value>(A:GPS drives nav1,bool) !</Value>
         <Case Value="1">
            <Image Name="TruTrack_Green_NAV.bmp"  Bright="Yes"/>
         </Case>
      </Select>
       </Element>
   </Element>

Here is a typical NAV/GPS switch from Aces, cira FS9;

Code:
   <Element>
      <Select>
         <Value>(A:GPS drives nav1,bool) !</Value>
         <Case Value="0">
            <Image Name="Rotor_GPSNav_GPS.bmp" ImageSizes="35,40,56,64"/>
         </Case>
         <Case Value="1">
            <Image Name="Rotor_GPSNav_Nav.bmp" ImageSizes="35,40,56,64"/>
         </Case>
      </Select>
   </Element>

Note that on the above code, the Bitmaps will autolocate to the top corner, so locations/positions need to be put in, but I coudlnt get these/this route to work.

In writing them in two versions of Elements, one using <Case> 0, the other using <Case> 1, only NAV worked. (Does AP need to be on for the GPS button light to go on? I noticed my GPS system reads from GPS to NAV mode when the button is selected).

Here is a similar route I did also;

Code:
  <Element>
          <Position X="634" Y="167"/>
    <Select>
         <Value>(A:GPS drives nav1,bool) !</Value>
       <Case Value="1">
            <Image Name="TruTrack_Green_GPS.bmp" Bright="Yes"/>
       </Case>
    </Select>
  </Element>

In writing it like the above, leaving out the ! symbol in the Value section (at the end) this still only produces a NAV button that shows up, no GPS button when GPS is selected.


Many thanks for any thoughts.


Bill
LHC
 
Last edited:
Here is another route;

Non functioning.



<!-- ========== GPS NAV BUTTON ============ -->


Code:
  <Element>
          <Position X="634" Y="167"/>
    <Select>
         <Value>(A:GPS drives nav1,bool)</Value>
       <Case Value="0">
            <Image Name="TruTrack_Green_GPS.bmp" Bright="Yes"/>
       </Case>
    </Select>
  </Element>


  <Element>
          <Position X="632" Y="27"/>
    <Select>
         <Value>(A:GPS drives nav1,bool)</Value>
       <Case Value="1">
            <Image Name="TruTrack_Green_NAV.bmp"  Bright="Yes"/>
       </Case>
    </Select>
  </Element>
 
Bill,

Your use of <Select> <Case> does not work here. You should make this an if statement.

if 0 GPS els NAV

The Select case is based on the value - if you only have two then it should look like

<Select>
case 0 GPS
case 1 NAV
</Select>

You have

<SELECT>
case 0 GPS
</SELECT>

<SELECT>
case 1 NAV
</SELECT>

That is because you have two elements in different spots on the panel. Microsoft example has it where one overwrites the other same x,y,size.

You are trying two buttons in different places. SO your logic needs to be:

if 0 then Bright GPS and dim NAV els dim GPS bright NAV.


I'm away from my main computer now - I don't have any exact code. I just suggest you rework it to if/els. You may get select case to work, but it too complicated for what you want to do.
 
Bill,

In your case, where you have two elements in different position and you need to show either of them depending on a given value, you don't need to use a <Select> command but instead a <Visible> condition.

In your example:
Code:
   <Element>
       <Element>
         <Position X="634" Y="167"/>
          <Visible>(A:GPS drives nav1,bool)</Value>
          <Image Name="TruTrack_Green_GPS.bmp" Bright="Yes"/>
       </Element>
       <Element>
          <Position X="632" Y="27"/>
          <Visible>(A:GPS drives nav1,bool) !</Value>
          <Image Name="TruTrack_Green_NAV.bmp"  Bright="Yes"/>
       </Element>
   </Element>

Also, the parent <Element> that contains the two image elements is useless in this case because it adds no functionality.

Tom
 
Back
Top