1
0
Fork 0
flightgear/src/Instrumentation/tacan.hxx

120 lines
3 KiB
C++
Raw Normal View History

2005-10-01 11:08:06 +00:00
// dme.hxx - distance-measuring equipment.
// Written by David Megginson, started 2003.
//
// This file is in the Public Domain and comes with no warranty.
#ifndef __INSTRUMENTS_TACAN_HXX
#define __INSTRUMENTS_TACAN_HXX 1
#ifndef __cplusplus
# error This library requires C++
#endif
#include <simgear/math/point3d.hxx>
#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
/**
* Model a TACAN radio.
*
* Input properties:
*
* /position/longitude-deg
* /position/latitude-deg
* /position/altitude-ft
* /heading
2005-10-01 11:08:06 +00:00
* /systems/electrical/outputs/TACAN
* /instrumentation/"name"/serviceable
* /instrumentation/"name"/frequencies/source
* /instrumentation/"name"/frequencies/selected-mhz
*
* Output properties:
*
* /instrumentation/"name"/in-range
* /instrumentation/"name"/indicated-distance-nm
* /instrumentation/"name"/indicated-ground-speed-kt
* /instrumentation/"name"/indicated-time-kt
*/
class TACAN : public SGSubsystem
{
public:
TACAN ( SGPropertyNode *node );
TACAN ();
virtual ~TACAN ();
virtual void init ();
virtual void update (double delta_time_sec);
private:
void search (double frequency, double longitude_rad,
double latitude_rad, double altitude_m);
double searchChannel (const string& channel);
2005-10-01 11:08:06 +00:00
SGPropertyNode_ptr _longitude_node;
SGPropertyNode_ptr _latitude_node;
SGPropertyNode_ptr _altitude_node;
SGPropertyNode_ptr _heading_node;
SGPropertyNode_ptr _yaw_node;
2005-10-01 11:08:06 +00:00
SGPropertyNode_ptr _serviceable_node;
SGPropertyNode_ptr _electrical_node;
SGPropertyNode_ptr _source_node;
SGPropertyNode_ptr _frequency_node;
SGPropertyNode_ptr _display_node;
SGPropertyNode_ptr _x_shift_node;
SGPropertyNode_ptr _y_shift_node;
SGPropertyNode_ptr _rotation_node;
/*SGPropertyNode_ptr _x_shift_calibration_node;
SGPropertyNode_ptr _y_shift_calibration_node;
SGPropertyNode_ptr _distance_calibration_node;*/
2005-10-01 11:08:06 +00:00
SGPropertyNode_ptr _in_range_node;
SGPropertyNode_ptr _distance_node;
SGPropertyNode_ptr _speed_node;
SGPropertyNode_ptr _time_node;
SGPropertyNode_ptr _bearing_node;
SGPropertyNode_ptr _ident_node;
SGPropertyNode_ptr _name_node;
2005-10-01 11:08:06 +00:00
SGPropertyNode_ptr _carrier_name_node;
SGPropertyNode_ptr _channel_node;
SGPropertyNode_ptr _tanker_callsign_node;
SGPropertyNode_ptr _mp_callsign_node;
string _last_channel;
2005-10-01 11:08:06 +00:00
double _last_distance_nm;
double _last_frequency_mhz;
double _time_before_search_sec;
bool _mobile_valid;
2005-10-01 11:08:06 +00:00
bool _transmitter_valid;
2006-06-15 19:16:21 +00:00
SGVec3d _transmitter;
SGGeod _transmitter_pos;
2005-10-01 11:08:06 +00:00
double _transmitter_range_nm;
double _transmitter_bearing_deg;
double _transmitter_bias;
string _transmitter_name;
string _transmitter_ident;
double _mobile_lat, _mobile_lon;
double _mobile_elevation_ft;
double _mobile_range_nm;
double _mobile_bearing_deg;
double _mobile_bias;
string _mobile_name;
string _mobile_ident;
string _name;
int _num;
2005-10-01 11:08:06 +00:00
};
#endif // __INSTRUMENTS_TACAN_HXX