Sign in to follow this  
Rocky

XML: Pie Drawing - FS9/FSX

Recommended Posts

The following XML script will draw a lovely "pie element" from 210 degrees to 0 degrees (0 is the "points east" ending point.The SDK insists that adding StartAngleScript= to the command string will allow one to use a "script" to control the dynamics of the drawing, such as evaluating/scaling N1% for example.However, nothing I've tried seems to work. Has anyone ever gotten this working?

<Element><Position X="506" Y="83"/><Pie Radius="41" StartAngle="210" EndAngle="0" LineWidth="2" LineColor="White" FillColor="#545454" Bright="Yes"/></Element>

210 degrees full scale / 100 percent = 2.1 scalar needed.

<Pie Radius="41" StartAngle="210" StartAngleScript="%((A:TURB ENG CORRECTED N1:1,percent) 2.1 *)%!2d!%" EndAngle="0" LineWidth="2" LineColor="White" FillColor="#545454" Bright="Yes"/>

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hey Bill,Try this:StartAngleScript="(A:TURB ENG CORRECTED N1:1,percent) 2.1 *"orStartAngleScript="((A:TURB ENG CORRECTED N1:1,percent) 2.1 *)"I don't think you need the percent signs and the fixed length formatting (which is probably turning your numeric value into a string).

Share this post


Link to post
Share on other sites

StartAngleScript="(A:TURB ENG CORRECTED N1:1,percent) 2.1 *"

or

StartAngleScript="((A:TURB ENG CORRECTED N1:1,percent) 2.1>*)"

 

I don't think you need the percent signs and the fixed length>formatting (which is probably turning your numeric value into>a string).

 

I'll give it a try. At least it's a suggestion... ;)

 

I've discovered that Pie and Arc actually DO work in FS9's XML syntax (which is a surprise to me!), but I hadn't gotten this part working yet.

 

I know I could script in pure FSX XML schema, but I need to have something that will work in both sim versions.

 

I did discover (the hard way of course) that LineColor doesn't work in FS9's schema. Color works fine though!

<Polyline LineWidth="3" LineColor="#05BE1A" FillColor="Black" Bright="Yes">
will have a WHITE Line...

<Polyline LineWidth="3" Color="#05BE1A" FillColor="Black" Bright="Yes">
will have a GREEN Line... :)

Share this post


Link to post
Share on other sites

Well... This is a pity... The following will draw the initial StartAngle correctly, but it will never update... :(This is the final thing I need to accomplish somehow...

<Pie Radius="41" StartAngle="(A:TURB ENG CORRECTED N1:1,percent)" EndAngle="0" LineWidth="2" Color="White" FillColor="#545454" Bright="Yes">

b787mfd000006ts6.jpg

Share this post


Link to post
Share on other sites

>Well... This is a pity... The following will draw the initial>StartAngle correctly, but it will never update... :(>>This is the final thing I need to accomplish somehow...>>FillColor="#545454" Bright="Yes">I could never make work in FS9...How did you do that? Unfortunately, the use of scripts in drawing vectors (line, pie,rectangle,etc both in FS9 and FSX) is limited to the starting point only, so it's not very useful IMHO. BTW, you should use TURB ENG N1 instead of the corrected value in engine gauges :-)Tom

Share this post


Link to post
Share on other sites

Hi,This works, just a test, a workaround?:(A:general eng1 throttle lever position,part) 0.33 <(A:general eng1 throttle lever position,part)(A:general eng1 throttle lever position,part) 0.33 > (A:general eng1 throttle lever position,part) 0.66 < and(A:general eng1 throttle lever position,part)(A:general eng1 throttle lever position,part) 0.66 >(A:general eng1 throttle lever position,part)By testing you will see what i mean.Change Lines and Colours etc.Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Brilliant, Jan. If you can't rotate your pie, pie your rotates! :)

Share this post


Link to post
Share on other sites

Congratulations for doing a so nice display in XML, really amazing !!I am especially surprised by the curve drawn for the flight route.Eric

Share this post


Link to post
Share on other sites
Congratulations for doing a so nice display in XML, really amazing !!I am especially surprised by the curve drawn for the flight route.Eric
I know I'm really late on this topic, but is Eric right? In that did you indeed construct that display using XML? :( I've been trying for ages to figure out how to code just one of the features of your display, to no avail and you've constructed everything I've ever wanted to get out of a XML display.How'd you go about creating the climb/descend prediction bar (The green one, don't know the right term for it). How is it possible to change the display of Intersections, NDB's, VOR's, Airports, and runways the way you've done so in your display? :( :( Achieveing something anywhere near what you've achieved in your display has become my insparation, I've put it up on my desktop to be inspired to build it! B) B)

Share this post


Link to post
Share on other sites

NOTE: Since the forum software was updated last year, previously posted XML Script examples are being "hidden from view" unless they are wrapped in {CODE} tags. I've taken the liberty to respond to Jan's old post simply so I could resurrect his XML Script for everyone to see. There's nothing more annoying when searching for answers to find that because of age they've been "hidden from view!" :(

 

Hi,This works, just a test, a workaround?:
<Element>
  <Position X="100" Y="100"/>
  <Element>
    <Visible>
      (A:general eng1 throttle lever position,part) 0.33 <
    </Visible>
    <Pie Radius="50" StartAngle="360" EndAngle="270" LineWidth="2" Color="dkgray" FillColor="red" Bright="yes">
      <Pivot X="51" Y="51"/>
    </Pie>
    <Rotate>
      <Value>(A:general eng1 throttle lever position,part)</Value>
      <Nonlinearity>
        <Item Value="0" X="50" Y="0"/>
        <Item Value="0.4" X="0" Y="50"/>
      </Nonlinearity>
    </Rotate>
  </Element>
  <Element>
    <Visible>
      (A:general eng1 throttle lever position,part) 0.33 > (A:general eng1 throttle lever position,part) 0.66 < and
    </Visible>
    <Pie Radius="50" StartAngle="360" EndAngle="180" LineWidth="2" Color="dkgray" FillColor="red" Bright="yes">
      <Pivot X="51" Y="51"/>
    </Pie>
    <Rotate>
      <Value>(A:general eng1 throttle lever position,part)</Value>
      <Nonlinearity>
        <Item Value="0" X="50" Y="0"/>
        <Item Value="0.4" X="0" Y="50"/>
      </Nonlinearity>
    </Rotate>
  </Element>
  <Element>
    <Visible>(A:general eng1 throttle lever position,part) 0.66 ></Visible>
    <Pie Radius="50" StartAngle="360" EndAngle="90" LineWidth="2" Color="dkgray" FillColor="red" Bright="yes">
      <Pivot X="51" Y="51"/>
    </Pie>
    <Rotate>
      <Value>(A:general eng1 throttle lever position,part)</Value>
      <Nonlinearity>
        <Item Value="0" X="50" Y="0"/>
        <Item Value="0.4" X="0" Y="50"/>
      </Nonlinearity>
    </Rotate>
  </Element>
  <Element>
    <Position X="0" Y="-50"/>
    <Polygon LineWidth="2" Color="dkgray" FillColor="green" Bright="yes">
      <Point X="-30" Y="-1"/>
      <Point X="-1" Y="50"/>
      <Point X="50" Y="50"/>
      <Point X="50" Y="-1"/>
      <Point X="-30" Y="-1"/>
    </Polygon>
  </Element>
</Element>

By testing you will see what i mean.Change Lines and Colours etc.Hope it helps,Jan"Beatus ille qui procul negotiis..."

Edited by n4gix
Resurrect Jan's XML Script again!

Share this post


Link to post
Share on other sites
I know I'm really late on this topic, but is Eric right? In that did you indeed construct that display using XML? :( I've been trying for ages to figure out how to code just one of the features of your display, to no avail and you've constructed everything I've ever wanted to get out of a XML display.How'd you go about creating the climb/descend prediction bar (The green one, don't know the right term for it). How is it possible to change the display of Intersections, NDB's, VOR's, Airports, and runways the way you've done so in your display? :( :( Achieveing something anywhere near what you've achieved in your display has become my insparation, I've put it up on my desktop to be inspired to build it! B) B)
Yes, the entire display is XML script. It was one of the "gauges" I programmed under contract with ABACUS for their newest version of the B787.As for the "custom display" of VORs, NDBs, Intersections, et cetera one simply takes the returned Lat/Lon for each one and draws one's own graphic in lieu of having the default drawn.As for the VNav display, I never did manage to get it working properly. What's shown in the screenshot is a static view of the real display. I wound up simplifying it considerably for the final release version:b787000002.th.jpg

Share this post


Link to post
Share on other sites

Bill would you be able to show me some example code on how to achieve this? I'm un-able to conceive how to do so. :( The main things I want to accomplish are to produce the following things:Coustom drawings/txt for the Intersections, VOR's, NDB's, and RWY's - I'm assuming you've tied this to an FMC as to select the departure/arrival runway and then show it on the ND.And another really usefull bit of code would be the vertical speed trend bar.I appreciate any/all the help you can provide me with!

Share this post


Link to post
Share on other sites

Anyone here know how this can be done?By this I mean using your own drawings for the symbols of waypoints and what not.

Share this post


Link to post
Share on other sites
The main things I want to accomplish are to produce the following things:Coustom drawings/txt for the Intersections, VOR's, NDB's, and RWY's - I'm assuming you've tied this to an FMC as to select the departure/arrival runway and then show it on the ND.
Oh dear! I completely missed your question the first time around...In any event, what you see in the full panel for the nav data is default from the fs9gps.dll...There's an amazing variety of things you can do with the default symbols however.Yes, there's an FMC providing signals to drive the autopilot and the displays.

Share this post


Link to post
Share on other sites
Oh dear! I completely missed your question the first time around...In any event, what you see in the full panel for the nav data is default from the fs9gps.dll...There's an amazing variety of things you can do with the default symbols however.Yes, there's an FMC providing signals to drive the autopilot and the displays.
How would I go about achieving what ever I want - what you did with the intersection symbols & runway & VOR - I know I can't edit the FS9GPS.dll, so I wonder what you did to achieve such a result in your display? I would assume you collected information from the module and then drew up the symbols - how would one do that, collect the information, then display the appropriate symbol in respect to the information...?I've been going crazy trying to figure something out from the default GPS's or somewhere online but I can't find anything that would even lead me in the right direction, everything I've come across so far seems to be limited to the default ugly runway blocks not like yours at all!I assume it would be troublesome for you to teach me exactly how to do it, but if you would just point me in the right direction?You had originally said: "As for the "custom display" of VORs, NDBs, Intersections, et cetera one simply takes the returned Lat/Lon for each one and draws one's own graphic in lieu of having the default drawn."This seems quite troublesome to me, I can not fathom how to take the LAT/LON for every intersection that is to be displayed within the range of the window a (In my case a min of 5NM and Max of 320NM) and neglect displaying the one that's there and display my own image... :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this