// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h> // bcopy()
+#else
+# include <string.h> // MSVC doesn't have strings.h
+#endif
+
#include <Main/globals.hxx>
#include <Airports/runways.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include "ATCdisplay.hxx"
#include "ATCmgr.hxx"
#include "ATCutils.hxx"
+#include "ATCDialog.hxx"
#include "commlist.hxx"
#include "AILocalTraffic.hxx"
// TowerPlaneRec
TowerPlaneRec::TowerPlaneRec() :
-clearedToLand(false),
-clearedToLineUp(false),
-clearedToTakeOff(false),
-holdShortReported(false),
-downwindReported(false),
-longFinalReported(false),
-longFinalAcknowledged(false),
-finalReported(false),
-finalAcknowledged(false),
-instructedToGoAround(false),
-onRwy(false),
-nextOnRwy(false),
-opType(TTT_UNKNOWN),
-leg(LEG_UNKNOWN),
-landingType(AIP_LT_UNKNOWN),
-isUser(false)
+ clearedToLand(false),
+ clearedToLineUp(false),
+ clearedToTakeOff(false),
+ holdShortReported(false),
+ downwindReported(false),
+ longFinalReported(false),
+ longFinalAcknowledged(false),
+ finalReported(false),
+ finalAcknowledged(false),
+ rwyVacatedReported(false),
+ rwyVacatedAcknowledged(false),
+ instructedToGoAround(false),
+ onRwy(false),
+ nextOnRwy(false),
+ vfrArrivalReported(false),
+ vfrArrivalAcknowledged(false),
+ opType(TTT_UNKNOWN),
+ leg(LEG_UNKNOWN),
+ landingType(AIP_LT_UNKNOWN),
+ isUser(false)
{
plane.callsign = "UNKNOWN";
}
TowerPlaneRec::TowerPlaneRec(PlaneRec p) :
-clearedToLand(false),
-clearedToLineUp(false),
-clearedToTakeOff(false),
-holdShortReported(false),
-downwindReported(false),
-longFinalReported(false),
-longFinalAcknowledged(false),
-finalReported(false),
-finalAcknowledged(false),
-instructedToGoAround(false),
-onRwy(false),
-nextOnRwy(false),
-opType(TTT_UNKNOWN),
-leg(LEG_UNKNOWN),
-landingType(AIP_LT_UNKNOWN),
-isUser(false)
+ clearedToLand(false),
+ clearedToLineUp(false),
+ clearedToTakeOff(false),
+ holdShortReported(false),
+ downwindReported(false),
+ longFinalReported(false),
+ longFinalAcknowledged(false),
+ finalReported(false),
+ finalAcknowledged(false),
+ rwyVacatedReported(false),
+ rwyVacatedAcknowledged(false),
+ instructedToGoAround(false),
+ onRwy(false),
+ nextOnRwy(false),
+ vfrArrivalReported(false),
+ vfrArrivalAcknowledged(false),
+ opType(TTT_UNKNOWN),
+ leg(LEG_UNKNOWN),
+ landingType(AIP_LT_UNKNOWN),
+ isUser(false)
{
plane = p;
}
TowerPlaneRec::TowerPlaneRec(Point3D pt) :
-clearedToLand(false),
-clearedToLineUp(false),
-clearedToTakeOff(false),
-holdShortReported(false),
-downwindReported(false),
-longFinalReported(false),
-longFinalAcknowledged(false),
-finalReported(false),
-finalAcknowledged(false),
-instructedToGoAround(false),
-onRwy(false),
-nextOnRwy(false),
-opType(TTT_UNKNOWN),
-leg(LEG_UNKNOWN),
-landingType(AIP_LT_UNKNOWN),
-isUser(false)
+ clearedToLand(false),
+ clearedToLineUp(false),
+ clearedToTakeOff(false),
+ holdShortReported(false),
+ downwindReported(false),
+ longFinalReported(false),
+ longFinalAcknowledged(false),
+ finalReported(false),
+ finalAcknowledged(false),
+ rwyVacatedReported(false),
+ rwyVacatedAcknowledged(false),
+ instructedToGoAround(false),
+ onRwy(false),
+ nextOnRwy(false),
+ vfrArrivalReported(false),
+ vfrArrivalAcknowledged(false),
+ opType(TTT_UNKNOWN),
+ leg(LEG_UNKNOWN),
+ landingType(AIP_LT_UNKNOWN),
+ isUser(false)
{
plane.callsign = "UNKNOWN";
pos = pt;
}
TowerPlaneRec::TowerPlaneRec(PlaneRec p, Point3D pt) :
-clearedToLand(false),
-clearedToLineUp(false),
-clearedToTakeOff(false),
-holdShortReported(false),
-downwindReported(false),
-longFinalReported(false),
-longFinalAcknowledged(false),
-finalReported(false),
-finalAcknowledged(false),
-instructedToGoAround(false),
-onRwy(false),
-nextOnRwy(false),
-opType(TTT_UNKNOWN),
-leg(LEG_UNKNOWN),
-landingType(AIP_LT_UNKNOWN),
-isUser(false)
+ clearedToLand(false),
+ clearedToLineUp(false),
+ clearedToTakeOff(false),
+ holdShortReported(false),
+ downwindReported(false),
+ longFinalReported(false),
+ longFinalAcknowledged(false),
+ finalReported(false),
+ finalAcknowledged(false),
+ rwyVacatedReported(false),
+ rwyVacatedAcknowledged(false),
+ instructedToGoAround(false),
+ onRwy(false),
+ nextOnRwy(false),
+ vfrArrivalReported(false),
+ vfrArrivalAcknowledged(false),
+ opType(TTT_UNKNOWN),
+ leg(LEG_UNKNOWN),
+ landingType(AIP_LT_UNKNOWN),
+ isUser(false)
{
plane = p;
pos = pt;
Currently user is assumed to have taken off again when leaving the runway - check speed/elev for taxiing-in.
-AI plane lands even when user on rwy - make it go-around instead.
-
Tell AI plane to contact ground when taxiing in.
Use track instead of heading to determine what leg of the circuit the user is flying.
if(rwyOccupied) {
// Assume the user is started at the threshold ready to take-off
TowerPlaneRec* t = new TowerPlaneRec;
- t->plane.callsign = "Charlie Foxtrot Sierra"; // C-FGFS !!! - fixme - this is a bit hardwired
- t->plane.type = GA_SINGLE;
+ t->plane.callsign = fgGetString("/sim/user/callsign");
+ t->plane.type = GA_SINGLE; // FIXME - hardwired!!
t->opType = TTT_UNKNOWN; // We don't know if the user wants to do circuits or a departure...
t->landingType = AIP_LT_UNKNOWN;
t->leg = TAKEOFF_ROLL;
t->clearedToTakeOff = true;
rwyList.push_back(t);
departed = false;
+ } else {
+ // For now assume that this means the user is not at the airport and is in the air.
+ // TODO FIXME - this will break when user starts on apron, at hold short, etc.
+ current_atcdialog->add_entry(ident, "@AP Tower @CS @MI miles @CD of the airport for full stop with the ATIS", "Contact tower for VFR arrival (full stop)", TOWER, (int)USER_REQUEST_VFR_ARRIVAL_FULL_STOP);
}
}
cout << update_count << "\ttL: " << trafficList.size() << " cL: " << circuitList.size() << " hL: " << holdList.size() << " aL: " << appList.size() << '\n';
}
*/
+ //if(ident == "EGNX") cout << display << '\n';
if(departed != false) {
timeSinceLastDeparture += dt;
}
void FGTower::ReceiveUserCallback(int code) {
- if(code == (int)USER_REQUEST_DEPARTURE) {
+ if(code == (int)USER_REQUEST_VFR_DEPARTURE) {
cout << "User requested departure\n";
+ } else if(code == (int)USER_REQUEST_VFR_ARRIVAL) {
+ VFRArrivalContact("USER");
+ } else if(code == (int)USER_REQUEST_VFR_ARRIVAL_FULL_STOP) {
+ VFRArrivalContact("USER", FULL_STOP);
+ } else if(code == (int)USER_REQUEST_VFR_ARRIVAL_TOUCH_AND_GO) {
+ VFRArrivalContact("USER", TOUCH_AND_GO);
+ } else if(code == (int)USER_REPORT_DOWNWIND) {
+ ReportDownwind("USER");
+ } else if(code == (int)USER_REPORT_3_MILE_FINAL) {
+ // For now we'll just call report final instead of report long final to avoid having to alter the response code
+ ReportFinal("USER");
+ } else if(code == (int)USER_REPORT_RWY_VACATED) {
+ ReportRunwayVacated("USER");
}
}
void FGTower::Respond() {
- //cout << "Entering Respond..." << endl;
+ cout << "Entering Respond, responseID = " << responseID << endl;
TowerPlaneRec* t = FindPlane(responseID);
if(t) {
// This will grow!!!
- if(t->downwindReported) {
+ if(t->vfrArrivalReported && !t->vfrArrivalAcknowledged) {
+ // Testing - hardwire straight in for now
+ string trns = t->plane.callsign;
+ trns += " ";
+ trns += name;
+ trns += " Tower";
+ // Should we clear staight in or for downwind entry?
+ // For now we'll clear straight in if greater than 1km from a line drawn through the threshold perpendicular to the rwy.
+ // Later on we might check the actual heading and direct some of those to enter on downwind or base.
+ Point3D op = ortho.ConvertToLocal(t->pos);
+ if(op.y() < -1000) {
+ trns += " Report three mile straight-in runway ";
+ current_atcdialog->add_entry(ident, "@AP Tower @CS @MI mile final Runway @RW", "Report Final", TOWER, (int)USER_REPORT_3_MILE_FINAL);
+ } else {
+ // For now we'll just request reporting downwind.
+ // TODO - In real life something like 'report 2 miles southwest right downwind rwy 19R' might be used
+ // but I'm not sure how to handle all permutations of which direction to tell to report from yet.
+ trns += " Report ";
+ trns += (rwy.patternDirection ? "right " : "left ");
+ trns += "downwind runway ";
+ current_atcdialog->add_entry(ident, "@AP Tower @CS Downwind @RW", "Report Downwind", TOWER, (int)USER_REPORT_DOWNWIND);
+ }
+ trns += ConvertRwyNumToSpokenString(activeRwy);
+ if(display) {
+ globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ } else {
+ cout << "Not displaying, trns was " << trns << '\n';
+ }
+ t->vfrArrivalAcknowledged = true;
+ } else if(t->downwindReported) {
t->downwindReported = false;
int i = 1;
for(tower_plane_rec_list_iterator twrItr = circuitList.begin(); twrItr != circuitList.end(); twrItr++) {
if((*twrItr)->plane.callsign == responseID) break;
++i;
- }
- string trns = "Number ";
+ }
+ string trns = t->plane.callsign;
+ trns += " Number ";
trns += ConvertNumToSpokenDigits(i);
trns += " ";
- trns += t->plane.callsign;
+ if(i == 1) {
+ trns += "Cleared to land";
+ t->clearedToLand = true;
+ }
if(display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ globals->get_ATC_display()->RegisterSingleMessage(trns);
}
- if(t->isUser && t->opType == TTT_UNKNOWN) {
- t->opType = CIRCUIT;
+ if(t->isUser) {
+ if(t->opType == TTT_UNKNOWN) t->opType = CIRCUIT;
+ current_atcdialog->add_entry(ident, "@CS Clear of the runway", "Report runway vacated", TOWER, USER_REPORT_RWY_VACATED);
}
} else if(t->holdShortReported) {
if(t->nextOnRwy) {
}
// TODO - add winds
t->clearedToLand = true;
+ if(t->isUser) current_atcdialog->add_entry(ident, "@CS Clear of the runway", "Report runway vacated", TOWER, USER_REPORT_RWY_VACATED);
} else if(t->eta < 20) {
// Do nothing - we'll be telling it to go around in less than 10 seconds if the
// runway doesn't clear so no point in calling "continue approach".
t->clearedToLand = false;
}
if(display && disp) {
- globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ globals->get_ATC_display()->RegisterSingleMessage(trns);
}
t->finalAcknowledged = true;
+ } else if(t->rwyVacatedReported && !(t->rwyVacatedAcknowledged)) {
+ string trns = t->plane.callsign;
+ if(separateGround) {
+ trns += " Contact ground on ";
+ double f = globals->get_ATC_mgr()->GetFrequency(ident, GROUND) / 100.0;
+ char buf[10];
+ sprintf(buf, "%.2f", f);
+ trns += buf;
+ trns += " Good Day";
+ } else {
+ // Cop-out!!
+ trns += " cleared for taxi to the GA parking";
+ }
+ if(display) {
+ globals->get_ATC_display()->RegisterSingleMessage(trns);
+ }
+ t->rwyVacatedAcknowledged = true;
+ // Maybe we should check that the plane really *has* vacated the runway!
}
}
freqClear = true; // FIXME - set this to come true after enough time to render the message
ortho.Init(rwy.threshold_pos, rwy.hdg);
rwy.end1ortho = ortho.ConvertToLocal(rwy.threshold_pos); // should come out as zero
rwy.end2ortho = ortho.ConvertToLocal(takeoff_end);
+
+ // Set the pattern direction
+ // TODO - we'll check for a facilities file with this in eventually - for now assume left traffic except
+ // for certain circumstances (RH parallel rwy).
+ rwy.patternDirection = -1; // Left
+ if(rwy.rwyID.size() == 3) {
+ rwy.patternDirection = (rwy.rwyID.substr(2,1) == "R" ? 1 : -1);
+ }
} else {
SG_LOG(SG_ATC, SG_ALERT, "Help - can't get good runway in FGTower!!");
activeRwy = "NN";
doThresholdUseOrder();
}
-void FGTower::RequestLandingClearance(string ID) {
+// Contact tower for VFR approach
+// eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo"
+// This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec.
+// opt defaults to AIP_LT_UNKNOWN
+void FGTower::VFRArrivalContact(string ID, LandingType opt) {
//cout << "Request Landing Clearance called...\n";
- // Assume this comes from the user - have another function taking a pointer to the AIplane for the AI traffic.
- // For now we'll also assume that the user is a light plane and can get him/her to join the circuit if necessary.
-
- TowerPlaneRec* t = new TowerPlaneRec;
- t->isUser = true;
- t->clearedToLand = false;
- t->pos.setlon(user_lon_node->getDoubleValue());
- t->pos.setlat(user_lat_node->getDoubleValue());
- t->pos.setelev(user_elev_node->getDoubleValue());
+ // For now we'll assume that the user is a light plane and can get him/her to join the circuit if necessary.
+
+ TowerPlaneRec* t;
+ string usercall = fgGetString("/sim/user/callsign");
+ if(ID == "USER" || ID == usercall) {
+ t = FindPlane(usercall);
+ if(!t) {
+ //cout << "NOT t\n";
+ t = new TowerPlaneRec;
+ t->isUser = true;
+ t->pos.setlon(user_lon_node->getDoubleValue());
+ t->pos.setlat(user_lat_node->getDoubleValue());
+ t->pos.setelev(user_elev_node->getDoubleValue());
+ } else {
+ //cout << "IS t\n";
+ // Oops - the plane is already registered with this tower - maybe we took off and flew a giant circuit without
+ // quite getting out of tower airspace - just ignore for now and treat as new arrival.
+ // TODO - Maybe should remove from departure and circuit list if in there though!!
+ }
+ } else {
+ // Oops - something has gone wrong - put out a warning
+ cout << "WARNING - FGTower::VFRContact(string ID, LandingType lt) called with ID " << ID << " which does not appear to be the user.\n";
+ return;
+ }
+
// TODO
- // Calculate where the user is in relation to the active runway and it's circuit
+ // Calculate where the plane is in relation to the active runway and it's circuit
// and set the op-type as appropriate.
// HACK - to get up and running I'm going to assume that the user contacts tower on a staight-in final for now.
t->opType = STRAIGHT_IN;
t->plane.type = GA_SINGLE; // FIXME - Another assumption!
- t->plane.callsign = ID;
+ t->plane.callsign = usercall;
+
+ t->vfrArrivalReported = true;
+ responseReqd = true;
appList.push_back(t); // Not necessarily permanent
AddToTrafficList(t);
+
+ current_atcdialog->remove_entry(ident, USER_REQUEST_VFR_ARRIVAL, TOWER);
+ current_atcdialog->remove_entry(ident, USER_REQUEST_VFR_ARRIVAL_FULL_STOP, TOWER);
+ current_atcdialog->remove_entry(ident, USER_REQUEST_VFR_ARRIVAL_TOUCH_AND_GO, TOWER);
}
void FGTower::RequestDepartureClearance(string ID) {
}
void FGTower::ReportFinal(string ID) {
+ if(ID == "USER") {
+ ID = fgGetString("/sim/user/callsign");
+ current_atcdialog->remove_entry(ident, USER_REPORT_3_MILE_FINAL, TOWER);
+ }
TowerPlaneRec* t = FindPlane(ID);
if(t) {
t->finalReported = true;
}
}
-//void FGTower::ReportLongFinal(string ID);
+void FGTower::ReportLongFinal(string ID) {
+ if(ID == "USER") {
+ ID = fgGetString("/sim/user/callsign");
+ current_atcdialog->remove_entry(ident, USER_REPORT_3_MILE_FINAL, TOWER);
+ }
+ TowerPlaneRec* t = FindPlane(ID);
+ if(t) {
+ t->longFinalReported = true;
+ t->longFinalAcknowledged = false;
+ if(!(t->clearedToLand)) {
+ responseReqd = true;
+ } // possibly respond with wind even if already cleared to land?
+ } else {
+ SG_LOG(SG_ATC, SG_WARN, "WARNING: Unable to find plane " << ID << " in FGTower::ReportLongFinal(...)");
+ }
+}
+
//void FGTower::ReportOuterMarker(string ID);
//void FGTower::ReportMiddleMarker(string ID);
//void FGTower::ReportInnerMarker(string ID);
void FGTower::ReportRunwayVacated(string ID) {
//cout << "Report Runway Vacated Called...\n";
+ if(ID == "USER") {
+ ID = fgGetString("/sim/user/callsign");
+ current_atcdialog->remove_entry(ident, USER_REPORT_RWY_VACATED, TOWER);
+ }
+ TowerPlaneRec* t = FindPlane(ID);
+ if(t) {
+ t->rwyVacatedReported = true;
+ responseReqd = true;
+ } else {
+ SG_LOG(SG_ATC, SG_WARN, "WARNING: Unable to find plane " << ID << " in FGTower::ReportRunwayVacated(...)");
+ }
}
TowerPlaneRec* FGTower::FindPlane(string ID) {
void FGTower::ReportDownwind(string ID) {
//cout << "ReportDownwind(...) called\n";
- // Tell the plane reporting what number she is in the circuit
+ if(ID == "USER") {
+ ID = fgGetString("/sim/user/callsign");
+ current_atcdialog->remove_entry(ident, USER_REPORT_DOWNWIND, TOWER);
+ }
TowerPlaneRec* t = FindPlane(ID);
if(t) {
t->downwindReported = true;
}
}
+string FGTower::GenText(const string& m, int c) {
+ const int cmax = 300;
+ //string message;
+ char tag[4];
+ char crej = '@';
+ char mes[cmax];
+ char dum[cmax];
+ //char buf[10];
+ char *pos;
+ int len;
+ //FGTransmission t;
+ string usercall = fgGetString("/sim/user/callsign");
+
+ //transmission_list_type tmissions = transmissionlist_station[station];
+ //transmission_list_iterator current = tmissions.begin();
+ //transmission_list_iterator last = tmissions.end();
+
+ //for ( ; current != last ; ++current ) {
+ // if ( current->get_code().c1 == code.c1 &&
+ // current->get_code().c2 == code.c2 &&
+ // current->get_code().c3 == code.c3 ) {
+
+ //if ( ttext ) message = current->get_transtext();
+ //else message = current->get_menutext();
+ strcpy( &mes[0], m.c_str() );
+
+ // Replace all the '@' parameters with the actual text.
+ int check = 0; // If mes gets overflowed the while loop can go infinite
+ while ( strchr(&mes[0], crej) != NULL ) { // ie. loop until no more occurances of crej ('@') found
+ pos = strchr( &mes[0], crej );
+ bcopy(pos, &tag[0], 3);
+ tag[3] = '\0';
+ int i;
+ len = 0;
+ for ( i=0; i<cmax; i++ ) {
+ if ( mes[i] == crej ) {
+ len = i;
+ break;
+ }
+ }
+ strncpy( &dum[0], &mes[0], len );
+ dum[len] = '\0';
+
+ if ( strcmp ( tag, "@ST" ) == 0 )
+ //strcat( &dum[0], tpars.station.c_str() );
+ strcat(&dum[0], ident.c_str());
+ else if ( strcmp ( tag, "@AP" ) == 0 )
+ //strcat( &dum[0], tpars.airport.c_str() );
+ strcat(&dum[0], name.c_str());
+ else if ( strcmp ( tag, "@CS" ) == 0 )
+ //strcat( &dum[0], tpars.callsign.c_str() );
+ strcat(&dum[0], usercall.c_str());
+ else if ( strcmp ( tag, "@TD" ) == 0 ) {
+ /*
+ if ( tpars.tdir == 1 ) {
+ char buf[] = "left";
+ strcat( &dum[0], &buf[0] );
+ }
+ else {
+ char buf[] = "right";
+ strcat( &dum[0], &buf[0] );
+ }
+ */
+ }
+ else if ( strcmp ( tag, "@HE" ) == 0 ) {
+ /*
+ char buf[10];
+ sprintf( buf, "%i", (int)(tpars.heading) );
+ strcat( &dum[0], &buf[0] );
+ */
+ }
+ else if ( strcmp ( tag, "@VD" ) == 0 ) {
+ /*
+ if ( tpars.VDir == 1 ) {
+ char buf[] = "Descend and maintain";
+ strcat( &dum[0], &buf[0] );
+ }
+ else if ( tpars.VDir == 2 ) {
+ char buf[] = "Maintain";
+ strcat( &dum[0], &buf[0] );
+ }
+ else if ( tpars.VDir == 3 ) {
+ char buf[] = "Climb and maintain";
+ strcat( &dum[0], &buf[0] );
+ }
+ */
+ }
+ else if ( strcmp ( tag, "@AL" ) == 0 ) {
+ /*
+ char buf[10];
+ sprintf( buf, "%i", (int)(tpars.alt) );
+ strcat( &dum[0], &buf[0] );
+ */
+ }
+ else if ( strcmp ( tag, "@MI" ) == 0 ) {
+ char buf[10];
+ //sprintf( buf, "%3.1f", tpars.miles );
+ int dist_miles = dclGetHorizontalSeparation(Point3D(lon, lat, elev), Point3D(user_lon_node->getDoubleValue(), user_lat_node->getDoubleValue(), user_elev_node->getDoubleValue())) / 1600;
+ sprintf(buf, "%i", dist_miles);
+ strcat( &dum[0], &buf[0] );
+ }
+ else if ( strcmp ( tag, "@FR" ) == 0 ) {
+ /*
+ char buf[10];
+ sprintf( buf, "%6.2f", tpars.freq );
+ strcat( &dum[0], &buf[0] );
+ */
+ }
+ else if ( strcmp ( tag, "@RW" ) == 0 ) {
+ strcat(&dum[0], ConvertRwyNumToSpokenString(activeRwy).c_str());
+ } else if(strcmp(tag, "@CD") == 0) { // @CD = compass direction
+ double h = GetHeadingFromTo(Point3D(lon, lat, elev), Point3D(user_lon_node->getDoubleValue(), user_lat_node->getDoubleValue(), user_elev_node->getDoubleValue()));
+ while(h < 0.0) h += 360.0;
+ while(h > 360.0) h -= 360.0;
+ if(h < 22.5 || h > 337.5) {
+ strcat(&dum[0], "North");
+ } else if(h < 67.5) {
+ strcat(&dum[0], "North-East");
+ } else if(h < 112.5) {
+ strcat(&dum[0], "East");
+ } else if(h < 157.5) {
+ strcat(&dum[0], "South-East");
+ } else if(h < 202.5) {
+ strcat(&dum[0], "South");
+ } else if(h < 247.5) {
+ strcat(&dum[0], "South-West");
+ } else if(h < 292.5) {
+ strcat(&dum[0], "West");
+ } else {
+ strcat(&dum[0], "North-West");
+ }
+ } else {
+ cout << "Tag " << tag << " not found" << endl;
+ break;
+ }
+ strcat( &dum[0], &mes[len+3] );
+ strcpy( &mes[0], &dum[0] );
+
+ ++check;
+ if(check > 10) {
+ SG_LOG(SG_ATC, SG_WARN, "WARNING: Possibly endless loop terminated in FGTransmissionlist::gen_text(...)");
+ break;
+ }
+ }
+
+ //cout << mes << endl;
+ //break;
+ //}
+ //}
+ if ( mes != "" ) return mes;
+ else return "No transmission found";
+}
+
ostream& operator << (ostream& os, tower_traffic_type ttt) {
switch(ttt) {
case(CIRCUIT): return(os << "CIRCUIT");