Commit 3e29b8a0 authored by Simon Tenbusch's avatar Simon Tenbusch

[sequencechartfacade]

- better zooming behaviour, when switching timelinemodes
parent 7c7d95e5
......@@ -796,6 +796,9 @@ public class SequenceChart
if (!eventLog.isEmpty())
setViewportSimulationTimeRange(leftRightSimulationTimes);
if(getViewportWidth() != 1)
zoomToFit();
}
/**
......@@ -1200,9 +1203,18 @@ public class SequenceChart
eventLogInput.runWithProgressMonitor(new Runnable() {
public void run() {
int padding = 20;
double firstTimelineCoordinate = sequenceChartFacade.getTimelineCoordinate(eventLog.getFirstEvent());
double lastTimelineCoordinate = sequenceChartFacade.getTimelineCoordinate(eventLog.getLastEvent());
double firstTimelineCoordinate;
double lastTimelineCoordinate;
if(getTimelineMode() == SequenceChart.TimelineMode.REAL_TIME) {
firstTimelineCoordinate = sequenceChartFacade.getTimelineCoordinate(eventLog.getFirstEventRealTime());
lastTimelineCoordinate = sequenceChartFacade.getTimelineEventEndCoordinate(eventLog.getLastEventRealTime());
} else {
firstTimelineCoordinate = sequenceChartFacade.getTimelineCoordinate(eventLog.getFirstEvent());
lastTimelineCoordinate = sequenceChartFacade.getTimelineEventEndCoordinate(eventLog.getLastEvent());
}
double timelineCoordinateDelta = lastTimelineCoordinate - firstTimelineCoordinate;
if (timelineCoordinateDelta == 0)
setPixelPerTimelineUnit(1);
else
......
......@@ -954,7 +954,6 @@ bool SequenceChartFacade::isOnCriticalPath(IEvent* event) {
void SequenceChartFacade::calculateCriticalPath() {
long maxEarliestProcessingTime = 0;
IEvent* maxEarliestProcessingTimeEvent;
printf("bla1");
for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
simtime_t startTime = current->getSimulationTime();
int moduleId = current->getModuleId();
......
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