X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGFCS.cpp;h=a3b7e91bc5e3ba65bcb1c90e242b29f459b0138c;hb=416ba93a417c4cadde025ba4d7bbcce71d613372;hp=f5bbba07d885103ff29cb796df7993f3df08bd34;hpb=a61f34667fdb43198f707e719f56f5bbaf2fb7b5;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGFCS.cpp b/src/FDM/JSBSim/models/FGFCS.cpp index f5bbba07d..a3b7e91bc 100644 --- a/src/FDM/JSBSim/models/FGFCS.cpp +++ b/src/FDM/JSBSim/models/FGFCS.cpp @@ -63,7 +63,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGFCS.cpp,v 1.68 2010/03/18 13:21:24 jberndt Exp $"; +static const char *IdSrc = "$Id: FGFCS.cpp,v 1.73 2011/04/05 20:20:21 andgi Exp $"; static const char *IdHdr = ID_FCS; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -182,7 +182,7 @@ bool FGFCS::InitModel(void) return true; } - + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Notes: In this logic the default engine commands are set. This is simply a // sort of safe-mode method in case the user has not defined control laws for @@ -207,7 +207,7 @@ bool FGFCS::Run(void) // Set the default steering angle for (i=0; iGetGearUnit(i); + FGLGear* gear = FDMExec->GetGroundReactions()->GetGearUnit(i); SteerPosDeg[i] = gear->GetDefaultSteerAngle( GetDsCmd() ); } @@ -705,18 +705,18 @@ string FGFCS::FindSystemFullPathname(const string& sysfilename) system_filename.append(".xml"); } - system_file.open(string(fullpath + system_filename).c_str()); + system_file.open(string(localpath + system_filename).c_str()); if ( !system_file.is_open()) { - system_file.open(string(localpath + system_filename).c_str()); + system_file.open(string(fullpath + system_filename).c_str()); if ( !system_file.is_open()) { cerr << " Could not open system file: " << system_filename << " in path " << fullpath << " or " << localpath << endl; return string(""); } else { - return string(localpath + system_filename); + return string(fullpath + system_filename); } } - return string(fullpath + system_filename); + return string(localpath + system_filename); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -736,9 +736,9 @@ ifstream* FGFCS::FindSystemFile(const string& sysfilename) system_filename.append(".xml"); } - system_file->open(string(fullpath + system_filename).c_str()); + system_file->open(string(localpath + system_filename).c_str()); if ( !system_file->is_open()) { - system_file->open(string(localpath + system_filename).c_str()); + system_file->open(string(fullpath + system_filename).c_str()); if ( !system_file->is_open()) { cerr << " Could not open system file: " << system_filename << " in path " << fullpath << " or " << localpath << endl; @@ -749,7 +749,7 @@ ifstream* FGFCS::FindSystemFile(const string& sysfilename) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -string FGFCS::GetComponentStrings(const string& delimiter) +string FGFCS::GetComponentStrings(const string& delimiter) const { unsigned int comp; string CompStrings = ""; @@ -786,7 +786,7 @@ string FGFCS::GetComponentStrings(const string& delimiter) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -string FGFCS::GetComponentValues(const string& delimiter) +string FGFCS::GetComponentValues(const string& delimiter) const { std::ostringstream buf; @@ -953,7 +953,7 @@ void FGFCS::bindModel(void) string tmp; for (i=0; iGetGearUnit(i)->GetSteerable()) { + if (FDMExec->GetGroundReactions()->GetGearUnit(i)->GetSteerable()) { tmp = CreateIndexedPropertyName("fcs/steer-pos-deg", i); PropertyManager->Tie( tmp.c_str(), this, i, &FGFCS::GetSteerPosDeg, &FGFCS::SetSteerPosDeg); }