Jump to content
Sign in to follow this  
Guest Ron Freimuth

XML 'macros' for FS9

Recommended Posts

Guest Ron Freimuth

I found what simple 'macros' do. I extracted the Beech Baron files from the CAB file into Beech_Baron and edited them in a few places so they would work with CCW or CW prop rotation. Later, I copied the FS9 XML files to the same subfolder in "FS2002Gauges". I knew a few things had changed but wanted to see if anything would work running in FS2K2. First, an AC with a CCW and CW prop displayed RPM correctly. I'd also modifed the Prop Synch and it also worked. However, 'Fuel Flow' gauges read zero. I checked the xml files for the "Left" and "Right" gauges. They were changed slightly from the FS2K2 version. Probably just to demonstrate macros (most other pairs of engine gauges did not use macros). One can extract the Left|Right fuel flow XML files and look. There is something a line near the top:1 ..... (A:Eng fuel flow GPH:@ENGINE_NUMBER, gallons per hour).... IOW, when "@ENGINE_NUMBER" is in a line, '1' is substituted during run time interpretation. Only advantage here is that similar gauges could have 'macro' in the code when there were variations in otherwise identical files. Make several copies of the same XML file (with appropirate names). Finally, fill out the Macro vaule as appropriate, in this case with '1' or '2', depending on Engine 1 or Engine 2. Macros in the GPS files are more complex. They contain strings of operations. I'd want to use short macro names so the coding would be less verbose. One might be able to use macros for those long XML variable names. Maybe Macros within Macros. Reduce the Value string above to "FF" Engine 1 or 2 is set at the top.-RAF

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

Micky Mouse operators appear to have been eliminated:from gps_500.xml:(M:Event) 'LeftSingle' scmp 0 == (@g:nrstButtonDown) 0 == and if{ 1 (>@g:nrstButtonDown) @NRSTButton } Note 'and' above. I also see 'and and' in other places. Probably equivalent to the C "&&" There was one "&&" in the whole file:(C:fs9gps:group4currentPage) 0 == && if{ @ProcedurePageInit } Perhaps it was missed in conversion. I noted ">=" in the macro below, not "ge;". Loops:%((@g:enteringInput) 10 == (@g:popupMenu) 0 == and) %{if} %((@c:IcaoSearchCurrentIdent) slen sp1 0 sp0) %{loop} <****************** %((@c:IcaoSearchCursorPosition) l0 ==)% {if}{blnk}%end}% ((@c:IcaoSearchCurrentIdent) l0 symb d slen 0 == if{ p ' ' })%!s!{nr} %(l0 ++ s0 l1 <=) %{next} <********************* %{else}.................... C like string escapes: "n t" New line, tab. 'varname,type' mostly eliminated. I could not find how the data bases are acessed. They appear to be the .idx files in ..User..Facilities I see no evidence of the complex gps500 being aided by any specific dll's that are used specifically for it. I noted MSXML4 was loaded with FS9, not the MSXML3 FS2K2 uses. -RAF

Share this post


Link to post
Share on other sites

Ron, this may be the source of my problem... I just noticed that the Baron Left RPM gauge does not rotate and that the tooltip shows negative instead of positive values...When this got introduced I do not know...If I substitute (-100) for 100 in the value line, the gauge starts working again, but the tooltip is still negative...< Rotate > < Value Minimum="0" Maximum="35" > ( A:Prop1 RPM, RPM) -100 / < /Value>I may have a non standard airfile... which could be the cause... but if I take the FSD Seneca RPM gauge, it works correctly..Any hints on how to edit the XML file so it handles either positive or negative values?


Bert

Share this post


Link to post
Share on other sites

Spent some time browsing the forum and found the recommendation to use the "abs" function, that way it works with either positive or negative numbers. This seems to fix my problem, but I wish I knew why all the gauge size numbers are off when I use the gauge in my panel folder, rather than in the original cab file in the gauges folder.. :-(The ratio to correct it is 1.6 which is the 1024/640 ratio, beyond that it is all a mystery to me... basically found all this by trial and error. The cause for the negative rpm is that I am using the FSD Baron airfile by Steve Small which has counterrotating props.. this does not seem to be handled well by the FS9 Baron gauges..


Bert

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

>Spent some time browsing the forum and found the>recommendation to use the "abs" function, that way it works>with either positive or negative numbers. This seems to fix>my problem, but I wish I knew why all the gauge size numbers>are off when I use the gauge in my panel folder, rather than>in the original cab file in the gauges folder.. :-(> Yes, I put 'abs' in a few places and both the RPM and Engine Synch then work with CW or CCW rotation. Ron

Share this post


Link to post
Share on other sites

Sorry to ramble on... but I've now figured out why the size was off... I did not realize that the bmp files had to be in 1024 and 640 subdirectories... now that is fixed, it all works just fine again!


Bert

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