Initialize the varables *before* reading in the configuration file
This commit is contained in:
parent
266534259d
commit
869aa997a5
1 changed files with 15 additions and 15 deletions
|
@ -60,21 +60,6 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
|||
{
|
||||
string token;
|
||||
|
||||
Name = Eng_cfg->GetValue("NAME");
|
||||
Eng_cfg->GetNextConfigLine();
|
||||
while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
|
||||
*Eng_cfg >> token;
|
||||
if (token == "MINMP") *Eng_cfg >> MinManifoldPressure_inHg;
|
||||
else if (token == "MAXMP") *Eng_cfg >> MaxManifoldPressure_inHg;
|
||||
else if (token == "DISPLACEMENT") *Eng_cfg >> Displacement;
|
||||
else if (token == "MAXHP") *Eng_cfg >> MaxHP;
|
||||
else if (token == "CYCLES") *Eng_cfg >> Cycles;
|
||||
else if (token == "IDLERPM") *Eng_cfg >> IdleRPM;
|
||||
else if (token == "MAXTHROTTLE") *Eng_cfg >> MaxThrottle;
|
||||
else if (token == "MINTHROTTLE") *Eng_cfg >> MinThrottle;
|
||||
else cerr << "Unhandled token in Engine config file: " << token << endl;
|
||||
}
|
||||
|
||||
Type = etPiston;
|
||||
crank_counter = 0;
|
||||
EngineNumber = 0;
|
||||
|
@ -126,6 +111,21 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
|||
*Power_Mixture_Correlation << 20 << 74.0;
|
||||
*Power_Mixture_Correlation << (14.7/0.6) << 58;
|
||||
|
||||
Name = Eng_cfg->GetValue("NAME");
|
||||
Eng_cfg->GetNextConfigLine();
|
||||
while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
|
||||
*Eng_cfg >> token;
|
||||
if (token == "MINMP") *Eng_cfg >> MinManifoldPressure_inHg;
|
||||
else if (token == "MAXMP") *Eng_cfg >> MaxManifoldPressure_inHg;
|
||||
else if (token == "DISPLACEMENT") *Eng_cfg >> Displacement;
|
||||
else if (token == "MAXHP") *Eng_cfg >> MaxHP;
|
||||
else if (token == "CYCLES") *Eng_cfg >> Cycles;
|
||||
else if (token == "IDLERPM") *Eng_cfg >> IdleRPM;
|
||||
else if (token == "MAXTHROTTLE") *Eng_cfg >> MaxThrottle;
|
||||
else if (token == "MINTHROTTLE") *Eng_cfg >> MinThrottle;
|
||||
else cerr << "Unhandled token in Engine config file: " << token << endl;
|
||||
}
|
||||
|
||||
Debug(0); // Call Debug() routine from constructor if needed
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue