FGAIAircraft::FGAIAircraft(FGAISchedule *ref) : FGAIBase(otAircraft) {
trafficRef = ref;
- if (trafficRef)
+ if (trafficRef) {
groundOffset = trafficRef->getGroundOffset();
+ setCallSign(trafficRef->getCallSign());
+ }
else
groundOffset = 0;
holdPos = false;
_performance = 0; //TODO initialize to JET_TRANSPORT from PerformanceDB
+
}
props->tie("controls/gear/gear-down",
SGRawValueMethods<FGAIAircraft,bool>(*this,
&FGAIAircraft::_getGearDown));
- props->setStringValue("callsign", callsign.c_str());
+ props->tie("callsign",
+ SGRawValueMethods<FGAIAircraft,const char *>(*this,
+ &FGAIAircraft::_getCallSign));
+ //props->setStringValue("callsign", callsign.c_str());
}
FGAIBase::unbind();
props->untie("controls/gear/gear-down");
+ props->untie("callsign");
}
return _performance->gearExtensible(this);
}
+const char * FGAIAircraft::_getCallSign() const {
+ return callsign.c_str();
+}
+
void FGAIAircraft::loadNextLeg() {
int leg;
if ((leg = fp->getLeg()) == 10) {
trafficRef->next();
+ setCallSign(trafficRef->getCallSign());
+ //props->setStringValue("callsign", callsign.c_str());
leg = 1;
fp->setLeg(leg);
}