December 7, 200817 yr Nice example Bill :( However, I would like to point out this is one case where macros are not necessary to be used (in fact shouldn't be used :( if part of a big project).Let me explain:Say you have 100+ messages that display from multiple conditions. Probably the EICAS gauge would be duplicated in main panel/VC and maybe some subpanels; then the macro code and conditionals would be duplicated as well. The best in this case is to "build" the message via a local variable placed in the own gauge that manages the failure and refer to that variable in the CAS <FormattedText>For example, %@(L:ACBus Off,bool)%{if}AC BUS OFF\n%{end} where (L:ACBus Off,bool) condition is updated in another gauge, say ELECTRICS gauge.Notice that neither I use @Message(n) macros, but instead their direct meaning, is more clear to the user and saves some "extra" loading time.All this stated as my two cents in terms of code optimization :( Tom
December 7, 200817 yr Author Moderator Nice example Bill :( However, I would like to point out this is one case where macros are not necessary to be used (in fact shouldn't be used :( if part of a big project).Not too surprisingly, I fully agree that the use of <Macro>s in this case is not only "overkill" but actually very inefficient for the very reasons you explicated so well...However that said, the primary purpose of the example is to remove the "visual clutter" that obscures the actual simplicity of the <FormattedText> technique. By replacing all of the long and often complex "Conditional scripts" with a common length @Macro, the basic structure of the <String> is revealed more clearly! :(Thus, the otherwise hidden subtleties of things such as \{clr2} may be seen with greater clarity.In my actual gauge script I've in fact used L:vars for the conditions and placed the actual text in the <String> section. All the actual "math" for the conditions is in the master warn/caution gauge script, as it is in ACES Lear45 example. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 7, 200817 yr Author Moderator The amount of <Shift> depends of the amount of textlines you want to have visible at one time on the Eicas. Say max lines visible is 10 and linewidth=15, then you have to shift 10*15 forth and back.Add a <Clip> to hide the text outside the MFD screen.Works very satisfactory.Hope it helps,JanThanks, Jan. The idea of this followup to my own original post is to:a. illustrate clearly one easy method's principlesb. make use of the new forum software's ability to retain code/script formattingc. allow others (such as you and Tom) to introduce additions, expansions, and/or alternative suggestions :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment