Neetha Girish <neethagirish@usa.net>
==================================== Cockpit.cxx ----------- Commented #ifdef FIGHTER_HUD. Hud.cxx ------- Included code to read the xml file and draw the corresponding instrument. Hud.hxx, Hud_ladr.cxx, Hud_card.cxx and Hud_labl.cxx --------------------------------------------------- Integrated code to draw any kind of hud. Preference.xml --------------- Included XML file path in the sim/hud property. ReadMe.xmlhud ------------- The Readme.xmlhud describes the reconfigurable HUD implemented thru XML files.
This commit is contained in:
parent
6f6f19cf24
commit
af80c2080b
6 changed files with 1735 additions and 2554 deletions
|
@ -286,22 +286,28 @@ float get_view_direction( void )
|
|||
}
|
||||
|
||||
// $$$ begin - added, VS Renganathan 13 Oct 2K
|
||||
#ifdef FIGHTER_HUD
|
||||
// #ifdef FIGHTER_HUD
|
||||
float get_Vx ( void )
|
||||
{
|
||||
float Vxx = current_aircraft.fdm_state->get_V_north_rel_ground();
|
||||
// CLO - 5 Jan 2000 - something needs to get addressed here
|
||||
// float Vxx = current_aircraft.fdm_state->get_V_north_rel_ground();
|
||||
float Vxx = 0;
|
||||
return (Vxx);
|
||||
}
|
||||
|
||||
float get_Vy ( void )
|
||||
{
|
||||
float Vyy = current_aircraft.fdm_state->get_V_east_rel_ground();
|
||||
// CLO - 5 Jan 2000 - something needs to get addressed here
|
||||
// float Vyy = current_aircraft.fdm_state->get_V_east_rel_ground();
|
||||
float Vyy = 0;
|
||||
return (Vyy);
|
||||
}
|
||||
|
||||
float get_Vz ( void )
|
||||
{
|
||||
float Vzz = current_aircraft.fdm_state->get_V_down_rel_ground();
|
||||
// CLO - 5 Jan 2000 - something needs to get addressed here
|
||||
// float Vzz = current_aircraft.fdm_state->get_V_down_rel_ground();
|
||||
float Vzz = 0;
|
||||
return (Vzz);
|
||||
}
|
||||
|
||||
|
@ -508,7 +514,7 @@ float get_aux18 (void)
|
|||
FGADA *fdm = (FGADA *)current_aircraft.fdm_state;
|
||||
return fdm->get_aux18();
|
||||
}
|
||||
#endif
|
||||
// #endif
|
||||
// $$$ end - added, VS Renganathan 13 Oct 2K
|
||||
|
||||
|
||||
|
|
1712
src/Cockpit/hud.cxx
1712
src/Cockpit/hud.cxx
File diff suppressed because it is too large
Load diff
|
@ -444,9 +444,9 @@ class instr_item { // An Abstract Base Class (ABC)
|
|||
UINT height,
|
||||
UINT width,
|
||||
FLTFNPTR data_source,
|
||||
float data_scaling,
|
||||
float data_scaling,
|
||||
UINT options,
|
||||
bool working = true);
|
||||
bool working = true);
|
||||
|
||||
instr_item( const instr_item & image );
|
||||
|
||||
|
@ -530,6 +530,8 @@ class instr_label : public instr_item {
|
|||
int fontSize;
|
||||
int blink;
|
||||
char format_buffer[80];
|
||||
bool lat;
|
||||
bool lon;
|
||||
|
||||
public:
|
||||
instr_label( int x,
|
||||
|
@ -538,14 +540,16 @@ class instr_label : public instr_item {
|
|||
UINT height,
|
||||
FLTFNPTR data_source,
|
||||
const char *label_format,
|
||||
const char *pre_label_string = 0,
|
||||
const char *post_label_string = 0,
|
||||
float scale_data = 1.0,
|
||||
UINT options = HUDS_TOP,
|
||||
fgLabelJust justification = CENTER_JUST,
|
||||
int font_size = SMALL,
|
||||
int blinking = NOBLINK,
|
||||
bool working = true);
|
||||
const char *pre_label_string,
|
||||
const char *post_label_string,
|
||||
float scale_data,
|
||||
UINT options,
|
||||
fgLabelJust justification,
|
||||
int font_size,
|
||||
int blinking,
|
||||
bool latitude,
|
||||
bool longitude,
|
||||
bool working);
|
||||
|
||||
~instr_label();
|
||||
|
||||
|
@ -574,14 +578,14 @@ class lat_label : public instr_item {
|
|||
UINT height,
|
||||
FLTFNPTR data_source,
|
||||
const char *label_format,
|
||||
const char *pre_label_string = 0,
|
||||
const char *post_label_string = 0,
|
||||
float scale_data = 1.0,
|
||||
UINT options = HUDS_TOP,
|
||||
fgLabelJust justification = CENTER_JUST,
|
||||
int font_size = SMALL,
|
||||
int blinking = NOBLINK,
|
||||
bool working = true);
|
||||
const char *pre_label_string,
|
||||
const char *post_label_string,
|
||||
float scale_data,
|
||||
UINT options,
|
||||
fgLabelJust justification,
|
||||
int font_size,
|
||||
int blinking,
|
||||
bool working);
|
||||
|
||||
~lat_label();
|
||||
|
||||
|
@ -609,14 +613,14 @@ class lon_label : public instr_item {
|
|||
UINT height,
|
||||
FLTFNPTR data_source,
|
||||
const char *label_format,
|
||||
const char *pre_label_string = 0,
|
||||
const char *post_label_string = 0,
|
||||
float scale_data = 1.0,
|
||||
UINT options = HUDS_TOP,
|
||||
fgLabelJust justification = CENTER_JUST,
|
||||
int font_size = SMALL,
|
||||
int blinking = NOBLINK,
|
||||
bool working = true);
|
||||
const char *pre_label_string,
|
||||
const char *post_label_string,
|
||||
float scale_data,
|
||||
UINT options,
|
||||
fgLabelJust justification,
|
||||
int font_size,
|
||||
int blinking,
|
||||
bool working);
|
||||
|
||||
~lon_label();
|
||||
|
||||
|
@ -652,14 +656,14 @@ class instr_scale : public instr_item {
|
|||
FLTFNPTR load_fn,
|
||||
UINT options,
|
||||
float show_range,
|
||||
float max_value = 100.0,
|
||||
float min_value = 0.0,
|
||||
float disp_scaling = 1.0,
|
||||
UINT major_divs = 10,
|
||||
UINT minor_divs = 5,
|
||||
UINT rollover = 0,
|
||||
int dp_showing = 2,
|
||||
bool working = true);
|
||||
float max_value,
|
||||
float min_value,
|
||||
float disp_scaling,
|
||||
UINT major_divs,
|
||||
UINT minor_divs,
|
||||
UINT rollover,
|
||||
int dp_showing,
|
||||
bool working = true);
|
||||
|
||||
virtual ~instr_scale();
|
||||
instr_scale( const instr_scale & image);
|
||||
|
@ -683,7 +687,20 @@ class instr_scale : public instr_item {
|
|||
class hud_card : public instr_scale {
|
||||
private:
|
||||
float val_span;
|
||||
string type;
|
||||
float half_width_units;
|
||||
bool draw_tick_bottom;
|
||||
bool draw_tick_top;
|
||||
bool draw_tick_right;
|
||||
bool draw_tick_left;
|
||||
bool draw_cap_bottom;
|
||||
bool draw_cap_top;
|
||||
bool draw_cap_right;
|
||||
bool draw_cap_left;
|
||||
float marker_offset;
|
||||
bool pointer;
|
||||
string pointer_type;
|
||||
|
||||
|
||||
public:
|
||||
hud_card( int x,
|
||||
|
@ -692,15 +709,27 @@ class hud_card : public instr_scale {
|
|||
UINT height,
|
||||
FLTFNPTR load_fn,
|
||||
UINT options,
|
||||
float maxValue = 100.0,
|
||||
float minValue = 0.0,
|
||||
float disp_scaling = 1.0,
|
||||
UINT major_divs = 10,
|
||||
UINT minor_divs = 5,
|
||||
UINT modulator = 100,
|
||||
int dp_showing = 2,
|
||||
float value_span = 100.0,
|
||||
bool working = true);
|
||||
float maxValue,
|
||||
float minValue,
|
||||
float disp_scaling,
|
||||
UINT major_divs,
|
||||
UINT minor_divs,
|
||||
UINT modulator,
|
||||
int dp_showing,
|
||||
float value_span,
|
||||
string type,
|
||||
bool draw_tick_bottom,
|
||||
bool draw_tick_top,
|
||||
bool draw_tick_right,
|
||||
bool draw_tick_left,
|
||||
bool draw_cap_bottom,
|
||||
bool draw_cap_top,
|
||||
bool draw_cap_right,
|
||||
bool draw_cap_left,
|
||||
float marker_offset,
|
||||
bool pointer,
|
||||
string pointer_type,
|
||||
bool working);
|
||||
|
||||
~hud_card();
|
||||
hud_card( const hud_card & image);
|
||||
|
@ -719,14 +748,14 @@ class guage_instr : public instr_scale {
|
|||
UINT height,
|
||||
FLTFNPTR load_fn,
|
||||
UINT options,
|
||||
float disp_scaling = 1.0,
|
||||
float maxValue = 100,
|
||||
float minValue = 0,
|
||||
UINT major_divs = 50,
|
||||
UINT minor_divs = 0,
|
||||
int dp_showing = 2,
|
||||
UINT modulus = 0,
|
||||
bool working = true);
|
||||
float disp_scaling,
|
||||
float maxValue,
|
||||
float minValue,
|
||||
UINT major_divs,
|
||||
UINT minor_divs,
|
||||
int dp_showing,
|
||||
UINT modulus,
|
||||
bool working);
|
||||
|
||||
~guage_instr();
|
||||
guage_instr( const guage_instr & image);
|
||||
|
@ -750,8 +779,8 @@ class dual_instr_item : public instr_item {
|
|||
UINT height,
|
||||
FLTFNPTR chn1_source,
|
||||
FLTFNPTR chn2_source,
|
||||
bool working = true,
|
||||
UINT options = HUDS_TOP);
|
||||
bool working,
|
||||
UINT options );
|
||||
|
||||
virtual ~dual_instr_item() {};
|
||||
dual_instr_item( const dual_instr_item & image);
|
||||
|
@ -773,12 +802,12 @@ class fgTBI_instr : public dual_instr_item {
|
|||
int y,
|
||||
UINT width,
|
||||
UINT height,
|
||||
FLTFNPTR chn1_source = get_roll,
|
||||
FLTFNPTR chn2_source = get_sideslip,
|
||||
float maxBankAngle = 45.0,
|
||||
float maxSlipAngle = 5.0,
|
||||
UINT gap_width = 5,
|
||||
bool working = true);
|
||||
FLTFNPTR chn1_source,
|
||||
FLTFNPTR chn2_source,
|
||||
float maxBankAngle,
|
||||
float maxSlipAngle,
|
||||
UINT gap_width,
|
||||
bool working);
|
||||
|
||||
fgTBI_instr( const fgTBI_instr & image);
|
||||
fgTBI_instr & operator = (const fgTBI_instr & rhs );
|
||||
|
@ -800,29 +829,52 @@ class HudLadder : public dual_instr_item {
|
|||
UINT minor_div;
|
||||
UINT label_pos;
|
||||
UINT scr_hole;
|
||||
UINT minimal;
|
||||
float vmax;
|
||||
float vmin;
|
||||
float factor;
|
||||
float vmax;
|
||||
float vmin;
|
||||
float factor;
|
||||
string hudladder_type;
|
||||
bool frl;
|
||||
bool target_spot;
|
||||
bool velocity_vector;
|
||||
bool drift_marker;
|
||||
bool alpha_bracket;
|
||||
bool energy_marker;
|
||||
bool climb_dive_marker;
|
||||
bool glide_slope_marker;
|
||||
float glide_slope;
|
||||
bool energy_worm;
|
||||
bool waypoint_marker;
|
||||
|
||||
fgTextList TextList;
|
||||
fgLineList LineList;
|
||||
fgLineList StippleLineList;
|
||||
|
||||
public:
|
||||
HudLadder( int x,
|
||||
HudLadder( string name,
|
||||
int x,
|
||||
int y,
|
||||
UINT width,
|
||||
UINT height,
|
||||
UINT minimal = 0,
|
||||
FLTFNPTR ptch_source = get_roll,
|
||||
FLTFNPTR roll_source = get_pitch,
|
||||
float span_units = 45.0,
|
||||
float division_units = 10.0,
|
||||
float minor_division = 0.0,
|
||||
UINT screen_hole = 70,
|
||||
UINT lbl_pos = 0,
|
||||
bool working = true );
|
||||
float factor,
|
||||
FLTFNPTR ptch_source,
|
||||
FLTFNPTR roll_source,
|
||||
float span_units,
|
||||
float division_units,
|
||||
float minor_division,
|
||||
UINT screen_hole,
|
||||
UINT lbl_pos,
|
||||
bool frl,
|
||||
bool target_spot,
|
||||
bool velocity_vector,
|
||||
bool drift_marker,
|
||||
bool alpha_bracket,
|
||||
bool energy_marker,
|
||||
bool climb_dive_marker,
|
||||
bool glide_slope_marker,
|
||||
float glide_slope,
|
||||
bool energy_worm,
|
||||
bool waypoint_marker,
|
||||
bool working);
|
||||
|
||||
~HudLadder();
|
||||
|
||||
|
@ -867,6 +919,7 @@ extern void strokeString( int x,
|
|||
char *msg,
|
||||
void *font = GLUT_STROKE_ROMAN,
|
||||
float theta = 0);
|
||||
|
||||
//extern void strokeString(float xx,
|
||||
// float yy,
|
||||
// char *msg,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,15 +23,20 @@ instr_label ::
|
|||
fgLabelJust justification,
|
||||
int font_size,
|
||||
int blinking,
|
||||
bool working ):
|
||||
bool latitude,
|
||||
bool longitude,
|
||||
bool working):
|
||||
instr_item( x, y, width, height,
|
||||
data_source, scale_data,options, working ),
|
||||
data_source,scale_data,options, working ),
|
||||
pformat ( label_format ),
|
||||
pre_str ( pre_label_string ),
|
||||
post_str ( post_label_string ),
|
||||
justify ( justification ),
|
||||
fontSize ( font_size ),
|
||||
blink ( blinking )
|
||||
blink ( blinking ),
|
||||
lat ( latitude ),
|
||||
lon ( longitude )
|
||||
|
||||
{
|
||||
if( pre_str != NULL) {
|
||||
if( post_str != NULL ) {
|
||||
|
@ -63,7 +68,10 @@ instr_label :: instr_label( const instr_label & image) :
|
|||
pformat ( image.pformat ),
|
||||
pre_str ( image.pre_str ),
|
||||
post_str ( image.post_str ),
|
||||
blink ( image.blink )
|
||||
blink ( image.blink ),
|
||||
lat ( image.lat ),
|
||||
lon ( image.lon )
|
||||
|
||||
{
|
||||
if( pre_str != NULL) {
|
||||
if( post_str != NULL ) {
|
||||
|
@ -91,6 +99,10 @@ instr_label & instr_label ::operator = (const instr_label & rhs )
|
|||
justify = rhs.justify;
|
||||
pre_str = rhs.pre_str;
|
||||
post_str = rhs.post_str;
|
||||
lat = rhs.lat;
|
||||
lon = rhs.lon;
|
||||
|
||||
|
||||
strcpy(format_buffer,rhs.format_buffer);
|
||||
}
|
||||
return *this;
|
||||
|
@ -110,11 +122,17 @@ draw( void ) // Required method in base class
|
|||
RECT scrn_rect = get_location();
|
||||
|
||||
if( data_available() ) {
|
||||
sprintf( label_buffer, format_buffer, get_value() );
|
||||
if(lat)
|
||||
sprintf( label_buffer, format_buffer, coord_format_lat(get_value()) );
|
||||
else
|
||||
if(lon)
|
||||
sprintf( label_buffer, format_buffer, coord_format_lon(get_value()) );
|
||||
else
|
||||
sprintf( label_buffer, format_buffer, get_value() );
|
||||
}
|
||||
else {
|
||||
sprintf( label_buffer, format_buffer );
|
||||
}
|
||||
}
|
||||
|
||||
lenstr = getStringWidth( label_buffer );
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue