示例#1
0
void Conn::onSegmentDel(Segment::PtrConst seg0){
    FWK_DEBUG("Conn::onSegmentDel() with name: " << seg0->name());
    if (graphSegment_.find(seg0->name()) == graphSegment_.end()){
        FWK_DEBUG("Conn::onSegmentDel() did not find any segment called "
            << seg0->name() << " in the graph");
        return;
    }
    removeGraphSegment(seg0);
    if (seg0->returnSegment() != "")
        removeGraphSegment(graphSegment_[seg0->returnSegment()]);
};
示例#2
0
void Stats::onSegmentExpUpdate(Segment::PtrConst _p) {
    FWK_DEBUG("Stats::onSegmentUpdate with " << _p->name());
    if (_p->expediteSupport() == Segment::fullExpediteSupport()) {
        expeditedSupportCount_++;
    } else {
        expeditedSupportCount_--;
    }
    updateExpPercentage();
}
示例#3
0
void Stats::onSegmentNew(Segment::PtrConst _p) {
    FWK_DEBUG("Stats::onSegmentNew(" << _p->name() << ")");
    if (_p->type() == Segment::boatSegment()) {
        boatSegmentCount_++;
    } else if (_p->type() == Segment::truckSegment()) {
        truckSegmentCount_++;
    } else if (_p->type() == Segment::planeSegment()) {
        planeSegmentCount_++;
    }

    if (_p->expediteSupport() == Segment::fullExpediteSupport()) {
        expeditedSupportCount_++;
    }
    totalSegmentCount_++;
    updateExpPercentage();
}
示例#4
0
Conn::Insertable Conn::isInsertable(Segment::PtrConst seg){
    FWK_DEBUG("Conn::isInsertable() with name: " << seg->name());
    if (!owner_->entityManager()->segment(seg->returnSegment())){
        FWK_DEBUG("Conn::isInsertable() Missing Return");
        return missingReturn_;
    }
    if (!owner_->entityManager()->location(seg->source())){
        FWK_DEBUG("Conn::isInsertable() Missing Source");
        return missingSource_;
    }
    if (!owner_->entityManager()->location(
        owner_->entityManager()->segment(
        seg->returnSegment())->source())) {
            FWK_DEBUG("Conn::isInsertable() Missing Return Source");
            return missingReturnSource_;
    }
    FWK_DEBUG("Conn::isInsertable() Insertable");
    return insertable_;
};
示例#5
0
void Conn::onSegmentUpdate(Segment::PtrConst seg0) {
    FWK_DEBUG("Conn::onSegmentUpdate() with name: " << seg0->name());
    if (graphSegment_.find(seg0->name()) == graphSegment_.end()){
        FWK_DEBUG("Conn::onSegmentUpdate() did not find any segment called "
            << seg0->name() << " in the graph");
        if (isInsertable(seg0) == insertable_){
            Segment::PtrConst seg1 = 
                owner_->entityManager()->segment(seg0->returnSegment());
            FWK_DEBUG("Conn::onSegmentUpdate() Adding " << 
                seg0->name() << " to graph");
            graphSegment_[seg0->name()] = seg0;
            FWK_DEBUG("Conn::onSegmentUpdate() Adding " <<
                seg1->name() << " to graph");
            graphSegment_[seg1->name()] = seg1;
            if (graphLocation_.find(seg0->source()) == graphLocation_.end()) {
                Location::PtrConst loc0 =
                    owner_->entityManager()->location(seg0->source());
                FWK_DEBUG("Conn::onSegmentUpdate() Adding " << 
                    loc0->name() << " to graph");
                graphLocation_[loc0->name()] = loc0;
                routeTable_->statusIs(RouteTable::needsUpdate);
            }
            if (graphLocation_.find(seg1->source()) == graphLocation_.end()){
                Location::PtrConst loc1 = 
                    owner_->entityManager()->location(seg1->source());
                FWK_DEBUG("Conn::onSegmentUpdate() Adding " <<
                    loc1->name() << " to graph");
                graphLocation_[loc1->name()] = loc1;
                routeTable_->statusIs(RouteTable::needsUpdate);
            }
        } else {
            FWK_DEBUG("Conn::onSegmentUpdate() " << seg0->name() <<
                " is not insertable");
            return;
        }
    }
    if (seg0->source() == ""){
        removeGraphSegment(seg0);
        removeGraphSegment(graphSegment_[seg0->returnSegment()]);
    }
    if (seg0->returnSegment() == ""){
        removeGraphSegment(seg0);
    }
};
示例#6
0
void Conn::removeGraphSegment(Segment::PtrConst seg) {
    FWK_DEBUG("Conn::removeGraphSegment() with name: " << seg->name());
    graphSegment_.erase(seg->name());
    if (graphLocation_.find(seg->source()) != graphLocation_.end())
        removeGraphLocation(graphLocation_[seg->source()]);
};