]> git.mxchange.org Git - flightgear.git/commitdiff
Sync. w. JSBSim CVS.
authorehofman <ehofman>
Mon, 13 Mar 2006 15:21:57 +0000 (15:21 +0000)
committerehofman <ehofman>
Mon, 13 Mar 2006 15:21:57 +0000 (15:21 +0000)
src/FDM/JSBSim/initialization/FGInitialCondition.cpp
src/FDM/JSBSim/input_output/FGXMLElement.cpp
src/FDM/JSBSim/math/FGFunction.cpp
src/FDM/JSBSim/math/FGTable.cpp
src/FDM/JSBSim/models/FGLGear.cpp
src/FDM/JSBSim/models/atmosphere/FGMSIS.cpp
src/FDM/JSBSim/models/propulsion/FGPiston.cpp
src/FDM/JSBSim/models/propulsion/FGPropeller.cpp

index 87d17cd023d5f97adab9084c810b45322b20194c..02262b092ecba16a3fc69237cd1cd58ad19e3e73 100644 (file)
@@ -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");
index 4e5d37fb1fd1eb63f6c0bf4cdaabe7ec2c56964b..027e2608b9506fc9e83445fee19ead5de466ecba 100755 (executable)
@@ -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);
 }
 
index 016b6697fccc8a69c93b786baf65816118744bfc..b655d3b374d854332e863272cdfc9b90a19c6a23 100755 (executable)
@@ -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);
index f285117dee747431b2cf4b01bee3757bcc408b81..542b1390c1ff4118ed6b7c7ae442c67acc20340c 100644 (file)
@@ -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) {
index 62fe8cc439dfb8adfb5a028baf5e91145fe3d75a..6f3d6f2fadd5086c580d50bf1aac72d826450b58 100644 (file)
@@ -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);
index 1930b3fab05573b69daf97e2beb6b529bb19fe8d..38f7dd7bea33a236cac7793af9ceb307b4680716 100755 (executable)
@@ -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;
 }
 
index d090e291350bc22ac6da2cc8f035f859ca544fc1..4ad410459796764b4379fcd0214239d3d9b49f77 100644 (file)
@@ -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;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index a223b64fe85f169acbbc12ac2e1773fab5bc7f6a..fa706b6c331dedb7fcf126b7894fcf7d5f3facbd 100644 (file)
@@ -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);
 }