Project

General

Profile

Revision 2595f1a9

ID2595f1a9890bb63db6307019153c817fc0417e11

Added by Simon Tenbusch over 8 years ago

[sequencechart]
- various bugfixes

View differences:

src/eventlog/sequencechartfacade.cc
42 42
    smallestDuration = -1;
43 43
    largestDuration = -1;
44 44

  
45
    biggestEarliestProcessingTime = 0;
46

  
45 47
    cachedParallelSet.clear();
46 48
    cachedCriticalPath.clear();
47 49
}
......
452 454
    {
453 455
        case REAL_TIME:
454 456
        {
455
            simtime_t lastEventSimulationTime = (eventLog->getLastEvent()->getEarliestStartTime())/1000000.0;
456
            //NOTE: This sometimes crashes the Sequencechart because the returned value might be too big
457
            simulationTime = max(BigDecimal::Zero, min(lastEventSimulationTime, (timelineCoordinate + timelineCoordinateOriginRealTime)));
457
            simulationTime = max(BigDecimal::Zero, min(biggestEarliestProcessingTime, (timelineCoordinate + timelineCoordinateOriginRealTime)));
458 458
        }
459 459
        break;
460 460
        case SIMULATION_TIME:
......
976 976
    }
977 977
    //Now produce the convex hull of critical antecessors/predecessors:
978 978
    cachedCriticalPath.clear();
979
    //Cache largest processing time:
980
    biggestEarliestProcessingTime = maxEarliestProcessingTime / 1000000.0;
981
    biggestEarliestProcessingTimeEvent = maxEarliestProcessingTimeEvent;
979 982
    for (IEvent *predecessor = maxEarliestProcessingTimeEvent; predecessor ; predecessor = predecessor->getCriticalPredecessor()) {
980 983
        cachedCriticalPath.insert((ptr_t)predecessor);
981 984
        if(predecessor->getEventNumber() == 0) {
......
983 986
        }
984 987
    }
985 988
}
986

  
989
/*
990
 * Returns the event with the largest calculated earliest Processing time in REAL_TIME mode
991
 * or the largest endtime in other modes within the given event range.
992
 */
987 993
ptr_t SequenceChartFacade::getLargestEndtimeInEventRange(ptr_t startEventPtr, ptr_t endEventPtr) {
988 994
    IEvent *startEvent = (IEvent *)startEventPtr;
989 995
    IEvent *endEvent = (IEvent *)endEventPtr;
......
991 997
    {
992 998
    case REAL_TIME:
993 999
    {
1000
        //Use cached result when range contains all events
1001
        if(startEvent == eventLog->getFirstEvent() && endEvent == eventLog->getLastEvent()) {
1002
            return (ptr_t)biggestEarliestProcessingTimeEvent;
1003
        }
1004

  
994 1005
        long largest = 0;
995 1006
        IEvent* largestEvent = startEvent;
996 1007

  

Also available in: Unified diff