]> git.mxchange.org Git - flightgear.git/commitdiff
Panel tweaks to support "shaped" panels.
authorcurt <curt>
Fri, 13 Oct 2000 23:34:54 +0000 (23:34 +0000)
committercurt <curt>
Fri, 13 Oct 2000 23:34:54 +0000 (23:34 +0000)
Additional HUD support for waypoints.
JSBSim updates.

21 files changed:
Makefile.am
docs-mini/README.xmlpanel
src/Autopilot/auto_gui.cxx
src/Autopilot/newauto.cxx
src/Autopilot/newauto.hxx
src/Cockpit/hud.cxx
src/Cockpit/panel.cxx
src/FDM/JSBSim.cxx
src/FDM/JSBSim.hxx
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAircraft.h
src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGAuxiliary.h
src/FDM/JSBSim/FGControls.cpp
src/FDM/JSBSim/FGControls.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGInertial.h
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/FGLGear.cpp
src/Main/options.cxx

index 47574a8021fe5a0b7412692e50fcd08ed1f363f3..72a8c88ddd3c74c816c13a5e49db74c64b6f9ad9 100644 (file)
@@ -20,35 +20,45 @@ dist-hook:
 # make the base distribution with textures, sounds and a bit of
 # scenery, and all the other associated files
 
-fgfs-base: fgfs-base-tar fgfs-base-zip fgfs-base-patch
+fgfs-base: fgfs-base-tar fgfs-base-zip fgfs-base-patch fgfs-textures-high
 
 fgfs-base-tar:
        (cd $(HOME); \
-       tar czvf fgfs-base-$(VERSION)b.tar.gz \
+       tar czvf fgfs-base-$(VERSION).tar.gz \
        FlightGear/A[A-su-z]* \
        FlightGear/[B-CE-R]* \
        FlightGear/Scenery/w120n30/w111n33 \
        FlightGear/Sounds \
-       FlightGear/[T-W]* FlightGear/[c-m]*)
+       FlightGear/Textures \
+       FlightGear/T[A-Za-df-z]* \
+       FlightGear/[U-W]* FlightGear/[c-m]*)
 
 fgfs-base-zip:
        (cd $(HOME); \
-       zip -rv fgfs-base-$(VERSION)b.zip \
+       zip -rv fgfs-base-$(VERSION).zip \
        FlightGear/A[A-su-z]* \
        FlightGear/[B-CE-R]* \
        FlightGear/Scenery/w120n30/w111n33 \
        FlightGear/Sounds \
-       FlightGear/Textures FlightGear/Thanks \
-       FlightGear/[T-W]* FlightGear/[c-z]*)
+       FlightGear/Textures \
+       FlightGear/T[A-Za-df-z]* \
+       FlightGear/[U-W]* FlightGear/[c-z]*)
 
 fgfs-base-patch:
        (cd $(HOME); \
-       tar --newer 9/18/2000 -czvf fgfs-base-patch-$(VERSION)a.tar.gz \
+       tar --newer 9/18/2000 -czvf fgfs-base-patch-$(VERSION)b.tar.gz \
        FlightGear/A[A-su-z]* \
        FlightGear/[B-CE-R]* \
        FlightGear/Scenery/w120n30/w111n33 \
        FlightGear/Sounds \
-       FlightGear/[T-W]* FlightGear/[c-m]*)
+       FlightGear/Textures \
+       FlightGear/T[A-Za-df-z]* \
+       FlightGear/[U-W]* FlightGear/[c-m]*)
+
+fgfs-textures-high:
+       (cd $(HOME); \
+       tar -czvf fgfs-textures-high-$(VERSION)b.tar.gz \
+       FlightGear/Textures.high)
 
 # make the mini JSBsim data distribution
 jsbsim-data:
index 07cc974e76c4f1108cdab6ed28f9e3cc957c76ed..08830190cc1b90022b007891ee4f164289a1e576 100644 (file)
@@ -1,5 +1,5 @@
 Users Guide to FlightGear panel configuration
-Version 0.3, October 5 2000
+Version 0.4, October 11 2000
 Author: John Check <j4strngs@rockfish.net>  
 
 This document is an attempt to describe the configuration of 
@@ -112,6 +112,15 @@ when the user clicks the left or center mouse button.  Actions are
 always tied to properties: they can toggle a boolean property, adjust
 the value of a numeric property, or swap the values of two properties.
 
+About Transformations and Needle Placement:
+
+When describing placement of instrument needles, an transformation offset must 
+be applied to shift the needle's fulcrum or else the needle will rotate around it's 
+middle. The offset will be of <type> x-shift or y-shift depending on the orientation of 
+the needle section in the cropped texture.
+Offsets applied to shift the needle from the center of the instrument face must be 
+applied *before* the transformation that describes the needle movement.
+
 About Textures:
 
 The texture files used to create the panel instruments are maximum 256x256
index 47b17d68cac6adbfc12fc10aa449c843d3ba1060..32a4733d85ca12553918f7bc2cac927b00f6f720 100644 (file)
@@ -590,7 +590,7 @@ void TgtAptDialog_OK (puObject *)
 
     string tmp = s;
     double alt = 0.0;
-    int pos = tmp.find( "," );
+    int pos = tmp.find( "@" );
     if ( pos != string::npos ) {
        TgtAptId = tmp.substr( 0, pos );
        string alt_str = tmp.substr( pos + 1 );
@@ -654,6 +654,18 @@ void AddWayPoint(puObject *cb)
 void PopWayPoint(puObject *cb)
 {
     globals->get_route()->delete_first();
+
+    // see if there are more waypoints on the list
+    if ( globals->get_route()->size() ) {
+       // more waypoints
+       current_autopilot->set_HeadingMode( FGAutopilot::FG_HEADING_WAYPOINT );
+    } else {
+       // end of the line
+       current_autopilot->set_HeadingMode( FGAutopilot::FG_HEADING_LOCK );
+
+       // use current heading
+       current_autopilot->set_TargetHeading( FGBFI::getHeading() );
+    }
 }
 
 void ClearRoute(puObject *cb)
index 1630837fe4f8c3d19be7a8dc4b4f249daa0f8ec0..33a7421df68c208cfd2b149e9cdfe9f2d437e0df 100644 (file)
@@ -107,25 +107,80 @@ static inline double get_ground_speed() {
 }
 
 
-void FGAutopilot::MakeTargetDistanceStr( double distance ) {
-    double eta = distance*METER_TO_NM / get_ground_speed();
-    if ( eta >= 100.0 ) { eta = 99.999; }
-    int major, minor;
-    if ( eta < (1.0/6.0) ) {
-       // within 10 minutes, bump up to min/secs
-       eta *= 60.0;
+void FGAutopilot::MakeTargetWPStr( double distance ) {
+    double accum = 0.0;
+
+    int size = globals->get_route()->size();
+
+    // start by wiping the strings
+    TargetWP1Str[0] = 0;
+    TargetWP2Str[0] = 0;
+    TargetWP3Str[0] = 0;
+
+    // current route
+    if ( size > 0 ) {
+       SGWayPoint wp1 = globals->get_route()->get_waypoint( 0 );
+       accum += distance;
+       double eta = accum * METER_TO_NM / get_ground_speed();
+       if ( eta >= 100.0 ) { eta = 99.999; }
+       int major, minor;
+       if ( eta < (1.0/6.0) ) {
+           // within 10 minutes, bump up to min/secs
+           eta *= 60.0;
+       }
+       major = (int)eta;
+       minor = (int)((eta - (int)eta) * 60.0);
+       sprintf( TargetWP1Str, "%s %.2f NM  ETA %d:%02d",
+                wp1.get_id().c_str(),
+                accum*METER_TO_NM, major, minor );
+       // cout << "distance = " << distance*METER_TO_NM
+       //      << "  gndsp = " << get_ground_speed() 
+       //      << "  time = " << eta
+       //      << "  major = " << major
+       //      << "  minor = " << minor
+       //      << endl;
+    }
+
+    // next route
+    if ( size > 1 ) {
+       SGWayPoint wp2 = globals->get_route()->get_waypoint( 1 );
+       accum += wp2.get_distance();
+       
+       double eta = accum * METER_TO_NM / get_ground_speed();
+       if ( eta >= 100.0 ) { eta = 99.999; }
+       int major, minor;
+       if ( eta < (1.0/6.0) ) {
+           // within 10 minutes, bump up to min/secs
+           eta *= 60.0;
+       }
+       major = (int)eta;
+       minor = (int)((eta - (int)eta) * 60.0);
+       sprintf( TargetWP2Str, "%s %.2f NM  ETA %d:%02d",
+                wp2.get_id().c_str(),
+                accum*METER_TO_NM, major, minor );
+    }
+
+    // next route
+    if ( size > 2 ) {
+       for ( int i = 2; i < size; ++i ) {
+           accum += globals->get_route()->get_waypoint( i ).get_distance();
+       }
+       
+       SGWayPoint wpn = globals->get_route()->get_waypoint( size - 1 );
+
+       double eta = accum * METER_TO_NM / get_ground_speed();
+       if ( eta >= 100.0 ) { eta = 99.999; }
+       int major, minor;
+       if ( eta < (1.0/6.0) ) {
+           // within 10 minutes, bump up to min/secs
+           eta *= 60.0;
+       }
+       major = (int)eta;
+       minor = (int)((eta - (int)eta) * 60.0);
+       sprintf( TargetWP3Str, "%s %.2f NM  ETA %d:%02d",
+                wpn.get_id().c_str(),
+                accum*METER_TO_NM, major, minor );
     }
-    major = (int)eta;
-    minor = (int)((eta - (int)eta) * 60.0);
-    sprintf( TargetDistanceStr, "%s %.2f NM  ETA %d:%02d",
-            waypoint.get_id().c_str(),
-            distance*METER_TO_NM, major, minor );
-    // cout << "distance = " << distance*METER_TO_NM
-    //      << "  gndsp = " << get_ground_speed() 
-    //      << "  time = " << eta
-    //      << "  major = " << major
-    //      << "  minor = " << minor
-    //      << endl;
 }
 
 
@@ -217,7 +272,7 @@ void FGAutopilot::reset() {
        
     // TargetLatitude = FGBFI::getLatitude();
     // TargetLongitude = FGBFI::getLongitude();
-    // s<et_WayPoint( FGBFI::getLongitude(), FGBFI::getLatitude(), 0.0, "reset" );
+    // set_WayPoint( FGBFI::getLongitude(), FGBFI::getLatitude(), 0.0, "reset" );
 
     MakeTargetLatLonStr( get_TargetLatitude(), get_TargetLongitude() );
 }
@@ -355,8 +410,9 @@ int FGAutopilot::run() {
 
            // compute course to way_point
            // need to test for iter
-           waypoint.CourseAndDistance( lon, lat, alt, 
-                                       &wp_course, &wp_distance );
+           SGWayPoint wp = globals->get_route()->get_first();
+           wp.CourseAndDistance( lon, lat, alt, 
+                                 &wp_course, &wp_distance );
 
 #ifdef DO_fgAP_CORRECTED_COURSE
            corrected_course = course - wp_course;
@@ -392,7 +448,7 @@ int FGAutopilot::run() {
            MakeTargetHeadingStr( TargetHeading );
            // Force this just in case
            TargetDistance = wp_distance;
-           MakeTargetDistanceStr( wp_distance );
+           MakeTargetWPStr( wp_distance );
        }
 
        double RelHeading;
@@ -654,7 +710,7 @@ void FGAutopilot::set_HeadingMode( fgAutoHeadingMode mode ) {
            TargetDistance = distance;
            MakeTargetLatLonStr( waypoint.get_target_lat(),
                                 waypoint.get_target_lon() );
-           MakeTargetDistanceStr( distance );
+           MakeTargetWPStr( distance );
 
            if ( waypoint.get_target_alt() > 0.0 ) {
                TargetAltitude = waypoint.get_target_alt();
index feeca7ab4b3b2080c782f2aa4148d2130620b00b..1670b71bf9ee4f4a6dd834331f9836f6761e3f7e 100644 (file)
@@ -100,7 +100,9 @@ private:
     char TargetLatitudeStr[64];
     char TargetLongitudeStr[64];
     char TargetLatLonStr[64];
-    char TargetDistanceStr[64];
+    char TargetWP1Str[64];
+    char TargetWP2Str[64];
+    char TargetWP3Str[64];
     char TargetHeadingStr[64];
     char TargetAltitudeStr[64];
 
@@ -156,7 +158,9 @@ public:
 
     inline char *get_TargetLatitudeStr() { return TargetLatitudeStr; }
     inline char *get_TargetLongitudeStr() { return TargetLongitudeStr; }
-    inline char *get_TargetDistanceStr() { return TargetDistanceStr; }
+    inline char *get_TargetWP1Str() { return TargetWP1Str; }
+    inline char *get_TargetWP2Str() { return TargetWP2Str; }
+    inline char *get_TargetWP3Str() { return TargetWP3Str; }
     inline char *get_TargetHeadingStr() { return TargetHeadingStr; }
     inline char *get_TargetAltitudeStr() { return TargetAltitudeStr; }
     inline char *get_TargetLatLonStr() { return TargetLatLonStr; }
@@ -165,7 +169,7 @@ public:
     void MakeTargetLatLonStr( double lat, double lon );
     void MakeTargetAltitudeStr( double altitude );
     void MakeTargetHeadingStr( double bearing );
-    void MakeTargetDistanceStr( double distance );
+    void MakeTargetWPStr( double distance );
     void update_old_control_values();
 
     // accessors
index 75af7a76797a442435fc36ea66ffa0d0cb5d377e..8b233493578f1a24e726f3a6bbf77190a6634981 100644 (file)
@@ -1300,23 +1300,34 @@ void fgUpdateHUD( void ) {
 //  HUD_TextList.add( fgText( "AUTOPILOT", 20, apY) );
 //  apY -= 15;
   if( current_autopilot->get_HeadingEnabled() ) {
-         HUD_TextList.add( fgText( 40, apY, 
-                           current_autopilot->get_TargetHeadingStr()) );
-         apY -= 15;
+      HUD_TextList.add( fgText( 40, apY, 
+                               current_autopilot->get_TargetHeadingStr()) );
+      apY -= 15;
   }
   if( current_autopilot->get_AltitudeEnabled() ) {
-         HUD_TextList.add( fgText( 40, apY, 
-                           current_autopilot->get_TargetAltitudeStr()) );
-         apY -= 15;
+      HUD_TextList.add( fgText( 40, apY, 
+                               current_autopilot->get_TargetAltitudeStr()) );
+      apY -= 15;
   }
   if( current_autopilot->get_HeadingMode() == 
-      FGAutopilot::FG_HEADING_WAYPOINT ) {
-         HUD_TextList.add( fgText( 40, apY, 
-                           current_autopilot->get_TargetLatLonStr()) );
+      FGAutopilot::FG_HEADING_WAYPOINT )
+  {
+      char *wpstr;
+      wpstr = current_autopilot->get_TargetWP1Str();
+      if ( strlen( wpstr ) ) {
+         HUD_TextList.add( fgText( 40, apY, wpstr ) );
+         apY -= 15;
+      }
+      wpstr = current_autopilot->get_TargetWP2Str();
+      if ( strlen( wpstr ) ) {
+         HUD_TextList.add( fgText( 40, apY, wpstr ) );
          apY -= 15;
-         HUD_TextList.add( fgText( 40, apY,
-                           current_autopilot->get_TargetDistanceStr() ) );
+      }
+      wpstr = current_autopilot->get_TargetWP3Str();
+      if ( strlen( wpstr ) ) {
+         HUD_TextList.add( fgText( 40, apY, wpstr ) );
          apY -= 15;
+      }
   }
   
   HUD_TextList.draw();
index 4b72ce0f2cb767f68d339e3fd2cbedf5d301ae12..16168f8c80d7a0d1443072dcb1e87297de08caf0 100644 (file)
@@ -202,9 +202,9 @@ FGPanel::update () const
   glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
   glBegin(GL_POLYGON);
   glTexCoord2f(0.0, 0.0); glVertex3f(_winx, _winy, 0);
-  glTexCoord2f(10.0, 0.0); glVertex3f(_winx + _width, _winy, 0);
-  glTexCoord2f(10.0, 5.0); glVertex3f(_winx + _width, _winy + _height, 0);
-  glTexCoord2f(0.0, 5.0); glVertex3f(_winx, _winy + _height, 0);
+  glTexCoord2f(1.0, 0.0); glVertex3f(_winx + _width, _winy, 0);
+  glTexCoord2f(1.0, 1.0); glVertex3f(_winx + _width, _winy + _height, 0);
+  glTexCoord2f(0.0, 1.0); glVertex3f(_winx, _winy + _height, 0);
   glEnd();
 
                                // Draw the instruments.
index 48efe4341bba3fcd116d9ffa1d348f9bbbb1a45b..6abc5e2a0c01b091737bb5dbb1cd43e7763693f4 100644 (file)
 // Initialize the JSBsim flight model, dt is the time increment for
 // each subsequent iteration through the EOM
 
-static bool trimmed = false;
-static bool trim_elev = false;
-static bool trim_throttle = false;
-
 int FGJSBsim::init( double dt ) {
 
   bool result;
index 7ad6156785a2c05e28895d23a225cbbe5ca9a3a1..093719b7fc291f0a90162c310e092fc912e6cf21 100644 (file)
@@ -34,6 +34,9 @@ class FGJSBsim: public FGInterface {
 
     // The aircraft for this instance
     FGFDMExec FDMExec;
+    bool trimmed;
+    float trim_elev;
+    float trim_throttle;
 
 public:
 
index 8184840f8a166d3e3bf037433ddf1f786cb5583d..b0639ec3cffbc790a8b6572bd27e9decf3bfac8d 100644 (file)
@@ -128,6 +128,9 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 
+const char *IdSrc = "$Header$";
+const char *IdHdr = ID_AIRCRAFT;
+
 /*******************************************************************************
 ************************************ CODE **************************************
 *******************************************************************************/
index b831e92a1079e98349d28c295bc316668c6b8003..46972cc5fc503f7661e641f37875a07ee6ba179d 100644 (file)
@@ -121,6 +121,8 @@ INCLUDES
 #include "FGConfigFile.h"
 #include "FGMatrix.h"
 
+#define ID_AIRCRAFT "$Header$"
+
 /*******************************************************************************
 DEFINITIONS
 *******************************************************************************/
index 3d5b94c42e01b60a9d76615f7632b5812f646df4..4457caac04e9e9972c35946a8fe73bba2849c22c 100644 (file)
@@ -44,6 +44,7 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGMatrix.h"
+
 /*******************************************************************************
 COMMENTS, REFERENCES,  and NOTES
 ********************************************************************************
index 08fba1e3444724e5430f441a083aff07831c0447..845e6e4fcab39f26188ab6d96fc6a9af6c585098 100644 (file)
@@ -38,6 +38,7 @@ SENTRY
 /*******************************************************************************
 INCLUDES
 *******************************************************************************/
+
 #include "FGModel.h"
 #include "FGMatrix.h"
 
index de2ef278f6b051abb314e6a5b63de2e90ebb226e..333b3f69ba2af557e189fab5aa26e2ede960efaa 100644 (file)
@@ -51,8 +51,10 @@ FGControls::~FGControls() {
 
 
 // $Log$
-// Revision 1.17  2000/10/10 15:44:35  curt
-// Oct. 10, 2000 sync with JSBSim master repository.
+// Revision 1.18  2000/10/13 21:34:57  curt
+// Panel tweaks to support "shaped" panels.
+// Additional HUD support for waypoints.
+// JSBSim updates.
 //
 // Revision 1.3  2000/04/26 10:55:57  jsb
 // Made changes as required by Curt to install JSBSim into FGFS
index 57eb899fe862d369798ff40fd4c4ccb054284624..9de1e303912955b19ffcd8867db316015a1e0f7b 100644 (file)
@@ -177,8 +177,10 @@ extern FGControls controls;
 
 
 // $Log$
-// Revision 1.16  2000/10/10 15:44:35  curt
-// Oct. 10, 2000 sync with JSBSim master repository.
+// Revision 1.17  2000/10/13 21:34:58  curt
+// Panel tweaks to support "shaped" panels.
+// Additional HUD support for waypoints.
+// JSBSim updates.
 //
 // Revision 1.6  2000/06/03 13:59:52  jsb
 // Changes for compatibility with MSVC
index a29df963bd9be533d9799495ad23efad389ccf6c..2a39dac5cf0972e7a4a72bdcad81b7bf1f300026 100644 (file)
@@ -60,6 +60,7 @@ INCLUDES
 ************************************ CODE **************************************
 *******************************************************************************/
 
+char const *Id = "$Header$";
 
 FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) {
   Name = "FGFCS";
index 7cf37bf1659447c260a4586fb8e1e38fc1967046..8c669c03ee1fc364a41a04c313b61252c9156f7f 100644 (file)
@@ -54,7 +54,6 @@ INCLUDES
 #include "FGModel.h"
 #include "FGConfigFile.h"
 
-
 /*******************************************************************************
 CLASS DECLARATION
 *******************************************************************************/
index f0706a46c73204d654e7b0b7ec7abc71b0291e30..856b94c01ed94efb433ed9cf182ed2df9f2e48d4 100644 (file)
@@ -60,6 +60,8 @@ INCLUDES
 CLASS DECLARATION
 *******************************************************************************/
 
+const char *Id_Inertial = "JSBSim $Header$";
+
 class FGInertial : public FGModel {
 
 public:
index 9e15820c56f113504ab7940e9cfe49914c7e3f2d..f4c33ce74ef4c6c681d7b6cfe1b545b21c6a1ac1 100644 (file)
@@ -103,6 +103,7 @@ typedef enum { setvt, setvc, setve, setmach } speedset;
         considered equivalent to setting gamma.
  
 */
+
 class FGInitialCondition {
 public:
 
index 2ad970baece799be1b83277970e4457589009e18..9aeca8fdf47904db2ae27750ac1b9a8d660724c6 100644 (file)
@@ -137,8 +137,6 @@ FGColumnVector FGLGear::Force(void)
 
     vForce  = State->GetTl2b() * vLocalForce ;
     vMoment = vWhlBodyVec * vForce;
-    cout << "      Force: " << vForce << endl;
-    cout << "      Moment: " << vMoment << endl;
 
   } else {
 
index 1903391e211c77d0b11e287663e85e992aad06d1..4cf73e7779ffa3a3b40efa08c8736502376c4751 100644 (file)
@@ -596,7 +596,7 @@ bool fgOPTIONS::parse_wp( const string& arg ) {
     string id, alt_str;
     double alt = 0.0;
 
-    int pos = arg.find( "," );
+    int pos = arg.find( "@" );
     if ( pos != string::npos ) {
        id = arg.substr( 0, pos );
        alt_str = arg.substr( pos + 1 );
@@ -1164,7 +1164,7 @@ void fgOPTIONS::usage ( void ) {
 
     cout << endl;
     cout << "Route/Way Point Options:" << endl;
-    cout << "\t--wp=ID[,alt]:  specify a waypoint for the GC autopilot" << endl;
+    cout << "\t--wp=ID[@alt]:  specify a waypoint for the GC autopilot" << endl;
     cout << "\t\tYou can specify multiple waypoints (a route) with multiple"
         << endl;
     cout << "\t\tinstances of --wp=" << endl;