use of org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems in project tracecompass by tracecompass.
the class DataDrivenTimeGraphProviderFactory method create.
/**
* Create a data provider for a trace
*
* @param trace
* The trace for which to create a provider
* @return A time graph data provider, or <code>null</code> if the data
* provider cannot be built for this trace because it does not have
* the proper analyses.
*/
@Nullable
public ITimeGraphDataProvider<TimeGraphEntryModel> create(ITmfTrace trace) {
Set<@NonNull ITmfAnalysisModuleWithStateSystems> stateSystemModules = new HashSet<>();
List<ITmfStateSystem> sss = new ArrayList<>();
if (fAnalysisIds.isEmpty()) {
/*
* No analysis specified, take all state system analysis modules
*/
Iterables.addAll(stateSystemModules, TmfTraceUtils.getAnalysisModulesOfClass(trace, ITmfAnalysisModuleWithStateSystems.class));
} else {
for (String moduleId : fAnalysisIds) {
// Get the module for the current trace only. The caller will
// take care of
// generating composite providers with experiments
IAnalysisModule module = trace.getAnalysisModule(moduleId);
if (module instanceof ITmfAnalysisModuleWithStateSystems) {
stateSystemModules.add((ITmfAnalysisModuleWithStateSystems) module);
}
}
}
for (ITmfAnalysisModuleWithStateSystems module : stateSystemModules) {
if (module.schedule().isOK() && module.waitForInitialization()) {
module.getStateSystems().forEach(sss::add);
}
}
return (sss.isEmpty() ? null : create(trace, sss, fEntries, fValues, null));
}
use of org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems in project tracecompass by tracecompass.
the class StateSystemPresentationProvider method getEventHoverToolTipInfo.
@Override
public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
Map<String, String> retMap = new LinkedHashMap<>();
if (event instanceof TimeEvent) {
ITimeGraphEntry entry = event.getEntry();
ITmfTreeDataModel model = ((TimeGraphEntry) entry).getEntryModel();
if (model instanceof StateSystemEntryModel) {
TimeGraphEntry moduleEntry = (TimeGraphEntry) entry.getParent();
ModuleEntryModel moduleModel = (ModuleEntryModel) moduleEntry.getEntryModel();
ITmfAnalysisModuleWithStateSystems module = (moduleModel).getModule();
if (module instanceof TmfAbstractAnalysisModule) {
retMap.putAll(((TmfAbstractAnalysisModule) module).getProperties());
}
} else if (model instanceof ModuleEntryModel) {
ITmfAnalysisModuleWithStateSystems module = ((ModuleEntryModel) model).getModule();
retMap.put(Messages.ModuleHelpText, module.getHelpText());
retMap.put(Messages.ModuleIsAutomatic, Boolean.toString(module.isAutomatic()));
}
}
return retMap;
}
use of org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems in project tracecompass by tracecompass.
the class TmfStateSystemExplorer method createPartControl.
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
getTimeGraphViewer().addTimeListener(event -> synchingToTime(event.getBeginTime()));
getTimeGraphViewer().getTimeGraphControl().addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent event) {
ITimeGraphEntry selection = getTimeGraphViewer().getSelection();
if (selection instanceof TimeGraphEntry) {
ITmfTreeDataModel model = ((TimeGraphEntry) selection).getEntryModel();
if (model instanceof ModuleEntryModel && selection.getChildren().isEmpty()) {
/**
* Schedule the analysis if it has not run yet.
*/
ITmfAnalysisModuleWithStateSystems module = ((ModuleEntryModel) model).getModule();
module.schedule();
}
TimeGraphControl control = getTimeGraphViewer().getTimeGraphControl();
boolean expandedState = control.getExpandedState(selection);
control.setExpandedState(selection, !expandedState);
}
}
});
}
Aggregations