2001-12-01 06:22:24 +00:00
|
|
|
#ifndef _YASIM_HXX
|
|
|
|
#define _YASIM_HXX
|
|
|
|
|
|
|
|
#include <FDM/flight.hxx>
|
2012-04-05 19:06:39 +00:00
|
|
|
#include <vector>
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
namespace yasim { class FGFDM; };
|
|
|
|
|
|
|
|
class YASim : public FGInterface {
|
|
|
|
public:
|
|
|
|
YASim(double dt);
|
2006-12-09 20:37:59 +00:00
|
|
|
~YASim();
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
// Load externally set stuff into the FDM
|
|
|
|
virtual void init();
|
2001-12-24 13:54:03 +00:00
|
|
|
virtual void bind();
|
2011-10-09 17:46:49 +00:00
|
|
|
virtual void reinit();
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
// Run an iteration
|
2002-05-11 16:28:50 +00:00
|
|
|
virtual void update(double dt);
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
private:
|
2003-02-22 20:29:43 +00:00
|
|
|
|
2001-12-01 06:22:24 +00:00
|
|
|
void report();
|
|
|
|
void copyFromYASim();
|
|
|
|
void copyToYASim(bool copyState);
|
|
|
|
|
|
|
|
yasim::FGFDM* _fdm;
|
|
|
|
float _dt;
|
2009-03-15 11:26:31 +00:00
|
|
|
double _simTime;
|
2003-02-22 20:29:43 +00:00
|
|
|
enum {
|
|
|
|
NED,
|
|
|
|
UVW,
|
|
|
|
KNOTS,
|
|
|
|
MACH
|
|
|
|
} _speed_set;
|
|
|
|
|
2012-04-05 19:06:39 +00:00
|
|
|
class GearProps
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GearProps(SGPropertyNode_ptr gear_root);
|
|
|
|
|
|
|
|
SGPropertyNode_ptr has_brake;
|
|
|
|
SGPropertyNode_ptr wow;
|
|
|
|
SGPropertyNode_ptr compression_norm;
|
|
|
|
SGPropertyNode_ptr compression_m;
|
|
|
|
SGPropertyNode_ptr caster_angle_deg;
|
|
|
|
SGPropertyNode_ptr rollspeed_ms;
|
|
|
|
SGPropertyNode_ptr ground_is_solid;
|
|
|
|
SGPropertyNode_ptr ground_friction_factor;
|
|
|
|
};
|
|
|
|
|
|
|
|
SGPropertyNode_ptr _crashed;
|
|
|
|
SGPropertyNode_ptr _pressure_inhg, _temp_degc, _density_slugft3;
|
|
|
|
SGPropertyNode_ptr _gear_agl_m, _gear_agl_ft;
|
|
|
|
SGPropertyNode_ptr _pilot_g, _speed_setprop;
|
|
|
|
SGPropertyNode_ptr _catapult_launch_cmd, _tailhook_position_norm;
|
|
|
|
SGPropertyNode_ptr _launchbar_position_norm, _launchbar_holdback_pos_norm;
|
|
|
|
SGPropertyNode_ptr _launchbar_state, _launchbar_strop;
|
2013-11-11 18:55:54 +00:00
|
|
|
std::vector<GearProps> _gearProps;
|
2001-12-01 06:22:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _YASIM_HXX
|