Revision ced95c57

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();
src/eventlog/sequencechartfacade.h
48 48
        long smallestComplexity;
49 49
        long largestComplexity;
50 50

  
51
        simtime_t smallestDuration;
52
        simtime_t largestDuration;
53

  
51 54
    public:
52 55
        SequenceChartFacade(IEventLog *eventLog);
53 56
        virtual ~SequenceChartFacade() {}
......
91 94
        long getLargestEventComplexity();
92 95

  
93 96
        /*
97
         * returns smallest event duration in the event log
98
         */
99
        simtime_t getSmallestEventDuration();
100
        /*
101
         * returns largest event duration in the event log
102
         */
103
        simtime_t getLargestEventDuration();
104

  
105

  
106
        /*
94 107
        * Returns whether an event not part of a set of parallel events with more than treshold elements.
95 108
        */
96 109
        bool isBottleneck(IEvent* event, unsigned int threshold);

Also available in: Unified diff