Search in sources :

Example 1 with SCTDebugTarget

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;
}
Also used : SCTDebugTarget(org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget) ISimulationEngine(org.yakindu.sct.simulation.core.engine.ISimulationEngine)

Example 2 with SCTDebugTarget

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
    }
}
Also used : SCTDebugTarget(org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget) Statechart(org.yakindu.sct.model.sgraph.Statechart)

Example 3 with SCTDebugTarget

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;
}
Also used : SCTDebugTarget(org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget) ArrayList(java.util.ArrayList) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) SCTDebugElement(org.yakindu.sct.simulation.core.debugmodel.SCTDebugElement) IResource(org.eclipse.core.resources.IResource)

Aggregations

SCTDebugTarget (org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget)3 ArrayList (java.util.ArrayList)1 IResource (org.eclipse.core.resources.IResource)1 IDebugTarget (org.eclipse.debug.core.model.IDebugTarget)1 Statechart (org.yakindu.sct.model.sgraph.Statechart)1 SCTDebugElement (org.yakindu.sct.simulation.core.debugmodel.SCTDebugElement)1 ISimulationEngine (org.yakindu.sct.simulation.core.engine.ISimulationEngine)1