Commit 17a06e54 authored by Simon Tenbusch's avatar Simon Tenbusch

[sequencechart]

- implemented the overlapping indication now also for the REAL TIME domain
parent 5e706c5e
......@@ -2985,14 +2985,41 @@ public class SequenceChart
} else { //showEventOverlapping:
graphics.setForegroundColor(EVENT_BORDER_COLOR);
if (isParallelWithSelection(eventPtr)) {
graphics.setBackgroundColor(OVERLAPPING_EVENT_BACKGROUND_COLOR);
} else {
graphics.setBackgroundColor(NON_OVERLAPPING_EVENT_BACKGROUND_COLOR);
switch (getTimelineMode()) {
case REAL_TIME:
if (isOverlappingRealTimeWithSelection(eventPtr)) {
graphics.setBackgroundColor(OVERLAPPING_EVENT_BACKGROUND_COLOR);
} else {
graphics.setBackgroundColor(NON_OVERLAPPING_EVENT_BACKGROUND_COLOR);
}
break;
default:
if (isParallelWithSelection(eventPtr)) {
graphics.setBackgroundColor(OVERLAPPING_EVENT_BACKGROUND_COLOR);
} else {
graphics.setBackgroundColor(NON_OVERLAPPING_EVENT_BACKGROUND_COLOR);
}
}
}
}
private boolean isOverlappingRealTimeWithSelection(long eventPtr) {
if (selectionEventNumbers.isEmpty()) {
return false;
}
IEvent selected = eventLog.getEventForEventNumber(selectionEventNumbers.get(0));
if (selected.getEventNumber()==0) {
return false; //Exclude Event 0 (management event)
}
if(isLegacyTrace()) {
return false; //Legacy: no duration
}
return sequenceChartFacade.isOverlappingInRealTimeDomain(eventPtr, selected.getCPtr());
}
/**
* Draws a single event at the given coordinates and axis module.
*/
......
......@@ -1099,7 +1099,6 @@ double SequenceChartFacade::getOverlapping(ptr_t eventPtr) {
overlapping += event->getComplexity();
}
}
printf("overlapping %i %f %i %i\n", overlapping, overlapping / (event->getComplexity() * 1.0), event->getComplexity(), event->getEventNumber());
return overlapping / (event->getComplexity() * 1.0);
}
......@@ -1114,7 +1113,6 @@ double SequenceChartFacade::getMaximumOverlapping() {
maxOverlapping = overlapping;
}
}
printf("maxoverlapping %i \n", maxOverlapping);
return maxOverlapping;
}
......@@ -1137,3 +1135,11 @@ double SequenceChartFacade::getOverlappingQuotient(ptr_t eventPtr) {
return overlapping / maximumOverlapping;
}
bool SequenceChartFacade::isOverlappingInRealTimeDomain(ptr_t eventPtr1, ptr_t eventPtr2) {
long eventProcessingTime1 = ((IEvent*)eventPtr1)->getEarliestProcessingTime();
long eventStartTime1 = ((IEvent*)eventPtr1)->getEarliestStartTime();
long eventProcessingTime2 = ((IEvent*)eventPtr2)->getEarliestProcessingTime();
long eventStartTime2 = ((IEvent*)eventPtr2)->getEarliestStartTime();
return !(eventProcessingTime1 < eventStartTime2 || eventProcessingTime2 < eventStartTime1);
}
......@@ -119,6 +119,11 @@ class EVENTLOG_API SequenceChartFacade : public EventLogFacade
double getOverlappingQuotient(ptr_t eventPtr);
/*
* returns true when the events overlap in the REAL_TIME domain (i.e. are executed on two cpus in parallel)
*/
bool isOverlappingInRealTimeDomain(ptr_t eventPtr1, ptr_t eventPtr2);
/*
* Returns whether an event not part of a set of parallel events with more than treshold elements.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment