*******************************************************************************/
package org.eclipse.linuxtools.lttng.ui.views.common;
-import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
+import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.ui.TraceDebug;
-import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeScaleSelectionEvent;
/**
private long startTime = 0;
private long endTime = Long.MAX_VALUE;
private Long selectedTime = null;
- private final int defaultWidth = 2000; // number of estimated pixels that
+ private final int DEFAULT_WIDTH = 2000; // number of estimated pixels
+ // that
// can hold the time range space
- private int width = defaultWidth; // width in pixels used to represent the
+ private int width = DEFAULT_WIDTH; // width in pixels used to represent the
// time interval
private double pixelsPerNs = 0;
private int eventsDiscarded = 0;
+ private int eventsDiscardedOutOfView = 0;
+ private int eventsDiscardedNotVisible = 0;
private int eventsDiscardedWrongOrder = 0;
private TmfTimeRange trange = null;
+ public static final int OUT_OF_VIEWRANGE = 0;
+ public static final int NOT_VISIBLE = 1;
+
// ========================================================================
// Methods
// ========================================================================
int dwidth = event.getWidth();
updated = update(time0, time1, dwidth);
- setSelectedTime(event.getSelectedTime());
+
+ // initialization only, otherwise wait for the actual selection
+ // event to update its value. Note that the time must be different
+ // upon selection of a new time in order to trigger an update to all
+ if (selectedTime == null) {
+ setSelectedTime(event.getSelectedTime());
+ }
+
}
return updated;
* @param selTime
*/
public void setSelectedTime(long selTime) {
- if (selTime > startTime && selTime < endTime) {
- selectedTime = selTime;
- } else {
- selectedTime = null;
- }
+ TraceDebug.debug("Selected time changed from: \n\t" + selectedTime //$NON-NLS-1$
+ + " to: \n\t" + selTime); //$NON-NLS-1$
+ selectedTime = selTime;
}
/**
// update succeeded
updated = true;
- TraceDebug.debug("Configuration updated to: StartTime: " /* */
+ TraceDebug.debug("Configuration updated to: StartTime: " /* */ //$NON-NLS-1$
+ fTimeStart /* */
- + "-" /* */
+ + "-" /* */ //$NON-NLS-1$
+ fTimeEnd /* */
- + " width: " /* */
- + width + " k: " + pixelsPerNs); /* */
+ + " width: " /* */ //$NON-NLS-1$
+ + width + " k: " + pixelsPerNs); /* */ //$NON-NLS-1$
} else {
TraceDebug
- .debug("End time is not greater than start time, start time: "
- + time0 + " end time: " + time1);
+ .debug("End time is not greater than start time, start time: " //$NON-NLS-1$
+ + time0 + " end time: " + time1); //$NON-NLS-1$
}
return updated;
*/
public int getWidth() {
if (width == 0) {
- return defaultWidth;
- } else {
- TraceDebug.debug("Unexpected width value of 0 pixels");
+ TraceDebug
+ .debug("Unexpected width value of 0 pixels, returning default"); //$NON-NLS-1$
+ return DEFAULT_WIDTH;
}
return width;
eventsDiscarded = value;
if (value == 0) {
eventsDiscardedWrongOrder = 0;
+ eventsDiscardedNotVisible = 0;
+ eventsDiscardedOutOfView = 0;
}
}
/**
*
*/
- public void incrementEventsDiscarded() {
+ public void incrementEventsDiscarded(int reason) {
+ if (reason == OUT_OF_VIEWRANGE) {
+ this.eventsDiscardedOutOfView++;
+ }
+
+ if (reason == NOT_VISIBLE) {
+ this.eventsDiscardedNotVisible++;
+ }
+
this.eventsDiscarded++;
}
}
+ /**
+ * @return
+ */
+ public int getEventsDiscardedNotVisible() {
+ return eventsDiscardedNotVisible;
+
+ }
+
+ /**
+ * @return
+ */
+ public int getEventsDiscardedOutOfViewRange() {
+ return eventsDiscardedOutOfView;
+
+ }
+
/**
* @return
*/