5 UINT instr_item :: instances = 0; // Initial value of zero
6 int instr_item :: brightness = BRT_MEDIUM;
7 glRGBTRIPLE instr_item :: color = {0.1, 0.7, 0.0};
9 // constructor ( No default provided )
19 handle ( ++instances ),
20 load_value_fn ( data_source ),
21 disp_factor ( data_scaling ),
23 is_enabled ( working ),
28 scrn_pos.right = width;
29 scrn_pos.bottom = height;
31 // Set up convenience values for centroid of the box and
32 // the span values according to orientation
34 if( opts & HUDS_VERT) { // Vertical style
35 // Insure that the midpoint marker will fall exactly at the
37 if( !(scrn_pos.bottom % 2)) {
40 scr_span = scrn_pos.bottom;
43 // Insure that the midpoint marker will fall exactly at the
45 if( !(scrn_pos.right % 2)) {
48 scr_span = scrn_pos.right;
50 // Here we work out the centroid for the corrected box.
51 mid_span.x = scrn_pos.left + (scrn_pos.right >> 1);
52 mid_span.y = scrn_pos.top + (scrn_pos.bottom >> 1);
58 instr_item ( const instr_item & image ):
59 handle ( ++instances ),
60 scrn_pos ( image.scrn_pos ),
61 load_value_fn( image.load_value_fn),
62 disp_factor ( image.disp_factor ),
64 is_enabled ( image.is_enabled ),
65 broken ( image.broken ),
66 scr_span ( image.scr_span ),
67 mid_span ( image.mid_span )
71 // assignment operator
73 instr_item & instr_item :: operator = ( const instr_item & rhs )
75 if( !(this == &rhs )) { // Not an identity assignment
76 scrn_pos = rhs.scrn_pos;
77 load_value_fn = rhs.load_value_fn;
78 disp_factor = rhs.disp_factor;
80 is_enabled = rhs.is_enabled;
88 instr_item :: ~instr_item ()
100 // break_display This is emplaced to provide hooks for making
101 // instruments unreliable. The default behavior is
102 // to simply not display, but more sophisticated behavior is available
103 // by over riding the function which is virtual in this class.
106 break_display ( bool bad )
113 SetBrightness ( int level )
115 brightness = level; // This is all we will do for now. Later the
116 // brightness levels will be sensitive both to
117 // the control knob and the outside light levels
118 // to emulated night vision effects.
121 UINT instr_item :: get_Handle( void )