diff --git a/VectoCommon/VectoCommon/Models/PowertrainPosition.cs b/VectoCommon/VectoCommon/Models/PowertrainPosition.cs index 4d3e806d6e5333a9d26a9561500b2504347ad814..43044255f7ffc08af83684c7de55e3fd69486ec5 100644 --- a/VectoCommon/VectoCommon/Models/PowertrainPosition.cs +++ b/VectoCommon/VectoCommon/Models/PowertrainPosition.cs @@ -115,6 +115,7 @@ namespace TUGraz.VectoCommon.InputData { case "Components_PEV-E2_LorryType": case "Components_PEV-E3_LorryType": case "Components_PEV-E4_LorryType": + case "Components_PEV-E2_PrimaryBusType": return $"E{pos}"; default: return null; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs index 0a6ee94e74c35bcc5f9e3c6befa90a189fd2ec01..01b1fccdab89cddde04b8837aa18393dba91e920 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs @@ -24,11 +24,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public const string XSD_TYPE = "AUX_Conventional_PrimaryBusType"; public const string XSD_HEV_P_TYPE = "AUX_HEV-P_PrimaryBusType"; public const string XSD_HEV_S_TYPE = "AUX_HEV-S_PrimaryBusType"; + public const string XSD_PEV_E2_TYPE = "AUX_PEV_PrimaryBusType"; public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); public static readonly string QUALIFIED_XSD_HEV_P_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_HEV_P_TYPE); public static readonly string QUALIFIED_XSD_HEV_S_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_HEV_S_TYPE); - + public static readonly string QUALIFIED_XSD_PEV_E2_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_PEV_E2_TYPE); public XMLDeclarationPrimaryBusAuxiliariesDataProviderV210( IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs index a7d9c9cdc1c754e534c9b29eb05faf5733138f7d..bcf80fb7b5584cd4d33647095c5018aa6f806386 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs @@ -99,7 +99,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public virtual IBusAuxiliariesDeclarationData BusAuxiliaries => null; public virtual IElectricStorageSystemDeclarationInputData ElectricStorage => _electricStorageSystemInputData ?? (_electricStorageSystemInputData = ComponentReader.ElectricStorageSystem); public virtual IElectricMachinesDeclarationInputData ElectricMachines => _electricMachinesInputData ?? (_electricMachinesInputData = ComponentReader.ElectricMachines); - public IIEPCDeclarationInputData IEPC => _iepcInputData ?? (_iepcInputData = ComponentReader.IEPCInputData); + public virtual IIEPCDeclarationInputData IEPC => _iepcInputData ?? (_iepcInputData = ComponentReader.IEPCInputData); #endregion @@ -428,4 +428,28 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationHeavyLorryPEVExComponentDataV210(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationPrimaryBusPEVE2ComponentDataV210 : XMLDeclarationComponentsDataProviderV10 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V210_JOBS; + public new const string XSD_TYPE = "Components_PEV-E2_PrimaryBusType"; + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IBusAuxiliariesDeclarationData _busAuxiliariesDeclarationInputData; + + public XMLDeclarationPrimaryBusPEVE2ComponentDataV210(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + : base(vehicle, componentNode, sourceFile) { } + + #region Overrides of XMLDeclarationComponentsDataProviderV10 + + public override IEngineDeclarationInputData EngineInputData => null; + + public override IIEPCDeclarationInputData IEPC => null; + + public override IBusAuxiliariesDeclarationData BusAuxiliaries => _busAuxiliariesDeclarationInputData ?? + (_busAuxiliariesDeclarationInputData = ComponentReader.BusAuxiliariesInputData); + #endregion + } } \ 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 e070798c828caf35e3da43c2fae90f3926b8b7b2..c856f25acb68c7538dfbb7fc0d2b614a3e013e50 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -1429,4 +1429,22 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationPEVPrimaryBusDataProviderV210 : XMLDeclarationPEVMediumLorryExDataProviderV210 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V210_JOBS; + public new const string XSD_TYPE = "Vehicle_PEV_PrimaryBusDeclarationType"; + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLDeclarationPEVPrimaryBusDataProviderV210(IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile) + : base(jobData, xmlNode, sourceFile) { } + + #region Overrides of XMLDeclarationVehicleDataProviderV10 + + public override CubicMeter CargoVolume => null; + + #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 fe8d6b51245cbfba999be7c35ddbd1fb0861d9c9..52538e14479a23fe0cdd71c0861d7eed1e9e5f78 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV210InjectModule.cs @@ -58,6 +58,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLDeclarationVehicleData>().To<XMLDeclarationPEVMediumLorryExDataProviderV210>() .Named(XMLDeclarationPEVMediumLorryExDataProviderV210.QUALIFIED_XSD_TYPE); + Bind<IXMLDeclarationVehicleData>().To<XMLDeclarationPEVPrimaryBusDataProviderV210>() + .Named(XMLDeclarationPEVPrimaryBusDataProviderV210.QUALIFIED_XSD_TYPE); + Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationCompletedBusComponentsDataProviderV210>() .Named(XMLDeclarationCompletedBusComponentsDataProviderV210.QUALIFIED_XSD_TYPE); @@ -100,6 +103,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationHeavyLorryPEVExComponentDataV210>() .Named(XMLDeclarationHeavyLorryPEVExComponentDataV210.QUALIFIED_XSD_PEV_E4_TYPE); + Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusPEVE2ComponentDataV210>() + .Named(XMLDeclarationPrimaryBusPEVE2ComponentDataV210.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); @@ -137,6 +143,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLComponentReader>().To<XMLPEVHeavyLorryE4DeclarationComponentReaderV201>() .Named(XMLPEVHeavyLorryE4DeclarationComponentReaderV201.QUALIFIED_XSD_TYPE); + Bind<IXMLComponentReader>().To<XMLPEVPrimaryBusE2DeclarationComponentReaderV201>() + .Named(XMLPEVPrimaryBusE2DeclarationComponentReaderV201.QUALIFIED_XSD_TYPE); + Bind<IXMLGearboxReader>().To<XMLGearboxDeclarationComponentReaderV201>() .Named(XMLGearboxDeclarationComponentReaderV201.GEARBOX_READER_QUALIFIED_XSD_TYPE); @@ -187,6 +196,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV210>() .Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV210.QUALIFIED_XSD_HEV_S_TYPE); + + Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV210>() + .Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV210.QUALIFIED_XSD_PEV_E2_TYPE); Bind<IXMLDeclarationVehicleData>().To<XMLDeclarationMediumLorryVehicleDataProviderV210>() .Named(XMLDeclarationMediumLorryVehicleDataProviderV210.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 d3463ed67d28be2ad36a81fda155df20a44b4ae3..ea75e7e664e94d90da17e8903a7299944c717bc4 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -891,9 +891,35 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl #endregion } - + // --------------------------------------------------------------------------------------- + + public class XMLPEVPrimaryBusE2DeclarationComponentReaderV201 : XMLComponentReaderV10 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V210_JOBS; + public new const string XSD_TYPE = "Components_PEV-E2_PrimaryBusType"; + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + protected IBusAuxiliariesDeclarationData _busAuxInputData; + + public XMLPEVPrimaryBusE2DeclarationComponentReaderV201(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) + : base(vehicle, componentsNode) { } + + #region Overrides of XMLComponentReaderV10 + + public override IAuxiliariesDeclarationInputData AuxiliaryData => null; + public override IBusAuxiliariesDeclarationData BusAuxiliariesInputData => + _busAuxInputData ?? (_busAuxInputData = CreateComponent(XMLNames.Component_Auxiliaries, BusAuxCreator)); + + protected virtual IBusAuxiliariesDeclarationData BusAuxCreator(string version, XmlNode componentNode, string sourceFile) + { + return Factory.CreateBusAuxiliaires(version, Vehicle, componentNode, sourceFile); + } + #endregion + } + // --------------------------------------------------------------------------------------- + public class XMLGearboxDeclarationComponentReaderV201 : XMLComponentReaderV10 { public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V2101_JOBS; diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs index 6231c2d8182ebde2878fb72d50af0cd5d7ceb35b..0c26c66546e72eb4fe5e369e9b0f61ac3b492ebd 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv210.cs @@ -1250,6 +1250,37 @@ namespace TUGraz.VectoCore.Tests.XML } + [TestCase(@"PrimaryBus\PEV_primaryBus_AMT_E2.xml")] + public void TestPEVPrimaryBusE2(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.IsNotNull(vehicle.Components.GearboxInputData); + TestTorqueConverter(vehicle); + Assert.IsNotNull(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.IsNotNull(vehicle.TorqueLimits); + Assert.IsNotNull(vehicle.ElectricMotorTorqueLimits); + Assert.IsNull(vehicle.MaxPropulsionTorque); + } + + #region Test existence of torque converter private void TestTorqueConverter(IVehicleDeclarationInputData vehicle)