Oops, in the latest property manager rewrite, a typo crept in on
somewhat of a global scale. This commit should fix all these up.
This commit is contained in:
parent
e82d7d5a64
commit
0a035c7f36
12 changed files with 42 additions and 30 deletions
|
@ -315,7 +315,7 @@ void NewAltitudeInit()
|
|||
|
||||
float alt = cur_fdm_state->get_Altitude();
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "meters")) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "meters")) {
|
||||
alt *= SG_FEET_TO_METER;
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ void TgtAptDialog_OK (puObject *)
|
|||
TgtAptId = tmp.substr( 0, pos );
|
||||
string alt_str = tmp.substr( pos + 1 );
|
||||
alt = atof( alt_str.c_str() );
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
alt *= SG_FEET_TO_METER;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -907,7 +907,7 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) {
|
|||
* SG_FEET_TO_METER ) {
|
||||
}
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
MakeTargetAltitudeStr( TargetAltitude * SG_METER_TO_FEET );
|
||||
} else {
|
||||
MakeTargetAltitudeStr( TargetAltitude * SG_METER_TO_FEET );
|
||||
|
@ -918,7 +918,7 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) {
|
|||
} else if ( altitude_mode == FG_ALTITUDE_TERRAIN ) {
|
||||
TargetAGL = altitude_agl_node->getDoubleValue() * SG_FEET_TO_METER;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
MakeTargetAltitudeStr( TargetAGL * SG_METER_TO_FEET );
|
||||
} else {
|
||||
MakeTargetAltitudeStr( TargetAGL * SG_METER_TO_FEET );
|
||||
|
@ -933,7 +933,7 @@ void FGAutopilot::set_AltitudeMode( fgAutoAltitudeMode mode ) {
|
|||
void FGAutopilot::AltitudeSet( double new_altitude ) {
|
||||
double target_alt = new_altitude;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
target_alt = new_altitude * SG_FEET_TO_METER;
|
||||
}
|
||||
|
||||
|
@ -944,7 +944,7 @@ void FGAutopilot::AltitudeSet( double new_altitude ) {
|
|||
TargetAltitude = target_alt;
|
||||
altitude_mode = FG_ALTITUDE_LOCK;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
target_alt *= SG_METER_TO_FEET;
|
||||
}
|
||||
// ApAltitudeDialogInput->setValue((float)target_alt);
|
||||
|
@ -958,7 +958,7 @@ void FGAutopilot::AltitudeAdjust( double inc )
|
|||
{
|
||||
double target_alt, target_agl;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
target_alt = TargetAltitude * SG_METER_TO_FEET;
|
||||
target_agl = TargetAGL * SG_METER_TO_FEET;
|
||||
} else {
|
||||
|
@ -978,7 +978,7 @@ void FGAutopilot::AltitudeAdjust( double inc )
|
|||
target_agl = ( int ) ( target_agl / inc ) * inc + inc;
|
||||
}
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
target_alt *= SG_FEET_TO_METER;
|
||||
target_agl *= SG_FEET_TO_METER;
|
||||
}
|
||||
|
@ -986,9 +986,9 @@ void FGAutopilot::AltitudeAdjust( double inc )
|
|||
TargetAltitude = target_alt;
|
||||
TargetAGL = target_agl;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
target_alt *= SG_METER_TO_FEET;
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
target_agl *= SG_METER_TO_FEET;
|
||||
|
||||
if ( altitude_mode == FG_ALTITUDE_LOCK ) {
|
||||
|
|
|
@ -195,9 +195,12 @@ float get_altitude( void )
|
|||
|
||||
float get_agl( void )
|
||||
{
|
||||
static const SGPropertyNode *startup_units_node
|
||||
= fgGetNode("/sim/startup/units");
|
||||
|
||||
float agl;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
|
||||
agl = (current_aircraft.fdm_state->get_Altitude()
|
||||
- scenery.get_cur_elev() * SG_METER_TO_FEET);
|
||||
} else {
|
||||
|
@ -246,8 +249,11 @@ float get_vfc_tris_culled ( void )
|
|||
|
||||
float get_climb_rate( void )
|
||||
{
|
||||
static const SGPropertyNode *startup_units_node
|
||||
= fgGetNode("/sim/startup/units");
|
||||
|
||||
float climb_rate;
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
|
||||
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
|
||||
} else {
|
||||
climb_rate = current_aircraft.fdm_state->get_Climb_Rate() * SG_FEET_TO_METER * 60.0;
|
||||
|
|
|
@ -646,10 +646,12 @@ readTBI(const SGPropertyNode * node)
|
|||
|
||||
int readInstrument(const SGPropertyNode * node)
|
||||
{
|
||||
static const SGPropertyNode *startup_units_node
|
||||
= fgGetNode("/sim/startup/units");
|
||||
|
||||
instr_item *HIptr;
|
||||
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(startup_units_node->getStringValue(), "feet") ) {
|
||||
strcpy(units, " ft");
|
||||
} else {
|
||||
strcpy(units, " m");
|
||||
|
|
|
@ -239,7 +239,9 @@ void FGExternalNet::init() {
|
|||
|
||||
sprintf( cmd, "/longitude-deg?value=%.8f", lon );
|
||||
new HTTPClient( fdm_host.c_str(), cmd_port, cmd );
|
||||
cout << "before loop()" << endl;
|
||||
netChannel::loop(0);
|
||||
cout << "here" << endl;
|
||||
|
||||
sprintf( cmd, "/latitude-deg?value=%.8f", lat );
|
||||
new HTTPClient( fdm_host.c_str(), cmd_port, cmd );
|
||||
|
|
|
@ -50,7 +50,9 @@ public:
|
|||
while (*s)
|
||||
fputc(*s++,stdout);
|
||||
|
||||
printf("done\n");
|
||||
buffer.remove();
|
||||
printf("after buffer.remove()\n");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1060,7 +1060,7 @@ void guiInit()
|
|||
// Set up menu bar toggle
|
||||
gui_menu_on = ~0;
|
||||
|
||||
if (!strcmp("/sim/flight-model", "ada")) {
|
||||
if (!strcmp(fgGetString("/sim/flight-model"), "ada")) {
|
||||
guiToggleMenu(); // Menu off by default
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ do_view_cycle (const SGPropertyNode * arg, SGCommandState ** state)
|
|||
{
|
||||
globals->get_current_view()->setHeadingOffset_deg(0.0);
|
||||
globals->get_viewmgr()->next_view();
|
||||
if ( !strcmp("/sim/flight-model", "ada") ) {
|
||||
if ( !strcmp(fgGetString("/sim/flight-model"), "ada") ) {
|
||||
globals->get_props()->setBoolValue( "/sim/hud/visibility", true );
|
||||
if ( globals->get_viewmgr()->get_current() == 1 ) {
|
||||
globals->get_props()->setBoolValue( "/sim/hud/visibility", false );
|
||||
|
|
|
@ -792,7 +792,7 @@ bool fgInitSubsystems( void ) {
|
|||
|
||||
FGLocalWeatherDatabase::DatabaseWorkingType working_type;
|
||||
|
||||
if (!strcmp("/environment/weather/working-type", "internet"))
|
||||
if (!strcmp(fgGetString("/environment/weather/working-type"), "internet"))
|
||||
{
|
||||
working_type = FGLocalWeatherDatabase::use_internet;
|
||||
} else {
|
||||
|
|
|
@ -292,11 +292,11 @@ void fgInitVisuals( void ) {
|
|||
|
||||
// glFogi (GL_FOG_MODE, GL_LINEAR);
|
||||
glFogi (GL_FOG_MODE, GL_EXP2);
|
||||
if ( (!strcmp("/sim/rendering/fog", "disabled")) ||
|
||||
if ( (!strcmp(fgGetString("/sim/rendering/fog"), "disabled")) ||
|
||||
(!fgGetBool("/sim/rendering/shading"))) {
|
||||
// if fastest fog requested, or if flat shading force fastest
|
||||
glHint ( GL_FOG_HINT, GL_FASTEST );
|
||||
} else if ( !strcmp("/sim/rendering/fog", "nicest") ) {
|
||||
} else if ( !strcmp(fgGetString("/sim/rendering/fog"), "nicest") ) {
|
||||
glHint ( GL_FOG_HINT, GL_NICEST );
|
||||
}
|
||||
if ( fgGetBool("/sim/rendering/wireframe") ) {
|
||||
|
@ -802,7 +802,7 @@ void fgUpdateTimeDepCalcs() {
|
|||
FGSteam::update( multi_loop * fgGetInt("/sim/speed-up") );
|
||||
}
|
||||
|
||||
if ( !strcmp("/sim/view-mode", "pilot") ) {
|
||||
if ( !strcmp(fgGetString("/sim/view-mode"), "pilot") ) {
|
||||
cur_view_fdm = *cur_fdm_state;
|
||||
// do nothing
|
||||
}
|
||||
|
@ -1758,7 +1758,7 @@ void fgUpdateDCS (void) {
|
|||
|
||||
// Deck should be the first object in objects.txt in case of fdm=ada
|
||||
|
||||
if (!strcmp("/sim/flight-model", "ada")) {
|
||||
if (!strcmp(fgGetString("/sim/flight-model"), "ada")) {
|
||||
if ((fdm->get_iaux(1))==1)
|
||||
{
|
||||
obj_lat[1] = fdm->get_daux(1)*SGD_DEGREES_TO_RADIANS;
|
||||
|
|
|
@ -482,7 +482,7 @@ parse_wp( const string& arg ) {
|
|||
alt_str = arg.substr( pos + 1 );
|
||||
// cout << "id str = " << id << " alt str = " << alt_str << endl;
|
||||
alt = atof( alt_str.c_str() );
|
||||
if ( !strcmp("/sim/startup/units", "feet") ) {
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") ) {
|
||||
alt *= SG_FEET_TO_METER;
|
||||
}
|
||||
} else {
|
||||
|
@ -610,49 +610,49 @@ parse_option (const string& arg)
|
|||
fgSetString("/sim/startup/airport-id", "");
|
||||
} else if ( arg.find( "--altitude=" ) == 0 ) {
|
||||
fgSetBool("/sim/startup/onground", false);
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/position/altitude-ft", atof(arg.substr(11)));
|
||||
else
|
||||
fgSetDouble("/position/altitude-ft",
|
||||
atof(arg.substr(11)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--uBody=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "UVW");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/uBody-fps", atof(arg.substr(8)));
|
||||
else
|
||||
fgSetDouble("/velocities/uBody-fps",
|
||||
atof(arg.substr(8)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--vBody=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "UVW");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/vBody-fps", atof(arg.substr(8)));
|
||||
else
|
||||
fgSetDouble("/velocities/vBody-fps",
|
||||
atof(arg.substr(8)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--wBody=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "UVW");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/wBody-fps", atof(arg.substr(8)));
|
||||
else
|
||||
fgSetDouble("/velocities/wBody-fps",
|
||||
atof(arg.substr(8)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--vNorth=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "NED");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/speed-north-fps", atof(arg.substr(9)));
|
||||
else
|
||||
fgSetDouble("/velocities/speed-north-fps",
|
||||
atof(arg.substr(9)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--vEast=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "NED");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/speed-east-fps", atof(arg.substr(8)));
|
||||
else
|
||||
fgSetDouble("/velocities/speed-east-fps",
|
||||
atof(arg.substr(8)) * SG_METER_TO_FEET);
|
||||
} else if ( arg.find( "--vDown=" ) == 0 ) {
|
||||
fgSetString("/sim/startup/speed-set", "NED");
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/velocities/speed-down-fps", atof(arg.substr(8)));
|
||||
else
|
||||
fgSetDouble("/velocities/speed-down-fps",
|
||||
|
@ -708,7 +708,7 @@ parse_option (const string& arg)
|
|||
fgSetBool("/environment/clouds/status", true);
|
||||
} else if ( arg.find( "--clouds-asl=" ) == 0 ) {
|
||||
// FIXME: check units
|
||||
if ( !strcmp("/sim/startup/units", "feet") )
|
||||
if ( !strcmp(fgGetString("/sim/startup/units"), "feet") )
|
||||
fgSetDouble("/environment/clouds/altitude-ft",
|
||||
atof(arg.substr(13)));
|
||||
else
|
||||
|
|
|
@ -132,7 +132,7 @@ FGViewMgr::update (int dt)
|
|||
fgGetDouble("/orientation/roll-deg"),
|
||||
fgGetDouble("/orientation/pitch-deg"),
|
||||
fgGetDouble("/orientation/heading-deg"));
|
||||
if (!strcmp("/sim/flight-model", "ada")) {
|
||||
if (!strcmp(fgGetString("/sim/flight-model"), "ada")) {
|
||||
//+ve x is aft, +ve z is up (see viewer.hxx)
|
||||
pilot_view->setPositionOffsets( -5.0, 0.0, 1.0 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue