• 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 Flap Gauge Coding

Messages
76
Country
unitedkingdom
Hi all,

Sorry I am a bit stuck on this one and not sure if it can be done in a 2D gauge is there anyway you can clicl the flap lever down or up and returns to center after each click.
e.g do drop 3 notches of flap you will have to push it three times and image always centered.

I have looked through SDK and Forum search and drawn a blank below is all I have so far.

Any help would be graciously received

Cheers
Matt

XML:
<Gauge Name="Flaps" Version="1.0">
<Element>
<Select>
 <Value>(A:Flaps handle index,number)</Value>
<Case Value="0">
 <Image Name="flaps1.bmp"/>
 </Case>
<Case Value="1">
 <Image Name="flaps2.bmp"/>
 </Case>
<Case Value="2">
 <Image Name="flaps3.bmp"/>
 </Case>
 </Select>
 </Element>
<Mouse>
<Area Height="100" Width="100" Top="100" Left="0">
 <Cursor Type="DownArrow"/>
 <Click Repeat="Yes" Event="FLAPS_DECR"/>
 </Area>
<Area Height="100" Width="100" Top="0" Left="0">
 <Cursor Type="UpArrow"/>
 <Click Repeat="Yes" Event="FLAPS_INCR"/>
 </Area>
 </Mouse>
 </Gauge>

moOhkTt.png


ndBUq4t.png


W7WVwW3.png
 
Last edited:
Messages
840
Country
indonesia
Your mouse areas are way too complicated.
Try;
XML:
<Area Top="0" Bottom="100">
 <Cursor Type="DownArrow"/>
 <Click Repeat="Yes" Event="FLAPS_DECR"/>
 </Area>
<Area Top="100" Bottom="200">
 <Cursor Type="UpArrow"/>
 <Click Repeat="Yes" Event="FLAPS_INCR"/>
 </Area>
Now that you've got that working you can think about adding conditionals into your case values to have it do what you wanted to do in your first post.
But I'd be worried about not knowing your flap position if the handle is always in the centre.
 
Messages
440
Country
us-wisconsin
You could do this in a few ways, below are some examples.
The first one relies on a simple timer,the second one relies on a click type handler.
Neither one has been tested live but code examples have been used before.
XML:
<Gauge Name="Flaps" Version="1.0">
    <Update>
        (G:Var1) s1 0 != if{
            l1 0 &gt; if{ l1 1 - } els{ l1 1 + } (>G:Var1)
        }
    </Update>
    <Element>
        <Select>
            <Value>l1 0 == if{ 0 } els{ l1 0 &lt; if{ 2 } els{ 1 } } </Value>
            <Case Value="0"> <!-- SWITCH CENTER -->
                <Image Name="flaps1.bmp"/>
             </Case>
            <Case Value="1"> <!-- SWITCH UP -->
                <Image Name="flaps2.bmp"/>
             </Case>
            <Case Value="2"> <!-- SWITCH DOWN -->
                <Image Name="flaps3.bmp"/>
             </Case>
         </Select>
     </Element>
    <Mouse>
    <!-- THE 9 / -9 IS THE TIMER VALUE, IN THIS CASE 9 / -9 IS EQUIVALENT TO 1/2 SECOND -->
        <Area Height="100" Width="100" Top="0" Left="0">
             <Cursor Type="UpArrow"/>
             <Click Repeat="No">
                9 (>G:Var1) (>K:FLAPS_DECR)
            </Click>
         </Area>
        <Area Height="100" Width="100" Top="100" Left="0">
             <Cursor Type="DownArrow"/>
             <Click Repeat="No">
                -9 (>G:Var1) (>K:FLAPS_INCR)
            </Click>
         </Area>
     </Mouse>
</Gauge>


XML:
 <Gauge Name="Flaps" Version="1.0">
    <Element>
        <Select>
            <Value>(G:Var1)</Value>
            <Case Value="0"> <!-- SWITCH CENTER -->
                <Image Name="flaps1.bmp"/>
             </Case>
            <Case Value="1"> <!-- SWITCH UP -->
                <Image Name="flaps2.bmp"/>
             </Case>
            <Case Value="2"> <!-- SWITCH DOWN -->
                <Image Name="flaps3.bmp"/>
             </Case>
         </Select>
     </Element>
    <Mouse>
        <Area Height="100" Width="100" Top="0" Left="0">
             <Cursor Type="UpArrow"/>
             <Click Repeat="No" Kind="LeftSingle+LeftRelease+Leave">
                (M:Event) 'LeftSingle' scmp 0 == if{
                    1 (>G:Var1) (>K:FLAPS_DECR)
                } els{
                    0 (>G:Var1)
                }
            </Click>
         </Area>
        <Area Height="100" Width="100" Top="100" Left="0">
             <Cursor Type="DownArrow"/>
             <Click Repeat="No" Kind="LeftSingle+LeftRelease+Leave">
                (M:Event) 'LeftSingle' scmp 0 == if{
                    2 (>G:Var1) (>K:FLAPS_INCR)
                } els{
                    0 (>G:Var1)
                }
            </Click>
         </Area>
     </Mouse>
</Gauge>
 
Last edited:

tgibson

Resource contributor
Messages
11,338
Country
us-california
Hi,

Many older planes used levers of this type, usually combined with a flaps position gauge. Often you moved the lever to the center position to avoid keeping pressure in the hydraulic control lines for long periods of time (or similar issues). Many aircraft did the same thing for landing gear levers.
 
Messages
76
Country
unitedkingdom
Thank you gentlemen will make the adjustments and give it a whirl. Don't worry Chris there is a flap gauge as well. Nearly finished pic below Commander 115 pleased with cowl flap. As it is a pull out job it gets larger the more open the cowls get.

114.jpg
 
Messages
76
Country
unitedkingdom
Quick Update

I have the Gauge working I tried both The timer gauge works well and I will be using that one.
The second one did not move the .bmps

Spokes and Chris thank you both so much for your time.

Cheers
Matt


you-rock-250.jpg
 
Messages
440
Country
us-wisconsin
Matt,
The second one is all my fault - not enough coffee when written, hehe..
Corrected now and should work although not tested. Available as an example.

Roman
 
Messages
840
Country
indonesia
Roman! You've ruined my day :)
Just got into work (boring babysitting job) and I find it's all done.
Now what am I going to do for the rest of the day?
 
Messages
76
Country
unitedkingdom
Lol no worries Roman I will test it a bit later and let you know if it world thanks again.

Thanks Chris for the thought
 
Top