From 28eb9c81e969b5577f11b8ec34e8c4458f8fcdb0 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 13 Mar 2006 15:21:57 +0000 Subject: [PATCH] Sync. w. JSBSim CVS. --- src/FDM/JSBSim/initialization/FGInitialCondition.cpp | 11 ++++++----- src/FDM/JSBSim/input_output/FGXMLElement.cpp | 9 +++++++-- src/FDM/JSBSim/math/FGFunction.cpp | 2 +- src/FDM/JSBSim/math/FGTable.cpp | 1 + src/FDM/JSBSim/models/FGLGear.cpp | 1 + src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp | 4 ++-- src/FDM/JSBSim/models/propulsion/FGPiston.cpp | 6 +++--- src/FDM/JSBSim/models/propulsion/FGPropeller.cpp | 2 ++ 8 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/FDM/JSBSim/initialization/FGInitialCondition.cpp b/src/FDM/JSBSim/initialization/FGInitialCondition.cpp index 87d17cd02..02262b092 100644 --- a/src/FDM/JSBSim/initialization/FGInitialCondition.cpp +++ b/src/FDM/JSBSim/initialization/FGInitialCondition.cpp @@ -982,12 +982,13 @@ void FGInitialCondition::bind(void){ //****************************************************************************** -void FGInitialCondition::unbind(void){ +void FGInitialCondition::unbind(void) +{ PropertyManager->Untie("ic/vc-kts"); PropertyManager->Untie("ic/ve-kts"); PropertyManager->Untie("ic/vg-kts"); PropertyManager->Untie("ic/vt-kts"); - PropertyManager->Untie("ic/mach-norm"); + PropertyManager->Untie("ic/mach"); PropertyManager->Untie("ic/roc-fpm"); PropertyManager->Untie("ic/gamma-deg"); PropertyManager->Untie("ic/alpha-deg"); @@ -1010,13 +1011,13 @@ void FGInitialCondition::unbind(void){ PropertyManager->Untie("ic/vw-east-fps"); PropertyManager->Untie("ic/vw-down-fps"); PropertyManager->Untie("ic/vw-mag-fps"); - /* PropertyManager->Untie("ic/vw-dir-deg"); */ + PropertyManager->Untie("ic/vw-dir-deg"); PropertyManager->Untie("ic/roc-fps"); - /* PropertyManager->Untie("ic/u-fps"); + PropertyManager->Untie("ic/u-fps"); PropertyManager->Untie("ic/v-fps"); - PropertyManager->Untie("ic/w-fps"); */ + PropertyManager->Untie("ic/w-fps"); PropertyManager->Untie("ic/gamma-rad"); PropertyManager->Untie("ic/alpha-rad"); diff --git a/src/FDM/JSBSim/input_output/FGXMLElement.cpp b/src/FDM/JSBSim/input_output/FGXMLElement.cpp index 4e5d37fb1..027e2608b 100755 --- a/src/FDM/JSBSim/input_output/FGXMLElement.cpp +++ b/src/FDM/JSBSim/input_output/FGXMLElement.cpp @@ -407,8 +407,13 @@ void Element::AddAttribute(string name, string value) void Element::AddData(string d) { - int string_start = d.find_first_not_of(" "); - if (string_start > 0) d.erase(0,string_start-1); + int string_end=-1; + int string_start = d.find_first_not_of(" \t"); + if (string_start > 0) { + d.erase(0,string_start); + string_end = d.find_first_of(" \t"); + if (string_end > 0) d.erase(string_end,d.size()-string_end); + } data_lines.push_back(d); } diff --git a/src/FDM/JSBSim/math/FGFunction.cpp b/src/FDM/JSBSim/math/FGFunction.cpp index 016b6697f..b655d3b37 100755 --- a/src/FDM/JSBSim/math/FGFunction.cpp +++ b/src/FDM/JSBSim/math/FGFunction.cpp @@ -162,7 +162,7 @@ double FGFunction::GetValue(void) const temp = pow(temp,Parameters[1]->GetValue()); break; case eAbs: - temp = abs(temp); + temp = fabs(temp); break; case eSin: temp = sin(temp); diff --git a/src/FDM/JSBSim/math/FGTable.cpp b/src/FDM/JSBSim/math/FGTable.cpp index f285117de..542b1390c 100644 --- a/src/FDM/JSBSim/math/FGTable.cpp +++ b/src/FDM/JSBSim/math/FGTable.cpp @@ -156,6 +156,7 @@ FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(prop while (axisElement) { property_string = axisElement->GetDataLine(); + // The property string passed into GetNode() must have no spaces or tabs. node = PropertyManager->GetNode(property_string); if (node == 0) { diff --git a/src/FDM/JSBSim/models/FGLGear.cpp b/src/FDM/JSBSim/models/FGLGear.cpp index 62fe8cc43..6f3d6f2fa 100644 --- a/src/FDM/JSBSim/models/FGLGear.cpp +++ b/src/FDM/JSBSim/models/FGLGear.cpp @@ -169,6 +169,7 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) : Exec(fdmex), maxCompLen = 0.0; WheelSlip = last_WheelSlip = 0.0; + slipIn = last_SlipIn = 0; TirePressureNorm = 1.0; Debug(0); diff --git a/src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp b/src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp index 1930b3fab..38f7dd7be 100755 --- a/src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp +++ b/src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp @@ -950,7 +950,7 @@ double MSIS::globe7(double *p, struct nrlmsise_input *input, /* parms not used: 82, 89, 99, 139-149 */ tinf = p[30]; for (i=0;i<14;i++) - tinf = tinf + abs(flags->sw[i+1])*t[i]; + tinf = tinf + fabs(flags->sw[i+1])*t[i]; return tinf; } @@ -1049,7 +1049,7 @@ double MSIS::glob7s(double *p, struct nrlmsise_input *input, } tt=0; for (i=0;i<14;i++) - tt+=abs(flags->sw[i+1])*t[i]; + tt+=fabs(flags->sw[i+1])*t[i]; return tt; } diff --git a/src/FDM/JSBSim/models/propulsion/FGPiston.cpp b/src/FDM/JSBSim/models/propulsion/FGPiston.cpp index d090e2913..4ad410459 100644 --- a/src/FDM/JSBSim/models/propulsion/FGPiston.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGPiston.cpp @@ -196,8 +196,8 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number) if (el->FindElement("ratedaltitude3")) RatedAltitude[2] = el->FindElementValueAsNumberConvertTo("ratedaltitude3", "FT"); } - minMAP = MinManifoldPressure_inHg * 3376.85; // inHg to Pa - maxMAP = MaxManifoldPressure_inHg * 3376.85; + minMAP = MinManifoldPressure_inHg * 3386.38; // inHg to Pa + maxMAP = MaxManifoldPressure_inHg * 3386.38; // Set up and sanity-check the turbo/supercharging configuration based on the input values. if (TakeoffBoost > RatedBoost[0]) bTakeoffBoost = true; @@ -468,7 +468,7 @@ void FGPiston::doMAP(void) } // And set the value in American units as well - ManifoldPressure_inHg = MAP / 3376.85; + ManifoldPressure_inHg = MAP / 3386.38; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp b/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp index a223b64fe..fa706b6c3 100644 --- a/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp @@ -145,6 +145,8 @@ FGPropeller::~FGPropeller() PropertyManager->Untie( property_name ); snprintf(property_name, 80, "propulsion/engine[%d]/blade-angle", EngineNum); PropertyManager->Untie( property_name ); + snprintf(property_name, 80, "propulsion/engine[%d]/thrust-coefficient", EngineNum); + PropertyManager->Untie( property_name ); Debug(1); }