Added CHT (cylinder head temp) to BFI and property manager.
This commit is contained in:
parent
b5b0ba5eba
commit
b83ad15313
8 changed files with 60 additions and 2 deletions
|
@ -134,6 +134,7 @@ bool FGLaRCsim::update( int multiloop ) {
|
|||
e->set_MaxHP( eng.get_MaxHP() );
|
||||
e->set_Percentage_Power( eng.get_Percentage_Power() );
|
||||
e->set_EGT( eng.get_EGT() );
|
||||
e->set_CHT( eng.get_CHT() );
|
||||
e->set_prop_thrust( eng.get_prop_thrust_SI() );
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -112,6 +112,7 @@ private:
|
|||
double MaxHP;
|
||||
double Percentage_Power;
|
||||
double EGT;
|
||||
double CHT;
|
||||
double prop_thrust;
|
||||
|
||||
/* others...
|
||||
|
@ -137,6 +138,7 @@ public:
|
|||
inline double get_MaxHP() const { return MaxHP; }
|
||||
inline double get_Percentage_Power() const { return Percentage_Power; }
|
||||
inline double get_EGT() const { return EGT; }
|
||||
inline double get_CHT() const { return CHT; }
|
||||
inline double get_prop_thrust() const { return prop_thrust; }
|
||||
|
||||
inline void set_Throttle( double t ) { Throttle = t; }
|
||||
|
@ -147,6 +149,7 @@ public:
|
|||
inline void set_MaxHP( double hp ) { MaxHP = hp; }
|
||||
inline void set_Percentage_Power( double p ) { Percentage_Power = p; }
|
||||
inline void set_EGT( double e ) { EGT = e; }
|
||||
inline void set_CHT( double c ) { CHT = c; }
|
||||
inline void set_prop_thrust( double t ) { prop_thrust = t; }
|
||||
|
||||
};
|
||||
|
|
|
@ -130,6 +130,8 @@ FGBFI::init ()
|
|||
getRPM, 0);
|
||||
current_properties.tieDouble("/engines/engine0/egt",
|
||||
getEGT, 0);
|
||||
current_properties.tieDouble("/engines/engine0/cht",
|
||||
getCHT, 0);
|
||||
|
||||
// Velocities
|
||||
current_properties.tieDouble("/velocities/airspeed",
|
||||
|
@ -713,6 +715,18 @@ FGBFI::getEGT ()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the current engine0 CHT.
|
||||
*/
|
||||
double
|
||||
FGBFI::getCHT ()
|
||||
{
|
||||
if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
|
||||
return current_aircraft.fdm_state->get_engine(0)->get_CHT();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Velocities
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
static double getRPM ();
|
||||
static void setRPM ( double rpm );
|
||||
static double getEGT ();
|
||||
static double getCHT ();
|
||||
|
||||
// Velocities
|
||||
static double getAirspeed ();
|
||||
|
|
|
@ -583,6 +583,9 @@ bool fgInitSubsystems( void ) {
|
|||
cur_fdm_state->get_Theta(),
|
||||
cur_fdm_state->get_Psi() );
|
||||
|
||||
// set current view to 0 (first) which is our main pilot view
|
||||
globals->set_current_view( pilot_view );
|
||||
|
||||
FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = "
|
||||
<< globals->get_current_view()->get_abs_view_pos());
|
||||
|
||||
|
@ -815,6 +818,9 @@ void fgReInitSubsystems( void )
|
|||
cur_fdm_state->get_Theta(),
|
||||
cur_fdm_state->get_Psi() );
|
||||
|
||||
// set current view to 0 (first) which is our main pilot view
|
||||
globals->set_current_view( pilot_view );
|
||||
|
||||
FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = "
|
||||
<< globals->get_current_view()->get_abs_view_pos());
|
||||
|
||||
|
|
|
@ -418,7 +418,9 @@ void GLUTkey(unsigned char k, int x, int y) {
|
|||
fgUpdateSkyAndLightingParams();
|
||||
return;
|
||||
case 118: // v key
|
||||
// globals->get_options()->cycle_view_mode();
|
||||
globals->set_current_view( globals->get_viewmgr()->next_view() );
|
||||
#if 0
|
||||
// globals->get_options()->cycle_view_mode();
|
||||
if ( globals->get_options()->get_view_mode() ==
|
||||
FGOptions::FG_VIEW_FOLLOW )
|
||||
{
|
||||
|
@ -433,6 +435,7 @@ void GLUTkey(unsigned char k, int x, int y) {
|
|||
v->set_view_offset( FG_PI * 1.75 );
|
||||
globals->get_current_view()->set_pilot_offset(25.0, -25.0, 1.0);
|
||||
}
|
||||
#endif
|
||||
fgReshape( globals->get_options()->get_xsize(),
|
||||
globals->get_options()->get_ysize() );
|
||||
return;
|
||||
|
|
|
@ -336,6 +336,28 @@ void fgRenderFrame( void ) {
|
|||
cur_fdm_state->get_Theta(),
|
||||
cur_fdm_state->get_Psi() );
|
||||
|
||||
FGViewerLookAt *chase_view =
|
||||
(FGViewerLookAt *)globals->get_viewmgr()->get_view( 1 );
|
||||
|
||||
sgVec3 po; // chase view pilot_offset
|
||||
sgVec3 wup; // chase view world up
|
||||
sgCopyVec3( po, chase_view->get_pilot_offset() );
|
||||
sgCopyVec3( wup, chase_view->get_world_up() );
|
||||
sgMat4 CXFM; // chase view + pilot offset xform
|
||||
sgMakeRotMat4( CXFM, cur_fdm_state->get_Psi() * RAD_TO_DEG, wup );
|
||||
sgVec3 npo; // new pilot offset after rotation
|
||||
sgXformVec3( npo, po, CXFM );
|
||||
|
||||
chase_view->set_geod_view_pos( cur_fdm_state->get_Longitude(),
|
||||
cur_fdm_state->get_Lat_geocentric(),
|
||||
cur_fdm_state->get_Altitude() *
|
||||
FEET_TO_METER );
|
||||
chase_view->set_pilot_offset( npo[0], npo[1], npo[2] );
|
||||
sgVec3 negpo;
|
||||
sgNegateVec3( negpo, npo );
|
||||
chase_view->set_view_forward( negpo );
|
||||
chase_view->set_view_up( wup );
|
||||
|
||||
#if 0
|
||||
// this is a test, we are trying to match RPH and LookAt
|
||||
// matrices
|
||||
|
@ -1347,7 +1369,12 @@ int main( int argc, char **argv ) {
|
|||
|
||||
FGViewerRPH *pv = new FGViewerRPH;
|
||||
globals->get_viewmgr()->add_view( pv );
|
||||
globals->set_current_view( pv );
|
||||
|
||||
FGViewerLookAt *chase = new FGViewerLookAt;
|
||||
globals->get_viewmgr()->add_view( chase );
|
||||
|
||||
// set current view to 0 (first) which is our main pilot view
|
||||
globals->set_current_view( globals->get_viewmgr()->get_view( 0 ) );
|
||||
|
||||
// Scan the config file(s) and command line options to see if
|
||||
// fg_root was specified (ignore all other options for now)
|
||||
|
|
|
@ -64,6 +64,9 @@ public:
|
|||
|
||||
// getters
|
||||
inline int size() const { return views.size(); }
|
||||
inline FGViewer *get_view() {
|
||||
return views[current];
|
||||
}
|
||||
inline FGViewer *get_view( int i ) {
|
||||
if ( i < 0 ) { i = 0; }
|
||||
if ( i >= (int)views.size() ) { i = views.size() - 1; }
|
||||
|
|
Loading…
Add table
Reference in a new issue