Bläddra i källkod

Issue 71: value of a constant can not be changed via simulation view

Andreas Mülder 10 år sedan
förälder
incheckning
319686e605

+ 1 - 0
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/container/DefaultExecutionContextInitializer.xtend

@@ -114,6 +114,7 @@ class DefaultExecutionContextInitializer implements IExecutionContextInitializer
 		it.fqName = variable.fullyQualifiedName.toString
 		it.type = variable.inferType.type
 		it.value = it.type.initialValue
+		it.writable = variable.writeable
 	}
 
 	def dispatch ExecutionSlot create new ExecutionEventImpl() transform(EventDefinition event) {

+ 2 - 2
plugins/org.yakindu.sct.simulation.core/META-INF/MANIFEST.MF

@@ -9,9 +9,9 @@ Bundle-Vendor: statecharts.org
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.debug.core;visibility:=reexport,
- org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore;visibility:=reexport,
  org.yakindu.base.types;visibility:=reexport,
- org.yakindu.sct.model.sgraph,
+ org.yakindu.sct.model.sgraph;visibility:=reexport,
  org.eclipse.jdt.debug,
  com.google.guava;bundle-version="10.0.1",
  org.eclipse.emf.workspace;bundle-version="1.5.1",

+ 2 - 0
plugins/org.yakindu.sct.simulation.core/model/sruntime.ecore

@@ -35,6 +35,8 @@
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//InferredType"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="#//JavaObject"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="fqName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="writable" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        defaultValueLiteral="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EDataType" name="InferredType" instanceClassName="org.yakindu.base.types.InferredType"/>
   <eClassifiers xsi:type="ecore:EClass" name="ExecutionVariable" eSuperTypes="#//ExecutionSlot"/>

+ 28 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/sruntime/ExecutionSlot.java

@@ -24,6 +24,7 @@ import org.yakindu.base.types.InferredType;
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#getType <em>Type</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#getValue <em>Value</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#getFqName <em>Fq Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#isWritable <em>Writable</em>}</li>
  * </ul>
  * </p>
  *
@@ -110,4 +111,31 @@ public interface ExecutionSlot extends NamedElement {
 	 */
 	void setFqName(String value);
 
+	/**
+	 * Returns the value of the '<em><b>Writable</b></em>' attribute.
+	 * The default value is <code>"true"</code>.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Writable</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Writable</em>' attribute.
+	 * @see #setWritable(boolean)
+	 * @see org.yakindu.sct.simulation.core.sruntime.SRuntimePackage#getExecutionSlot_Writable()
+	 * @model default="true"
+	 * @generated
+	 */
+	boolean isWritable();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#isWritable <em>Writable</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Writable</em>' attribute.
+	 * @see #isWritable()
+	 * @generated
+	 */
+	void setWritable(boolean value);
+
 } // ExecutionSlot

+ 80 - 7
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/sruntime/SRuntimePackage.java

@@ -113,6 +113,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int EXECUTION_CONTEXT__FQ_NAME = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 2;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_CONTEXT__WRITABLE = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 3;
+
 	/**
 	 * The feature id for the '<em><b>Slots</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -120,7 +129,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT__SLOTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 3;
+	int EXECUTION_CONTEXT__SLOTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 4;
 
 	/**
 	 * The feature id for the '<em><b>Active States</b></em>' reference list.
@@ -129,7 +138,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT__ACTIVE_STATES = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 4;
+	int EXECUTION_CONTEXT__ACTIVE_STATES = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 5;
 
 	/**
 	 * The feature id for the '<em><b>Executed Elements</b></em>' reference list.
@@ -138,7 +147,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT__EXECUTED_ELEMENTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 5;
+	int EXECUTION_CONTEXT__EXECUTED_ELEMENTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 6;
 
 	/**
 	 * The feature id for the '<em><b>Suspended Elements</b></em>' reference list.
@@ -147,7 +156,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT__SUSPENDED_ELEMENTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 6;
+	int EXECUTION_CONTEXT__SUSPENDED_ELEMENTS = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 7;
 
 	/**
 	 * The feature id for the '<em><b>Snapshot</b></em>' attribute.
@@ -156,7 +165,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT__SNAPSHOT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 7;
+	int EXECUTION_CONTEXT__SNAPSHOT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 8;
 
 	/**
 	 * The number of structural features of the '<em>Execution Context</em>' class.
@@ -165,7 +174,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_CONTEXT_FEATURE_COUNT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 8;
+	int EXECUTION_CONTEXT_FEATURE_COUNT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 9;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionSlotImpl <em>Execution Slot</em>}' class.
@@ -213,6 +222,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int EXECUTION_SLOT__FQ_NAME = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 2;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_SLOT__WRITABLE = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 3;
+
 	/**
 	 * The number of structural features of the '<em>Execution Slot</em>' class.
 	 * <!-- begin-user-doc -->
@@ -220,7 +238,7 @@ public interface SRuntimePackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int EXECUTION_SLOT_FEATURE_COUNT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 3;
+	int EXECUTION_SLOT_FEATURE_COUNT = BasePackage.NAMED_ELEMENT_FEATURE_COUNT + 4;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionEventImpl <em>Execution Event</em>}' class.
@@ -268,6 +286,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int EXECUTION_EVENT__FQ_NAME = EXECUTION_SLOT__FQ_NAME;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_EVENT__WRITABLE = EXECUTION_SLOT__WRITABLE;
+
 	/**
 	 * The feature id for the '<em><b>Raised</b></em>' attribute.
 	 * <!-- begin-user-doc -->
@@ -350,6 +377,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int EXECUTION_VARIABLE__FQ_NAME = EXECUTION_SLOT__FQ_NAME;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int EXECUTION_VARIABLE__WRITABLE = EXECUTION_SLOT__WRITABLE;
+
 	/**
 	 * The number of structural features of the '<em>Execution Variable</em>' class.
 	 * <!-- begin-user-doc -->
@@ -405,6 +441,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int COMPOSITE_SLOT__FQ_NAME = EXECUTION_SLOT__FQ_NAME;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int COMPOSITE_SLOT__WRITABLE = EXECUTION_SLOT__WRITABLE;
+
 	/**
 	 * The feature id for the '<em><b>Slots</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -469,6 +514,15 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	int REFERENCE_SLOT__FQ_NAME = COMPOSITE_SLOT__FQ_NAME;
 
+	/**
+	 * The feature id for the '<em><b>Writable</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int REFERENCE_SLOT__WRITABLE = COMPOSITE_SLOT__WRITABLE;
+
 	/**
 	 * The feature id for the '<em><b>Slots</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -668,6 +722,17 @@ public interface SRuntimePackage extends EPackage {
 	 */
 	EAttribute getExecutionSlot_FqName();
 
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#isWritable <em>Writable</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Writable</em>'.
+	 * @see org.yakindu.sct.simulation.core.sruntime.ExecutionSlot#isWritable()
+	 * @see #getExecutionSlot()
+	 * @generated
+	 */
+	EAttribute getExecutionSlot_Writable();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.simulation.core.sruntime.ExecutionVariable <em>Execution Variable</em>}'.
 	 * <!-- begin-user-doc -->
@@ -884,6 +949,14 @@ public interface SRuntimePackage extends EPackage {
 		 */
 		EAttribute EXECUTION_SLOT__FQ_NAME = eINSTANCE.getExecutionSlot_FqName();
 
+		/**
+		 * The meta object literal for the '<em><b>Writable</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute EXECUTION_SLOT__WRITABLE = eINSTANCE.getExecutionSlot_Writable();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionVariableImpl <em>Execution Variable</em>}' class.
 		 * <!-- begin-user-doc -->

+ 56 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/sruntime/impl/ExecutionContextImpl.java

@@ -50,6 +50,7 @@ import com.google.common.collect.Sets;
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getType <em>Type</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getValue <em>Value</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getFqName <em>Fq Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#isWritable <em>Writable</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getSlots <em>Slots</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getActiveStates <em>Active States</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionContextImpl#getExecutedElements <em>Executed Elements</em>}</li>
@@ -117,6 +118,26 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 	 */
 	protected String fqName = FQ_NAME_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isWritable() <em>Writable</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isWritable()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean WRITABLE_EDEFAULT = true;
+
+	/**
+	 * The cached value of the '{@link #isWritable() <em>Writable</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isWritable()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean writable = WRITABLE_EDEFAULT;
+
 	/**
 	 * The cached value of the '{@link #getSlots() <em>Slots</em>}' containment reference list.
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -251,6 +272,27 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 			eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME, oldFqName, fqName));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isWritable() {
+		return writable;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setWritable(boolean newWritable) {
+		boolean oldWritable = writable;
+		writable = newWritable;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__WRITABLE, oldWritable, writable));
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -509,6 +551,8 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 				return getValue();
 			case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
 				return getFqName();
+			case SRuntimePackage.EXECUTION_CONTEXT__WRITABLE:
+				return isWritable();
 			case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
 				return getSlots();
 			case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
@@ -540,6 +584,9 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 			case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
 				setFqName((String)newValue);
 				return;
+			case SRuntimePackage.EXECUTION_CONTEXT__WRITABLE:
+				setWritable((Boolean)newValue);
+				return;
 			case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
 				getSlots().clear();
 				getSlots().addAll((Collection<? extends ExecutionSlot>)newValue);
@@ -579,6 +626,9 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 			case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
 				setFqName(FQ_NAME_EDEFAULT);
 				return;
+			case SRuntimePackage.EXECUTION_CONTEXT__WRITABLE:
+				setWritable(WRITABLE_EDEFAULT);
+				return;
 			case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
 				getSlots().clear();
 				return;
@@ -611,6 +661,8 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 				return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
 			case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME:
 				return FQ_NAME_EDEFAULT == null ? fqName != null : !FQ_NAME_EDEFAULT.equals(fqName);
+			case SRuntimePackage.EXECUTION_CONTEXT__WRITABLE:
+				return writable != WRITABLE_EDEFAULT;
 			case SRuntimePackage.EXECUTION_CONTEXT__SLOTS:
 				return slots != null && !slots.isEmpty();
 			case SRuntimePackage.EXECUTION_CONTEXT__ACTIVE_STATES:
@@ -636,6 +688,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 				case SRuntimePackage.EXECUTION_CONTEXT__TYPE: return SRuntimePackage.EXECUTION_SLOT__TYPE;
 				case SRuntimePackage.EXECUTION_CONTEXT__VALUE: return SRuntimePackage.EXECUTION_SLOT__VALUE;
 				case SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME: return SRuntimePackage.EXECUTION_SLOT__FQ_NAME;
+				case SRuntimePackage.EXECUTION_CONTEXT__WRITABLE: return SRuntimePackage.EXECUTION_SLOT__WRITABLE;
 				default: return -1;
 			}
 		}
@@ -659,6 +712,7 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 				case SRuntimePackage.EXECUTION_SLOT__TYPE: return SRuntimePackage.EXECUTION_CONTEXT__TYPE;
 				case SRuntimePackage.EXECUTION_SLOT__VALUE: return SRuntimePackage.EXECUTION_CONTEXT__VALUE;
 				case SRuntimePackage.EXECUTION_SLOT__FQ_NAME: return SRuntimePackage.EXECUTION_CONTEXT__FQ_NAME;
+				case SRuntimePackage.EXECUTION_SLOT__WRITABLE: return SRuntimePackage.EXECUTION_CONTEXT__WRITABLE;
 				default: return -1;
 			}
 		}
@@ -686,6 +740,8 @@ public class ExecutionContextImpl extends NamedElementImpl implements ExecutionC
 		result.append(value);
 		result.append(", fqName: ");
 		result.append(fqName);
+		result.append(", writable: ");
+		result.append(writable);
 		result.append(", snapshot: ");
 		result.append(snapshot);
 		result.append(')');

+ 52 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/sruntime/impl/ExecutionSlotImpl.java

@@ -28,6 +28,7 @@ import org.yakindu.sct.simulation.core.sruntime.SRuntimePackage;
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionSlotImpl#getType <em>Type</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionSlotImpl#getValue <em>Value</em>}</li>
  *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionSlotImpl#getFqName <em>Fq Name</em>}</li>
+ *   <li>{@link org.yakindu.sct.simulation.core.sruntime.impl.ExecutionSlotImpl#isWritable <em>Writable</em>}</li>
  * </ul>
  * </p>
  *
@@ -94,6 +95,26 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 	 */
 	protected String fqName = FQ_NAME_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isWritable() <em>Writable</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isWritable()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean WRITABLE_EDEFAULT = true;
+
+	/**
+	 * The cached value of the '{@link #isWritable() <em>Writable</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isWritable()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean writable = WRITABLE_EDEFAULT;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -176,6 +197,27 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 			eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_SLOT__FQ_NAME, oldFqName, fqName));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isWritable() {
+		return writable;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setWritable(boolean newWritable) {
+		boolean oldWritable = writable;
+		writable = newWritable;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_SLOT__WRITABLE, oldWritable, writable));
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -190,6 +232,8 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 				return getValue();
 			case SRuntimePackage.EXECUTION_SLOT__FQ_NAME:
 				return getFqName();
+			case SRuntimePackage.EXECUTION_SLOT__WRITABLE:
+				return isWritable();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -211,6 +255,9 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 			case SRuntimePackage.EXECUTION_SLOT__FQ_NAME:
 				setFqName((String)newValue);
 				return;
+			case SRuntimePackage.EXECUTION_SLOT__WRITABLE:
+				setWritable((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -232,6 +279,9 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 			case SRuntimePackage.EXECUTION_SLOT__FQ_NAME:
 				setFqName(FQ_NAME_EDEFAULT);
 				return;
+			case SRuntimePackage.EXECUTION_SLOT__WRITABLE:
+				setWritable(WRITABLE_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -250,6 +300,8 @@ public abstract class ExecutionSlotImpl extends NamedElementImpl implements Exec
 				return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
 			case SRuntimePackage.EXECUTION_SLOT__FQ_NAME:
 				return FQ_NAME_EDEFAULT == null ? fqName != null : !FQ_NAME_EDEFAULT.equals(fqName);
+			case SRuntimePackage.EXECUTION_SLOT__WRITABLE:
+				return writable != WRITABLE_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}

+ 11 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/sruntime/impl/SRuntimePackageImpl.java

@@ -282,6 +282,15 @@ public class SRuntimePackageImpl extends EPackageImpl implements SRuntimePackage
 		return (EAttribute)executionSlotEClass.getEStructuralFeatures().get(2);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getExecutionSlot_Writable() {
+		return (EAttribute)executionSlotEClass.getEStructuralFeatures().get(3);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -397,6 +406,7 @@ public class SRuntimePackageImpl extends EPackageImpl implements SRuntimePackage
 		createEAttribute(executionSlotEClass, EXECUTION_SLOT__TYPE);
 		createEAttribute(executionSlotEClass, EXECUTION_SLOT__VALUE);
 		createEAttribute(executionSlotEClass, EXECUTION_SLOT__FQ_NAME);
+		createEAttribute(executionSlotEClass, EXECUTION_SLOT__WRITABLE);
 
 		executionVariableEClass = createEClass(EXECUTION_VARIABLE);
 
@@ -491,6 +501,7 @@ public class SRuntimePackageImpl extends EPackageImpl implements SRuntimePackage
 		initEAttribute(getExecutionSlot_Type(), this.getInferredType(), "type", null, 0, 1, ExecutionSlot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEAttribute(getExecutionSlot_Value(), this.getJavaObject(), "value", null, 0, 1, ExecutionSlot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEAttribute(getExecutionSlot_FqName(), ecorePackage.getEString(), "fqName", null, 0, 1, ExecutionSlot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getExecutionSlot_Writable(), ecorePackage.getEBoolean(), "writable", "true", 0, 1, ExecutionSlot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(executionVariableEClass, ExecutionVariable.class, "ExecutionVariable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 

BIN
plugins/org.yakindu.sct.simulation.ui/icons/Variable_lock.gif


+ 4 - 2
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/SimulationImages.java

@@ -31,8 +31,10 @@ public enum SimulationImages {
 	
 	BREAKPOINT_DISABLED("icons/brkpd_obj.gif"),
 
-	LAUNCHER_ICON("icons/Statechart-Launcher-16.png");
-
+	LAUNCHER_ICON("icons/Statechart-Launcher-16.png"), 
+	
+	VARIABLE_LOCK("icons/Variable_lock.gif");
+	
 	private final String path;
 
 	private SimulationImages(String path) {

+ 4 - 1
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/ExecutionContextLabelProvider.java

@@ -84,7 +84,10 @@ public class ExecutionContextLabelProvider extends StyledCellLabelProvider {
 		} else if (element instanceof ExecutionVariable) {
 			ExecutionVariable variable = (ExecutionVariable) element;
 			cell.setText(variable.getName());
-			cell.setImage(SimulationImages.VARIABLE.image());
+			if (((ExecutionVariable) element).isWritable())
+				cell.setImage(SimulationImages.VARIABLE.image());
+			else
+				cell.setImage(SimulationImages.VARIABLE_LOCK.image());
 		} else if (element instanceof CompositeSlot) {
 			cell.setText(((CompositeSlot) element).getName());
 			cell.setImage(SimulationImages.SCOPE.image());

+ 2 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/editing/ScopeSlotEditingSupport.java

@@ -32,6 +32,8 @@ public abstract class ScopeSlotEditingSupport extends PublicEditingSupport {
 	@Override
 	public boolean canEdit(Object element) {
 		if (element instanceof ExecutionSlot) {
+			if(!((ExecutionSlot) element).isWritable())
+				return false;
 			Object value = ((ExecutionSlot) element).getValue();
 			if (value == null) {
 				return false;