import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.TmfCommonConstants;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventFilterAppliedSignal;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceModelSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
long offset = trace.getInitialRangeOffset().toNanos();
long endTime = startTs.toNanos() + offset;
final TmfTimeRange selectionRange = new TmfTimeRange(startTs, startTs);
- final TmfTimeRange windowRange = new TmfTimeRange(startTs, new TmfTimestamp(endTime, ITmfTimestamp.NANOSECOND_SCALE));
+ final TmfTimeRange windowRange = new TmfTimeRange(startTs, TmfTimestamp.fromNanos(endTime));
- final TmfTraceContext startCtx = new TmfTraceContext(selectionRange, windowRange, editorFile, null);
+ final TmfTraceContext startCtx = trace.createTraceContext(selectionRange, windowRange, editorFile, null);
fTraces.put(trace, startCtx);
fCurrentTrace = trace;
}
+ /**
+ * Signal propagator
+ * @param signal any signal
+ * @since 2.0
+ */
+ @TmfSignalHandler
+ public synchronized void signalReceived(final @NonNull TmfTraceModelSignal signal) {
+ fTraces.forEach((t, u) -> u.receive(signal));
+ }
+
+
/**
* Handler for the TmfTraceSelectedSignal.
*
if (context == null) {
throw new RuntimeException();
}
- fTraces.put(newTrace, new TmfTraceContext(context.getSelectionRange(),
+ fTraces.put(newTrace, newTrace.createTraceContext(context.getSelectionRange(),
context.getWindowRange(),
context.getEditorFile(),
signal.getEventFilter()));
* else the same as the previous trace context.
*/
TmfTimeRange newSelectionRange = new TmfTimeRange(beginTs, endTs);
- TmfTraceContext newCtx = new TmfTraceContext(newSelectionRange,
+ TmfTraceContext newCtx = trace.createTraceContext(newSelectionRange,
prevCtx.getWindowRange(),
prevCtx.getEditorFile(),
prevCtx.getFilter());
TmfTimeRange newWindowTr = (targetTr == null ? prevCtx.getWindowRange() : targetTr);
/* Keep the values from the old context, except for the window range */
- TmfTraceContext newCtx = new TmfTraceContext(prevCtx.getSelectionRange(),
+ TmfTraceContext newCtx = trace.createTraceContext(prevCtx.getSelectionRange(),
newWindowTr, prevCtx.getEditorFile(), prevCtx.getFilter());
entry.setValue(newCtx);
}