diff --git a/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/Signal.xtend b/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/Signal.xtend index 6bd2bee30b..eca4ca2b5c 100644 --- a/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/Signal.xtend +++ b/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/Signal.xtend @@ -14,6 +14,7 @@ package de.cau.cs.kieler.sccharts.processors import com.google.inject.Inject +import de.cau.cs.kieler.annotations.extensions.AnnotationsExtensions import de.cau.cs.kieler.kexpressions.CombineOperator import de.cau.cs.kieler.kexpressions.OperatorExpression import de.cau.cs.kieler.kexpressions.OperatorType @@ -90,6 +91,10 @@ class Signal extends SCChartsProcessor implements Traceable { @Inject extension SCChartsStateExtensions @Inject extension SCChartsActionExtensions @Inject extension KExpressionsArrayExtensions + @Inject extension AnnotationsExtensions + + // Prevents reset from being generated + static public final String NO_RESET_ANNOTATION = "NoReset" // This prefix is used for naming of all generated signals, states and regions static public final String GENERATED_PREFIX = "_" @@ -300,7 +305,7 @@ class Signal extends SCChartsProcessor implements Traceable { // Add a during reset action for the presentVariable if it is an output or local variable. // Do not do this for only-input-variables. - if (!presentVariable.isInput) { + if (!presentVariable.isInput && !presentVariable.hasAnnotation(NO_RESET_ANNOTATION)) { if (absentDuringAction === null) { absentDuringAction = state.createDuringAction diff --git a/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/dataflow/Dataflow.xtend b/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/dataflow/Dataflow.xtend index 84f76bfc5b..43b64dc3fa 100644 --- a/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/dataflow/Dataflow.xtend +++ b/plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/dataflow/Dataflow.xtend @@ -46,10 +46,11 @@ import de.cau.cs.kieler.sccharts.extensions.SCChartsScopeExtensions import de.cau.cs.kieler.sccharts.extensions.SCChartsStateExtensions import de.cau.cs.kieler.sccharts.extensions.SCChartsTransitionExtensions import de.cau.cs.kieler.sccharts.processors.SCChartsProcessor +import de.cau.cs.kieler.sccharts.processors.Signal import org.eclipse.emf.ecore.EObject -import static extension de.cau.cs.kieler.kicool.kitt.tracing.TransformationTracing.* import static extension de.cau.cs.kieler.kicool.kitt.tracing.TracingEcoreUtil.* +import static extension de.cau.cs.kieler.kicool.kitt.tracing.TransformationTracing.* /** * @author ssm @@ -391,11 +392,9 @@ class Dataflow extends SCChartsProcessor { localDeclaration.input = false localDeclaration.output = false if (localDeclaration.signal) { - localDeclaration.signal = false if (localDeclaration.type != ValueType.PURE) { environment.errors.add("Access to valued signal inputs/outputs in dataflow SCCharts not yet supported", localDeclaration, true) } - localDeclaration.type = ValueType.BOOL } for (valuedObject : declaration.valuedObjects) { @@ -521,6 +520,10 @@ class Dataflow extends SCChartsProcessor { } } } + + if (assignment.reference !== null && assignment.reference.valuedObject !== null && assignment.reference.valuedObject.signal) { + assignment.reference.valuedObject.addTagAnnotation(Signal.NO_RESET_ANNOTATION) + } } lastSequential = eq.value.isSequential }