use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class XmlDataProviderManager method traceClosed.
/**
* Signal handler for the traceClosed signal.
*
* @param signal
* The incoming signal
*/
@TmfSignalHandler
public synchronized void traceClosed(final TmfTraceClosedSignal signal) {
for (ITmfTrace trace : TmfTraceManager.getTraceSetWithExperiment(signal.getTrace())) {
fXyProviders.row(trace).clear();
fTimeGraphProviders.row(trace).clear();
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TimeChartView method traceSelected.
/**
* Handler for the Trace Selected signal
*
* @param signal
* The incoming signal
*/
@TmfSignalHandler
public void traceSelected(TmfTraceSelectedSignal signal) {
if (signal.getSource() != this) {
ITmfTrace trace = signal.getTrace();
for (int i = 0; i < fTimeAnalysisEntries.size(); i++) {
if (fTimeAnalysisEntries.get(i).getTrace().equals(trace)) {
fViewer.setSelection(fTimeAnalysisEntries.get(i), true);
break;
}
}
TmfTraceContext ctx = TmfTraceManager.getInstance().getCurrentTraceContext();
long beginTime = ctx.getSelectionRange().getStartTime().toNanos();
long endTime = ctx.getSelectionRange().getEndTime().toNanos();
fViewer.setSelectionRange(beginTime, endTime, false);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class AbstractTimeGraphView method windowRangeUpdated.
/**
* Handler for the window range signal.
*
* @param signal
* The signal that's received
* @since 1.0
*/
@TmfSignalHandler
public void windowRangeUpdated(final TmfWindowRangeUpdatedSignal signal) {
if (signal.getSource() == this || fTrace == null) {
return;
}
TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(checkNotNull(fTrace));
final long startTime = ctx.getWindowRange().getStartTime().toNanos();
final long endTime = ctx.getWindowRange().getEndTime().toNanos();
Display.getDefault().asyncExec(() -> {
if (fTimeGraphViewer.getControl().isDisposed()) {
return;
}
if (startTime == fTimeGraphViewer.getTime0() && endTime == fTimeGraphViewer.getTime1()) {
return;
}
fTimeGraphViewer.setStartFinishTime(startTime, endTime);
startZoomThread(startTime, endTime);
});
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class HistogramView method windowRangeUpdated.
/**
* Updates the current window time range in the time range histogram and
* full range histogram.
*
* @param signal
* the signal to process
* @since 1.0
*/
@TmfSignalHandler
public void windowRangeUpdated(final TmfWindowRangeUpdatedSignal signal) {
if (Display.getCurrent() == null) {
// Make sure the signal is handled in the UI thread
Display.getDefault().asyncExec(() -> {
if (getParentComposite().isDisposed()) {
return;
}
windowRangeUpdated(signal);
});
return;
}
if (fTrace != null) {
// Validate the time range
TmfTimeRange range = signal.getCurrentRange().getIntersection(fTrace.getTimeRange());
if (range == null) {
return;
}
updateDisplayedTimeRange(range.getStartTime().toNanos(), range.getEndTime().toNanos());
// Send the event request to populate the small histogram
sendTimeRangeRequest(fWindowStartTime, fWindowEndTime);
fTimeSpanControl.setValue(fWindowSpan);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class HistogramView method traceClosed.
/**
* Handles trace closed signal. Clears the view and data model and cancels requests.
* @param signal the trace closed signal
*/
@TmfSignalHandler
public void traceClosed(TmfTraceClosedSignal signal) {
if (signal.getTrace() != fTrace) {
return;
}
// Kill any running request
if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
fTimeRangeRequest.cancel();
}
if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
fFullTraceRequest.cancel();
}
// Initialize the internal data
fTrace = null;
fTraceStartTime = 0L;
fTraceEndTime = 0L;
fWindowStartTime = 0L;
fWindowEndTime = 0L;
fWindowSpan = 0L;
fSelectionBeginTime = 0L;
fSelectionEndTime = 0L;
// Clear the UI widgets
fFullTraceHistogram.clear();
fFullTraceHistogram.fDataModel.setTrace(null);
fTimeRangeHistogram.clear();
fTimeRangeHistogram.fDataModel.setTrace(null);
fSelectionStartControl.setValue(Long.MIN_VALUE);
fSelectionEndControl.setValue(Long.MIN_VALUE);
fTimeSpanControl.setValue(Long.MIN_VALUE);
for (Control c : fLegendArea.getChildren()) {
c.dispose();
}
disposeLegendImages();
fLegendArea.layout();
fLegendArea.getParent().layout();
}
Aggregations