use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry in project tracecompass by tracecompass.
the class LamiReportViewTabPage method updateSelection.
// ------------------------------------------------------------------------
// Signals
// ------------------------------------------------------------------------
// Custom chart signals
/**
* Signal handler for a chart selection update. It will try to propagate a
* {@link TmfSelectionRangeUpdatedSignal} if possible.
*
* @param signal
* The selection update signal
*/
@TmfSignalHandler
public void updateSelection(ChartSelectionUpdateSignal signal) {
/* Make sure we are not sending a signal to ourself */
if (signal.getSource() == this) {
return;
}
/* Make sure the signal comes from the data provider's scope */
if (fResultTable.hashCode() != signal.getDataProvider().hashCode()) {
return;
}
/* Find which index row has been selected */
Set<Object> entries = signal.getSelectedObject();
/* Update the selection */
fSelection = entries;
/* Only propagate to all TraceCompass if there is a single selection */
if (entries.size() == 1) {
LamiTableEntry entry = (LamiTableEntry) Iterables.getOnlyElement(entries);
/* Make sure the selection represent a time range */
LamiTimeRange timeRange = entry.getCorrespondingTimeRange();
if (timeRange == null) {
return;
}
/* Get the timestamps from the time range */
/**
* TODO: Consider low and high limits of timestamps here.
*/
Number tsBeginValueNumber = timeRange.getBegin().getValue();
Number tsEndValueNumber = timeRange.getEnd().getValue();
if (tsBeginValueNumber == null || tsEndValueNumber == null) {
return;
}
/* Send Range update to other views */
ITmfTimestamp start = TmfTimestamp.fromNanos(tsBeginValueNumber.longValue());
ITmfTimestamp end = TmfTimestamp.fromNanos(tsEndValueNumber.longValue());
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, start, end));
}
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry in project tracecompass by tracecompass.
the class LamiAspectTest method lamiDurationAspectTest.
/**
* Test the duration aspect
*
* @throws JSONException
* won't happen
*/
@Test
public void lamiDurationAspectTest() throws JSONException {
LamiTableEntryAspect aspect = new LamiDurationAspect(ASPECT_NAME, 3);
LamiTableEntry entry1 = createLamiData(1);
LamiTableEntry entry2 = createLamiData(2);
assertEquals(ASPECT_NAME + " (ns)", aspect.getLabel());
assertEquals(ASPECT_NAME, aspect.getName());
assertEquals(0, aspect.getComparator().compare(entry1, entry2));
assertEquals("1", aspect.resolveString(entry1));
assertNull(aspect.resolveNumber(entry1));
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry in project tracecompass by tracecompass.
the class LamiAspectTest method lamiIRQNameAspectTest.
/**
* Test the irq name aspect
*
* @throws JSONException
* won't happen
*/
@Test
public void lamiIRQNameAspectTest() throws JSONException {
LamiTableEntryAspect aspect = new LamiIRQNameAspect(ASPECT_NAME, 3);
LamiTableEntry entry1 = createLamiData(1);
LamiTableEntry entry2 = createLamiData(2);
assertEquals(ASPECT_NAME + " (name)", aspect.getLabel());
assertEquals(ASPECT_NAME + " (name)", aspect.getName());
assertEquals(-1, aspect.getComparator().compare(entry1, entry2));
assertEquals("1", aspect.resolveString(entry1));
assertNull(aspect.resolveNumber(entry1));
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry in project tracecompass by tracecompass.
the class LamiAspectTest method lamiEmptyAspectTest.
/**
* Test the empty aspect
*
* @throws JSONException
* won't happen
*/
@Test
public void lamiEmptyAspectTest() throws JSONException {
LamiTableEntryAspect aspect = LamiEmptyAspect.INSTANCE;
LamiTableEntry entry1 = createLamiData(1);
LamiTableEntry entry2 = createLamiData(2);
assertEquals("", aspect.getLabel());
assertEquals("", aspect.getName());
assertEquals(0, aspect.getComparator().compare(entry1, entry2));
assertNull(aspect.resolveString(entry1));
assertNull(aspect.resolveNumber(entry1));
}
use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry in project tracecompass by tracecompass.
the class LamiAspectTest method lamiProcessNameAspectTest.
/**
* Test the process name aspect
*
* @throws JSONException
* won't happen
*/
@Test
public void lamiProcessNameAspectTest() throws JSONException {
LamiTableEntryAspect aspect = new LamiProcessNameAspect(ASPECT_NAME, 0);
LamiTableEntry entry1 = createLamiData(1);
LamiTableEntry entry2 = createLamiData(2);
assertEquals(ASPECT_NAME + " (name)", aspect.getLabel());
assertEquals(ASPECT_NAME + " (name)", aspect.getName());
assertEquals(0, aspect.getComparator().compare(entry1, entry2));
assertNull(aspect.resolveString(entry1));
assertNull(aspect.resolveNumber(entry1));
}
Aggregations