Jump to content

Sign in to follow this  
Rocky

XML: Pie Drawing - FS9/FSX

Recommended Posts

Okay it seems I've come across something that might get me somewhere, would I use something likeWaypointVorLatitude & WaypointVorLongitudeFirst to get the correct position of - I guess all VOR's - then to place a image or what not on those positions? And I guess I would do the same for other things like NDB's, Airports and runways? :( On a different matter than the one above, but having to do with the GPS system I would like to ask this question:I've built an FMC, and within it I've built a system that can understand numbers and letters, anyway long story short on my Route page I can set the DEST Airport ICAO and what not but it essentially doesn't mean anything so what I've been wanting to do is if there isn't a flight plan active then the DEST airport I enter I want it to be the direct to airport I go to. Now when I show the DEST ICAO it's loaded into four different L:Vars one for each letter, what I want to do is make each one of those letters be understood by the fs9gps.dll Anyway here's the code:

 (@c:FlightPlanIsActiveFlightPlan) 0 ==  if{ (L:FMC-RTE-DEST-1,number) 64 > (L:FMC-RTE-DEST-4,number) 64 > (L:FMC-RTE-DEST,bool) 0 == and and if{  1 (>C:fs9gps:IcaoSearchStartCursor) (L:FMC-RTE-DEST-1,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-2,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-3,number) (>C:fs9gps:IcaoSearchEnterChar) (C:fs9gps:IcaoSearchCursorPosition) 1 + (>C:fs9gps:IcaoSearchCursorPosition) (L:FMC-RTE-DEST-4,number) (>C:fs9gps:IcaoSearchEnterChar)  1 (>C:fs9gps:IcaoSearchStopCursor)  1 (>@c:FlightPlanDirectToDestination)  1 (>L:FMC-RTE-DEST,bool) } } 

I don't have much experience with the fs9gps.dll so I don't know how newbish that looks? :( Thanks for the help!Engjell BerishaGood Day!


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

I thought it would be appropriate to post this here as it's where I learned it.The thing wont budge, why?

  <Element>    <Pie Radius="50" StartAngle="360" EndAngle="270" LineWidth="2" Color="#DDDDDD" FillColor="#525252" Bright="Yes">      <Pivot X="51" Y="51"/>    </Pie>    <Rotate>      <Value>(A:TURB ENG1 N1,perecent)</Value>      <Nonlinearity>        <Item Value="0.0"  X="50" Y="0"/>        <Item Value="40.0" X="0" Y="50"/>      </Nonlinearity>    </Rotate>  </Element>

If I manually put something else in the value like 40 it moves perfectly but other then that it will not move when N1 increases/decreases at all.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Hi,Try to use axis instead of pivot.Jan


Jan

 

 

 

"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

 

 

If I manually put something else in the value like 40 it moves perfectly but other then that it will not move when N1 increases/decreases at all.
It's been far too long since I last worked on this. However, <Pivot> is the correct tag to use.Here's the script I used for the N1% display in the gauge above. Note that instead of a non-linearity table, I've used a scalar value to calibrate the rotation. Also, this uses three "pie" segments. The first "pie" segment is hidden with an overlay mask. The other two segments are hidden behind the first:
<Element Name="Eng1 N1 Gray Circle">
  <Position X="548" Y="123"/>
  <Element>
    <Visible>(A:TURB ENG CORRECTED N1:1,percent) 33.0 <</Visible>
    <Pie Radius="41" StartAngle="360" EndAngle="270" FillColor="#545454" Bright="yes">
      <Pivot X="42" Y="42"/>
    </Pie>
    <Rotate>
      <Value>3.6 (A:TURB ENG CORRECTED N1:1,percent) 100 / *</Value>
    </Rotate>
  </Element>
  <Element>
    <Visible>(A:TURB ENG CORRECTED N1:1,percent) 33.0 > (A:TURB ENG CORRECTED N1:1,percent) 66.0 < and</Visible>
    <Pie Radius="41" StartAngle="360" EndAngle="180" FillColor="#545454" Bright="yes">
      <Pivot X="42" Y="42"/>
    </Pie>
    <Rotate>
      <Value>3.6 (A:TURB ENG CORRECTED N1:1,percent) 100 / *</Value>
    </Rotate>
  </Element>
  <Element>
    <Visible>(A:TURB ENG CORRECTED N1:1,percent) 66.0 ></Visible>
    <Pie Radius="41" StartAngle="360" EndAngle="90" FillColor="#545454" Bright="yes">
      <Pivot X="42" Y="42"/>
    </Pie>
    <Rotate>
      <Value>3.6 (A:TURB ENG CORRECTED N1:1,percent) 100 / *</Value>
    </Rotate>
  </Element>
</Element>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556

Interests: Gauge Programming - 3d Modeling for Milviz

Many Thanks to All That Donated To Our Server Drive!

Share this post


Link to post
Share on other sites

Jan I tried that but it didn't work.Bill, you're the man - again - thank you. The only difference I can tell from my code and yours is that there's no nonlinarity table and you've changed the value it seems to be an angel of 360 from what I can tell.What's the difference between the corrected N1 and the TURB ENG1 N1?EDIT: Bill you said that you hid the other two with the first one and the first one with a mask? How did you hid the other two with the first one?FYI, for whatever odd reason (A:TURB ENG1 N1,perecent) percent will not work, only the corrected [(A:TURB ENG CORRECTED N1:1,percent)] works. I replaced the corrected in bills code with turb eng1 n1 and it didn't work and then I put in the corrected into the initial code I used and it moved just as bills does now. I still don't know the difference between the too but corrected works with pie and turb eng1 n1 won't.


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Hi,See my pie code upstairs.Here i use pivot.In the SDK, see http://msdn.microsoft.com/en-us/library/cc526953.aspx#mozTocId69607 ,axis is adviced.I use axis extensively for my custom made flightplan lines and symbols.Btw. tested:

<Element>
  <Visible>(A:TURB ENG N1:1,percent) 33.0 <</Visible>
  <Pie Radius="41" StartAngle="360" EndAngle="270" FillColor="#545454" Bright="yes">
    <Pivot X="42" Y="42"/>
  </Pie>
  <Rotate>
    <Value>3.6 (A:TURB ENG N1:1,percent) 100 / *</Value>
  </Rotate>
</Element>and<Element>
  <Visible>(A:TURB ENG N1:1,percent) 33.0 <</Visible>
  <Pie Radius="41" StartAngle="360" EndAngle="270" FillColor="#545454" Bright="yes">
    <Axis X="42" Y="42"/>
  </Pie>
  <Rotate>
    <Value>3.6 (A:TURB ENG N1:1,percent) 100 / *</Value>
  </Rotate>
</Element>

and they work ok.Jan


Jan

 

 

 

"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Just tested, they work now on mine too. Thank You Jan.You're saying Axis is more advisable than pivot correct?Would you be able to teach me/point me in the right directions for creating custom flightplan lines & symbols?


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Hi,Custom symbols etc.Still somewhat experimental; lots of inefficient(?) code.Sended it to Spokes and Edetroit to edit and to make it a useful freeware gauge someday if they want so.But you are commercial....Some hints:Most is already here at avsim in the different threads.Use the gps flightplanline and custom symbols.For a transparant background like a hud, make your own lines. For flightplan no problem, but almost impossible for the different approachsegments.The waypoints have there lat/lon, so does your plane.Calculate bearing and distance and use some gonio-mathematics to shift the symbols in regard to the plane's heading.Use some "loop" code from the gps to get the next waypoints.The same applies for fplines, waypoints, nav symbols, runways etc.No bitmaps.Hope it helps,Jan


Jan

 

 

 

"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Bill, you're the man - again - thank you. The only difference I can tell from my code and yours is that there's no nonlinarity table and you've changed the value it seems to be an angel of 360 from what I can tell.What's the difference between the corrected N1 and the TURB ENG1 N1?EDIT: Bill you said that you hid the other two with the first one and the first one with a mask? How did you hid the other two with the first one?
It's been far too long (over 2 years!) since I scripted this, but to the best of my recollection I used the <Pivot> tag so that the same script would work in both FS9 and FSX. It is odd that <Pivot> is not even mentioned in the FSX/ESP SDK, and of course ACES never explained anything in the FS9 SDK, not even that <Pie> or <Arc> existed at all! :( Honestly, I haven't a clue to the (probably very minor) difference between the two (corrected vice non-corrected).If you note, all three of the pie "segments" begin their rotation from the same angle. The <Visibility> code keeps them "hidden" until needed, but even without the <Visibility> condition they'd simply be in the same position as the first "segment..."Were you to make each of the three pie segments a different color, you'd see them "unfolding" like the petals on a lady's "hand fan."BTW, the "scalar" is calculated to calibrate the "percentage" around a 360º rotation. If your display is only a partial rotation such as 270º, then the scalar would be 2.7 of course!

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556

Interests: Gauge Programming - 3d Modeling for Milviz

Many Thanks to All That Donated To Our Server Drive!

Share this post


Link to post
Share on other sites
Hi,Custom symbols etc.Still somewhat experimental; lots of inefficient(?) code.Sended it to Spokes and Edetroit to edit and to make it a useful freeware gauge someday if they want so.But you are commercial....Some hints:Most is already here at avsim in the different threads.Use the gps flightplanline and custom symbols.For a transparant background like a hud, make your own lines. For flightplan no problem, but almost impossible for the different approachsegments.The waypoints have there lat/lon, so does your plane.Calculate bearing and distance and use some gonio-mathematics to shift the symbols in regard to the plane's heading.Use some "loop" code from the gps to get the next waypoints.The same applies for fplines, waypoints, nav symbols, runways etc.No bitmaps.Hope it helps,Jan
I'm actually more freeware than it seems you think or than I seem to have been labeled, but I suppose I'm not labeled that way....I'll see what I can figure out from your advice, thank you Jan.
It's been far too long (over 2 years!) since I scripted this, but to the best of my recollection I used the <Pivot> tag so that the same script would work in both FS9 and FSX. It is odd that <Pivot> is not even mentioned in the FSX/ESP SDK, and of course ACES never explained anything in the FS9 SDK, not even that <Pie> or <Arc> existed at all! :( Honestly, I haven't a clue to the (probably very minor) difference between the two (corrected vice non-corrected).If you note, all three of the pie "segments" begin their rotation from the same angle. The <Visibility> code keeps them "hidden" until needed, but even without the <Visibility> condition they'd simply be in the same position as the first "segment..."Were you to make each of the three pie segments a different color, you'd see them "unfolding" like the petals on a lady's "hand fan."BTW, the "scalar" is calculated to calibrate the "percentage" around a 360º rotation. If your display is only a partial rotation such as 270º, then the scalar would be 2.7 of course!
Thank You Bill, makes great sense now. Currently I'm just using a clip to make it look decent I may potentially add a mask if needed, this is great fun though - pie & arc rule!Thank You guys!

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Hi,AFAIK use "corrected" engine values for calculations (airfile) and the "normal" ones in the EICAS.Jan


Jan

 

 

 

"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Hi,AFAIK use "corrected" engine values for calculations (airfile) and the "normal" ones in the EICAS.Jan
Thank You Jan. There isn't a difference between the two values though?

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Does anyone know if the Nearest Selected variables work? I can set the select number but I get nothing for the names or lat/lons of the selected.Such as: NearestVorSelectedVorLatitude


Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Share this post


Link to post
Share on other sites

Hi,No examples in fs.gps.Tried, but failed.Jan


Jan

 

 

 

"Beatus ille qui procul negotiis..."

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    2%
    $540.00 of $25,000.00 Donate Now
×
×
  • Create New...