diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTyreDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTyreDataProvider.cs index 8771014c85c8e96b26f22ee9044df58a1bcce6a0..0b4130a690fdf34f72b9d7d4a07e1fcd59239cf5 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTyreDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTyreDataProvider.cs @@ -126,4 +126,22 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return NAMESPACE_URI; } } } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationTyreDataProviderV23 : XMLDeclarationTyreDataProviderV10 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V23; + + //public new const string XSD_TYPE = "TyreComponentDeclarationType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + public XMLDeclarationTyreDataProviderV23(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + : base(vehicle, componentNode, sourceFile) { } + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + + //public override string FuelEfficiencyClass => GetString("FuelEfficiencyClass"); + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV23InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV23InjectModule.cs index dc2fb66dd0d7bdb71eea200947c3d9fca5c5ee35..1f52aad43db8f9802655affd9aea22086bd48bcb 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV23InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV23InjectModule.cs @@ -9,6 +9,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules public override void Load() { Bind<IXMLEngineDeclarationInputData>().To<XMLDeclarationEngineDataProviderV23>().Named( XMLDeclarationEngineDataProviderV23.QUALIFIED_XSD_TYPE); + + Bind<IXMLTyreDeclarationInputData>().To<XMLDeclarationTyreDataProviderV23>().Named( + XMLDeclarationTyreDataProviderV23.QUALIFIED_XSD_TYPE); } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs index a00fa6f0078d4dca5d7011240e1f2c0b51859bf3..5b1aa0be71fa203e15b723bda05d3c08acee8c4a 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs @@ -96,7 +96,7 @@ namespace TUGraz.VectoCore.OutputData.XML new XElement(tns + XMLNames.Vehicle_ZeroEmissionVehicle, modelData.VehicleData.ZeroEmissionVehicle), new XElement(tns + XMLNames.Vehicle_HybridElectricHDV, modelData.VehicleData.HybridElectricHDV), new XElement(tns + "WasteHeatRecovery", modelData.EngineData.WHRType != WHRType.None), - new XElement(tns + XMLNames.Vehicle_DualFuelVehicle, modelData.VehicleData.DualFuelVehicle), + new XElement(tns + XMLNames.Vehicle_DualFuelVehicle, modelData.EngineData.Fuels.Count > 1), exempted ? ExemptedData(modelData) : new[] { new XElement(tns + XMLNames.Vehicle_AxleConfiguration, modelData.VehicleData.AxleConfiguration.GetName()), @@ -134,7 +134,7 @@ namespace TUGraz.VectoCore.OutputData.XML private XElement[] ComponentData(VectoRunData modelData) { - return new[] { + var retVal = new List<XElement>() { new XElement( tns + XMLNames.Report_Vehicle_EngineRatedPower, XMLHelper.ValueAsUnit(modelData.EngineData.RatedPowerDeclared, XMLNames.Unit_kW)), @@ -147,7 +147,10 @@ namespace TUGraz.VectoCore.OutputData.XML // fuelModes.SelectMany(x => x.Select(f => f.FuelType.ToXMLFormat())).Distinct() // .Select(x => new XElement(tns + XMLNames.Engine_FuelType, x)) //), - new XElement(tns + XMLNames.Engine_FuelType, modelData.EngineData.Fuels.First().FuelData.FuelType.ToXMLFormat()), + }; + retVal.AddRange(modelData.EngineData.Fuels.Select(x => + new XElement(tns + XMLNames.Engine_FuelType, x.FuelData.FuelType.ToXMLFormat()))); + retVal.AddRange(new [] { new XElement( tns + XMLNames.Report_Vehicle_TransmissionCertificationMethod, modelData.GearboxData.CertificationMethod.ToXMLFormat()), @@ -160,8 +163,8 @@ namespace TUGraz.VectoCore.OutputData.XML new XElement( tns + XMLNames.Report_Vehicle_AverageRRCLabel, DeclarationData.Wheels.TyreClass.Lookup(modelData.VehicleData.AverageRollingResistanceTruck)) - }; - + }); + return retVal.ToArray(); } private XElement CreateDummySig() @@ -210,7 +213,7 @@ namespace TUGraz.VectoCore.OutputData.XML { return new object[] { new XElement(tns + XMLNames.Report_Result_Payload, XMLHelper.ValueAsUnit(result.Payload, XMLNames.Unit_kg, 0)), - new XElement(tns + XMLNames.Report_Results_FuelType, XMLHelper.ToXmlStr(DeclarationData.FuelData.Lookup(result.FuelData.First().FuelType, result.FuelData.First().TankSystem))), + result.FuelData.Select(x => new XElement(tns + XMLNames.Report_Results_FuelType, XMLHelper.ToXmlStr(DeclarationData.FuelData.Lookup(x.FuelType, x.TankSystem)))), new XElement(tns + XMLNames.Report_Results_AverageSpeed, XMLHelper.ValueAsUnit(result.AverageSpeed, XMLNames.Unit_kmph, 1)), XMLDeclarationReport.GetResults(result, tns, false).Cast<object>().ToArray() }; diff --git a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs index 3135a128ed968a8d599ac8367e13f92970094d05..aecf88b7ef4ab2df78423bdef29c9e37f41e1681 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs @@ -91,7 +91,7 @@ namespace TUGraz.VectoCore.OutputData.XML new XElement(tns + XMLNames.Vehicle_CurbMassChassis, XMLHelper.ValueAsUnit(modelData.VehicleData.CurbMass, XMLNames.Unit_kg)), new XElement(tns + XMLNames.Vehicle_ZeroEmissionVehicle, modelData.VehicleData.ZeroEmissionVehicle), new XElement(tns + XMLNames.Vehicle_HybridElectricHDV, modelData.VehicleData.HybridElectricHDV), - new XElement(tns + XMLNames.Vehicle_DualFuelVehicle, modelData.VehicleData.DualFuelVehicle), + new XElement(tns + XMLNames.Vehicle_DualFuelVehicle, modelData.EngineData.Fuels.Count > 1), exempted ? ExemptedData(modelData) : new[] { @@ -391,7 +391,7 @@ namespace TUGraz.VectoCore.OutputData.XML new XElement(tns + XMLNames.Report_ResultEntry_SimulationParameters, new XElement(tns + XMLNames.Report_ResultEntry_TotalVehicleMass, XMLHelper.ValueAsUnit(result.TotalVehicleWeight, XMLNames.Unit_kg)), new XElement(tns + XMLNames.Report_ResultEntry_Payload, XMLHelper.ValueAsUnit(result.Payload, XMLNames.Unit_kg)), - new XElement(tns + XMLNames.Report_ResultEntry_FuelType, XMLHelper.ToXmlStr(DeclarationData.FuelData.Lookup(result.FuelData.First().FuelType, result.FuelData.First().TankSystem))) + result.FuelData.Select(x => new XElement(tns + XMLNames.Report_ResultEntry_FuelType, XMLHelper.ToXmlStr(DeclarationData.FuelData.Lookup(x.FuelType, x.TankSystem)))) ), new XElement(tns + XMLNames.Report_ResultEntry_VehiclePerformance, new XElement(tns + XMLNames.Report_ResultEntry_AverageSpeed, XMLHelper.ValueAsUnit(result.AverageSpeed, XMLNames.Unit_kmph, 1)), diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.7.2.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.7.2.xsd index b71ca11975d38dd0e3830b033d4855b179b72ddd..54bdf204917a430676e7e6d025433cebaf280213 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.7.2.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.7.2.xsd @@ -46,7 +46,7 @@ </xs:simpleContent> </xs:complexType> </xs:element> - <xs:element name="FuelType" type="xs:string"/> + <xs:element name="FuelType" type="xs:string" maxOccurs="unbounded"/> <xs:element name="AverageSpeed"> <xs:complexType> <xs:simpleContent> @@ -301,7 +301,7 @@ </xs:simpleContent> </xs:complexType> </xs:element> - <xs:element name="FuelType" type="vdecdef:FuelTypeType"> + <xs:element name="FuelType" type="vdecdef:FuelTypeType" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>P193 / II.1.2.3</xs:documentation> </xs:annotation> diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.2.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.2.xsd index bc76d16d5bdf3dc3af037c7ebecd256e5977943d..41f1034cf36e18787201902175cbc6417be9057d 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.2.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.2.xsd @@ -441,7 +441,7 @@ </xs:simpleContent> </xs:complexType> </xs:element> - <xs:element name="FuelType" type="xs:string"> + <xs:element name="FuelType" type="xs:string" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>P193, P275 / I.2.1.3 / #58</xs:documentation> </xs:annotation> diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index c50be45faac4b77306bf0b46266660b1711ac1a4..98e7bb8d3eb1d4b61ff01b881e9c42e84e79a152 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -178,6 +178,7 @@ <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV21InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV221InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV22InjectModule.cs" /> + <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV23InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\AbstractComponentReader.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLADASReader.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLComponentReader.cs" />