use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class HistogramView method traceRangeUpdated.
/**
* Handles trace range updated signal. Extends histogram according to the new time range. If a
* HistogramRequest is already ongoing, it will be cancelled and a new request with the new range
* will be issued.
*
* @param signal the trace range updated signal
*/
@TmfSignalHandler
public void traceRangeUpdated(TmfTraceRangeUpdatedSignal signal) {
if (signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getRange();
fTraceStartTime = fullRange.getStartTime().toNanos();
fTraceEndTime = fullRange.getEndTime().toNanos();
fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
sendFullRangeRequest(fullRange);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class HistogramView method traceUpdated.
/**
* Handles the trace updated signal. Used to update time limits (start and end time)
* @param signal the trace updated signal
*/
@TmfSignalHandler
public void traceUpdated(TmfTraceUpdatedSignal signal) {
if (signal.getTrace() != fTrace) {
return;
}
TmfTimeRange fullRange = signal.getTrace().getTimeRange();
fTraceStartTime = fullRange.getStartTime().toNanos();
fTraceEndTime = fullRange.getEndTime().toNanos();
fFullTraceHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
fTimeRangeHistogram.setFullRange(fTraceStartTime, fTraceEndTime);
if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
sendFullRangeRequest(fullRange);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class AbstractTimeGraphView method selectionRangeUpdated.
/**
* Handler for the selection range signal.
*
* @param signal
* The signal that's received
* @since 1.0
*/
@TmfSignalHandler
public void selectionRangeUpdated(final TmfSelectionRangeUpdatedSignal signal) {
final ITmfTrace trace = fTrace;
if (signal.getSource() == this || trace == null) {
return;
}
ITmfTrace signalTrace = signal.getTrace();
if (signalTrace != null && !TmfTraceManager.getInstance().isSynchronized(trace, signalTrace)) {
return;
}
TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
long beginTime = ctx.getSelectionRange().getStartTime().toNanos();
long endTime = ctx.getSelectionRange().getEndTime().toNanos();
Display.getDefault().asyncExec(() -> {
if (fTimeGraphViewer.getControl().isDisposed()) {
return;
}
if (beginTime == endTime) {
fTimeGraphViewer.setSelectedTime(beginTime, true);
} else {
fTimeGraphViewer.setSelectionRange(beginTime, endTime, true);
}
synchingToTime(fTimeGraphViewer.getSelectionBegin());
});
}
Aggregations