Jump to content
Sign in to follow this  
badderjet

GDI+ Nonlinearity Needles (C++)

Recommended Posts

Guest schwudde

Hello at all!I have one Question: has anyone figured out or could anyone explain me how to Setup nonlinearity Needles in GDI+ Gauges using C++? My linearity Transformations working fine but i have no Idea how to make this for Nonlineraity. I want to draw a Needle for the Vertical Speed (Values in Range +- 6000ft) similar to the Airbus or Boeing PFD's.Thanks for your Help.RegardsSven

Share this post


Link to post
Share on other sites

>Hello at all!>>I have one Question: has anyone figured out or could anyone>explain me how to Setup nonlinearity Needles in GDI+ Gauges>using C++? My linearity Transformations working fine but i>have no Idea how to make this for Nonlineraity. I want to draw>a Needle for the Vertical Speed (Values in Range +- 6000ft)>similar to the Airbus or Boeing PFD's.>>Thanks for your Help.>>Regards>SvenIn the easiest case the scale will be split up into linear parts, depends on the type of aircraft you are modelling obviously. That way you could just define an if-construction, like:if VS between -1000 and 1000, move needle at (fictious) speed 3if VS between 1000 and 3000, move needle at speed 2 (same for negative values)if VS between 3000 and 6000, move needle at speed 1Cheers, :-beerchugEtienne :-wave

Share this post


Link to post
Share on other sites

In GDI+ (as well as XML "vector drawing") movement is accomplished by shifting x and/or y coordinate values by some calculated factor.For example, if you need to shift the x coordinate from 0 to 1000, and the total "distance in pixels" between 0 and 1000 is say, 300, then you will need to calculate the appropriate factor by dividing delta-pixels by the delta-value:300pix / 1000ft-min = 0.3 pix per ft-minIf the next range from 1000 to 2000 is only 200 pixels, then the factor becomes:200pix / 1000ft-min = 0.2 pix per ft-minAlternatively, you can use a similar method to calculate a rotational factor based on the degree of rotation needed for each non-linear portion of your scale.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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.
×
×
  • Create New...