Jump to content
Sign in to follow this  
Guest zavoq

Help with XML Clock Creation Help

Recommended Posts

Guest zavoq

First of all, let me say that I am brand spankin' new to AvSim, Gauge creation for FSX, and XML as a whole. That being said, please be patient :)I am trying to program a clock gauge that will show Universal time, and change to display Local time, Flight Time and Elapsed Time. I have made some good progress, but I am stuck on getting the correct time to display based on the G:Var1 variable. Here is my code as it stands:(G:Var1)(G:Var1) 0 ==%((P:Zulu time,hours) flr)%!02d!:%((P:Zulu time,minutes) flr 60 %)%!02d!(G:Var1) 1 ==%((P:Local time,hours) flr)%!02d!:%((P:Local time,minutes) flr 60 %)%!02d!(G:Var1) 3 == if{ (G:Var1) 3 - (>G:Var1) } els{ (G:Var1) ++ (>G:Var1) }As you can see I am using the "Visible" command to choose which text string is visible, the problem is, that it shows the Zulu time when G:Var1 == 0, but it does not show local time when G:Var == 1. It will however show local time if I make that the visible in the 0 case. So what am I missing? Why will it not show the Local time element when G:Var1 == 1?I appreciate any help you can provideThanksCharlie

Share this post


Link to post
Share on other sites

Try using (G:Var1,enum) instead of just (G:Var1)...


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
Guest zavoq

Thanks for the quick response. I really appriciate your help.adding enum does not seem to have changed anything in the gauge operation.Zulu time still shows when G:Var is = to 0, but Local time does not become visible when G:Var = 1.Any other ideas?

Share this post


Link to post
Share on other sites
Guest zavoq

Actually, I think I just found out what is going on. Here is the deal, and it is a new issue alltogetherIt is making it visible, it is just not redrawing the text string until something in it changes. It only updates the layers that are visible, so since I am only showing Hours and Mins, if I wait for the clock to change the mins digit, then it appears, but If I let it sit there for a couple of mins, and then go back to the Zulu time, it will still be on the numbers it was on when I switched away from it...until the min digit changes while that is visible.Does that make sense?

Share this post


Link to post
Share on other sites
Guest zavoq

OK, I think that I got that issue figuresd out. I am sure that there is a better way than the way I did it, but this seems to work. I added a seconds portion to the string, but restricted the number of digits to 5 so that they dont show up. Seems to be working for the time being.Thanks for the helpCharlie

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