Search in sources :

Example 26 with TmfSignalHandler

use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.

the class OffsetDialog method eventSelected.

/**
 * Handler for the event selected signal
 *
 * @param signal
 *            the event selected signal
 */
@TmfSignalHandler
public void eventSelected(final TmfEventSelectedSignal signal) {
    Display.getDefault().asyncExec(() -> {
        for (TmfTraceElement traceElement : fOffsetMap.keySet()) {
            if (traceElement.getResource().equals(signal.getEvent().getTrace().getResource())) {
                fRefTimeMap.put(traceElement, signal.getEvent().getTimestamp());
                fViewer.getViewer().update(traceElement, null);
                break;
            }
        }
    });
}
Also used : TmfTraceElement(org.eclipse.tracecompass.tmf.ui.project.model.TmfTraceElement) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 27 with TmfSignalHandler

use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.

the class OffsetDialog method timeSelected.

/**
 * Handler for the time selected signal
 *
 * @param signal
 *            the event selected signal
 */
@TmfSignalHandler
public void timeSelected(final TmfSelectionRangeUpdatedSignal signal) {
    Display.getDefault().asyncExec(() -> {
        for (TmfTraceElement traceElement : fOffsetMap.keySet()) {
            fTargetTimeMap.put(traceElement, signal.getBeginTime());
            fViewer.getViewer().update(traceElement, null);
        }
    });
}
Also used : TmfTraceElement(org.eclipse.tracecompass.tmf.ui.project.model.TmfTraceElement) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 28 with TmfSignalHandler

use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoader method windowRangeUpdated.

/**
 * Moves to the page that contains the current time provided by signal. No
 * message will be selected however the focus will be set to the message if
 * the provided time is the time of a message.
 *
 * @param signal
 *            The window range signal
 * @since 1.0
 */
@TmfSignalHandler
public void windowRangeUpdated(TmfWindowRangeUpdatedSignal signal) {
    fLock.lock();
    try {
        if ((signal.getSource() != this) && (fFrame != null) && !fIsSignalSent && (!fCheckPoints.isEmpty())) {
            TmfTimeRange newTimeRange = signal.getCurrentRange();
            fIsSelect = false;
            fCurrentTime = newTimeRange.getStartTime();
            moveToMessage();
        }
    } finally {
        fLock.unlock();
    }
}
Also used : TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 29 with TmfSignalHandler

use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.

the class TmfTimeViewer method selectionRangeUpdated.

/**
 * Signal handler for handling of the selected range signal.
 *
 * @param signal
 *            The {@link TmfSelectionRangeUpdatedSignal}
 * @since 1.0
 */
@TmfSignalHandler
public void selectionRangeUpdated(@Nullable TmfSelectionRangeUpdatedSignal signal) {
    final ITmfTrace trace = fTrace;
    if (signal != null && (signal.getSource() != this) && (trace != null)) {
        TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
        long selectedTime = ctx.getSelectionRange().getStartTime().toNanos();
        long selectedEndTime = ctx.getSelectionRange().getEndTime().toNanos();
        setSelectionRange(selectedTime, selectedEndTime);
    }
}
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)

Example 30 with TmfSignalHandler

use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.

the class TmfTimeViewer method windowRangeUpdated.

/**
 * Signal handler for handling of the window range signal.
 *
 * @param signal
 *            The {@link TmfWindowRangeUpdatedSignal}
 * @since 1.0
 */
@TmfSignalHandler
public void windowRangeUpdated(@Nullable TmfWindowRangeUpdatedSignal signal) {
    final ITmfTrace trace = fTrace;
    if (signal != null && trace != null) {
        TmfTraceContext ctx = TmfTraceManager.getInstance().getTraceContext(trace);
        // Validate the time range
        TmfTimeRange range = ctx.getWindowRange().getIntersection(trace.getTimeRange());
        if (range == null) {
            return;
        }
        if (signal.getSource() != this) {
            // Update the time range
            long windowStartTime = range.getStartTime().toNanos();
            long windowEndTime = range.getEndTime().toNanos();
            setWindowRange(windowStartTime, windowEndTime);
        }
    }
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfTraceContext(org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) 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