1
0
Fork 0

YASim: conver Airplane::setupState from static to const

This commit is contained in:
Henning Stahlke 2017-04-22 15:06:02 +02:00
parent 2229b0a494
commit 5e99f92a0f
3 changed files with 5 additions and 4 deletions

View file

@ -300,7 +300,8 @@ void Airplane::setFuelFraction(float frac)
}
}
void Airplane::setupState(const float aoa, const float speed, const float gla, State* s)
// used by runCruise, runApproach, solveHelicopter and in yasim-test
void Airplane::setupState(const float aoa, const float speed, const float gla, State* s) const
{
float cosAoA = Math::cos(aoa);
float sinAoA = Math::sin(aoa);

View file

@ -100,7 +100,7 @@ public:
float getApproachElevator() const { return _approachElevator.val; }
const char* getFailureMsg() const { return _failureMsg; }
static void setupState(const float aoa, const float speed, const float gla, yasim::State* s); // utility
void setupState(const float aoa, const float speed, const float gla, yasim::State* s) const;
void loadApproachControls() { loadControls(_approachControls); }
void loadCruiseControls() { loadControls(_cruiseControls); }

View file

@ -74,7 +74,7 @@ void yasim_graph(Airplane* a, const float alt, const float kts, int cfg = CONFIG
for(int deg=-15; deg<=90; deg++) {
float aoa = deg * DEG2RAD;
Airplane::setupState(aoa, kts * KTS2MPS, 0 ,&s);
a->setupState(aoa, kts * KTS2MPS, 0 ,&s);
m->getBody()->reset();
m->initIteration();
m->calcForces(&s);
@ -148,7 +148,7 @@ void yasim_drag(Airplane* a, const float aoa, const float alt, int cfg = CONFIG_
printf("#kts, drag\n");
for(int kts=15; kts<=150; kts++) {
Airplane::setupState(aoa, kts * KTS2MPS, 0 ,&s);
a->setupState(aoa, kts * KTS2MPS, 0 ,&s);
m->getBody()->reset();
m->initIteration();
m->calcForces(&s);