Commit d27d1242 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Units usage demo

parent 2f3c04e2
......@@ -108,7 +108,7 @@ public class WindowTypeItemProvider extends ItemProviderAdapter implements IEdit
getString("_UI_PropertyDescriptor_description", "_UI_WindowType_uValue_feature",
"_UI_WindowType_type"),
BuildingPhysicsPackage.Literals.WINDOW_TYPE__UVALUE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
......
......@@ -4,9 +4,10 @@
<semanticResources>buildingphysics.ecore</semanticResources>
<semanticResources>buildingphysics.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="_nfHygB3ZEeuNsK3dZmTkbQ">
<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="_nfUm0R3ZEeuNsK3dZmTkbQ" name="buildingphysics" repPath="#_nfTYsB3ZEeuNsK3dZmTkbQ" changeId="a1062b51-8959-4afb-9bd9-d8005211eecd">
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_nfUm0R3ZEeuNsK3dZmTkbQ" name="buildingphysics" repPath="#_nfTYsB3ZEeuNsK3dZmTkbQ" changeId="fac715aa-7a10-4171-90f4-69601067b0c1">
<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="buildingphysics.ecore#/"/>
</ownedRepresentationDescriptors>
......@@ -311,7 +312,7 @@
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
<arrangeConstraints>KEEP_SIZE</arrangeConstraints>
<arrangeConstraints>KEEP_RATIO</arrangeConstraints>
<ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_KeYXAYTuEeuS2t1ZhP-JHQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
<ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_5698YZMBEeuiSuHo7p9iCw" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
<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']"/>
......@@ -331,7 +332,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
<ownedElements xmi:type="diagram:DNodeListElement" uid="_KzM7ICQwEeuaK-RhvCx2-Q" name="uValue : EDouble = 0.0" tooltipText="">
<ownedElements xmi:type="diagram:DNodeListElement" uid="_KzM7ICQwEeuaK-RhvCx2-Q" name="uValue : EDouble = 3.0" tooltipText="">
<target xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//WindowType/uValue"/>
<semanticElements xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//WindowType/uValue"/>
<ownedStyle xmi:type="diagram:BundledImage" uid="_PX9fzyQwEeuaK-RhvCx2-Q" labelAlignment="LEFT" description="_FqIYkx3aEeuNsK3dZmTkbQ">
......@@ -347,10 +348,10 @@
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
<ownedElements xmi:type="diagram:DNodeListElement" uid="_1uk1UCQwEeuaK-RhvCx2-Q" name="glazingNumber : QuantityLong = 12 m" tooltipText="">
<ownedElements xmi:type="diagram:DNodeListElement" uid="_1uk1UCQwEeuaK-RhvCx2-Q" name="glazingNumber : EInt = 1" tooltipText="">
<target xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//WindowType/glazingNumber"/>
<semanticElements xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//WindowType/glazingNumber"/>
<ownedStyle xmi:type="diagram:BundledImage" uid="_KeZlJYTuEeuS2t1ZhP-JHQ" labelAlignment="LEFT" description="_FqIYkx3aEeuNsK3dZmTkbQ">
<ownedStyle xmi:type="diagram:BundledImage" uid="_57s8M5MBEeuiSuHo7p9iCw" labelAlignment="LEFT" description="_FqIYkx3aEeuNsK3dZmTkbQ">
<labelFormat>bold</labelFormat>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
......@@ -512,7 +513,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
<ownedElements xmi:type="diagram:DNodeListElement" uid="_JjJd8CQvEeuaK-RhvCx2-Q" name="heatCapacity : QuantityDouble = 0.0 kW" tooltipText="">
<ownedElements xmi:type="diagram:DNodeListElement" uid="_JjJd8CQvEeuaK-RhvCx2-Q" name="heatCapacity : QuantityDouble = J/K" tooltipText="">
<target xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//Material/heatCapacity"/>
<semanticElements xmi:type="ecore:EAttribute" href="buildingphysics.ecore#//Material/heatCapacity"/>
<ownedStyle xmi:type="diagram:BundledImage" uid="_SZDuk4TuEeuS2t1ZhP-JHQ" labelAlignment="LEFT" description="_FqIYkx3aEeuNsK3dZmTkbQ">
......
......@@ -15,11 +15,12 @@
iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="uValue" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
eType="ecore:EDataType ../../de.hftstuttgart.cityunits.model/model/Quantities.ecore#//QuantityDouble"
defaultValueLiteral="W/(m²·K)"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="gValue" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="glazingNumber" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="0"/>
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="1"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="frameRatio" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
......@@ -53,7 +54,7 @@
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="heatCapacity" lowerBound="1"
eType="ecore:EDataType ../../de.hftstuttgart.cityunits.model/model/Quantities.ecore#//QuantityDouble"
defaultValueLiteral="0.0 kW"/>
defaultValueLiteral="J/K"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="conductivity" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
</eClassifiers>
......
......@@ -95,13 +95,13 @@ public interface Material extends EObject {
/**
* Returns the value of the '<em><b>Heat Capacity</b></em>' attribute.
* The default value is <code>"0.0 kW"</code>.
* The default value is <code>"J/K"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Heat Capacity</em>' attribute.
* @see #setHeatCapacity(NullableQuantity)
* @see de.hftstuttgart.buildingphysics.BuildingPhysicsPackage#getMaterial_HeatCapacity()
* @model default="0.0 kW" dataType="de.hftstuttgart.cityunits.model.quantities.QuantityDouble" required="true"
* @model default="J/K" dataType="de.hftstuttgart.cityunits.model.quantities.QuantityDouble" required="true"
* @generated
*/
NullableQuantity getHeatCapacity();
......
......@@ -2,6 +2,7 @@
*/
package de.hftstuttgart.buildingphysics;
import de.hftstuttgart.cityunits.model.NullableQuantity;
import org.eclipse.emf.ecore.EObject;
/**
......@@ -72,15 +73,16 @@ public interface WindowType extends EObject {
/**
* Returns the value of the '<em><b>UValue</b></em>' attribute.
* The default value is <code>"W/(m*m*K)"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>UValue</em>' attribute.
* @see #setUValue(double)
* @see #setUValue(NullableQuantity)
* @see de.hftstuttgart.buildingphysics.BuildingPhysicsPackage#getWindowType_UValue()
* @model required="true"
* @model default="W/(m*m*K)" dataType="de.hftstuttgart.cityunits.model.quantities.QuantityDouble" required="true"
* @generated
*/
double getUValue();
NullableQuantity getUValue();
/**
* Sets the value of the '{@link de.hftstuttgart.buildingphysics.WindowType#getUValue <em>UValue</em>}' attribute.
......@@ -90,7 +92,7 @@ public interface WindowType extends EObject {
* @see #getUValue()
* @generated
*/
void setUValue(double value);
void setUValue(NullableQuantity value);
/**
* Returns the value of the '<em><b>GValue</b></em>' attribute.
......@@ -116,13 +118,13 @@ public interface WindowType extends EObject {
/**
* Returns the value of the '<em><b>Glazing Number</b></em>' attribute.
* The default value is <code>"0"</code>.
* The default value is <code>"1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Glazing Number</em>' attribute.
* @see #setGlazingNumber(int)
* @see de.hftstuttgart.buildingphysics.BuildingPhysicsPackage#getWindowType_GlazingNumber()
* @model default="0" required="true"
* @model default="1" required="true"
* @generated
*/
int getGlazingNumber();
......
......@@ -545,11 +545,12 @@ public class BuildingPhysicsPackageImpl extends EPackageImpl implements Building
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_Name(), ecorePackage.getEString(), "name", null, 1, 1, WindowType.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_UValue(), ecorePackage.getEDouble(), "uValue", null, 1, 1, WindowType.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_UValue(), theQuantitiesPackage.getQuantityDouble(), "uValue", "W/(m*m*K)", 1, 1,
WindowType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_GValue(), ecorePackage.getEDouble(), "gValue", null, 1, 1, WindowType.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_GlazingNumber(), ecorePackage.getEInt(), "glazingNumber", "0", 1, 1,
initEAttribute(getWindowType_GlazingNumber(), ecorePackage.getEInt(), "glazingNumber", "1", 1, 1,
WindowType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getWindowType_FrameRatio(), ecorePackage.getEInt(), "frameRatio", null, 1, 1, WindowType.class,
......@@ -592,8 +593,8 @@ public class BuildingPhysicsPackageImpl extends EPackageImpl implements Building
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getMaterial_Density(), ecorePackage.getEDouble(), "density", null, 1, 1, Material.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getMaterial_HeatCapacity(), theQuantitiesPackage.getQuantityDouble(), "heatCapacity", "0.0 kW",
1, 1, Material.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
initEAttribute(getMaterial_HeatCapacity(), theQuantitiesPackage.getQuantityDouble(), "heatCapacity", "J/K", 1,
1, Material.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getMaterial_Conductivity(), ecorePackage.getEDouble(), "conductivity", null, 1, 1,
Material.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
......
......@@ -104,7 +104,7 @@ public class MaterialImpl extends MinimalEObjectImpl.Container implements Materi
* @ordered
*/
protected static final NullableQuantity HEAT_CAPACITY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE
.createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "0.0 kW");
.createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "J/K");
/**
* The cached value of the '{@link #getHeatCapacity() <em>Heat Capacity</em>}' attribute.
......
......@@ -4,7 +4,9 @@ package de.hftstuttgart.buildingphysics.impl;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.WindowType;
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;
......@@ -79,7 +81,8 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
* @generated
* @ordered
*/
protected static final double UVALUE_EDEFAULT = 0.0;
protected static final NullableQuantity UVALUE_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE
.createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "W/(m*m*K)");
/**
* The cached value of the '{@link #getUValue() <em>UValue</em>}' attribute.
......@@ -89,7 +92,7 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
* @generated
* @ordered
*/
protected double uValue = UVALUE_EDEFAULT;
protected NullableQuantity uValue = UVALUE_EDEFAULT;
/**
* The default value of the '{@link #getGValue() <em>GValue</em>}' attribute.
......@@ -119,7 +122,7 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
* @generated
* @ordered
*/
protected static final int GLAZING_NUMBER_EDEFAULT = 0;
protected static final int GLAZING_NUMBER_EDEFAULT = 1;
/**
* The cached value of the '{@link #getGlazingNumber() <em>Glazing Number</em>}' attribute.
......@@ -223,7 +226,7 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
* @generated
*/
@Override
public double getUValue() {
public NullableQuantity getUValue() {
return uValue;
}
......@@ -233,8 +236,8 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
* @generated
*/
@Override
public void setUValue(double newUValue) {
double oldUValue = uValue;
public void setUValue(NullableQuantity newUValue) {
NullableQuantity oldUValue = uValue;
uValue = newUValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__UVALUE, oldUValue,
......@@ -352,7 +355,7 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
setName((String) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
setUValue((Double) newValue);
setUValue((NullableQuantity) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
setGValue((Double) newValue);
......@@ -410,7 +413,7 @@ public class WindowTypeImpl extends MinimalEObjectImpl.Container implements Wind
case BuildingPhysicsPackage.WINDOW_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
return uValue != UVALUE_EDEFAULT;
return UVALUE_EDEFAULT == null ? uValue != null : !UVALUE_EDEFAULT.equals(uValue);
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
return gValue != GVALUE_EDEFAULT;
case BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment