YASim: conver Airplane::setupState from static to const
This commit is contained in:
parent
2229b0a494
commit
5e99f92a0f
3 changed files with 5 additions and 4 deletions
|
@ -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 cosAoA = Math::cos(aoa);
|
||||||
float sinAoA = Math::sin(aoa);
|
float sinAoA = Math::sin(aoa);
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
float getApproachElevator() const { return _approachElevator.val; }
|
float getApproachElevator() const { return _approachElevator.val; }
|
||||||
const char* getFailureMsg() const { return _failureMsg; }
|
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 loadApproachControls() { loadControls(_approachControls); }
|
||||||
void loadCruiseControls() { loadControls(_cruiseControls); }
|
void loadCruiseControls() { loadControls(_cruiseControls); }
|
||||||
|
|
||||||
|
|
|
@ -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++) {
|
for(int deg=-15; deg<=90; deg++) {
|
||||||
float aoa = deg * DEG2RAD;
|
float aoa = deg * DEG2RAD;
|
||||||
Airplane::setupState(aoa, kts * KTS2MPS, 0 ,&s);
|
a->setupState(aoa, kts * KTS2MPS, 0 ,&s);
|
||||||
m->getBody()->reset();
|
m->getBody()->reset();
|
||||||
m->initIteration();
|
m->initIteration();
|
||||||
m->calcForces(&s);
|
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");
|
printf("#kts, drag\n");
|
||||||
|
|
||||||
for(int kts=15; kts<=150; kts++) {
|
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->getBody()->reset();
|
||||||
m->initIteration();
|
m->initIteration();
|
||||||
m->calcForces(&s);
|
m->calcForces(&s);
|
||||||
|
|
Loading…
Reference in a new issue