diff --git a/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt b/VectoCommon/VectoHashing/Resources/XSLT/SortInputData.xslt index 0bce8e86b3e279b0a9804fb59256c48b5871875a..f0d1ae473117ecebc84d68441300fe666e7e85cc 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 bb400ae0f8bbb26dcb558afc238859f4374684ec..b1145470147ec306504ff7f4005cbb23cb83423b 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 54c3f46d827d7524a851ba21c36cfd5f0ab9f16c..da16aa272c15b98362f422fce3c8e39ff1e900b6 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 b0bfc44f10ab51fcb56c184630c584accd628898..158c30237d6789fc8f28b14fb98ce2a31f0f4027 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);