Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2012-12-05 11:17:09 -0500
committerBernd Hufmann2012-12-05 12:40:53 -0500
commit2551d61f2066fd6d1e04c68dd6dd8b70a1681621 (patch)
tree1b8b58143a63b62a1b6ca136d313b80fbf84dd3a
parentad85e77c537a5335575f71295bcb8e5b372d7209 (diff)
downloadorg.eclipse.linuxtools-2551d61f2066fd6d1e04c68dd6dd8b70a1681621.tar.gz
org.eclipse.linuxtools-2551d61f2066fd6d1e04c68dd6dd8b70a1681621.tar.xz
org.eclipse.linuxtools-2551d61f2066fd6d1e04c68dd6dd8b70a1681621.zip
Fix mouse wheel zoom in time range histogram
Change-Id: I4739526671a7835fdb420313bbdb9f8e81e79b5f Reviewed-on: https://git.eclipse.org/r/9026 Reviewed-by: Bernd Hufmann <bhufmann@gmail.com> IP-Clean: Bernd Hufmann <bhufmann@gmail.com> Tested-by: Bernd Hufmann <bhufmann@gmail.com> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java14
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java4
2 files changed, 5 insertions, 13 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
index d905d2d95f..617d2d0434 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
@@ -446,7 +446,6 @@ public class HistogramView extends TmfView {
return;
}
- boolean drawTimeRangeHistogram = fTraceStartTime == 0;
TmfTimeRange fullRange = signal.getRange();
fTraceStartTime = fullRange.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
@@ -455,17 +454,6 @@ public class HistogramView extends TmfView {
fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
- if (drawTimeRangeHistogram) {
- long startTime = fTrace.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- long duration = fTrace.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue() - startTime;
- fCurrentTimestamp = fTrace.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- fCurrentEventTimeControl.setValue(fCurrentTimestamp);
- fTimeSpanControl.setValue(duration);
- fFullTraceHistogram.setTimeRange(startTime, duration);
- fTimeRangeHistogram.setTimeRange(startTime, duration);
- sendTimeRangeRequest(startTime, startTime + duration);
- }
-
sendFullRangeRequest(fullRange);
}
@@ -487,6 +475,7 @@ public class HistogramView extends TmfView {
fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
fFullTraceHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(), fWindowSpan);
+ fTimeRangeHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(), fWindowSpan);
if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
sendFullRangeRequest(fullRange);
@@ -605,6 +594,7 @@ public class HistogramView extends TmfView {
TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS);
fTimeRangeHistogram.clear();
+ fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
fTimeRangeHistogram.setTimeRange(startTime, endTime - startTime);
int cacheSize = fTrace.getCacheSize();
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java
index b79fbaffb4..cb1e2c9c3f 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java
@@ -82,7 +82,9 @@ public class TimeRangeHistogram extends Histogram {
*/
public synchronized void setTimeRange(long startTime, long duration) {
fZoom.setNewRange(startTime, duration);
- getDataModel().setTimeRange(startTime, startTime + duration);
+ if (getDataModel().getNbEvents() == 0) {
+ getDataModel().setTimeRange(startTime, startTime + duration);
+ }
}
/**

Back to the top