/////////////////////////////////////////////////////////////////////////////
// All_gears_down_ind.c
// 
/////////////////////////////////////////////////////////////////////////////
//
signed int All_gears_down_ind = 0;
MODULE_VAR RADIO_HEIGHT_var = {RADIO_HEIGHT};
MODULE_VAR VERTICAL_VELOCITY_var = {VERTICAL_VELOCITY};


//	Set up gauge header
char All_gears_down_ind_gauge_name[]	= GAUGE_NAME;
extern PELEMENT_HEADER	All_gears_down_ind_list;

GAUGE_HEADER_FS700(GAUGE_W, All_gears_down_ind_gauge_name, &All_gears_down_ind_list, \
						0, 0, 0, 0, 0);


/*---------------------------------------------------------------------------
---- Functions that ilustrate status of Keys --------------------------------
---------------------------------------------------------------------------*/
FLOAT64 FSAPI	All_gears_down_ind_icon_cb( PELEMENT_ICON pelement )
{
	lookup_var (&RADIO_HEIGHT_var);
	lookup_var (&VERTICAL_VELOCITY_var);
	if ( RADIO_HEIGHT_var.var_value.n < 300 && VERTICAL_VELOCITY_var.var_value.n < -3 && Nose_gear_ind != 1 && Left_gear_ind != 1 && Right_gear_ind != 1 ) {
		All_gears_down_ind = 1; // If lower then 300 meters
	}
	else All_gears_down_ind = 0;
	return All_gears_down_ind;
}

/*---------------------------------------------------------------------------
------------ Make ICONS macroses     ----------------------------------------
---------------------------------------------------------------------------*/

MAKE_ICON
(		
	All_gears_down_ind_icon,
	BMP_All_gears_down_off,
	NULL,
	NULL,
	IMAGE_USE_BRIGHT | IMAGE_USE_TRANSPARENCY,
	0,
	0,0,

	MODULE_VAR_NONE, All_gears_down_ind_icon_cb,

	ICON_SWITCH_TYPE_SET_CUR_ICON,
	2,
	0,
	0
)

PELEMENT_HEADER		All_gears_down_ind_icon_list[] =
{
	&All_gears_down_ind_icon.header,
	NULL
};
/////////////////////////////////////////////////////////////////////////////
MAKE_STATIC
(
	All_gears_down_ind_background,
	BMP_All_gears_down_off,
	&All_gears_down_ind_icon_list,
	NULL,
	IMAGE_USE_TRANSPARENCY,
	0,
	0,0
)

PELEMENT_HEADER		All_gears_down_ind_list= &All_gears_down_ind_background.header;

/////////////////////////////////////////////////////////////////////////////


#undef GAUGE_NAME
#undef GAUGEHDR_VAR_NAME
#undef GAUGE_W
