Jump to content
Sign in to follow this  
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

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 }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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

Edited by phjvh

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


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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>

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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

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.

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...