Search in sources :

Example 31 with TmfSignalHandler

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

the class TmfUml2SDSyncLoader method traceClosed.

/**
 * Signal handler for the trace closed signal.
 *
 * @param signal
 *            The trace closed signal
 */
@TmfSignalHandler
public void traceClosed(TmfTraceClosedSignal signal) {
    if (signal.getTrace() != fTrace) {
        return;
    }
    ITmfEventRequest indexRequest = null;
    fLock.lock();
    try {
        indexRequest = fIndexRequest;
        fIndexRequest = null;
        cancelOngoingRequests();
        if (fFilterCriteria != null) {
            fFilterCriteria.clear();
        }
        FilterListDialog.deactivateSavedGlobalFilters();
    } finally {
        fTrace = null;
        fLock.unlock();
    }
    if (indexRequest != null && !indexRequest.isCompleted()) {
        indexRequest.cancel();
    }
    resetLoader();
}
Also used : ITmfEventRequest(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 32 with TmfSignalHandler

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

the class AbstractSegmentStoreTableViewer method traceClosed.

/**
 * Trace closed handler
 *
 * @param signal
 *            Last opened trace was closed
 */
@TmfSignalHandler
public void traceClosed(TmfTraceClosedSignal signal) {
    ITmfTrace trace = fTrace;
    if (trace == signal.getTrace()) {
        // Cancel the filtering job
        Job job = fFilteringJob;
        if (job != null) {
            job.cancel();
        }
    }
    // Check if there is no more opened trace
    if (TmfTraceManager.getInstance().getActiveTrace() == null) {
        if (!getTableViewer().getTable().isDisposed()) {
            getTableViewer().setInput(null);
            getTableViewer().setItemCount(0);
            refresh();
        }
        ISegmentStoreProvider provider = getSegmentProvider();
        if ((provider != null)) {
            SegmentStoreProviderProgressListener listener = fListener;
            if (listener != null) {
                provider.removeListener(listener);
            }
        }
        fTrace = null;
    }
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) ISegmentStoreProvider(org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider) Job(org.eclipse.core.runtime.jobs.Job) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 33 with TmfSignalHandler

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

the class AbstractSegmentStoreTableViewer method traceSelected.

// ------------------------------------------------------------------------
// Signal handlers
// ------------------------------------------------------------------------
/**
 * Trace selected handler
 *
 * @param signal
 *            Different opened trace (on which segment store analysis as
 *            already been performed) has been selected
 */
@TmfSignalHandler
public void traceSelected(TmfTraceSelectedSignal signal) {
    ITmfTrace trace = signal.getTrace();
    if (trace != fTrace) {
        // Cancel the filtering job from the previous trace
        Job job = fFilteringJob;
        if (job != null) {
            job.cancel();
        }
    }
    fTrace = trace;
    if (trace != null) {
        setData(getSegmentStoreProvider(trace));
    }
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) Job(org.eclipse.core.runtime.jobs.Job) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 34 with TmfSignalHandler

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

the class AbstractSegmentStoreScatterChartViewer2 method traceOpened.

/**
 * @param signal
 *            Signal received when trace is opened
 */
@Override
@TmfSignalHandler
public void traceOpened(@Nullable TmfTraceOpenedSignal signal) {
    super.traceOpened(signal);
    if (getTrace() != null) {
        final TmfTimeRange timeRange = TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange();
        setWindowRange(timeRange.getStartTime().toNanos(), timeRange.getEndTime().toNanos());
    }
}
Also used : TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Example 35 with TmfSignalHandler

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

the class AbstractSegmentStoreScatterChartViewer2 method traceSelected.

// ------------------------------------------------------------------------
// Signal handlers
// ------------------------------------------------------------------------
/**
 * @param signal
 *            Signal received when a different trace is selected
 */
@Override
@TmfSignalHandler
public void traceSelected(@Nullable TmfTraceSelectedSignal signal) {
    super.traceSelected(signal);
    if (getTrace() != null) {
        final TmfTimeRange timeRange = TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange();
        setWindowRange(timeRange.getStartTime().toNanos(), timeRange.getEndTime().toNanos());
    }
}
Also used : 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