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
|
2006-04-26 21:55:42 +00:00
|
|
|
* /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);
|
2005-10-25 13:49:55 +00:00
|
|
|
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;
|
2006-04-26 21:55:42 +00:00
|
|
|
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;
|
2006-04-26 21:55:42 +00:00
|
|
|
SGPropertyNode_ptr _display_node;
|
|
|
|
SGPropertyNode_ptr _x_shift_node;
|
|
|
|
SGPropertyNode_ptr _y_shift_node;
|
|
|
|
SGPropertyNode_ptr _rotation_node;
|
2006-06-09 18:48:57 +00:00
|
|
|
/*SGPropertyNode_ptr _x_shift_calibration_node;
|
2006-06-09 18:29:51 +00:00
|
|
|
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-11-27 17:25:39 +00:00
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
SGPropertyNode_ptr _carrier_name_node;
|
|
|
|
SGPropertyNode_ptr _channel_node;
|
|
|
|
|
2006-04-19 17:36:41 +00:00
|
|
|
SGPropertyNode_ptr _tanker_callsign_node;
|
2006-05-18 16:59:04 +00:00
|
|
|
SGPropertyNode_ptr _mp_callsign_node;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
double _last_distance_nm;
|
|
|
|
double _last_frequency_mhz;
|
|
|
|
double _time_before_search_sec;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2006-05-24 10:06:44 +00:00
|
|
|
bool _mobile_valid;
|
2005-10-01 11:08:06 +00:00
|
|
|
bool _transmitter_valid;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
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;
|
2006-06-09 18:29:51 +00:00
|
|
|
string _transmitter_ident;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2006-05-24 10:06:44 +00:00
|
|
|
double _mobile_lat, _mobile_lon;
|
|
|
|
double _mobile_elevation_ft;
|
|
|
|
double _mobile_range_nm;
|
|
|
|
double _mobile_bearing_deg;
|
|
|
|
double _mobile_bias;
|
|
|
|
string _mobile_name;
|
2006-06-09 18:29:51 +00:00
|
|
|
string _mobile_ident;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
string name;
|
|
|
|
int num;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_TACAN_HXX
|