diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs index e3afd6f796f2a3ac4ab51fe4c7d68072928165e3..60196ba8d2a8e8f06c6594c46b35fbb32d03e5fc 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs @@ -455,13 +455,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- - public class XMLDeclarationPrimaryBusPEVE3ComponentDataV210 : XMLDeclarationPrimaryBusPEVE2ComponentDataV210 + public class XMLDeclarationPrimaryBusPEVExComponentDataV210 : XMLDeclarationPrimaryBusPEVE2ComponentDataV210 { public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V210_JOBS; public new const string XSD_TYPE = "Components_PEV-E3_PrimaryBusType"; + public const string XSD_PEV_E4_TYPE = "Components_PEV-E4_PrimaryBusType"; + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public static readonly string QUALIFIED_XSD_PEV_E4_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_PEV_E4_TYPE); - public XMLDeclarationPrimaryBusPEVE3ComponentDataV210(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, + public XMLDeclarationPrimaryBusPEVExComponentDataV210(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs index 614db715fa9e9ab3c98f46df05e98d973cdb49db..e518821ac97dea41ee3458ba7591b7d8db288be5 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -1449,7 +1449,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region Overrides of XMLDeclarationPEVMediumLorryExDataProviderV210 public override IList<ITorqueLimitInputData> TorqueLimits => - Components is XMLDeclarationPrimaryBusPEVE3ComponentDataV210 ? null : base.TorqueLimits; + Components is XMLDeclarationPrimaryBusPEVExComponentDataV210 ? null : base.TorqueLimits; #endregion } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs index 06735ef88efb219c9ee8ba2c1f16370754d5959a..32f1c591e3ce94f2790ee38a36e36f47cdbe572e 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs @@ -106,8 +106,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusPEVE2ComponentDataV210>() .Named(XMLDeclarationPrimaryBusPEVE2ComponentDataV210.QUALIFIED_XSD_TYPE); - Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusPEVE3ComponentDataV210>() - .Named(XMLDeclarationPrimaryBusPEVE3ComponentDataV210.QUALIFIED_XSD_TYPE); + Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusPEVExComponentDataV210>() + .Named(XMLDeclarationPrimaryBusPEVExComponentDataV210.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusPEVExComponentDataV210>() + .Named(XMLDeclarationPrimaryBusPEVExComponentDataV210.QUALIFIED_XSD_PEV_E4_TYPE); Bind<IXMLComponentReader>().To<XMLComponentReaderV210_CompletedBus>().Named(XMLComponentReaderV210_CompletedBus.QUALIFIED_XSD_TYPE); @@ -152,6 +155,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLComponentReader>().To<XMLPEVPrimaryBusE3DeclarationComponentReaderV201>() .Named(XMLPEVPrimaryBusE3DeclarationComponentReaderV201.QUALIFIED_XSD_TYPE); + Bind<IXMLComponentReader>().To<XMLPEVPrimaryBusE4DeclarationComponentReaderV201>() + .Named(XMLPEVPrimaryBusE4DeclarationComponentReaderV201.QUALIFIED_XSD_TYPE); + Bind<IXMLGearboxReader>().To<XMLGearboxDeclarationComponentReaderV201>() .Named(XMLGearboxDeclarationComponentReaderV201.GEARBOX_READER_QUALIFIED_XSD_TYPE); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs index 747a3202b07c518d2619ab25b67c8e221f395f1b..51c115ba324c873cbe7c2fac240995a175df7656 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -938,6 +938,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl #endregion } + // --------------------------------------------------------------------------------------- + + public class XMLPEVPrimaryBusE4DeclarationComponentReaderV201 : XMLPEVPrimaryBusE3DeclarationComponentReaderV201 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V210_JOBS; + public new const string XSD_TYPE = "Components_PEV-E4_PrimaryBusType"; + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLPEVPrimaryBusE4DeclarationComponentReaderV201(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) + : base(vehicle, componentsNode) { } + + + #region Overrides of XMLComponentReaderV10 + + public override IAxleGearInputData AxleGearInputData => null; + + #endregion + } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs index c7934075911404ed7123a714cc6c3912a52309a4..7e870259c2c5a585491833da95c50f5da860f3d7 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs @@ -1310,6 +1310,38 @@ namespace TUGraz.VectoCore.Tests.XML Assert.IsNull(vehicle.MaxPropulsionTorque); } + + [TestCase(@"PrimaryBus\PEV_primaryBus_E4.xml")] + public void TestPEVPrimaryBusE4(string jobfile) + { + var filename = Path.Combine(BASE_DIR, jobfile); + var dataProvider = xmlInputReader.CreateDeclaration(XmlReader.Create(filename)); + Assert.NotNull(dataProvider.JobInputData); + var vehicle = dataProvider.JobInputData.Vehicle; + Assert.NotNull(vehicle); + Assert.IsNull(vehicle.Components.EngineInputData); + Assert.IsNotNull(vehicle.Components.ElectricMachines); + Assert.AreEqual(1, vehicle.Components.ElectricMachines.Entries.Count); + Assert.AreEqual(PowertrainPosition.BatteryElectricE4, vehicle.Components.ElectricMachines.Entries[0].Position); + Assert.IsNull(vehicle.Components.IEPC); + Assert.IsNull(vehicle.Components.GearboxInputData); + Assert.IsNull(vehicle.Components.TorqueConverterInputData); + Assert.IsNull(vehicle.Components.AngledriveInputData); + Assert.IsNotNull(vehicle.Components.RetarderInputData); + Assert.IsNull(vehicle.Components.AxleGearInputData); + Assert.IsNotNull(vehicle.Components.AxleWheels); + Assert.IsNull(vehicle.Components.AuxiliaryInputData); + Assert.IsNotNull(vehicle.Components.BusAuxiliaries); + Assert.IsNotNull(vehicle.Components.AirdragInputData); + Assert.IsNotNull(vehicle.Components.ElectricStorage); + Assert.IsNull(vehicle.Components.PTOTransmissionInputData); + Assert.IsNull(vehicle.CargoVolume); + Assert.IsNull(vehicle.TorqueLimits); + Assert.IsNotNull(vehicle.ElectricMotorTorqueLimits); + Assert.IsNull(vehicle.MaxPropulsionTorque); + } + + #region Test existence of torque converter private void TestTorqueConverter(IVehicleDeclarationInputData vehicle)