Copyright: Flight Simulator 98 SDK, Version 1.0
Citation: Flight Simulator 98 SDK


element_install, element_list_install

The element_install function installs a single drawing element; the element_list_install function installs all elements in the element list.

Syntax

element_install(PELEMENT_HEADER element, HINSTANCE resource_file_handle)

element_list_install(PELEMENT_HEADER element, HINSTANCE resource_file_handle)

The element_install and element_list_install functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

HINSTANCE

resource_file_handle	Specifies the instance handle of the gauge DLL.

Example

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

}

 Related Topics


element_initialize, element_list_initialize

The element_initialize function initializes a single drawing element; the element_list_initialize function initializes all elements in the element list.

Syntax

element_initialize(PELEMENT_HEADER element)

element_list_initialize(PELEMENT_HEADER element)

The element_initialize and element_list_initialize functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

Example

void initialize_routine()

{

element_list_initialize(list);

}

 Related Topics


element_update, element_list_update

The element_update function updates the token variables in a single drawing element; the element_list_update function updates the token variables in all drawing elements in the element list.

Syntax

element_update(PELEMENT_HEADER element)

element_list_update(PELEMENT_HEADER element)

The element_update and element_list_update functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

Example

void update_routine()

{

element_list_update(list);

}

 Related Topics


element_generate, element_list_generate

The element_generate function does the final color mapping of a gauge image to the Flight Simulator 98 palette, plus the thirty-two colors specified in the Panel.cfg file; the element_list_generate does the final color mapping of all gauge images in the element list to the Flight Simulator 98 palette, plus the thirty-two colors specified in the Panel.cfg file.

Syntax

element_generate(PELEMENT_HEADER element, GENERATE_PHASE phase)

element_list_generate(PELEMENT_HEADER element, GENERATE_PHASE phase)

The element_generate and element_list_generate functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

GENERATE_PHASE phase	Not currently defined. Pass from generate_routine to either element_generate or element_list_generate.

Example

void generate_routine(GENERATE_PHASE phase)

{

element_list_generate(list, phase);

}

 Related Topics


element_plot, element_list_plot

The element_plot function draws a single drawing element to the panel window; the element_list_plot function draws all drawing elements in the element list to the panel window.

Syntax

element_plot(PELEMENT_HEADER element)

element_list_plot(PELEMENT_HEADER element)

The element_plot and element_list_plot functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

Example

void draw_routine()

{

element_list_plot(list);

}

 Related Topics


element_kill, element_list_kill

The element_kill function deletes a single drawing element; the element_list_kill function deletes all drawing elements in the element list.

Syntax

element_kill(PELEMENT_HEADER element)

element_list_kill(PELEMENT_HEADER element)

The element_kill and element_list_kill functions have these parameters:

Parameter	Description

PELEMENT_HEADER

element	Pointer to one or more elements to initialize.

Example

void kill_routine()

{

element_list_kill(list);

}

 Related Topics


panel_window_toggle

The panel_window_toggle function toggles the visible state of a panel window.

Syntax

BOOL panel_window_toggle (UINT32 panel_id)

The panel_window_toggle function has these parameters:

Parameter	Description

UINT32 panel_id	Specifies the identification number of the window to toggle. The identification number is specified in the Panel.cfg file in the [WindowXX] section by the variable ident.

Return Values

The panel_window_toggle function has these return values:

Return Value	Description

0	Returns 0 if the window specified by panel_id exists and its visibility state is successfully changed.

Non-zero	Returns a non-zero number if there is an error.

Example

BOOL window_open_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags)

{

return panel_window_toggle(50);

}

 Related Topics


trigger_key_event

The trigger_key_event function directly triggers a key event.

Syntax

ERR trigger_key_event(ID32 event_id, UINT32 value)

The trigger_key_event function has these parameters:

Parameter	Description

ID32 event_id	Specifies the event to trigger. See the topic Event IDs for a complete list of events.

UINT32 value	Specifies the value used by the event. This parameter depends on the event specified in the event_id parameter.

Return Values

The trigger_key_event function has these return values:

Return Value	Description

0	Returns 0 if the event was valid and triggered successfully.

Non-zero	Returns a non-zero number if there is an error.

Example

BOOL throttle_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags)

{

SINT32 new_val;

new_val = background.image_data.final->dim.y  - relative_point->y;

new_val = (UINT32)((FLOAT64)(new_val*16383) /

background.image_data.final->dim.y);

if(new_val > 16383)

new_val = 16383;

if(new_val < 0)

new_val = 0;

trigger_key_event(KEY_THROTTLE_SET, new_val);

return FALSE;

}

 Related Topics


install_routine

The install_routine function is the first function called when a gauge is loaded; install_routine installs the gauge. Required by the Panel API; install_routine is one of the functions that defines the gauge interface.

Syntax

install_routine (HINSTANCE resource_file_handle)

The install_routine syntax has these parameters:

Parameter	Description

HINSTANCE

resource_file_handle	Specifies the instance handle of the gauge DLL.

Example

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

mouse_list_install(mouse_rect, &gauge_header,

&background.image_data.final->dim);

mouse_list_register(mouse_rect, &gauge_header);

}

Remarks

To install the drawing elements, you must call either (Panel API functions) the element_list_install function or the element_install function in the install_routine function. If your gauge uses mouse rectangles, enable mouse rectangles by calling mouse_list_install and mouse_list_register in the install_routine function.

The install_routine function is a good place to allocate memory or initialize data that's specific to the gauge you're building. Some gauges require that you use several token variables; you can use install_routine to initialize these variables.

 Related Topics


initialize_routine

The initialize_routine function is called immediately after the install_routine function. Required by the Panel API; initialize_routine is one of the functions that defines the gauge interface. To initialize the drawing elements, call either (Panel API functions) the element_list_initialize function or element_initialize function.

Syntax

initialize_routine( )

Example

void initialize_routine()

{

element_list_initialize(list);

}

 Related Topics


update_routine

The update_routine function is called to update the gauge's state variables. Required by the Panel API; update_routine is one of the functions that defines the gauge interface. To update the drawing elements, call either (Panel API functions) the element_list_update function or element_update function.

Syntax

update_routine( )

Example

void update_routine ()

{

element_list_update(list);

}

 Related Topics


generate_routine

The generate_routine function is not used in Flight Simulator 98 and is implemented to support future versions of Flight Simulator. Instead, call either (Panel API functions) the element_list_generate function or element_generate function.

Syntax

generate_routine(GENERATE_PHASE phase)

The generate_routine syntax has these parameters:

Parameter	Description

GENERATE_PHASE phase	Not currently defined. Pass from generate_routine to either element_generate or element_list_generate.

Example

void generate_routine (GENERATE_PHASE phase)

{

element_list_generate(list, phase);

}

 Related Topics


draw_routine

The draw_routine function is called to draw the gauge on the panel window. Required by the Panel API; draw_routine is one of the functions that defines the gauge interface. To render the drawing elements, call either (Panel API functions) the element_list_plot function or element_plot function.

Syntax

draw_routine( )

Example

void draw_routine ()

{

element_list_plot(list);

}

 Related Topics


kill_routine

The kill_routine function is called just before the gauge DLL is unloaded. Required by the Panel API; kill_routine is one of the functions that defines the gauge interface. To uninstall the drawing elements, call either (Panel API functions) the element_list_kill function or element_kill function.

Syntax

kill_routine( )

Example

void kill_routine ()

{

mouse_list_unregister(mouse_rect, &gauge_header);

element_list_kill(list);

}

Remarks

This is a safe place to free any memory allocated by your gauge.

 Related Topics


mouse_child_funct

The mouse_child_funct function is a callback function used by the MOUSE_CHILD_FUNCT macro discussed in the topic Defining Mouse Rectangles. You provide this function, and the Panel system calls mouse_child_funct when the specified mouse event occurs.

Syntax

BOOL mouse_child_funct(PPIXPOINT relative_point, FLAGS32 mouse_flags)

The mouse_child_funct function has these parameters:

Parameter	Description

PPIXPOINT relative_point	Specifies the point in the gauge that was clicked.

FLAGS32 mouse_flags	Returns one of the following mouse events:
MOUSE_NONE
MOUSE_RIGHTSINGLE
MOUSE_MIDDLESINGLE
MOUSE_LEFTSINGLE
MOUSE_RIGHTDOUBLE
MOUSE_MIDDLEDOUBLE
MOUSE_LEFTDOUBLE
MOUSE_RIGHTDRAG
MOUSE_MIDDLEDRAG
MOUSE_LEFTDRAG
MOUSE_MOVE
MOUSE_DOWN_REPEAT
MOUSE_KEYBOARD

Return Values

The mouse_child_funct function has this return value:

Return Value	Description

FALSE	The mouse_child_funct always returns FALSE.

Example

MOUSE_FUNCTION mouse_hdg_cb;

BOOL mouse_hdg_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags)

{

if(icon_ap.source_var.var_value.n)	'Autopilot is off.

{

trigger_key_event(KEY_AP_MASTER, 0);

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

}

else if(icon_hdg.source_var.var_value.n)	'Heading hold is off.

{

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

}

else

{

trigger_key_event(KEY_AP_PANEL_HEADING_HOLD, 0);

trigger_key_event(KEY_AP_WING_LEVELER, 0);

}

return FALSE;

}

 Related Topics


mouse_list_install

The mouse_list_install function initializes a mouse rectangle structure.

Syntax

mouse_list_install(PMOUSERECT rect, PGAUGEHDR gauge_header, PPIXPOINT size)

The mouse_list_install function has these parameters:

Parameter	Description

PMOUSERECT rect	Pointer to the mouse rectangle structure to initialize.

PGAUGEHDR gauge_header	Pointer to the gauge header.

PPIXPOINT size	Specifies the size of the gauge that the mouse rectangle structure belongs to.

Example

MOUSE_BEGIN(mouse_rect, HELPID_B737_FLAPS, 0, 0)

MOUSE_CHILD_EVENT(0, 0, 44, 85, CURSOR_DOWNARROR, MOUSE_LEFTSINGLE, KEY_FLAPS_DECR)

MOUSE_CHILD_EVENT( 44, 0, 44, 85, CURSOR_UPARROR, MOUSE_LEFTSINGLE, KEY_FLAPS_INCR)

MOUSE_END

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

mouse_list_install(mouse_rect, &gauge_header,

&background.image_data.final->dim);

mouse_list_register(mouse_rect, &gauge_header);

}

 Related Topics


mouse_list_register

The mouse_list_register function initializes a mouse rectangle structure with the Panel system.

Syntax

mouse_list_register(PMOUSERECT rect, PGAUGEHDR gauge_header)

The mouse_list_register function has these parameters:

Parameter	Description

PMOUSERECT rect	Pointer to the mouse rectangle structure to register.

PGAUGEHDR gauge_header	Pointer to the gauge header.

Example

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

mouse_list_install(mouse_rect, &gauge_header, &background.image_data.final->dim);

mouse_list_register(mouse_rect, &gauge_header);

}

 Related Topics


mouse_list_unregister

The mouse_list_unregister function unregisters a mouse rectangle structure from the Panel system.

Syntax

mouse_list_unregister(PMOUSERECT rect, PGAUGEHDR gauge_header)

The mouse_list_unregister function has these parameters:

Parameter	Description

PMOUSERECT rect	Pointer to the mouse rectangle structure to unregister.

PGAUGEHDR gauge_header	Pointer to the gauge header.

Example

void kill_routine()

{

mouse_list_unregister(mouse_rect, &gauge_header);

element_list_kill( list );

}

 Related Topics


initialize_var

The initialize_var function initializes a token variable. Before a token variable can be used, you must initialize it with initialize_var.

Syntax

initialize_var(PMODULE_VAR module_var)

The initialize_var syntax has these parameters:

Parameter	Description

PMODULE_VAR module_var	Required. Pointer to a token variable to initialize.

Example

MODULE_VAR gs_var = {VOR1_GS_FLAG};

void install_routine(HINSTANCE resource_file_handle)

{

initialize_var(&gs_var);

'Include other initialization code.

}

 Related Topics


lookup_var

The lookup_var function updates the contents of a token variable. Before using the contents of module_var, you must call the lookup_var function.

Syntax

lookup_var(PMODULE_VAR module_var)

The lookup_var syntax has these parameters:

Parameter	Description

PMODULE_VAR module_var	Required. Pointer to a token variable to update.

Example

MODULE_VAR gs_var = {VOR1_GS_FLAG};

void	update_routine()

{

lookup_var(&gs_var);

if(gs_var.var_value.n == 0)

{

HIDE_IMAGE((&gs_slider));

HIDE_IMAGE((&gs_background));

}

else

{

SHOW_IMAGE((&gs_slider));

SHOW_IMAGE((&gs_background));

}

'Include other update code

}

 Related Topics


Event IDs

The following table describes the Event IDs used by the Panel system.

Event ID	Description

KEY_NULL	Not used.

KEY_DEMO_STOP	Stops a Flight Simulator demo.

KEY_REPLAY_STOP	Stops an instant replay.

KEY_SELECT_1	Selects the #1 engine. This is used by other related KEY events.

KEY_SELECT_2	Selects the #2 engine. This is used by other related KEY events.

KEY_SELECT_3	Selects the #3 engine. This is used by other related KEY events.

KEY_SELECT_4	Selects #4 the engine. This is used by other related KEY events.

KEY_DEMO_RECORD_

1_SEC	Sets demo recording speed to fast.

KEY_DEMO_RECORD_

5_SEC	Sets demo recording speed to slow.

KEY_MINUS	Decrements the currently selected key’s value (when appropriate).

KEY_PLUS	Increments the currently selected key’s value (when appropriate).

KEY_ZOOM_1X	Sets Zoom factor to 1-times (normal zoom).

KEY_PANEL_SELECT_1	Not used.

KEY_SOUND_TOGGLE	Toggles sound on and off.

KEY_FULL_WINDOW_

TOGGLE	Sets window to Full screen.

KEY_ENGINE

KEY_SIM_RATE

KEY_XPNDR

KEY_SLEW_TOGGLE

KEY_EGT

KEY_SMOKE_TOGGLE	Toggles smoke on/off.

KEY_STROBES_TOGGLE	Toggles strobe lights on/off.

KEY_PAUSE_TOGGLE	Toggles Pause.

KEY_ATC

KEY_ADF

KEY_VIEW_MODE

KEY_HEADING_GYRO_SET

KEY_DME

KEY_GEAR_TOGGLE

KEY_ANTI_ICE_TOGGLE

KEY_JET_STARTER

KEY_JOYSTICK_CALIBRATE

KEY_ALL_LIGHTS_TOGGLE

KEY_SITUATION_SAVE

KEY_VIEW_WINDOW_TO_

FRONT

KEY_DEMO_RECORD_STOP

KEY_ANALYSIS_

MANEUVER_STOP

KEY_AP_MASTER

KEY_LANDME_TOGGLE

KEY_COM_RADIO

KEY_VOR_OBS

KEY_BAROMETRIC

KEY_NAV_RADIO

KEY_MAGNETO

KEY_DEMO_RECORD_

MESSAGE

KEY_BRAKES

KEY_SPOILERS_TOGGLE

KEY_SITUATION_RESET

KEY_FLAPS_UP

KEY_THROTTLE_FULL

KEY_FLAPS_1

KEY_THROTTLE_INCR

KEY_FLAPS_2

KEY_THROTTLE_INCR_

SMALL

KEY_FLAPS_3

KEY_THROTTLE_DECR

KEY_FLAPS_4

KEY_FLAPS_DOWN

KEY_THROTTLE_CUT

KEY_VIEW

KEY_NUMPAD7

KEY_NUMPAD8

KEY_NUMPAD9

KEY_NUMPAD4

KEY_NUMPAD5

KEY_NUMPAD6

KEY_NUMPAD1

KEY_NUMPAD2

KEY_NUMPAD3

KEY_MOUSE_AS_YOKE_

TOGGLE

KEY_SLEW_ALTIT_UP_

FAST

KEY_SLEW_ALTIT_UP_

SLOW

KEY_SLEW_ALTIT_FREEZE

KEY_SLEW_ALTIT_DN_

SLOW

KEY_SLEW_ALTIT_DN_FAST

KEY_SLEW_ALTIT_PLUS

KEY_SLEW_ALTIT_MINUS

KEY_SLEW_PITCH_DN_

FAST

KEY_SLEW_PITCH_DN_

SLOW

KEY_SLEW_PITCH_FREEZE

KEY_SLEW_PITCH_UP_

SLOW

KEY_SLEW_PITCH_UP_

FAST

KEY_SLEW_PITCH_PLUS

KEY_SLEW_PITCH_MINUS

KEY_MAGNETO_LEFT

KEY_MAGNETO_RIGHT

KEY_COM_RADIO_WHOLE_

DEC

KEY_COM_RADIO_WHOLE_

INC

KEY_COM_RADIO_FRACT_

DEC

KEY_COM_RADIO_FRACT_

INC

KEY_NAV1_RADIO_WHOLE_

DEC

KEY_NAV1_RADIO_WHOLE_

INC

KEY_NAV1_RADIO_FRACT_

DEC

KEY_NAV1_RADIO_FRACT_

INC

KEY_NAV2_RADIO_WHOLE_

DEC

KEY_NAV2_RADIO_WHOLE_

INC

KEY_NAV2_RADIO_FRACT_

DEC

KEY_NAV2_RADIO_FRACT_

INC

KEY_ADF_100_INC

KEY_ADF_10_INC

KEY_ADF_1_INC

KEY_XPNDR_1000_INC

KEY_XPNDR_100_INC

KEY_XPNDR_10_INC

KEY_XPNDR_1_INC

KEY_ZOOM_IN

KEY_ZOOM_OUT

KEY_CLOCK_HOURS_DEC

KEY_CLOCK_HOURS_INC

KEY_CLOCK_MINUTES_DEC

KEY_CLOCK_MINUTES_INC

KEY_CLOCK_SECONDS_

ZERO

KEY_VOR1_OBI_DEC

KEY_VOR1_OBI_INC

KEY_VOR2_OBI_DEC

KEY_VOR2_OBI_INC

KEY_ADF_100_DEC

KEY_ADF_10_DEC

KEY_ADF_1_DEC

KEY_AP_MASTER_ALT

KEY_MAP_ZOOM_FINE_IN

KEY_PAN_LEFT

KEY_PAN_RIGHT

KEY_MAP_ZOOM_FINE_

OUT

KEY_VIEW_FORWARD

KEY_VIEW_FORWARD_

RIGHT

KEY_VIEW_RIGHT

KEY_VIEW_REAR_RIGHT

KEY_VIEW_REAR

KEY_VIEW_REAR_LEFT

KEY_VIEW_LEFT

KEY_VIEW_FORWARD_LEFT

KEY_VIEW_DOWN

KEY_ELEVATOR_DOWN

KEY_ELEVATOR_UP

KEY_AILERON_LEFT

KEY_AILERON_CENTER

KEY_AILERON_RIGHT

KEY_RUDDER_LEFT

KEY_RUDDER_CENTER

KEY_RUDDER_RIGHT

KEY_VIEW1_MODE_SET

KEY_SOUND_SET

KEY_VIEW1_DIRECTION_

SET

KEY_ELEVATOR_SET

KEY_AILERON_SET

KEY_RUDDER_SET

KEY_THROTTLE_SET

KEY_FLAPS_SET

KEY_GEAR_SET

KEY_VIEW1_ZOOM_SET

KEY_AXIS_IND_SET

KEY_VIEW1_WINDOW_SET

KEY_VIEW2_WINDOW_SET

KEY_MAP_WINDOW_SET

KEY_ELEVATOR_TRIM_SET

KEY_COM_RADIO_SET

KEY_NAV1_RADIO_SET

KEY_NAV2_RADIO_SET

KEY_VIEW2_MODE_SET

KEY_VIEW2_DIRECTION_

SET

KEY_VIEW2_ZOOM_SET

KEY_MAP_ZOOM_SET

KEY_ADF_SET

KEY_XPNDR_SET

KEY_VOR1_SET

KEY_VOR2_SET

KEY_ZOOM_MINUS

KEY_ZOOM_PLUS

KEY_BRAKES_RIGHT

KEY_AP_ATT_HOLD

KEY_AP_LOC_HOLD

KEY_AP_APR_HOLD

KEY_AP_HDG_HOLD

KEY_AP_ALT_HOLD

KEY_BRAKES_LEFT

KEY_AP_WING_LEVELER

KEY_AP_BC_HOLD

KEY_AP_NAV1_HOLD

KEY_SLEW_OFF

KEY_SLEW_ON

KEY_EXIT

KEY_ABORT

KEY_PAN_UP

KEY_PAN_DOWN

KEY_READOUTS_SLEW

KEY_READOUTS_FLIGHT

KEY_SLEW_BANK_MINUS

KEY_SLEW_AHEAD_PLUS

KEY_SLEW_BANK_PLUS

KEY_SLEW_BANK_PLUS

KEY_SLEW_LEFT

KEY_SLEW_FREEZE

KEY_SLEW_RIGHT

KEY_SLEW_HEADING_

MINUS

KEY_SLEW_AHEAD_MINUS

KEY_SLEW_HEADING_PLUS

KEY_PANEL_SELECT_2

KEY_PANEL_TOGGLE

KEY_VIEW_MODE_REV

KEY_PANEL_LIGHTS_

TOGGLE

KEY_LANDING_LIGHTS_

TOGGLE

KEY_PARKING_BRAKES

KEY_ZOOM_IN_FINE

KEY_ZOOM_OUT_FINE

KEY_MINUS_SHIFT

KEY_PLUS_SHIFT

KEY_FLAPS_INCR

KEY_FLAPS_DECR

KEY_FLAPS_DETENTS_SET

KEY_AXIS_ELEVATOR_SET

KEY_AXIS_AILERONS_SET

KEY_AXIS_RUDDER_SET

KEY_AXIS_THROTTLE_SET

KEY_AXIS_ELEV_TRIM_SET

KEY_PROP_PITCH_SET

KEY_PROP_PITCH_LO

KEY_PROP_PITCH_INCR

KEY_PROP_PITCH_INCR_

SMALL

KEY_PROP_PITCH_DECR

KEY_PROP_PITCH_HI

KEY_MIXTURE_SET

KEY_MIXTURE_RICH

KEY_MIXTURE_INCR

KEY_MIXTURE_INCR_

SMALL

KEY_MIXTURE_DECR

KEY_MIXTURE_LEAN

KEY_MOUSE_AS_YOKE_

OFF

KEY_MOUSE_AS_YOKE_ON

KEY_MOUSE_AS_YOKE_

SUSPEND

KEY_MOUSE_AS_YOKE_

RESUME

KEY_SPOILERS_SET

KEY_DME1_TOGGLE

KEY_DME2_TOGGLE

KEY_SIM_RATE_INCR

KEY_SIM_RATE_DECR

KEY_AUTOPILOT_OFF

KEY_AUTOPILOT_ON

KEY_YAW_DAMPER_

TOGGLE

KEY_PAUSE_ON

KEY_PAUSE_OFF

KEY_SLEW_RESET

KEY_AP_PANEL_HEADING_

HOLD	Toggles the autopilot heading hold state.

KEY_AP_PANEL_ALTITUDE_

HOLD	Toggles the autopilot altitude hold state.

KEY_CHVPP_LEFT_HAT_UP

KEY_CHVPP_LEFT_HAT_

DOWN

KEY_CHVPP_AP_ALT_WING

KEY_CENTER_NT361_

CHECK

KEY_AP_ATT_HOLD_ON	Turns on the autopilot attitude hold.

KEY_AP_LOC_HOLD_ON

KEY_AP_APR_HOLD_ON

KEY_AP_HDG_HOLD_ON

KEY_AP_ALT_HOLD_ON

KEY_AP_WING_LEVELER_

ON

KEY_AP_BC_HOLD_ON

KEY_AP_NAV1_HOLD_ON

KEY_AP_ATT_HOLD_OFF	Turns off the autopilot attitude hold.

KEY_AP_LOC_HOLD_OFF

KEY_AP_APR_HOLD_OFF

KEY_AP_HDG_HOLD_OFF

KEY_AP_ALT_HOLD_OFF

KEY_AP_WING_LEVELER_

OFF

KEY_AP_BC_HOLD_OFF

KEY_AP_NAV1_HOLD_OFF

KEY_THROTTLE1_SET

KEY_THROTTLE2_SET

KEY_THROTTLE3_SET

KEY_THROTTLE4_SET

KEY_CLOSE_VIEW

KEY_NEW_VIEW

KEY_NEW_MAP

KEY_NEXT_VIEW

KEY_PREV_VIEW

KEY_VIEW_TYPE

KEY_VIEW_TYPE_REV

KEY_VIEW_TYPE_SET

KEY_RADIO_VOR1_IDENT_

DISABLE

KEY_RADIO_VOR2_IDENT_

DISABLE

KEY_RADIO_DME1_IDENT_

DISABLE

KEY_RADIO_DME2_IDENT_

DISABLE

KEY_RADIO_ADF_IDENT_

DISABLE

KEY_RADIO_VOR1_IDENT_

ENABLE

KEY_RADIO_VOR2_IDENT_

ENABLE

KEY_RADIO_DME1_IDENT_

ENABLE

KEY_RADIO_DME2_IDENT_

ENABLE

KEY_RADIO_ADF_IDENT_

ENABLE

KEY_RADIO_VOR1_IDENT_

TOGGLE

KEY_RADIO_VOR2_IDENT_

TOGGLE

KEY_RADIO_DME1_IDENT_

TOGGLE

KEY_RADIO_DME2_IDENT_

TOGGLE

KEY_RADIO_ADF_IDENT_

TOGGLE

KEY_RADIO_VOR1_IDENT_

SET

KEY_RADIO_VOR2_IDENT_

SET

KEY_RADIO_DME1_IDENT_

SET

KEY_RADIO_DME2_IDENT_

SET

KEY_RADIO_ADF_IDENT_

SET

KEY_GEAR_PUMP

KEY_SPOILERS_ARM_

TOGGLE

KEY_PAN_LEFT_UP

KEY_PAN_LEFT_DOWN

KEY_PAN_RIGHT_UP

KEY_PAN_RIGHT_DOWN

KEY_PITOT_HEAT_TOGGLE

KEY_AP_AIRSPEED_HOLD

KEY_AUTO_THROTTLE_

ARM

KEY_AUTO_THROTTLE_

TO_GA

KEY_LANDING_LIGHT_UP

KEY_LANDING_LIGHT_

DOWN

KEY_LANDING_LIGHT_LEFT

KEY_LANDING_LIGHT_

RIGHT

KEY_LANDING_LIGHT_

HOME

KEY_AXIS_SLEW_AHEAD_

SET

KEY_AXIS_SLEW_

SIDEWAYS_SET

KEY_AXIS_SLEW_

HEADING_SET

KEY_AXIS_SLEW_ALT_SET

KEY_AXIS_SLEW_BANK_

SET

KEY_AXIS_SLEW_PITCH_

SET

KEY_PAN_TILT_LEFT

KEY_PAN_TILT_RIGHT

KEY_PAN_RESET

KEY_CHECKLISTS

KEY_GYRO_DRIFT_INC

KEY_GYRO_DRIFT_DEC

KEY_HEADING_BUG_INC

KEY_HEADING_BUG_DEC

KEY_ADF_CARD_INC

KEY_ADF_CARD_DEC

KEY_KOHLSMAN_INC

KEY_KOHLSMAN_DEC

KEY_TRUE_AIRSPEED_

CALIBRATE_INC

KEY_TRUE_AIRSPEED_

CALIBRATE_DEC

KEY_CROSS_FEED_OFF

KEY_CROSS_FEED_LEFT_

TO_RIGHT

KEY_CROSS_FEED_RIGHT_

TO_LEFT

KEY_AP_PANEL_VS_HOLD

KEY_AP_PANEL_SPEED_

HOLD

KEY_AP_ALT_VAR_INC

KEY_AP_ALT_VAR_DEC

KEY_AP_VS_VAR_INC

KEY_AP_VS_VAR_DEC

KEY_AP_SPD_VAR_INC

KEY_AP_SPD_VAR_DEC

KEY_AP_N1_REF_INC

KEY_AP_N1_REF_DEC

KEY_MULTIPLAYER_

TRACK_TOGGLE

KEY_MULTIPLAYER_

PLAYER_TOGGLE

KEY_MULTIPLAYER_

PLAYER_SNAP

KEY_MULTIPLAYER_GO_

OBSERVER

KEY_MULTIPLAYER_CHAT

KEY_MULTIPLAYER_

ACTIVATE_CHAT

KEY_PANEL_1

KEY_PANEL_2

KEY_PANEL_3

KEY_PANEL_4

KEY_PANEL_5

KEY_PANEL_6

KEY_PANEL_7

KEY_PANEL_8

KEY_PANEL_9

KEY_AP_PANEL_MACH_

HOLD

KEY_AP_MACH_VAR_INC	Increments autopilot mach hold speed.

KEY_AP_MACH_VAR_DEC	Decrements autopilot mach hold speed.

KEY_AP_MACH_HOLD	Toggles autopilot mach hold.

 Related Topics


Using Drawing Elements

The following drawing elements are available in Flight Simulator 98:

•	ELEMENT_STATIC_IMAGE

•	ELEMENT_NEEDLE

•	ELEMENT_STRING

•	ELEMENT_SLIDER

•	ELEMENT_ICON

•	ELEMENT_MOVING_IMAGE

•	ELEMENT_SPRITE

The drawing elements used in Flight Simulator 98 have several things in common. For instance, the drawing elements are defined by C data structures.

The shared data elements aren't included in the declaration of each structure. Instead, a #define HEADER is present that, when expanded, produces the twelve data members. The following code examples show the drawing element ELEMENT_NEEDLE before and after expansion.

Before expansion:

typedef struct ELEMENT_NEEDLE

{

HEADER;

'Needle-specific data members

};

After expansion:

typedef struct ELEMENT_NEEDLE

{

ELEMENT_TYPE_ENUM 	element_type;

ID	resource_id;

PIXPOINT	position;

PIXPOINT	previous_position;

PIXPOINT	ofs;

PGAUGEHDR	gauge_header;

struct ELEMENT_HEADER	previous_element;

struct ELEMENT_HEADER	next_element;

PFAILURE_RECORD	failure_systems;

FLAGS	image_flags;

FLAGS	aircraft_special_instrumentation;

FLAGS	                   reserved;

'Needle-specific data members.

};

The first twelve data members are the same for all the drawing element structures. The data members are described in the following table.

Member	Description

element_type	Specifies the element type. Set this member to be one of the following elements:
ELEMENT_TYPE_STATIC_IMAGE
ELEMENT_TYPE_NEEDLE
ELEMENT_TYPE_STRING
ELEMENT_TYPE_SLIDER
ELEMENT_TYPE_ICON
ELEMENT_TYPE_MOVING_IMAGE
ELEMENT_TYPE_SPRITE

resource_id	Specifies the resource ID of an 8-bit or 24-bit bitmap resource. All element types, with the exception of ELEMENT_STRING (which ignores this value), use this value.

position	For ELEMENT_NEEDLE and ELEMENT_SPRITE, specifies the point that the drawing element pivots around.

previous_position	Specifies the previous position of the element relative to the gauge position. Used by the Panel system. This value is ignored during initialization.

ofs	Specifies an offset (pivot point) for an element to rotate around. This value is used by ELEMENT_NEEDLE and ELEMENT_SPRITE and ignored by the other elements.

gauge_header	Pointer to the gauge header file.

previous_element	Pointer to the previous element. This value is set by the Panel system. This value is ignored during initialization.

next_element	Pointer to a list of graphical elements. The elements are drawn after the current element. This value is used to determine the drawing order of all the elements in your gauge.

failure_systems	Pointer to a FAILURE_RECORD list. This list defines how an element will react during simulated aircraft system failure. For more information, see the topic Simulating System Failures.

image_flags	Specifies how the element image will be rendered. This member can be a combination of the following values:
IMAGE_USE_TRANSPARENCY
Renders the image using transparency. If this flag is set, palette index 0 is treated as transparent in an 8-bit bitmap, and RGB color (0,0,0) is treated as transparent in a 24-bit bitmap. Because non-transparent rendering is faster than transparent rendering, you can use this flag to enhance performance.
IMAGE_USE_ERASE
Before the graphical element is rendered, a "snapshot" of the background is saved. As a result, the Panel system can erase the element as needed by plotting the contents of the save buffer to the screen. You can use this flag to increase performance and save memory if an element never needs to be erased. Static images use this flag extensively.
IMAGE_USE_BRIGHT
Maps the element’s image colors to the section of the Flight Simulator 98 palette that doesn't change during the transition from day to night. The image colors will not change. For more information, see the topic Color Mapping Table.
IMAGE_NO_STATIC_BLENDING
This flag is only valid on static images using IMAGE_USE_TRANSPARENCY and the first element in the list.
IMAGE_HIDDEN
You can set this flag dynamically to hide or show the element.

aircraft_special_

instrumentation	Specifies how the element will react in a special instrument situation. Currently this is used only with autopilot.
ASI_ALT_MANUALLY_TUNABLE
Sets a global flag that causes Flight Simulator 98 to recognize that autopilot altitude hold is manually tunable. If this flag isn't set, turning on altitude hold holds the current altitude instead of the currently set altitude.
ASI_HEADING_MANUALLY_TUNABLE
Sets a global flag that causes Flight Simulator 98 to recognize that autopilot heading hold is manually tunable. If this flag isn't set, turning on heading hold would hold the current heading instead of the currently set heading.

reserved	This value is reserved and must be set to 0.

Drawing Element Structures

Each drawing element structure has one or more MODULE_VAR members. You can initialize these members to one of the values listed in the topic Token Variables. Call the function element_install or element_list_install to initialize the MODULE_VAR element(s).

The element_update or element_list_update function can be used to update the contents of the MODULE_VAR. The elements themselves use the MODULE_VAR information at render time to determine in what state they'll be rendered.

Graphical elements can use the MODULE_VAR structure member to determine the state that the element will be rendered in. Sometimes, however, MODULE_VAR may not be a useful value. The way around this problem is to use callbacks. For each of the MODULE_VAR structures listed in the element structure, you can set an associated PMODULE_VAR_CB pointer. The pointer points to a callback function that you can use to set the variable to a useful value. The callback function is called by the Panel system after the variable has been updated from the simulation state information. The callback function is usually used to normalize or scale the MODULE_VAR value into a range that can be used. You can also use the callback function to convert enumerated values, interpret a flag's variable, and so on.

For example, the following code uses a callback routine to clip the airspeed to a useful range that can be used by the airspeed gauge:

FLOAT64 convert_var_aspeed(PMODULE_VAR var)

{

if (var->var_value.n > GAUGE_MAX_AIRSPEED)

var->var_value.n = GAUGE_MAX_AIRSPEED;

if (var->var_value.n < 60)

var->var_value.n = 60;

return var->var_value.n;

}

You can set any callback pointer to NULL, and no call will occur.

NOTE: Any assignments to the MODULE_VAR in a callback routine are discarded. The final value set in the MODULE_VAR is the return value of the callback function.

Drawing Element Lists

In code, the drawing elements are organized in a tree structure using the previous_element and next_element variables in the element structures. This element list is used to define the drawing order of the gauge elements. The first element in the list in the gauge header is drawn first. Each subsequent element in the list is drawn in the order it appears in the list. Before drawing the next element in the list, the current element’s element list pointer is examined. If the pointer is not NULL, the element’s element list is drawn using the same logic.

You don't need to set the previous_element pointer. The previous_element pointers are initialized by the Panel system when the gauge is initialized.

The following Panel API functions also use the element list structure to perform an operation on all elements in the gauge:

void element_list_query(PELEMENT_HEADER element);

void element_list_install(PELEMENT_HEADER element, HINSTANCE resource_file_handle);

void element_list_initialize(PELEMENT_HEADER element);

void element_list_update(PELEMENT_HEADER element);

void element_list_generate(PELEMENT_HEADER element, GENERATE_PHASE phase);

void element_list_plot(PELEMENT_HEADER element);

void element_list_erase(PELEMENT_HEADER element);

void element_list_kill(PELEMENT_HEADER element);

 Related Topics


ELEMENT_STATIC_IMAGE

ELEMENT_STATIC_IMAGE draws the simplest type of graphical element. Use ELEMENT_STATIC_IMAGE to draw an image that never changes.

typedef struct ELEMENT_STATIC_IMAGE

{

HEADER;

IMAGE_SET	image_data;

PIMAGE	save_buffer;

} ELEMENT_STATIC_IMAGE, *PELEMENT_STATIC_IMAGE, **PPELEMENT_STATIC_IMAGE;

ELEMENT_STATIC_IMAGE uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

image_set	Used internally by the Panel system. Do not set or use.

pimage	Used internally by the Panel system. Do not set or use.

 Related Topics


ELEMENT_NEEDLE

Use ELEMENT_NEEDLE to draw an image that pivots around a specific point in another image. ELEMENT_NEEDLE supports transparency and nonlinear gauges. For ELEMENT_NEEDLE, POS (position) is the center of rotation in the background image; OFS (offset) is the center of rotation in the needle image.

typedef struct ELEMENT_NEEDLE

{

HEADER;

MODULE_VAR	source_var;

PMODULE_VAR_CB	source_var_cb;

PFN_FLOAT64	display_value_fn;

PFN_FLOAT64	angle_fn;

PFN_FLOAT64	lag_fn;

PIXPOINT	reference;

PNONLINEARITY	nonlinearity_table;

UINT32	nonlinearity_table_size;

SINT32	max_degrees_per_tick;

FLOAT64	readout_goal;

FLOAT64	theta_goal;

FLOAT64	theta;

PIXPOINT	reference_old;

PIXPOINT	o0, o1, o2, o3;

IMAGE_SET	needle_data;

PIMAGE	texture_data;

UINT32	texture_handle;

PIMAGE	save_buffer;

PIXPOINT	save_position;

} ELEMENT_NEEDLE, *PELEMENT_NEEDLE, **PPELEMENT_NEEDLE;

ELEMENT_NEEDLE uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var	Use as MODULE_VAR to access simulation state values.

source_var_cb	Use as a callback function for source_var.

display_value_fn	Do not use.

angle_fn	Do not use.

lag_fn	Do not use.

reference	Use as a reference point to determine if the needle needs to be rotated. This point is rotated the number of degrees the needle should be rotated. If, after rotation, the point’s X and Y values haven't changed since the previous frame, the needle will not be redrawn. The closer this point is to the pivot point, the less likely the point will change with a small angle of rotation. If the point is too far away, the more likely the point is going to change with a small rotation. Generally, a point near the tip of the needle is a good reference point.

nonlinearity_table	Points to an array of NONLINEARITY structures.

nonlinearity_table_size	Number of entries in nonlinearity_table array.

max_degrees_per_tick	Maximum angle, in degrees, the needle can rotate in one timer tick. Use this to make your needle movement smoother. If the value is 0, it's ignored.

readout_goal	Used internally by the Panel system; do not use. Must be set to 0.

theta_goal	Used internally by the Panel system; do not use. Must be set to 0.

theta	Used internally by the Panel system; do not use. Must be set to 0.

reference_old	Used internally by the Panel system; do not use. Must be set to 0.

o0, o1, o2, o3	Used internally by the Panel system; do not use. Must be set to 0.

needle_data	Used internally by the Panel system; do not use. Must be set to 0.

texture_data	Used internally by the Panel system; do not use. Must be set to 0.

texture_handle	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

save_position	Used internally by the Panel system; do not use. Must be set to 0.

Remarks

In some cases, you might want your needle to move in a nonlinear manner. For example, an airspeed gauge sometimes shows a greater angle between 0 and 50 knots than the angle between 100 and 150 knots. You can accomplish this by using a nonlinearity table.

A nonlinearity table is defined as an array of NONLINEARITY structures. Each element in the array represents a discrete point on your gauge where the value is known. For example, your gauge might show airspeed as values from 0 to 160 knots, with tick marks every 20 knots. You could create an entry for each tick, filling in the pt and value member variables of the NONLINEARITY structure.

A NONLINEARITY structure uses the following members:

Member	Description

pt	Specifies X, Y point in the background bitmap.

value	Readout of the gauge at that point.

degrees	Used internally by the Panel system: do not use. Must be set to 0.

At runtime, the value of the needle is examined and the angle to be drawn is interpolated from the nonlinearity table.

Values are listed as they appear clockwise around the face of the gauge. If gauge values increase when rotating clockwise, values in the nonlinearity table will start at the minimum and increase. If gauge values decrease when rotating clockwise, then values in the table will start with the maximum and decrease.

The following code example shows the nonlinearity table structure definition:

typedef struct NONLINEARITY

{

PIXPOINT	pt;

FLOAT64	value;

FLOAT64	degrees;

} NONLINEARITY, *PNONLINEARITY, **PPNONLINEARITY;

 Related Topics


ELEMENT_STRING

Use ELEMENT_STRING to display text on a gauge. ELEMENT_STRING is particularly useful when you have a string that changes as the gauge is updated; the string can be automatically updated by setting up the MODULE_VAR elements and using callback functions. Using ELEMENT_STRING, you can specify the font name, weight, background and foreground colors of the text. You can also specify a highlight text color to use when the string is selected.

typedef struct ELEMENT_STRING

{

HEADER;

MODULE_VAR	source_var[3];

FLOAT64	save_var[3];

PMODULE_VAR_CB 	source_var_cb[3];

PFN_FLOAT64	source_fn;

PCHAR	string;

PCHAR	string_old;

PIXPOINT	img_size;

PIMAGE	string_data;

PIMAGE	save_buffer;

COLORREF	fg_color;

COLORREF	bg_color;

COLORREF	hilite_color;

HDC	hdc;

HFONT	hfont;

HFONT	hfont_old;

HBITMAP	hbmp;

HBITMAP	hbmp_old;

HBRUSH	hbrush;

HBRUSH	hbrush_old;

char	font_name[32];

long	font_weight;

UINT8	font_charset;

UINT32	draw_text_flags;

UINT16	max_string_length;

UINT16	char_width;

SINT16	sel_str;

SINT16	sel_end;

PSEQ_REC	seq;

int	save_global_seq;

} ELEMENT_STRING, *PELEMENT_STRING, **PPELEMENT_STRING;

ELEMENT_STRING uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var[3]	Token values to update the string. You must provide at least one callback function to update the string data member.

save_var[3]	Used internally by the Panel system; do not use. Must be set to 0.

source_var_cb[3]	Callback function used to update the display string. The callback function updates the string member variable. The string member variable is the character string data that's used to render this drawing element.

string	Character string data to render the drawing element. Update this string to change the text displayed.

string_old	Used internally by the Panel system: do not use. Must be set to 0.

img_size	Width and height of the bounding rectangle area updated by the string. The font size used by ELEMENT_STRING is calculated using img_size and max_string_length. The optimal font size is also calculated using this information.

string_data	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

fg_color	RGB text color.

bg_color	RGB background color.

hilite_color	RGB highlight color.

hdc	Used internally by the Panel system; do not use. Must be set to 0.

hfont	Used internally by the Panel system; do not use. Must be set to 0.

hfont_old	Used internally by the Panel system; do not use. Must be set to 0.

hbmp	Used internally by the Panel system; do not use. Must be set to 0.

hbmp_old	Used internally by the Panel system; do not use. Must be set to 0.

hbrush	Used internally by the Panel system; do not use. Must be set to 0.

hbrush_old	Used internally by the Panel system; do not use. Must be set to 0.

font_name[32]	Name of the font used to render the string.

font_weight	Font weight used to create the Windows font used by the ELEMENT_STRING. A list of valid values can be found in the CreateFont Win32 API.

font_charset	Character set used to create the Windows font used by the ELEMENT_STRING. A list of valid values can be found in the CreateFont Win32 API.

draw_text_flags	Not supported at this time. Must be set to 0.

max_string_length	Number of characters to use in the string. The font size used by the ELEMENT_STRING is calculated using img_size and max_string_length members of this structure. The optimal font size is calculated using this information.

char_width	Used internally by the Panel system; do not use. Must be set to 0.

sel_str	First character to select. Set both sel_str and sel_end to -1 to deselect a string.

sel_end	Last character to select. Set both sel_str and sel_end to -1 to deselect a string.

seq	Pointer to a SEQ_REC array structure. Can be NULL or a pointer to an array of SELECT states used to manage the highlighting of the string.

save_global_seq	Used internally by the Panel system; do not use. Must be set to 0.

You can use the SEQ_REC table to automatically select a string on certain KEY_EVENTs. Flight Simulator 98 allows the user to select certain gauge elements by using different keyboard combinations. The SEQ_REC structure sets up the relationship between the current selection state and the characters that can be selected for that state. The following code example shows the SEQ_REC structure definition:

typedef struct SEQ_REC

{

int seq_id;

int sel_str;

int sel_end;

} SEQ_REC, *PSEQ_REC, **PPSEQ_REC;

SEQ_REQ uses the following members:

Member	Description

seq_id	Specifies the selection state.

sel_str	Specifies the first character to select when the Flight Simulator 98 selection state is equal to the seq_id state.

sel_end	Specifies the last character to select.

To mark the end of the array you must add one blank record that sets seq_id, sel_str, and sel_end to SELECT_NONE, 0, and 0, respectively. The following code example shows a sample SEQ_REC definition:

SEQ_REC seq_com[]  =

{

{SELECT_COM_WHOLE, 0, 2},

{SELECT_COM_FRACTION, 4, 5},

{SELECT_NONE, 0, 0}

};

The following table includes the gauge selection states available in Flight Simulator 98.

SEQ Record ID	Description

SELECT_NONE	No selection

SELECT_1	Unused

SELECT_ZOOM	Zoom

SELECT_MAGNETO	Magneto

SELECT_COM_WHOLE	Communication frequency, whole number

SELECT_COM_FRACTION	Communication frequency, fractional number

SELECT_NAV1_WHOLE	Navigation radio frequency #1, whole number

SELECT_NAV1_FRACTION	Navigation radio frequency #1, fractional number

SELECT_NAV2_WHOLE	Navigation radio frequency #2, whole number

SELECT_NAV2_FRACTION	Navigation radio frequency #2, fractional number

SELECT_XPNDR_1000	Transponder frequency fourth digit

SELECT_XPNDR_0100	Transponder frequency third digit

SELECT_XPNDR_0010	Transponder frequency second digit

SELECT_XPNDR_0001	Transponder frequency first digit

SELECT_VOR1	Toggle to VOR1 selection

SELECT_VOR2	Toggle to VOR2 selection

SELECT_ENGINE	Toggle engine selection

SELECT_DME1	Toggle to DME1 selection

SELECT_DME2	Toggle to DME2 selection

SELECT_ADF_100	ADF frequency third digit

SELECT_ADF_010	ADF frequency second digit

SELECT_ADF_001	ADF frequency first digit

SELECT_EGT_BUG	EGT bug

SELECT_SIM_RATE	Simulation rate

SELECT_CLOCK_HOURS	Clock hours

SELECT_CLOCK_MINUTES	Clock minutes

SELECT_CLOCK_SECONDS	Clock seconds

SELECT_STANDBY_

COM_WHOLE	Standby communication frequency, whole number. No standby frequencies are implemented.

SELECT_STANDBY_

COM_FRACTION	Standby communication frequency, fractional number. No standby frequencies are implemented.

SELECT_STANDBY_

NAV_WHOLE	Standby navigation radio frequency, whole number. No standby frequencies are implemented.

SELECT_STANDBY_NAV_

FRACTION	Standby navigation radio frequency, fractional number. No standby frequencies are implemented.

SELECT_STANDBY_

ADF_100	Standby ADF frequency, third digit. No standby frequencies are implemented.

SELECT_STANDBY_

ADF_010	Standby ADF frequency, second digit. No standby frequencies are implemented.

SELECT_STANDBY_

ADF_001	Standby ADF frequency, first digit. No standby frequencies are implemented.

 Related Topics


ELEMENT_SLIDER

Use ELEMENT_SLIDER to move a drawing element around a gauge with two degrees of freedom. You can see a good example of this type of movement in the mini-controls panel window in Flight Simulator 98. The red dot moves around the window, representing the elevator and aileron control positions. The moving red dot is drawn using ELEMENT_SLIDER.

You can use ELEMENT_SLIDER to move an image in only one direction, as well. Just set the MODULE_VAR, for either X or Y, to MODULE_VAR_NONE.

typedef struct ELEMENT_SLIDER

{

HEADER;

MODULE_VAR	source_var_x;

PMODULE_VAR_CB	source_var_x_cb;

FLOAT64	scale_x;

PFN_FLOAT64	lag_fn_x;

MODULE_VAR	source_var_y;

PMODULE_VAR_CB	source_var_y_cb;

FLOAT64	scale_y;

PFN_FLOAT64	lag_fn_y;

IMAGE_SET	slider_data;

PIMAGE	save_buffer;

} ELEMENT_SLIDER, *PELEMENT_SLIDER, **PPELEMENT_SLIDER;

ELEMENT_SLIDER uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var_x	Token value used to calculate the slider's movement along the X axis.

source_var_x_cb	Callback function used for source_var_x.

scale_x	Used to scale the MODULE_VAR value in the X direction.

lag_fn_x	Do not use.

source_var_y	Token value used to calculate the slider’s movement along the Y axis.

source_var_y_cb	Callback function used for source_var_y.

scale_y	Used to scale the MODULE_VAR value in the Y direction.

lag_fn_y	Do not use.

slider_data	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

 Related Topics


ELEMENT_MOVING_IMAGE

ELEMENT_MOVING_IMAGE, like ELEMENT_SLIDER, is used to move an image around on a gauge with two degrees of freedom. The difference is that ELEMENT_MOVING_IMAGE includes a mask, which does not move, and is used to hide parts of the image. In Flight Simulator 98, the whiskey compasses are drawn using ELEMENT_MOVING_IMAGE.

typedef struct ELEMENT_MOVING_IMAGE

{

HEADER;

MODULE_VAR	source_var_x;

PMODULE_VAR_CB	source_var_x_cb;

FLOAT64	min_x;

FLOAT64	max_x;

PFN_FLOAT64	lag_x;

MODULE_VAR	source_var_y;

PMODULE_VAR_CB	source_var_y_cb;

FLOAT64	min_y;

FLOAT64	max_y;

PFN_FLOAT64	lag_y;

FLOAT64	scale_x;

FLOAT64	scale_y;

FLOAT64	offset_x;

FLOAT64	offset_y;

PIXPOINT	save_position;

IMAGE_SET	image_data;

IMAGE_SET	local_mask_data;

PIMAGE	mask_data;

PIMAGE	save_buffer;

} ELEMENT_MOVING_IMAGE, *PELEMENT_MOVING_IMAGE, **PPELEMENT_MOVING_IMAGE;

ELEMENT_MOVING_IMAGE uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var_x	Token value used to calculate the slider's movement along the X axis.

source_var_x_cb	Callback function use for source_var_x.

min_x	Minimum value of source_var_x.

max_x	Maximum value of source_var_x.

lag_x	Do not use.

source_var_y	Token value used to calculate the slider’s movement along the Y axis.

source_var_y_cb	Callback function used for source_var_y.

min_y	Minimum value of source_var_y.

max_y	Maximum value of source_var_y.

lag_y	Do not use.

scale_x	Used internally by the Panel system; do not use. Must be set to 0.

scale_y	Used internally by the Panel system; do not use. Must be set to 0.

offset_x	Used internally by the Panel system; do not use. Must be set to 0.

offset_y	Used internally by the Panel system; do not use. Must be set to 0.

save_position	Used internally by the Panel system; do not use. Must be set to 0.

image_data	Used internally by the Panel system; do not use. Must be set to 0.

local_mask_data	Used internally by the Panel system; do not use. Must be set to 0.

mask_data	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

When the gauge is loading, the resource_id member specifies the image to use as the moving image. The resource_id + 3 specifies the mask image.

The mask is placed on the gauge using the position member. The moving image moves in reference to where the mask is placed. The image is moved in X and Y directions based on the source_var_x and source_var_y values. Looking at source_var_x, the image is placed so the image’s and mask’s left sides are aligned when source_var_x is equal to min_x. Similarly, the image’s and mask’s right sides are aligned when source_var_x is equal to max_x. Looking at source_var_y, the image is placed so the image’s and mask’s top sides are aligned when source_var_y is equal to min_y. Similarly, the image’s and mask’s bottom sides are aligned when source_var_y is equal to max_y.

 Related Topics


ELEMENT_ICON

Use ELEMENT_ICON to toggle between one of several images at a static location on a gauge. The resource_id member of the structure specifies the first icon image. The Panel system loads the first icon image using the resource_id. The Panel system loads the next icon image by adding three to the resource_id. It then adds three more to the resource_id and loads the next image, and so on. The Panel system continues this process as many times as num_icons specifies.

Icon images can be any size, although all images in the same ELEMENT_ICON have the same upper left location.

Tip: If you specify IMAGE_USE_ERASE in the image flags for ELEMENT_ICON, the save buffer will only be as large as the first image.

If source_var.n is set to -1, the icon image is automatically hidden.

typedef struct ELEMENT_ICON

{

HEADER;

MODULE_VAR	source_var;

PMODULE_VAR_CB	source_var_cb;

long	switch_type;

long	switch_count;

FLOAT64	scale;

long	offset;

long	num_icons;

long	cur_icon;

long	dst_icon;

PIMAGE_SET	picon_data;

PIMAGE	save_buffer;

} ELEMENT_ICON, *PELEMENT_ICON, **PPELEMENT_ICON;

ELEMENT_ICON uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var	Token value used to determine the currently rendered icon.

source_var_cb	Callback function used for source_var.

switch_type	Used to determine how source_var is interpreted to select the current icon.  It can be set to one of the following values:
ICON_SWITCH_TYPE_SET_CUR_ICON
The value is interpreted as an index to the current icon, where 0 is the first icon and the number of icons minus one is the last icon.
ICON_SWITCH_TYPE_SET_CUR_USING_RANGE
The value is subtracted from offset and divided by scale to get the current index. You can specify a range that is linearly interpolated into the valid range of icon index.
ICON_SWITCH_TYPE_STEP_TO
This is the same as ICON_SWITCH_TYPE_SET_CUR_ICON except that it will step through (animate) each icon.
ICON_SWITCH_TYPE_STEP_TO_USING_RANGE
This is the same as ICON_SWITCH_TYPE_SET_CUR_USING_RANGE except that it will step through (animate) each icon.

switch_count	Used internally by the Panel system; do not use. Must be set to 0.

scale	Specifies the range of values for source_var. This value is only used if switch_type is ICON_SWITCH_TYPE_SET_CUR_USING_RANGE or ICON_SWITCH_TYPE_STEP_TO_USING_RANGE.

offset	Specifies the minimum value for source_var. The maximum values is calculated as: max_value = offset + scale. This value is only used if switch type is ICON_SWITCH_TYPE_SET_CUR_USING_RANGE or ICON_SWITCH_TYPE_STEP_TO_USING_RANGE.

num_icons	Specifies the number of icons loaded.

cur_icon	Used internally by the Panel system; do not use. Must be set to 0.

dst_icon	Used internally by the Panel system; do not use. Must be set to 0.

picon_data	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

 Related Topics


ELEMENT_SPRITE

ELEMENT_SPRITE, like ELEMENT_MOVING_IMAGE, moves an element in X and Y directions and uses a mask to hide parts of the element. The difference is that ELEMENT_SPRITE can rotate an element around a pivot point. For ELEMENT_SPRITE, POS (position) is interpreted normally (as the upper-left corner position); OFS (offset) is the center of the sprite—the center of the texture maps to this point.

Textures used for ELEMENT_SPRITE must be 256 x 256. When the gauge is loaded, the resource_id specifies the image to use for the texture. The resource_id + 3 specifies the mask image. The mask doesn't have to be a specific size. The mask is placed on the gauge using the position member. The texture slides and rotates underneath the mask.

Element transformations occur in the following order:

1	Rotate, based on source_var_0

2	Scale, based on texture_scale_x and texture_scale_y

3	Transpose, based on source_var_x and source_var_y

typedef struct ELEMENT_SPRITE

{

HEADER;

MODULE_VAR	source_var_x;

PMODULE_VAR_CB	source_var_x_cb;

FLOAT64	scale_x;

MODULE_VAR	source_var_y;

PMODULE_VAR_CB	source_var_y_cb;

FLOAT64	scale_y;

MODULE_VAR	source_var_0;

PMODULE_VAR_CB	source_var_0_cb;

FLOAT64	scale_0;

float	texture_scale_x;

float	texture_scale_y;

PIXPOINT	reference;

PIXPOINT	reference_old;

PIXPOINT	o0, o1, o2, o3;

PIXPOINT	os0, os1, os2, os3;

IMAGE_SET	sprite_data;

PIMAGE	texture_data;

UINT32	texture_handle;

IMAGE_SET	local_mask_data;

PIMAGE	mask_data;

PIMAGE	save_buffer;

} ELEMENT_SPRITE, *PELEMENT_SPRITE, **PPELEMENT_SPRITE;

ELEMENT_SPRITE uses the following members:

Member	Description

HEADER	Discussed in detail in the topic Using Drawing Elements.

source_var_x	Token value used to calculate movement in the X direction.

source_var_x_cb	Callback function used to modify the source_var_x member.

scale_x	Scales the source_var_x value after its callback function is called. The source_var_x member is set to (source_var_x * scale_x). This value has no effect if equal to 1.

source_var_y	Token value used to calculate the movement in the Y direction.

source_var_y_cb	Callback function used to modify source_var_y.

scale_y	Scales the source_var_y value after its callback function is called. The source_var_y member is set to (source_var_y * scale_y). This value has no effect if equal to 1.

source_var_0	Token value used to calculate the rotation around the pivot point.

source_var_0_cb	Callback function used to modify source_var_0.

scale_0	Scales the source_var_0 value after its callback function is called. The source_var_0 member is set to (source_var_0 * scale_0). This value has no effect if equal to 1.

texture_scale_x	Specifies how the texture image width is scaled when rendered.

texture_scale_y	Specifies how the texture image height is scaled when rendered.

reference	Point used to determine if the SPRITE_ELEMENT has changed enough to be re-rendered. This point is rotated with the drawing element. After rotation, if the X, Y values have not changed since the previous frame, the element is not redrawn. The closer this point is to the pivot point, the less likely it is the point will change with a small angle of rotation. The farther away this point is from the pivot point, the more likely it is that the point will change with a small angle of rotation. Generally, a point near the edge of the mask is a good reference point.

reference_old	Used internally by the Panel system; do not use. Must be set to 0.

o0, o1, o2, o3	Used internally by the Panel system; do not use. Must be set to 0.

os0, os1, os2, os3	Used internally by the Panel system; do not use. Must be set to 0.

sprite_data	Used internally by the Panel system; do not use. Must be set to 0.

texture_data	Used internally by the Panel system; do not use. Must be set to 0.

texture_handle	Used internally by the Panel system; do not use. Must be set to 0.

local_mask_data	Used internally by the Panel system; do not use. Must be set to 0.

mask_data	Used internally by the Panel system; do not use. Must be set to 0.

save_buffer	Used internally by the Panel system; do not use. Must be set to 0.

 Related Topics


Simulating System Failures

Flight Simulator 98 simulates several types of aircraft system failures. System failures are listed in the FAILURE_KEY enum values; for details, see the table included in this topic. The following code is a sample element failure record.

FAILURE_RECORD fail_vertical_speed[] =

{

{FAIL_GAUGE_VERTICAL_SPEED, FAIL_ACTION_FREEZE},

{FAIL_SYSTEM_PITOT_STATIC, FAIL_ACTION_ZERO},

{FAIL_NONE, FAIL_ACTION_NONE}

};

typedef enum FAILURE_KEY

{

FAIL_NONE = 0,

FAIL_SYSTEM_ELECTRICAL,

FAIL_SYSTEM_ENGINE,

FAIL_SYSTEM_PITOT_STATIC,

FAIL_SYSTEM_VACUUM,

FAIL_GAUGE_ADF,

FAIL_GAUGE_AIRSPEED,

FAIL_GAUGE_ALTIMETER,

FAIL_GAUGE_ATTITUDE,

FAIL_GAUGE_COMMUNICATIONS,

FAIL_GAUGE_FUEL_INDICATORS,

FAIL_GAUGE_GYRO_HEADING,

FAIL_GAUGE_MAGNETIC_COMPASS,

FAIL_GAUGE_NAVIGATION,

FAIL_GAUGE_NAVIGATION_VOR1,

FAIL_GAUGE_NAVIGATION_VOR2,

FAIL_GAUGE_NAVIGATION_BOTH,

FAIL_GAUGE_TRANSPONDER,

FAIL_GAUGE_TURN_COORDINATOR,

FAIL_GAUGE_VERTICAL_SPEED,

FAIL_KEY_MAX

} FAILURE_KEY, *PFAILURE_KEY, **PPFAILURE_KEY;

The FAILURE_KEY enum values for Flight Simulator 98 are described in the following table:

Enum values	Description

FAIL_NONE	Used to mark the end of a failure record.

FAIL_SYSTEM_ELECTRICAL	Specifies an electrical system failure.

FAIL_SYSTEM_ENGINE	Specifies an engine system failure.

FAIL_SYSTEM_PITOT_

STATIC	Specifies a pitot static system failure.

FAIL_SYSTEM_VACUUM	Specifies a vacuum system failure.

FAIL_GAUGE_ADF	Specifies an ADF gauge system failure.

FAIL_GAUGE_AIRSPEED	Specifies an airspeed gauge system failure.

FAIL_GAUGE_ALTIMETER	Specifies an altimeter gauge system failure.

FAIL_GAUGE_ATTITUDE	Specifies an attitude gauge system failure.

FAIL_GAUGE_

COMMUNICATIONS	Specifies a communication gauge system failure.

FAIL_GAUGE_FUEL_

INDICATORS	Specifies a fuel indicators gauge system failure.

FAIL_GAUGE_GYRO_

HEADING	Specifies a gyro heading gauge system failure.

FAIL_GAUGE_MAGNETIC_

COMPASS	Specifies a magnetic compass gauge system failure.

FAIL_GAUGE_NAVIGATION	Specifies a navigation gauge system failure.

FAIL_GAUGE_NAVIGATION_

VOR1	Specifies a navigation VOR1 gauge system failure.

FAIL_GAUGE_NAVIGATION_

VOR2	Specifies a navigation VOR2 gauge system failure.

FAIL_GAUGE_NAVIGATION_

BOTH	Specifies a complete failure of the navigation radio.

FAIL_GAUGE_

TRANSPONDER	Specifies a transponder gauge system failure.

FAIL_GAUGE_TURN_

COORDINATOR	Specifies a turn coordinator gauge system failure.

FAIL_GAUGE_VERTICAL_

SPEED	Specifies a vertical speed indicator gauge system failure.

FAIL_KEY_MAX	Not used.

You can set up a gauge element to react to one or more of the system failures shown in the following code example, defined by the FAILURE_ACTION enum values:

typedef enum FAILURE_ACTION

{

FAIL_ACTION_NONE = 0,

FAIL_ACTION_FREEZE,

FAIL_ACTION_ZERO,

FAIL_ACTION_NO_DRAW,

FAIL_ACTION_COVER,

FAIL_ACTION_MAX

} FAILURE_ACTION, *PFAILURE_ACTION, **PPFAILURE_ACTION;

The FAIL_ACTION enum values for Flight Simulator 98 are described in the following table:

Member	Description

FAIL_ACTION_NONE	No action taken. This type of failure record is typically used as the background static image for covering a gauge.

FAIL_ACTION_FREEZE	The element MODULE_VAR variable(s) will not be updated. The gauge element freezes at its last updated position.

FAIL_ACTION_ZERO	Sets the element MODULE_VAR variable(s) to 0.

FAIL_ACTION_NO_DRAW	Erases the element and doesn't draw it again.

FAIL_ACTION_COVER	Return value indicating that the user has chosen to cover this gauge in the aircraft settings menu. This value generally won’t be used in failure records.

FAIL_ACTION_MAX	Not used.

 Related Topics


Defining Mouse Rectangles

By using mouse rectangles, you can specify how a gauge will interact with the mouse pointer (mouse movement and mouse button clicks). For example, you can change the cursor or display a ToolTip as the mouse enters the area you've defined as a mouse rectangle; you can also trigger a Flight Simulator event or execute a callback function.

To define a mouse rectangle you use a combination of the mouse definition macros, as shown in the following code example:

MOUSE_PARENT_BEGIN(x, y, w, h, helpid)

MOUSE_PARENT_END

MOUSE_PARENT_BEGIN uses the following parameters:

Parameter	Description

x, y	Specifies the upper-left corner of the rectangle.

w, h	Specifies the width and height of rectangle.

helpid	Specifies the Help ID of the ToolTip text to display for the rectangle. For foreign versions, the Help IDs point to localized strings. There is currently no way to add more ToolTip ID’s. For a complete list of Help IDs, see the topic, Help IDs.

MOUSE_CHILD_EVENT defines a sub-rectangle of the rectangle created by MOUSE_PARENT_BEGIN; you can use the MOUSE_CHILD_FUNCT macro to specify a function to be called when an event specified by the mouse_flags parameter is triggered.

MOUSE_CHILD_EVENT(x, y, w, h, cursor, mouse_flags, event_id)

MOUSE_CHILD_EVENT uses the following parameters:

Parameter	Description

x, y	Specifies the upper-left corner of the rectangle.

w, h	Specifies the width and height of rectangle.

cursor	Specifies the cursor shown when the mouse is in the mouse rectangle. This parameter can be set to one of the following:
CURSOR_NONE
CURSOR_NORMAL
CURSOR_UPARROW
CURSOR_DOWNARROW
CURSOR_LEFTARROW
CURSOR_RIGHTARROW
CURSOR_HAND
CURSOR_CROSSHAIR

mouse_flags	Specifies under what conditions a callback function will be executed. It can be set to one of the following values:
MOUSE_NONE
MOUSE_RIGHTSINGLE
MOUSE_MIDDLESINGLE
MOUSE_LEFTSINGLE
MOUSE_RIGHTDOUBLE
MOUSE_MIDDLEDOUBLE
MOUSE_LEFTDOUBLE
MOUSE_RIGHTDRAG
MOUSE_MIDDLEDRAG
MOUSE_LEFTDRAG
MOUSE_MOVE
MOUSE_DOWN_REPEAT
MOUSE_KEYBOARD

event_id	Specifies the event to be sent to Flight Simulator 98 by the mouse event. For a complete list of events, see the topic Event IDs.

The MOUSE_CHILD_FUNCT macro calls a callback function when an event specified by the mouse_flags parameter is triggered. The callback function is defined as follows:

BOOL mouse_child_funct(PPIXPOINT relative_point, FLAGS32 mouse_flags)

For more information, see the topic mouse_child_funct.

The trigger_key_event and panel_window_toggle APIs are often used in the mouse event callback functions. For more information, see the topics panel_window_toggle and trigger_key_event.

The syntax for MOUSE_CHILD_FUNCT is as follows:

MOUSE_CHILD_FUNCT(x, y, w, h, cursor, mouse_flags, function)

MOUSE_CHILD_FUNCT uses the following parameters:

Parameter	Description

x, y	Specifies the upper-left corner of the rectangle.

w, h	Specifies the width and height of rectangle.

cursor	Specifies the cursor shown when the mouse is in the mouse rectangle. It can be set to one of the following:
CURSOR_NONE
CURSOR_NORMAL
CURSOR_UPARROW
CURSOR_DOWNARROW
CURSOR_LEFTARROW
CURSOR_RIGHTARROW
CURSOR_HAND
CURSOR_CROSSHAIR

mouse_flags	Specifies under what conditions the callback function will be executed.
MOUSE_NONE
MOUSE_RIGHTSINGLE
MOUSE_MIDDLESINGLE
MOUSE_LEFTSINGLE
MOUSE_RIGHTDOUBLE
MOUSE_MIDDLEDOUBLE
MOUSE_LEFTDOUBLE
MOUSE_RIGHTDRAG
MOUSE_MIDDLEDRAG
MOUSE_LEFTDRAG
MOUSE_MOVE
MOUSE_DOWN_REPEAT
MOUSE_KEYBOARD

function	Specifies the callback function executed by the mouse event.

The following is an example of mouse rectangle setup code:

MOUSE_BEGIN(mouse_rect, HELPID_B737_FLAPS, 0, 0)

MOUSE_CHILD_EVENT(0,0,44,85,  CURSOR_DOWNARROW, MOUSE_LEFTSINGLE, KEY_FLAPS_DECR)

MOUSE_CHILD_EVENT(44,0,44,85, CURSOR_UPARROW, MOUSE_LEFTSINGLE, KEY_FLAPS_INCR)

MOUSE_END

If you want to use mouse rectangles, you must use the mouse rectangle Panel API calls. These APIs set up the mouse rectangles to be used by the Panel system.

Call the mouse_list_install and mouse_list_register APIs in the install_routine gauge interface function, as shown in the following code example:

void install_routine(HINSTANCE resource_file_handle)

{

element_list_install(list, resource_file_handle);

mouse_list_install(mouse_rect, &gauge_header, &background.image_data.final->dim );

mouse_list_register(mouse_rect, &gauge_header);

}

Call the mouse_list_unregister API in the kill_routine gauge interface function, as shown in the following code example:

void kill_routine()

{

mouse_list_unregister(mouse_rect, &gauge_header);

element_list_kill(list);

}

 Related Topics


Creating a Gauge File, the Guage DLL
Creating a Gauge File, the Gauge DLL

A gauge file is a Windows DLL with the extension .gau. The gauge DLL is loaded by the Panel system. The Panel system interacts with each gauge using the exported interface defined by the gauge header file. The interface used by the gauge consists of a list of drawing elements and the exported functions used to manage the gauge.

To compile a fully functioning gauge

1	Create a gauge file.
This step includes creating the drawing elements; specifying other actions (such as failures, mouse events, highlighting, and so on); creating functions that interact with the Panel system, including the appropriate callbacks; and creating a gauge header.

2	Create a drawing element list that includes at least one drawing element (see the topic Using Drawing Elements).

3	Call the exported functions you need to manage your gauge (see the topic Using Exported Functions).

The gauge header is a GAUGEHDR structure that defines the interface used by the Panel system to control the gauge DLL. Each gauge DLL must define a gauge header. The following is the structure definition of a gauge header:

typedef struct	GAUGEHDR

{

UINT32	gauge_header_version;

char	*gauge_name;

PPELEMENT_HEADER	elements_list;

PQUERY_ROUTINE	query_routine;

PINSTALL_ROUTINE	install_routine;

PINITIALIZE_ROUTINE	initialize_routine;

PUPDATE_ROUTINE	update_routine;

PGENERATE_ROUTINE	generate_routine;

PDRAW_ROUTINE	draw_routine;

PKILL_ROUTINE	kill_routine;

PVOID	resource_file_handle;

UINT32	size_x_mm;

UINT32	size_y_mm;

float	x_adjust;

float	y_adjust;

PAWIND	window;

PPANEL_WND	panel_window_info;

PIXPOINT	position;

} GAUGEHDR, *PGAUGEHDR, **PPGAUGEHDR;

You must export the gauge header to expose the gauge interface to the Panel system. Use the GAUGE_HEADER macro to create and export the GAUGEHDR. The GAUGE_HEADER macro creates the GAUGEHDR, filling in the unique members of the structure.

The following is the syntax for the GAUGE_HEADER macro:

#define GAUGE_HEADER(version, size, name, element_list)

The GAUGE_HEADER macro has these members:

Member	Description

version	Must be set to GAUGE_HEADER_VERSION.

size	Specifies the X-axis size of the gauge, in millimeters.

name	Specifies the name of the gauge.

element_list	Pointer to the first drawing element in the list of elements. See the topic Using Drawing Elements.

The GAUGE_HEADER macro creates the GAUGEHDR structure and an exported variable, gauge_header. The Panel system uses the gauge_header variable to initialize each of the drawing elements. Most of the Panel API functions use gauge_header as one parameter to be passed. You will use this variable often.

The following example shows how to use the GAUGE_HEADER macro in code:

char	gauge_name[] = "Cessna_182.OMI\0";

'List will be defined later in this file.

extern PELEMENT_HEADER list;

GAUGE_HEADER(GAUGE_HEADER_VERSION, 49, gauge_name, &list);

To use the GAUGE_HEADER macro, you must include the exported functions listed in the topic Using Exported Functions, in your C implementation.

The other GAUGE_HEADER macro fields are set automatically at load-time based on panel information and other factors. You can't set these fields at compile-time because they'll be overwritten with new values when the gauge is loaded.

 Related Topics


Creating a Gauge, an Example

You can create a gauge using the compiler that comes with Visual C++ version 4.0 or later. To build a gauge you need to create a MAKE file.

To create a MAKE file

1	Define the variables required by the FS6GLOB.MAK.

2	Include FS6GLOB.MAK file.

3	Set up build-targets and dependencies.

You can find the files that you need to create a gauge, including the MAKE file, on the Flight Simulator 98 SDK Web site (the same site as this Help file).

For an example of a gauge header, see Creating a Gauge File, the Gauge DLL.

 Related Topics


Using Exported Functions

The functions described in the following table must be included in your gauge DLL. These functions define the interface used by the Panel system to control the gauge. These functions are described in detail in the topics included in Exported Functions section of the Panels SDK.

Function type and name	Description

INSTALL_ROUTINE

install_routine	Called when the gauge is loaded.

INITIALIZE_ROUTINE

initialize_routine	Called to initialize the gauge.

UPDATE_ROUTINE

update_routine	Called when it is time to update the variables that refer to the gauge's drawing elements.

GENERATE_ROUTINE

generate_routine	Called to re-initialize the gauge (for example, when the panel is resized).

DRAW_ROUTINE

draw_routine	Called to draw the gauge to the panel window.

KILL_ROUTINE

kill_routine	Called when the gauge is unloaded to free any memory used by the gauge.

 Related Topics


Using Token Variables

Gauges have access to Flight Simulator simulation state information. You can access state information though tokenized variables. For a complete list of tokenized variables, see the topic Token Variables.

You can access tokenized variables in one of two different ways, either through drawing elements or the Panel API. The most common method used to access tokenized variables is through drawing elements. In the element structure, you can specify which variable controls the element. For example, you may have a needle (ELEMENT_NEEDLE) that is controlled by the variable VERTICAL_SPEED. As the needle is updated, it will refer to the variable VERTICAL_SPEED to determine the angle at which it will be displayed. For details, see the topic Using Drawing Elements. The other method of accessing tokenized variables is through the Panel API.

To access a tokenized variable through the Panel API

1	Instantiate a MODULE_VAR variable initializing the GAUGE_TOKEN ID structure member.
You can set the ID to one of the token variables listed in the topic Token Variables. For example:
typedef struct	MODULE_VAR
{
GAUGE_TOKEN	id;
PVOID	var_ptr;
VAR_TYPE	var_type;
UNIVERSAL_VAR	var_value;
UNIVERSAL_VAR	var_old;
} MODULE_VAR, *PMODULE_VAR, **PPMODULE_VAR;

2	Initialize the variable by calling the Panel API initialize_var( ).
After you call initialize_var, the variable is ready to use. To update the contents of the variable from Flight Simulator 98 state information, use lookup_var( ). The following is the syntax for initialize_var and lookup_var( ), respectively:
initialize_var(PMODULE_VAR module_var)
lookup_var(PMODULE_VAR module_var )

After the lookup_var( ) function is called, the value of a MODULE_VAR variable is stored in the var_value member of the structure.

Important:  Module Variables are read-only. Any attempt to set simulation variables through the var_ptr variable may result in program crashes and incompatibility with future versions of Flight Simulator.

The following code example shows how the MODULE_VAR variable is used:

MODULE_VAR	gs_var = {VOR1_GS_FLAG};

void install_routine(HINSTANCE resource_file_handle)

{

initialize_var(&gs_var);

'Insert other initialization code.

}

void	update_routine()

{

lookup_var(&gs_var);

if(gs_var.var_value.n == 0)

{

HIDE_IMAGE((&gs_slider));

HIDE_IMAGE((&gs_background));

}

else

{

SHOW_IMAGE((&gs_slider));

SHOW_IMAGE((&gs_background));

}

'Insert other code to update drawing elements.

}

The following code example shows how the UNIVERSAL_VAR variable is used.

typedef union	UNIVERSAL_VAR {

FLOAT64	n;	'You can use any number.

BOOL	b;	// any boolean

ENUM	e;	// any enumerated value

FLAGS	f;	// any flags field

PVOID	p;	// any pointer

VAR32	d;	// any binary coded decimal

VAR32	o;	// any binary coded octal

} UNIVERSAL_VAR, *PUNIVERSAL_VAR, **PPUNIVERSAL_VAR;

For table of available module variables, see the topic Token Variables. The table lists the module variable name and description and specifies which UNIVERSAL_VAR union member to use with each variable.

 Related Topics


Help IDs

The following table includes the Help IDs, as well as string table text associated with each Help ID, used by the Panel system.

Help ID	String table text

HELPID_CESS_AD	"ADF Indicator"

HELPID_CESS_ALTIMETER	Altimeter"

HELPID_CESS_

ALTIMETER_SET	"Altimeter Setting Knob"

HELPID_CESS_AIRSPEED	"Airspeed Indicator"

HELPID_CESS_ATTITUDE_

INDICATOR	"Attitude Indicator"

HELPID_CESS_HEADING_

INDICATOR	"Heading Indicator"

HELPID_CESS_

TEMPERATURE	"Outside Air Temperature (OAT)"

HELPID_CESS_CARB_HEAT	"Carburetor Heat Indicator"

HELPID_CESS_ZOOM	"Zoom Indicator"

HELPID_CESS_STROBES	"Toggle Strobe Lights"

HELPID_CESS_LANDING_

LIGHT	"Toggle Landing Lights"

HELPID_CESS_AUTOPILOT	"Autopilot Status Indicator"

HELPID_CESS_LANDING_

GEAR	"Landing Gear Indicator"

HELPID_CESS_FLAPS	"Flaps Position Indicator"

HELPID_CESS_MAGNETOS	"Magnetos Switch"

HELPID_CESS_CLOCK	"Clock"

HELPID_CESS_EGT	"Exhaust Gas Temperature (EGT) Gauge"

HELPID_CESS_THROTTLE	"Throttle"

HELPID_CESS_TURN_

COORDINATOR	"Turn Coordinator"

HELPID_CESS_VOR1	"VOR 1 Indicator"

HELPID_CESS_OBS1	"OBS 1 Selector"

HELPID_CESS_VOR2	"VOR 2 Indicator"

HELPID_CESS_OBS2	"OBS 2 Selector"

HELPID_CESS_VSI	"Vertical Speed Indicator"

HELPID_CESS_RPM	"RPM Indicator"

HELPID_CESS_MAN_PRESS	"Manifold Pressure"

HELPID_CESS_OIL_TEMP	"Oil Temperature"

HELPID_CESS_OIL_PRESS	"Oil Pressure"

HELPID_CESS_PROP_ADV	"Propeller Advance"

HELPID_CESS_MIXTURE	"Engine Mixture"

HELPID_CESS_OUTER_

MARKER	"Outer Marker Indicator"

HELPID_CESS_MIDDLE_

MARKER	"Middle Marker Indicator"

HELPID_CESS_INNER_

MARKER	"Inner Marker Indicator"

HELPID_CESS_FUEL_LEFT	"Left Fuel Tank Level Indicator"

HELPID_CESS_FUEL_RIGHT	"Right Fuel Tank Level Indicator"

HELPID_CESS_MAG_

COMPASS	"Magnetic Compass"

HELPID_CESS_BACK_

COURSE_IND	"Backcourse Indicator"

HELPID_CESS_HEADING_

ADJUST	"Heading Indicator Adjustment Knob"

HELPID_CESS_TRIM	"Elevator Trim"

HELPID_CESS_VACUUM	"Engine Vacuum"

HELPID_CESS_AMPS	"Generator Amps"

HELPID_CESS_FUEL_FLOW	"Fuel Flow (GPH)"

HELPID_CESS_CHT	"Cylinder Head Temperature"

HELPID_CESS_TAS_

CALIBRATION	"True Airspeed Calibration Knob"

HELPID_CESS_KOHLSMAN	"Kohlsman Calibration Knob"

HELPID_CESS_PITOT_HEAT	"Pitot Heat"

HELPID_CESS_SUCTION	"Suction"

HELPID_CESS_HEADING_

BUG_ADJUST	"Heading Bug Adjust"

HELPID_CESS_PANEL_

LIGHTS_TOGGLE	"Toggle Instrument Panel Lights"

HELPID_CESS_PITOT_

HEAT_TOGGLE	"Toggle Pitot Heat"

HELPID_LEAR_ADF_

INDICATOR	"ADF Indicator"

HELPID_LEAR_ALTIMETER	"Altimeter"

HELPID_LEAR_ALTIMETER_

SET	"Altimeter Setting"

HELPID_LEAR_AIRSPEED	"Airspeed Indicator"

HELPID_LEAR_AOA	"Angle of Attack Indicator"

HELPID_LEAR_ATTITUDE_

INDICATOR	"Attitude Indicator"

HELPID_LEAR_CLOCK	"Clock"

HELPID_LEAR_SIM_RATE	"Simulation Rate Indicator"

HELPID_LEAR_COMPASS	"Magnetic Compass"

HELPID_LEAR_TURBINE_

SPEED	"Turbine Speed (N2) Percent"

HELPID_LEAR_TURBINE_

TEMP	"Turbine Inlet Temperature (Celsius)"

HELPID_LEAR_FAN_SPEED	"Fan Speed (N1) Percent"

HELPID_LEAR_OIL_TEMP	"Oil Temperature (Celsius)"

HELPID_LEAR_OIL_

PRESSURE	"Oil Pressure"

HELPID_LEAR_FUEL_FLOW	"Fuel Flow (1000 Lbs/Hour)"

HELPID_LEAR_FUEL_

QUANTITY	"Fuel Quantity (1000 Lbs)"

HELPID_LEAR_THRUST_

LEVERS	"Thrust Levers"

HELPID_LEAR_ENGINE1_

LEVER	"Engine 1 Thrust Lever"

HELPID_LEAR_ENGINE2_

LEVER	"Engine 2 Thrust Lever"

HELPID_LEAR_ENGINE_

STARTERS	"Engine Starters"

HELPID_LEAR_ENGINE1_

STARTER	"Engine 1 Starter/Magneto"

HELPID_LEAR_ENGINE1_

GENERATOR	"Engine 1 Generator"

HELPID_LEAR_ENGINE2_

STARTER	"Engine 2 Starter/Magneto"

HELPID_LEAR_ENGINE2_

GENERATOR	"Engine 2 Generator"

HELPID_LEAR_HEADING_

INDICATOR	"Heading Indicator"

HELPID_LEAR_HEADING_

ADJUST	"Heading Indicator Adjustment Knob"

HELPID_LEAR_ZOOM_

INDICATOR	"Zoom Indicator"

HELPID_LEAR_AUTOPILOT_

INDICATOR	"Autopilot Indicators"

HELPID_LEAR_ALT_HOLD	"Altitude Hold Indicator"

HELPID_LEAR_HEADING_

HOLD	"Heading Hold Indicator"

HELPID_LEAR_NAV_HOLD	"Nav Hold Indicator"

HELPID_LEAR_LOC_GS_

HOLD	"ILS Hold Indicator"

HELPID_LEAR_

BACKCOURSE_HOLD	"Localizer Backcourse Hold Indicator"

HELPID_LEAR_AUTOPILOT_

MASTER	"Autopilot Master Switch"

HELPID_LEAR_STROBES	"Strobe Light Switch"

HELPID_LEAR_SPOILER	"Spoiler Indicators"

HELPID_LEAR_TRIM	"Elevator Trim"

HELPID_LEAR_LANDING_

GEAR	"Landing Gear Position Indicator and Lever"

HELPID_LEAR_FLAP_

INDICATOR	"Flap Position Indicator"

HELPID_LEAR_COM_RADIO	"Communications Radio"

HELPID_LEAR_NAV1	"Navigation Radio 1"

HELPID_LEAR_NAV2	"Navigation Radio 2"

HELPID_LEAR_

TRANSPONDER	"Transponder"

HELPID_LEAR_ADF_FREQ	"ADF Frequency"

HELPID_LEAR_AILERON	"Aileron Position Indicator"

HELPID_LEAR_ELEVATOR	"Elevator Position Indicator"

HELPID_LEAR_RUDDER	"Rudder Position Indicator"

HELPID_LEAR_

TEMPERATURE	"Outside Air Temperature"

HELPID_LEAR_SKID_SLIP	"Slip/Skid Indicator"

HELPID_LEAR_VOR1_

INDICATOR	"VOR 1 Indicator"

HELPID_LEAR_VOR2_

INDICATOR	"VOR 2 Indicator"

HELPID_LEAR_VERTICAL_

SPEED	"Vertical Speed Indicator"

HELPID_LEAR_NAV_LIGHTS	"Navigation Lights"

HELPID_LEAR_DME1	"DME 1 Indicator"

HELPID_LEAR_DME2	"DME 2 Indicator"

HELPID_LEAR_HIS	"Horizontal Situation Indicator"

HELPID_LEAR_MACH	"Mach Number Hold Indicator"

HELPID_LEAR_PANEL_

LIGHTS	"Panel Lights"

HELPID_LEAR_LANDING_

LIGHTS	"Landing Lights"

HELPID_LEAR_WARNING_

INDIC	"Warning Indicators"

HELPID_LEAR_GLIDESLOPE	"Glideslope Indicator"

HELPID_LEAR_VOR2_

NEEDLE_TOGGLE	"Toggle VOR2 Needle"

HELPID_LEAR_ADF_

NEEDLE_TOGGLE	"Toggle ADF Needle"

HELPID_LEAR_SPD	"Indicated Airspeed Hold Indicator"

HELPID_LEAR_IAS_MACH	"IAS/Mach Selector"

HELPID_LEAR_MACH_

INDICATOR	"Indicated Mach"

HELPID_LEAR_WARNING_

ENUNCIATOR	"Annunciator Panel"

HELPID_LEAR_

ENUNCIATOR_TEST	"Annunciator Panel Test Button"

HELPID_SOPWITH_ALT	"Altimeter"

HELPID_SOPWITH_ASI	"Airspeed Indicator"

HELPID_SOPWITH_

COMPASS	"Magnetic Compass"

HELPID_SOPWITH_TURN	"Turn Coordinator"

HELPID_SOPWITH_FUEL	"Fuel Quantity Indicator"

HELPID_SOPWITH_OILP	"Oil Pressure Indicator"

HELPID_SOPWITH_MAG	"Magnetos"

HELPID_SOPWITH_RPM	“RPM Indicator"

HELPID_SCHWEIZER_ALT	"Altimeter"

HELPID_SCHWEIZER_ALT_

SET	"Kohlsman Calibration Knob"

HELPID_SCHWEIZER_ASI	"Airspeed"

HELPID_SCHWEIZER_

COMPASS	"Magnetic Compass"

HELPID_SCHWEIZER_

SPOILERS	"Spoilers"

HELPID_SCHWEIZER_COMM	"Communications Radio"

HELPID_SCHWEIZER_VSI	"Vertical Speed Indicator"

HELPID_SCHWEIZER_

MASTER_AVI	"Master Avionics Switch"

HELPID_B737_ALTIMETER	"Altimeter"

HELPID_B737_ALT_SET	"Altimeter Setting Knob"

HELPID_B737_AUTOPILOT	"Autopilot Controls"

HELPID_B737_AUTOPILOT_

MASTER	"Autopilot Master Switch"

HELPID_B737_AUTOPILOT_

HEADING	"Heading Hold Indicator"

HELPID_B737_AUTOPILOT_

ALT	"Altitude Hold Indicator"

HELPID_B737_AUTOPILOT_

NAV	"Nav Hold Indicator"

HELPID_B737_AUTOPILOT_

LOC_GS	"ILS Hold Indicator"

HELPID_B737_AUTOPILOT_

BC	"Localizer Back Course Hold"

HELPID_B737_AIRSPEED	"Airspeed Indicator"

HELPID_B737_ATTITUDE	"Attitude Direction Indicator (ADI)"

HELPID_B737_SLIP_SKID	"Slip/Skid Indicator"

HELPID_B737_CLOCK	"Clock"

HELPID_B737_SIM_RATE	"Simulation Rate"

HELPID_B737_ELAPSED_

TIME	"Elapsed Time"

HELPID_B737_ENGINES	"Engine Instruments"

HELPID_B737_FAN_SPEED	"Fan Speed (N1) Percent"

HELPID_B737_EGT	"Exhaust Gas Temperature"

HELPID_B737_TURBINE_

SPEED	"Turbine Speed (N2) Percent"

HELPID_B737_FUEL_FLOW	"Fuel Flow (x10 Lbs/Hr)"

HELPID_B737_FLAPS	"Flap Position Indicator"

HELPID_B737_FUEL_QUANT	"Fuel Quantity (1000 Lbs)"

HELPID_B737_LANDING_

GEAR	"Landing Gear Indicator"

HELPID_B737_OIL	"Oil Status"

HELPID_B737_OIL_

PRESSURE	"Oil Pressure"

HELPID_B737_OIL_TEMP	"Oil Temperature"

HELPID_B737_OIL_QUANT	"Oil Quantity Percent"

HELPID_B737_HYDRAULIC	"Hydraulic Pressure"

HELPID_B737_MARKER	"Marker Beacon Lights"

HELPID_B737_STROBES	"Strobe Light Indicator"

HELPID_B737_NAV_LIGHTS	"Navigation Lights Indicator"

HELPID_B737_ENGINE1_

START	"Engine 1 Starter"

HELPID_B737_ENGINE2_

START	"Engine 2 Starter"

HELPID_B737_COMM	"Communications Radio"

HELPID_B737_NAV1	"Nav 1 Radio"

HELPID_B737_NAV2	"Nav 2 Radio"

HELPID_B737_ADF	"ADF Radio"

HELPID_B737_

TRANSPONDER	"Transponder"

HELPID_B737_RMI	"Radio Magnetic Indicator (Dual Needle RMI)"

HELPID_B737_SPOILERS	"Spoilers"

HELPID_B737_THRUST_

LEVERS	"Thrust Levers"

HELPID_B737_ELEVATOR_

TRIM	"Elevator Trim Indicator"

HELPID_B737_VOR_

INDICATOR	"Horizontal Situation Indicator (HSI)"

HELPID_B737_VSI	“Vertical Speed Indicator"

HELPID_B737_AUTOPILOT_

WING_LEVELER	"Wing Leveler"

HELPID_B737_AUTOPILOT_

YAW_DAMPER	"Yaw Damper"

HELPID_B737_AUTOPILOT_

COURSE_SELECT	"Course Selector"

HELPID_B737_AUTOPILOT_

HEADING_SELECT	"Heading Selector"

HELPID_B737_AUTOPILOT_

ALTITUDE_SELECT	"Altitude Selector"

HELPID_B737_TOTAL_

AIR_TEMP	"Total Air Temperature (Deg. C)"

HELPID_B737_LANDING_

GEAR_LEVER	"Landing Gear Lever"

HELPID_B737_VIBRATION	"Engine Vibration Indicator"

HELPID_B737_HYDRAULIC_

QTY	"Hydraulic Fluid Quantity Percent"

HELPID_B737_DME1	"DME 1 Indicator"

HELPID_B737_DME2	"DME 2 Indicator"

HELPID_B737_AUTOPILOT_

IAS_MACH_SELECT	"Display Indicated Airspeed/Mach"

HELPID_B737_TO_GA	"Takeoff/Go Around Button"

HELPID_B737_

AUTOTHROTTLE	"Autothrottle Engage"

HELPID_B737_

REFERENCE_N1	"Reference N1"

HELPID_B737_N1_SET	"N1 Set"

HELPID_B737_CROSS_FEED	"Cross Feed"

HELPID_B737_PITOT_HEAT	"Pitot Heat"

HELPID_B737_SPEED_HOLD	"Airspeed Hold Indicator"

HELPID_B737_VERTICAL_

SPEED_HOLD	"Vertical Speed Hold Indicator"

HELPID_B737_SPEED_

SELECT	"Airspeed Selector"

HELPID_B737_VERTICAL_

SPEED_SELECT	"Vertical Speed Selector"

HELPID_B737_ZOOM	"Current View Zoom Factor"

HELPID_B737_AUTO_

THROTTLE_ARM	"Auto Throttle Arm"

HELPID_B737_TAKEOFF_

POWER_ACTIVE	"Takeoff Power Active"

HELPID_B737_OPEN_RADIO_

STACK	"Open Radio Stack"

HELPID_EXTR_ADF_

INDICATOR	"ADF Indicator"

HELPID_EXTR_ADF_SET	"ADF Setting Knob"

HELPID_EXTR_ALTIMETER	"Altimeter"

HELPID_EXTR_ALTIMETER_

SET	"Altimeter Setting Knob"

HELPID_EXTR_AIRSPEED	"Airspeed Indicator"

HELPID_EXTR_ATTITUDE_

INDICATOR	"Attitude Indicator"

HELPID_EXTR_TURN_

NEEDLE	"Turn Indicator"

HELPID_EXTR_SLIP_SKID	"Slip/Skid Indicator"

HELPID_EXTR_ENGINE_

CONTROLS	"Engine Controls"

HELPID_EXTR_THROTTLE	"Throttle"

HELPID_EXTR_PROP	"Propeller Control"

HELPID_EXTR_MIXTURE	"Mixture Control"

HELPID_EXTR_CLOCK	"Clock"

HELPID_EXTR_SIM_RATE	"Simulation Rate Indicator"

HELPID_EXTR_COMPASS	"Magnetic Compass"

HELPID_EXTR_MASTER_

SWITCH	"Master Switch"

HELPID_EXTR_PANEL_

LIGHTS	"Instrument Panel Lights"

HELPID_EXTR_STROBE_

LIGHTS	"Strobe Lights"

HELPID_EXTR_RADIO_

MASTER	"Avionics Master Switch"

HELPID_EXTR_SMOKE	"Smoke System Switch"

HELPID_EXTR_ACRO_TANK	"Left Fuel Tank Indicator"

HELPID_EXTR_MAIN_TANK	"Right Fuel Tank Indicator"

HELPID_EXTR_FUEL_FLOW	"Fuel Flow (GPH)"

HELPID_EXTR_EGT	"Exhaust Gas Temperature"

HELPID_EXTR_AMPS	"Ammeter"

HELPID_EXTR_STARTER	"Starter/Magneto Switch"

HELPID_EXTR_HEADING_

INDICATOR	"Heading Indicator"

HELPID_EXTR_HEADING_

SET	"Heading Indicator Setting Knob"

HELPID_EXTR_G_METER	"G Meter"

HELPID_EXTR_RADIOS	"Radios"

HELPID_EXTR_COMM	"Communication Radio"

HELPID_EXTR_NAV	"Navigation Radio"

HELPID_EXTR_

TRANSPONDER	"Transponder"

HELPID_EXTR_ADF	"ADF Indicator"

HELPID_EXTR_VSI	"Vertical Speed Indicator"

HELPID_EXTR_RPM	"Tachometer"

HELPID_EXTR_MP	"Manifold Pressure"

HELPID_EXTR_OIL_TEMP	"Oil Temperature"

HELPID_EXTR_OIL_

PRESSURE	"Oil Pressure"

HELPID_EXTR_G_METER_

RESET	"G Meter Reset Button"

HELPID_EXTR_VOR1	"VOR Indicator"

HELPID_EXTR_OBI1	"OBS Indicator"

HELPID_EXTR_ARESTI_

DIAGRAM	"Diagram In Aresti Notation"

HELPID_EXTR_DME	"DME Indicator"

HELPID_BELL_OIL_PSI	"Oil Pressure"

HELPID_BELL_OIL_TEMP	"Oil Temperature"

HELPID_BELL_XMISSION_

PSI	"Transmission Oil Pressure"

HELPID_BELL_XMISSION_

TEMP	"Transmission Oil Temperature"

HELPID_BELL_FUEL_QTY	"Fuel Quantity"

HELPID_BELL_GEN_LOAD	"Generator Load"

HELPID_BELL_FUEL_PSI	"Fuel Pressure"

HELPID_BELL_TORQUE	"Torque (Percent)"

HELPID_BELL_TURBINE_

TEMP	"Turbine Temperature"

HELPID_BELL_GAS_

PRODUCER	"Gas Producer (N1)"

HELPID_BELL_CLOCK	"Clock"

HELPID_BELL_AIRSPEED	"Indicated Airspeed"

HELPID_BELL_ROTOR_

TURBINE	"Rotor (NR)/Turbine (N2) Speed"

HELPID_BELL_ADF	"ADF"

HELPID_BELL_ADF_

SETTING	"ADF Tuning Knob"

HELPID_BELL_ATTITUDE	"Attitude Indicator"

HELPID_BELL_HIS	"Horizontal Situation Indicator"

HELPID_BELL_VOR2	"VOR 2"

HELPID_BELL_ALTIMETER	"Altitude Indicator"

HELPID_BELL_KOHLSMAN	"Kohlsman Calibration Knob"

HELPID_BELL_VSI	"Vertical Speed Indicator"

HELPID_BELL_TURN_

INDICATOR	"Turn Indicator"

HELPID_BELL_CYCLIC_LR	"Left/Right Cyclic"

HELPID_BELL_CYCLIC_FA	"Fore/Aft Cyclic"

HELPID_BELL_ANTI_

TORQUE_ROTOR	"Anti-Torque Rotor Indicator"

HELPID_BK_NAV1	"Navigation 1 Radio"

HELPID_BK_COMM1	"Communication 1 Radio"

HELPID_BK_NAV2	"Navigation 2 Radio"

HELPID_BK_COMM2	"Communication 2 Radio"

HELPID_BK_DME	"DME Indicator"

HELPID_BK_DME_KT	"DME Knots"

HELPID_BK_DME_NM	"DME Nautical Miles"

HELPID_BK_DME_MIN	"DME Minutes"

HELPID_BK_DME_N1_N2_

SELECT	"DME Nav 1/ Nav 2 Select"

HELPID_BK_ADF_RADIO	"ADF"

HELPID_BK_TRANSPONDER	"Transponder"

HELPID_BK_RADIOS_OPEN	"Open Radio Stack"

HELPID_BK_AP_RADIO	"Autopilot"

 Related Topics


Macros

The following macros have been defined to manipulate drawing elements:

#define GET_IMAGE_HIDDEN(element)	(element->image_flags & IMAGE_HIDDEN)

#define SHOW_IMAGE(element)	(element->image_flags &= ~IMAGE_HIDDEN)

#define HIDE_IMAGE(element)	(element->image_flags |= IMAGE_HIDDEN)

#define GET_ON_SCREEN(element)	(element->image_flags & IMAGE_ON_SCREEN)

#define SET_ON_SCREEN(element)	element->image_flags |= IMAGE_ON_SCREEN

#define SET_OFF_SCREEN(element)	element->image_flags &= ~IMAGE_ON_SCREEN

The following macros have been defined to manipulate string elements:

#define STR_UNSEL(ELEMENT)	ELEMENT->sel_end = -1; ELEMENT->sel_str = -1;

#define STR_SEL(ELEMENT, STR, END)	ELEMENT->sel_end = END; ELEMENT->sel_str = STR;

#define IS_STR_SEL(ELEMENT)	(ELEMENT->sel_end != -1 && ELEMENT->sel_str != -1)

 Related Topics


Overview

The Panels SDK includes everything you need to know to create, modify, and install fully functioning panels in Flight Simulator 98. You'll find the files that you need, complete with examples of existing files. You'll find source code that you can just cut and paste. You'll also find a programming reference that covers the structures and elements used in creating a panel.

If you want to create a gauge from scratch, take a look at the topics included in the Defining Panels and Defining Gauges sections. If you want to modify a gauge or understand the "ins and outs" of how a specific drawing element interacts with the Panel system, see the Drawing Elements section. For reference information, see the Programming Reference section, as well as the topics included in the rest of the SDK that focus on specific functions and how they interact with the Panel system.

Important: The information included in the Panels SDK is intended as a reference for programmers. It assumes familiarity with C programming language and game development. The information is not supported by Microsoft Product Support.

In Flight Simulator 98, all aircraft-specific files are located in the Aircraft folder, also called the container system. The aircraft folder includes a folder for each aircraft available in Flight Simulator 98. In turn, each individual aircraft folder includes the following folders and files:

•	Model folder

•	Panel folder

•	Sound folder

•	Texture folder

•	Aircraft configuration file

•	Checklists configuration file

The Panels SDK covers the Panel folder and the Aircraft configuration file, which are essential to creating a panel.

 Related Topics


Aircraft Configuration File

The Aircraft.cfg file specifies the location of aircraft information. The sections of the file and the information specified in each section are as follows:

[Fltsim.0]

Title= the aircraft name displayed in the Aircraft Selection dialog box.

Sim= the .air file.

Model= the location of model information. The default location is the folder "Model."

Panel= the location of panel information. The default location is the folder "Panel."

Sound= the location of sound information. The default location is the folder "Sound."

Texture= the location of texture information. The default location is the folder "Texture."

Checklists= the checklists configuration file.

If you have more than one version of the same aircraft, you can specify information for each version in the same aircraft configuration file. Just designate the first version as [Fltsim.0], the second version as [Fltsim.1], and so on. The example aircraft configuration file in this topic specifies an aircraft that has two versions.

In the first version of the aircraft in the example below ([Fltsim.0]), Model=rg points to a model folder named model.rg, Panel=rg points to a panel folder named panel.rg, Sound refers to the default folder, Sound, and Texture=rg points to a texture folder named texture.rg. In the second version of the aircraft in the example below ([Fltsim.1]), the folders aren't specified and point to the default folders for model, panel, sound, and texture (Model, Panel, Sound, and Texture, respectively).

[Fltsim.0]

Title=Cessna Skylane 182R RG

Sim=Cessna182RRG

Model=rg

Panel=rg

Sound=

Texture=rg

Checklists=Cessna182RRG_check

[Fltsim.1]

Title=Cessna Skylane 182S

Sim=Cessna182S

Model=

Panel=

Sound=

Texture=

Checklists=Cessna182S_check

 Related Topics


Panel Configuration File

The folder used by the Panel system is the Panel folder. The Panel folder contains the panel background image (.bmp) files and panel configuration file (Panel.cfg).

If you have more than one version of an aircraft that each requires a different panel layout, you will have more than one Panel folder. The name of the default Panel folder is Panel. Additional Panel folders must have the name Panel.xxx, where xxx is an identifying key. The identification key is found in the Aircraft configuration file.

When Flight Simulator 98 loads an aircraft, it also loads the panel configuration file. The file location is determined by the rules discussed in the Overview topic. The following example is a panel configuration file (Panel.cfg) used in Flight Simulator 98.

[Window Titles]

window00=Schweizer

window01=Minicontrols

[Window00]

file=Schweizer2_32.bmp

size_mm=515

window_size_ratio=1.0

position=7

visible=1

ident=0

gauge00=Schweizer.Compass,0,165

gauge01=Schweizer.Com-Radio,214,161

gauge02=Schweizer.Master,298,35

gauge03=Schweizer.Altimeter,17,78

gauge04=Schweizer.Airspeed,106,31

gauge05=Schweizer.Vertical-Speed,396,85

[Window01]

file=Minicontrols.bmp

size_mm=100

position=0

visible=0

ident=100

gauge00=Minicontrols, 0, 0

[8 Bit Colors]

color00= 99, 107, 123

color01=148, 156, 148

color02=148, 156, 123

color03=181, 181, 140

color04=239, 239, 198

color05=255, 255, 214

color06=189, 189, 165

color07=231, 222, 173

color08=156, 148, 107

color09=173, 165, 132

color10=222, 206, 148

color11=123, 115,  99

color12=173, 148, 107

color13= 74,  66,  57

color14=222, 181, 140

color15= 49,  41,  33

color16=107,  90,  74

color17=140, 123, 107

color18=148, 107,  82

color19=198, 123,  82

color20=222, 148, 115

color21=206,  99,  66

color22=107,  57,  41

color23=148,  66,  41

color24= 66,  33,  24

color25=181,  99,  74

color26= 99,  33,  16

color27=173,  74,  49

color28=123,  41,  24

color29= 24,  16,  16

color30= 33,  24,  24

color31= 66,  49,  49

[Default View]

X=0

Y=0

SIZE_X=8191

SIZE_Y=4890

The Panel system creates the aircraft's panel windows by using the [Window Titles] section. The Panel system starts from window00, creating panel windows until it reaches window63 or until it finds a break in the progression. For each windowXX variable in this section, the Panel system creates a panel window. When creating the panel window it looks for a corresponding [WindowXX] section. The variables in this section are used to set the initial state of each panel window. After the panel window is created, the gauges listed in the [WindowXX] section are loaded.

The gauges are specified by the gauge00 through gauge63 in the [WindowXX] section. The Panel system starts loading gauges, starting from gauge00 until it reaches gauge63, or until it finds a break in the progression.

When the bitmap background and gauge images are loaded, the image colors are mapped to the closest Flight Simulator colors listed in the Color Mapping Table topic. In addition to the colors listed in the color table, there are 32 panel-specific colors (the values for these colors are listed in the Panel.cfg file example, earlier in this topic) that can be set in the panel configuration file. If the panel-specific colors are set, they are also used during the color mapping process. The panel-specific-colors are set in the [8 bit colors] section of the Panel.cfg file.

Tip: The .bmp file used for the panel window background must be an 8-bit color image. There will be a "hole" in the panel window anywhere index 0 (transparency) is used in the background image. Using index 0 is a great technique for giving the panel windows a distinctive shape other than rectangular. For example, you could use index 0 on corners, making the corners transparent and giving a rounded appearance.

The following table shows the sections of the Panel.cfg file, including the variables used in each section, and describes how each section effects the panel.

Section and variable	Description

[Window Titles]

window00–window63	Window00=Schweizer
Title displayed for the panel window when it's undocked. Also displayed as an item included in the list when you click Instrument Panel on the Views menu.

[Window00]–[Window63]

File	File = Schweizer2_32.bmp
Bitmap file to load and use for the panel window background. The .bmp file should be in the same directory as the Panel.cfg file.

size_mm	Size_MM = 515
Size of the panel window, in millimeters.

Window_size_ratio	Window_size_ratio = 0.8
Optional. Determines the width of panel window as a ratio of the client area of Flight Simulator main window.  If not specified, 1.0 is the default

Position	Position = 7
The relative position of a panel window to the main window. Position is designated by a number from 0 to 8 described as follows:
0 = upper-left corner
1 = upper-middle side
2 = upper-right corner
3 = middle-left side
4 = middle
5 = middle-right side
6 = lower-left corner
7 = lower-middle side
8 = lower-right corner
If not specified, 7 is the default.

Visible	Visible = 1
Specifies the initial visible state of the panel window
1 = visible
0 = hidden
If not specified, 1 is the default.

Ident	Ident = 100
A unique numeric identifier used by some Panel system APIs.

gauge00–gauge63	Gauge00=Sopwith.Altimeter, 211, 113
A comma-delimited variable that specifies the gauge DLL file to load and the X, Y position of the gauge, in millimeters.

[8 Bit Colors]

color00–color31	Color00 = 128,128,0
These can be used to add up to thirty-two extra colors to the palette. The additional colors are used to display gauges and window background.

[Default View]

X	X = 0
Specifies the X position of the default 3D window.

Y	Y = 0
Specifies the Y position of the default 3D window.

SIZE_X	SIZE_X = 8191
Specifies the width of the default 3D window.

SIZE_Y	SIZE_Y = 3370
Specifies the height of the default 3D window.

 Related Topics


Token Variables

Token Variable	UNIVERSAL_VAR member	Description

MODULE_VAR_NONE	N/A	Specifies an unused variable.

TICK18	N	Included at 18hz. Used for general
purpose timing.

GROUND_ALTITUDE	N	Specifies ground level altitude (1/256
meter/unit).

CLOCK_HOUR	N	Specifies local clock time, hours (0–23)

CLOCK_MINUTE	N	Specifies local clock time, minutes (0–59)

CLOCK_SECOND	N	Specifies local clock time, seconds
(0–59)

ZULU_HOUR	N	Specifies delta time from GMT.

ZULU_MINUTE	N	Specifies delta time from GMT.

ZULU_DAY	N	Specifies GMT day of year (1–365/366)

ZULU_YEAR	N	Specifies GMT year.

PANEL_LIGHTS	B	TRUE=panel lighting on.

STROBE_LIGHTS	B	TRUE=strobe lights on.

STROBE_FLASH	B	TRUE=strobe flash on model and screen.

PITOT_HEAT	B	TRUE=pitot heat on.

LANDING_LIGHTS	B	TRUE=landing lights on.

SMOKE_ENABLE	B	TRUE=smoke system active.

ADF_FREQUENCY	D	Specifies ADF frequency.

ADF_500_HZ_TUNABLE	B	Specifies ADF frequency.

ADF_EXTENDED_

FREQUENCY	D	Specifies ADF frequency.

ADF_IDENTITY	N

ADF_SIGNAL_STRENGTH	N

ADF_MORSE_IDENT	D

ADF_CARD_RADIAL	N	Specifies integer degrees, 0–360.

COM_FREQUENCY	D	Specifies BCD COM radio frequency.

NAV1_FREQUENCY	D	Specifies BCD NAV1 radio frequency.

NAV1_VOR_RADIAL	N

NAV1_MORSE_IDENT	D

NAV2_FREQUENCY	D	Specifies BCD NAV2 radio frequency.

NAV2_VOR_RADIAL	N

NAV2_MORSE_IDENT	D

DME1_DISPLAY_TYPE	B	FALSE=distance readout; TRUE=speed,
in knots, readout.

DME1_DISTANCE	N	Specifies DME1 distance readout.

DME1_SPEED	N	Specifies DME1 speed readout.

DME1_MORSE_IDENT	D

DME2_DISPLAY_TYPE	B	FALSE=distance readout; TRUE=speed,
in knots, readout.

DME2_DISTANCE	N	Specifies DME2 distance readout.

DME2_SPEED	N	Specifies DME2 speed readout.

DME2_MORSE_IDENT	D

TRANSPONDER_CODE	D	Specifies octal transponder code (0000–
7777.

ADF_NEEDLE	N

VOR1_NEEDLE	N

VOR1_GS_NEEDLE	N

VOR1_BACK_COURSE

_FLAGS	F	Status of VOR1 (see BC_FLAG_ in
 FS6DEF.H)

VOR1_TF_FLAG	E

VOR1_GS_FLAG	B

VOR1_OBI	N

VOR1_CODE	D

VOR1_IDENTITY	D

VOR1_MAG_VAR	N

VOR1_SIGNAL_STRENGTH	N

VOR2_NEEDLE	N

VOR2_BACK_COURSE

_FLAGS	F	Status of VOR2 (see BC_FLAG_ in
 FS6DEF.H)

VOR2_TF_FLAG	E

VOR2_GS_FLAG	B

VOR2_OBI	N

VOR2_CODE	D

VOR2_IDENTITY	D

VOR2_MAG_VAR	N

VOR2_SIGNAL_STRENGTH	N

VOR2_BEARING_DEGREES	N

AIRCRAFT_ON_GROUND	B	TRUE=aircraft is on the ground.

AIRSPEED	N	Airspeed - Indicated or True based on
GLOBALP->indicated_aspd.

AIRSPEED_TRUE_

CALIBRATE	N	Specifies the degrees of rotation of the
TAS calibration card.

BARBER_POLE_ASPD	N	Specifies moveable redline airspeed
(1/128th knot/unit)

MACH	N	Specifies mach; 64K=3.2.

VERTICAL_SPEED	N	Specifies upward velocity, vertical speed
(1/256th, m/sec)

MACH_MAX_OPERATE	N

STALL_WARNING	B	TRUE=5 knots before stall.

OVERSPEED_WARNING	B	TRUE=over speed warning.

TURN_COORDINATOR_

BALL_POS	N	Specifies turn-coordinator ball
position (-127–127).

DELTA_HEADING_RATE	N

PLANE_LATITUDE	N	Specifies current latitude of aircraft.

PLANE_LONGITUDE	N	Specifies current longitude of aircraft.

PLANE_ALTITUDE	N	Specifies current altitude of aircraft.

ALT_FROM_BAROMETRIC

_PRESSURE	N

KOHLSMAN_SETTING_MB	N	Specifies knob position in milli-bars.

KOHLSMAN_SETTING_HG	N	Specifies knob position in inches of hg.

PLANE_PITCH_DEGREES	N

ATTITUDE_INDICATOR_

PITCH_DEGREES	N

PLANE_BANK_DEGREES	N

ATTITUDE_INDICATOR

_BANK_DEGREES	N

PLANE_HEADING_

DEGREES_MAGNETIC	N

MAGNETIC_VAR	N	Magnetic north vs. true north angular
error

WHISKEY_COMPASS

_DEGREES	N	Specifies true degrees.

PLANE_HEADING_

DEGREES_GYRO	N

GYRO_DRIFT_ERROR	N

PLANE_HEADING_

DEGREES_TRUE	N

AIRCRAFT_AUTOPILOT_

AVAILABLE	B

AIRCRAFT_FLAPS_

AVAILABLE	B

AIRCRAFT_STALL_

HORN_AVAILABLE	B

AIRCRAFT_ENGINE_

MIXTURE_AVAILABLE	B

AIRCRAFT_CARB_

HEAT_AVAILABLE	B

AIRCRAFT_SPOILER_

AVAILABLE	B

AIRCRAFT_IS_

TAIL_DRAGGER	B

AIRCRAFT_STROBES

_AVAILABLE	B

AIRCRAFT_PROP_

TYPE_AVAILABLE	N	Specifies the type of propeller;
Prop_type_fixed, prop_type_manual,
prop_type_automatic

AIRCRAFT_TOE_

BRAKES_AVAILABLE	B

AIRCRAFT_NAV1_

AVAILABLE	B

AIRCRAFT_NAV2_

AVAILABLE	B

AIRCRAFT_NAV1_

OBS_AVAILABLE	B

AIRCRAFT_NAV2_OBS_

AVAILABLE	B

AIRCRAFT_VOR2_

GAUGE_AVAILABLE	B

AUTOPILOT_ACTIVE	B	Toggles autopilot master.

AUTOPILOT_WING_

LEVELER	B	Toggles wing leveler.

AUTOPILOT_NAV1_LOCK	B	Toggles Nav 1 lock.

AUTOPILOT_HEADING_

LOCK	B	Toggles heading lock.

AUTOPILOT_HEADING_

LOCK_DIR	N	Specifies heading lock direction.

AUTOPILOT_ALTITUDE_

LOCK	B	Toggles altitude lock.

AUTOPILOT_ALTITUDE_

LOCK_VAR	N	Specifies altitude lock altitude in
appropriate units.

AUTOPILOT_ATTITUDE_

HOLD	B	Specifies attitude hold.

AUTOPILOT_GLIDESLOPE_

HOLD	B	Specifies glidescope.

AUTOPILOT_APROACH_

HOLD	B	Specifies approach hold.

AUTOPILOT_

BACKCOURSE_HOLD	B	Specifies backcourse hold.

AUTOPILOT_YAW_DAMPER	B	Specifies yaw damper.

AUTOPILOT_AIRSPEED_

HOLD	B	Specifies airspeed hold.

AUTOPILOT_AIRSPEED_

HOLD_VAR	N	Specifies airspeed hold var.

AUTOPILOT_MACH_HOLD	B	Specifies airspeed hold.

AUTOPILOT_MACH_

HOLD_VAR	N	Specifies airspeed hold var.

AUTOPILOT_VERTICAL_

HOLD	B	Specifies vertical hold.

AUTOPILOT_VERTICAL_

HOLD_VAR	N	Specifies vertical speed hold var, in
appropriate units.

AUTOPILOT_ALTITUDE_

MANUALLY_TUNABLE	B

AUTOPILOT_HEADING_

MANUALLY_TUNABLE	B

AUTOPILOT_AUTO_

THROTTLE_ARM	B

AUTOPILOT_TAKEOFF_

POWER_ACTIVE	B

ENGINE_RPM_HOLD	B

ENGINE_CONTROL_SELECT	F	Specifies which engine will be
controlled.

ENGINE1	P

ENGINE1_THROTTLE_

LEVER_POS	N	Specifies throttle position (16k=100
percent throttle position).

ENGINE1_PROPELLER_

LEVER_POS	N	Specifies propeller lever position (16k=
100 percent propeller setting).

ENGINE1_MIXTURE_

LEVER_POS	N	Specifies mixture position (16k=100
percent mixture position).

ENGINE1_COMBUSTION	B	Specifies combustion flag
(combustion=TRUE).

ENGINE1_STARTER_

SWITCH_POS	E	Specifies starter switch position.

ENGINE1_MAGNETO_LEFT	B	Specifies left magneto status
(activated=1).

ENGINE1_MAGNETO_RIGHT	B	Specifies right magneto status
(activated=1).

ENGINE1_N1_RPM	N	Specifies gas producer (RPM) (16k=100
percent RPM).

ENGINE1_N2_RPM	N	Specifies power (RPM) (16k=100 percent
RPM).

ENGINE1_FF_GPH	N

ENGINE1_FF_PPH	N	Specifies fuel flow (PPH).

ENGINE1_FF_PPH_SSL	N	Specifies fuel flow (PPH) (16k=100
percent, standard sea level conditions).

ENGINE1_TORQUE	N	Specifies torque produced
(per foot pound).

ENGINE1_ANTI_ICE_

SWITCH	B	Anti-ice switch.

ENGINE1_PRESSURE_

RATIO	N	Specifies engine pressure ratio (65k=6.4).

ENGINE1_PRESSURE_

BUG_POS	N	EPR-governed engine setting
(16k=100 percent EPR setting).

ENGINE1_EGT`	N	Specifies exhaust gas temperature
(degrees Celsius) (16k=860ºC).

ENGINE1_EGT_

BUG_POS	N	Specifies EGT-governed engine setting
(16k=100 percent EGT setting).

ENGINE1_CHT	N	Specifies cylinder head temperature.

ENGINE1_OIL_

TEMPERATURE	N	Specifies oil temperature (degrees
Celsius) (16k=140ºC).

ENGINE1_OIL_PRESSURE	N	Specifies oil pressure (psi) (16k=55 psi).

ENGINE1_OIL_QUANTITY	N	Specifies oil quantity (16k=100 percent).

ENGINE1_HYDRAULIC_

PRESSURE	N	Specifies hydraulic pressure (psi)
(16k=4 psi).

ENGINE1_HYDRAULIC_

QUANTITY	N	Specifies hydraulic quantity (16k=
100 percent).

ENGINE1_MANIFOLD_

PRESSURE	N	Specifies manifold pressure (65k=64).

ENGINE1_ENGINE_

VIBRATION	N	Specifies oil quantity (16k=5).

ENGINE1_RPM_SCALER	N	*16384 gives actual prop rpm in dx
(= 65535 for jets).

ENGINE1_TURBINE_

TEMPERATURE	N	Specifies the turbine temperature
(degrees Celsius * 16384).

ENGINE1_TORQUE_

PERCENT	N	Specifies the percentage of engine torque
(foot pounds * 16384).

ENGINE1_FUEL_

PRESSURE	N	Specifies the engine fuel pressure
(psi*16384).

ENGINE1_ELECTRICAL_

LOAD	N	Specifies (Max load * 16384).

ENGINE1_TRANSMISSION_

PRESSURE	N	Specifies engine transmission pressure
(psi * 16384).

ENGINE1_TRANSMISSION_

TEMPERATURE	N	Specifies transmission temperature
(degrees Celsius * 16384).

ENGINE1_ROTOR_RPM	N	(Max * 16384).

ENGINE2	P

ENGINE2_THROTTLE_

LEVER_POS	N	Specifies throttle position (0-16384=
>0-100 percent throttle position).

ENGINE2_PROPELLER_

LEVER_POS	N	Specifies propeller lever position
(0-16384=>0-100 percent propeller
setting).

ENGINE2_MIXTURE_

LEVER_POS	N	Specifies engine mixture position
(0-16384=>0-100 percent mixture
position).

ENGINE2_COMBUSTION	B	Specifies combustion flag
(combustion=TRUE).

ENGINE2_STARTER_

SWITCH_POS	E	Specifies starter switch position.

ENGINE2_MAGNETO_LEFT	B	Specifies Left magneto status
(activated=1).

ENGINE2_MAGNETO_RIGHT	B	Right magneto status (activated=1).

ENGINE2_N1_RPM	N	Specifies gas producer RPM
(0-16384=>0-100 percent RPM).

ENGINE2_N2_RPM	N	Specifies power RPM
(0-16384=>0-100 percent RPM).

ENGINE2_FF_GPH	N

ENGINE2_FF_PPH	N	Specifies pph.

ENGINE2_FF_PPH_SSL	N	Specifies fuel flow (0-16384=>0-
100 percent) PPH, standard sea level
conditions.

ENGINE2_TORQUE	N	Specifies torque produced (FT*LBS).

ENGINE2_ANTI_ICE_

SWITCH	B	Specifies anti-ice switch.

ENGINE2_PRESSURE_

RATIO	N	Specifies engine pressure ratio
(0-65536=>0-6.4).

ENGINE2_PRESSURE_

BUG_POS	N	Specifies EPR-governed engine setting
(0-16384=>0-100 percent EPR setting).

ENGINE2_EGT	N	Specifies exhaust gas temperature
(degrees Celsius).

ENGINE2_EGT_BUG_POS	N	EGT governed engine setting
(0-16384=>0-100 percent EGT setting).

ENGINE2_CHT	N	Specifies cylinder head temperature.

ENGINE2_OIL_

TEMPERATURE	N	Specifies oil temperature (degrees
Celsius).

ENGINE2_OIL_PRESSURE	N	Specifies oil pressure (psi).

ENGINE2_OIL_QUANTITY	N	Specifies oil quantity
(0-16384 => 0-100 percent).

ENGINE2_HYDRAULIC_

PRESSURE	N	Specifies hydraulic pressure
(0-16384 => 0-4 psi).

ENGINE2_HYDRAULIC_

QUANTITY	N	Specifies hydraulic quantity (0-16384 =>
0-100 percent).

ENGINE2_MANIFOLD_

PRESSURE	N	Specifies manifold pressure (0-65536=>
0-64).

ENGINE2_ENGINE_

VIBRATION	N	Specifies oil quantity (0-16384 => 0-5).

ENGINE2_RPM_SCALER	N	*16384 gives actual prop rpm in dx
(= 65535 for jets).

ENGINE2_TURBINE_

TEMPERATURE	N	(Degrees Celsius*16384).

ENGINE2_TORQUE_

PERCENT	N	(Foot pounds * 16384).

ENGINE2_FUEL_PRESSURE	N	(psi * 16384)

ENGINE2_ELECTRICAL_

LOAD	N	(Max load * 16384)

ENGINE2_TRANSMISSION_

PRESSURE	N	(psi * 16384)

ENGINE2_TRANSMISSION_

TEMPERATURE	N	(Degrees Celsius*16384)

ENGINE2_ROTOR_RPM	N	(Max * 16384).

ENGINE3	P	Specifies throttle position (0-16384=
>0-100 percent throttle position).

ENGINE3_THROTTLE_

LEVER_POS	N

ENGINE3_PROPELLER_

LEVER_POS	N	Specifies propeller lever position
(0-16384=>0-100 percent prop setting).

ENGINE3_MIXTURE_

LEVER_POS	N	Specifies mixture position (0-16384=>
0-100 percent mixture position).

ENGINE3_COMBUSTION	B	Specifies combustion flag
(combustion = TRUE).

ENGINE3_STARTER_

SWITCH_POS	E	Specifies starter switch position.

ENGINE3_MAGNETO_LEFT	B	Specifies left magneto status (activated=
1).

ENGINE3_MAGNETO_RIGHT	B	Specifies right magneto status (activated=
1).

ENGINE3_N1_RPM	N	Specifies gas producer RPM
(0-16384=>0-100 percent RPM).

ENGINE3_N2_RPM	N	Power RPM (0-16384=>0-100
percent RPM).

ENGINE3_FF_GPH	N	Specifies fuel flow pph.

ENGINE3_FF_PPH_SSL	N	Specifies fuel flow (0-16384=>
0-100 percent) PPH, standard sea level
conditions.

ENGINE3_TORQUE	N	Specifies torque produced
(FT*LBS).

ENGINE3_ANTI_ICE_SWITCH	B	Specifies anti-ice switch.

ENGINE3_PRESSURE_

RATIO	N	Specifies engine pressure ratio
(0-65536=>0-6.4).

ENGINE3_PRESSURE_

BUG_POS	N	Specifies EPR-governed engine setting
(0-16384=>0-100 percent EPR setting).

ENGINE3_EGT	N	Specifies exhaust gas temperature
(degrees Celsius).

ENGINE3_EGT_BUG_POS	N	EGT-governed engine setting
(0-16384=>0-100 percent EGT setting).

ENGINE3_CHT	N	Specifies cylinder head temperature.

ENGINE3_OIL_

TEMPERATURE	N	Specifies oil temperature
(degrees Celsius).

ENGINE3_OIL_PRESSURE	N	Specifies oil pressure (psi).

ENGINE3_OIL_QUANTITY	N	Specifies oil quantity (0-16384 =
> 0-100 percent).

ENGINE3_HYDRAULIC_

PRESSURE	N	Specifies hydraulic pressure (0-16384 =
> 0-4 psi).

ENGINE3_HYDRAULIC_

QUANTITY	N	Specifies hydraulic quantity (0-16384 =
> 0-100 percent).

ENGINE3_MANIFOLD_

PRESSURE	N	Specifies manifold pressure
(0-65536=>0-64).

ENGINE3_ENGINE_

VIBRATION	N	Specifies oil quantity (0-16384 => 0-5).

ENGINE3_RPM_SCALER	N	*16384 gives actual propeller rpm in
dx (= 65535 for jets).

ENGINE3_TURBINE_

TEMPERATURE	N	(Degrees Celsius * 16384).

ENGINE3_TORQUE_

PERCENT	N	(Ft/lbs * 16384).

ENGINE3_FUEL_PRESSURE	N	(psi * 16384).

ENGINE3_ELECTRICAL_

LOAD	N	(Max load * 16384).

ENGINE3_TRANSMISSION_

PRESSURE	N	(psi * 16384).

ENGINE3_TRANSMISSION_

TEMPERATURE	N	(Degrees Celsius * 16384).

ENGINE3_ROTOR_RPM	N	(Max * 16384).

ENGINE4	P

ENGINE4_THROTTLE_

LEVER_POS	N	Throttle position (0-16384=>
0-100 percent throttle position).

ENGINE4_PROPELLER_

LEVER_POS	N	Specifies propeller lever position
(0-16384=>0-100 percent propeller
setting).

ENGINE4_MIXTURE_

LEVER_POS	N	Specifies mixture position (0-16384=
>0-100 percent mixture position).

ENGINE4_COMBUSTION	B	Specifies combustion flag
(combustion = TRUE).

ENGINE4_STARTER_

SWITCH_POS	E	Specifies starter switch position.

ENGINE4_MAGNETO_LEFT	B	Specifies left magneto status
(activated = 1).

ENGINE4_MAGNETO_RIGHT	B	Specifies right magneto status
(activated = 1).

ENGINE4_N1_RPM	N	Specifies gas producer RPM
(0-16384=>0-100 percent RPM).

ENGINE4_N2_RPM	N	Specifies power RPM (0-16384=>
0-100 percent RPM).

ENGINE4_FF_GPH	N

ENGINE4_FF_PPH	N	Specifies fuel flow PPH.

ENGINE4_FF_PPH_SSL	N	Fuel flow (0-16384=>0-100 percent PPH,
standard sea level conditions).

ENGINE4_TORQUE	N	Specifies torque produced (FT*LBS).

ENGINE4_ANTI_ICE_

SWITCH	B	Specifies anti-ice switch.

ENGINE4_PRESSURE_

RATIO	N	Specifies engine pressure ratio
(0-65536=>0-6.4).

ENGINE4_PRESSURE_

BUG_POS	N	EPR-governed engine setting
(0-16384=>0-100 percent EPR setting).

ENGINE4_EGT	N	Exhaust gas temperature
(degrees Celsius).

ENGINE4_EGT_BUG_POS	N	EGT-governed engine setting
(0-16384=>0-100 percent EGT setting).

ENGINE4_CHT	N	Specifies cylinder head temperature.

ENGINE4_OIL_

TEMPERATURE	N	Specifies oil temperature
(degrees Celsius).

ENGINE4_OIL_PRESSURE	N	Specifies oil pressure (psi).

ENGINE4_OIL_QUANTITY	N	Specifies oil quantity
(0-16384 => 0-100 percent).

ENGINE4_HYDRAULIC_

PRESSURE	N	Specifies hydraulic pressure (0-16384 =
> 0-4 psi).

ENGINE4_HYDRAULIC_

QUANTITY	N	Specifies hydraulic quantity (0-16384 =
> 0-100 percent).

ENGINE4_MANIFOLD_

PRESSURE	N	Specifies manifold pressure (0-65536=
>0-64).

ENGINE4_ENGINE_

VIBRATION	N	Specifies oil quantity (0-16384 => 0-5).

ENGINE4_RPM_SCALER	N	*16384 gives actual propeller rpm in dx
(= 65535 for jets).

ENGINE4_TURBINE_

TEMPERATURE	N	(Degrees Celsius * 16384).

ENGINE4_TORQUE_

PERCENT	N	(Ft/lbs * 16384).

ENGINE4_FUEL_

PRESSURE	N	(Psi * 16384).

ENGINE4_ELECTRICAL_

LOAD	N	(Max load * 16384).

ENGINE4_TRANSMISSION_

PRESSURE	N	(Psi * 16384).

ENGINE4_TRANSMISSION_

TEMPERATURE	N	(Degrees Celsius * 16384).

ENGINE4_ROTOR_RPM	N	(Max * 16384).

NUMBER_OF_ENGINES	N	1=single 2=twin.

PROP_ADVANCE_

SELECTION	E	0=fixed 1=optimal 2=manual.

THROTTLE_LOWER_LIMIT	N	Set by Flight Simulator 98 for
thrust reversers.

OIL_QUANTITY_TOTAL	N	0..7fff (8 qt.).

SYSTEMS_AVAILABLE	N

INSTRUMENTS_AVAILABLE	N

PP_ADF	E	Specifies partial panel variables.

PP_AIR	E

PP_ALTIM	E

PP_ATTITUDE	E

PP_COM	E

PP_COMPASS	E

PP_ELECT	E

PP_ENGINE	E

PP_FUEL_IND	E

PP_HEADING	E

PP_VERT_VEL	E

PP_XPNDR	E

PP_NAV	E

PP_PITOT	E

PP_TURN_COORD	E

PP_VACUUM	E

FUEL_TANK_CENTER_

LEVEL	N

FUEL_TANK_CENTER_

CAPACITY	N

FUEL_TANK_LEFT_MAIN_

LEVEL	N

FUEL_TANK_LEFT_MAIN_

CAPACITY	N

FUEL_TANK_LEFT_AUX_

LEVEL	N

FUEL_TANK_LEFT_AUX_

CAPACITY	N

FUEL_TANK_LEFT_TIP_

LEVEL	N

FUEL_TANK_LEFT_TIP_

CAPACITY	N

FUEL_TANK_RIGHT_MAIN_

LEVEL	N

FUEL_TANK_RIGHT_MAIN_

CAPACITY	N

FUEL_TANK_RIGHT_

AUX_LEVEL	N

FUEL_TANK_RIGHT_AUX_

CAPACITY	N

FUEL_TANK_RIGHT_

TIP_LEVEL	N

FUEL_TANK_RIGHT_TIP_

CAPACITY	N

FUEL_QUANTITY_RIGHT	N	Specifies total gallons of fuel, right engine.

FUEL_QUANTITY_LEFT	N	Specifies total gallons of fuel, left engine.

FUEL_QUANTITY_CENTER	N	Specifies total gallons of fuel, center
engine.

FUEL_WEGHT_PER_

GALLON	N	Specifies weight of fuel, in pounds I.F.
(6 lbs/gal = 1536).

FUEL_TANK_SELECTOR	E	See FUEL_TANK_SELECTOR_ enum
values.

CROSS_FEED_SELECTOR	E	Settings are OFF, LEFT_TO_RIGHT,
or RIGHT_TO_LEFT.

YOKE_POS_Y	N	Yoke Y position -16k=yoke
pushed full in.

YOKE_IND_Y	N	Yoke Y position -16k=yoke
pushed full in.

YOKE_POS_X	N	Aileron -16k=yoke turned full left.

YOKE_IND_X	N	Aileron -16k=yoke turned full left.

AILERON_POS	N	Aileron Position -16k=full left.

RUDDER_PEDAL_POS	N	Rudder pedals -16k=left pedal pushed
full in.

RUDDER_PEDAL_IND	N	Rudder -16k=left pedal pushed full in.

RUDDER_POS	N	Rudder Position -16k=full left.

ELEVATOR_POS	N	Elevator position -16k=down full.

ELEVATOR_TRIM_POS	N	Elevator trim position -16k=full nose down.

ELEVATOR_TRIM_IND	N	Elevator trim position -16k=full nose down

BRAKES_LEFT_POS	N	0=off; 32k=full brakes.

BRAKES_RIGHT_POS	N	0=off; 32k=full brakes.

BRAKE_IND	N	0=off; 16k=full brakes.

PARKING_BRAKE_POS	N	0=off; 32k=full parking brakes.

SPOILERS_ARMED	B

SPOILERS_HANDLE_POS	N

SPOILERS_POS_LEFT	N

SPOILERS_POS_RIGHT	N

FLAPS_HANDLE_POS	N

FLAPS_POS_LEFT	N

FLAPS_POS_RIGHT	N

GEAR_HANDLE_POS	N

GEAR_POS_NOSE	N

GEAR_POS_LEFT	N

GEAR_POS_RIGHT	N

DISPLAY_UNITS	N	English vs. metric system.

SIM_SPEED	N	Specifies time dilation factor for Flight
Simulator 98 equations.

ZOOM_FACTOR	N	Specifies zoom value of current window in
real units.

REALISM_SENSE	N

REALISM_SYSTEMS	N

RELIABILITY_SENSE	N	0 = unreliable - 100 = totally reliable

AMBIENT_TEMP_

DEGREES_C	N	15º Celsius = 59º degrees F
(1/256 degrees Celsius = 1 unit).

AMBIENT_PRES_MBAR	N	1013.2 mb = 29.92 in Hg (1/16 mb =
1 unit).

AMBIENT_WIND_VEL	N	Specifies current wind velocity (knots).

AMBIENT_WIND_DIR	N	Specifies current wind direction.

AMBIENT_WINDE	N	Specifies east wind component i.f m/sec
units.

AMBIENT_WINDN	N	Specifies north wind component i.f m/sec
units.

AMBIENT_WINDA	N	Specifies alt wind component i.f m/sec
units.

BAROMETRIC_PRESSURE	N	Specifies barometric pressure
experienced.

ANGLE_OF_ATTACK_

INDICATOR	N

TOTAL_AIR_TEMP	N

G_FORCE	N

CHARGING_AMPS	N	Charging system amps - 1 amp=65535.

SUCTION_PRESSURE	N	In hg.

MARKER_BEACON_STATE	N	Specifies beacon; 0=no beacon, 1=outer,
2=middle, 3=inner.

CURRENT_DME	E

 Related Topics


Color Mapping Table

Panel images are mapped to the RGB colors mapped in the following tables plus the 32 panel-specific colors listed in the [8 bit colors] section of the panel configuration file. For information on panel-specific colors see the topic, Panel Configuration File.

The following table includes the RGB values for dimmed colors.

Red	Green	Blue

16	16	16

24	24	24

32	32	32

40	40	40

48	48	48

56	56	56

65	65	65

73	73	73

81	81	81

89	89	89

97	97	97

105	105	105

113	113	113

121	121	121

130	130	130

138	138	138

146	146	146

154	154	154

162	162	162

170	170	170

178	178	178

186	186	186

195	195	195

203	203	203

211	211	211

219	219	219

227	227	227

235	235	235

247	247	247

255	255	255

21	5	5

42	10	10

63	15	15

84	20	20

105	25	25

126	30	30

147	35	35

168	40	40

189	45	45

210	50	50

231	55	55

252	60	60

5	21	5

10	42	10

15	63	15

20	84	20

25	105	25

30	126	30

35	147	35

40	168	40

45	189	45

50	210	50

55	231	55

60	252	60

0	7	23

0	15	40

0	23	58

0	40	84

0	64	104

0	71	122

0	87	143

0	99	156

0	112	179

0	128	199

0	143	215

0	153	230

28	14	0

56	28	0

84	42	0

112	56	0

140	70	0

168	84	0

196	98	0

224	112	0

252	126	0

28	28	0

56	56	0

84	84	0

112	112	0

140	140	0

168	168	0

196	196	0

224	224	0

252	252	0

25	21	16

50	42	32

75	63	48

100	84	64

125	105	80

150	126	96

175	147	112

200	168	128

229	189	144

28	11	7

56	22	14

84	33	21

112	44	28

140	55	35

168	66	42

196	77	49

140	55	35

168	66	42

196	77	41

224	88	56

252	99	63

17	22	9

34	44	18

51	66	27

68	88	36

85	110	45

102	132	54

102	132	54

119	154	63

136	176	72

153	198	81

0	58	104

0	87	112

43	112	128

When the image flag IMAGE_USE_BRIGHT flag is used when creating a drawing element, the image's colors are mapped to the RGB values included in the following table.

Red	Green	Blue

128	0	0

0	128	0

128	128	0

0	0	128

128	0	128

0	128	128

192	192	192

0	0	0

255	0	0

64	255	64

0	0	192

0	105	105

255	128	0

255	255	0

81	81	81

121	121	121

146	146	146

170	170	170

195	195	195

227	227	227

128	128	128

255	0	0

0	255	0

255	255	0

0	0	255

255	0	255

0	255	255

255	255	255

 Related Topics