//
// Tank_1.c
//
char	 Tank_1_gauge_name[]		= GAUGE_NAME;
extern	 PELEMENT_HEADER			Tank_1_list;
extern	 MOUSERECT					Tank_1_mouse_rect[];

GAUGE_HEADER_FS700(GAUGE_W, Tank_1_gauge_name, &Tank_1_list, \
						Tank_1_mouse_rect, 0, 0, 0, 0);

/////////////////////////////////////////////////////////////////////////////
FAILURE_RECORD	Tank_1_fail[] =
{
	{FAIL_SYSTEM_ELECTRICAL_PANELS, FAIL_ACTION_NO_DRAW},
	{FAIL_NONE, FAIL_ACTION_NONE}
};

/////////////////////////////////////////////////////////////////////////////
FLOAT64 FSAPI	Tank_1_string_cb( PELEMENT_STRING pelement )
{
	lookup_var( &FUEL_TANK_LEFT_AUX_LEVEL_var );
	lookup_var( &FUEL_TANK_RIGHT_AUX_LEVEL_var );
	Tank_1_R = FUEL_TANK_RIGHT_AUX_LEVEL_var.var_value.n / 8388608 * 7000;
	Tank_1_L = FUEL_TANK_LEFT_AUX_LEVEL_var.var_value.n / 8388608 * 7000;
	Tank_1 = ( ( FUEL_TANK_LEFT_AUX_LEVEL_var.var_value.n + FUEL_TANK_RIGHT_AUX_LEVEL_var.var_value.n ) / 8388608 ) * 7000;

	sprintf(pelement->string ,"%05d",Tank_1);

	return Tank_1;
}

MAKE_STRING
(
	Tank_1_string,
	NULL,
	Tank_1_fail,
	IMAGE_USE_ERASE | IMAGE_USE_BRIGHT | IMAGE_USE_BRIGHT | IMAGE_USE_TRANSPARENCY,
	0,
	6, 1,
	94, 61,
	5,

	MODULE_VAR_NONE,  
	MODULE_VAR_NONE,
	MODULE_VAR_NONE,
	RGB(0,161,0),
	RGB(0,0,0),
	RGB(92,92,92),
	GAUGE_FONT_DEFAULT,
	GAUGE_WEIGHT_DEFAULT,
	GAUGE_CHARSET,
	0,
	DT_CENTER | DT_VCENTER | DT_SINGLELINE,
	NULL,
	Tank_1_string_cb
)

PELEMENT_HEADER		Tank_1_icon_list[] =
{
	&Tank_1_string.header,
	NULL
};


/////////////////////////////////////////////////////////////////////////////
MAKE_STATIC
(
	Tank_1_background,
	BMP_String_bg,
	&Tank_1_icon_list,
	NULL,
	IMAGE_USE_TRANSPARENCY,
	0,
	0,0
)

PELEMENT_HEADER		Tank_1_list	= &Tank_1_background.header;


MOUSE_BEGIN( Tank_1_mouse_rect, HELP_NONE, 0, 0 )
MOUSE_END


/////////////////////////////////////////////////////////////////////////////
#undef GAUGE_NAME
#undef GAUGEHDR_VAR_NAME
#undef GAUGE_W
#undef GAUGE_CHARSET
#undef GAUGE_FONT_DEFAULT
#undef GAUGE_WEIGHT_DEFAULT


