September 8, 201015 yr HiDoes anyone know if you can call a macro defined in "This_Gauge.xml" from "That_Gauge.xml"?// ------------------------------------------------------------------------For example, I have<Gauge Name="This_Gauge" Version="1.0"><Macro Name="MyMacro">...</Macro>// ------------------------------------------------------------------------I would like to call MyMacro from "That_Gauge.xml"Is this possible?ThanksBobby
September 8, 201015 yr Hi,You have to put the same macro in the other gauge.Jan Jan "Beatus ille qui procul negotiis..."
September 10, 201015 yr In reality you could... It should be a well used macro to do so though and not very dependant on update rates. A hypothetical solution -- Use 1 L:Var named dataSTATUS & 1 called dataHOLDER.(L:dataSTATUS , number) 0 = Idle1 = Data held in (L:dataHOLDER, enum) is being sent to macro.2 = Data held in (L:dataHOLDER, enum) has been processed by macro and is being sent back to originating gauge.In the originating gauge have the sending portion in something, either an element or an update EX-- blah, blah (L:dataSTATUS , number) 0 == & if{ 1 (>L:dataSTATUS , number) "dataTObeSent" (>L:dataHolder , enum) } In the MACRO gauge have -- <!-- Have the MACRO holding gauge portion in an update EX. --><Macro Name="MyMacro"> 10 * </Macro><Update>(L:dataSTATUS , number) 1 == if{ (L:dataHolder , enum) @MyMacro (>L:dataHolder , enum) 2 (>L:dataSTATUS , number) }</Update><!-- (L:dataHolder , enum) now equals "dataTObeSent" * 10 --> Back to the originating gauge have -- <Update>(L:dataSTATUS , number) 2 == if{ (L:dataHolder , enum) --> DOsomethingWITHit 0 (>L:dataSTATUS , number) }</Update> As said before, update rates will suffer with the data being transferred. In the order of 18hz/2 or as bad as 18hz/4. Is it efficient?? Maybe, depending on how used, most likely NOT.. Just an example of how it could be done. I have used this technique in a developing gauge. (A gauge that helps me develop gauges LOL! ) so update rates are not a factor.Roman FS RTWR SHRS F-111 JoinFS Little Navmap
September 11, 201015 yr Moderator Of course, it rather defeats the purpose of a @Macro... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 11, 201015 yr Yes indeed. But the question was asked. FS RTWR SHRS F-111 JoinFS Little Navmap
September 14, 201015 yr Author Thanks everyone. I was thinking that if I could call some macros that I have defined in my main gauge, I could add some stuff outside that gauge and not affect/change/add to the original file. I've gone ahead and added to my original file.Thanks
September 29, 201015 yr I've had exactly the same problem and PPWIZARD did the trick for me.It's a standalone pre-processor engine oriented on HTML authoring but XML files are processed just as easily.You put all your macros and reusable code parts to separate files, put references to these in the master files and process.PPWIZARD Link
Create an account or sign in to comment