1
0
Fork 0

Sync. w. JSBSim CVS.

This commit is contained in:
ehofman 2006-03-13 15:21:57 +00:00
parent 771fbd680a
commit 28eb9c81e9
8 changed files with 23 additions and 13 deletions

View 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/vc-kts");
PropertyManager->Untie("ic/ve-kts"); PropertyManager->Untie("ic/ve-kts");
PropertyManager->Untie("ic/vg-kts"); PropertyManager->Untie("ic/vg-kts");
PropertyManager->Untie("ic/vt-kts"); PropertyManager->Untie("ic/vt-kts");
PropertyManager->Untie("ic/mach-norm"); PropertyManager->Untie("ic/mach");
PropertyManager->Untie("ic/roc-fpm"); PropertyManager->Untie("ic/roc-fpm");
PropertyManager->Untie("ic/gamma-deg"); PropertyManager->Untie("ic/gamma-deg");
PropertyManager->Untie("ic/alpha-deg"); PropertyManager->Untie("ic/alpha-deg");
@ -1010,13 +1011,13 @@ void FGInitialCondition::unbind(void){
PropertyManager->Untie("ic/vw-east-fps"); PropertyManager->Untie("ic/vw-east-fps");
PropertyManager->Untie("ic/vw-down-fps"); PropertyManager->Untie("ic/vw-down-fps");
PropertyManager->Untie("ic/vw-mag-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/roc-fps");
/* PropertyManager->Untie("ic/u-fps"); PropertyManager->Untie("ic/u-fps");
PropertyManager->Untie("ic/v-fps"); PropertyManager->Untie("ic/v-fps");
PropertyManager->Untie("ic/w-fps"); */ PropertyManager->Untie("ic/w-fps");
PropertyManager->Untie("ic/gamma-rad"); PropertyManager->Untie("ic/gamma-rad");
PropertyManager->Untie("ic/alpha-rad"); PropertyManager->Untie("ic/alpha-rad");

View file

@ -407,8 +407,13 @@ void Element::AddAttribute(string name, string value)
void Element::AddData(string d) void Element::AddData(string d)
{ {
int string_start = d.find_first_not_of(" "); int string_end=-1;
if (string_start > 0) d.erase(0,string_start-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); data_lines.push_back(d);
} }

View file

@ -162,7 +162,7 @@ double FGFunction::GetValue(void) const
temp = pow(temp,Parameters[1]->GetValue()); temp = pow(temp,Parameters[1]->GetValue());
break; break;
case eAbs: case eAbs:
temp = abs(temp); temp = fabs(temp);
break; break;
case eSin: case eSin:
temp = sin(temp); temp = sin(temp);

View file

@ -156,6 +156,7 @@ FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(prop
while (axisElement) { while (axisElement) {
property_string = axisElement->GetDataLine(); property_string = axisElement->GetDataLine();
// The property string passed into GetNode() must have no spaces or tabs.
node = PropertyManager->GetNode(property_string); node = PropertyManager->GetNode(property_string);
if (node == 0) { if (node == 0) {

View file

@ -169,6 +169,7 @@ FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) : Exec(fdmex),
maxCompLen = 0.0; maxCompLen = 0.0;
WheelSlip = last_WheelSlip = 0.0; WheelSlip = last_WheelSlip = 0.0;
slipIn = last_SlipIn = 0;
TirePressureNorm = 1.0; TirePressureNorm = 1.0;
Debug(0); Debug(0);

View file

@ -950,7 +950,7 @@ double MSIS::globe7(double *p, struct nrlmsise_input *input,
/* parms not used: 82, 89, 99, 139-149 */ /* parms not used: 82, 89, 99, 139-149 */
tinf = p[30]; tinf = p[30];
for (i=0;i<14;i++) 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; return tinf;
} }
@ -1049,7 +1049,7 @@ double MSIS::glob7s(double *p, struct nrlmsise_input *input,
} }
tt=0; tt=0;
for (i=0;i<14;i++) for (i=0;i<14;i++)
tt+=abs(flags->sw[i+1])*t[i]; tt+=fabs(flags->sw[i+1])*t[i];
return tt; return tt;
} }

View file

@ -196,8 +196,8 @@ FGPiston::FGPiston(FGFDMExec* exec, Element* el, int engine_number)
if (el->FindElement("ratedaltitude3")) if (el->FindElement("ratedaltitude3"))
RatedAltitude[2] = el->FindElementValueAsNumberConvertTo("ratedaltitude3", "FT"); RatedAltitude[2] = el->FindElementValueAsNumberConvertTo("ratedaltitude3", "FT");
} }
minMAP = MinManifoldPressure_inHg * 3376.85; // inHg to Pa minMAP = MinManifoldPressure_inHg * 3386.38; // inHg to Pa
maxMAP = MaxManifoldPressure_inHg * 3376.85; maxMAP = MaxManifoldPressure_inHg * 3386.38;
// Set up and sanity-check the turbo/supercharging configuration based on the input values. // Set up and sanity-check the turbo/supercharging configuration based on the input values.
if (TakeoffBoost > RatedBoost[0]) bTakeoffBoost = true; if (TakeoffBoost > RatedBoost[0]) bTakeoffBoost = true;
@ -468,7 +468,7 @@ void FGPiston::doMAP(void)
} }
// And set the value in American units as well // And set the value in American units as well
ManifoldPressure_inHg = MAP / 3376.85; ManifoldPressure_inHg = MAP / 3386.38;
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -145,6 +145,8 @@ FGPropeller::~FGPropeller()
PropertyManager->Untie( property_name ); PropertyManager->Untie( property_name );
snprintf(property_name, 80, "propulsion/engine[%d]/blade-angle", EngineNum); snprintf(property_name, 80, "propulsion/engine[%d]/blade-angle", EngineNum);
PropertyManager->Untie( property_name ); PropertyManager->Untie( property_name );
snprintf(property_name, 80, "propulsion/engine[%d]/thrust-coefficient", EngineNum);
PropertyManager->Untie( property_name );
Debug(1); Debug(1);
} }