//
// Tank_RO_R.c
//

int Tank_RO_R = 0;  // Tank_RO_R counter

char	 Tank_RO_R_gauge_name[]		= GAUGE_NAME;
extern	 PELEMENT_HEADER			Tank_RO_R_list;
extern	 MOUSERECT					Tank_RO_R_mouse_rect[];

GAUGE_HEADER_FS700(GAUGE_W, Tank_RO_R_gauge_name, &Tank_RO_R_list, \
						Tank_RO_R_mouse_rect, 0, 0, 0, 0);

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

/////////////////////////////////////////////////////////////////////////////
FLOAT64 FSAPI	Tank_RO_R_string_cb( PELEMENT_STRING pelement )
{
	int tmp;

	tmp = Tank_1_R + Tank_2_R + Tank_4 / 2;
	if ( tmp > 1900) {
		Tank_RO_R = 1900;
	}
	else Tank_RO_R = tmp;

	sprintf(pelement->string ,"%04d",Tank_RO_R);

	return Tank_RO_R;
}

MAKE_STRING
(
	Tank_RO_R_string,
	NULL,
	Tank_RO_R_fail,
	IMAGE_USE_ERASE | IMAGE_USE_BRIGHT | IMAGE_USE_BRIGHT | IMAGE_USE_TRANSPARENCY,
	0,
	6, 1,
	90, 57,
	4,

	FUEL_TANK_RIGHT_TIP_LEVEL,
	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_RO_R_string_cb
)

PELEMENT_HEADER		Tank_RO_R_icon_list[] =
{
	&Tank_RO_R_string.header,
	NULL
};


/////////////////////////////////////////////////////////////////////////////
MAKE_STATIC
(
	Tank_RO_R_background,
	BMP_String_bg,
	&Tank_RO_R_icon_list,
	NULL,
	IMAGE_USE_TRANSPARENCY,
	0,
	0,0
)

PELEMENT_HEADER		Tank_RO_R_list	= &Tank_RO_R_background.header;


MOUSE_BEGIN( Tank_RO_R_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


