Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

calling xml macro from another gauge

Featured Replies

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

Hi,You have to put the same macro in the other gauge.Jan

Jan

 

 

 

"Beatus ille qui procul negotiis..."

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

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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

  • 2 weeks later...

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.