}
trns += ConvertRwyNumToSpokenString(activeRwy);
if(_display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ pending_transmission = trns;
+ Transmit();
} else {
//cout << "Not displaying, trns was " << trns << '\n';
}
string trns = t->plane.callsign;
trns += " hold position";
if(_display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ pending_transmission = trns;
+ Transmit();
}
// TODO - add some idea of what traffic is blocking him.
}
t->clearedToLand = false;
}
if(_display && disp) {
- globals->get_ATC_display()->RegisterSingleMessage(trns);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns);
+ pending_transmission = trns;
+ Transmit();
}
t->finalAcknowledged = true;
} else if(t->rwyVacatedReported && !(t->rwyVacatedAcknowledged)) {
s = s.substr(0,p);
trns += s;
if((tt->opType) == CIRCUIT) {
- if(tt->planePtr->GetLeg() == FINAL) {
+ PatternLeg leg;
+ if(t->isUser) {
+ leg = tt->leg;
+ } else {
+ leg = tt->planePtr->GetLeg();
+ }
+ if(leg == FINAL) {
trns += " on final";
- } else if(tt->planePtr->GetLeg() == TURN4) {
+ } else if(leg == TURN4) {
trns += " turning final";
- } else if(tt->planePtr->GetLeg() == BASE) {
+ } else if(leg == BASE) {
trns += " on base";
- } else if(tt->planePtr->GetLeg() == TURN3) {
+ } else if(leg == TURN3) {
trns += " turning base";
}
} else {
}
}
if(_display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns);
+ pending_transmission = trns;
+ Transmit();
}
if(t->isUser) {
if(t->opType == TTT_UNKNOWN) t->opType = CIRCUIT;
}
//cout << "trns = " << trns << '\n';
if(_display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns);
+ pending_transmission = trns;
+ Transmit();
}
RemoveFromRwyList(t->plane.callsign);
AddToVacatedList(t);
timeSinceLastDeparture = 0.0;
}
if(_display) {
- globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ //globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
+ pending_transmission = trns;
+ Transmit();
}
//cout << "Done ClearHoldingPlane " << endl;
}
//cout << " ho = " << ho << " abs(ho = " << abs(ho) << '\n';
// TODO FIXME - get the wind and convert this to track, or otherwise use track somehow!!!
// If it's gusty might need to filter the value, although we are leaving 30 degrees each way leeway!
- if(abs(ho) < 30) {
+ if(fabs(ho) < 30) {
// could be either takeoff, climbout or landing - check orthopos.y
//cout << "tortho.y = " << tortho.y() << '\n';
if((tortho.y() < 0) || (t->leg == TURN4) || (t->leg == FINAL)) {
}
}
}
- } else if(abs(ho) < 60) {
+ } else if(fabs(ho) < 60) {
// turn1 or turn 4
// TODO - either fix or doublecheck this hack by looking at heading and pattern direction
if((t->leg == CLIMBOUT) || (t->leg == TURN1)) {
t->leg = TURN4;
//cout << "Turn4\n";
}
- } else if(abs(ho) < 120) {
+ } else if(fabs(ho) < 120) {
// crosswind or base
// TODO - either fix or doublecheck this hack by looking at heading and pattern direction
if((t->leg == TURN1) || (t->leg == CROSSWIND)) {
t->leg = BASE;
//cout << "Base\n";
}
- } else if(abs(ho) < 150) {
+ } else if(fabs(ho) < 150) {
// turn2 or turn 3
// TODO - either fix or doublecheck this hack by looking at heading and pattern direction
if((t->leg == CROSSWIND) || (t->leg == TURN2)) {
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);
+ memmove(&tag[0], pos, 3);
tag[3] = '\0';
int i;
len = 0;