From 3af7367284d1f2153ce4007711c10e0684dc9ac6 Mon Sep 17 00:00:00 2001 From: Khan <khan@fortiss.org> Date: Mon, 6 Jun 2016 12:42:28 +0000 Subject: [PATCH] adaptations to the raspberry pi generator --- .../model/annotation/AnnotationFactory.java | 51 +++ .../model/annotation/AnnotationPackage.java | 272 +++++++++++ .../model/annotation/CoreAddress.java | 51 +++ .../raspberry/model/annotation/PinNumber.java | 51 +++ .../impl/AnnotationFactoryImpl.java | 106 +++++ .../impl/AnnotationPackageImpl.java | 229 ++++++++++ .../annotation/impl/CoreAddressImpl.java | 431 ++++++++++++++++++ .../model/annotation/impl/PinNumberImpl.java | 431 ++++++++++++++++++ .../util/AnnotationAdapterFactory.java | 235 ++++++++++ .../annotation/util/AnnotationSwitch.java | 223 +++++++++ .../model/impl/ModelPackageImpl.java | 11 + .../executable/ActuatorOutExecutable.java | 22 +- .../executable/BusMasterPortExecutable.java | 74 +-- .../executable/SensorInExecutable.java | 22 +- 14 files changed, 2156 insertions(+), 53 deletions(-) create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationFactory.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationPackage.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/CoreAddress.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/PinNumber.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationFactoryImpl.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationPackageImpl.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/CoreAddressImpl.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/PinNumberImpl.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationAdapterFactory.java create mode 100644 org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationSwitch.java diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationFactory.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationFactory.java new file mode 100644 index 00000000..dcfa1e82 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationFactory.java @@ -0,0 +1,51 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage + * @generated + */ +public interface AnnotationFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + AnnotationFactory eINSTANCE = org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Core Address</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Core Address</em>'. + * @generated + */ + CoreAddress createCoreAddress(); + + /** + * Returns a new object of class '<em>Pin Number</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Pin Number</em>'. + * @generated + */ + PinNumber createPinNumber(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + AnnotationPackage getAnnotationPackage(); + +} //AnnotationFactory diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationPackage.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationPackage.java new file mode 100644 index 00000000..b6e29792 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/AnnotationPackage.java @@ -0,0 +1,272 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; + +import org.fortiss.tooling.base.model.element.ElementPackage; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationFactory + * @model kind="package" + * @generated + */ +public interface AnnotationPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "annotation"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.fortiss.org/af3/platform/raspberry/annotation"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "org-fortiss-af3-platform-raspberry-annotation"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + AnnotationPackage eINSTANCE = org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl.init(); + + /** + * The meta object id for the '{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl <em>Core Address</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl#getCoreAddress() + * @generated + */ + int CORE_ADDRESS = 0; + + /** + * The feature id for the '<em><b>Id</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CORE_ADDRESS__ID = ElementPackage.IANNOTATED_SPECIFICATION__ID; + + /** + * The feature id for the '<em><b>Specification Of</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CORE_ADDRESS__SPECIFICATION_OF = ElementPackage.IANNOTATED_SPECIFICATION__SPECIFICATION_OF; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CORE_ADDRESS__NAME = ElementPackage.IANNOTATED_SPECIFICATION__NAME; + + /** + * The feature id for the '<em><b>Core Address</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CORE_ADDRESS__CORE_ADDRESS = ElementPackage.IANNOTATED_SPECIFICATION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the '<em>Core Address</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CORE_ADDRESS_FEATURE_COUNT = ElementPackage.IANNOTATED_SPECIFICATION_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl <em>Pin Number</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl#getPinNumber() + * @generated + */ + int PIN_NUMBER = 1; + + /** + * The feature id for the '<em><b>Id</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PIN_NUMBER__ID = ElementPackage.IANNOTATED_SPECIFICATION__ID; + + /** + * The feature id for the '<em><b>Specification Of</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PIN_NUMBER__SPECIFICATION_OF = ElementPackage.IANNOTATED_SPECIFICATION__SPECIFICATION_OF; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PIN_NUMBER__NAME = ElementPackage.IANNOTATED_SPECIFICATION__NAME; + + /** + * The feature id for the '<em><b>Pin Number</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PIN_NUMBER__PIN_NUMBER = ElementPackage.IANNOTATED_SPECIFICATION_FEATURE_COUNT + 0; + + /** + * The number of structural features of the '<em>Pin Number</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PIN_NUMBER_FEATURE_COUNT = ElementPackage.IANNOTATED_SPECIFICATION_FEATURE_COUNT + 1; + + + /** + * Returns the meta object for class '{@link org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress <em>Core Address</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Core Address</em>'. + * @see org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress + * @generated + */ + EClass getCoreAddress(); + + /** + * Returns the meta object for the attribute '{@link org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress#getCoreAddress <em>Core Address</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Core Address</em>'. + * @see org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress#getCoreAddress() + * @see #getCoreAddress() + * @generated + */ + EAttribute getCoreAddress_CoreAddress(); + + /** + * Returns the meta object for class '{@link org.fortiss.af3.platform.raspberry.model.annotation.PinNumber <em>Pin Number</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Pin Number</em>'. + * @see org.fortiss.af3.platform.raspberry.model.annotation.PinNumber + * @generated + */ + EClass getPinNumber(); + + /** + * Returns the meta object for the attribute '{@link org.fortiss.af3.platform.raspberry.model.annotation.PinNumber#getPinNumber <em>Pin Number</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Pin Number</em>'. + * @see org.fortiss.af3.platform.raspberry.model.annotation.PinNumber#getPinNumber() + * @see #getPinNumber() + * @generated + */ + EAttribute getPinNumber_PinNumber(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + AnnotationFactory getAnnotationFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl <em>Core Address</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl#getCoreAddress() + * @generated + */ + EClass CORE_ADDRESS = eINSTANCE.getCoreAddress(); + + /** + * The meta object literal for the '<em><b>Core Address</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute CORE_ADDRESS__CORE_ADDRESS = eINSTANCE.getCoreAddress_CoreAddress(); + + /** + * The meta object literal for the '{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl <em>Pin Number</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl + * @see org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl#getPinNumber() + * @generated + */ + EClass PIN_NUMBER = eINSTANCE.getPinNumber(); + + /** + * The meta object literal for the '<em><b>Pin Number</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PIN_NUMBER__PIN_NUMBER = eINSTANCE.getPinNumber_PinNumber(); + + } + +} //AnnotationPackage diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/CoreAddress.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/CoreAddress.java new file mode 100644 index 00000000..8b46fd94 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/CoreAddress.java @@ -0,0 +1,51 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation; + +import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Core Address</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress#getCoreAddress <em>Core Address</em>}</li> + * </ul> + * </p> + * + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage#getCoreAddress() + * @model + * @generated + */ +public interface CoreAddress extends IAnnotatedSpecification, IHiddenSpecification { + /** + * Returns the value of the '<em><b>Core Address</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Core Address</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Core Address</em>' attribute. + * @see #setCoreAddress(int) + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage#getCoreAddress_CoreAddress() + * @model + * @generated + */ + int getCoreAddress(); + + /** + * Sets the value of the '{@link org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress#getCoreAddress <em>Core Address</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Core Address</em>' attribute. + * @see #getCoreAddress() + * @generated + */ + void setCoreAddress(int value); + +} // CoreAddress diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/PinNumber.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/PinNumber.java new file mode 100644 index 00000000..0ab6b505 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/PinNumber.java @@ -0,0 +1,51 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation; + +import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Pin Number</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.PinNumber#getPinNumber <em>Pin Number</em>}</li> + * </ul> + * </p> + * + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage#getPinNumber() + * @model + * @generated + */ +public interface PinNumber extends IAnnotatedSpecification, IHiddenSpecification { + /** + * Returns the value of the '<em><b>Pin Number</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Pin Number</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Pin Number</em>' attribute. + * @see #setPinNumber(int) + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage#getPinNumber_PinNumber() + * @model + * @generated + */ + int getPinNumber(); + + /** + * Sets the value of the '{@link org.fortiss.af3.platform.raspberry.model.annotation.PinNumber#getPinNumber <em>Pin Number</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Pin Number</em>' attribute. + * @see #getPinNumber() + * @generated + */ + void setPinNumber(int value); + +} // PinNumber diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationFactoryImpl.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationFactoryImpl.java new file mode 100644 index 00000000..2b03f68b --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationFactoryImpl.java @@ -0,0 +1,106 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.fortiss.af3.platform.raspberry.model.annotation.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class AnnotationFactoryImpl extends EFactoryImpl implements AnnotationFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static AnnotationFactory init() { + try { + AnnotationFactory theAnnotationFactory = (AnnotationFactory)EPackage.Registry.INSTANCE.getEFactory(AnnotationPackage.eNS_URI); + if (theAnnotationFactory != null) { + return theAnnotationFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new AnnotationFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnnotationFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case AnnotationPackage.CORE_ADDRESS: return createCoreAddress(); + case AnnotationPackage.PIN_NUMBER: return createPinNumber(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public CoreAddress createCoreAddress() { + CoreAddressImpl coreAddress = new CoreAddressImpl(); + return coreAddress; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PinNumber createPinNumber() { + PinNumberImpl pinNumber = new PinNumberImpl(); + return pinNumber; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnnotationPackage getAnnotationPackage() { + return (AnnotationPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static AnnotationPackage getPackage() { + return AnnotationPackage.eINSTANCE; + } + +} //AnnotationFactoryImpl diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationPackageImpl.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationPackageImpl.java new file mode 100644 index 00000000..3a5c5e64 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/AnnotationPackageImpl.java @@ -0,0 +1,229 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.fortiss.af3.platform.model.AF3PlatformPackage; + +import org.fortiss.af3.platform.raspberry.model.ModelPackage; + +import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationFactory; +import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage; +import org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress; +import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber; + +import org.fortiss.af3.platform.raspberry.model.impl.ModelPackageImpl; + +import org.fortiss.tooling.base.model.element.ElementPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class AnnotationPackageImpl extends EPackageImpl implements AnnotationPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass coreAddressEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass pinNumberEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage#eNS_URI + * @see #init() + * @generated + */ + private AnnotationPackageImpl() { + super(eNS_URI, AnnotationFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link AnnotationPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static AnnotationPackage init() { + if (isInited) return (AnnotationPackage)EPackage.Registry.INSTANCE.getEPackage(AnnotationPackage.eNS_URI); + + // Obtain or create and register package + AnnotationPackageImpl theAnnotationPackage = (AnnotationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AnnotationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AnnotationPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + AF3PlatformPackage.eINSTANCE.eClass(); + + // Obtain or create and register interdependencies + ModelPackageImpl theModelPackage = (ModelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI) instanceof ModelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI) : ModelPackage.eINSTANCE); + + // Create package meta-data objects + theAnnotationPackage.createPackageContents(); + theModelPackage.createPackageContents(); + + // Initialize created meta-data + theAnnotationPackage.initializePackageContents(); + theModelPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theAnnotationPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(AnnotationPackage.eNS_URI, theAnnotationPackage); + return theAnnotationPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getCoreAddress() { + return coreAddressEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getCoreAddress_CoreAddress() { + return (EAttribute)coreAddressEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getPinNumber() { + return pinNumberEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPinNumber_PinNumber() { + return (EAttribute)pinNumberEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnnotationFactory getAnnotationFactory() { + return (AnnotationFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + coreAddressEClass = createEClass(CORE_ADDRESS); + createEAttribute(coreAddressEClass, CORE_ADDRESS__CORE_ADDRESS); + + pinNumberEClass = createEClass(PIN_NUMBER); + createEAttribute(pinNumberEClass, PIN_NUMBER__PIN_NUMBER); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + ElementPackage theElementPackage = (ElementPackage)EPackage.Registry.INSTANCE.getEPackage(ElementPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + coreAddressEClass.getESuperTypes().add(theElementPackage.getIAnnotatedSpecification()); + coreAddressEClass.getESuperTypes().add(theElementPackage.getIHiddenSpecification()); + pinNumberEClass.getESuperTypes().add(theElementPackage.getIAnnotatedSpecification()); + pinNumberEClass.getESuperTypes().add(theElementPackage.getIHiddenSpecification()); + + // Initialize classes and features; add operations and parameters + initEClass(coreAddressEClass, CoreAddress.class, "CoreAddress", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCoreAddress_CoreAddress(), ecorePackage.getEInt(), "coreAddress", null, 0, 1, CoreAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(pinNumberEClass, PinNumber.class, "PinNumber", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPinNumber_PinNumber(), ecorePackage.getEInt(), "pinNumber", null, 0, 1, PinNumber.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + } + +} //AnnotationPackageImpl diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/CoreAddressImpl.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/CoreAddressImpl.java new file mode 100644 index 00000000..943d3bc3 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/CoreAddressImpl.java @@ -0,0 +1,431 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EcoreUtil; + +import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage; +import org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress; + +import org.fortiss.tooling.base.model.element.ElementPackage; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; +import org.fortiss.tooling.base.model.element.IModelElement; + +import org.fortiss.tooling.kernel.model.FortissToolingKernelPackage; +import org.fortiss.tooling.kernel.model.INamedElement; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Core Address</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl#getId <em>Id</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl#getSpecificationOf <em>Specification Of</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl#getName <em>Name</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.CoreAddressImpl#getCoreAddress <em>Core Address</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class CoreAddressImpl extends EObjectImpl implements CoreAddress { + /** + * The default value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected static final int ID_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected int id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getCoreAddress() <em>Core Address</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCoreAddress() + * @generated + * @ordered + */ + protected static final int CORE_ADDRESS_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getCoreAddress() <em>Core Address</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCoreAddress() + * @generated + * @ordered + */ + protected int coreAddress = CORE_ADDRESS_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected CoreAddressImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnnotationPackage.Literals.CORE_ADDRESS; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getId() { + return id; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setId(int newId) { + int oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.CORE_ADDRESS__ID, oldId, id)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public IModelElement getSpecificationOf() { + if (eContainerFeatureID() != AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF) return null; + return (IModelElement)eContainer(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public IModelElement basicGetSpecificationOf() { + if (eContainerFeatureID() != AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF) return null; + return (IModelElement)eInternalContainer(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetSpecificationOf(IModelElement newSpecificationOf, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject)newSpecificationOf, AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSpecificationOf(IModelElement newSpecificationOf) { + if (newSpecificationOf != eInternalContainer() || (eContainerFeatureID() != AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF && newSpecificationOf != null)) { + if (EcoreUtil.isAncestor(this, newSpecificationOf)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newSpecificationOf != null) + msgs = ((InternalEObject)newSpecificationOf).eInverseAdd(this, ElementPackage.IMODEL_ELEMENT__SPECIFICATIONS, IModelElement.class, msgs); + msgs = basicSetSpecificationOf(newSpecificationOf, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF, newSpecificationOf, newSpecificationOf)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.CORE_ADDRESS__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getCoreAddress() { + return coreAddress; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCoreAddress(int newCoreAddress) { + int oldCoreAddress = coreAddress; + coreAddress = newCoreAddress; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.CORE_ADDRESS__CORE_ADDRESS, oldCoreAddress, coreAddress)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetSpecificationOf((IModelElement)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + return basicSetSpecificationOf(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + return eInternalContainer().eInverseRemove(this, ElementPackage.IMODEL_ELEMENT__SPECIFICATIONS, IModelElement.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__ID: + return getId(); + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + if (resolve) return getSpecificationOf(); + return basicGetSpecificationOf(); + case AnnotationPackage.CORE_ADDRESS__NAME: + return getName(); + case AnnotationPackage.CORE_ADDRESS__CORE_ADDRESS: + return getCoreAddress(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__ID: + setId((Integer)newValue); + return; + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + setSpecificationOf((IModelElement)newValue); + return; + case AnnotationPackage.CORE_ADDRESS__NAME: + setName((String)newValue); + return; + case AnnotationPackage.CORE_ADDRESS__CORE_ADDRESS: + setCoreAddress((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__ID: + setId(ID_EDEFAULT); + return; + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + setSpecificationOf((IModelElement)null); + return; + case AnnotationPackage.CORE_ADDRESS__NAME: + setName(NAME_EDEFAULT); + return; + case AnnotationPackage.CORE_ADDRESS__CORE_ADDRESS: + setCoreAddress(CORE_ADDRESS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnnotationPackage.CORE_ADDRESS__ID: + return id != ID_EDEFAULT; + case AnnotationPackage.CORE_ADDRESS__SPECIFICATION_OF: + return basicGetSpecificationOf() != null; + case AnnotationPackage.CORE_ADDRESS__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case AnnotationPackage.CORE_ADDRESS__CORE_ADDRESS: + return coreAddress != CORE_ADDRESS_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { + if (baseClass == INamedElement.class) { + switch (derivedFeatureID) { + case AnnotationPackage.CORE_ADDRESS__NAME: return FortissToolingKernelPackage.INAMED_ELEMENT__NAME; + default: return -1; + } + } + if (baseClass == IHiddenSpecification.class) { + switch (derivedFeatureID) { + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { + if (baseClass == INamedElement.class) { + switch (baseFeatureID) { + case FortissToolingKernelPackage.INAMED_ELEMENT__NAME: return AnnotationPackage.CORE_ADDRESS__NAME; + default: return -1; + } + } + if (baseClass == IHiddenSpecification.class) { + switch (baseFeatureID) { + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(", name: "); + result.append(name); + result.append(", coreAddress: "); + result.append(coreAddress); + result.append(')'); + return result.toString(); + } + +} //CoreAddressImpl diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/PinNumberImpl.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/PinNumberImpl.java new file mode 100644 index 00000000..cdb65f53 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/impl/PinNumberImpl.java @@ -0,0 +1,431 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EcoreUtil; + +import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage; +import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber; + +import org.fortiss.tooling.base.model.element.ElementPackage; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; +import org.fortiss.tooling.base.model.element.IModelElement; + +import org.fortiss.tooling.kernel.model.FortissToolingKernelPackage; +import org.fortiss.tooling.kernel.model.INamedElement; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Pin Number</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl#getId <em>Id</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl#getSpecificationOf <em>Specification Of</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl#getName <em>Name</em>}</li> + * <li>{@link org.fortiss.af3.platform.raspberry.model.annotation.impl.PinNumberImpl#getPinNumber <em>Pin Number</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class PinNumberImpl extends EObjectImpl implements PinNumber { + /** + * The default value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected static final int ID_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getId() <em>Id</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getId() + * @generated + * @ordered + */ + protected int id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getPinNumber() <em>Pin Number</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPinNumber() + * @generated + * @ordered + */ + protected static final int PIN_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getPinNumber() <em>Pin Number</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPinNumber() + * @generated + * @ordered + */ + protected int pinNumber = PIN_NUMBER_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PinNumberImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnnotationPackage.Literals.PIN_NUMBER; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getId() { + return id; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setId(int newId) { + int oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.PIN_NUMBER__ID, oldId, id)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public IModelElement getSpecificationOf() { + if (eContainerFeatureID() != AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF) return null; + return (IModelElement)eContainer(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public IModelElement basicGetSpecificationOf() { + if (eContainerFeatureID() != AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF) return null; + return (IModelElement)eInternalContainer(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetSpecificationOf(IModelElement newSpecificationOf, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject)newSpecificationOf, AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF, msgs); + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSpecificationOf(IModelElement newSpecificationOf) { + if (newSpecificationOf != eInternalContainer() || (eContainerFeatureID() != AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF && newSpecificationOf != null)) { + if (EcoreUtil.isAncestor(this, newSpecificationOf)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newSpecificationOf != null) + msgs = ((InternalEObject)newSpecificationOf).eInverseAdd(this, ElementPackage.IMODEL_ELEMENT__SPECIFICATIONS, IModelElement.class, msgs); + msgs = basicSetSpecificationOf(newSpecificationOf, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF, newSpecificationOf, newSpecificationOf)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.PIN_NUMBER__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getPinNumber() { + return pinNumber; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setPinNumber(int newPinNumber) { + int oldPinNumber = pinNumber; + pinNumber = newPinNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnnotationPackage.PIN_NUMBER__PIN_NUMBER, oldPinNumber, pinNumber)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetSpecificationOf((IModelElement)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + return basicSetSpecificationOf(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + return eInternalContainer().eInverseRemove(this, ElementPackage.IMODEL_ELEMENT__SPECIFICATIONS, IModelElement.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__ID: + return getId(); + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + if (resolve) return getSpecificationOf(); + return basicGetSpecificationOf(); + case AnnotationPackage.PIN_NUMBER__NAME: + return getName(); + case AnnotationPackage.PIN_NUMBER__PIN_NUMBER: + return getPinNumber(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__ID: + setId((Integer)newValue); + return; + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + setSpecificationOf((IModelElement)newValue); + return; + case AnnotationPackage.PIN_NUMBER__NAME: + setName((String)newValue); + return; + case AnnotationPackage.PIN_NUMBER__PIN_NUMBER: + setPinNumber((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__ID: + setId(ID_EDEFAULT); + return; + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + setSpecificationOf((IModelElement)null); + return; + case AnnotationPackage.PIN_NUMBER__NAME: + setName(NAME_EDEFAULT); + return; + case AnnotationPackage.PIN_NUMBER__PIN_NUMBER: + setPinNumber(PIN_NUMBER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnnotationPackage.PIN_NUMBER__ID: + return id != ID_EDEFAULT; + case AnnotationPackage.PIN_NUMBER__SPECIFICATION_OF: + return basicGetSpecificationOf() != null; + case AnnotationPackage.PIN_NUMBER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case AnnotationPackage.PIN_NUMBER__PIN_NUMBER: + return pinNumber != PIN_NUMBER_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { + if (baseClass == INamedElement.class) { + switch (derivedFeatureID) { + case AnnotationPackage.PIN_NUMBER__NAME: return FortissToolingKernelPackage.INAMED_ELEMENT__NAME; + default: return -1; + } + } + if (baseClass == IHiddenSpecification.class) { + switch (derivedFeatureID) { + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { + if (baseClass == INamedElement.class) { + switch (baseFeatureID) { + case FortissToolingKernelPackage.INAMED_ELEMENT__NAME: return AnnotationPackage.PIN_NUMBER__NAME; + default: return -1; + } + } + if (baseClass == IHiddenSpecification.class) { + switch (baseFeatureID) { + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(", name: "); + result.append(name); + result.append(", pinNumber: "); + result.append(pinNumber); + result.append(')'); + return result.toString(); + } + +} //PinNumberImpl diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationAdapterFactory.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationAdapterFactory.java new file mode 100644 index 00000000..9bf9eb82 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationAdapterFactory.java @@ -0,0 +1,235 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.fortiss.af3.platform.raspberry.model.annotation.*; + +import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; +import org.fortiss.tooling.base.model.element.IModelElementSpecification; + +import org.fortiss.tooling.kernel.model.IIdLabeled; +import org.fortiss.tooling.kernel.model.INamedElement; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage + * @generated + */ +public class AnnotationAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static AnnotationPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnnotationAdapterFactory() { + if (modelPackage == null) { + modelPackage = AnnotationPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected AnnotationSwitch<Adapter> modelSwitch = + new AnnotationSwitch<Adapter>() { + @Override + public Adapter caseCoreAddress(CoreAddress object) { + return createCoreAddressAdapter(); + } + @Override + public Adapter casePinNumber(PinNumber object) { + return createPinNumberAdapter(); + } + @Override + public Adapter caseIIdLabeled(IIdLabeled object) { + return createIIdLabeledAdapter(); + } + @Override + public Adapter caseIModelElementSpecification(IModelElementSpecification object) { + return createIModelElementSpecificationAdapter(); + } + @Override + public Adapter caseINamedElement(INamedElement object) { + return createINamedElementAdapter(); + } + @Override + public Adapter caseIAnnotatedSpecification(IAnnotatedSpecification object) { + return createIAnnotatedSpecificationAdapter(); + } + @Override + public Adapter caseIHiddenSpecification(IHiddenSpecification object) { + return createIHiddenSpecificationAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress <em>Core Address</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress + * @generated + */ + public Adapter createCoreAddressAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.af3.platform.raspberry.model.annotation.PinNumber <em>Pin Number</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.af3.platform.raspberry.model.annotation.PinNumber + * @generated + */ + public Adapter createPinNumberAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.tooling.kernel.model.IIdLabeled <em>IId Labeled</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.tooling.kernel.model.IIdLabeled + * @generated + */ + public Adapter createIIdLabeledAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.tooling.base.model.element.IModelElementSpecification <em>IModel Element Specification</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.tooling.base.model.element.IModelElementSpecification + * @generated + */ + public Adapter createIModelElementSpecificationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.tooling.kernel.model.INamedElement <em>INamed Element</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.tooling.kernel.model.INamedElement + * @generated + */ + public Adapter createINamedElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.tooling.base.model.element.IAnnotatedSpecification <em>IAnnotated Specification</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.tooling.base.model.element.IAnnotatedSpecification + * @generated + */ + public Adapter createIAnnotatedSpecificationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.fortiss.tooling.base.model.element.IHiddenSpecification <em>IHidden Specification</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.fortiss.tooling.base.model.element.IHiddenSpecification + * @generated + */ + public Adapter createIHiddenSpecificationAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //AnnotationAdapterFactory diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationSwitch.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationSwitch.java new file mode 100644 index 00000000..14e2caa2 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/annotation/util/AnnotationSwitch.java @@ -0,0 +1,223 @@ +/** + */ +package org.fortiss.af3.platform.raspberry.model.annotation.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import org.fortiss.af3.platform.raspberry.model.annotation.*; + +import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; +import org.fortiss.tooling.base.model.element.IHiddenSpecification; +import org.fortiss.tooling.base.model.element.IModelElementSpecification; + +import org.fortiss.tooling.kernel.model.IIdLabeled; +import org.fortiss.tooling.kernel.model.INamedElement; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage + * @generated + */ +public class AnnotationSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static AnnotationPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public AnnotationSwitch() { + if (modelPackage == null) { + modelPackage = AnnotationPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case AnnotationPackage.CORE_ADDRESS: { + CoreAddress coreAddress = (CoreAddress)theEObject; + T result = caseCoreAddress(coreAddress); + if (result == null) result = caseIAnnotatedSpecification(coreAddress); + if (result == null) result = caseIHiddenSpecification(coreAddress); + if (result == null) result = caseIModelElementSpecification(coreAddress); + if (result == null) result = caseINamedElement(coreAddress); + if (result == null) result = caseIIdLabeled(coreAddress); + if (result == null) result = defaultCase(theEObject); + return result; + } + case AnnotationPackage.PIN_NUMBER: { + PinNumber pinNumber = (PinNumber)theEObject; + T result = casePinNumber(pinNumber); + if (result == null) result = caseIAnnotatedSpecification(pinNumber); + if (result == null) result = caseIHiddenSpecification(pinNumber); + if (result == null) result = caseIModelElementSpecification(pinNumber); + if (result == null) result = caseINamedElement(pinNumber); + if (result == null) result = caseIIdLabeled(pinNumber); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Core Address</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Core Address</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCoreAddress(CoreAddress object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Pin Number</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Pin Number</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePinNumber(PinNumber object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>IId Labeled</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>IId Labeled</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIIdLabeled(IIdLabeled object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>IModel Element Specification</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>IModel Element Specification</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIModelElementSpecification(IModelElementSpecification object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>INamed Element</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>INamed Element</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseINamedElement(INamedElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>IAnnotated Specification</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>IAnnotated Specification</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIAnnotatedSpecification(IAnnotatedSpecification object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>IHidden Specification</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>IHidden Specification</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIHiddenSpecification(IHiddenSpecification object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //AnnotationSwitch diff --git a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/impl/ModelPackageImpl.java b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/impl/ModelPackageImpl.java index 4cae8c90..bab6f137 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/impl/ModelPackageImpl.java +++ b/org.fortiss.af3.platform.raspberry/trunk/generated-src/org/fortiss/af3/platform/raspberry/model/impl/ModelPackageImpl.java @@ -27,6 +27,8 @@ import org.fortiss.af3.platform.raspberry.model.RaspberryPi2; import org.fortiss.af3.platform.raspberry.model.RaspberryPi3; import org.fortiss.af3.platform.raspberry.model.Sensor; import org.fortiss.af3.platform.raspberry.model.SensorIn; +import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage; +import org.fortiss.af3.platform.raspberry.model.annotation.impl.AnnotationPackageImpl; /** * <!-- begin-user-doc --> @@ -196,11 +198,16 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage { // Initialize simple dependencies AF3PlatformPackage.eINSTANCE.eClass(); + // Obtain or create and register interdependencies + AnnotationPackageImpl theAnnotationPackage = (AnnotationPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(AnnotationPackage.eNS_URI) instanceof AnnotationPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(AnnotationPackage.eNS_URI) : AnnotationPackage.eINSTANCE); + // Create package meta-data objects theModelPackage.createPackageContents(); + theAnnotationPackage.createPackageContents(); // Initialize created meta-data theModelPackage.initializePackageContents(); + theAnnotationPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theModelPackage.freeze(); @@ -440,8 +447,12 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage { setNsURI(eNS_URI); // Obtain other dependent packages + AnnotationPackage theAnnotationPackage = (AnnotationPackage)EPackage.Registry.INSTANCE.getEPackage(AnnotationPackage.eNS_URI); AF3PlatformPackage theAF3PlatformPackage = (AF3PlatformPackage)EPackage.Registry.INSTANCE.getEPackage(AF3PlatformPackage.eNS_URI); + // Add subpackages + getESubpackages().add(theAnnotationPackage); + // Create type parameters // Set bounds for type parameters diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/ActuatorOutExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/ActuatorOutExecutable.java index e8beeace..f757b27e 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/ActuatorOutExecutable.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/ActuatorOutExecutable.java @@ -17,13 +17,13 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.af3.platform.raspberry.generator.executable; +import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.createVar; import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation; import org.fortiss.af3.component.model.OutputPort; import org.fortiss.af3.deployment.model.Deployment; import org.fortiss.af3.expression.model.terms.IExpressionTerm; -import org.fortiss.af3.expression.utils.ExpressionModelElementFactory; import org.fortiss.af3.platform.language.executable.TransmitterExecutableBase; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.ITermExecutable; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IWriteExecutableWithNoValSupport; @@ -52,13 +52,15 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut /** {@inheritDoc} */ @Override public IExpressionTerm getInitialization() { - return funcCall("init_Actuator");// + modelElement.getName() + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("init_Actuator", createVar(actuatorId)); } /** {@inheritDoc} */ @Override public IExpressionTerm getTermination() { - return funcCall("term_Actuator"); + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("term_Actuator", createVar(actuatorId)); } /** {@inheritDoc} */ @@ -67,8 +69,8 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) { PinNumber ias = getAnnotation(modelElement, PinNumber.class); int pinNr = ias.getPinNumber(); - return funcCall("write_Actuator", ExpressionModelElementFactory.createVar(pinNr + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("write_Actuator", createVar(pinNr + ""), createVar(actuatorId)); } @@ -85,8 +87,8 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut Deployment depl) { PinNumber ias = getAnnotation(modelElement, PinNumber.class); int pinNr = ias.getPinNumber(); - return funcCall("write_Actuator", ExpressionModelElementFactory.createVar(pinNr + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("write_Actuator", createVar(pinNr + ""), createVar(actuatorId)); } /** {@inheritDoc} */ @@ -100,7 +102,8 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut @Override public IExpressionTerm getTermination(Deployment depl) { // TODO Auto-generated method stub - return funcCall("term_Actuator"); + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("term_Actuator", createVar(actuatorId)); } /** {@inheritDoc} */ @@ -122,7 +125,8 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut @Override public IExpressionTerm getInitialization(Deployment depl) { // TODO Auto-generated method stub - return funcCall("init_Actuator"); + String actuatorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("init_Actuator", createVar(actuatorId)); } } diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusMasterPortExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusMasterPortExecutable.java index abdd3a78..4c509ab6 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusMasterPortExecutable.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusMasterPortExecutable.java @@ -18,6 +18,7 @@ $Id$ package org.fortiss.af3.platform.raspberry.generator.executable; import static org.fortiss.af3.deployment.utils.DeploymentUtils.findECUforDeployedComponent; +import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.createVar; import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation; @@ -26,11 +27,12 @@ import org.fortiss.af3.component.model.Channel; import org.fortiss.af3.component.model.Component; import org.fortiss.af3.component.model.InputPort; import org.fortiss.af3.component.model.OutputPort; +import org.fortiss.af3.component.model.Port; import org.fortiss.af3.deployment.model.Deployment; import org.fortiss.af3.expression.model.terms.IExpressionTerm; -import org.fortiss.af3.expression.utils.ExpressionModelElementFactory; import org.fortiss.af3.platform.language.executable.TransceiverExecutableBase; import org.fortiss.af3.platform.model.ExecutionUnit; +import org.fortiss.af3.platform.model.IPlatformArchitectureElement; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IReadExecutableWithNoValSupport; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.ITermExecutable; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IWriteExecutableWithNoValSupport; @@ -60,13 +62,15 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster /** {@inheritDoc} */ @Override public IExpressionTerm getInitialization(Deployment depl) { - return funcCall("init_" + modelElement.getName()); + int currentCoreAddress = getParentCoreAddress(); + return funcCall("init_" + modelElement.getName(), createVar(currentCoreAddress + "")); } /** {@inheritDoc} */ @Override public IExpressionTerm getTermination(Deployment depl) { - return funcCall("term_" + modelElement.getName()); + int currentCoreAddress = getParentCoreAddress(); + return funcCall("term_" + modelElement.getName(), createVar(currentCoreAddress + "")); } /** {@inheritDoc} */ @@ -74,28 +78,24 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value, Deployment depl) { int coreAddress = getTargetCoreAddress(logicalSignal, depl); - return funcCall("write_" + modelElement.getName(), - ExpressionModelElementFactory.createVar(coreAddress + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); - // return funcCall("write_" + modelElement.getName(), value); + String signalId = logicalSignal.getName() + "_ID_" + logicalSignal.getId(); + return funcCall("write_" + modelElement.getName(), createVar(coreAddress + ""), + createVar(signalId)); } /** {@inheritDoc} */ @Override public IExpressionTerm getValueReadAccessor(InputPort logicalSignal, Deployment depl) { - - int coreAddress = getSourceCoreAddress(logicalSignal, depl); - - return funcCall("read_" + modelElement.getName(), - ExpressionModelElementFactory.createVar(coreAddress + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); + Port sourceSignal = getSourceSignal(logicalSignal); + String signalId = sourceSignal.getName() + "_ID_" + sourceSignal.getId(); + return funcCall("read_" + modelElement.getName(), createVar(signalId)); } /** {@inheritDoc} */ @Override public IExpressionTerm getNoValWriteAccessor(OutputPort logicalSignal) { - return funcCall("set_noval_" + modelElement.getName());// + "_" + logicalSignal.getName() + return funcCall("set_noval_" + modelElement.getName()); } /** {@inheritDoc} */ @@ -104,29 +104,12 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster return funcCall("is_noval_" + modelElement.getName()); } - /** {@inheritDoc} */ - @Override - public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { - // TODO Auto-generated method stub - return null; - } - - /** {@inheritDoc} */ - @Override - public IExpressionTerm getNoValGuardAccessor(IExpressionTerm signal, IExpressionTerm buffer) { - // TODO Auto-generated method stub - return null; - } - - /** Gets the address for the core that drives the Input Port */ - - private int getSourceCoreAddress(InputPort logicalSignal, Deployment depl) { + /** Get source signal for the current port */ + private Port getSourceSignal(InputPort logicalSignal) { EList<Channel> channels = logicalSignal.getIncomingChannels(); // get one of the channels, usually only one channel will be connected per input port - Component sourceComponent = channels.get(0).getSource().getComponent(); - ExecutionUnit sourceCore = findECUforDeployedComponent(sourceComponent, depl); - CoreAddress ias = getAnnotation(sourceCore, CoreAddress.class); - return ias.getCoreAddress();// sourceCore.getId(); + Port sourceSignal = channels.get(0).getSource(); + return sourceSignal; } /** Gets the address for the core that acts as sink for the Output Port */ @@ -139,6 +122,27 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster return ias.getCoreAddress(); } + /** Get core address the modelElement is deployed on */ + private int getParentCoreAddress() { + IPlatformArchitectureElement parentElement = modelElement.getPlatformElement(); + CoreAddress ias = getAnnotation(parentElement, CoreAddress.class); + return ias.getCoreAddress(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { + // TODO Auto-generated method stub + return null; + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValGuardAccessor(IExpressionTerm signal, IExpressionTerm buffer) { + // TODO Auto-generated method stub + return null; + } + /** {@inheritDoc} */ @Override public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) { diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/SensorInExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/SensorInExecutable.java index 7ea678c2..d8652e9b 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/SensorInExecutable.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/SensorInExecutable.java @@ -17,13 +17,13 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.af3.platform.raspberry.generator.executable; +import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.createVar; import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation; import org.fortiss.af3.component.model.InputPort; import org.fortiss.af3.deployment.model.Deployment; import org.fortiss.af3.expression.model.terms.IExpressionTerm; -import org.fortiss.af3.expression.utils.ExpressionModelElementFactory; import org.fortiss.af3.platform.language.executable.ReceiverExecutableBase; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IReadExecutableWithNoValSupport; import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.ITermExecutable; @@ -52,13 +52,15 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme /** {@inheritDoc} */ @Override public IExpressionTerm getInitialization() { - return funcCall("init_Sensor"); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("init_Sensor", createVar(sensorId)); } /** {@inheritDoc} */ @Override public IExpressionTerm getTermination() { - return funcCall("term_Sensor"); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("term_Sensor", createVar(sensorId)); } /** {@inheritDoc} */ @@ -67,8 +69,8 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { PinNumber ias = getAnnotation(modelElement, PinNumber.class); int pinNr = ias.getPinNumber(); - return funcCall("read_Sensor", ExpressionModelElementFactory.createVar(pinNr + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("read_Sensor", createVar(pinNr + ""), createVar(sensorId)); } /** {@inheritDoc} */ @@ -83,8 +85,8 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme public IExpressionTerm getValueReadAccessor(InputPort logicalSignal, Deployment depl) { PinNumber ias = getAnnotation(modelElement, PinNumber.class); int pinNr = ias.getPinNumber(); - return funcCall("read_Sensor", ExpressionModelElementFactory.createVar(pinNr + ""), - ExpressionModelElementFactory.createVar(logicalSignal.getName() + "")); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("read_Sensor", createVar(pinNr + ""), createVar(sensorId)); } /** {@inheritDoc} */ @@ -105,7 +107,8 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme @Override public IExpressionTerm getTermination(Deployment depl) { // TODO Auto-generated method stub - return funcCall("term_Sensor"); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("term_Sensor", createVar(sensorId)); } /** {@inheritDoc} */ @@ -127,6 +130,7 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme @Override public IExpressionTerm getInitialization(Deployment depl) { // TODO Auto-generated method stub - return funcCall("init_Sensor"); + String sensorId = modelElement.getName() + "_ID_" + modelElement.getId(); + return funcCall("init_Sensor", createVar(sensorId)); } } -- GitLab