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
|
|
|
|
* /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;
|
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _electrical_node;
|
|
|
|
SGPropertyNode_ptr _source_node;
|
|
|
|
SGPropertyNode_ptr _frequency_node;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
bool _carrier_valid;
|
2006-04-19 17:36:41 +00:00
|
|
|
bool _tanker_valid;
|
2005-10-01 11:08:06 +00:00
|
|
|
bool _transmitter_valid;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
Point3D _transmitter;
|
|
|
|
double _transmitter_lat, _transmitter_lon;
|
|
|
|
double _transmitter_elevation_ft;
|
|
|
|
double _transmitter_range_nm;
|
|
|
|
double _transmitter_bearing_deg;
|
|
|
|
double _transmitter_bias;
|
|
|
|
string _transmitter_name;
|
2006-04-19 17:36:41 +00:00
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
double _carrier_lat, _carrier_lon;
|
|
|
|
double _carrier_elevation_ft;
|
|
|
|
double _carrier_range_nm;
|
|
|
|
double _carrier_bearing_deg;
|
|
|
|
double _carrier_bias;
|
|
|
|
string _carrier_name;
|
|
|
|
|
2006-04-19 17:36:41 +00:00
|
|
|
double _tanker_lat, _tanker_lon;
|
|
|
|
double _tanker_elevation_ft;
|
|
|
|
double _tanker_range_nm;
|
|
|
|
double _tanker_bearing_deg;
|
|
|
|
double _tanker_bias;
|
|
|
|
string _tanker_name;
|
|
|
|
|
2005-10-01 11:08:06 +00:00
|
|
|
string name;
|
|
|
|
int num;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_TACAN_HXX
|