#include "atis_lexicon.hxx"
#include <simgear/compiler.h>
+#include <simgear/math/sg_random.h>
+#include <simgear/misc/sg_path.hxx>
#include <stdlib.h> // atoi()
#include <stdio.h> // sprintf
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
-
-#include <simgear/misc/sg_path.hxx>
-
#include <Environment/environment_mgr.hxx>
#include <Environment/environment.hxx>
#include <Environment/atmosphere.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Airports/runways.hxx>
+#include <Airports/dynamics.hxx>
-#include "commlist.hxx"
#include "ATCutils.hxx"
#include "ATCmgr.hxx"
+using std::string;
+using std::map;
using std::cout;
using std::cout;
using boost::ref;
_prev_display(0),
refname("atis")
{
- _vPtr = globals->get_ATC_mgr()->GetVoicePointer(ATIS);
+ FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+ if (!pAtcMgr)
+ {
+ SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+ _vPtr = NULL;
+ }
+ else
+ _vPtr = pAtcMgr->GetVoicePointer(ATIS);
_voiceOK = (_vPtr == NULL ? false : true);
if (!(_type != ATIS || _type == AWOS)) {
SG_LOG(SG_ATC, SG_ALERT, "ERROR - _type not ATIS or AWOS in atis.cxx");
string BRK = ".\n";
string PAUSE = " / ";
- double tstamp = atof(fgGetString("sim/time/elapsed-sec"));
int interval = _type == ATIS ?
ATIS_interval // ATIS updated hourly
: 2*minute; // AWOS updated more frequently
- int sequence = current_commlist->GetAtisSequence(ident,
- tstamp, interval, special);
+
+ FGAirport* apt = FGAirport::findByIdent(ident);
+ int sequence = apt->getDynamics()->updateAtisSequence(interval, special);
if (!regen && sequence > LTRS) {
//xx if (msg_OK) cout << "ATIS: no change: " << sequence << endl;
//xx msg_time = cur_time;