PDA

View Full Version : Gauge help


Astoroth
December 13th, 2007, 00:38
For the gauge guru's out there, is it possible to make a gauge, possibly one of those invisible .xml gauges, that could do 2 things at once?

For instance, I have a project that I have been tinkering with for about a year. I have it flying just the way I want it, but landings are kind of complicated. When landing you have to get your airspeed down to about 20 knts and altitude about the ground at about 20 feet, then put the gear down and pop the flaps to full at the same time. Would it be possible to create a gauge that would do both of those things with one button press? Right now I have it set up thru FSUIPC to do both with one keypress, but it takes a registered copy of FSUIPC to access the button programming feature and not everyone has a registered copy. Would be nice if it could be done with one of those invisible .xml gauges, so I guess I am just asking if it is possible.

Thanks,

~A~

Moparmike
December 13th, 2007, 10:12
Yup, Would be no problem to do something like that. Just set up your trigger event (being at your altitude and under your airspeed limit) to trigger those two key events (set flap position to 100% and lower gear).

Not real up on my XML programming but here's a snippet of a C-type gauge callback function that would do both set the spoiler and set the flaps up/down at the same time.


FLOAT64 FSAPI action_cb (PELEMENT_ICON pelement)

{
if(pelement->source_var.var_value.n<=97.19) //<--use this area to set your conditions
{
trigger_key_event( KEY_SPOILERS_ON, 1 );
trigger_key_event( FLAPS_DOWN, 1 );
return 1;
}

else
{
trigger_key_event( KEY_SPOILERS_OFF, 0 );
trigger_key_event( KEY_FLAPS_UP, 0 );
return 0;
}
}