Revision daf081df src/eventlog/sequencechartfacade.cc

View differences:

src/eventlog/sequencechartfacade.cc
35 35

  
36 36
    nonLinearMinimumTimelineCoordinateDelta = 0.1;
37 37
    setNonLinearFocus(calculateNonLinearFocus());
38

  
39
    smallestComplexity = -1;
40
    largestComplexity = -1;
38 41
}
39 42

  
40 43
void SequenceChartFacade::synchronize(FileReader::FileChangedState change)
......
611 614

  
612 615
    return adjacencyMatrix;
613 616
}
617

  
618

  
619
long SequenceChartFacade::getSmallestEventComplexity() {
620
    long complexity = 0;
621
    if (smallestComplexity < 0) {
622
        for (IEvent *event = eventLog->getFirstEvent();event != eventLog->getLastEvent(); event = event->getNextEvent()) {
623
             if (event->getEventEndEntry()) {
624
                 complexity = event->getEventEndEntry()->complexity;
625
             }
626
             if (complexity < smallestComplexity || smallestComplexity < 0) {
627
                 smallestComplexity = complexity;
628
             }
629
             if (complexity > largestComplexity || largestComplexity < 0) {
630
                 largestComplexity = complexity;
631
             }
632
        }
633
    }
634
    if (smallestComplexity < 0) {
635
        smallestComplexity = 0;
636
    }
637
    return smallestComplexity;
638
}
639

  
640
long SequenceChartFacade::getLargestEventComplexity() {
641
    if (largestComplexity < 0) {
642
        getSmallestEventComplexity();
643
    }
644
    if (largestComplexity < 0) {
645
        largestComplexity = 0;
646
    }
647
    return largestComplexity;
648
}

Also available in: Unified diff