class FGNavRecord;
typedef SGSharedPtr<FGNavRecord> FGNavRecordPtr;
-class FGNavRadio : public SGSubsystem
+class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener
{
FGMorse morse;
SGPropertyNode_ptr gs_deflection_node;
SGPropertyNode_ptr gs_deflection_deg_node;
SGPropertyNode_ptr gs_deflection_norm_node;
+ SGPropertyNode_ptr gs_direct_node;
SGPropertyNode_ptr gs_rate_of_climb_node;
SGPropertyNode_ptr gs_rate_of_climb_fpm_node;
SGPropertyNode_ptr gs_dist_node;
string dme_fx_name;
double target_radial;
- SGTimeStamp prev_time;
- SGTimeStamp curr_time;
double effective_range;
double target_gs;
double twist;
double horiz_vel;
double last_x;
- double last_loc_dist;
double last_xtrack_error;
double xrate_ms;
double _localizerWidth; // cached localizer width in degrees
// internal periodic station search timer
double _time_before_search_sec;
- SGVec3d _gsCart, _gsAxis, _gsVertical;
+ SGVec3d _gsCart, _gsAxis, _gsVertical, _gsBaseline;
FGNavRecordPtr _dme;
bool _dmeInRange;
double _cdiCrossTrackErrorM;
double _gsNeedleDeflection;
double _gsNeedleDeflectionNorm;
+ double _gsDirect;
SGSharedPtr<SGSampleGroup> _sgr;
- std::vector<SGPropertyNode*> _tiedNodes;
+ std::vector<SGPropertyNode_ptr> _tiedNodes;
bool updateWithPower(double aDt);
void clearOutputs();
- /**
- * Compute the localizer width in degrees - see implementation for
- * more information on the relevant standards and formulae.
- */
- double localizerWidth(FGNavRecord* aLOC);
FGNavRecord* findPrimaryNavaid(const SGGeod& aPos, double aFreqMHz);
/// accessor for tied, read-only 'operable' property
template <typename T>
void tie(const char* aRelPath, const SGRawValue<T>& aRawValue)
{
- SGPropertyNode* nd = _radio_node->getNode(aRelPath, true);
+ SGPropertyNode_ptr nd = _radio_node->getNode(aRelPath, true);
_tiedNodes.push_back(nd);
nd->tie(aRawValue);
}
+
+ // implement SGPropertyChangeListener
+ virtual void valueChanged (SGPropertyNode * prop);
public:
FGNavRadio(SGPropertyNode *node);