2002-09-26 16:19:06 +00:00
|
|
|
// marker_beacon.hxx -- class to manage the marker beacons
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 2000.
|
|
|
|
//
|
2004-11-19 22:10:41 +00:00
|
|
|
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
2002-09-26 16:19:06 +00:00
|
|
|
//
|
|
|
|
// 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
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-09-26 16:19:06 +00:00
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_MARKER_BEACON_HXX
|
|
|
|
#define _FG_MARKER_BEACON_HXX
|
|
|
|
|
|
|
|
#include <simgear/compiler.h>
|
2019-06-03 14:32:38 +01:00
|
|
|
|
|
|
|
#include <Instrumentation/AbstractInstrument.hxx>
|
2002-09-26 16:19:06 +00:00
|
|
|
#include <simgear/timing/timestamp.hxx>
|
|
|
|
|
2009-10-04 13:52:53 +00:00
|
|
|
class SGSampleGroup;
|
2002-09-26 16:19:06 +00:00
|
|
|
|
2019-06-03 14:32:38 +01:00
|
|
|
class FGMarkerBeacon : public AbstractInstrument
|
2002-09-26 16:19:06 +00:00
|
|
|
{
|
2004-11-19 23:10:44 +00:00
|
|
|
// Inputs
|
2006-06-11 10:21:10 +00:00
|
|
|
SGPropertyNode_ptr lon_node;
|
|
|
|
SGPropertyNode_ptr lat_node;
|
|
|
|
SGPropertyNode_ptr alt_node;
|
|
|
|
SGPropertyNode_ptr audio_btn;
|
2006-06-24 07:43:09 +00:00
|
|
|
SGPropertyNode_ptr audio_vol;
|
2009-11-30 12:05:20 +00:00
|
|
|
SGPropertyNode_ptr sound_working;
|
2002-09-26 16:19:06 +00:00
|
|
|
|
|
|
|
bool outer_marker;
|
|
|
|
bool middle_marker;
|
|
|
|
bool inner_marker;
|
|
|
|
|
|
|
|
SGTimeStamp blink;
|
|
|
|
bool outer_blink;
|
|
|
|
bool middle_blink;
|
|
|
|
bool inner_blink;
|
|
|
|
|
2004-11-19 23:10:44 +00:00
|
|
|
// internal periodic station search timer
|
|
|
|
double _time_before_search_sec;
|
|
|
|
|
2009-10-24 12:57:50 +00:00
|
|
|
SGSharedPtr<SGSampleGroup> _sgr;
|
2009-10-04 13:52:53 +00:00
|
|
|
|
2002-09-26 16:19:06 +00:00
|
|
|
public:
|
2004-05-28 05:24:54 +00:00
|
|
|
enum fgMkrBeacType {
|
2006-06-24 07:48:05 +00:00
|
|
|
NOBEACON = 0,
|
|
|
|
INNER,
|
|
|
|
MIDDLE,
|
|
|
|
OUTER
|
2004-05-28 05:24:54 +00:00
|
|
|
};
|
|
|
|
|
2004-11-19 23:10:44 +00:00
|
|
|
FGMarkerBeacon(SGPropertyNode *node);
|
2002-09-26 16:19:06 +00:00
|
|
|
~FGMarkerBeacon();
|
|
|
|
|
2018-04-03 10:41:27 +02:00
|
|
|
// Subsystem API.
|
|
|
|
void bind() override;
|
|
|
|
void init() override;
|
|
|
|
void reinit() override;
|
|
|
|
void unbind() override;
|
|
|
|
void update(double dt) override;
|
2002-09-26 16:19:06 +00:00
|
|
|
|
2018-05-05 11:38:11 +02:00
|
|
|
// Subsystem identification.
|
|
|
|
static const char* staticSubsystemClassId() { return "marker-beacon"; }
|
|
|
|
|
2002-09-26 16:19:06 +00:00
|
|
|
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; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _FG_MARKER_BEACON_HXX
|