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.

XML macro for bright/luminous flags?

Featured Replies

Never managed to control the Bright/Luminous flags successfully using macros in XML. I know this is an old issue but I could not find any post related to it. So here goes:A plain 1 or 0 works, like this:1but not this:%('1' '0' 2 (L:SWITCH,enum) case)Why? /Tom

  • Moderator

>Never managed to control the Bright/Luminous flags>successfully using macros in XML. I know this is an old issue>but I could not find any post related to it. So here goes:>>>>A plain 1 or 0 works, like this:>1>>but not this:>%('1' '0' 2 (L:SWITCH,enum) case)Remove the single quote marks... :)(Macro Name="Lit">1 0 2 (L:SWITCH,enum) case)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Bill: Sorry, that won't fly. :( First thing I tried. I believe the value must be a boolean, and any sort of operation in the macro makes it a float? Would be easier in C I think. The reason I tried with a string macro btw was that it works with Color/FillColor attribs. Jan: That method is what I have been using for years now, it works fine but is cumbersome for large gauges with dozens of bitmaps. I need to toggle the bright flag when I change bitmaps, so a macro just for bitmap names is not enough. Thanks a bunch anyway!/Tom

  • Moderator

>Bill: Sorry, that won't fly. :( First thing I tried. I>believe the value must be a boolean, and any sort of operation>in the macro makes it a float? Would be easier in C I think. >The reason I tried with a string macro btw was that it works>with Color/FillColor attribs.That is a bit odd, isn't it? Have you tried using "bool" as the type rather than "enum"? How about actual strings? I'm just batting some suggestions here. I'm in the middle of working on an FSX XML gauge, and the syntax is completely different, so I can't really test these myself at the moment... ;)(Macro Name="Lit">'True' 'False' 2 (L:SWITCH,string) case) If you think this is challenging, wait 'till you get to FSX XML gauges with alternate _night bitmaps (which fortunately, work automatically!) which present some rather "interesting challenges" with regards to getting the 2d and VC panel lighting balanced!

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks Bill, I will follow your suggestions and experiment.The FSX SDK actually scared the living daylights out of me. I have to reconsider if I really have time for all this... Maybe it's time to hand this bloody aircraft (Saab 35) over to people with more brain cells left. ;) Cheers /Tom

Tom,"Bright" property doesn't accept stack evaluation or coditionals.as it happens with almost all of the structures' properties (there are a bunch of exceptions)So, for example, Bright="@Lit" will work using only these kind of macros:1YesHope this helps.Tom

  • Moderator

>So, for example, Bright="@Lit" will work using only these kind>of macros:>>1>Yes...which is - of course - completely useless... ;)What I've had to do is essentially clone all of the completed "lighted" and change their Bright flags to zero, then encapsulate both non-lighted and lighted as children of their controlling "Parents..." ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

>...which is - of course - completely useless... ;)>You bet...:-hmmm >What I've had to do is essentially clone all of the completed>"lighted" and change their Bright flags to zero,>then encapsulate both non-lighted and lighted as children of>their controlling "Parents..." ;)...using in a single element, that's the way to switch between lighted-non lighted bitmaps IMHO. :-)Tom

  • Author

Hi,Like:(L:capt instr bus AC volts,number) 100 > (L:panellights,bool) 2 * [email protected]"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

..or better :-)(L:capt instr bus AC volts,number) 100 > (L:panellights,bool) 2 * +@powerPity this wouldn't work in FSX as is...(I think)Tom

  • Author

Hi,That is a good one, but doesn't work when eg.:@power@current if{ (A:Indicated Altitude,feet) s3 100000 + 100000 % 10000 / flr s0 l3 100000 + 10000 % s1 9980 >= if{ l1 100 % 80 - 20 / } els{ 0 } l0 + } els{ 0 } Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Try putting the nonlinearity table inside the SHIFT statement instead. Works for me./Tom

Hi Jan, why is that? it should work with:@power@current if{ (A:Indicated Altitude,feet) s3 100000 + 100000 % 10000 / flr s0 l3 100000 + 10000 % s1 9980 >= if{ l1 100 % 80 - 20 / } els{ 0 } l0 + } els{ 0 } Tom

  • Author

Tom,That is new for me and certainly worth a try.Much more efficient and may be fps...?Thanks!Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

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.