use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class TmfStatisticsViewer method timeSynchUpdated.
/**
* Handles the time synch updated signal. It updates the time range
* statistics.
*
* @param signal
* Contains the information about the new selected time range.
* @since 1.0
*/
@TmfSignalHandler
public void timeSynchUpdated(TmfSelectionRangeUpdatedSignal signal) {
if (fTrace == null) {
return;
}
ITmfTimestamp begin = signal.getBeginTime();
ITmfTimestamp end = signal.getEndTime();
TmfTimeRange timeRange;
if (begin.compareTo(end) <= 0) {
timeRange = new TmfTimeRange(begin, end);
} else {
timeRange = new TmfTimeRange(end, begin);
}
requestTimeRangeData(fTrace, timeRange);
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method getPage.
/**
* Gets page that contains timestamp
*
* @param time
* The timestamp
* @return page that contains the time
*/
protected int getPage(ITmfTimestamp time) {
int page;
int size;
fLock.lock();
try {
size = fCheckPoints.size();
for (page = 0; page < size; page++) {
TmfTimeRange timeRange = fCheckPoints.get(page);
if (timeRange.getEndTime().compareTo(time) >= 0) {
break;
}
}
if (page >= size) {
page = size - 1;
}
return page;
} finally {
fLock.unlock();
}
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class TmfTimeViewer method traceRangeUpdated.
/**
* Signal handler for handling of the trace range updated signal.
*
* @param signal
* The trace range signal {@link TmfTraceRangeUpdatedSignal}
*/
@TmfSignalHandler
public void traceRangeUpdated(@Nullable TmfTraceRangeUpdatedSignal signal) {
if (signal == null || signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getRange();
long traceStartTime = fullRange.getStartTime().toNanos();
long traceEndTime = fullRange.getEndTime().toNanos();
setStartTime(traceStartTime);
setEndTime(traceEndTime);
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class TmfTimeViewer method traceUpdated.
/**
* Signal handler for handling of the trace updated signal.
*
* @param signal
* The trace updated signal {@link TmfTraceUpdatedSignal}
*/
@TmfSignalHandler
public void traceUpdated(@Nullable TmfTraceUpdatedSignal signal) {
if (signal == null || signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getTrace().getTimeRange();
long traceStartTime = fullRange.getStartTime().toNanos();
long traceEndTime = fullRange.getEndTime().toNanos();
setStartTime(traceStartTime);
setEndTime(traceEndTime);
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class TmfTimeViewer method loadTrace.
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
/**
* A Method to load a trace into the viewer.
*
* @param trace
* A trace to apply in the viewer
*/
public void loadTrace(ITmfTrace trace) {
fTrace = trace;
if (trace == null) {
return;
}
TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
long selectionStart = ctx.getSelectionRange().getStartTime().toNanos();
long selectionEnd = ctx.getSelectionRange().getEndTime().toNanos();
TmfTimeRange windowRange = ctx.getWindowRange();
long windowStartTime = windowRange.getStartTime().toNanos();
long windowEndTime = windowRange.getEndTime().toNanos();
long startTime = fTrace.getStartTime().toNanos();
long endTime = fTrace.getEndTime().toNanos();
setSelectionRange(selectionStart, selectionEnd);
setStartTime(startTime);
setWindowRange(windowStartTime, windowEndTime);
setEndTime(endTime);
}
Aggregations