Merge branch 'master' into lttng-kepler
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / histogram / HistogramView.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2011, 2012 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * William Bourque - Initial API and implementation
11 * Yuriy Vashchuk - GUI reorganisation, simplification and some related code improvements.
12 * Yuriy Vashchuk - Histograms optimisation.
13 * Yuriy Vashchuk - Histogram Canvas Heritage correction
14 * Francois Chouinard - Cleanup and refactoring
15 * Francois Chouinard - Moved from LTTng to TMF
16 *******************************************************************************/
17
18 package org.eclipse.linuxtools.tmf.ui.views.histogram;
19
20 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
21 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
22 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
23 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
24 import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
25 import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
26 import org.eclipse.linuxtools.tmf.core.signal.TmfRangeSynchSignal;
27 import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
28 import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
29 import org.eclipse.linuxtools.tmf.core.signal.TmfTimeSynchSignal;
30 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal;
31 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal;
32 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal;
33 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
34 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
35 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
36 import org.eclipse.linuxtools.tmf.ui.editors.ITmfTraceEditor;
37 import org.eclipse.linuxtools.tmf.ui.views.TmfView;
38 import org.eclipse.swt.SWT;
39 import org.eclipse.swt.layout.GridData;
40 import org.eclipse.swt.layout.GridLayout;
41 import org.eclipse.swt.widgets.Composite;
42 import org.eclipse.ui.IEditorPart;
43 import org.eclipse.ui.PlatformUI;
44
45 /**
46 * The purpose of this view is to provide graphical time distribution statistics about the trace events.
47 * <p>
48 * The view is composed of two histograms and two controls:
49 * <ul>
50 * <li>an event distribution histogram for the whole trace;
51 * <li>an event distribution histogram for current time window (window span);
52 * <li>the timestamp of the currently selected event;
53 * <li>the window span (size of the time window of the smaller histogram).
54 * </ul>
55 * The histograms x-axis show their respective time range.
56 *
57 * @version 2.0
58 * @author Francois Chouinard
59 */
60 public class HistogramView extends TmfView {
61
62 // ------------------------------------------------------------------------
63 // Constants
64 // ------------------------------------------------------------------------
65
66 /**
67 * The view ID as defined in plugin.xml
68 */
69 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.histogram"; //$NON-NLS-1$
70
71 /**
72 * The initial window span (in nanoseconds)
73 */
74 public static final long INITIAL_WINDOW_SPAN = (1L * 100 * 1000 * 1000); // .1sec
75
76 // ------------------------------------------------------------------------
77 // Attributes
78 // ------------------------------------------------------------------------
79
80 // Parent widget
81 private Composite fParent;
82
83 // The current trace
84 private ITmfTrace fTrace;
85
86 // Current timestamp/time window - everything in the TIME_SCALE
87 private long fTraceStartTime;
88 private long fTraceEndTime;
89 private long fWindowStartTime;
90 private long fWindowEndTime;
91 private long fWindowSpan = INITIAL_WINDOW_SPAN;
92 private long fCurrentTimestamp;
93
94 // Time controls
95 private HistogramTextControl fCurrentEventTimeControl;
96 private HistogramTextControl fTimeSpanControl;
97
98 // Histogram/request for the full trace range
99 private static FullTraceHistogram fFullTraceHistogram;
100 private HistogramRequest fFullTraceRequest;
101
102 // Histogram/request for the selected time range
103 private static TimeRangeHistogram fTimeRangeHistogram;
104 private HistogramRequest fTimeRangeRequest;
105
106 // ------------------------------------------------------------------------
107 // Constructor
108 // ------------------------------------------------------------------------
109
110 /**
111 * Default constructor
112 */
113 public HistogramView() {
114 super(ID);
115 }
116
117 @Override
118 public void dispose() {
119 if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
120 fTimeRangeRequest.cancel();
121 }
122 if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
123 fFullTraceRequest.cancel();
124 }
125 fFullTraceHistogram.dispose();
126 fTimeRangeHistogram.dispose();
127 fCurrentEventTimeControl.dispose();
128 fTimeSpanControl.dispose();
129 super.dispose();
130 }
131
132 // ------------------------------------------------------------------------
133 // TmfView
134 // ------------------------------------------------------------------------
135
136 @Override
137 public void createPartControl(Composite parent) {
138
139 fParent = parent;
140
141 // Control labels
142 final String currentEventLabel = Messages.HistogramView_currentEventLabel;
143 final String windowSpanLabel = Messages.HistogramView_windowSpanLabel;
144
145 // --------------------------------------------------------------------
146 // Set the HistogramView layout
147 // --------------------------------------------------------------------
148
149 Composite viewComposite = new Composite(fParent, SWT.FILL);
150 GridLayout gridLayout = new GridLayout();
151 gridLayout.numColumns = 2;
152 gridLayout.horizontalSpacing = 5;
153 gridLayout.verticalSpacing = 0;
154 gridLayout.marginHeight = 0;
155 gridLayout.marginWidth = 0;
156 viewComposite.setLayout(gridLayout);
157
158 // Use all available space
159 GridData gridData = new GridData();
160 gridData.horizontalAlignment = SWT.FILL;
161 gridData.verticalAlignment = SWT.FILL;
162 gridData.grabExcessHorizontalSpace = true;
163 viewComposite.setLayoutData(gridData);
164
165 // --------------------------------------------------------------------
166 // Time controls
167 // --------------------------------------------------------------------
168
169 Composite controlsComposite = new Composite(viewComposite, SWT.FILL);
170 gridLayout = new GridLayout();
171 gridLayout.numColumns = 2;
172 gridLayout.marginHeight = 0;
173 gridLayout.marginWidth = 0;
174 gridLayout.horizontalSpacing = 5;
175 gridLayout.verticalSpacing = 0;
176 gridLayout.makeColumnsEqualWidth = false;
177 gridLayout.marginLeft = 5;
178 gridLayout.marginRight = 5;
179 controlsComposite.setLayout(gridLayout);
180
181 // Current event time control
182 gridData = new GridData();
183 gridData.horizontalAlignment = SWT.CENTER;
184 gridData.verticalAlignment = SWT.CENTER;
185 fCurrentEventTimeControl = new HistogramCurrentTimeControl(this, controlsComposite, currentEventLabel, 0L);
186 fCurrentEventTimeControl.setLayoutData(gridData);
187 fCurrentEventTimeControl.setValue(0L);
188
189 // Window span time control
190 gridData = new GridData();
191 gridData.horizontalAlignment = SWT.CENTER;
192 gridData.verticalAlignment = SWT.CENTER;
193 fTimeSpanControl = new HistogramTimeRangeControl(this, controlsComposite, windowSpanLabel, 0L);
194 fTimeSpanControl.setLayoutData(gridData);
195 fTimeSpanControl.setValue(0L);
196
197 // --------------------------------------------------------------------
198 // Time range histogram
199 // --------------------------------------------------------------------
200
201 Composite timeRangeComposite = new Composite(viewComposite, SWT.FILL);
202 gridLayout = new GridLayout();
203 gridLayout.numColumns = 1;
204 gridLayout.marginHeight = 0;
205 gridLayout.marginWidth = 0;
206 gridLayout.marginTop = 5;
207 gridLayout.horizontalSpacing = 0;
208 gridLayout.verticalSpacing = 0;
209 gridLayout.marginLeft = 5;
210 gridLayout.marginRight = 5;
211 timeRangeComposite.setLayout(gridLayout);
212
213 // Use remaining horizontal space
214 gridData = new GridData();
215 gridData.horizontalAlignment = SWT.FILL;
216 gridData.verticalAlignment = SWT.FILL;
217 gridData.grabExcessHorizontalSpace = true;
218 timeRangeComposite.setLayoutData(gridData);
219
220 // Histogram
221 fTimeRangeHistogram = new TimeRangeHistogram(this, timeRangeComposite);
222
223 // --------------------------------------------------------------------
224 // Full range histogram
225 // --------------------------------------------------------------------
226
227 Composite fullRangeComposite = new Composite(viewComposite, SWT.FILL);
228 gridLayout = new GridLayout();
229 gridLayout.numColumns = 1;
230 gridLayout.marginHeight = 0;
231 gridLayout.marginWidth = 0;
232 gridLayout.marginTop = 5;
233 gridLayout.horizontalSpacing = 0;
234 gridLayout.verticalSpacing = 0;
235 gridLayout.marginLeft = 5;
236 gridLayout.marginRight = 5;
237 fullRangeComposite.setLayout(gridLayout);
238
239 // Use remaining horizontal space
240 gridData = new GridData();
241 gridData.horizontalAlignment = SWT.FILL;
242 gridData.verticalAlignment = SWT.FILL;
243 gridData.horizontalSpan = 2;
244 gridData.grabExcessHorizontalSpace = true;
245 fullRangeComposite.setLayoutData(gridData);
246
247 // Histogram
248 fFullTraceHistogram = new FullTraceHistogram(this, fullRangeComposite);
249
250 IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
251 if (editor instanceof ITmfTraceEditor) {
252 ITmfTrace trace = ((ITmfTraceEditor) editor).getTrace();
253 if (trace != null) {
254 traceSelected(new TmfTraceSelectedSignal(this, trace));
255 }
256 }
257 }
258
259 @Override
260 public void setFocus() {
261 fFullTraceHistogram.fCanvas.setFocus();
262 }
263
264 void refresh() {
265 fParent.layout(true);
266 }
267
268 // ------------------------------------------------------------------------
269 // Accessors
270 // ------------------------------------------------------------------------
271
272 /**
273 * Returns the current trace handled by the view
274 *
275 * @return the current trace
276 * @since 2.0
277 */
278 public ITmfTrace getTrace() {
279 return fTrace;
280 }
281
282 /**
283 * Returns the time range of the current selected window (base on default time scale).
284 *
285 * @return the time range of current selected window.
286 */
287 public TmfTimeRange getTimeRange() {
288 return new TmfTimeRange(
289 new TmfTimestamp(fWindowStartTime, ITmfTimestamp.NANOSECOND_SCALE),
290 new TmfTimestamp(fWindowEndTime, ITmfTimestamp.NANOSECOND_SCALE));
291 }
292
293 // ------------------------------------------------------------------------
294 // Operations
295 // ------------------------------------------------------------------------
296
297 /**
298 * Broadcast TmfSignal about new current time value.
299 * @param newTime the new current time.
300 */
301 void updateCurrentEventTime(long newTime) {
302 if (fTrace != null) {
303 TmfTimeRange timeRange = new TmfTimeRange(new TmfTimestamp(newTime, ITmfTimestamp.NANOSECOND_SCALE), TmfTimestamp.BIG_CRUNCH);
304 HistogramRequest request = new HistogramRequest(fTimeRangeHistogram.getDataModel(), timeRange, 0, 1, 0, ExecutionType.FOREGROUND) {
305 @Override
306 public void handleData(ITmfEvent event) {
307 if (event != null) {
308 TmfTimeSynchSignal signal = new TmfTimeSynchSignal(this, event.getTimestamp());
309 TmfSignalManager.dispatchSignal(signal);
310 }
311 }
312 };
313 fTrace.sendRequest(request);
314 }
315 }
316
317 /**
318 * Broadcast TmfSignal about new selected time range.
319 * @param startTime the new start time
320 * @param endTime the new end time
321 */
322 void updateTimeRange(long startTime, long endTime) {
323 if (fTrace != null) {
324 // Build the new time range; keep the current time
325 TmfTimeRange timeRange = new TmfTimeRange(
326 new TmfTimestamp(startTime, ITmfTimestamp.NANOSECOND_SCALE),
327 new TmfTimestamp(endTime, ITmfTimestamp.NANOSECOND_SCALE));
328 ITmfTimestamp currentTime = new TmfTimestamp(fCurrentTimestamp, ITmfTimestamp.NANOSECOND_SCALE);
329 fTimeSpanControl.setValue(endTime - startTime);
330
331 // Send the FW signal
332 TmfRangeSynchSignal signal = new TmfRangeSynchSignal(this, timeRange, currentTime);
333 TmfSignalManager.dispatchSignal(signal);
334 }
335 }
336
337 /**
338 * Broadcast TmfSignal about new selected time range.
339 * @param newDuration new duration (relative to current start time)
340 */
341 public synchronized void updateTimeRange(long newDuration) {
342 if (fTrace != null) {
343 long delta = newDuration - fWindowSpan;
344 long newStartTime = fWindowStartTime + (delta / 2);
345 setNewRange(newStartTime, newDuration);
346 }
347 }
348
349 private void setNewRange(long startTime, long duration) {
350 if (startTime < fTraceStartTime) {
351 startTime = fTraceStartTime;
352 }
353
354 long endTime = startTime + duration;
355 if (endTime > fTraceEndTime) {
356 endTime = fTraceEndTime;
357 if ((endTime - duration) > fTraceEndTime) {
358 startTime = endTime - duration;
359 } else {
360 startTime = fTraceStartTime;
361 }
362 }
363 updateTimeRange(startTime, endTime);
364 }
365
366 // ------------------------------------------------------------------------
367 // Signal handlers
368 // ------------------------------------------------------------------------
369
370 /**
371 * Handles trace opened signal. Loads histogram if new trace time range is not
372 * equal <code>TmfTimeRange.NULL_RANGE</code>
373 * @param signal the trace selected signal
374 * @since 2.0
375 */
376 @TmfSignalHandler
377 public void traceOpened(TmfTraceOpenedSignal signal) {
378 assert (signal != null);
379 fTrace = signal.getTrace();
380 loadTrace();
381 }
382
383 /**
384 * Handles trace selected signal. Loads histogram if new trace time range is not
385 * equal <code>TmfTimeRange.NULL_RANGE</code>
386 * @param signal the trace selected signal
387 * @since 2.0
388 */
389 @TmfSignalHandler
390 public void traceSelected(TmfTraceSelectedSignal signal) {
391 assert (signal != null);
392 if (fTrace != signal.getTrace()) {
393 fTrace = signal.getTrace();
394 loadTrace();
395 }
396 }
397
398 private void loadTrace() {
399 initializeHistograms();
400 fParent.redraw();
401 }
402
403 /**
404 * Handles trace closed signal. Clears the view and data model and cancels requests.
405 * @param signal the trace closed signal
406 * @since 2.0
407 */
408 @TmfSignalHandler
409 public void traceClosed(TmfTraceClosedSignal signal) {
410
411 if (signal.getTrace() != fTrace) {
412 return;
413 }
414
415 // Kill any running request
416 if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
417 fTimeRangeRequest.cancel();
418 }
419 if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
420 fFullTraceRequest.cancel();
421 }
422
423 // Initialize the internal data
424 fTrace = null;
425 fTraceStartTime = 0L;
426 fTraceEndTime = 0L;
427 fWindowStartTime = 0L;
428 fWindowEndTime = 0L;
429 fWindowSpan = INITIAL_WINDOW_SPAN;
430 fCurrentTimestamp = 0L;
431
432 // Clear the UI widgets
433 fFullTraceHistogram.clear();
434 fTimeRangeHistogram.clear();
435 fCurrentEventTimeControl.setValue(0L);
436
437 fTimeSpanControl.setValue(0);
438 }
439
440 /**
441 * Handles trace range updated signal. Extends histogram according to the new time range. If a
442 * HistogramRequest is already ongoing, it will be cancelled and a new request with the new range
443 * will be issued.
444 *
445 * @param signal the trace range updated signal
446 * @since 2.0
447 */
448 @TmfSignalHandler
449 public void traceRangeUpdated(TmfTraceRangeUpdatedSignal signal) {
450
451 if (signal.getTrace() != fTrace) {
452 return;
453 }
454
455 boolean drawTimeRangeHistogram = fTraceStartTime == 0;
456 TmfTimeRange fullRange = signal.getRange();
457
458 fTraceStartTime = fullRange.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
459 fTraceEndTime = fullRange.getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
460
461 fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
462 fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
463
464 if (drawTimeRangeHistogram) {
465 fCurrentTimestamp = fTraceStartTime;
466 fCurrentEventTimeControl.setValue(fCurrentTimestamp);
467 fFullTraceHistogram.setTimeRange(fTraceStartTime, INITIAL_WINDOW_SPAN);
468 fTimeRangeHistogram.setTimeRange(fTraceStartTime, INITIAL_WINDOW_SPAN);
469 sendTimeRangeRequest(fTraceStartTime, fTraceStartTime + INITIAL_WINDOW_SPAN);
470 }
471
472 sendFullRangeRequest(fullRange);
473 }
474
475 /**
476 * Handles the trace updated signal. Used to update time limits (start and end time)
477 * @param signal the trace updated signal
478 * @since 2.0
479 */
480 @TmfSignalHandler
481 public void traceUpdated(TmfTraceUpdatedSignal signal) {
482 if (signal.getTrace() != fTrace) {
483 return;
484 }
485 TmfTimeRange fullRange = signal.getTrace().getTimeRange();
486 fTraceStartTime = fullRange.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
487 fTraceEndTime = fullRange.getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
488
489 fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
490 fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
491
492 fFullTraceHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(), fWindowSpan);
493
494 if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
495 sendFullRangeRequest(fullRange);
496 }
497 }
498
499 /**
500 * Handles the current time updated signal. Sets the current time in the time range
501 * histogram as well as the full histogram.
502 *
503 * @param signal the signal to process
504 */
505 @TmfSignalHandler
506 public void currentTimeUpdated(TmfTimeSynchSignal signal) {
507 // Because this can't happen :-)
508 assert (signal != null);
509
510 // Update the selected event time
511 ITmfTimestamp currentTime = signal.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE);
512 fCurrentTimestamp = currentTime.getValue();
513
514 // Notify the relevant widgets
515 fFullTraceHistogram.setCurrentEvent(fCurrentTimestamp);
516 fTimeRangeHistogram.setCurrentEvent(fCurrentTimestamp);
517 fCurrentEventTimeControl.setValue(fCurrentTimestamp);
518 }
519
520 /**
521 * Updates the current time range in the time range histogram and full range histogram.
522 * @param signal the signal to process
523 */
524 @TmfSignalHandler
525 public void timeRangeUpdated(TmfRangeSynchSignal signal) {
526 // Because this can't happen :-)
527 assert (signal != null);
528
529 if (fTrace != null) {
530 // Update the time range
531 fWindowStartTime = signal.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
532 fWindowEndTime = signal.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
533 fWindowSpan = fWindowEndTime - fWindowStartTime;
534
535 // Notify the relevant widgets
536 sendTimeRangeRequest(fWindowStartTime, fWindowEndTime);
537 fFullTraceHistogram.setTimeRange(fWindowStartTime, fWindowSpan);
538
539 fTimeSpanControl.setValue(fWindowSpan);
540 }
541 }
542
543 // ------------------------------------------------------------------------
544 // Helper functions
545 // ------------------------------------------------------------------------
546
547 private void initializeHistograms() {
548 TmfTimeRange fullRange = updateTraceTimeRange();
549
550 if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
551 fTimeRangeRequest.cancel();
552 }
553 fTimeRangeHistogram.clear();
554 fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
555 fTimeRangeHistogram.setTimeRange(fTraceStartTime, INITIAL_WINDOW_SPAN);
556 fTimeRangeHistogram.setCurrentEvent(fTraceStartTime);
557
558 if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
559 fFullTraceRequest.cancel();
560 }
561 fFullTraceHistogram.clear();
562 fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
563 fFullTraceHistogram.setTimeRange(fTraceStartTime, INITIAL_WINDOW_SPAN);
564 fFullTraceHistogram.setCurrentEvent(fTraceStartTime);
565
566 fWindowStartTime = fTraceStartTime;
567 fWindowSpan = INITIAL_WINDOW_SPAN;
568 fWindowEndTime = fWindowStartTime + fWindowSpan;
569
570 fCurrentEventTimeControl.setValue(fTraceStartTime);
571
572 fTimeSpanControl.setValue(fWindowSpan);
573
574 if (!fullRange.equals(TmfTimeRange.NULL_RANGE)) {
575 sendTimeRangeRequest(fTraceStartTime, fTraceStartTime + fWindowSpan);
576 sendFullRangeRequest(fullRange);
577 }
578 }
579
580 private TmfTimeRange updateTraceTimeRange() {
581 fTraceStartTime = 0L;
582 fTraceEndTime = 0L;
583 fCurrentTimestamp = 0L;
584
585 TmfTimeRange timeRange = fTrace.getTimeRange();
586 if (!timeRange.equals(TmfTimeRange.NULL_RANGE)) {
587 fTraceStartTime = timeRange.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
588 fTraceEndTime = timeRange.getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
589 fCurrentTimestamp = fTraceStartTime;
590 }
591 return timeRange;
592 }
593
594 private void sendTimeRangeRequest(long startTime, long endTime) {
595 if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
596 fTimeRangeRequest.cancel();
597 }
598 TmfTimestamp startTS = new TmfTimestamp(startTime, ITmfTimestamp.NANOSECOND_SCALE);
599 TmfTimestamp endTS = new TmfTimestamp(endTime, ITmfTimestamp.NANOSECOND_SCALE);
600 TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS);
601
602 fTimeRangeHistogram.clear();
603 fTimeRangeHistogram.setTimeRange(startTime, endTime - startTime);
604
605 int cacheSize = fTrace.getCacheSize();
606 fTimeRangeRequest = new HistogramRequest(fTimeRangeHistogram.getDataModel(), timeRange, 0, TmfDataRequest.ALL_DATA, cacheSize, ExecutionType.FOREGROUND);
607 fTrace.sendRequest(fTimeRangeRequest);
608 }
609
610 private void sendFullRangeRequest(TmfTimeRange fullRange) {
611 if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
612 fFullTraceRequest.cancel();
613 }
614 int cacheSize = fTrace.getCacheSize();
615 fFullTraceRequest = new HistogramRequest(fFullTraceHistogram.getDataModel(), fullRange, (int) fFullTraceHistogram.fDataModel.getNbEvents(),
616 TmfDataRequest.ALL_DATA, cacheSize, ExecutionType.BACKGROUND);
617 fTrace.sendRequest(fFullTraceRequest);
618 }
619
620 }
This page took 0.044089 seconds and 6 git commands to generate.