]> git.mxchange.org Git - flightgear.git/commitdiff
Added CHT (cylinder head temp) to BFI and property manager.
authorcurt <curt>
Fri, 27 Oct 2000 22:00:43 +0000 (22:00 +0000)
committercurt <curt>
Fri, 27 Oct 2000 22:00:43 +0000 (22:00 +0000)
src/FDM/LaRCsim.cxx
src/FDM/flight.hxx
src/Main/bfi.cxx
src/Main/bfi.hxx
src/Main/fg_init.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Main/viewmgr.hxx

index e3134d337517577be630ace1b1da2ced72a54e49..8423e5283b0953e3b639f5a9415a57a992aa64c7 100644 (file)
@@ -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
index 0e333d2afef293543536959639e547d9f4fb6f2e..e49008f48a84244d32c4316fad612abe3c91b747 100644 (file)
@@ -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; }
 
 };
index e4fb0fb5e3d5ff08ec79f0d8aae6749c05855b9c..59a5e68e80a0a7042a6483051402dcf65d178d1b 100644 (file)
@@ -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();
+  }
+}
+
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // Velocities
index 6c086f6763cccd8fda08a521dd017d23121a2c23..877af44d92895c905a01e5b2eda962c44b6bacb7 100644 (file)
@@ -94,6 +94,7 @@ public:
   static double getRPM ();
   static void setRPM ( double rpm );
   static double getEGT ();
+  static double getCHT ();
 
                                // Velocities
   static double getAirspeed ();
index 408baf805ab8d281385ff82b7f42996eb9f481e2..23e82f52dcee334c7e44b7b2baaaee4c986038a9 100644 (file)
@@ -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());
 
index e28854cc8aacba9e4d46d8b0728b54f132ead8ce..d5bbf920aff22ae1cfa29cf3ccc0ccece60bcac6 100644 (file)
@@ -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;
index 658ee8f74f0536dd10ae63fbc940f2063c86bf5a..945e75fb63f09d5341b074f8aa98e764145a9efb 100644 (file)
@@ -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)
index 08be5aebf33ad460c5b0d43226cd0f10638ed553..80928abf0debb025583203b98943532526346b80 100644 (file)
@@ -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; }