1
0
Fork 0

Some preparatory work for reinstating a missing piece of code in the routing algorithm for the AI system.

This commit is contained in:
Durk Talsma 2015-05-14 18:22:42 +02:00
parent 1dc7d4cf11
commit dbde1f2232
3 changed files with 17 additions and 10 deletions

View file

@ -270,7 +270,7 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
if (node == -1) {
node = park->guid();
} else if (node == 0) {
// HAndle case where parking doens't have a node
// Handle case where parking doesn't have a node
if (firstFlight) {
node = park->guid();
} else {
@ -311,6 +311,10 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
// push each node on the taxi route as a waypoint
// int route;
//cerr << "Building taxi route" << endl;
// Note that the line wpt->setRouteIndex was commented out by revision [afcdbd] 2012-01-01,
// which breaks the rendering functions.
// These can probably be generated on the fly however.
while (taxiRoute.next(&node)) {
char buffer[10];
snprintf(buffer, 10, "%lld", (long long int) node);
@ -319,7 +323,8 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
FGAIWaypoint *wpt =
createOnGround(ac, buffer, tn->geod(), apt->getElevation(),
ac->getPerformance()->vTaxi());
// wpt->setRouteIndex(route);
// TODO: find an alternative way to pass route information to the waypoint.
//wpt->setRouteIndex(route);
//cerr << "Nodes left " << taxiRoute->nodesLeft() << " ";
if (taxiRoute.nodesLeft() == 1) {
// Note that we actually have hold points in the ground network, but this is just an initial test.
@ -416,7 +421,8 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
FGAIWaypoint *wpt =
createOnGround(ac, buffer, tn->geod(), apt->getElevation(),
ac->getPerformance()->vTaxi());
// wpt->setRouteIndex(route);
//TODO: find an alternative way to pass route information to the waypoint.
//wpt->setRouteIndex(route);
pushBackWaypoint(wpt);
}
return true;

View file

@ -1048,7 +1048,7 @@ FGATCInstruction FGTowerController::getInstruction(int id)
}
void FGTowerController::render(bool visible) {
//cerr << "FGTowerController::render function not yet implemented" << endl;
//std::cerr << "FGTowerController::render function not yet implemented" << std::endl;
}
string FGTowerController::getName() {
@ -1315,7 +1315,7 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
void FGStartupController::render(bool visible)
{
//std::cerr << "Rendering startup controller" << std::endl;
SGMaterialLib *matlib = globals->get_matlib();
if (group) {
//int nr = ;
@ -1716,7 +1716,7 @@ ActiveRunway *FGApproachController::getRunway(const string& name)
}
void FGApproachController::render(bool visible) {
//cerr << "FGApproachController::render function not yet implemented" << endl;
std::cerr << "FGApproachController::render function not yet implemented" << std::endl;
}

View file

@ -1140,7 +1140,6 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
void FGGroundNetwork::render(bool visible)
{
SGMaterialLib *matlib = globals->get_matlib();
if (group) {
//int nr = ;
@ -1163,7 +1162,8 @@ void FGGroundNetwork::render(bool visible)
//for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
//double dx = 0;
for (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
// Handle start point
// Handle start point i.e. the segment that is connected to the aircraft itself on the starting end
// and to the the first "real" taxi segment on the other end.
int pos = i->getCurrentPosition() - 1;
if (pos >= 0) {
@ -1178,7 +1178,7 @@ void FGGroundNetwork::render(bool visible)
double coveredDistance = length * 0.5;
SGGeod center;
SGGeodesy::direct(start, heading, coveredDistance, center, az2);
//cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << endl;
//std::cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << std::endl;
///////////////////////////////////////////////////////////////////////////////
// Make a helper function out of this
osg::Matrix obj_pos;
@ -1242,8 +1242,9 @@ void FGGroundNetwork::render(bool visible)
group->addChild( obj_trans );
/////////////////////////////////////////////////////////////////////
} else {
//cerr << "BIG FAT WARNING: current position is here : " << pos << endl;
//std::cerr << "BIG FAT WARNING: current position is here : " << pos << std::endl;
}
// Next: Draw the other taxi segments.
for (intVecIterator j = (i)->getIntentions().begin(); j != (i)->getIntentions().end(); j++) {
osg::Matrix obj_pos;
int k = (*j)-1;