diff --git a/VectoCommon/VectoCommon/Models/PowertrainPosition.cs b/VectoCommon/VectoCommon/Models/PowertrainPosition.cs index 43044255f7ffc08af83684c7de55e3fd69486ec5..6634cbe8d8c157b897341d0c4a61742d1b7406c7 100644 --- a/VectoCommon/VectoCommon/Models/PowertrainPosition.cs +++ b/VectoCommon/VectoCommon/Models/PowertrainPosition.cs @@ -116,6 +116,8 @@ namespace TUGraz.VectoCommon.InputData { case "Components_PEV-E3_LorryType": case "Components_PEV-E4_LorryType": case "Components_PEV-E2_PrimaryBusType": + case "Components_PEV-E3_PrimaryBusType": + case "Components_PEV-E4_PrimaryBusType": return $"E{pos}"; default: return null; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs index bcf80fb7b5584cd4d33647095c5018aa6f806386..e3afd6f796f2a3ac4ab51fe4c7d68072928165e3 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs @@ -452,4 +452,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider (_busAuxiliariesDeclarationInputData = ComponentReader.BusAuxiliariesInputData); #endregion } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationPrimaryBusPEVE3ComponentDataV210 : 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 new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + public XMLDeclarationPrimaryBusPEVE3ComponentDataV210(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 c856f25acb68c7538dfbb7fc0d2b614a3e013e50..614db715fa9e9ab3c98f46df05e98d973cdb49db 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -1445,6 +1445,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public override CubicMeter CargoVolume => null; #endregion + + #region Overrides of XMLDeclarationPEVMediumLorryExDataProviderV210 + + public override IList<ITorqueLimitInputData> TorqueLimits => + Components is XMLDeclarationPrimaryBusPEVE3ComponentDataV210 ? null : base.TorqueLimits; + + #endregion } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs index 52538e14479a23fe0cdd71c0861d7eed1e9e5f78..06735ef88efb219c9ee8ba2c1f16370754d5959a 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs @@ -105,7 +105,10 @@ 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<IXMLComponentReader>().To<XMLComponentReaderV210_CompletedBus>().Named(XMLComponentReaderV210_CompletedBus.QUALIFIED_XSD_TYPE); Bind<IXMLComponentReader>().To<XMLComponentReaderV210_HEV_PxHeavyLorry>().Named(XMLComponentReaderV210_HEV_PxHeavyLorry.QUALIFIED_XSD_TYPE); @@ -146,6 +149,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLComponentReader>().To<XMLPEVPrimaryBusE2DeclarationComponentReaderV201>() .Named(XMLPEVPrimaryBusE2DeclarationComponentReaderV201.QUALIFIED_XSD_TYPE); + Bind<IXMLComponentReader>().To<XMLPEVPrimaryBusE3DeclarationComponentReaderV201>() + .Named(XMLPEVPrimaryBusE3DeclarationComponentReaderV201.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 ea75e7e664e94d90da17e8903a7299944c717bc4..747a3202b07c518d2619ab25b67c8e221f395f1b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -917,7 +917,28 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl } #endregion } - + + // --------------------------------------------------------------------------------------- + + public class XMLPEVPrimaryBusE3DeclarationComponentReaderV201 : XMLPEVPrimaryBusE2DeclarationComponentReaderV201 + { + 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 new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLPEVPrimaryBusE3DeclarationComponentReaderV201(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) + : base(vehicle, componentsNode) { } + + + #region Overrides of XMLComponentReaderV10 + + public override IGearboxDeclarationInputData GearboxInputData => null; + public override ITorqueConverterDeclarationInputData TorqueConverterInputData => null; + public override IAngledriveInputData AngledriveInputData => null; + + #endregion + } + + // --------------------------------------------------------------------------------------- public class XMLGearboxDeclarationComponentReaderV201 : XMLComponentReaderV10 diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs index 0c26c66546e72eb4fe5e369e9b0f61ac3b492ebd..c7934075911404ed7123a714cc6c3912a52309a4 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs @@ -1280,6 +1280,35 @@ namespace TUGraz.VectoCore.Tests.XML Assert.IsNull(vehicle.MaxPropulsionTorque); } + [TestCase(@"PrimaryBus\PEV_primaryBus_E3.xml")] + public void TestPEVPrimaryBusE3(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.BatteryElectricE2, 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.IsNotNull(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