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

XML Gauges and Schema

Messages
25
Country
us-texas
I have been trying to improve one of the payware models with a 2D panel, since the view to reach the AP, heading,and even Pitot tubes are difficult. I'm an utter noob in coding.

I decided to code simple gauges in XML and, I managed to get a few things working by searching online, and looking at already written code in other freeware gauges. Learned a lot that way.
I even managed to get some custom code of the pitot to be activated from the 2D panel I did (I know this is easy for you guys, but it was a huge achievement for me hahahaha). I've been switching back and forth with the SDK on P3D page, and dealing with ace.exe crashes. But that was taking a lot of time and tiring me.

So,I'm asking, is there an alternative to ace.exe, besides notepad++/PSPad? What can I use to read the "propdefs" schema and be useful, or aid me?

Thank you in advance for the help.
I have been reading this forum for years, and always helped me on my doubts.For that, I'm eternally grateful to everyone here! I found some posts regarding this subject from a couple of years old. So, has anything changed in 2017?
 
I believe most of the XML developers in this forum, including professional gauge developers like Bill Leaming and Tom Aguilo (to name only two) who have many years of expert experience with gauge languages, will advise to avoid the FSX XML schema (a.k.a., "Aces") and stay with the simpler, more readable FS9 XML schema.

Examples of FS9 schema XML can be found in the XML gauges shipped with FS9 (FS 2004). There are some people that are skilled and comfortable with FSX schema, but probably most of the XML snippets or entire gauges you run across in this forum are FS9. Unfortunately, XML gauge work is largely a learn as you go process involving lots of personal trial and error. Some tutorials exist, and they are good, but not exhaustive.

Good luck.

Bob
 
Thank you for the reply. I decided to download the FS9 SDK and check it out. It does look easier, and that explains why one of the gauge I peaked had a different formating than what was on FSX/P3D SDK and what I could output in Ace.exe.
I hope I can manage to do more than flipping switches and display information hahaha! I'll need to create a few knobs, since I'm trying to replicate a very old AP. If I can't, I'll have to include an FSX standard gauge. I'll update you guys :)
 
In the avoidance of confusion, I should say that FS9 XML schema is compatible with FSX and P3D gauges you describe, especially if you first tackle 2D XML gauges.

It may take you a while to learn the ropes, but certainty you can make an autopilot in XML. Old vintage, knobs, switches, readout displays. All can be done.
 
Thanks! This has helped me a lot! This is what I have done so far, compared to what I had before, it is a lot! I still need to sort out the textures, but the 2D AP is working. This should facilitate anyone flying this aircraft.
The radios,I'm thinking of leaving it as is, it is relatively easier to reach the radios than it is for the autopilot. I'm doing this inspired on the work done to fix the Metroliner III. HS748 Is a fun aircraft to fly.
 

Attachments

  • 2017-2-17_17-14-59-27.jpg
    2017-2-17_17-14-59-27.jpg
    251.2 KB · Views: 531
*Blushes*

After flying around on the Metroliner III, and thoroughly enjoying your work and the others who contributed, like the 2D lights panel, I realized that another plane needed some love too. So,I'm learning by looking around your work, and this forum!

Managed to solve(90% haha) the tape trim Wheel, just have to find out why it bugs out when I ask to go up.
Here's what I have done for today. Still lots to do...
 

Attachments

  • 2017-2-18_0-9-26-895.jpg
    2017-2-18_0-9-26-895.jpg
    231.9 KB · Views: 395
Just to let you guys know that I'm still working on it, and soon, all I'll have left to do is improve the art. This is the progress from a few hours ago, I've already added a quartz like screen for the numeric information. I also need to add a way to change the barometric information.

5GCD7kq.png
 
Looks great!

...will advise to avoid the FSX XML schema (a.k.a., "Aces") and stay with the simpler, more readable FS9 XML schema.
- Since i'm new to (C++ and XML) gauge creation.. Are there any (technical) differences (beside XML-schema-readabilities) in possibilities what you can/can not create with the FS9 XML_code vrs FSX XML_code?

Some tutorials exist, and they are good, but not exhaustive.
Here is an overview of the best FS9 related XML tutorials I've found online, I hope that they can help to solve your current XML challenges:
- http://www.fs2x.com/Tutorials.htm - six FS9 related XML tutorials
- http://users.skynet.be/fa062023/xFS/xml_FS_01.htm - homepage (5 page tutorial)
- http://woodair.net/Flight_Sim/tutorial/FST_XML.htm
- http://www.kgz.shawbiz.ca/tutorials/xml/backup_attitude_gauge.html
- http://www.kgz.shawbiz.ca/tutorials/xml/l45radio.html#radios
- http://www.douglassdawson.ca/
- http://talk.pafs.wf/viewtopic.php?t=1692
 
- Since i'm new to (C++ and XML) gauge creation.. Are there any (technical) differences (beside XML-schema-readabilities) in possibilities what you can/can not create with the FS9 XML_code vrs FSX XML_code?

I recall there is a minor bunch of differences, but the important thing is that you will need to stick to FSX schema for G1000 customizations (which are many outa there).
With basic steam gauges and/or radios and/or system's code, FS9 schema should be the choice.

Tom
 
As far as I've been able to determine, the only thing that FSX schema can do that FS9 schema cannot is to rotate an arc. Even then, there are techniques one may use in FS9 schema to achieve the same visual result, albeit not so simply and elegantly! :wizard:
 
So far so good,still need to figure out a few things, and why my tape <shift> bit is not working (The VS wheel close to the turn knob). I'm unsure if the problem is me or the plane, as the tooltip, when I move it on the model itself keeps showing "0", but the tape jumps everywhere in my 2D panel.

Also need to finish the art.
But this is the latest I have.
Thank goodness I found some snippets of code here to help me on the knobs! Those things were driving me crazy.
Found the best solution here, if anyone reading this thread is interested: http://www.fsdeveloper.com/forum/threads/xml-turning-knobs.429009/#post-662132

xLZR82m.png
 
Alright, this is today's progress. A few bugs to fix, here and there, and still figure out how to use the tape VS/Pitch tape. I also fixed the uber-large GPS window that came with the plane, added another window for the NAV/COM radios.

When I finish that, I'll venture in fixing(I hope) a bug with the light texture on the overhead panel that, when you turn it on, it looks really weird.

OHkkvOS.png
 
As far as I've been able to determine, the only thing that FSX schema can do that FS9 schema cannot is to rotate an arc. Even then, there are techniques one may use in FS9 schema to achieve the same visual result, albeit not so simply and elegantly! :wizard:
You mean something like this Bill. A discharge valve. The front disc rotates when the valve is open or closed (crosslined). And a white disc appears in the window to indicate by how much the valve is open. Not bad for FS9 eh!!!
dis.jpg

Code:
<Gauge Name="fwd discharge Indicator" Version="1.0">
   <Image Name="fwd_dv_back.bmp" Luminous="1"/>
   <Element>
      <Position X="190" Y="182"/>
      <Image Name="fwd_dv_disc.bmp" PointsTo="West" Luminous="1">
         <Axis X="131" Y="131"/>
      </Image>
      <Rotate>
         <Value>(L:fwd_dv_segment,enum) 0 &gt; if{ 0 } els{ 1 }</Value>
         <Nonlinearity>
            <Item Value="0" X="71" Y="210"/>
            <Item Value="1" X="175" Y="49"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="50"/>
      </Rotate>
   </Element>
   <Element>
      <Position X="0" Y="0"/>
      <Image Name="fwd_dv_topmask.bmp" Luminous="1"/>
   </Element>
   <Element>
      <Position X="205" Y="201"/>
      <Image Name="fwd_dv_bar.bmp" PointsTo="North" Luminous="1">
         <Axis X="205" Y="201"/>
      </Image>
      <Rotate>
         <Value>(L:fwd_dv_segment,enum) 0 &gt; if{ 1 } els{ 0 }</Value>
         <Nonlinearity>
            <Item Value="1" X="9" Y="181"/>
            <Item Value="0" X="185" Y="21"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="160"/>
      </Rotate>
   </Element>
   <Mouse>
      <Tooltip>Fwd Discharge Valve %( (L:fwd_dv_segment,enum) )%{if}Cross-Lined%{else}In_Line%{end}</Tooltip>
   </Mouse>
</Gauge>
 
Alright, this is today's progress. A few bugs to fix, here and there, and still figure out how to use the tape VS/Pitch tape.

Do you mean the animation or the autopilot interaction? For the former, you'll need a few bitmaps to create the illusion of a scrolling wheel, for the latter, you can use the default autopilot pitch hold (sans wing leveler) and vertical speed hold commands.

Other than that, good work.
 
You mean something like this Bill. A discharge valve. The front disc rotates when the valve is open or closed (crosslined). And a white disc appears in the window to indicate by how much the valve is open. Not bad for FS9 eh!!!
Nice! That's not precisely what I was speaking of though. I am meaning the drawing of an arc on a glass gauge, such as fuel level, N1%, N2% and so forth. XML can do vector drawing similar to what GDI+ can do, where there are no 'bitmaps' involved, just simple drawing instructions.

See: http://www.avsim.com/topic/75318-xml-pie-drawing-fs9fsx/ for more.
 
This plane, it seems, has 3 types of trims. FD Trim wheel(under the Artificial Horizon), VS Trim(on the side of the Turn knob) and the elevator Trim wheel.

Turns out, the VS Trim wheel, the one alongside the Turn Knob, only displays information after I turn on the Autopilot and fly. If I try to move the VS Trim wheel on my 2D panel it will go crazy.

I'm think of elimination the line I did for the position 0 of that wheel, since it behaves quite oddly.

I'm going to attempt to do some flights, perhaps tomorrow, to check for more bugs or other problems. Since I'm a bit exhausted after learning on the go, and doing some small coding.

Here you can see, on the picture, on the almost complete guage, my attempt to fix this. At the time of the screenshot I was using two different parameters in that test to see what responded better.

I'll paste the code for it below the picture in case you are curious, try not to laugh at my attempt! hahahaha
It has the code for the bar/wheel and the code extracted from the ModelRef.xml.

Maybe I should use "PITCH_WHEEL_VS" to see if it works and bypass the "dc8_ap_Vspeed_alt"?

Z1KHNpr.png





Code:
    <Element> //Pitch VS - LEFT
        <Position X="215" Y="74"/>
        <MaskImage Name="Wheel_Mask1.bmp"  Bright="Yes" ImageSizes="27,20">
          //  <Axis X="0" Y="55"/>
        </MaskImage>
        <Position X="215" Y="74"/>
        <Image Name="WheelVS.bmp" Bright="No">// ImageSizes="27,800">
            <Axis X="12" Y="400"/>
            <Nonlinearity>
                <Item Value="9900" X="0" Y="50"/>
                <Item Value="0" x="0" Y="401"/>
                <Item Value="-9900" X="0" Y="750"/>
            </Nonlinearity>
           
        </Image>
        <Shift>
            <Value Minimum="-9900" Maximum="9900">(L:dc8_ap_Vspeed_alt, number)</Value>
        </Shift>
    </Element>
   <Element>
        <Position X="215" Y="74"/>
        <Image Name="Wheel_Alpha1.bmp" Alpha="Yes" ImageSizes="27,80"/>
    </Element>
   


        <Area Left="215" Right="250" Top="74" Bottom="180"> // Pitch Trim/VS ---LEFT
            <Tooltip>Selected pitch/VS: (%((L:PITCH_WHEEL_TYPE, number))%{case}%{:0}%((L:PITCH_WHEEL_PITCH, number)) %!d! deg%{else}%((L:PITCH_WHEEL_VS, number)) %!d! ft/min%{end})</Tooltip>
            <Cursor Type="Hand"/>
            <Click Kind="WheelDown+WheelUp+DownRepeat+LeftSingle+MiddleSingle+RightSingle">
                (M:Event) 'RightSingle' scmp 0 ==
                if{ (L:dc8_ap_Vspeed_alt,number) 2 + 200 min (&gt;L:dc8_ap_Vspeed_alt,number)
                (L:dc8_ap_Vspeed_alt,number) 200 == if{ 0 (&gt;L:dc8_ap_Vspeed_alt,number) }
               
                1 (&gt;L:lightrotary_switch,number)
                }
                (M:Event) 'LeftSingle' scmp 0 ==
                if{ (L:dc8_ap_Vspeed_alt,number) 2 - 0 max (&gt;L:dc8_ap_Vspeed_alt,number)
                (L:dc8_ap_Vspeed_alt,number) 0 == if{ 200 (&gt;L:dc8_ap_Vspeed_alt,number) }
               
                1 (&gt;L:lightrotary_switch,number)
                }
                (M:Event) 'WheelDown' scmp 0 ==
                if{ (L:dc8_ap_Vspeed_alt,number) 2 - 0 max (&gt;L:dc8_ap_Vspeed_alt,number)
                (L:dc8_ap_Vspeed_alt,number) 0 == if{ 200 (&gt;L:dc8_ap_Vspeed_alt,number) }
               
                1 (&gt;L:lightrotary_switch,number)
                }
                (M:Event) 'WheelUp' scmp 0 ==
                if{ (L:dc8_ap_Vspeed_alt,number) 2 + 200 min (&gt;L:dc8_ap_Vspeed_alt,number)
                (L:dc8_ap_Vspeed_alt,number) 200 == if{ 0 (&gt;L:dc8_ap_Vspeed_alt,number) }
               
                1 (&gt;L:lightrotary_switch,number)
                }
                (M:Event) 'MiddleSingle' scmp 0 ==
                if{
                1 (&gt;L:button_switch,number)
                }
            </Click>
        </Area>
 
Check the values in the nonlinearity table and shift function. Your L: var has a value range from 0 to 200 and both nonlinearity and shift do not reflect that. You should also adapt the value range to have the neutral position of the bitmap at 0 (since FSX initially loads all L: vars with a value of zero), minimum at -100 and maximum at 100.
 
Check the values in the nonlinearity table and shift function. Your L: var has a value range from 0 to 200 and both nonlinearity and shift do not reflect that. You should also adapt the value range to have the neutral position of the bitmap at 0 (since FSX initially loads all L: vars with a value of zero), minimum at -100 and maximum at 100.


Thanks for the reply and suggestion. I think I managed to do your suggestion, unless I got lost somewhere :D.

I've tried your suggestion, and the other idea I had. Both were unsuccessful.

The one on the left is what you suggested, the one on the right is my attempt. The values change as well, if I switch on the "ALT" switch. It goes from Degrees to ft/min. Without the "ALT" switch on, the maximum range is 30 Degrees, with it on, it changes to 9900 ft/min.

EDIT: Forgot to mention, that I've also used "Degrees" and "number", and neither works.

Maybe it needs something more complex, than just using one nonlinearity numerical range?

I've added a screenshot showing what is happening.

Once again, thank you for your help!


vs wheel.png




Code:
    <!-- _______________________________//Pitch VS - LEFT________________________________ --> 

    <Element> //Pitch VS - LEFT
        <Position X="215" Y="74"/>
        <MaskImage Name="Wheel_Mask1.bmp"  Bright="Yes" ImageSizes="27,20">
          //  <Axis X="0" Y="55"/>
        </MaskImage>
        <Position X="215" Y="74"/>
        <Image Name="WheelVS.bmp" Bright="No">// ImageSizes="27,800">
            <Axis X="12" Y="400"/>
            <Nonlinearity>
                <Item Value="100" X="0" Y="50"/>
                <Item Value="0" x="0" Y="400"/>
                <Item Value="-100" X="0" Y="750"/>
            </Nonlinearity>
          
        </Image>
        <Shift>
            <Value Minimum="-100" Maximum="100">(L:dc8_ap_Vspeed_alt, number)</Value>
        </Shift>
    </Element>
   <Element>
        <Position X="215" Y="74"/>
        <Image Name="Wheel_Alpha1.bmp" Alpha="Yes" ImageSizes="27,80"/>
    </Element>
  
  
    <!-- _______________________________//Pitch VS - RIGHT________________________________ -->   
  
    <Element> //Pitch VS - RIGHT
        <Position X="495" Y="74"/>
        <MaskImage Name="Wheel_Mask1.bmp" PointsTo="North"  Bright="Yes" ImageSizes="27,20">
            <Axis X="0" Y="55"/>
        </MaskImage>
        <Position X="495" Y="74"/>
        <Image Name="WheelVS.bmp" Bright="No">
            <Axis X="12" Y="400"/>
            <Nonlinearity>
                <Item Value="20" X="0" Y="50"/>
                <Item Value="0" x="0" Y="400"/>
                <Item Value="-20" X="0" Y="750"/>
            </Nonlinearity>
          
        </Image>
        <Shift>
            <Value Minimum="-20" Maximum="20">(L:PITCH_WHEEL_VS, number)</Value>
        </Shift>
    </Element>
    <Element>
        <Position X="495" Y="74"/>
        <Image Name="Wheel_Alpha1.bmp" Alpha="Yes" ImageSizes="27,80"/>
    </Element>
 
Back
Top