Revision ced95c57 src/eventlog/sequencechartfacade.cc

View differences:

src/eventlog/sequencechartfacade.cc
38 38

  
39 39
    smallestComplexity = -1;
40 40
    largestComplexity = -1;
41

  
42
    smallestDuration = -1;
43
    largestDuration = -1;
41 44
}
42 45

  
43 46
void SequenceChartFacade::synchronize(FileReader::FileChangedState change)
......
649 652
    return largestComplexity;
650 653
}
651 654

  
655
simtime_t SequenceChartFacade::getSmallestEventDuration() {
656
    simtime_t duration = 0;
657
    if (smallestDuration < 0) {
658
        for (IEvent *event = eventLog->getFirstEvent();event != eventLog->getLastEvent(); event = event->getNextEvent()) {
659
             if (event->getEventEntry()) {
660
                 duration = event->getEventEntry()->duration;
661
             } else {
662
                 continue;
663
             }
664
             if (duration < smallestDuration || smallestDuration < 0) {
665
                 smallestDuration = duration;
666
             }
667
             if (duration > largestDuration || largestDuration < 0) {
668
                 largestDuration = duration;
669
             }
670
        }
671
    }
672
    if (smallestDuration < 0) {
673
        smallestDuration = 0;
674
    }
675
    return smallestDuration;
676
}
677

  
678
simtime_t SequenceChartFacade::getLargestEventDuration() {
679
    if (largestDuration < 0) {
680
        getSmallestEventComplexity();
681
    }
682
    if (largestDuration < 0) {
683
        largestDuration = 0;
684
    }
685
    return largestDuration;
686
}
687

  
652 688

  
653 689
IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, unsigned int threshold) {
654 690
    IEvent* next = e->getPreviousEvent();

Also available in: Unified diff