Additional departure airport/time and arrival airport/time information in the property tree for AI aircraft.
This commit is contained in:
parent
207703a931
commit
94f82c47ef
2 changed files with 14 additions and 1 deletions
|
@ -358,7 +358,9 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
announcePositionToController();
|
announcePositionToController();
|
||||||
|
if (fp) {
|
||||||
|
props->getChild("arrivaltime", 0, true)->setIntValue(fp->getArrivalTime());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next) {
|
if (next) {
|
||||||
|
|
|
@ -383,6 +383,17 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots
|
||||||
if (fp->isValidPlan()) {
|
if (fp->isValidPlan()) {
|
||||||
aiAircraft->FGAIBase::setFlightPlan(std::move(fp));
|
aiAircraft->FGAIBase::setFlightPlan(std::move(fp));
|
||||||
globals->get_subsystem<FGAIManager>()->attach(aiAircraft);
|
globals->get_subsystem<FGAIManager>()->attach(aiAircraft);
|
||||||
|
if (aiAircraft->_getProps()) {
|
||||||
|
SGPropertyNode *nodeofaircraft = aiAircraft->_getProps();
|
||||||
|
if (dep) {
|
||||||
|
nodeofaircraft->getChild("departureairport", 0, true)->setStringValue(dep->getId());
|
||||||
|
nodeofaircraft->getChild("departuretime", 0, true)->setIntValue(deptime);
|
||||||
|
}
|
||||||
|
if (arr) {
|
||||||
|
nodeofaircraft->getChild("arrivalairport", 0, true)->setStringValue(arr->getId());
|
||||||
|
// arrival time not known here
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
aiAircraft = NULL;
|
aiAircraft = NULL;
|
||||||
|
|
Loading…
Reference in a new issue