Fix 3d tables.
This commit is contained in:
parent
292ad8f5af
commit
01d85464be
2 changed files with 23 additions and 8 deletions
|
@ -104,10 +104,11 @@ FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(prop
|
||||||
string lookup_axis;
|
string lookup_axis;
|
||||||
string call_type;
|
string call_type;
|
||||||
string parent_type;
|
string parent_type;
|
||||||
|
string brkpt_string;
|
||||||
FGPropertyManager* node;
|
FGPropertyManager* node;
|
||||||
Element *tableData;
|
Element *tableData=0;
|
||||||
Element *parent_element;
|
Element *parent_element=0;
|
||||||
Element *axisElement;
|
Element *axisElement=0;
|
||||||
string operation_types = "function, product, sum, difference, quotient,"
|
string operation_types = "function, product, sum, difference, quotient,"
|
||||||
"pow, abs, sin, cos, asin, acos, tan, atan, table";
|
"pow, abs, sin, cos, asin, acos, tan, atan, table";
|
||||||
|
|
||||||
|
@ -195,13 +196,23 @@ FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(prop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // no independentVars found, and table is not marked as internal
|
} else {
|
||||||
cerr << endl << fgred << "No independent variable found for table." << fgdef << endl << endl;
|
brkpt_string = el->GetAttributeValue("breakPoint");
|
||||||
abort();
|
if (brkpt_string.empty()) {
|
||||||
|
// no independentVars found, and table is not marked as internal, nor is it a 3D table
|
||||||
|
cerr << endl << fgred << "No independent variable found for table." << fgdef << endl << endl;
|
||||||
|
abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// end lookup property code
|
// end lookup property code
|
||||||
|
|
||||||
tableData = el->FindElement("tableData");
|
if (brkpt_string.empty()) { // Not a 3D table "table element"
|
||||||
|
tableData = el->FindElement("tableData");
|
||||||
|
} else { // This is a table in a 3D table
|
||||||
|
tableData = el;
|
||||||
|
dimension = 2; // Currently, infers 2D table
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0; i<tableData->GetNumDataLines(); i++) {
|
for (i=0; i<tableData->GetNumDataLines(); i++) {
|
||||||
buf << tableData->GetDataLine(i) << string(" ");
|
buf << tableData->GetDataLine(i) << string(" ");
|
||||||
}
|
}
|
||||||
|
@ -241,6 +252,7 @@ FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(prop
|
||||||
Type = tt3D;
|
Type = tt3D;
|
||||||
colCounter = 1;
|
colCounter = 1;
|
||||||
rowCounter = 1;
|
rowCounter = 1;
|
||||||
|
lastRowIndex = lastColumnIndex = 2;
|
||||||
|
|
||||||
Data = Allocate(); // this data array will contain the keys for the associated tables
|
Data = Allocate(); // this data array will contain the keys for the associated tables
|
||||||
Tables.reserve(nTables); // necessary?
|
Tables.reserve(nTables); // necessary?
|
||||||
|
|
|
@ -175,7 +175,10 @@ void FGEngine::ConsumeFuel(void)
|
||||||
if (Tank->GetContents() > 0.0) ++TanksWithOxidizer;
|
if (Tank->GetContents() > 0.0) ++TanksWithOxidizer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TanksWithFuel==0 || (haveOxTanks && TanksWithOxidizer==0)) return;
|
if (TanksWithFuel==0 || (haveOxTanks && TanksWithOxidizer==0)) {
|
||||||
|
Starved = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0; i<SourceTanks.size(); i++) {
|
for (i=0; i<SourceTanks.size(); i++) {
|
||||||
Tank = Propulsion->GetTank(SourceTanks[i]);
|
Tank = Propulsion->GetTank(SourceTanks[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue