2003-03-09 03:20:34 +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_DME_HXX
|
|
|
|
#define __INSTRUMENTS_DME_HXX 1
|
|
|
|
|
2003-05-06 23:46:24 +00:00
|
|
|
#include <simgear/props/props.hxx>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2003-03-09 03:20:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a DME radio.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
|
|
|
* /position/longitude-deg
|
|
|
|
* /position/latitude-deg
|
|
|
|
* /position/altitude-ft
|
|
|
|
* /systems/electrical/outputs/dme
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* /instrumentation/"name"/frequencies/source
|
|
|
|
* /instrumentation/"name"/frequencies/selected-mhz
|
2003-03-09 03:20:34 +00:00
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/in-range
|
|
|
|
* /instrumentation/"name"/indicated-distance-nm
|
|
|
|
* /instrumentation/"name"/indicated-ground-speed-kt
|
|
|
|
* /instrumentation/"name"/indicated-time-kt
|
2003-03-09 03:20:34 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class DME : public SGSubsystem
|
2003-03-09 03:20:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
DME ( SGPropertyNode *node );
|
2003-03-09 03:20:34 +00:00
|
|
|
virtual ~DME ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void update (double delta_time_sec);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void search (double frequency, double longitude_rad,
|
|
|
|
double latitude_rad, double altitude_m);
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
double _last_distance_nm;
|
|
|
|
double _last_frequency_mhz;
|
|
|
|
double _time_before_search_sec;
|
|
|
|
|
|
|
|
bool _transmitter_valid;
|
2006-06-15 19:16:21 +00:00
|
|
|
SGVec3d _transmitter;
|
2003-03-09 03:20:34 +00:00
|
|
|
double _transmitter_elevation_ft;
|
|
|
|
double _transmitter_range_nm;
|
2004-05-28 05:24:54 +00:00
|
|
|
double _transmitter_bias;
|
2003-03-09 03:20:34 +00:00
|
|
|
|
2006-12-06 22:11:43 +00:00
|
|
|
string _name;
|
|
|
|
int _num;
|
2004-10-16 12:37:39 +00:00
|
|
|
|
2003-03-09 03:20:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_DME_HXX
|