Search in sources :

Example 1 with ISimulationEngine

use of org.yakindu.sct.simulation.core.engine.ISimulationEngine 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 ISimulationEngine

use of org.yakindu.sct.simulation.core.engine.ISimulationEngine in project statecharts by Yakindu.

the class DefaultSimulationEngineFactory method createExecutionContainer.

public ISimulationEngine createExecutionContainer(Statechart statechart, ILaunch launch) throws CoreException {
    ISimulationEngine controller = createController(statechart);
    injector.injectMembers(controller);
    // For restoring execution context
    String attribute = launch.getLaunchConfiguration().getAttribute(ISCTLaunchParameters.EXECUTION_CONTEXT, "");
    if (attribute != null && attribute.trim().length() > 0) {
        ExecutionContext context = restore(attribute, statechart);
        controller.setExecutionContext(context);
    }
    return controller;
}
Also used : ExecutionContext(org.yakindu.sct.model.sruntime.ExecutionContext) ISimulationEngine(org.yakindu.sct.simulation.core.engine.ISimulationEngine)

Example 3 with ISimulationEngine

use of org.yakindu.sct.simulation.core.engine.ISimulationEngine in project statecharts by Yakindu.

the class SimulationView method activeTargetChanged.

protected void activeTargetChanged(final IDebugTarget debugTarget) {
    openEditorForTarget(debugTarget);
    updateTypeSystem(debugTarget);
    ISimulationEngine engine = (ISimulationEngine) debugTarget.getAdapter(ISimulationEngine.class);
    timeScheduler = (DefaultTimeTaskScheduler) engine.getTimeTaskScheduler();
    setViewerInput(engine.getExecutionContext());
    updateActions();
    updateSessionDropdownInput(debugTarget);
}
Also used : ISimulationEngine(org.yakindu.sct.simulation.core.engine.ISimulationEngine)

Aggregations

ISimulationEngine (org.yakindu.sct.simulation.core.engine.ISimulationEngine)3 ExecutionContext (org.yakindu.sct.model.sruntime.ExecutionContext)1 SCTDebugTarget (org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget)1