use of org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget in project statecharts by Yakindu.
the class SCTSourceDisplayDispatcher method displaySource.
public void displaySource(Object element, IWorkbenchPage page, boolean forceSourceLookup) {
SCTDebugTarget newTarget = unwrapTarget(element);
if (!newTarget.getModelIdentifier().equals(IDebugConstants.ID_DEBUG_MODEL) || newTarget.getDebugTarget().isTerminated())
return;
if (newTarget != null && activeDebugTarget != newTarget) {
if (activeSourceDisplay != null)
activeSourceDisplay.terminate(false);
activeSourceDisplay = new SCTSourceDisplay((ISimulationEngine) newTarget.getAdapter(ISimulationEngine.class));
}
activeSourceDisplay.displaySource(newTarget, page, forceSourceLookup);
activeDebugTarget = newTarget;
}
use of org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget in project statecharts by Yakindu.
the class AbstractSCTLaunchConfigurationDelegate method launch.
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
String filename = configuration.getAttribute(FILE_NAME, DEFAULT_FILE_NAME);
Statechart statechart = loadStatechart(filename);
SCTDebugTarget target = createDebugTarget(launch, statechart);
launch.addDebugTarget(target);
try {
target.init();
target.start();
} catch (InitializationException e) {
// handled in AbstractExecutionFlowSimulationEngine
}
}
use of org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget in project statecharts by Yakindu.
the class SCTHotModelReplacementManager method getAffectedTargets.
private List<IDebugTarget> getAffectedTargets() {
List<IDebugTarget> targets = new ArrayList<IDebugTarget>();
synchronized (activeTargets) {
for (IDebugTarget debugTarget : activeTargets) {
if (debugTarget instanceof SCTDebugTarget) {
String resourceString = ((SCTDebugElement) debugTarget).getResourceString();
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceString);
if (changedFiles.contains(resource)) {
targets.add(debugTarget);
}
}
}
}
return targets;
}
Aggregations