Jump to content
Sign in to follow this  
nickpike

XML Timer Issues

Recommended Posts

I need an XML timer that will turn ON a variable for X seconds every Y seconds. So far, I've been unsuccessful in this venture.I want to create a "fake ATC interrogation request" every 40 seconds or so, and have the "R" displayed for about 5 seconds or so.This is such a trivial bit of code in C, but I just can't seem to get my head wrapped around the solution! :(I do know that it requires two timer circuits; one to initiate the "Interrogation," and another to keep the "R" displayed for 5 seconds, and that the "R" timer needs to be nested in the "Interrogation" timer.I'd be deeply grateful for any help! ;)


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

It never fails! One minute and thirty-seven seconds after posting a plea for help... I find a solution... ;)It ain't pretty, but it's functional:(L:ATC_FakeTimer,seconds) 1 + (>L:ATC_FakeTimer,seconds)(L:ATC_FakeTimer,seconds) 360 > if{ 1 (>L:ATC_Fake,bool) (L:ATC_FakeTimer,seconds) 450 > if{ 0 (>L:ATC_FakeTimer,seconds) 0 (>L:ATC_Fake,bool) } }


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

or(L:ATC_FakeTimer,seconds) 1 + s0 (>L:ATC_FakeTimer,seconds) l0 39 > if{ (>L:ATC_Fake,bool) } l0 44 > if{ 0 (>L:ATC_FakeTimer,seconds) 0 (>L:ATC_Fake,bool) }not testednick

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