Archived

This topic is now archived and is closed to further replies.

Slammer

How to show ADI GS/LOC flag momentary

Recommended Posts

Hi all,I'm trying to show the GS and LOC flags of my ADI for the first 10 seconds when they become active (trigger is: (A:HSI GSI needle valid, bool) or (A:HSI has localizer, bool)) and simulates that the GS and LOC signals are unreliable, after 10 seconds the bitmaps have to disappear. One important factor is that the INS is alligned before it can be activated. This happens when (L:AVCS-INS, enum) 2=I've searched this forum, found some issues concerning this matter, but wasn't fruitfull. I think i end up in somekind of loop because during (A:HSI GSI needle valid, bool) or (A:HSI has localizer, bool) the bitmaps may only be shown for 10 seconds while the function of the GS or LOC will stay on (1).Can anybody help me out on this one?Greets Slammer

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You will need to concantanate your desired conditions. In simple english, here's the prototype:IF (MyVariable) is true AND (GSI Needle) is true AND (Current Time) is less than (Current Time) + 10 seconds THEN (1) ELSE (0)Translated to XML it would be something like this:

(L:AVCS-INS, enum) 2 ==(A:HSI GSI needle valid, bool) and(P:Absolute time,seconds) (P:Absolute time,seconds) 10 + < andif{ 1 }els{ 0 }

Share this post


Link to post
Share on other sites

Goodevening Bill,Thanks for your quick reaction. Unfortunately it constantly shows the GS or LOC flag when (A:HSI GSI needle valid, bool) or (A:HSI has localizer, bool) is active, i think he's looping because the bool value stays 1 so validation starts over again, or am i wrong on this? Here's the code:

<Element>  <Position X="0" Y="0"/>  <Select>			    <Value>(L:AVCS-INS, enum) 2 == (A:HSI GSI needle valid, bool) and (P:Absolute time,seconds) (P:Absolute time,seconds) 10 + < and if{ 1 } els{ 0 }</Value>   <Case Value="1">    <Image Name="ADI_GS_FLAG.bmp" Bright="Yes"/>   </Case>  </Select></Element>

Bill, am i missing something?Greets Slammer

Share this post


Link to post
Share on other sites

Hi,Try:

(L:AVCS-INS, enum) 2 ==(A:HSI GSI needle valid,bool)(A:HSI has localizer,bool)and andif{(L:Number,enum) 1 + 200 min (>L:Number,enum)(L:Number,enum) 10 > (L:Number,enum) 190 < andif{(L:Visible,enum) 1 != if{ 1 (>L:Visible,enum) }}els{ 0 (>L:Visible,enum) }}els{0 (>L:Number,enum)0 (>L:Visible,enum)}

GS and LOC flag are visible when (L:Visible,enum) = 1Hope it helps,Jan

Share this post


Link to post
Share on other sites

Well, yes I did leave out a "latch variable" that would prevent looping...Jan's solution should work well, but I fail to see the purpose of having two timers......as the (L:Number,enum) 190 &lt; test comes out to 10.5 seconds (190/18).

Share this post


Link to post
Share on other sites

Hi Jan,Thanx for helping me out Jan, but unfortunately with this it doesn't show the GS or LOC flag when GS or LOC becomes active.Greetz Slammer

Share this post


Link to post
Share on other sites

Maybe give this a try.. There "is" one inherent problem though. If you pick up the localizer it will trigger, but once you pick up the GS after picking up the LOC it will not because of the latching. Once it has been shown it cannot show again until loss of LOC and/or GS.

<Element Name="GSI and LOC"><Position X="0" Y="0"/><Select><Value>(A:HSI has localizer, bool) (A:HSI GSI needle valid, bool) || (L:AVCS-INS, enum) 2 == and if{ (G:Var1) 0 == if{ (P:Absolute time,seconds) 10 + (>G:Var1) } } els{ 0 (>G:Var1) } (G:Var1) (P:Absolute time,seconds) ></Value><Case Value="1"><Image Name="ADI_GS_FLAG.bmp" Bright="Yes"/></Case></Select></Element>

So for a workaround maybe something like this -- Not sure why you are using (A:HSI has localizer, bool), IIRC all that shows is the transmitter has a LOCeven though it may not be recieved yet. So using these 2 sets of code the light should light upon reception of LOC, go out after 10 seconds, then once picking up GS it will do it again. Hope this may help.Roman

<Element Name="GSI ONLY"><Position X="0" Y="0"/><Select><Value>(A:HSI has localizer, bool) (A:HSI GSI needle valid, bool) (L:AVCS-INS, enum) 2 == and and if{ (G:Var1) 0 == if{ (P:Absolute time,seconds) 10 + (>G:Var1) } } els{ 0 (>G:Var1) } (G:Var1) (P:Absolute time,seconds) ></Value><Case Value="1"><Image Name="ADI_GS_FLAG.bmp" Bright="Yes"/></Case></Select></Element><Element Name="LOC ONLY"><Position X="0" Y="0"/><Select><Value>(A:HSI has localizer, bool) (A:HSI CDI needle valid, bool) (L:AVCS-INS, enum) 2 == and and if{ (G:Var2) 0 == if{ (P:Absolute time,seconds) 10 + (>G:Var2) } } els{ 0 (>G:Var2) } (G:Var2) (P:Absolute time,seconds) ></Value><Case Value="1"><Image Name="ADI_GS_FLAG.bmp" Bright="Yes"/></Case></Select></Element>

Share this post


Link to post
Share on other sites

Roman,Also you thank you for your kind help as well as the others, your on the ball with two seperate flag as initialy intended. The two seperate elements work....ergo only once! If it pick's up the LOC it shows the flag for 10 sec this also happens when it pick's up the GS then, if it looses the signal and pick it up again later then the flags won't show up again!Is there a way that the G:VAR1 and 2 are reset after LOC and/or GS looses signal, so flags will be shown several times during flight?Greetz Slammer

Share this post


Link to post
Share on other sites

All FYI,This is the instrument i'm referring to, it's the ADI of my F-16MLU project. A good friend of me made the bitmaps.Greetz Slammer (Virtual Royal Netherlands Air Force, www.vrnlaf.nl)

Share this post


Link to post
Share on other sites

Slammer, Go back up to post #7, the code was in there.. Just needed to correct it, forgot of all things a ">" in both elements. Should be good to go now.Roman

Share this post


Link to post
Share on other sites

Roman,Exellent, it works great! :( That solves this problem.Still have another strange thing that's happening in FS on different computers. For instance: I've constructed a radio which can switch between UHF and ADF containing 5 rotating knobs to change the freqs, a preset function with 18 channels and a guard frequency. The problem is:On my desktop computer, the 5 knobs for changing frequencies only work when the radio is in the ADF mode and not when it is in UHF mode and it does not show the ID's of the instruments. On the other hand on my laptop it does everything. I don't have the faintest idea why?Many thanks to all of you, now I have to get the course deviation steering solution cue build into the HUD as a function of the ILS course.Greetz Slammer

Share this post


Link to post
Share on other sites
Roman,Exellent, it works great! :( That solves this problem.Still have another strange thing that's happening in FS on different computers. For instance: I've constructed a radio which can switch between UHF and ADF containing 5 rotating knobs to change the freqs, a preset function with 18 channels and a guard frequency. The problem is:On my desktop computer, the 5 knobs for changing frequencies only work when the radio is in the ADF mode and not when it is in UHF mode and it does not show the ID's of the instruments. On the other hand on my laptop it does everything. I don't have the faintest idea why?Many thanks to all of you, now I have to get the course deviation steering solution cue build into the HUD as a function of the ILS course.Greetz Slammer
Do you have the exact same versions of FS running on both? If it's FS9 then make sure the service pack is not in one and in the other. This sometimes causes problems for me aswell. I have not been able to pinpoint this however and I often end up having to redo the entire click code. I would suggest making another gauge just with the mouse/click code and seeing if it works.

Share this post


Link to post
Share on other sites

Thanks for the suggestion, gonna try it, and yes both versions are the same. Other people who fly with this cockpit have the same problems!Greetz Slammer

Share this post


Link to post
Share on other sites

Quote - Do you have the exact same versions of FS running on both?Boy. is that a good question.

Share this post


Link to post
Share on other sites