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

Three-position selector

Messages
126
Country
italy
<Element>
<Position X="200" Y="49"/>
<Select>
<Value>......?........</Value>
<Case Value="0">
<Image Name="ALT_HOLD.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="1">
<Image Name="OFF.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="2">
<Image Name="ALT_SEL.bmp" ImageSizes="34,42"/>
</Case>
</Select>
</Element>


<Mouse>
<Area Left="393" Top="49" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>.........?.............</Click>
</Area>

<Area Left="393" Top="82" Width="32" Height="32">
<Cursor Type="Hand"/>
<Click>............?..................</Click>
</Area>

<Area Left="393" Top="114" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>..............?................</Click>
</Area>
<\Mouse>

How can I do?
 
Last edited:
Original

Code:
<Element>
<Position X="200" Y="49"/>
<Select>
<Value>(L:ALT_MODE,Bool)</Value>
<Case Value="0">
<Image Name="ALT_HOLD.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="1">
<Image Name="OFF.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="2">
<Image Name="ALT_SEL.bmp" ImageSizes="34,42"/>
</Case>
</Select>
</Element>


<Mouse>
<Area Left="393" Top="49" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>0 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="82" Width="32" Height="32">
<Cursor Type="Hand"/>
<Click>1 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="114" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>2 (>L:ALT_MODE,Bool).</Click>
</Area>
<\Mouse>

The L:var by default will be a value of 0 so might be a good idea to make the off image case 0 rather than case 1.

Code:
<Element>
<Position X="200" Y="49"/>
<Select>
<Value>(L:ALT_MODE,Bool)</Value>
<Case Value="0">
<Image Name="OFF.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="1">
<Image Name="ALT_HOLD.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="2">
<Image Name="ALT_SEL.bmp" ImageSizes="34,42"/>
</Case>
</Select>
</Element>


<Mouse>
<Area Left="393" Top="49" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>0 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="82" Width="32" Height="32">
<Cursor Type="Hand"/>
<Click>1 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="114" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>2 (>L:ALT_MODE,Bool).</Click>
</Area>
<\Mouse>
 
<Element>
<Position X="833" Y="92"/>
<Select>
<Value>(L:ALT_MODE,Bool)</Value>
<Case Value="0">
<Image Name="ALT_HOLD.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="1">
<Image Name="OFF.bmp" ImageSizes="34,42"/>
</Case>
<Case Value="2">
<Image Name="ALT_SEL.bmp" ImageSizes="34,42"/>
</Case>
</Select>
</Element>

<Element>
<Visible>(A:Circuit general panel on, bool) (A:Autopilot master,bool) &amp;&amp;</Visible>
<Position X="840" Y="69"/>
<Select>
<Value>(A:Autopilot master, bool) (A:Autopilot altitude lock, bool) &amp;&amp;</Value>
<Case Value="1">
<Image Name="AP_LITE.bmp" Bright="Yes" ImageSizes="15,15"/>
</Case>
</Select>
</Element>



<Element>
<Visible>(A:Circuit general panel on, bool) (A:Autopilot master,bool) &amp;&amp;</Visible>
<Position X="840" Y="135"/>
<Select>
<Value>(A:Autopilot master, bool) (A:ALTITUDE_HOLD_ARM, bool) &amp;&amp;</Value>
<Case Value="1">
<Image Name="AP_LITE.bmp" Bright="Yes" ImageSizes="15,15"/>
</Case>
</Select>
</Element>

<Mouse>


<Area Left="825" Top="65" Width="47" Height="27">
<Cursor Type="Hand"/>
<Click>0 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="825" Top="92" Width="47" Height="38">
<Cursor Type="Hand"/>
<Click>1 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="825" Top="130" Width="47" Height="23">
<Cursor Type="Hand"/>
<Click>2 (>L:ALT_MODE,Bool).</Click>
</Area>

<Area Left="832" Top="66" Width="20" Height="20">
<Cursor Type="Hand"/>
<Tooltip>Altitude Hold</Tooltip>
<Click>(L:AUTOPILOT_SELECT, number) 0 != (L:FLIGHT DIRECTOR SWITCHES, enum) 0 != || (L:AP_TURBULENCE_MODE,bool) ! &amp;&amp; (L:AP_GLIDESLOPE_MODE, enum) 2 != &amp;&amp; if{ 5 (A:Autopilot altitude lock, bool) (L:AP_PITCH_MODE, enum) 1 == &amp;&amp; if{ (&gt;K:AP_PANEL_ALTITUDE_OFF, bool) 0 (&gt;L:AP_PITCH_MODE, enum) (A:Autopilot master, bool) ! (L:FLIGHT DIRECTOR SWITCHES, enum) 0 == (A:AUTOPILOT FLIGHT DIRECTOR ACTIVE,bool) &amp;&amp; &amp;&amp; if{ (&gt;K:TOGGLE_FLIGHT_DIRECTOR,bool) } } els{ (&gt;K:AP_PANEL_ALTITUDE_ON, bool) 1 (&gt;L:AP_PITCH_MODE, enum) (A:Indicated Altitude, feet) (&gt;K:AP_ALT_VAR_SET_ENGLISH) } }</Click>
</Area>


<Area Left="832" Top="132" Width="20" Height="20">
<Tooltip>Altitude Arming Capture Switch</Tooltip>
<Cursor Type="Hand"/>
<Click>(A:Autopilot master, bool) (L:FLIGHT DIRECTOR SWITCHES, enum) 0 != || (L:AP_TURBULENCE_MODE,bool) ! &amp;&amp; if{ 5(L:ALTITUDE_HOLD_ARM, bool) ! (&gt;L:ALTITUDE_HOLD_ARM, bool) }</Click>
</Area>

<\mouse>
 
Code:
<Mouse>
<Area Left="393" Top="49" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>0 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="82" Width="32" Height="32">
<Cursor Type="Hand"/>
<Click>1 (>L:ALT_MODE,Bool)</Click>
</Area>

<Area Left="393" Top="114" Width="32" Height="33">
<Cursor Type="Hand"/>
<Click>2 (>L:ALT_MODE,Bool).</Click>
</Area>
<\Mouse>

Bools are either 0 or 1, try (>L:ALT_MODE, number) instead.

Or maybe it doesn't matter with L:Vars ?

cheers,
Lane
 
The "dirty little secret" is that it truly does not matter. However, for human comprehension, it make sense to use "bool" for Boolean (on/off) operations, and "enum" or "number" for any variable over two possibilities.
 
I'm trying another way, but the images do not appear equally.
For the image ALT_HOLD not even appear the cursor:

<Element>
<Position X="830" Y="110"/>
<Select>
<Value>(L:ALTITUDE_HOLD_ARM, bool)</Value>
<Case Value="1">
<Image Name="ALT_SEL.bmp" Bright="Yes" ImageSizes="38,27"/>
</Case>
</Select>
</Element>

<Element>
<Position X="830" Y="83"/>
<Select>
<Value>(A:Autopilot altitude lock, bool) (L:AP_PITCH_MODE, enum) 1 == &amp;&amp;</Value>
<Case Value="1">
<Image Name="ALT_HOLD.bmp" Bright="Yes" ImageSizes="38,27"/>
</Case>
</Select>
</Element>


<Mouse>

<Area Left="830" Top="83" Width="38" Height="27">
<Tooltip>Altitude Hold</Tooltip>
<Click>(L:AUTOPILOT_SELECT, number) 0 != (L:FLIGHT DIRECTOR SWITCHES, enum) 0 != || (L:AP_TURBULENCE_MODE,bool) ! &amp;&amp; (L:AP_GLIDESLOPE_MODE, enum) 2 != &amp;&amp; if{ 5 (A:Autopilot altitude lock, bool) (L:AP_PITCH_MODE, enum) 1 == &amp;&amp; if{ (&gt;K:AP_PANEL_ALTITUDE_OFF, bool) 0 (&gt;L:AP_PITCH_MODE, enum) (A:Autopilot master, bool) ! (L:FLIGHT DIRECTOR SWITCHES, enum) 0 == (A:AUTOPILOT FLIGHT DIRECTOR ACTIVE,bool) &amp;&amp; &amp;&amp; if{ (&gt;K:TOGGLE_FLIGHT_DIRECTOR,bool) } } els{ (&gt;K:AP_PANEL_ALTITUDE_ON, bool) 1 (&gt;L:AP_PITCH_MODE, enum) (A:Indicated Altitude, feet) (&gt;K:AP_ALT_VAR_SET_ENGLISH) } }</Click>
</Area>

<Area Left="830" Top="110" Width="38" Height="27">
<Tooltip>Altitude Arming Capture Switch</Tooltip>
<Cursor Type="Hand"/>
<Click>(A:Autopilot master, bool) (L:FLIGHT DIRECTOR SWITCHES, enum) 0 != || (L:AP_TURBULENCE_MODE,bool) ! &amp;&amp; if{ 5 (L:ALTITUDE_HOLD_ARM, bool) ! (&gt;L:ALTITUDE_HOLD_ARM, bool) }</Click>
</Area>

<\Mouse>
 
I use "Bool" for switches no matter how many positions it has. And for counters and logic codes i use "NUMBER". This way i still know it's for a switch and not a counter or logic code!:idea:

&amp;&amp; .....This code take more time to write so you can just use "and"
 
Last edited:
Here's a complex switch which has four positions. It works a little bit like a springloaded joystick (having sometimes to be held in a position) but it also has a central neutral position and a fixed position while a variable is of a certain value. The switch also operates a valve with a white rotating disc indicating by how much the valve is open. The valve (not this code) will also indicate crosslined when closed which triggers this switch to return to the neutral position. Part of the code 2 (>L:SPILL,number) is tested by the cabin pressurisation code for a leak as it were. So if the spill valves are not set correctly on the ground you'll get a shock at 10,000ft!

Code:
<Gauge Name="LEFT SPILL VALVE" Version="1.0">
<Update>
(L:SetSpill,bool) 0 ==
   if{
      2 (>L:SPILL, number) 100 (>L:spill_segment,enum)
      1 (>L:SetSpill, bool)
   }
</Update>

   <Element>
      <Select>
         <Value>(L:SPILLSWITCH,number)</Value>
         <Case Value="0">
            <Image Name="L_spill_off.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="L_spill_shut.bmp"/>
         </Case>
         <Case Value="2">
            <Image Name="L_spill_norm.bmp"/>
         </Case>
         <Case Value="3">
            <Image Name="L_spill_spill.bmp"/>
         </Case>
      </Select>
   </Element>

  <Mouse>
<Tooltip>Left Spill Valve %((L:spill_segment,enum) near)%!d!%%</Tooltip>
      <Area Left="0" Top="22" Right="13" Bottom="39">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle+LeftRelease" Repeat="Yes">
            (M:Event) 'LeftSingle' scmp 0 == if{ 0 (>L:SPILL,number) 1 (>L:SPILLSWITCH,number) (L:spill_segment,enum) 0 &gt;
if{ (L:spill_segment,enum) -- (>L:spill_segment,enum) } }
         (M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:SPILL,number) 0 (>L:SPILLSWITCH,number) (L:spill_segment,enum) 0 &gt;
if{ (L:spill_segment,enum) -- (>L:spill_segment,enum) } }
        </Click>
      </Area>

      <Area Top="0" Bottom="12">
         <Cursor Type="Hand"/>
         <Click>1 (>L:SPILL,number) 73 (>L:spill_segment,enum) 2 (>L:SPILLSWITCH,number) 1 (>L:Sound_click,enum)</Click>
      </Area>
      <Area Left="14" Top="22" Right="25" Bottom="39">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle+LeftRelease" Repeat="Yes">
            (M:Event) 'LeftSingle' scmp 0 == if{ 2 (>L:SPILL,number) 3 (>L:SPILLSWITCH,number) (L:spill_segment,enum) 100 &lt;
if{ (L:spill_segment,enum) ++ (>L:spill_segment,enum) } }
          (M:Event) 'LeftRelease' scmp 0 == if{ 2 (>L:SPILL,number) 0 (>L:SPILLSWITCH,number) (L:spill_segment,enum) 100 &lt;
if{ (L:spill_segment,enum) ++ (>L:spill_segment,enum) } }
        </Click>
      </Area>

   </Mouse>
</Gauge>
 
I solved the problem above.
Now there are only two selectors and I'm done.
We start from the first:
Four positzioni: Turb (not simulated), off, V \ S, IAS (not simulated)
The code is as follows:

<Element>
<Position X = "800" Y = "41" />
<Image Name = "AP_SEL_KNOB.bmp" ImageSizes = "52.57" PointsTo = "North">
<Axis X = "26" y = "26" />
</ Image>
<Rotate>
<Minimum Value = "0" Maximum = "3"> (AUTOPILOT_CLIMB_MODE_SELECTED, number) </ Value>
<Nonlinearity>

<Item Value = "0" Degrees = "240" />
<Item Value = "1" Degrees = "270" />
<Item Value = "2" Degrees = "300" />
<Item Value = "3" Degrees = "330" />
</ Nonlinearity>
</ Rotate>
</ Element>


<Mouse>

<Area Left = "755" top = "27" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 0 (& gt; L: AUTOPILOT_CLIMB_MODE_SELECTED, number) 1 .......................... </ Click>
</ Area>

<Area Left = "770" Top = "3" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 1 (& gt; L: AUTOPILOT_CLIMB_MODE_SELECTED, number) ......................... 0 </ Click>
</ Area>

<Area Left = "810" Top = "2" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 2 (& gt; L: AUTOPILOT_CLIMB_MODE_SELECTED, number) ............................... 1 .......... </ Click>
</ Area>

<Area Left = "840" top = "24" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 3 (& gt; L: AUTOPILOT_CLIMB_MODE_SELECTED, number) ............................... 1 .... </ Click>

</ Area>

<\ Mouse>

Sections <area> working properly, because I tried them on the simulator, but
The selector "AP_SEL_KNOB.bmp" does not rotate
 
Try :-
<Axis X= "26" Y= "26" />
also,
<Value Minimum= "0" Maximum= "3">(AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Value>

Regards, Ted.
 
Last edited:
(AUTOPILOT_CLIMB_MODE_SELECTED, number) should be something like (L:AUTOPILOT_CLIMB_MODE_SELECTED, number)
 
Code:
<Element>
<Position X = "800" Y = "41" />
<Image Name = "AP_SEL_KNOB.bmp" ImageSizes = "52,57" PointsTo = "North">
<Axis X="26" Y="26" />
</ Image>
<Rotate>
<Value Minimum= "0" Maximum = "3"> (L:AUTOPILOT_CLIMB_MODE_SELECTED, number) </ Value>
<Nonlinearity>
<Item Value = "0" Degrees = "240" />
<Item Value = "1" Degrees = "270" />
<Item Value = "2" Degrees = "300" />
<Item Value = "3" Degrees = "330" />
</ Nonlinearity>
</ Rotate>
</ Element>


<Mouse>
<Area Left = "755" top = "27" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 0 (&gt;L: AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Click>
</ Area>

<Area Left = "770" Top = "3" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 1 (&gt;L: AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Click>
</ Area>

<Area Left = "810" Top = "2" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 2 (&gt;L: AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Click>
</ Area>

<Area Left = "840" top = "24" width = "20" Height = "20">
<Cursor Type = "Hand" />
<Click Repeat = "Yes"> 3 (&gt;L: AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Click>

</ Area>

</Mouse>
 
Last edited:

It looks like a syntax problem -
<Axis X = "26" y = "26" /> the Y designator should be upper case <Axis X= "26" Y= "26" />

<Minimum Value = "0" Maximum = "3"> (AUTOPILOT_CLIMB_MODE_SELECTED, number) </ Value> the start tag '<Minimum' does not match the end tag '</ Value>' so just reverse the order of the first two words <Value Minimum= "0" Maximum= "3">(L:AUTOPILOT_CLIMB_MODE_SELECTED, number)</ Value>
 
Last edited:
Back
Top