Revision 9bd9afa7 src/eventlog/sequencechartfacade.cc

View differences:

src/eventlog/sequencechartfacade.cc
319 319
    switch (timelineMode) {
320 320
        case REAL_TIME:
321 321
        {
322
            //TODO MAKE THIS MORE EFFICIENT (i.e. sorted data structure)!
323
            IEvent* res = eventLog->getFirstEvent();
324
            for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
322
            IEvent* res = eventLog->getFirstEventRealTime();
323
            for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
325 324
                if ((double) current->getEarliestStartTime() / 1000000.0 < timelineCoordinate) {
326 325
                    if (current->getEarliestStartTime() > res->getEarliestStartTime()) {
327 326
                        res = current;
328 327
                    }
328
                } else {
329
                    break;
329 330
                }
330 331
            }
331 332
            return res;
......
364 365
    switch (timelineMode) {
365 366
        case REAL_TIME:
366 367
        {
367
            //TODO MAKE THIS MORE EFFICIENT (i.e. sorted data structure)!
368
            IEvent* res = eventLog->getLastEvent();
369
            for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
368
            IEvent* res = eventLog->getLastEventRealTime();
369
            for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
370 370
                if ((double) current->getEarliestStartTime() / 1000000.0 > timelineCoordinate) {
371 371
                    if (current->getEarliestStartTime() < res->getEarliestStartTime()) {
372 372
                        res = current;
373 373
                    }
374
                } else {
375
                    break;
374 376
                }
375 377
            }
376 378
            return res;
......
785 787

  
786 788

  
787 789
IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, double threshold) {
788
    IEvent* next = e->getPreviousEvent();
790
    IEvent* next = e->getPreviousEventRealTime();
789 791
    while (next) {
790 792
        if (isBottleneck(next,threshold)) {
791 793
            return next;
792 794
        }
793
        next = next->getPreviousEvent();
795
        next = next->getPreviousEventRealTime();
794 796
    }
795 797
    return e;
796 798
}
797 799

  
798 800
IEvent* SequenceChartFacade::getNextBottleneck(IEvent* e, double threshold) {
799
    IEvent* next = e->getNextEvent();
801
    IEvent* next = e->getNextEventRealTime();
800 802
    while (next) {
801 803
        if (isBottleneck(next,threshold)) {
802 804
            return next;
803 805
        }
804
        next = next->getNextEvent();
806
        next = next->getNextEventRealTime();
805 807
    }
806 808
    return e;
807 809
}
......
1090 1092
    long eventProcessingTime = event->getEarliestProcessingTime();
1091 1093
    long eventStartTime = event->getEarliestStartTime();
1092 1094

  
1093
    for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
1095
    for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
1094 1096

  
1095 1097
        if(current->getComplexity() == 0) {
1096 1098
            continue;
......
1106 1108
        } else if (currentStartTime <= eventStartTime && currentProcessingTime >= eventProcessingTime) {
1107 1109
            overlapping += event->getComplexity();
1108 1110
        }
1111

  
1112
        if (current->getEarliestStartTime() > eventProcessingTime) {
1113
            break;
1114
        }
1109 1115
    }
1110 1116
    return overlapping / (event->getComplexity() * 1.0);
1111 1117
}

Also available in: Unified diff