Search in sources :

Example 51 with TmfSignalHandler

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);
}
Also used : TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 52 with TmfSignalHandler

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);
    }
}
Also used : TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 53 with TmfSignalHandler

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());
    });
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfTraceContext(org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Aggregations

TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)53 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)22 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)19 ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)6 TmfTraceContext (org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext)6 Job (org.eclipse.core.runtime.jobs.Job)4 IFile (org.eclipse.core.resources.IFile)3 IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)3 TmfTraceElement (org.eclipse.tracecompass.tmf.ui.project.model.TmfTraceElement)3 Collection (java.util.Collection)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 IResource (org.eclipse.core.resources.IResource)2 IStatus (org.eclipse.core.runtime.IStatus)2 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)2 TmfEventRequest (org.eclipse.tracecompass.tmf.core.request.TmfEventRequest)2 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)2 TmfTraceStub (org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub)2 HashMultiset (com.google.common.collect.HashMultiset)1