You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an aircraft with 2 engines and I wanted both engines to be started by the initialization file. Looking at FGInitialCondition.h I saw the following comment:
// - running (-1 for all engines, 0 for no engines, 1 ... n for specific engines)
So I added a running element to my initialization file.
<running> -1 </running>
However neither of the engines are started.
I then also noticed that the code in FGInitialCondition.cpp looks for multiple running elements, and based on the comment above - 1 … n for specific engines I tried the following based on the comment regarding 0 and 1.
<running> 1 </running>
<running> 2 </running>
However that only results in engine 1 being started and engine 0 isn't started. Engines are 0 based, from FGFDMExec.cpp
for (unsignedint n=0; n < propulsion->GetNumEngines(); ++n) {
if (IC->IsEngineRunning(n)) {
try {
propulsion->InitRunning(n);
} catch (const string& str) {
So looking at the code in FGInitialCondition.cpp.
// Check to see if any engines are specified to be initialized in a running state
Element* running_elements = document->FindElement("running");
while (running_elements) {
enginesRunning |= 1 << int(running_elements->GetDataAsNumber());
running_elements = document->FindNextElement("running");
}
I then tried the following which now does start both engines (0 and 1).
<running> 0 </running>
<running> 1 </running>
So assuming that the engine indices to the running elements should be 0 based then the comment in FGInitialCondition.h needs to be updated.
// 0 for no engines, 1 ... n for specific engines)
And the code needs to be fixed to properly handle the -1 option.
I'm happy to make the fixes, but before I do I just wanted to double-check whether the engine indices in the running elements should be 0 or 1 based.
The text was updated successfully, but these errors were encountered:
Doesn't look like the code before your commit handled the -1 case either. I'll submit a pull request to fix the handling of the -1 option and update the comment that engine values go from 0 to n-1.
I have an aircraft with 2 engines and I wanted both engines to be started by the initialization file. Looking at
FGInitialCondition.h
I saw the following comment:// - running (-1 for all engines, 0 for no engines, 1 ... n for specific engines)
So I added a
running
element to my initialization file.However neither of the engines are started.
I then also noticed that the code in
FGInitialCondition.cpp
looks for multiplerunning
elements, and based on the comment above -1 … n for specific engines
I tried the following based on the comment regarding 0 and 1.However that only results in engine 1 being started and engine 0 isn't started. Engines are 0 based, from
FGFDMExec.cpp
So looking at the code in
FGInitialCondition.cpp
.I then tried the following which now does start both engines (0 and 1).
So assuming that the engine indices to the
running
elements should be 0 based then the comment inFGInitialCondition.h
needs to be updated.// 0 for no engines, 1 ... n for specific engines)
And the code needs to be fixed to properly handle the -1 option.
I'm happy to make the fixes, but before I do I just wanted to double-check whether the engine indices in the
running
elements should be 0 or 1 based.The text was updated successfully, but these errors were encountered: