Jump to content
Sign in to follow this  
Guest greenco

Waypoint clock

Recommended Posts

Guest greenco

Is it possible to code a XML gauge, so that when I click on a bitmap's hot spot, the click event will print the current ZULU time, on that bitmap, and retain it for the duration of the flight? I have already made a clock gauge that displays both LOCAL and ZULU times, in a single gauge. I am trying to make a gauge that will keep track of (record) the actual time (ZULU), that I pass over a waypoint. I would need to have 5 or 6 such input boxes. It would be a lot easier to keep a record of the times, with a mouse click, than it is to pause the sim and write the times on paper. If so, which variable or parameter would be used and what would the syntax look like? Thanksgreenco

Share this post


Link to post
Share on other sites
Guest dek

Hi greenco,That is easy to do. Just setup a click spot and give the time to an L:variable when you click. Just have a counter so each click is different from the others.If you are on a flight plan you could actually set it up to automatically capture the time when each wpt is reached. Look at the A:variables below, A:GPS FLIGHT PLAN WP COUNT A:GPS FLIGHT PLAN WP INDEXThe latter A:variable will give the next active wpt number. You could set it up something like this:(A:GPS FLIGHT PLAN WP INDEX) X == (A:GPS WP DISTANCE, nmiles) 0 == && if{ (P:LOCAL TIME,hours) (>L:valueX, enum) }Then have a display for each time. don

Share this post


Link to post
Share on other sites
Guest greenco

Thanks DonI will not be using a flight plan, but I will be using the nav instruments to go from point to point. Here is a link for the bitmap that I want to use for the gauge.http://home.comcast.net/~fltsimmer/waypoints.jpgWhen I click on the click spot for the top box, I want the current "ZUZU" time to be printed in that box. When I click on the click spot for the next box, I want a NEW current "ZULU" time to be printed in that box and so on for the remaining boxes. Once a box has a time printed in it, I want that time to remain the same for the entire flight.greenco

Share this post


Link to post
Share on other sites
Guest dek

Hi greenco, there are a number of ways to do this.I would first go to the section and set up 5 click spots, one for each of the boxes. You could name them consecutively such as (L:var1x, L:var2x,...etc. (M:Event) 'LeftSingle' scmp 0 == if { 1 (>L:var1x,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 >L:var1x,bool) }When you click and hold down on the first box, (L:var1x,bool) will will be given the value 1. When you release it, it goes back to 0. (You need to make sure the click spot coincides with the corresponding box in you bitmap.)Now set it up so that when (L:var1x,bool) is equal to 1, the Zulu time is given to some variable, say (L:var1y,enum). When you release the click, (L:var1x,bool) goes back to 0 and the Zulu time is no longer given to the variable. (L:var1y,enum) will not change its value unless clicked again.(L:var1x,bool) 1 == if{ (P:Zulu Time,hours) (>L:var1y,enum) }Repeat for each box.Now display each of the (L:var-y,enum) values in their respective boxes. (You could also display the (L:var-y,enum) values directly using a line of code like that given above for each.) Remember the Zulu time you get is in hours, such as 12.22 hours. This actually is 12 hours and 13 minutes, or 12:13.Doing it this way allows you to re-enter a new Zulu time each time the spot is clicked.Does this help?Cheers, don

Share this post


Link to post
Share on other sites
Guest greenco

Don, I am not having much luck. I am trying to get the first waypoint box coded correctly so it works. Here is what I have done and when the panel loads the top box has a ZERO in it. When I put the mouse cursor on the click spot and left click nothing happens. Thanks for you helpgreenco (L:var1x,bool) 1 == if{ (P:Zulu Time,hours) (>(L:var1x,bool) 1 == if{ (P:Zulu Time,hours) (>L:var1y,enum)) } %((L:var1y,enum))%!2d!% (M:Event) 'LeftSingle' scmp 0 == if { 1 (>L:var1x,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 >L:var1x,bool) }

Share this post


Link to post
Share on other sites
Guest dek

Hi greenco,The following will put a click spot in the center of a 52x52 black background. A time value is also displayed in the center of the background.The time value will be 00:00 until clicked the first time. (You could have the real Zulu displayed until first clicked.) Whenever the spot is clicked the "captured" current Zulu time will be displayed, for example say 12:22, and will not change.(L:var1x,bool) 1 == if{ (P:ZULU TIME,hours)(>L:var1y,enum) }%((L:var1y,enum) flr 24 %)%!02d!:%((L:var1y,enum) 60 * flr 60 %)%!02d!%{end} (M:Event) 'LeftSingle' scmp 0 == if { 1 (>L:var1x,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:var1x,bool) }Do 1 for each box and make sure the click spot, and the display, is in the corresponding box.Cheers, don in the box

Share this post


Link to post
Share on other sites
Guest greenco

Don, I copied and pasted your code into a new gauge, made a new bitmap (52X52) and put the gauge on a panel. The black bitmap was on the panel and inside of the bitmap there was a white time format 00:00 . I positioned my mouse pointer over the numbers and it turned into a hand and I left clicked. Nothing happened! I tried clicking all over the click spot area and still nothing.I noticed that the image, in the header area of the gauge, had a size of 52,52,82,82, but I don't think that would cause the gauge not to work. Sorry to be such a bother to you!!greencoHere is the new code (L:var1x,bool) 1 == if{ (P:ZULU TIME,hours)(>L:var1y,enum) }%((L:var1y,enum) flr 24 %)%!02d!:%((L:var1y,enum) 60 * flr 60 %)%!02d!%{end} (M:Event) 'LeftSingle' scmp 0 == if { 1 (>L:var1x,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:var1x,bool) }

Share this post


Link to post
Share on other sites

Hi,Mind the spaces!Between: (L:var1x,bool) 1 == if{ (P:ZULU TIME,hours)(>L:var1y,enum) }there is one lacking.It must be: (L:var1x,bool) 1 == if{ (P:ZULU TIME,hours) (>L:var1y,enum) }Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi,Mind the spaces!Between: (L:var1x,bool) 1 == if{ (P:ZULU TIME,hours)(>L:var1y,enum) }there is one lacking.It must be: (L:var1x,bool) 1 == if{ (P:ZULU TIME,hours) (>L:var1y,enum) }Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest dek

Hi greenco,You are not bothering me at all. Jan has already pointed out the error, so you should be good to go.Good luck and let us know how it turns out.don

Share this post


Link to post
Share on other sites
Guest greenco

Hi JanYour info fixed it!!!I could have looked at that piece of code forever and not noticed the missing space. Now I can finish the gauge's design.I can't thank you and Don enough. You guys are the best.greenco

Share this post


Link to post
Share on other sites
Guest greenco

Here is the results for my waypoint gauges project. I had to change my plan, on the bitmap, because I was running out of room on the panel. I built six individual gauges and placed them on the overhead portion of my panel. I discovered a small problem, but I can live with it if it is not easy to fix. The following pictures shows the problem. http://home.comcast.net/~fltsimmer/pic1.jpgThe above picture shows two bitmaps close together, without me clicking on the left gauge.http://home.comcast.net/~fltsimmer/pic2.jpgThe above picture shows the same two bitmaps, after I clicked on the left one, to insert the time. When I did this, a small portion of the bitmap for the gauge on the right, ended up with a small gray rectangle replacing the border.http://home.comcast.net/~fltsimmer/pic3.jpgThe above picture shows the same two bitmaps positioned farther apart, without me clicking on the left gauge.http://home.comcast.net/~fltsimmer/pic4.jpgThe above picture shows the same two bitmaps, after I clicked on the left one, to insert the time. The bitmap on the right remained OK.I am sure it is caused by one of the positions, sizes or font entries, but I haven't found it out yet.The following is the link to a picture of the complete panel. It is a large file and I did not want to post it on the forum. I have gone digital all the way and am enjoying it.home.comcast.net/~fltsimmer/panel.jpgcopy and paste the above link into your browser in front of the "http://" to see the panel.Thanks again for all the help!greenco

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