INCLUDES
*******************************************************************************/
-#include <math.h>
+#ifdef FGFS
+# include <Include/compiler.h>
+# ifdef FG_HAVE_STD_INCLUDES
+# include <cmath>
+# else
+# include <math.h>
+# endif
+#else
+# include <cmath>
+#endif
#include "FGState.h"
#include "FGFDMExec.h"
}
-bool FGState::Reset(char* fname)
+bool FGState::Reset(string path, string fname)
{
- char resetDef[256];
+ string resetDef;
float U, V, W;
float phi, tht, psi;
float alpha, beta, gamma;
float Q0, Q1, Q2, Q3;
float T[4][4];
- sprintf(resetDef, "/h/curt/projects/FlightGear/Simulator/FDM/JSBsim/aircraft/%s/%s", FDMExec->GetAircraft()->GetAircraftName(), fname);
+ resetDef = path + "/" + FDMExec->GetAircraft()->GetAircraftName() +
+ "/" + fname;
- ifstream resetfile(resetDef);
+ ifstream resetfile(resetDef.c_str());
if (resetfile) {
resetfile >> U;
}
-bool FGState::StoreData(char* fname)
+bool FGState::StoreData(string fname)
{
- ofstream datafile(fname);
+ ofstream datafile(fname.c_str());
if (datafile) {
datafile << FDMExec->GetTranslation()->GetU();
}
-bool FGState::DumpData(char* fname)
+bool FGState::DumpData(string fname)
{
- ofstream datafile(fname);
+ ofstream datafile(fname.c_str());
if (datafile) {
datafile << "U: " << FDMExec->GetTranslation()->GetU() << endl;