Sign in to follow this  
Guest jfarrer@telus.net

Neuronically Shy XML

Recommended Posts

Hi:What I'm trying to achieve here is a simple 3 section display showing the I.D., distance and magnetic course to the station tuned into NAV1 when the case value is 0 and the I.D., distance and magnetic course to the next waypoint in an FS9 GPS flightplan when the case value is 1.Each of the text sections work on their own as separate elements although the waypoint won't cycle to the next when you fly over it.I'm fairly certain I'm using the wrong event ID in the mouse section 'cause when the gauge loads in, a little indicator light I have in a section is on and the active mouse area doesn't change the case value and switch it off. Even I can get the little blinky light part right. :)If I use GPS_DRIVES_NAV1 as a trigger I can get the display to change without the text elements needing to be in the areas and without two separate text entries, one for NAV and one for GPS, but as I said the waypoints won't cycle and that's why I was trying GPS_OBS_BUTTON as a trigger. I originally thought that the waypoints would cycle automatically if a flightplan was loaded in but it doesn't seem to work that way. I can easily move the text sections back into their own separate elements if necessary but my questions are:Is there another trigger besides GPS_DRIVES_NAV1 that will change the display and also allow the waypoints to cycle, or do I need two separate triggers and can I combine them?I wanted to put in some hotspots to be able to change to the next or previous waypoint in the FS9 flightplan manually in case I couldn't get the waypoints to cycle any other way, but the SDK shows nothing as an event ID even though it's implemented within the GPS. Are there triggers for the two that I'm misinterpreting?This is just the relevent XML, there's a COM1 and NAV1 section that works fine.(A:GPS IS ACTIVE WAY POINT, bool)%((A:NAV1 IDENT, string))%!s!%((A:GPS WP NEXT ID, string))%!s!(A:GPS IS ACTIVE WAY POINT, bool)%((A:NAV1 DME, nautical miles))%!4.1f!%((A:GPS WP DISTANCE, nautical miles))%!4.1f!(A:GPS IS ACTIVE WAY POINT, bool)%((A:NAV1 Radial,radians) (A:NAV1 MAGVAR,radians) - rddg 180 + dnor)%!03d!>%((A:GPS WP DESIRED TRACK, degrees))%!03d!>I know this is probably pretty simple stuff, but for some reason it's giving me a headache! :) Thanx in advance.Rgds: Jeff

Share this post


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

Your GPS variables used to monitor the GPS seem to be the right ones. As for your Toggling of the pages try this :Element> (L:MY_GAUGE_SELECT, bool)%((A:NAV1 IDENT, string))%!s!%((A:GPS WP NEXT ID,string))%!s!(L:MY_GAUGE_SELECT, bool)%((A:NAV1 DME, nauticalmiles))%!4.1f!%((A:GPS WP DISTANCE, nauticalmiles))%!4.1f!(L:MY_GAUGE_SELECT, bool)%((A:NAV1 Radial,radians) (A:NAV1MAGVAR,radians) - rddg 180 + dnor)%!03d!>%((A:GPS WP DESIRED TRACK,degrees))%!03d!>(L:MY_GAUGE_SELECT, bool) ! (>L:MY_GAUGE_SELECT, bool)________________________________________________________________Another way to this too is to have nested . It may keep it easier to track problems/mods in each section. It all depends how YOU want to do it. GPS/NAV I.E.(L:MY_GAUGE_SELECT, bool) ! **** PUT ALL YOUR VOR STUFF IN HERE INSIDE THEIR OWN ***(L:MY_GAUGE_SELECT, bool)**** PUT ALL YOUR GPS STUFF IN HERE INSIDE THEIR OWN ***(L:MY_GAUGE_SELECT, bool) ! (>L:MY_GAUGE_SELECT, bool) Roman

Share this post


Link to post
Share on other sites

Many thanks Roman!I had been reading the SDK and been thinking that a G: or L: variable would do the trick but I couldn't wrap my mind around how to use it as a mouse area. Did I happen to mention that I'm relatively new at this and neuronically shy? I couldn't help thinking that an event id and a parameter needed two separate and independant entries.Your example told me more about L: variables than anything the SDK seems to offer. I looked around for the Arne Bartels tutorial but it doesn't seem to be anywhere in the Avsim file libraries and most XML books I see at outlets seem to be geared more towards web applications.The little NavCom works well now although I might switch the A:GPS WP DESIRED TRACK entry. It seems that the reason the waypoints weren't cycling was that that particular GPS call gives you the desired track from your starting position. It does update, but so slowly that you can miss the waypoint by just enough to miss the trigger.Can you use the L: variable to bring up multiple screens other than the two supplied by 'bool'?Thanks AgainJF

Share this post


Link to post
Share on other sites

You can Get Arne's Tutorioal here.http://library.avsim.net/download.php?DLID=14095Some other XML tips and such:-Open up the stock .cabs and search inside what MS provided-The forums here, search for XML and read way back in 2002 what was going on. ( The very start of XML )An example of multiple pages (5) - note the L:VAR units changed from bool to number. Element> (L:MY_GAUGE_SELECT, number) **** STUFF GOES HERE *** **** STUFF GOES HERE *** **** STUFF GOES HERE *** **** STUFF GOES HERE *** **** STUFF GOES HERE *** **** THIS MOUSE SECTION IS FOR A UP/DOWN TYPE SELECTION ( use only 1 mouse section, change areas to suit) ***** (L:MY_GAUGE_SELECT,Number) ++ 4 min (>L:MY_GAUGE_SELECT, Number)(L:MY_GAUGE_SELECT,Number) -- 0 max (>L:MY_GAUGE_SELECT, Number)**** THIS MOUSE SECTION IS FOR A LOOPING TYPE SELECTION ( use only 1 mouse section) ***** (L:MY_GAUGE_SELECT,Number) 4 == if{ 0 (>L:MY_GAUGE_SELECT, Number) } els{ (L:MY_GAUGE_SELECT,Number) ++ 4 (>L:MY_GAUGE_SELECT, Number) }Roman

Share this post


Link to post
Share on other sites

Thanks once again Roman, I've started what many others have...a desktop text file with all these code snippets stored on it. Even a beginner like me can see the use of the above example, and the more I look at it, the more it seems to almost make sense. :)I think the beggest problem is that you can find code or help to make something do WHAT you want it to do, but it's extremely difficult to figure out HOW that code accomplishes it's task.I found that replacing %((A:GPS WP DESIRED TRACK, degrees))%!03d! with %((A:GPS WP BEARING, degrees))%!03d! solved the slow display update and ergo the 'missing the waypoint' problem as well.Again, thank you. It's folks like you and Jan and Rob etc. that makes me believe that there might be some future hope for the Internet yet.One thing though, I've been staring at XML code for so long I've started speaking Polish....only for some reason it's backwards! :)JF

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