1
0
Fork 0

Runtime checks for GroundContoller crashes.

Trying to identify what’s actually going wrong here.
This commit is contained in:
James Turner 2015-12-17 20:23:45 -08:00
parent b431696e9b
commit c76d106e64

View file

@ -970,6 +970,16 @@ void FGGroundController::updateStartupTraffic(TrafficVectorIterator i,
int& priority, int& priority,
time_t now) time_t now)
{ {
if (!i->getAircraft()) {
SG_LOG(SG_ATC, SG_ALERT, "updateStartupTraffic: missing aircraft");
return;
}
if (!i->getAircraft()->getPerformance()) {
SG_LOG(SG_ATC, SG_ALERT, "updateStartupTraffic: missing aircraft performance");
return;
}
i->allowPushBack(); i->allowPushBack();
i->setPriority(priority++); i->setPriority(priority++);
// in meters per second; // in meters per second;
@ -980,6 +990,11 @@ void FGGroundController::updateStartupTraffic(TrafficVectorIterator i,
FGGroundNetwork* network = dynamics->getGroundNetwork(); FGGroundNetwork* network = dynamics->getGroundNetwork();
if (!network) {
SG_LOG(SG_ATC, SG_ALERT, "updateStartupTraffic: missing ground network");
return;
}
// Check for all active aircraft whether it's current pos segment is // Check for all active aircraft whether it's current pos segment is
// an opposite of one of the departing aircraft's intentions // an opposite of one of the departing aircraft's intentions
for (TrafficVectorIterator j = activeTraffic.begin(); j != activeTraffic.end(); j++) { for (TrafficVectorIterator j = activeTraffic.begin(); j != activeTraffic.end(); j++) {
@ -1024,13 +1039,24 @@ void FGGroundController::updateActiveTraffic(TrafficVectorIterator i,
int& priority, int& priority,
time_t now) time_t now)
{ {
if (!i->getAircraft()) {
SG_LOG(SG_ATC, SG_ALERT, "updateActiveTraffic: missing aircraft");
return;
}
if (!i->getAircraft()->getPerformance()) {
SG_LOG(SG_ATC, SG_ALERT, "updateActiveTraffic: missing aircraft performance");
return;
}
assert(i->getAircraft());
assert(i->getAircraft()->getPerformance());
double length = 0; double length = 0;
double vTaxi = (i->getAircraft()->getPerformance()->vTaxi() * SG_NM_TO_METER) / 3600; double vTaxi = (i->getAircraft()->getPerformance()->vTaxi() * SG_NM_TO_METER) / 3600;
FGGroundNetwork* network = dynamics->getGroundNetwork(); FGGroundNetwork* network = dynamics->getGroundNetwork();
assert(network);
if (!network) {
SG_LOG(SG_ATC, SG_ALERT, "updateActiveTraffic: missing ground network");
return;
}
i->setPriority(priority++); i->setPriority(priority++);
int pos = i->getCurrentPosition(); int pos = i->getCurrentPosition();