2002-09-26 16:19:06 +00:00
|
|
|
// marker_beacon.hxx -- class to manage the marker beacons
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 2000.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_MARKER_BEACON_HXX
|
|
|
|
#define _FG_MARKER_BEACON_HXX
|
|
|
|
|
|
|
|
|
|
|
|
#include <Main/fg_props.hxx>
|
|
|
|
|
|
|
|
#include <simgear/compiler.h>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2002-09-26 16:19:06 +00:00
|
|
|
#include <simgear/math/interpolater.hxx>
|
|
|
|
#include <simgear/timing/timestamp.hxx>
|
|
|
|
|
|
|
|
#include <Sound/beacon.hxx>
|
|
|
|
#include <Sound/morse.hxx>
|
|
|
|
|
|
|
|
|
2003-09-24 17:20:55 +00:00
|
|
|
class FGMarkerBeacon : public SGSubsystem
|
2002-09-26 16:19:06 +00:00
|
|
|
{
|
|
|
|
FGBeacon beacon;
|
|
|
|
FGMorse morse;
|
|
|
|
|
|
|
|
SGInterpTable *term_tbl;
|
|
|
|
SGInterpTable *low_tbl;
|
|
|
|
SGInterpTable *high_tbl;
|
|
|
|
|
|
|
|
SGPropertyNode *lon_node;
|
|
|
|
SGPropertyNode *lat_node;
|
|
|
|
SGPropertyNode *alt_node;
|
2002-12-16 06:09:05 +00:00
|
|
|
SGPropertyNode *bus_power;
|
|
|
|
SGPropertyNode *power_btn;
|
|
|
|
SGPropertyNode *audio_btn;
|
2003-07-30 00:43:25 +00:00
|
|
|
SGPropertyNode *serviceable;
|
2002-09-26 16:19:06 +00:00
|
|
|
|
|
|
|
bool need_update;
|
|
|
|
|
|
|
|
bool outer_marker;
|
|
|
|
bool middle_marker;
|
|
|
|
bool inner_marker;
|
|
|
|
|
|
|
|
SGTimeStamp blink;
|
|
|
|
bool outer_blink;
|
|
|
|
bool middle_blink;
|
|
|
|
bool inner_blink;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-05-28 05:24:54 +00:00
|
|
|
enum fgMkrBeacType {
|
|
|
|
NOBEACON = 0,
|
|
|
|
INNER,
|
|
|
|
MIDDLE,
|
|
|
|
OUTER
|
|
|
|
};
|
|
|
|
|
2002-09-26 16:19:06 +00:00
|
|
|
FGMarkerBeacon();
|
|
|
|
~FGMarkerBeacon();
|
|
|
|
|
|
|
|
void init ();
|
|
|
|
void bind ();
|
|
|
|
void unbind ();
|
|
|
|
void update (double dt);
|
|
|
|
|
|
|
|
// Update nav/adf radios based on current postition
|
|
|
|
void search ();
|
|
|
|
|
|
|
|
// Marker Beacon Accessors
|
|
|
|
inline bool get_inner_blink () const { return inner_blink; }
|
|
|
|
inline bool get_middle_blink () const { return middle_blink; }
|
|
|
|
inline bool get_outer_blink () const { return outer_blink; }
|
2002-12-16 06:09:05 +00:00
|
|
|
inline bool has_power() const {
|
|
|
|
return power_btn->getBoolValue() && (bus_power->getDoubleValue() > 1.0);
|
|
|
|
}
|
2002-09-26 16:19:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _FG_MARKER_BEACON_HXX
|