Revision 7c7d95e5 src/eventlog/sequencechartfacade.cc

View differences:

src/eventlog/sequencechartfacade.cc
321 321
        {
322 322
            IEvent* res = eventLog->getFirstEventRealTime();
323 323
            for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
324
                if ((double) current->getEarliestProcessingTime() / 1000000.0 < timelineCoordinate) {
324
                if ((double) current->getEarliestProcessingTime() / 1000000.0 < timelineCoordinate + timelineCoordinateOriginRealTime) {
325 325
                    if (current->getEarliestProcessingTime() > res->getEarliestProcessingTime()) {
326 326
                        res = current;
327 327
                    }
......
366 366
        case REAL_TIME:
367 367
        {
368 368
            IEvent* res = eventLog->getLastEventRealTime();
369
            for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
370
                if ((double) current->getEarliestStartTime() / 1000000.0 > timelineCoordinate) {
369
            for (IEvent *current = eventLog->getLastEventRealTime(); current; current = current->getPreviousEventRealTime()) {
370
                if ((double) current->getEarliestStartTime() / 1000000.0 > timelineCoordinate + timelineCoordinateOriginRealTime) {
371 371
                    if (current->getEarliestStartTime() < res->getEarliestStartTime()) {
372 372
                        res = current;
373 373
                    }
......
961 961
        if(current->getEventEndEntry()) {
962 962
            current->_earliestProcessingTime = current->getComplexity();
963 963
        }
964
        printf("%i \n", current->getEventNumber());
965 964
        current->setCriticalPredecessor(eventLog->getFirstEvent());
966 965
        for (IEvent *antecessor = eventLog->getFirstEvent(); antecessor; antecessor = antecessor->getNextEvent()) {
967 966
            if(antecessor==current) {
......
1156 1155

  
1157 1156
bool compare_events_realtime (IEvent* a, IEvent* b)
1158 1157
{
1159
  return a->getEarliestStartTime() <= b->getEarliestStartTime();
1158
  return (a->getEarliestStartTime() < b->getEarliestStartTime() || (a->getEarliestStartTime() == b->getEarliestStartTime() && a->getEventNumber() < b->getEventNumber()));
1160 1159
}
1161 1160

  
1162 1161

  
......
1184 1183
    //Set last event in eventlog
1185 1184
    eventLog->setLastEventRealTime((Event*)prev);
1186 1185
    //Test:
1186
    /*
1187 1187
    for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
1188 1188
        printf("event %i, simtime %f, time %i \n",current->getEventNumber(), current->getSimulationTime().dbl(), current->getEarliestStartTime());
1189
    }
1189
    }*/
1190 1190

  
1191 1191

  
1192 1192
}

Also available in: Unified diff