Panel tweaks to support "shaped" panels.
Additional HUD support for waypoints. JSBSim updates.
This commit is contained in:
parent
fb2d013c4e
commit
5018278831
21 changed files with 176 additions and 63 deletions
26
Makefile.am
26
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -34,6 +34,9 @@ class FGJSBsim: public FGInterface {
|
|||
|
||||
// The aircraft for this instance
|
||||
FGFDMExec FDMExec;
|
||||
bool trimmed;
|
||||
float trim_elev;
|
||||
float trim_throttle;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -128,6 +128,9 @@ INCLUDES
|
|||
#include "FGAuxiliary.h"
|
||||
#include "FGOutput.h"
|
||||
|
||||
const char *IdSrc = "$Header$";
|
||||
const char *IdHdr = ID_AIRCRAFT;
|
||||
|
||||
/*******************************************************************************
|
||||
************************************ CODE **************************************
|
||||
*******************************************************************************/
|
||||
|
|
|
@ -121,6 +121,8 @@ INCLUDES
|
|||
#include "FGConfigFile.h"
|
||||
#include "FGMatrix.h"
|
||||
|
||||
#define ID_AIRCRAFT "$Header$"
|
||||
|
||||
/*******************************************************************************
|
||||
DEFINITIONS
|
||||
*******************************************************************************/
|
||||
|
|
|
@ -44,6 +44,7 @@ INCLUDES
|
|||
|
||||
#include "FGModel.h"
|
||||
#include "FGMatrix.h"
|
||||
|
||||
/*******************************************************************************
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
********************************************************************************
|
||||
|
|
|
@ -38,6 +38,7 @@ SENTRY
|
|||
/*******************************************************************************
|
||||
INCLUDES
|
||||
*******************************************************************************/
|
||||
|
||||
#include "FGModel.h"
|
||||
#include "FGMatrix.h"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -60,6 +60,7 @@ INCLUDES
|
|||
************************************ CODE **************************************
|
||||
*******************************************************************************/
|
||||
|
||||
char const *Id = "$Header$";
|
||||
|
||||
FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex) {
|
||||
Name = "FGFCS";
|
||||
|
|
|
@ -54,7 +54,6 @@ INCLUDES
|
|||
#include "FGModel.h"
|
||||
#include "FGConfigFile.h"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
CLASS DECLARATION
|
||||
*******************************************************************************/
|
||||
|
|
|
@ -60,6 +60,8 @@ INCLUDES
|
|||
CLASS DECLARATION
|
||||
*******************************************************************************/
|
||||
|
||||
const char *Id_Inertial = "JSBSim $Header$";
|
||||
|
||||
class FGInertial : public FGModel {
|
||||
|
||||
public:
|
||||
|
|
|
@ -103,6 +103,7 @@ typedef enum { setvt, setvc, setve, setmach } speedset;
|
|||
considered equivalent to setting gamma.
|
||||
|
||||
*/
|
||||
|
||||
class FGInitialCondition {
|
||||
public:
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ FGColumnVector FGLGear::Force(void)
|
|||
|
||||
vForce = State->GetTl2b() * vLocalForce ;
|
||||
vMoment = vWhlBodyVec * vForce;
|
||||
cout << " Force: " << vForce << endl;
|
||||
cout << " Moment: " << vMoment << endl;
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue