Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2014-06-06 18:38:43 +0000
committerGenevieve Bastien2014-06-12 14:15:48 +0000
commit06779c48a77ab9eefd01ad3760922e865640bf4c (patch)
tree130e68f43944e16821fa3ef4aea2c3846bf87d5c
parent92cc51c4d66ada291c83b112ffc1ef688ee5031f (diff)
downloadorg.eclipse.linuxtools-06779c48a77ab9eefd01ad3760922e865640bf4c.tar.gz
org.eclipse.linuxtools-06779c48a77ab9eefd01ad3760922e865640bf4c.tar.xz
org.eclipse.linuxtools-06779c48a77ab9eefd01ad3760922e865640bf4c.zip
TMF: Bug 436877: Set initial range in XY chart to the current range
Instead of using the trace's initial range, which may not correspond to the currently visible range if the trace was already opened. Change-Id: Iad5c8e7a579223d4c2c7d98d56c8ae7fb81c5743 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/28154 Tested-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfTimeViewer.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfTimeViewer.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfTimeViewer.java
index 0de95d5ee1..63915c89ba 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfTimeViewer.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/TmfTimeViewer.java
@@ -274,7 +274,10 @@ public abstract class TmfTimeViewer extends TmfViewer implements ITmfTimeProvide
fTrace = trace;
long timestamp = TmfTraceManager.getInstance().getSelectionBeginTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- long windowStartTime = TmfTraceManager.getInstance().getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ TmfTimeRange currentRange = TmfTraceManager.getInstance().getCurrentRange();
+ long windowStartTime = currentRange.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ long windowEndTime = currentRange.getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ long windowDuration = windowEndTime - windowStartTime;
long startTime = fTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
long endTime = fTrace.getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
@@ -282,9 +285,9 @@ public abstract class TmfTimeViewer extends TmfViewer implements ITmfTimeProvide
setSelectionEndTime(timestamp);
setStartTime(startTime);
setWindowStartTime(windowStartTime);
- setWindowDuration(fTrace.getInitialRangeOffset().getValue());
+ setWindowEndTime(windowEndTime);
+ setWindowDuration(windowDuration);
setEndTime(endTime);
- setWindowEndTime(windowStartTime + getWindowDuration());
}
/**

Back to the top