Sign in to follow this  
Guest Patrick_Waugh

Round 'n round she goes.

Recommended Posts

I have to laugh, because a few months ago, I was asking how to get a gauge to do this (see below), and now I'm asking how to keep a gauge from doing this. ;DAnyway, I have this VSI:http://i91.photobucket.com/albums/k282/Ben...vionics/Vsi.jpgand as you can see it has +/- 2000 ft/min in the same place.Using VERTICAL_SPEED with this non-linearity and callback:[pre]NONLINEARITY vsi_nonLinearity[] = { { {210, 128}, -2000, 0 }, { {191, -75}, -1500, 0 }, { {119, -46}, -1000, 0 }, { {66, -72}, -500, 0 }, { { 45, 128}, 0, 0 }, { { 66, 72}, 500, 0 }, { {119, 46}, 1000, 0 }, { {191, 75}, 1500, 0 }, { {210, 128}, 2000, 0 }};FLOAT64 FSAPI VsiNeedle_cb(PELEMENT_NEEDLE pelement){ const FLOAT64 maxVelocity = 2000.0; const FLOAT64 minVelocity = -2000.0; FLOAT64 velocity = pelement->source_var.var_value.n; if (velocity > maxVelocity) { return maxVelocity; } else if(velocity < minVelocity) { return minVelocity; } else return velocity;}[/pre]with a standard MAKE_NEEDLE macro (included for completeness)[pre]MAKE_NEEDLE( vsiNeedle, BMP_NEEDLE_VSI, NULL, vsi_fail, IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE | IMAGE_USE_LUMINOUS, 0, 128, 128, // Needle center on BG 42, 10, // Center position on Needle VERTICAL_SPEED, VsiNeedle_cb, vsi_nonLinearity, 6)PELEMENT_HEADER vsiNeedle_list[] = { &vsiNeedle.header, NULL };[pre]all apears fine, with it appearing to indicate the correct rate, until I get really high/low rates. At this point, the gauge "wraps" and "unwraps" (meaning goes all the way around).I am guessing the way to fix this is that I must not have the +2000 ft/min and -2000 ft/min points be exactly the same.Is there anything else problematic with the non-linearity?PatrickFYI: I'm very excited, here's what it's looking like now!http://i91.photobucket.com/albums/k282/Ben...ancedPanel2.png

Share this post


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

Figure it out. When I did the non-linearity table, I had obviously needed more sleep.After I corrected the table to:

NONLINEARITY vsi_nonLinearity[] = {	{ {210, 128},	-2000, 0 },	{ {191, 175},	-1500, 0 },	{ {120, 210},	-1000, 0 },	{ {66,  184},	 -500, 0 },	{ { 45, 128},	  0, 0 },	{ { 66,  72},	  500, 0 },	{ {120,  46},	 1000, 0 },	{ {191,  76},	 1500, 0 },	{ {210, 128},	 2000, 0 }};
everything worked fine. :DPatrick

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