FSX GS Lock light (2d Gauge)

#1
Hi all,

Sorry me again happily charging through a new panel and I am stuck on this one. Looked at Simulation Variables and 3D Cockpit has gauge but cant this one to work.
Sometimes I think I am getting this damn code then I cant fix it.

Code below basically want a light to go on when aircraft coupled to the approach on auto.

XML:
<Gauge Name="GSLOC" Version="1.0">
 <Image Name="1greenoff.bmp"/>
<Element>
 <Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &&&</Visible>
<Element>
<Select>
 <Value>(A:NAV HAS GLIDE SLOPE:1, bool)</Value>
<Failures>
 <SYSTEM_ELECTRICAL_PANELS Action="0"/>
 </Failures>
<Case Value="0">
 <Image Name="1greenoff.bmp" Bright="Yes"/>
 </Case>
<Case Value="1">
 <Image Name="1greenon.bmp" Bright="Yes"/>
 </Case>
 </Select>
 </Element>
 </Element>
Thanks a million
Matt
 
#2
Hi

I have never seen "&&&" being used. I would have put just "and and" as in
XML:
<Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) and and </Visible>
 
#3
I agree, the &&& is odd. If you wanted to and all of that, there's only two steps & & not three & & & and I don't know that they should be up against each other. Also, using 'and' instead of & may be easier to read.
 
#4
Or you could use:

XML:
<Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &gt; &gt; </Visible>
 
#7
Well, NAV HAS GLIDE SLOPE only tells you if the nav you're tuned to has a glideslope present. It doesn't mean you've got a good signal.
 
#8
That's all I am after Warp just trying to match up a gauge on pre-existing panel basically comes on when ac auto is locked on GS.
However I have done the changes and it is still not working so I am kinda of stuck accorong to the SDK it needs to be indexed and that's why I put number 1 there
but think that is problem changed code below.

Thanks all

XML:
<Gauge Name="GSLOC" Version="1.0">
 <Image Name="1greenoff.bmp"/>
<Element>
 <Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) (A:ELECTRICAL MASTER BATTERY, bool) &gt; &gt;</Visible>
<Element>
<Select>
 <Value>(A:NAV HAS GLIDE SLOPE:1, bool)</Value>
<Failures>
 <SYSTEM_ELECTRICAL_PANELS Action="0"/>
 </Failures>
<Case Value="0">
 <Image Name="1greenoff.bmp" Bright="Yes"/>
 </Case>
<Case Value="1">
 <Image Name="1greenon.bmp" Bright="Yes"/>
 </Case>
 </Select>
 </Element>
 </Element>
<Mouse>
 <Help ID="HELPID_GAUGE_GS_LIGHT"/>
 </Mouse>
 </Gauge>
 
#10
Hi Walter,

Well the 1greenon Light is the bright bmp so when it is locked on GS that bmp should come on but it doesn't.
The one in the 3d Cockpit goes bright but mine doesn't.

1greenoff


1greenon



Cheers
Matt
 
#11
Matt,

the 1greenoff light should be dark at the start of the scenario and then go bright when all the circuits and battery are on. If it does go bright then it means that the Visible condition is working fine. Just a way of eliminating problems...
 
Last edited:
#12
Not really as Just want to go on when it has Nav 1 is locked on Glideslope but should the electric go out I wanted light to go out aswell so it was more realistic.
 
#13
A couple of things:

First, try (A:NAV1 HAS GLIDESLOPE, bool) .

Second, test A:Var bools for equal to zero, or not equal to zero. Don't test them for equal to one. We sometimes assume that if Nav 1 has glideslope, the bool will return 1, but the value returned depends on the source. It's 1 when the signal comes from the GPS, or -1 when it comes from a radio source, and 0 when invalid or no signal.

Third, use a 'debug' utility such as BlackBox3 (Robbie McElrath), LocalVarsLogger in XMLTOOLS (Tom Aguilo), or the XML Var debug utility from Doug Dawson's website. It is a tremendous help to see the value that A:Vars or L:Vars are actually returning as you create a gauge.

Bob
 
Last edited:
#14
Hi Bob

Thank you I will download those and see if they help me. Although I did get the gauge wrong basically it only comes on and when locked on approach with autopilot however should deviate from the approach to much it will go out. So it is not just seeing if Nav 1 has Glide Slope I have gone through the SDK and cant see anything that resembles what this gauge is actually doing. I have put a a screen shot below so you can see it working in action it is just above the Artificial Horizon. So know I am at a bit of a loss second to last gauge made 35 of the things only to stumble on last two.

 
#15
Try using (A:HSI CDI needle, number) and/or (A:HSI GSI needle, number) together with (A:NAV1 HAS GLIDESLOPE, bool). When (A:HSI CDI needle, number) or (A:HSI GSI needle, number) exceed a certain value, the light goes off.
 
#16
I use

Code:
      (A:NAV HAS GLIDE SLOPE:1,bool) -1 ==
and this works.

<!-- **** Macro Glideslope alive min 119 max 119 **** -->
-118 118 (L:HSI_GSI_NEEDLE,number) rng


<!-- **** Macro Localizer alive max 127 min 127 **** -->
-125 125 (L:HSI_CDI_NEEDLE,number) rng
 
#18
Ähh sorry:(
this an excerpt from a gauges.

Of course i meant the A: variable!!

Code:
(A:HSI CDI NEEDLE,number)

(A:HSI GSI NEEDLE,number)
Sorry again
 

rcbarend

Resource contributor
#20
Hi Matt,

Some additional comment, apart from that posted above by other people.

First off (assuming this aircraft uses the default FSX AP functions): FSX has NO direct A:var that indicates that the AP has actually intercepted/is-locked-onto the Glideslope.
Which is, I assume, the purpose of this gauge.
So a GlideSlope-Lock gauge can only be derived from the state/value of other A:var's.

Best bet is to test for the condition:
(A:HSI GSI NEEDLE VALID,bool) being True, AND (A:HSI GSI NEEDLE,number) staying within certain values (min. -119 to max. +119); so like between -40 and +40 or so.

That said:
The only other criterium I know of, that actually tells you that the FSX AP function intercepts/starts-to-follow the GlideSlope, is:
Assuming that you are doing an approach with (A:AUTOPILOT APPROACH HOLD,bool) On, and (A:AUTOPILOT ALTITUDE LOCK,bool) On (so you are flying on AP "into" the GlideSlope), is that the FSX AP will set (A:AUTOPILOT ALTITUDE LOCK,bool) to Off at the point where it intercepts the Glideslope.
But, again, this test is only usefull for the point-of-interception; to monitor if it holds the GlideSlope you have to build in a test on (A:HSI GSI NEEDLE,number) values.


Rob
 
Top