• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Formatting strings

Messages
862
Country
indonesia
I'm trying to format a decimal (or floating) string for autopilot vertical speed. What I want is to see:

+1000
+0900
.
.
+0000
-0100
etc,

What I get is:

+1000 - good
0+900 - not so good
.
.
00+0 - !
0-100

The string is:
Code:
    <String>%( (A:AUTOPILOT VERTICAL HOLD VAR,Feet per minute) )%!+05d!</String>

I've tried various combinations of d & f with +, 0, and 'preceeding number' in different orders, all to no avail. Am I trying to do the impossible?
 

Attachments

  • ok_with_4_digits.jpg
    ok_with_4_digits.jpg
    5.9 KB · Views: 525
  • not_so_good_with_3_digts.jpg
    not_so_good_with_3_digts.jpg
    6 KB · Views: 543
  • bad_at_zero.jpg
    bad_at_zero.jpg
    5.4 KB · Views: 539
You might try:

Code:
<String>%( '+' '-' (A:AUTOPILOT VERTICAL HOLD VAR,Feet per minute) s0 0 >= ? l0 abs r )%!s!%!04d!</String>


Tom
 
That is a handy code Taguilo. I will save for plus or negative numbers. I was trying to use the {fnt1}NM{fnt} not using AceXML and it did not work.

Just used your code for my OAT string on my new project and it works amazing! Thanks!

Is there a way to create a code for my string so i can have N/M label stacked???
 
Last edited:
This 'un replaces the last digit by '0' for a less hectic display.

%((A:VERTICAL SPEED, feet per minute) 0.1 * )%!+d!%( '0' )%!s!
 
Is there a way to create a code for my string so i can have N/M label stacked???

Sure there is, but you should give me an example of what you really need.

This 'un replaces the last digit by '0' for a less hectic display.

%((A:VERTICAL SPEED, feet per minute) 0.1 * )%!+d!%( '0' )%!s!

Actually would be more simple:

<String>%((A:VERTICAL SPEED, feet per minute) 0.1 * )%!+d!0</String>

Notice also the OP uses AUTOPILOT vertical speed, which indeed gives a less hectical display.

Tom
 
Here is an example. You see the label "DIS" to the right is N over M stacked. I use a code like this {fnt1}NM{fnt} to stack them using the other gauge format.
This way it's all in the same string as the information.

I thought i had used 3 symbols "N/M" like this in the past but i can't find an example of it. So 2 symbols "NM" might be the only way. But i will take both methods if you can do it in the standard xml coding format.

GPS530_FREQ_HELP.jpg
 
I thought i had used 3 symbols "N/M" like this in the past but i can't find an example of it. So 2 symbols "NM" might be the only way. But i will take both methods if you can do it in the standard xml coding format.

Maybe sort of basic question but, did you try {fnt1}N/M{fnt} ?

Tom
 
It's actually \{fnt1}NM\{fnt} and uses GaugeString rather than String format.

Can you use GaugeString format in XML 1.0???
 
Last edited:
Labels on the two small (inner) knobs is reversed! PUSH CSR should be on the right side, PUSH C/V should be on the left side...

To use the {fnt1} function you need to use the <FormattedText> scheme. But, all that does is allow you to use a different font type and/or size that you've declared in the <FormatedText> section.

To 'stack' symbols you need to use this specification:
Code:
\{dpl=XY} Make X superscript and Y subscript

In your case that would be:
Code:
\{dpl=nm}
Here is a complete example of a <FormattedText> element. Note carefully that there are three uses of the \{dpl} method in this single <String>:
Code:
        <Element>
          <Visible>(@g:currentPageNAV) @kNAVPageDflt ==</Visible>
          <Position X="5" Y="170"/>
          <FormattedText X="38" Y="12" Font="Arial Black" FontSize="11" Adjust="Center" VerticalAdjust="Bottom" Color="0xF0D0D0" BackgroundColor="#080808" Bright="Yes">
            <String>
              %((@g:map_ZoomFactor) s0 5 &gt;=)%{if}%(l0)%!d!\{dpl=nm}%{else}%(l0 1 &gt;=)%{if}%(l0)%!.1f!\{dpl=nm}%{else}%(l0 6076 *)%!d!\{dpl=ft}%{end}%{end}
              %((@g:currentPageNAV) @kNAVPageDflt == if{ (@g:navPage0DetailLevel) } els{ (@g:navPage1DetailLevel) } s0 0 !=)%{if}-%(l0)%!d!%{end}
            </String>
          </FormattedText>
        </Element>

 
Last edited:
You might try:

Code:
<String>%( '+' '-' (A:AUTOPILOT VERTICAL HOLD VAR,Feet per minute) s0 0 >= ? l0 abs r )%!s!%!04d!</String>


Tom

The above places the + or - at the front of the readout.

The following are several examples where the the required indicators or cues are placed at the end of the readout.
Code:
    <GaugeString>\t%Brg %(@ClosingSpeed (&gt;L:ClosingSpeed,number))%(@AspectAngle (&gt;L:AspectAngle,number))
                        %((L:Target_Bearing, number) abs flr )%!3d!\{dplo= }%  %((L:Target_Bearing, number) 0 &lt; if{ 'L' } els{ 'R' } )%!s!    
                        \t\t%Cls %((L:ClosingSpeed,number))%!4d!
                         \n\n\t%Gs %((L:Target_Groundspeed, number) 10 / near 10 *)%!4d!%kt%
                         \t\t%Alt %((L:Target_Altitude, number) 100 / near)%!4d!\{dpl=FL}
                         \n\n\t%Hdg%((C:ITrafficInfo:S:PLANE HEADING DEGREES MAGNETIC, degrees))%!4d!%\{dplo= }
                         \t\t%Dst %((L:Target_Distance, number) 1.59 &lt;)%{if}%((L:Target_Distance, number) 6076 *)%!4d!%ft%((L:Target_Distance, number) 1.6 &gt;)%{else}%((L:Target_Distance, number))%!4.1f!\{dpl=nm}%{end}%
                         \n\n\t%VSI: %((L:Target_VSI, feet per minute) abs flr )%!d!%  %((L:Target_VSI, feet per minute) 0 &lt; if{ 'Dn' } els{ 'Up' } )%!s!
                         \t\t%((L:Target_Altitude, number) (A:Indicated Altitude,feet) - 100 / near abs flr)%!4d!%  %((L:Target_Altitude, number) (A:Indicated Altitude,feet) - 0 &lt; if{ 'Blw' } els{ 'Abv' } )%!s!
                         \n\n\t%Ac %((C:ITrafficInfo:S:ATC MODEL, string))%!s!
      %</GaugeString>

The following shot shows the above code as a text overlay on the radar screen at the right.
Text data relates to the AI aircraft visible left of HUD.

fsx2014-08-2200-47-50-40.jpg


This link refers to above,
http://www.fsdeveloper.com/forum/threads/conditional-statement-in-formatted-text.425596/

Cheers
Karol
 
Last edited:
I wonder how i got the knob labels reversed Bill? That sucks as i have never noticed that but i just checked my old GNS530 unit and it is correct so i must have mapped it backwards 1 year ago when i updated the unit with VNAV and some other new features. I am blown away nobody has noticed until now! I will fix this asap. But that means my C402 and C441 will be reversed until they get a new update! Thanks Bill for the info on the FormatedText as i knew there was another format out there that could be used. Will add this to my library of string formats! And thanks COBS for sharing the tags on the end of the string!
 
Last edited:
Back
Top