diff --git a/Makefile.am b/Makefile.am index 47574a802..72a8c88dd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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: diff --git a/docs-mini/README.xmlpanel b/docs-mini/README.xmlpanel index 07cc974e7..08830190c 100644 --- a/docs-mini/README.xmlpanel +++ b/docs-mini/README.xmlpanel @@ -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 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 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 diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 47b17d68c..32a4733d8 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -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) diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index 1630837fe..33a7421df 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -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(); - // sget_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(); diff --git a/src/Autopilot/newauto.hxx b/src/Autopilot/newauto.hxx index feeca7ab4..1670b71bf 100644 --- a/src/Autopilot/newauto.hxx +++ b/src/Autopilot/newauto.hxx @@ -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 diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 75af7a767..8b2334935 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -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; - HUD_TextList.add( fgText( 40, apY, - current_autopilot->get_TargetDistanceStr() ) ); + } + wpstr = current_autopilot->get_TargetWP2Str(); + if ( strlen( wpstr ) ) { + HUD_TextList.add( fgText( 40, apY, wpstr ) ); apY -= 15; + } + wpstr = current_autopilot->get_TargetWP3Str(); + if ( strlen( wpstr ) ) { + HUD_TextList.add( fgText( 40, apY, wpstr ) ); + apY -= 15; + } } HUD_TextList.draw(); diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 4b72ce0f2..16168f8c8 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -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. diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index 48efe4341..6abc5e2a0 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -60,10 +60,6 @@ // 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; diff --git a/src/FDM/JSBSim.hxx b/src/FDM/JSBSim.hxx index 7ad615678..093719b7f 100644 --- a/src/FDM/JSBSim.hxx +++ b/src/FDM/JSBSim.hxx @@ -34,6 +34,9 @@ class FGJSBsim: public FGInterface { // The aircraft for this instance FGFDMExec FDMExec; + bool trimmed; + float trim_elev; + float trim_throttle; public: diff --git a/src/FDM/JSBSim/FGAircraft.cpp b/src/FDM/JSBSim/FGAircraft.cpp index 8184840f8..b0639ec3c 100644 --- a/src/FDM/JSBSim/FGAircraft.cpp +++ b/src/FDM/JSBSim/FGAircraft.cpp @@ -128,6 +128,9 @@ INCLUDES #include "FGAuxiliary.h" #include "FGOutput.h" +const char *IdSrc = "$Header$"; +const char *IdHdr = ID_AIRCRAFT; + /******************************************************************************* ************************************ CODE ************************************** *******************************************************************************/ diff --git a/src/FDM/JSBSim/FGAircraft.h b/src/FDM/JSBSim/FGAircraft.h index b831e92a1..46972cc5f 100644 --- a/src/FDM/JSBSim/FGAircraft.h +++ b/src/FDM/JSBSim/FGAircraft.h @@ -121,6 +121,8 @@ INCLUDES #include "FGConfigFile.h" #include "FGMatrix.h" +#define ID_AIRCRAFT "$Header$" + /******************************************************************************* DEFINITIONS *******************************************************************************/ diff --git a/src/FDM/JSBSim/FGAtmosphere.h b/src/FDM/JSBSim/FGAtmosphere.h index 3d5b94c42..4457caac0 100644 --- a/src/FDM/JSBSim/FGAtmosphere.h +++ b/src/FDM/JSBSim/FGAtmosphere.h @@ -44,6 +44,7 @@ INCLUDES #include "FGModel.h" #include "FGMatrix.h" + /******************************************************************************* COMMENTS, REFERENCES, and NOTES ******************************************************************************** diff --git a/src/FDM/JSBSim/FGAuxiliary.h b/src/FDM/JSBSim/FGAuxiliary.h index 08fba1e34..845e6e4fc 100644 --- a/src/FDM/JSBSim/FGAuxiliary.h +++ b/src/FDM/JSBSim/FGAuxiliary.h @@ -38,6 +38,7 @@ SENTRY /******************************************************************************* INCLUDES *******************************************************************************/ + #include "FGModel.h" #include "FGMatrix.h" diff --git a/src/FDM/JSBSim/FGControls.cpp b/src/FDM/JSBSim/FGControls.cpp index de2ef278f..333b3f69b 100644 --- a/src/FDM/JSBSim/FGControls.cpp +++ b/src/FDM/JSBSim/FGControls.cpp @@ -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 diff --git a/src/FDM/JSBSim/FGControls.h b/src/FDM/JSBSim/FGControls.h index 57eb899fe..9de1e3039 100644 --- a/src/FDM/JSBSim/FGControls.h +++ b/src/FDM/JSBSim/FGControls.h @@ -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 diff --git a/src/FDM/JSBSim/FGFCS.cpp b/src/FDM/JSBSim/FGFCS.cpp index a29df963b..2a39dac5c 100644 --- a/src/FDM/JSBSim/FGFCS.cpp +++ b/src/FDM/JSBSim/FGFCS.cpp @@ -60,6 +60,7 @@ INCLUDES ************************************ CODE ************************************** *******************************************************************************/ +char const *Id = "$Header$"; FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGFCS"; diff --git a/src/FDM/JSBSim/FGFCS.h b/src/FDM/JSBSim/FGFCS.h index 7cf37bf16..8c669c03e 100644 --- a/src/FDM/JSBSim/FGFCS.h +++ b/src/FDM/JSBSim/FGFCS.h @@ -54,7 +54,6 @@ INCLUDES #include "FGModel.h" #include "FGConfigFile.h" - /******************************************************************************* CLASS DECLARATION *******************************************************************************/ diff --git a/src/FDM/JSBSim/FGInertial.h b/src/FDM/JSBSim/FGInertial.h index f0706a46c..856b94c01 100644 --- a/src/FDM/JSBSim/FGInertial.h +++ b/src/FDM/JSBSim/FGInertial.h @@ -60,6 +60,8 @@ INCLUDES CLASS DECLARATION *******************************************************************************/ +const char *Id_Inertial = "JSBSim $Header$"; + class FGInertial : public FGModel { public: diff --git a/src/FDM/JSBSim/FGInitialCondition.h b/src/FDM/JSBSim/FGInitialCondition.h index 9e15820c5..f4c33ce74 100644 --- a/src/FDM/JSBSim/FGInitialCondition.h +++ b/src/FDM/JSBSim/FGInitialCondition.h @@ -103,6 +103,7 @@ typedef enum { setvt, setvc, setve, setmach } speedset; considered equivalent to setting gamma. */ + class FGInitialCondition { public: diff --git a/src/FDM/JSBSim/FGLGear.cpp b/src/FDM/JSBSim/FGLGear.cpp index 2ad970bae..9aeca8fdf 100644 --- a/src/FDM/JSBSim/FGLGear.cpp +++ b/src/FDM/JSBSim/FGLGear.cpp @@ -137,8 +137,6 @@ FGColumnVector FGLGear::Force(void) vForce = State->GetTl2b() * vLocalForce ; vMoment = vWhlBodyVec * vForce; - cout << " Force: " << vForce << endl; - cout << " Moment: " << vMoment << endl; } else { diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 1903391e2..4cf73e777 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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;