• 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 Flaps Switch Doesn't Work

Messages
1,084
Country
us-northcarolina
I have a flaps switch that just doesn't work and I can't see why. It shows up on the panel and my XML Validator says there are no errors in the code but the switch does not go up and down so the flaps don't go up or down either. I checked the A: code in the simulator variables list and it looks right. Can anyone help please? Here is the code. If you want switches let me know and I will zip the whole gauge folder.


Code:
<Gauge Name="Wing_Flaps" Version="1.0">
<Element>
    <Select>
    <Value>(G:Var1)</Value>
    <Case Value="0">
    <Image Name="switch_up.bmp"/>
    </Case>
    <Case Value="1">
    <Image Name="switch_down.bmp"/>
    </Case>
    </Select>
   
</Element>

<Mouse>

  <Tooltip>Flaps_Rocker (%((A:FLAPS HANDLE INDEX,number)%{case} %{:0}Up%{:1}Down%{end})"</Tooltip>
  <Cursor Type="Hand"/>
  <Click>(>L:Flaps, bool) ! (>L:Flaps, bool) </Click>  <!-- operates flaps  -->

 </Mouse>
</Gauge>
 
The flap switch image should be controlled by (L:Flaps,bool).

The Click instruction had an extra > sign in it.

Although the flap switch would change position, there was no instruction to put down the flaps or bring them up again, unless that is controlled by (L:Flaps,bool) in part of the model, about which I know nothing :-(

In my own opinion, the Tooltip seems pointless, since if the switch is up so are the flaps, if the switch is down so are the flaps.

Code:
<Gauge Name="Wing_Flaps" Version="1.0">
<Element>
    <Select>
    <Value>(L:Flaps, bool)</Value>
    <Case Value="0">
    <Image Name="switch_up.bmp"/>
    </Case>
    <Case Value="1">
    <Image Name="switch_down.bmp"/>
    </Case>
    </Select>
</Element>

<Mouse>

  <Tooltip>Flaps_Rocker (%((A:FLAPS HANDLE INDEX,number)%{case} %{:0}Up%{:1}Down%{end})"</Tooltip>
  <Cursor Type="Hand"/>
  <Click>(L:Flaps, bool) ! (>L:Flaps, bool)
             (L:Flaps, bool) 1 ==
                   if{ 0 (&gt;K:FLAPS_DOWN)  }
                     els{ 0 (&gt;K:FLAPS_UP)  }
  </Click>  <!-- operates flaps  -->

 </Mouse>
</Gauge>
 
As WarpD says gvar has no value. (So where is the sim going to get its value “0”or 1 from ?)
click spot has no area defined. (Area needs To be set over the switch)
code in click section looks wrong. Double (&gt;L:Flaps, bool) ( or (>L:Flaps, bool) )

should be (L:Flaps, bool) ! (&gt;L:Flaps, bool) but that Lvar is not used nowhere else in the code, or at all.

I don’t see any code that sends a flap command when the switch is moved. If the above xml was moved about and made right, it looks like all it would do is move the flap switch up and down but not actually sent any commands to the sim to ask for a flap movement.
 
BalterOne, thank you Walter, code above works to a point. The switch moves down and the flaps move part way down but when the switch is clicked again, the flaps move back to 0. I have input into the aircraft.cfg, all nine (maximum allowed in fsx) positions 5-10-15-20-25-30-35-40-45 as on the flaps gauge which is the "real" gauge created in xml and works to indicate the flaps moving half way down and stopping. I am guessing that there is something in xml code that says move flaps 5 degrees at a time when the switch is clicked down and likewise move up 5 degrees at a time when the up position is clicked. I am going to see if I can find this code and hope that someone will jump in here because I don't know how at this moment to do that.
 
I presume then that the flap switch/lever is spring loaded or the electronic equivalent. Push it down and the flaps go down to the next position, pull it up and the flaps go up to the next position - and the lever always returns to centre. This in no way mirrors what the switch in your flaps gauge would have ever achieved. It appeared to me me to be controlling a flap system which was simply either up or down, not a multi-stage flap system - and that flaps up/down is what the code I gave provided for. The system you describe is of course achievable in XML, just a little bit more complicated. If I remember correctly some Cessnas had a flap lever that when moved down shifted the flaps down and when moved up shifted the flaps up, but the lever returned to the central position. There must be a flap position indicator in your aircraft so that the pilot knows what position the flaps are in because the lever/switch being centred would give no indication of that.
 
I have a flaps gauge that is calibrated for the nine positions spaced 5 degrees apart. The switch presently is click once it is down and the flaps go down to 10 degrees and stops. It stays down. When it is again clicked it goes up and the flaps go up to 0. It is not spring loaded which I would actually like of else and I believe there is a command in xml to REPEAT clicks and that would work too but I want it to be 5 degrees of flaps at a time up or down. Since I don't know how I hope that you know how to do this.
 
This is just a test to ensure what you really want is being provided by the gauge.

The mouse wheel controls the flaps up/down.

The little number in the middle of the gauge should be the degrees you require.

I suggest a popup for the moment, if it works it can be incorporated into your panel later, with proper switch images.

[Window03]
background_color=0,0,0
size_mm=75,138
window_size_ratio=1.0
position=0
visible=1
ident=10192
zorder=20

gauge01=WB_Flaps!WB_Flaps, 0,0,75,138

Just put the WB_Flaps directory into your gauges directory.

I am pretty certain that gauge developers everywhere will laugh heartily at my attempt - but it might stir up some more professional gauge development expertise from within the forum.
 

Attachments

The switch works just like you said but it only lowers the flaps 15 degrees. The on off switch only lowered them 10 degrees. I HAVE all nine values from 0 to 45 degrees in 5 degree increments in the aircraft.cfg which I know to do so I'm not sure what is going on now. Like you said maybe a "flaps expert" will jump in here.
 
Have you tried lowering and raising the flaps using F6/F7? This would show if your aircraft.cfg file is set up correctly for the flaps. If should also reflect in the number on the WB_Flaps gauge.
 
no I didn't but I will try that and see. You called it right on the head. The aircraft.cfg had the correct degrees but was mis-numbered. When I correctly numbered it not only F6 and F7 work but also the switch that you made for it works perfectly too. I think that I can do a proper 3 position steel switch artwork and use the same code. Thank you. Problem solved. Now all you have to do is figure out how to add belly flaps to the model. Just kidding. Wish I knew how. They were on the real aircraft but never modeled by Milton into his version. I KNOW that would take Blender to do it. The gmax files ARE online I believe Milton Shupe shared all of his but whether the Spartan or not I don't know. Blender and I are "not friendly" LOL!
 
Last edited:
Back
Top