diff --git a/org.example.democatalog.edit/META-INF/MANIFEST.MF b/org.example.democatalog.edit/META-INF/MANIFEST.MF index bbd169fde74e2a3c4c8f5da9b7b553a289285ddf..07a648d22ceb5e8c81d26ab0a7050a3137521059 100644 --- a/org.example.democatalog.edit/META-INF/MANIFEST.MF +++ b/org.example.democatalog.edit/META-INF/MANIFEST.MF @@ -11,6 +11,8 @@ Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-15 Export-Package: org.example.democatalog.provider Require-Bundle: org.eclipse.core.runtime, + org.example.democatalog;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport, - org.example.democatalog.model;bundle-version="1.0.0" + de.hftstuttgart.cityunits.model;visibility:=reexport, + de.hftstuttgart.cityunits.model.edit;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/DemocatalogEditPlugin.java b/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/DemocatalogEditPlugin.java index b080cb2d1faa5537e3a812a61c0cabace5b81f26..8e59c3df145e62ed011822420e2bc8006f623bf5 100644 --- a/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/DemocatalogEditPlugin.java +++ b/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/DemocatalogEditPlugin.java @@ -2,6 +2,7 @@ */ package org.example.democatalog.provider; +import de.hftstuttgart.cityunits.model.quantities.provider.QuantitiesEditPlugin; import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.util.ResourceLocator; @@ -36,7 +37,7 @@ public final class DemocatalogEditPlugin extends EMFPlugin { * @generated */ public DemocatalogEditPlugin() { - super(new ResourceLocator[] {}); + super(new ResourceLocator[] { QuantitiesEditPlugin.INSTANCE, }); } /** diff --git a/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/InverterItemProvider.java b/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/InverterItemProvider.java index c7e86b9d2316df77259e99322880b112b069022b..66c40b15b0566bf4d7e9a1f28ca17b337d27fc97 100644 --- a/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/InverterItemProvider.java +++ b/org.example.democatalog.edit/src-gen/org/example/democatalog/provider/InverterItemProvider.java @@ -63,7 +63,7 @@ public class InverterItemProvider extends ElectricalDeviceItemProvider { getString("_UI_PropertyDescriptor_description", "_UI_Inverter_maxDCVoltage_feature", "_UI_Inverter_type"), DemocatalogPackage.Literals.INVERTER__MAX_DC_VOLTAGE, true, false, false, - ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null)); + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** @@ -79,7 +79,7 @@ public class InverterItemProvider extends ElectricalDeviceItemProvider { getString("_UI_PropertyDescriptor_description", "_UI_Inverter_macDCCurrent_feature", "_UI_Inverter_type"), DemocatalogPackage.Literals.INVERTER__MAC_DC_CURRENT, true, false, false, - ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null)); + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** diff --git a/org.example.democatalog.model/META-INF/MANIFEST.MF b/org.example.democatalog.model/META-INF/MANIFEST.MF index 1542aa83c868d2f07ec6bd92fab2ca7c02fc3477..30fe5a7f735b79108c33cd3472a08111407bf5f1 100644 --- a/org.example.democatalog.model/META-INF/MANIFEST.MF +++ b/org.example.democatalog.model/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName -Bundle-SymbolicName: org.example.democatalog.model;singleton:=true +Bundle-SymbolicName: org.example.democatalog;singleton:=true Automatic-Module-Name: org.example.democatalog Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: . @@ -12,5 +12,6 @@ Export-Package: org.example.democatalog, org.example.democatalog.impl, org.example.democatalog.util Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport, + de.hftstuttgart.cityunits.model;visibility:=reexport, org.eclipse.core.runtime Bundle-ActivationPolicy: lazy diff --git a/org.example.democatalog.model/model/democatalog.aird b/org.example.democatalog.model/model/democatalog.aird index 998abe4e04f5f6bc534a4147611ec19006f2dde8..ff7b6f8cb1b0c85378664be9b11a8b5d72f5e67f 100644 --- a/org.example.democatalog.model/model/democatalog.aird +++ b/org.example.democatalog.model/model/democatalog.aird @@ -3,9 +3,11 @@ <viewpoint:DAnalysis uid="_HZnjoCHUEeuLPpz77IfmqA" selectedViews="_HikEQCHUEeuLPpz77IfmqA" version="14.3.1.202003261200"> <semanticResources>democatalog.ecore</semanticResources> <semanticResources>democatalog.genmodel</semanticResources> + <semanticResources>platform:/resource/de.hftstuttgart.cityunits.model/model/Quantities.ecore</semanticResources> + <semanticResources>platform:/resource/de.hftstuttgart.cityunits.model/model/Quantities.genmodel</semanticResources> <ownedViews xmi:type="viewpoint:DView" uid="_HikEQCHUEeuLPpz77IfmqA"> <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> - <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_HkPfQCHUEeuLPpz77IfmqA" name="democatalog" repPath="#_Hji7sCHUEeuLPpz77IfmqA" changeId="19235c9b-0cc2-4f1a-9aa8-7069bd7e5fa2"> + <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_HkPfQCHUEeuLPpz77IfmqA" name="democatalog" repPath="#_Hji7sCHUEeuLPpz77IfmqA" changeId="eeb8279a-74c0-4f63-8743-3f1144ab1d0a"> <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> <target xmi:type="ecore:EPackage" href="democatalog.ecore#/"/> </ownedRepresentationDescriptors> @@ -505,7 +507,7 @@ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> </ownedStyle> <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> - <ownedElements xmi:type="diagram:DNodeListElement" uid="_h6CGcCIEEeuUrYII4OYxLg" name="maxDCVoltage : EDouble = 0.0" tooltipText=""> + <ownedElements xmi:type="diagram:DNodeListElement" uid="_h6CGcCIEEeuUrYII4OYxLg" name="maxDCVoltage : QuantityDouble = 0.0 V" tooltipText=""> <target xmi:type="ecore:EAttribute" href="democatalog.ecore#//Inverter/maxDCVoltage"/> <semanticElements xmi:type="ecore:EAttribute" href="democatalog.ecore#//Inverter/maxDCVoltage"/> <ownedStyle xmi:type="diagram:BundledImage" uid="_sAIMsSIEEeuUrYII4OYxLg" labelAlignment="LEFT" description="_hEX5gCHzEeuUrYII4OYxLg"> diff --git a/org.example.democatalog.model/model/democatalog.ecore b/org.example.democatalog.model/model/democatalog.ecore index 1aea535499b24f8ab94761b7bf7429f23e43c712..cf3ae9f5619867b591ba88f02dbf5f3aeffcfc27 100644 --- a/org.example.democatalog.model/model/democatalog.ecore +++ b/org.example.democatalog.model/model/democatalog.ecore @@ -35,9 +35,11 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Inverter" eSuperTypes="#//ElectricalDevice"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="maxDCVoltage" lowerBound="1" - eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble" defaultValueLiteral="0.0"/> + eType="ecore:EDataType ../../de.hftstuttgart.cityunits.model/model/Quantities.ecore#//QuantityDouble" + defaultValueLiteral="0.0 V"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="macDCCurrent" lowerBound="1" - eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble" defaultValueLiteral="0.0"/> + eType="ecore:EDataType ../../de.hftstuttgart.cityunits.model/model/Quantities.ecore#//QuantityDouble" + defaultValueLiteral="100.0 mV"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Manufacturer"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" diff --git a/org.example.democatalog.model/model/democatalog.genmodel b/org.example.democatalog.model/model/democatalog.genmodel index ff46aa6d425cfa3d449b4bc00c0f33dbb582034e..14cf7f5f7774640c78e3cff4a7183b6db906375a 100644 --- a/org.example.democatalog.model/model/democatalog.genmodel +++ b/org.example.democatalog.model/model/democatalog.genmodel @@ -5,7 +5,8 @@ editDirectory="/org.example.democatalog.edit/src-gen" editorDirectory="/org.example.democatalog.editor/src-gen" modelPluginID="org.example.democatalog" modelName="Democatalog" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" codeFormatting="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="15.0" - copyrightFields="false" operationReflection="true" importOrganizing="true"> + copyrightFields="false" usedGenPackages="../../de.hftstuttgart.cityunits.model/model/Quantities.genmodel#//quantities" + operationReflection="true" importOrganizing="true"> <foreignModel>democatalog.ecore</foreignModel> <testsDirectory xsi:nil="true"/> <genPackages prefix="Democatalog" basePackage="org.example" disposableProviderFactory="true" diff --git a/org.example.democatalog.model/src-gen/org/example/democatalog/Inverter.java b/org.example.democatalog.model/src-gen/org/example/democatalog/Inverter.java index 2615b0f2f80ff245ff7362131fa578b633949da9..b2866c575bbdfb5ae0d65b589b6350954ba5e717 100644 --- a/org.example.democatalog.model/src-gen/org/example/democatalog/Inverter.java +++ b/org.example.democatalog.model/src-gen/org/example/democatalog/Inverter.java @@ -2,6 +2,8 @@ */ package org.example.democatalog; +import de.hftstuttgart.cityunits.model.NullableQuantity; + /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Inverter</b></em>'. @@ -22,16 +24,16 @@ package org.example.democatalog; public interface Inverter extends ElectricalDevice { /** * Returns the value of the '<em><b>Max DC Voltage</b></em>' attribute. - * The default value is <code>"0.0"</code>. + * The default value is <code>"0.0 V"</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the value of the '<em>Max DC Voltage</em>' attribute. - * @see #setMaxDCVoltage(double) + * @see #setMaxDCVoltage(NullableQuantity) * @see org.example.democatalog.DemocatalogPackage#getInverter_MaxDCVoltage() - * @model default="0.0" required="true" + * @model default="0.0 V" dataType="de.hftstuttgart.cityunits.model.quantities.QuantityDouble" required="true" * @generated */ - double getMaxDCVoltage(); + NullableQuantity getMaxDCVoltage(); /** * Sets the value of the '{@link org.example.democatalog.Inverter#getMaxDCVoltage <em>Max DC Voltage</em>}' attribute. @@ -41,20 +43,20 @@ public interface Inverter extends ElectricalDevice { * @see #getMaxDCVoltage() * @generated */ - void setMaxDCVoltage(double value); + void setMaxDCVoltage(NullableQuantity value); /** * Returns the value of the '<em><b>Mac DC Current</b></em>' attribute. - * The default value is <code>"0.0"</code>. + * The default value is <code>"100.0 mV"</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the value of the '<em>Mac DC Current</em>' attribute. - * @see #setMacDCCurrent(double) + * @see #setMacDCCurrent(NullableQuantity) * @see org.example.democatalog.DemocatalogPackage#getInverter_MacDCCurrent() - * @model default="0.0" required="true" + * @model default="100.0 mV" dataType="de.hftstuttgart.cityunits.model.quantities.QuantityDouble" required="true" * @generated */ - double getMacDCCurrent(); + NullableQuantity getMacDCCurrent(); /** * Sets the value of the '{@link org.example.democatalog.Inverter#getMacDCCurrent <em>Mac DC Current</em>}' attribute. @@ -64,6 +66,6 @@ public interface Inverter extends ElectricalDevice { * @see #getMacDCCurrent() * @generated */ - void setMacDCCurrent(double value); + void setMacDCCurrent(NullableQuantity value); } // Inverter diff --git a/org.example.democatalog.model/src-gen/org/example/democatalog/impl/DemocatalogPackageImpl.java b/org.example.democatalog.model/src-gen/org/example/democatalog/impl/DemocatalogPackageImpl.java index d99ed3ce2d40052c30cf1e622c65b09ad1e7606b..3a440335a15a11335a10b2d6b39a7748d13d7fe5 100644 --- a/org.example.democatalog.model/src-gen/org/example/democatalog/impl/DemocatalogPackageImpl.java +++ b/org.example.democatalog.model/src-gen/org/example/democatalog/impl/DemocatalogPackageImpl.java @@ -2,6 +2,7 @@ */ package org.example.democatalog.impl; +import de.hftstuttgart.cityunits.model.quantities.QuantitiesPackage; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; @@ -150,6 +151,9 @@ public class DemocatalogPackageImpl extends EPackageImpl implements DemocatalogP isInited = true; + // Initialize simple dependencies + QuantitiesPackage.eINSTANCE.eClass(); + // Create package meta-data objects theDemocatalogPackage.createPackageContents(); @@ -538,6 +542,10 @@ public class DemocatalogPackageImpl extends EPackageImpl implements DemocatalogP setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); + // Obtain other dependent packages + QuantitiesPackage theQuantitiesPackage = (QuantitiesPackage) EPackage.Registry.INSTANCE + .getEPackage(QuantitiesPackage.eNS_URI); + // Create type parameters // Set bounds for type parameters @@ -593,11 +601,11 @@ public class DemocatalogPackageImpl extends EPackageImpl implements DemocatalogP initEClass(inverterEClass, Inverter.class, "Inverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getInverter_MaxDCVoltage(), ecorePackage.getEDouble(), "maxDCVoltage", "0.0", 1, 1, - Inverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + initEAttribute(getInverter_MaxDCVoltage(), theQuantitiesPackage.getQuantityDouble(), "maxDCVoltage", "0.0 V", 1, + 1, Inverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getInverter_MacDCCurrent(), ecorePackage.getEDouble(), "macDCCurrent", "0.0", 1, 1, - Inverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + initEAttribute(getInverter_MacDCCurrent(), theQuantitiesPackage.getQuantityDouble(), "macDCCurrent", "100.0 mV", + 1, 1, Inverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(manufacturerEClass, Manufacturer.class, "Manufacturer", !IS_ABSTRACT, !IS_INTERFACE, diff --git a/org.example.democatalog.model/src-gen/org/example/democatalog/impl/InverterImpl.java b/org.example.democatalog.model/src-gen/org/example/democatalog/impl/InverterImpl.java index 564348022cd67470f21021f0ea3c2de43deb2603..ab106c9e32028cd84509f3023d8aaba85f2d339c 100644 --- a/org.example.democatalog.model/src-gen/org/example/democatalog/impl/InverterImpl.java +++ b/org.example.democatalog.model/src-gen/org/example/democatalog/impl/InverterImpl.java @@ -2,6 +2,9 @@ */ package org.example.democatalog.impl; +import de.hftstuttgart.cityunits.model.NullableQuantity; +import de.hftstuttgart.cityunits.model.quantities.QuantitiesFactory; +import de.hftstuttgart.cityunits.model.quantities.QuantitiesPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; @@ -34,7 +37,8 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated * @ordered */ - protected static final double MAX_DC_VOLTAGE_EDEFAULT = 0.0; + protected static final NullableQuantity MAX_DC_VOLTAGE_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE + .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "0.0 V"); /** * The cached value of the '{@link #getMaxDCVoltage() <em>Max DC Voltage</em>}' attribute. @@ -44,7 +48,7 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated * @ordered */ - protected double maxDCVoltage = MAX_DC_VOLTAGE_EDEFAULT; + protected NullableQuantity maxDCVoltage = MAX_DC_VOLTAGE_EDEFAULT; /** * The default value of the '{@link #getMacDCCurrent() <em>Mac DC Current</em>}' attribute. @@ -54,7 +58,8 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated * @ordered */ - protected static final double MAC_DC_CURRENT_EDEFAULT = 0.0; + protected static final NullableQuantity MAC_DC_CURRENT_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE + .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "100.0 mV"); /** * The cached value of the '{@link #getMacDCCurrent() <em>Mac DC Current</em>}' attribute. @@ -64,7 +69,7 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated * @ordered */ - protected double macDCCurrent = MAC_DC_CURRENT_EDEFAULT; + protected NullableQuantity macDCCurrent = MAC_DC_CURRENT_EDEFAULT; /** * <!-- begin-user-doc --> @@ -91,7 +96,7 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated */ @Override - public double getMaxDCVoltage() { + public NullableQuantity getMaxDCVoltage() { return maxDCVoltage; } @@ -101,8 +106,8 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated */ @Override - public void setMaxDCVoltage(double newMaxDCVoltage) { - double oldMaxDCVoltage = maxDCVoltage; + public void setMaxDCVoltage(NullableQuantity newMaxDCVoltage) { + NullableQuantity oldMaxDCVoltage = maxDCVoltage; maxDCVoltage = newMaxDCVoltage; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DemocatalogPackage.INVERTER__MAX_DC_VOLTAGE, @@ -115,7 +120,7 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated */ @Override - public double getMacDCCurrent() { + public NullableQuantity getMacDCCurrent() { return macDCCurrent; } @@ -125,8 +130,8 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { * @generated */ @Override - public void setMacDCCurrent(double newMacDCCurrent) { - double oldMacDCCurrent = macDCCurrent; + public void setMacDCCurrent(NullableQuantity newMacDCCurrent) { + NullableQuantity oldMacDCCurrent = macDCCurrent; macDCCurrent = newMacDCCurrent; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DemocatalogPackage.INVERTER__MAC_DC_CURRENT, @@ -158,10 +163,10 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { public void eSet(int featureID, Object newValue) { switch (featureID) { case DemocatalogPackage.INVERTER__MAX_DC_VOLTAGE: - setMaxDCVoltage((Double) newValue); + setMaxDCVoltage((NullableQuantity) newValue); return; case DemocatalogPackage.INVERTER__MAC_DC_CURRENT: - setMacDCCurrent((Double) newValue); + setMacDCCurrent((NullableQuantity) newValue); return; } super.eSet(featureID, newValue); @@ -194,9 +199,11 @@ public class InverterImpl extends ElectricalDeviceImpl implements Inverter { public boolean eIsSet(int featureID) { switch (featureID) { case DemocatalogPackage.INVERTER__MAX_DC_VOLTAGE: - return maxDCVoltage != MAX_DC_VOLTAGE_EDEFAULT; + return MAX_DC_VOLTAGE_EDEFAULT == null ? maxDCVoltage != null + : !MAX_DC_VOLTAGE_EDEFAULT.equals(maxDCVoltage); case DemocatalogPackage.INVERTER__MAC_DC_CURRENT: - return macDCCurrent != MAC_DC_CURRENT_EDEFAULT; + return MAC_DC_CURRENT_EDEFAULT == null ? macDCCurrent != null + : !MAC_DC_CURRENT_EDEFAULT.equals(macDCCurrent); } return super.eIsSet(featureID); }