From f0463bbfd90d005322d30871fec3bc1b2330ec04 Mon Sep 17 00:00:00 2001
From: Harald Martini <harald.martini@student.tugraz.at>
Date: Thu, 4 Nov 2021 07:34:20 +0100
Subject: [PATCH] Added simple types for attributes in
 ElectricMachineSystemPowerMapEntryType and
 ElectricMachineSystemVoltageLevelStandardValuesType. Split
 ElectricMachineSystemPowerMapEntryType and
 ElectricMachineSystemVoltageLevelStandardValuesType in seperate types for
 electric machines and IEPC

---
 ...ationDefinitions.2.10.1_xEV_Components.xsd | 192 ++++++++++++------
 1 file changed, 130 insertions(+), 62 deletions(-)

diff --git a/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.10.1_xEV_Components.xsd b/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.10.1_xEV_Components.xsd
index 030266d2eb..7ec15abf79 100644
--- a/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.10.1_xEV_Components.xsd
+++ b/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.10.1_xEV_Components.xsd
@@ -588,57 +588,38 @@
 			<xs:element name="Entry" type="v2.10.1:ElectricMachineSystemMaxTorqueEntryType" minOccurs="2" maxOccurs="unbounded"/>
 		</xs:sequence>
 	</xs:complexType>
+	<xs:complexType name="IEPCSystemMaxTorqueEntryType">
+		<xs:attribute name="outShaftSpeed" type="v2.10.1:outShaftSpeedType" use="required">
+			<xs:annotation>
+				<xs:documentation>P501 - [rpm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="maxTorque" type="v2.10.1:maxTorqueType" use="required">
+			<xs:annotation>
+				<xs:documentation>P502 - [Nm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="minTorque" type="v2.10.1:minTorqueType" use="required">
+			<xs:annotation>
+				<xs:documentation>P503 - [Nm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+	</xs:complexType>
 	<xs:complexType name="ElectricMachineSystemMaxTorqueEntryType">
-		<xs:attribute name="outShaftSpeed" use="required">
+		<xs:attribute name="outShaftSpeed" type="v2.10.1:outShaftSpeedType" use="required">
 			<xs:annotation>
-				<xs:documentation>P468, P501 - [rpm]</xs:documentation>
-				<xs:appinfo>
-					<vectoParam:description>
-						<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">468</vectoParam:parameterId>
-						<vectoParam:parameterId component="IEPC/MaxMinTorque">501</vectoParam:parameterId>
-						<vectoParam:unit>1/min</vectoParam:unit>
-					</vectoParam:description>
-				</xs:appinfo>
+				<xs:documentation>P468 - [rpm]</xs:documentation>
 			</xs:annotation>
-			<xs:simpleType>
-				<xs:restriction base="v1.0:Double2">
-					<xs:minInclusive value="0.00"/>
-				</xs:restriction>
-			</xs:simpleType>
 		</xs:attribute>
-		<xs:attribute name="maxTorque" use="required">
+		<xs:attribute name="maxTorque" type="v2.10.1:maxTorqueType" use="required">
 			<xs:annotation>
-				<xs:documentation>P469, P502 - [Nm]</xs:documentation>
-				<xs:appinfo>
-					<vectoParam:description>
-						<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">469</vectoParam:parameterId>
-						<vectoParam:parameterId component="IEPC/MaxMinTorque">502</vectoParam:parameterId>
-						<vectoParam:unit>Nm</vectoParam:unit>
-					</vectoParam:description>
-				</xs:appinfo>
+				<xs:documentation>P469 - [Nm]</xs:documentation>
 			</xs:annotation>
-			<xs:simpleType>
-				<xs:restriction base="v1.0:Double2">
-					<xs:minInclusive value="0.00"/>
-				</xs:restriction>
-			</xs:simpleType>
 		</xs:attribute>
-		<xs:attribute name="minTorque" use="required">
+		<xs:attribute name="minTorque" type="v2.10.1:minTorqueType" use="required">
 			<xs:annotation>
-				<xs:documentation>P470, P503 - [Nm]</xs:documentation>
-				<xs:appinfo>
-					<vectoParam:description>
-						<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">470</vectoParam:parameterId>
-						<vectoParam:parameterId component="IEPC/MaxMinTorque">503</vectoParam:parameterId>
-						<vectoParam:unit>Nm</vectoParam:unit>
-					</vectoParam:description>
-				</xs:appinfo>
+				<xs:documentation>P470 - [Nm]</xs:documentation>
 			</xs:annotation>
-			<xs:simpleType>
-				<xs:restriction base="v1.0:Double2">
-					<xs:maxInclusive value="0.00"/>
-				</xs:restriction>
-			</xs:simpleType>
 		</xs:attribute>
 	</xs:complexType>
 	<xs:complexType name="ElectricMachineSystemMeasuredDataDeclarationType">
@@ -697,25 +678,24 @@
 			</xs:extension>
 		</xs:complexContent>
 	</xs:complexType>
-	<xs:complexType name="ElectricMachineSystemPowerMapEntryType">
-		<xs:attribute name="outShaftSpeed" use="required">
+	<xs:complexType name="IEPCSystemPowerMapEntryType">
+		<xs:attribute name="outShaftSpeed" type="v2.10.1:outShaftSpeedType" use="required">
 			<xs:annotation>
-				<xs:documentation>P473, P506 - [rpm]</xs:documentation>
-				<xs:appinfo>
-					<vectoParam:description>
-						<vectoParam:parameterId component="ElectricMachine/PowerMap">473</vectoParam:parameterId>
-						<vectoParam:parameterId component="IEPC/PowerMap">506</vectoParam:parameterId>
-						<vectoParam:unit>1/min</vectoParam:unit>
-					</vectoParam:description>
-				</xs:appinfo>
+				<xs:documentation>P506 - [rpm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+				<xs:attribute name="torque" type="v2.10.1:PowerMapTorqueType" use="required">
+			<xs:annotation>
+				<xs:documentation>P507 - [Nm]</xs:documentation>
 			</xs:annotation>
-			<xs:simpleType>
-				<xs:restriction base="v1.0:Double2">
-					<xs:minInclusive value="0.00"/>
-				</xs:restriction>
-			</xs:simpleType>
 		</xs:attribute>
-		<xs:attribute name="torque" type="v1.0:Double2" use="required">
+		<xs:attribute name="electricPower" type="v2.10.1:PowerMapElectricPowerType" use="required">
+			<xs:annotation>
+				<xs:documentation>P508 - [W]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+	</xs:complexType>
+			<xs:simpleType name="PowerMapTorqueType">
 			<xs:annotation>
 				<xs:documentation>P474, P507 - [Nm]</xs:documentation>
 				<xs:appinfo>
@@ -726,8 +706,10 @@
 					</vectoParam:description>
 				</xs:appinfo>
 			</xs:annotation>
-		</xs:attribute>
-		<xs:attribute name="electricPower" type="v1.0:Double2" use="required">
+			<xs:restriction base="v1.0:Double2">
+			</xs:restriction>
+		</xs:simpleType>
+		<xs:simpleType name="PowerMapElectricPowerType">
 			<xs:annotation>
 				<xs:documentation>P475, P508 - [W]</xs:documentation>
 				<xs:appinfo>
@@ -738,6 +720,23 @@
 					</vectoParam:description>
 				</xs:appinfo>
 			</xs:annotation>
+			<xs:restriction base="v1.0:Double2"></xs:restriction>
+		</xs:simpleType>
+	<xs:complexType name="ElectricMachineSystemPowerMapEntryType">
+		<xs:attribute name="outShaftSpeed" type="v2.10.1:outShaftSpeedType" use="required">
+			<xs:annotation>
+				<xs:documentation>P473 - [rpm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="torque" type="v2.10.1:PowerMapTorqueType" use="required">
+			<xs:annotation>
+				<xs:documentation>P474 - [Nm]</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="electricPower" type="v2.10.1:PowerMapElectricPowerType" use="required">
+			<xs:annotation>
+				<xs:documentation>P475 - [W]</xs:documentation>
+			</xs:annotation>
 		</xs:attribute>
 	</xs:complexType>
 	<xs:complexType name="ElectricMachineSystemStandardValuesDataDeclarationType">
@@ -804,6 +803,28 @@
 			</xs:extension>
 		</xs:complexContent>
 	</xs:complexType>
+	<xs:complexType name="IEPCSystemVoltageLevelStandardValuesType">
+		<xs:complexContent>
+			<xs:extension base="v2.10.1:AbstractElectricMachineSystemVoltageLevelType">
+				<xs:sequence>
+					<xs:element name="MaxTorqueCurve">
+						<xs:complexType>
+							<xs:sequence>
+								<xs:element name="Entry" type="v2.10.1:IEPCSystemMaxTorqueEntryType" minOccurs="2" maxOccurs="unbounded"/>
+							</xs:sequence>
+						</xs:complexType>
+					</xs:element>
+					<xs:element name="PowerMap">
+						<xs:complexType>
+							<xs:sequence>
+								<xs:element name="Entry" type="v2.10.1:ElectricMachineSystemPowerMapEntryType" minOccurs="4" maxOccurs="unbounded"/>
+							</xs:sequence>
+						</xs:complexType>
+					</xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
 	<xs:complexType name="ElectricMachineSystemVoltageLevelStandardValuesType">
 		<xs:complexContent>
 			<xs:extension base="v2.10.1:AbstractElectricMachineSystemVoltageLevelType">
@@ -949,7 +970,7 @@
 					<xs:element name="PowerMap" maxOccurs="unbounded">
 						<xs:complexType>
 							<xs:sequence>
-								<xs:element name="Entry" type="v2.10.1:ElectricMachineSystemPowerMapEntryType" minOccurs="4" maxOccurs="unbounded"/>
+								<xs:element name="Entry" type="v2.10.1:IEPCSystemPowerMapEntryType" minOccurs="4" maxOccurs="unbounded"/>
 							</xs:sequence>
 							<xs:attribute name="gear" use="required">
 								<xs:simpleType>
@@ -1117,7 +1138,7 @@
 						</xs:annotation>
 					</xs:element>
 					<xs:element name="Gears" type="v2.10.1:AbstractIEPCGearsDeclarationType"/>
-					<xs:element name="VoltageLevel" type="v2.10.1:ElectricMachineSystemVoltageLevelStandardValuesType"/>
+					<xs:element name="VoltageLevel" type="v2.10.1:IEPCSystemVoltageLevelStandardValuesType"/>
 					<xs:element name="DragCurve">
 						<xs:complexType>
 							<xs:sequence>
@@ -1662,4 +1683,51 @@
 			</xs:element>
 		</xs:sequence>
 	</xs:group>
+	<xs:simpleType name="outShaftSpeedType">
+		<xs:annotation>
+			<xs:documentation>P468, P501 - [rpm]</xs:documentation>
+			<xs:appinfo>
+				<vectoParam:description>
+					<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">468</vectoParam:parameterId>
+					<vectoParam:parameterId component="ElectricMachine/PowerMap">473</vectoParam:parameterId>
+					<vectoParam:parameterId component="IEPC/MaxMinTorque">501</vectoParam:parameterId>
+					<vectoParam:parameterId component="IEPC/PowerMap">506</vectoParam:parameterId>
+					<vectoParam:unit>1/min</vectoParam:unit>
+				</vectoParam:description>
+			</xs:appinfo>
+		</xs:annotation>
+		<xs:restriction base="v1.0:Double2">
+			<xs:minInclusive value="0.00"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="maxTorqueType">
+		<xs:annotation>
+			<xs:documentation>P469, P502 - [Nm]</xs:documentation>
+			<xs:appinfo>
+				<vectoParam:description>
+					<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">469</vectoParam:parameterId>
+					<vectoParam:parameterId component="IEPC/MaxMinTorque">502</vectoParam:parameterId>
+					<vectoParam:unit>Nm</vectoParam:unit>
+				</vectoParam:description>
+			</xs:appinfo>
+		</xs:annotation>
+		<xs:restriction base="v1.0:Double2">
+			<xs:minInclusive value="0.00"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="minTorqueType">
+		<xs:annotation>
+			<xs:documentation>P470, P503 - [Nm]</xs:documentation>
+			<xs:appinfo>
+				<vectoParam:description>
+					<vectoParam:parameterId component="ElectricMachine/MaxMinTorque">470</vectoParam:parameterId>
+					<vectoParam:parameterId component="IEPC/MaxMinTorque">503</vectoParam:parameterId>
+					<vectoParam:unit>Nm</vectoParam:unit>
+				</vectoParam:description>
+			</xs:appinfo>
+		</xs:annotation>
+		<xs:restriction base="v1.0:Double2">
+			<xs:maxInclusive value="0.00"/>
+		</xs:restriction>
+	</xs:simpleType>
 </xs:schema>
-- 
GitLab