From 7c73c7d3e58f60743f4b91d678b16d8e313a46de Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Sun, 1 Aug 2010 16:16:33 +0200 Subject: [PATCH] Added some stubs in the flightgear main code to eventually add a full, FGSubsystems based ATIS system that will serve as a replacement for the ATCDCL code. --- src/ATC/Makefile.am | 1 + src/ATC/atis.cxx | 45 ++++++++++++++++++++++++++++++++++++++++++++ src/ATC/atis.hxx | 39 ++++++++++++++++++++++++++++++++++++++ src/Main/fg_init.cxx | 6 ++++++ 4 files changed, 91 insertions(+) create mode 100644 src/ATC/atis.cxx create mode 100644 src/ATC/atis.hxx diff --git a/src/ATC/Makefile.am b/src/ATC/Makefile.am index 35756c958..8748cef1e 100644 --- a/src/ATC/Makefile.am +++ b/src/ATC/Makefile.am @@ -2,6 +2,7 @@ noinst_LIBRARIES = libATC.a libATC_a_SOURCES = \ atcutils.cxx atcutils.hxx \ + atis.cxx atis.hxx \ trafficcontrol.cxx trafficcontrol.hxx INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src diff --git a/src/ATC/atis.cxx b/src/ATC/atis.cxx new file mode 100644 index 000000000..3e95dba27 --- /dev/null +++ b/src/ATC/atis.cxx @@ -0,0 +1,45 @@ +/****************************************************************************** + * atis.cxx + * Written by Durk Talsma, started August 1, 2010. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + **************************************************************************/ + + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include "atis.hxx" + +FGAtisManager::FGAtisManager() { + +} + +FGAtisManager::~FGAtisManager() { + +} + +void FGAtisManager::init() { + SGSubsystem::init(); +} + +void FGAtisManager::update ( double time ) { + cerr << "ATIS code is running at time: " << time << endl; +} diff --git a/src/ATC/atis.hxx b/src/ATC/atis.hxx new file mode 100644 index 000000000..12fc4fd07 --- /dev/null +++ b/src/ATC/atis.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++ -*- ***************************************************** + * atic.hxx + * Written by Durk Talsma. Started August 1, 2010; based on earlier work + * by David C. Luff + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + **************************************************************************/ + +#ifndef _ATIS_HXX_ +#define _ATIS_HXX_ + +#include + +class FGAtisManager : public SGSubsystem +{ +private: + +public: + FGAtisManager(); + ~FGAtisManager(); + void init(); + void update(double time); +}; + +#endif // _ATIS_HXX_ \ No newline at end of file diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 179b46e0e..b740425a8 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -79,6 +79,7 @@ # include # include "ATCDCL/commlist.hxx" #else +# include "ATC/atis.hxx" # include "ATC/atcutils.hxx" #endif @@ -1572,6 +1573,11 @@ bool fgInitSubsystems() { SG_LOG(SG_GENERAL, SG_INFO, " AI Manager"); globals->set_AI_mgr(new FGAIMgr); globals->get_AI_mgr()->init(); +#else + //////////////////////////////////////////////////////////////////// + // Initialise the ATIS Manager + //////////////////////////////////////////////////////////////////// + globals->add_subsystem("atis", new FGAtisManager, SGSubsystemMgr::POST_FDM); #endif //////////////////////////////////////////////////////////////////// // Initialise the AI Model Manager