Additional HUD support for waypoints.
JSBSim updates.
# 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:
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
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
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 );
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)
}
-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;
}
// 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() );
}
// 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;
MakeTargetHeadingStr( TargetHeading );
// Force this just in case
TargetDistance = wp_distance;
- MakeTargetDistanceStr( wp_distance );
+ MakeTargetWPStr( wp_distance );
}
double RelHeading;
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();
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];
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; }
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
// 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();
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.
// 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;
// The aircraft for this instance
FGFDMExec FDMExec;
+ bool trimmed;
+ float trim_elev;
+ float trim_throttle;
public:
#include "FGAuxiliary.h"
#include "FGOutput.h"
+const char *IdSrc = "$Header$";
+const char *IdHdr = ID_AIRCRAFT;
+
/*******************************************************************************
************************************ CODE **************************************
*******************************************************************************/
#include "FGConfigFile.h"
#include "FGMatrix.h"
+#define ID_AIRCRAFT "$Header$"
+
/*******************************************************************************
DEFINITIONS
*******************************************************************************/
#include "FGModel.h"
#include "FGMatrix.h"
+
/*******************************************************************************
COMMENTS, REFERENCES, and NOTES
********************************************************************************
/*******************************************************************************
INCLUDES
*******************************************************************************/
+
#include "FGModel.h"
#include "FGMatrix.h"
// $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
// $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
************************************ CODE **************************************
*******************************************************************************/
+char const *Id = "$Header$";
FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) {
Name = "FGFCS";
#include "FGModel.h"
#include "FGConfigFile.h"
-
/*******************************************************************************
CLASS DECLARATION
*******************************************************************************/
CLASS DECLARATION
*******************************************************************************/
+const char *Id_Inertial = "JSBSim $Header$";
+
class FGInertial : public FGModel {
public:
considered equivalent to setting gamma.
*/
+
class FGInitialCondition {
public:
vForce = State->GetTl2b() * vLocalForce ;
vMoment = vWhlBodyVec * vForce;
- cout << " Force: " << vForce << endl;
- cout << " Moment: " << vMoment << endl;
} else {
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 );
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;