From aada907cf0a8bb59a13e919bb149ca28ea5f436a Mon Sep 17 00:00:00 2001
From: "VKMTHD\\franzjosefkober" <franz.josef.kober@ivt.tugraz.at>
Date: Mon, 14 Mar 2022 14:50:23 +0100
Subject: [PATCH] added ElectircMachine and BoostingLimitation

---
 .../Resources/XSLT/SortInputData.xslt         | 27 ++++++++++++++++---
 .../Job/Sorted/HEV-S_heavyLorry_IEPC-S.xml    |  6 +++++
 .../Job/Unsorted/HEV-S_heavyLorry_IEPC-S.xml  |  6 +++++
 .../VectoHashingTest/VectoJobHashSortTest.cs  |  4 +--
 4 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt b/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt
index 0bce8e86b3..f0d1ae4731 100644
--- a/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt
+++ b/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt
@@ -287,7 +287,7 @@
 		</xsl:if>
 	</xsl:template>
 			
-	<!-- ElectricMotorTorqueLimits -->	
+	<!-- ElectricMachineTorqueLimits -->	
 	<xsl:template match="*[local-name()='ElectricMachine' and ./*[local-name()='Position']]">		
 		<xsl:if test="count(preceding-sibling::*[local-name()='ElectricMachine']) = 0">
 			<xsl:for-each select="../*[local-name()='ElectricMachine']">
@@ -299,7 +299,7 @@
 		</xsl:if>				
 	</xsl:template>	
 	
-	<!-- AUX SteeringPump -->
+	<!-- For AUX Component SteeringPump -->
 	<xsl:template match="*[local-name()='SteeringPump']">
 		<xsl:element name="{local-name()}">
 			<xsl:apply-templates select="@*"/>
@@ -310,7 +310,28 @@
 		</xsl:element>
 	</xsl:template>	
 	
-
+	<!-- For ElectricMachine component at HEV-Px, HEV-S2, HEV-S3, HEV-S4, PEV-E2, PEV-E3 and PEV-E4 -->
+	<xsl:template match="*[local-name()='P2.5GearRatios']">
+		<xsl:element name="{local-name()}">
+			<xsl:apply-templates select="@*"/>
+			<xsl:for-each select="*">
+				<xsl:sort data-type="number" select="@gear" order="ascending"/>
+				<xsl:apply-templates select="."/>
+			</xsl:for-each>
+		</xsl:element>	
+	</xsl:template>
+	
+	<!-- For Vehicle HEV IEPC-S and Vehicle HEV-Px -->
+	<xsl:template match="*[local-name()='BoostingLimitations']">
+		<xsl:element name="{local-name()}">
+			<xsl:apply-templates select="@*"/>
+			<xsl:for-each select="*">
+				<xsl:sort data-type="number" select="@rotationalSpeed" order="ascending"/>
+				<xsl:apply-templates select="."/>
+			</xsl:for-each>
+		</xsl:element>	
+	</xsl:template>
+	
 	
 
 </xsl:transform>
diff --git a/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Sorted/HEV-S_heavyLorry_IEPC-S.xml b/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Sorted/HEV-S_heavyLorry_IEPC-S.xml
index bb400ae0f8..b114547014 100644
--- a/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Sorted/HEV-S_heavyLorry_IEPC-S.xml
+++ b/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Sorted/HEV-S_heavyLorry_IEPC-S.xml
@@ -93,6 +93,12 @@
 				</VoltageLevel>
 			</ElectricMachine>	
 		</ElectricMotorTorqueLimits>
+		<BoostingLimitations xmlns:v2.10.2="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2" xsi:type="v2.10.2:BoostingLimitationsType">
+			<Entry rotationalSpeed="0.10" boostingTorque="0.30"/>
+			<Entry rotationalSpeed="0.12" boostingTorque="0.40"/>			
+			<Entry rotationalSpeed="1.30" boostingTorque="0.60"/>			
+			<Entry rotationalSpeed="1.40" boostingTorque="0.60"/>
+		</BoostingLimitations>
 		<Components xsi:type="Components_HEV-IEPC-S_LorryType">
 			<Engine>
 				<v2.0:Data xsi:type="v1.0:EngineDataDeclarationType" id="ENG-gooZah3D" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0">
diff --git a/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Unsorted/HEV-S_heavyLorry_IEPC-S.xml b/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Unsorted/HEV-S_heavyLorry_IEPC-S.xml
index 54c3f46d82..da16aa272c 100644
--- a/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Unsorted/HEV-S_heavyLorry_IEPC-S.xml
+++ b/VectoCommon/VectoHashingTest/Testdata/XML/Sort/Job/Unsorted/HEV-S_heavyLorry_IEPC-S.xml
@@ -94,6 +94,12 @@
 				</VoltageLevel>
 			</ElectricMachine>			
 		</ElectricMotorTorqueLimits>
+		<BoostingLimitations xmlns:v2.10.2="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2" xsi:type="v2.10.2:BoostingLimitationsType">
+			<Entry rotationalSpeed="0.12" boostingTorque="0.40"/>
+			<Entry rotationalSpeed="0.10" boostingTorque="0.30"/>
+			<Entry rotationalSpeed="1.40" boostingTorque="0.60"/>
+			<Entry rotationalSpeed="1.30" boostingTorque="0.60"/>
+		</BoostingLimitations>
 		<Components xsi:type="Components_HEV-IEPC-S_LorryType">
 			<Engine>
 				<v2.0:Data xsi:type="v1.0:EngineDataDeclarationType" id="ENG-gooZah3D" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0">
diff --git a/VectoCommon/VectoHashingTest/VectoJobHashSortTest.cs b/VectoCommon/VectoHashingTest/VectoJobHashSortTest.cs
index b0bfc44f10..158c30237d 100644
--- a/VectoCommon/VectoHashingTest/VectoJobHashSortTest.cs
+++ b/VectoCommon/VectoHashingTest/VectoJobHashSortTest.cs
@@ -17,8 +17,8 @@ namespace VectoHashingTest
 			Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
 		}
 
-		[TestCase("IpWiBzrQINrCc3ZqloHqhPROp7XLcAAfHlTf1IRxsGg=", SortedComponentPath + "HEV-S_heavyLorry_IEPC-S.xml")]
-		[TestCase("IpWiBzrQINrCc3ZqloHqhPROp7XLcAAfHlTf1IRxsGg=", UnsortedComponentPath + "HEV-S_heavyLorry_IEPC-S.xml")]
+		[TestCase("NBawT5DzeZHW9gIupRB8uNtII+JYLP/JxgiMKMaskpg=", SortedComponentPath + "HEV-S_heavyLorry_IEPC-S.xml")]
+		[TestCase("NBawT5DzeZHW9gIupRB8uNtII+JYLP/JxgiMKMaskpg=", UnsortedComponentPath + "HEV-S_heavyLorry_IEPC-S.xml")]
 		public void TestJobHashSort(string expectedJobHash, string filePath)
 		{
 			var loadedFile = VectoHash.Load(filePath);
-- 
GitLab