From abd8836b833a8709de362221a306203ce0a2c2e3 Mon Sep 17 00:00:00 2001 From: Harald Martini <harald.martini@student.tugraz.at> Date: Tue, 16 Aug 2022 16:21:16 +0200 Subject: [PATCH] added unit attribute to MaxContinousPropulsionPower --- .../CIFWriter/ComponentGroupWriters.cs | 10 ++++++---- .../Resources/XSD/VectoOutputCustomer.0.9.xsd | 11 ++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/ComponentGroupWriters.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/ComponentGroupWriters.cs index 83688fbcc3..d2d0ac0c48 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/ComponentGroupWriters.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/ComponentGroupWriters.cs @@ -193,13 +193,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation var voltageLevelsXElement = new XElement(_cif + "VoltageLevels"); result.Add(voltageLevelsXElement); - foreach (var electricMotorVoltageLevel in voltageLevels) - { + foreach (var electricMotorVoltageLevel in voltageLevels) { var voltageLevel = new XElement(_cif + XMLNames.ElectricMachine_VoltageLevel, - voltageLevels.Count > 1 ? new XAttribute("voltage", electricMotorVoltageLevel.VoltageLevel.ToXMLFormat(0)) : null, + voltageLevels.Count > 1 + ? new XAttribute("voltage", electricMotorVoltageLevel.VoltageLevel.ToXMLFormat(0)) + : null, new XElement(_cif + "MaxContinuousPropulsionPower", (electricMotorVoltageLevel.ContinuousTorque * electricMotorVoltageLevel.ContinuousTorqueSpeed) - .ToXMLFormat(0))); + .ValueAsUnit("kW", 0))); + voltageLevelsXElement.Add(voltageLevel); } diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd index 6ed442ddd8..da754e9fc3 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd @@ -856,9 +856,13 @@ <xs:group ref="ExemptedCompletedBusVehicleTypeGroup"/> </xs:sequence> </xs:complexType> - <xs:simpleType name="RatedPowerType"> - <xs:restriction base="xs:int"/> - </xs:simpleType> + <xs:complexType name="RatedPowerType"> + <xs:simpleContent> + <xs:extension base="xs:int"> + <xs:attribute name="unit" type="out:PowerUnitType" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> <xs:simpleType name="LegislativeCategoryType"> <xs:union memberTypes="v2.4:LegislativeCategoryHeavyLorryDeclarationType v2.4:LegislativeCategoryMediumLorryDeclarationType v2.4:LegislativeCategoryPrimaryBusDeclarationType"/> </xs:simpleType> @@ -1184,6 +1188,7 @@ <xs:complexType> <xs:sequence> <xs:element name="MaxContinuousPropulsionPower" type="RatedPowerType"/> + </xs:sequence> <xs:attribute name="voltage"/> </xs:complexType> -- GitLab