]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTable.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGTable.cpp
index bf02b178788cc7284681a85fe221052901ba9d73..f54418f2044d074bc5a0de2f285d72fa99abf028 100644 (file)
@@ -66,6 +66,7 @@ FGTable::FGTable(int NRows, int NCols, int NTables)
   Data = Allocate(); // this data array will contain the keys for the associated tables
   Tables.reserve(nTables);
   for (int i=0; i<nTables; i++) Tables.push_back(FGTable(NRows, NCols));
+  lastRowIndex=lastColumnIndex=2;
 
   Debug(0);
 }
@@ -282,7 +283,7 @@ double FGTable::GetValue(double rowKey, double colKey, double tableKey)
   }
 
   Value = Factor*(Tables[r-1].GetValue(rowKey, colKey) - Tables[r-2].GetValue(rowKey, colKey))
-                              + Tables[r-1].GetValue(rowKey, colKey);
+                              + Tables[r-2].GetValue(rowKey, colKey);
 
   return Value;
 }
@@ -335,8 +336,9 @@ FGTable& FGTable::operator<<(const int n)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGTable::Print(void)
+void FGTable::Print(int spaces)
 {
+  string tabspace;
   int startRow=0;
   int startCol=0;
 
@@ -349,9 +351,11 @@ void FGTable::Print(void)
   ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream
 #endif
 
+  for (int i=0;i<spaces;i++) tabspace+=" ";
+
   cout.precision(4);
   for (int r=startRow; r<=nRows; r++) {
-    cout << "  ";
+    cout << tabspace;
     for (int c=startCol; c<=nCols; c++) {
       if (r == 0 && c == 0) {
         cout << "      ";
@@ -359,7 +363,7 @@ void FGTable::Print(void)
         cout << Data[r][c] << "        ";
         if (Type == tt3D) {
           cout << endl;
-          Tables[r-1].Print();
+          Tables[r-1].Print(spaces);
         }
       }
     }