diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs index 277ad4e1446343776bd1bb6ec090b71605d8694e..ddf97843f9576eca9376c0b6bf97a80645a572e3 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs @@ -319,15 +319,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- - public class XMLDeclarationPrimaryBusAuxiliariesDataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + public class XMLPrimaryBusAuxiliaries_Conventional_DataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 { public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - public const string XSD_TYPE = "AuxiliaryDataVIFType"; + public const string XSD_TYPE = "AUX_Convetional_PrimaryBusType"; public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - public XMLDeclarationPrimaryBusAuxiliariesDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + public XMLPrimaryBusAuxiliaries_Conventional_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { } @@ -337,6 +337,76 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- + public class XMLPrimaryBusAuxiliaries_HEV_P_DataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + { + public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public const string XSD_TYPE = "AUX_HEV-P_PrimaryBusType"; + + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + public XMLPrimaryBusAuxiliaries_HEV_P_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + : base(componentNode) { } + + + public override XmlNode XMLSource => BaseNode; + } + + // --------------------------------------------------------------------------------------- + + + public class XMLPrimaryBusAuxiliaries_HEV_S_DataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + { + public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public const string XSD_TYPE = "AUX_HEV-S_PrimaryBusType"; + + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + public XMLPrimaryBusAuxiliaries_HEV_S_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + : base(componentNode) { } + + + public override XmlNode XMLSource => BaseNode; + + #region Overrides of AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + + public override bool SmartAirCompression => false; + + #endregion + } + + // --------------------------------------------------------------------------------------- + + + public class XMLPrimaryBusAuxiliaries_PEV_DataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + { + public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public const string XSD_TYPE = "AUX_PEV_PrimaryBusType"; + + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + public XMLPrimaryBusAuxiliaries_PEV_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) + : base(componentNode) { } + + + public override XmlNode XMLSource => BaseNode; + + #region Overrides of AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 + + public override string FanTechnology => null; + + public override bool SmartAirCompression => false; + + public override bool EngineWasteGasHeatExchanger => false; + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationCompletedBusAuxiliariesDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24, IElectricConsumersDeclarationData { public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs index f5779e14bd6cd7ce87af32454bb0484abbaecefa..8c78ff296de53a384b9552a7502fd6eec8af3c5d 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs @@ -210,7 +210,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- - public class XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsDataProviderV10, + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_Conventional_DataProviderV01 : XMLDeclarationComponentsDataProviderV10, IXMLVehicleComponentsDeclaration, IRetarderInputData { public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; @@ -221,7 +221,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IBusAuxiliariesDeclarationData _busAuxiliaries; - public XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle, + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_Conventional_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } @@ -244,6 +244,233 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion } + // --------------------------------------------------------------------------------------- + + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_Px_DataProviderV01 : XMLDeclarationComponentsDataProviderV10, + IXMLVehicleComponentsDeclaration, IRetarderInputData + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_HEV-Px_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IBusAuxiliariesDeclarationData _busAuxiliaries; + + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_Px_DataProviderV01(IXMLDeclarationVehicleData vehicle, + XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + + IRetarderInputData IVehicleComponentsDeclaration.RetarderInputData => this; + + IAirdragDeclarationInputData IVehicleComponentsDeclaration.AirdragInputData => null; + + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData => null; + + public override IBusAuxiliariesDeclarationData BusAuxiliaries => _busAuxiliaries ?? (_busAuxiliaries = ComponentReader.BusAuxiliariesInputData); + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + + #region IRetarderInputData Interface Implementation + + public RetarderType Type => _vehicle.RetarderType; + public double Ratio => _vehicle.RetarderRatio; + public TableData LossMap { get; } + + #endregion + } + + // --------------------------------------------------------------------------------------- + + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01 : XMLDeclarationComponentsDataProviderV10, + IXMLVehicleComponentsDeclaration, IRetarderInputData + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_HEV-S2_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IBusAuxiliariesDeclarationData _busAuxiliaries; + + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01(IXMLDeclarationVehicleData vehicle, + XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + + IRetarderInputData IVehicleComponentsDeclaration.RetarderInputData => this; + + IAirdragDeclarationInputData IVehicleComponentsDeclaration.AirdragInputData => null; + + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData => null; + + public override IBusAuxiliariesDeclarationData BusAuxiliaries => _busAuxiliaries ?? (_busAuxiliaries = ComponentReader.BusAuxiliariesInputData); + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + + #region IRetarderInputData Interface Implementation + + public RetarderType Type => _vehicle.RetarderType; + public double Ratio => _vehicle.RetarderRatio; + public TableData LossMap { get; } + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S3_DataProviderV01 : + XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_HEV-S3_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S3_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + #region Overrides of XMLDeclarationComponentsDataProviderV10 + + public override IGearboxDeclarationInputData GearboxInputData => null; + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S4_DataProviderV01 : + XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_HEV-S4_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S4_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + #region Overrides of XMLDeclarationComponentsDataProviderV10 + + public override IGearboxDeclarationInputData GearboxInputData => null; + + public override IAxleGearInputData AxleGearInputData => null; + + #endregion + } + + // --------------------------------------------------------------------------------------- + + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_IEPC_S_DataProviderV01 : XMLDeclarationComponentsDataProviderV10, + IXMLVehicleComponentsDeclaration, IRetarderInputData + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_HEV-IEPC-S_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IBusAuxiliariesDeclarationData _busAuxiliaries; + + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_IEPC_S_DataProviderV01(IXMLDeclarationVehicleData vehicle, + XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + + IRetarderInputData IVehicleComponentsDeclaration.RetarderInputData => this; + + IAirdragDeclarationInputData IVehicleComponentsDeclaration.AirdragInputData => null; + + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData => null; + + public override IBusAuxiliariesDeclarationData BusAuxiliaries => _busAuxiliaries ?? (_busAuxiliaries = ComponentReader.BusAuxiliariesInputData); + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + + #region IRetarderInputData Interface Implementation + + public RetarderType Type => _vehicle.RetarderType; + public double Ratio => _vehicle.RetarderRatio; + public TableData LossMap { get; } + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01 : XMLDeclarationComponentsDataProviderV10, + IXMLVehicleComponentsDeclaration, IRetarderInputData + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_PEV-E2_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IBusAuxiliariesDeclarationData _busAuxiliaries; + + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01(IXMLDeclarationVehicleData vehicle, + XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + public override IEngineDeclarationInputData EngineInputData => null; + + IRetarderInputData IVehicleComponentsDeclaration.RetarderInputData => this; + + IAirdragDeclarationInputData IVehicleComponentsDeclaration.AirdragInputData => null; + + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData => null; + + public override IBusAuxiliariesDeclarationData BusAuxiliaries => _busAuxiliaries ?? (_busAuxiliaries = ComponentReader.BusAuxiliariesInputData); + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + + #region IRetarderInputData Interface Implementation + + public RetarderType Type => _vehicle.RetarderType; + public double Ratio => _vehicle.RetarderRatio; + public TableData LossMap { get; } + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E3_DataProviderV01 : + XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_PEV-E3_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E3_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + #region Overrides of XMLDeclarationComponentsDataProviderV10 + + public override IGearboxDeclarationInputData GearboxInputData => null; + + #endregion + } + + // --------------------------------------------------------------------------------------- + + public class XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E4_DataProviderV01 : + XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01 + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "Vehicle_PEV-E4_ComponentsVIFType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E4_DataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + #region Overrides of XMLDeclarationComponentsDataProviderV10 + + public override IGearboxDeclarationInputData GearboxInputData => null; + + public override IAxleGearInputData AxleGearInputData => null; + + #endregion + } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs index 01208c38c8b8cb3ee3ed259fd3a6a369d93d7730..fd22e022021574822578eca5bc58127d67d93936 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs @@ -111,19 +111,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public class XMLDeclarationMultistage_Conventional_PrimaryVehicleBusJobInputDataProviderV01 : AbstractXMLResource, IXMLPrimaryVehicleBusJobInputData { - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + public static readonly XNamespace NAMESPACE_URI = + XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public const string XSD_TYPE = "ConventionalVehicleVIFType"; - public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public static readonly string QUALIFIED_XSD_TYPE = + XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); protected IVehicleDeclarationInputData _vehicle; - public XMLDeclarationMultistage_Conventional_PrimaryVehicleBusJobInputDataProviderV01(XmlNode node, IXMLPrimaryVehicleBusInputData inputProvider, + public XMLDeclarationMultistage_Conventional_PrimaryVehicleBusJobInputDataProviderV01(XmlNode node, + IXMLPrimaryVehicleBusInputData inputProvider, string fileName) : base(node, fileName) { InputData = inputProvider; } + protected override XNamespace SchemaNamespace => NAMESPACE_URI; public IVehicleDeclarationInputData Vehicle => _vehicle ?? (_vehicle = Reader.CreateVehicle); @@ -131,10 +135,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider protected override DataSourceType SourceType { get; } public bool SavedInDeclarationMode { get; } public string JobName { get; } - + public VectoSimulationJobType JobType => VectoSimulationJobType.ConventionalVehicle; public IXMLJobDataReader Reader { protected get; set; } public virtual IXMLPrimaryVehicleBusInputData InputData { get; } + } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs index fff8cb9b013b5b6311f5d51d81cbef95486c9524..be1422f965f3820779070d645da017d8783f2c31 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs @@ -84,7 +84,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public IManufacturingStageInputData ConsolidateManufacturingStage => _concolidateManfacturingStage ?? (_concolidateManfacturingStage = Reader.ConsolidateManufacturingStage); - public VectoSimulationJobType JobType => VectoSimulationJobType.ConventionalVehicle; + public VectoSimulationJobType JobType => ConsolidateManufacturingStage.Vehicle.VehicleType; public bool InputComplete => Reader.InputComplete; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs index 2f1250b0a5c8be7fd6bb6f3aa4307871cba4d11a..594ec608194c3e20e34f9d6f1aedca9791c295c9 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -490,6 +490,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion + public virtual string PowertrainPositionPrefix => "-"; + #region IXMLDeclarationVehicleData interface @@ -646,6 +648,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationMultistage_HEV_Px_PrimaryVehicleBusDataProviderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode xmlNode, string sourceFile) : base(busJobData, xmlNode, sourceFile) { } public override VectoSimulationJobType VehicleType { get => VectoSimulationJobType.ParallelHybridVehicle; } + + public override string PowertrainPositionPrefix => "P"; + } // --------------------------------------------------------------------------------------- @@ -663,6 +668,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationMultistage_HEV_Sx_PrimaryVehicleBusDataProviderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode xmlNode, string sourceFile) : base(busJobData, xmlNode, sourceFile) { } public override VectoSimulationJobType VehicleType { get => VectoSimulationJobType.ParallelHybridVehicle; } + + public override string PowertrainPositionPrefix => "E"; } // --------------------------------------------------------------------------------------- @@ -680,6 +687,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationMultistage_HEV_IEPC_S_PrimaryVehicleBusDataProviderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode xmlNode, string sourceFile) : base(busJobData, xmlNode, sourceFile) { } public override VectoSimulationJobType VehicleType { get => VectoSimulationJobType.ParallelHybridVehicle; } + + public override string PowertrainPositionPrefix => "S"; } // --------------------------------------------------------------------------------------- @@ -696,7 +705,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationMultistage_PEV_Ex_PrimaryVehicleBusDataProviderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode xmlNode, string sourceFile) : base(busJobData, xmlNode, sourceFile) { } - public override VectoSimulationJobType VehicleType { get => VectoSimulationJobType.ParallelHybridVehicle; } + public override VectoSimulationJobType VehicleType { get => VectoSimulationJobType.BatteryElectricVehicle; } + + public override string PowertrainPositionPrefix => "E"; } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs index a4abc2cbdf8deb6c05f504c065eef5d6ee35a5e2..ca3a74acc8d0467f9249c7e4bf5b9c41508eb821 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs @@ -17,7 +17,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); public static readonly string QUALIFIED_GEN_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_GEN_TYPE); - private IXMLDeclarationVehicleData _vehicle; + protected IXMLDeclarationVehicleData _vehicle; private IList<ElectricMachineEntry<IElectricMotorDeclarationInputData>> _entries; public XMLElectricMachinesDeclarationInputDataProvider( @@ -35,7 +35,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion - private List<ElectricMachineEntry<IElectricMotorDeclarationInputData>> GetEntries() + protected virtual List<ElectricMachineEntry<IElectricMotorDeclarationInputData>> GetEntries() { var machineEntry = new ElectricMachineEntry<IElectricMotorDeclarationInputData> { Position = PowertrainPositionHelper.Parse(((AbstractXMLVehicleDataProviderV24)_vehicle).PowertrainPositionPrefix + @@ -53,7 +53,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider return new List<ElectricMachineEntry<IElectricMotorDeclarationInputData>>{machineEntry}; } - private void SetGearRatios(ElectricMachineEntry<IElectricMotorDeclarationInputData> machineEntry) + protected void SetGearRatios(ElectricMachineEntry<IElectricMotorDeclarationInputData> machineEntry) { var gearRatios = GetNode(XMLNames.ElectricMachine_P2_5GearRatios, null, false); if (gearRatios != null) { @@ -134,4 +134,37 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider }); #endregion - } } + } + + public class XMLDeclarationElectricMachinesDataProviderV01 : XMLElectricMachinesDeclarationInputDataProvider + { + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public new const string XSD_TYPE = "ElectricMachineType"; + public const string XSD_GEN_TYPE = "ElectricMachineGENType"; + + public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public static readonly string QUALIFIED_GEN_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_GEN_TYPE); + + public XMLDeclarationElectricMachinesDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + + protected override List<ElectricMachineEntry<IElectricMotorDeclarationInputData>> GetEntries() + { + var machineEntry = new ElectricMachineEntry<IElectricMotorDeclarationInputData> { + Position = PowertrainPositionHelper.Parse(((XMLDeclarationMultistage_Conventional_PrimaryVehicleBusDataProviderV01)_vehicle).PowertrainPositionPrefix + + GetString(XMLNames.ElectricMachine_PowertrainPosition)), + Count = XmlConvert.ToInt32(GetString(XMLNames.ElectricMachine_Count)), + ElectricMachine = ElectricMachineSystemReader.CreateElectricMachineSystem(GetNode(XMLNames.ElectricMachineSystem)), + }; + + if (ElementExists("ADC")) + machineEntry.ADC = ElectricMachineSystemReader.ADCInputData; + + if (ElementExists(XMLNames.ElectricMachine_P2_5GearRatios)) + SetGearRatios(machineEntry); + + return new List<ElectricMachineEntry<IElectricMotorDeclarationInputData>> { machineEntry }; + } + } + +} diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs index 5b4e004570209e971071e75e546138deab6ff35f..e590ff346a46247a5d2807b42e92537b2685a13b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs @@ -186,7 +186,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public virtual TableData Conditioning => ElementExists(XMLNames.Conditioning) ? ReadConditioning() : null; - public virtual double OverloadRecoveryFactor { get; } #endregion @@ -464,4 +463,51 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #endregion } + + // --------------------------------------------------------------------------------------- + + public class XMLElectricMotorDeclarationInputDataProviderV01 : XMLCommonElectricMotorDeclarationInputData, + IXMLElectricMotorDeclarationInputData + { + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + public const string XSD_TYPE = "ElectricMachineSystemDataDeclarationType"; + + public static readonly string QUALIFIED_XSD_TYPE = + XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + + private IList<IElectricMotorVoltageLevel> _voltageLevels; + + public XMLElectricMotorDeclarationInputDataProviderV01( + XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile) + { + SourceType = DataSourceType.XMLEmbedded; + } + + #region Implementation of IElectricMotorDeclarationInputData + + public bool DcDcConverterIncluded => GetBool(XMLNames.ElectricMachine_DcDcConverterIncluded); + + public string IHPCType => GetString(XMLNames.ElectricMachine_IHPCType); + + public IList<IElectricMotorVoltageLevel> VoltageLevels => + _voltageLevels ?? (_voltageLevels = GetVoltageLevels()); + public TableData DragCurve => ReadDragCurve(); + public TableData Conditioning => ElementExists(XMLNames.Conditioning) + ? ReadConditioning() : null; + + #endregion + + protected override XNamespace SchemaNamespace => NAMESPACE_URI; + protected override DataSourceType SourceType { get; } + } + + // --------------------------------------------------------------------------------------- + + public class XMLElectricMotorIEPCIInputDataProviderV01 : XMLElectricMotorIEPCIInputDataProviderV23 + { + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + public const string XSD_TYPE = "IEPCMeasuredDataDeclarationType"; + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public XMLElectricMotorIEPCIInputDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs index 1a06861e1875c403d6be5d6705e7933514b5472b..1ec4f956fb835fa8f92e3355870fe6b264a1b9f5 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs @@ -30,8 +30,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLPrimaryVehicleBusInputData>().To<XMLDeclarationMultistagePrimaryVehicleInputDataV01>() .Named(XMLDeclarationMultistagePrimaryVehicleInputDataV01.QUALIFIED_XSD_TYPE); - Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV01>() - .Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV01.QUALIFIED_XSD_TYPE); + Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLPrimaryBusAuxiliaries_Conventional_DataProviderV01>() + .Named(XMLPrimaryBusAuxiliaries_Conventional_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLPrimaryBusAuxiliaries_HEV_P_DataProviderV01>() + .Named(XMLPrimaryBusAuxiliaries_HEV_P_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLPrimaryBusAuxiliaries_HEV_S_DataProviderV01>() + .Named(XMLPrimaryBusAuxiliaries_HEV_S_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLPrimaryBusAuxiliaries_PEV_DataProviderV01>() + .Named(XMLPrimaryBusAuxiliaries_PEV_DataProviderV01.QUALIFIED_XSD_TYPE); Bind<IXMLDeclarationPrimaryVehicleBusInputDataReader>().To<XMLMultistagePrimaryVehicleReaderV01>() .Named(XMLMultistagePrimaryVehicleReaderV01.QUALIFIED_XSD_TYPE); @@ -136,9 +145,46 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLAxlesReader>().To<XMLMultistagePrimaryVehicleBus_Conventional_ComponentReaderV01>() .Named(XMLMultistagePrimaryVehicleBus_Conventional_ComponentReaderV01.AXLES_READER_QUALIFIED_XSD_TYPE); + Bind<IXMLElectricMachineSystemReader>().To<XMLElectricMachineSystemReaderV01>().Named(XMLElectricMachineSystemReaderV01.QUALIFIED_XSD_TYPE); + Bind<IXMLElectricMachineSystemReader>().To<XMLElectricMachineSystemReaderV01>().Named(XMLElectricMachineSystemReaderV01.QUALIFIED_GEN_XSD_TYPE); + + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_Conventional_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_Conventional_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_Px_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_Px_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S2_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S3_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S3_DataProviderV01.QUALIFIED_XSD_TYPE); + Bind<IXMLVehicleComponentsDeclaration>() - .To<XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01>() - .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01.QUALIFIED_XSD_TYPE); + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S4_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_S4_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_IEPC_S_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_HEV_IEPC_S_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E2_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E3_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E3_DataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLVehicleComponentsDeclaration>() + .To<XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E4_DataProviderV01>() + .Named(XMLDeclarationComponentsMultistagePrimaryVehicleBus_PEV_E4_DataProviderV01.QUALIFIED_XSD_TYPE); + // ----------------------------------- @@ -170,6 +216,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLResultsInputData>().To<XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01>() .Named(XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01.QUALIFIED_XSD_TYPE); + Bind<IXMLElectricMachinesDeclarationInputData>().To<XMLDeclarationElectricMachinesDataProviderV01>().Named( + XMLDeclarationElectricMachinesDataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLElectricMachinesDeclarationInputData>().To<XMLDeclarationElectricMachinesDataProviderV01>().Named( + XMLDeclarationElectricMachinesDataProviderV01.QUALIFIED_GEN_XSD_TYPE); + + Bind<IXMLElectricMotorDeclarationInputData>().To<XMLElectricMotorDeclarationInputDataProviderV01>() + .Named(XMLElectricMotorDeclarationInputDataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLIEPCInputData>().To<XMLElectricMotorIEPCIInputDataProviderV01>() + .Named(XMLElectricMotorIEPCIInputDataProviderV01.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 c313f054a84fa5138b79c5dc7ca473cf7d938f29..8c0d69b735425c0ba3ac2f2d14a58a855087754b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -558,6 +558,54 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl // --------------------------------------------------------------------------------------- + public class XMLElectricMachineSystemReaderV01 : AbstractComponentReader, IXMLElectricMachineSystemReader + { + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + public const string XSD_TYPE = "ElectricMachineType"; + public const string XSD_GEN_TYPE = "ElectricMachineGENType"; + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + public static readonly string QUALIFIED_GEN_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_GEN_TYPE); + + [Inject] + public IDeclarationInjectFactory Factory { protected get; set; } + + public XMLElectricMachineSystemReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, + string sourceFile) : base(vehicle, componentNode) + { + + } + + #region Implementation of IXMLElectricMotorReader + + public virtual IElectricMotorDeclarationInputData CreateElectricMachineSystem(XmlNode electricMachineSystem) + { + return CreateComponent(XMLNames.ElectricMachineSystem, ElectricMachinesCreator); + } + + public virtual IADCDeclarationInputData ADCInputData { + get { + return CreateComponent("ADC", ADCCreator); + } + } + + + protected virtual IADCDeclarationInputData ADCCreator(string version, + XmlNode componentNode, string sourcefile) + { + return Factory.CreateADCDeclarationInputData(version, componentNode, sourcefile); + } + + protected virtual IElectricMotorDeclarationInputData ElectricMachinesCreator(string version, + XmlNode componentNode, string sourcefile) + { + return Factory.CreateElectricMotorDeclarationInputData(version, componentNode, sourcefile); + } + + #endregion + } + + // --------------------------------------------------------------------------------------- + public class XMLREESSReaderV24 : AbstractComponentReader, IXMLREESSReader { public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; @@ -674,6 +722,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl //public new static readonly string AXLES_READER_QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, AXLES_READER_TYPE); public XMLMultistagePrimaryVehicleBus_HEV_S2_ComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) : base(vehicle, componentsNode) { } + } // --------------------------------------------------------------------------------------- @@ -712,6 +761,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl //public new static readonly string AXLES_READER_QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, AXLES_READER_TYPE); public XMLMultistagePrimaryVehicleBus_HEV_S4_ComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) : base(vehicle, componentsNode) { } + + #region Overrides of XMLComponentReaderV10 + + public override IAxleGearInputData AxleGearInputData => null; + + #endregion } // --------------------------------------------------------------------------------------- @@ -731,6 +786,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl //public new static readonly string AXLES_READER_QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, AXLES_READER_TYPE); public XMLMultistagePrimaryVehicleBus_HEV_IEPC_S_ComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) : base(vehicle, componentsNode) { } + + #region Overrides of XMLMultistagePrimaryVehicleBus_Conventional_ComponentReaderV01 + + public override IGearboxDeclarationInputData GearboxInputData => null; + + #endregion } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs index ae7b106967a687f6a72162a15be2ab277aef0955..3eb3b05216fcd9918691ee43dd2202b3511ef352 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs @@ -883,7 +883,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl private bool PrimaryGearboxIsAT() { - switch (_primaryVehicleData.Components.GearboxInputData.Type) { + switch (_primaryVehicleData.Components.GearboxInputData?.Type) { case GearboxType.ATPowerSplit: case GearboxType.ATSerial: return true; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs index b2d437bb2d471ae5387a829f6757d700d2a0b5a4..b11c599c0695fa580b9b2254e5113d525004d290 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs @@ -168,8 +168,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter Current = spPower / Constants.BusAuxiliaries.ElectricSystem.PowernetVoltage }; - var fanPower = DeclarationData.Fan.LookupElectricalPowerDemand( - vehicleClass, mission.MissionType, busAuxPrimary.FanTechnology); + var fanPower = vehicleData.VehicleType == VectoSimulationJobType.BatteryElectricVehicle + ? 0.SI<Watt>() + : DeclarationData.Fan.LookupElectricalPowerDemand( + vehicleClass, mission.MissionType, busAuxPrimary.FanTechnology); retVal[Constants.Auxiliaries.IDs.Fan] = new ElectricConsumerEntry { ActiveDuringEngineStopStandstill = false, ActiveDuringEngineStopDriving = false, @@ -183,9 +185,14 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter IVehicleDeclarationInputData completedVehicle) { return new PneumaticUserInputsConfig { - CompressorMap = DeclarationData.BusAuxiliaries.GetCompressorMap(primaryBusAuxiliaries.PneumaticSupply.CompressorSize, primaryBusAuxiliaries.PneumaticSupply.Clutch), + CompressorMap = completedVehicle.VehicleType == VectoSimulationJobType.BatteryElectricVehicle + ? null + : DeclarationData.BusAuxiliaries.GetCompressorMap( + primaryBusAuxiliaries.PneumaticSupply.CompressorSize, + primaryBusAuxiliaries.PneumaticSupply.Clutch), CompressorGearEfficiency = Constants.BusAuxiliaries.PneumaticUserConfig.CompressorGearEfficiency, - CompressorGearRatio = primaryBusAuxiliaries.PneumaticSupply.Ratio, + CompressorGearRatio = completedVehicle.VehicleType == VectoSimulationJobType.BatteryElectricVehicle + ? 0 : primaryBusAuxiliaries.PneumaticSupply.Ratio, SmartAirCompression = primaryBusAuxiliaries.PneumaticSupply.SmartAirCompression, SmartRegeneration = primaryBusAuxiliaries.PneumaticSupply.SmartRegeneration, KneelingHeight = VectoMath.Max(0.SI<Meter>(), @@ -345,6 +352,11 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter Mission mission) { var hvacConfiguration = completedVehicle.Components.BusAuxiliaries.HVACAux.SystemConfiguration; + if (!hvacConfiguration.HasValue || hvacConfiguration.IsOneOf(BusHVACSystemConfiguration.Configuration0, BusHVACSystemConfiguration.Unknown )) { + throw new VectoException( + $"HVAC Configuration {hvacConfiguration.ToXmlFormat()} is invalid for final step"); + } + var correctionLengthDrivetrainVolume = DeclarationData.BusAuxiliaries.CorrectionLengthDrivetrainVolume( completedVehicle.VehicleCode, completedVehicle.LowEntry, primaryVehicle.AxleConfiguration.NumAxles(), primaryVehicle.Articulated); diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterMultistageBus.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterMultistageBus.cs index d4895ea0363ba2a54b1f941e3d0fe50cfd503419..45f045e6f4807422299308d2936e76e721fbe85e 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterMultistageBus.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterMultistageBus.cs @@ -50,7 +50,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var retVal = GetDefaultElectricalUserConfig(); var primaryBusAuxiliaries = primaryVehicle.Components.BusAuxiliaries; - retVal.AlternatorType = primaryBusAuxiliaries.ElectricSupply.AlternatorTechnology; + retVal.AlternatorType = primaryVehicle.VehicleType == VectoSimulationJobType.BatteryElectricVehicle + ? AlternatorType.None + : primaryBusAuxiliaries.ElectricSupply.AlternatorTechnology; retVal.ElectricalConsumers = currentDemand; retVal.AlternatorMap = new SimpleAlternator( diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedMultistageBusVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedMultistageBusVectoRunDataFactory.cs index df67542c6f55f8b2de63172dee0ad5f73db3498f..a0ed7404c4a83a526265e5bdbf157884cd5fe310 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedMultistageBusVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedMultistageBusVectoRunDataFactory.cs @@ -150,61 +150,69 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl protected virtual IEnumerable<VectoRunData> VectoRunDataHeavyBusCompleted() { - var engineModes = InputDataProvider.JobInputData.PrimaryVehicle.Vehicle.Components.EngineInputData.EngineModes; + if (InputDataProvider.JobInputData.PrimaryVehicle.Vehicle.VehicleType == + VectoSimulationJobType.BatteryElectricVehicle) { + foreach (var vectoRunData in CreateVectoRunDataForMissions(0, "")) + yield return vectoRunData; + } else { + var engineModes = InputDataProvider.JobInputData.PrimaryVehicle.Vehicle.Components.EngineInputData + ?.EngineModes; + + for (var modeIdx = 0; modeIdx < engineModes.Count; modeIdx++) { + var fuelMode = "single fuel mode"; + if (engineModes[modeIdx].Fuels.Count > 1) { + fuelMode = "dual fuel mode"; + } - for (var modeIdx = 0; modeIdx < engineModes.Count; modeIdx++) - { - var fuelMode = "single fuel mode"; - if (engineModes[modeIdx].Fuels.Count > 1) - { - fuelMode = "dual fuel mode"; + foreach (var vectoRunData in CreateVectoRunDataForMissions(modeIdx, fuelMode)) + yield return vectoRunData; } - foreach (var mission in _segmentCompletedBus.Missions) - { - foreach (var loading in mission.Loadings) - { - var simulationRunData = CreateVectoRunDataSpecific(mission, loading, modeIdx); - if (simulationRunData != null) - { - yield return simulationRunData; - } - - var primarySegment = GetPrimarySegment(PrimaryVehicle); - var primaryMission = primarySegment.Missions.Where( - m => { - return m.BusParameter.DoubleDecker == - CompletedVehicle.VehicleCode.IsDoubleDeckerBus() && - m.MissionType == mission.MissionType && - m.BusParameter.FloorType == CompletedVehicle.VehicleCode.GetFloorType(); - }).First(); - simulationRunData = CreateVectoRunDataGeneric( - primaryMission, - new KeyValuePair<LoadingType, Tuple<Kilogram, double?>>(loading.Key, primaryMission.Loadings[loading.Key]), - primarySegment, modeIdx); - - var primaryResult = InputDataProvider.JobInputData.PrimaryVehicle.GetResult( + } + } + + private IEnumerable<VectoRunData> CreateVectoRunDataForMissions(int modeIdx, string fuelMode) + { + foreach (var mission in _segmentCompletedBus.Missions) { + foreach (var loading in mission.Loadings) { + var simulationRunData = CreateVectoRunDataSpecific(mission, loading, modeIdx); + if (simulationRunData != null) { + yield return simulationRunData; + } + + var primarySegment = GetPrimarySegment(PrimaryVehicle); + var primaryMission = primarySegment.Missions.Where( + m => { + return m.BusParameter.DoubleDecker == + CompletedVehicle.VehicleCode.IsDoubleDeckerBus() && + m.MissionType == mission.MissionType && + m.BusParameter.FloorType == CompletedVehicle.VehicleCode.GetFloorType(); + }).First(); + simulationRunData = CreateVectoRunDataGeneric( + primaryMission, + new KeyValuePair<LoadingType, Tuple<Kilogram, double?>>(loading.Key, + primaryMission.Loadings[loading.Key]), + primarySegment, modeIdx); + + var primaryResult = InputDataProvider.JobInputData.PrimaryVehicle.GetResult( + simulationRunData.Mission.BusParameter.BusGroup, simulationRunData.Mission.MissionType, fuelMode, + simulationRunData.VehicleData.Loading); + if (primaryResult == null || !primaryResult.ResultStatus.Equals("success")) { + throw new VectoException( + "Failed to find results in PrimaryVehicleReport for vehicle group: {0}, mission: {1}, fuel mode: '{2}', payload: {3}. Make sure PIF and completed vehicle data match!", simulationRunData.Mission.BusParameter.BusGroup, simulationRunData.Mission.MissionType, fuelMode, simulationRunData.VehicleData.Loading); - if (primaryResult == null || !primaryResult.ResultStatus.Equals("success")) - { - throw new VectoException( - "Failed to find results in PrimaryVehicleReport for vehicle group: {0}, mission: {1}, fuel mode: '{2}', payload: {3}. Make sure PIF and completed vehicle data match!", - simulationRunData.Mission.BusParameter.BusGroup, simulationRunData.Mission.MissionType, fuelMode, - simulationRunData.VehicleData.Loading); - } - - if (primaryResult.ResultStatus != "success") - { - throw new VectoException( - "Simulation results in PrimaryVehicleReport for vehicle group: {0}, mission: {1}, fuel mode: '{2}', payload: {3} not finished successfully.", - simulationRunData.Mission.BusParameter.BusGroup, simulationRunData.Mission.MissionType, fuelMode, - simulationRunData.VehicleData.Loading); - } - - simulationRunData.PrimaryResult = primaryResult; + } - yield return simulationRunData; + if (primaryResult.ResultStatus != "success") { + throw new VectoException( + "Simulation results in PrimaryVehicleReport for vehicle group: {0}, mission: {1}, fuel mode: '{2}', payload: {3} not finished successfully.", + simulationRunData.Mission.BusParameter.BusGroup, simulationRunData.Mission.MissionType, fuelMode, + simulationRunData.VehicleData.Loading); } + + simulationRunData.PrimaryResult = primaryResult; + + yield return simulationRunData; } } } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFNinjectModule.cs index e944a51702a29301571513aafc2050f0a843f00e..c59d4199e23f9b8ea21a00b44316987ee9b3215c 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFNinjectModule.cs @@ -254,6 +254,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation Bind<IXmlTypeWriter>().To<CIF_ConventionalCompletedBusVehicleWriter>().When(AccessedViaCIFFactory) .NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetConventional_CompletedBusVehicleType()); + Bind<IXmlTypeWriter>().To<CIF_HEVCompletedBusVehicleWriter>().When(AccessedViaCIFFactory) + .NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetHEV_CompletedBusVehicleType()); + + Bind<IXmlTypeWriter>().To<CIF_PEVCompletedBusVehicleWriter>().When(AccessedViaCIFFactory) + .NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetPEV_CompletedBusVehicleType()); + Bind<IXmlTypeWriter>().To<CIF_ExemptedCompletedBusVehicleWriter>().When(AccessedViaCIFFactory) .NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetExemptedCompletedBusVehicleType()); #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/VehicleWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/VehicleWriter.cs index 4cd25b9e3fa442d63fa44bb4596e80b35dc9812d..1ccf10426a6923ce415775392ef990830f3bd3b6 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/VehicleWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFWriter/VehicleWriter.cs @@ -352,7 +352,45 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation #endregion } + public class CIF_HEVCompletedBusVehicleWriter : VehicleWriter + { + public CIF_HEVCompletedBusVehicleWriter(ICustomerInformationFileFactory cifFactory, IManufacturerReportFactory mrfFactory) : base(cifFactory, mrfFactory) { } + + #region Overrides of VehicleWriter + + public override XElement GetElement(IDeclarationInputDataProvider inputData) + { + return new XElement(_cif + XMLNames.Component_Vehicle, + _cifFactory.GetCompletedBusVehicleTypeGroup().GetElements(inputData), + _cifFactory.GetHEVADASType().GetXmlType(((IMultistageBusInputDataProvider)inputData) + .JobInputData + .ConsolidateManufacturingStage.Vehicle.ADAS).WithXName(_cif + "ADAS"), + _cifFactory.GetCompletedBusAuxGroup().GetElements(inputData) + ); + } + + #endregion + } + public class CIF_PEVCompletedBusVehicleWriter : VehicleWriter + { + public CIF_PEVCompletedBusVehicleWriter(ICustomerInformationFileFactory cifFactory, IManufacturerReportFactory mrfFactory) : base(cifFactory, mrfFactory) { } + + #region Overrides of VehicleWriter + + public override XElement GetElement(IDeclarationInputDataProvider inputData) + { + return new XElement(_cif + XMLNames.Component_Vehicle, + _cifFactory.GetCompletedBusVehicleTypeGroup().GetElements(inputData), + _cifFactory.GetPEVADASType().GetXmlType(((IMultistageBusInputDataProvider)inputData) + .JobInputData + .ConsolidateManufacturingStage.Vehicle.ADAS).WithXName(_cif + "ADAS"), + _cifFactory.GetCompletedBusAuxGroup().GetElements(inputData) + ); + } + + #endregion + } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/IManufacturerReportFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/IManufacturerReportFactory.cs index 4f4f797d12c52972b3ac6970ec8171c932c6ec8a..dc8b1fbcd876ffa6aa8b24c11b9882e18117b247 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/IManufacturerReportFactory.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/IManufacturerReportFactory.cs @@ -128,14 +128,25 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. IMRFBusAuxiliariesType GetConventionalCompletedBusAuxType(); IMRFBusAuxiliariesType GetConventionalCompletedBus_HVACSystemType(); - IMRFBusAuxiliariesType GetCompletedBusElectricSystemType(); + IMRFBusAuxiliariesType GetConventionalCompletedBusElectricSystemType(); + + IMRFBusAuxiliariesType GetHEVCompletedBusAuxType(); + IMRFBusAuxiliariesType GetHEVCompletedBus_HVACSystemType(); + IMRFBusAuxiliariesType GetHEVCompletedBusElectricSystemType(); + + IMRFBusAuxiliariesType GetPEVCompletedBusAuxType(); + IMRFBusAuxiliariesType GetPEVCompletedBus_HVACSystemType(); + IMRFBusAuxiliariesType GetPEVCompletedBusElectricSystemType(); IReportOutputGroup GetPEV_PrimaryBusVehicleOutputGroup(); - IReportOutputGroup GetCompletedBusGeneralVehicleOutputGroup(); + IReportOutputGroup GetConventionalCompletedBusGeneralVehicleOutputGroup(); + IReportOutputGroup GetHEVCompletedBusGeneralVehicleOutputGroup(); + IReportOutputGroup GetPEVCompletedBusGeneralVehicleOutputGroup(); IReportVehicleOutputGroup GetCompletedBusSequenceGroup(); IReportVehicleOutputGroup GetCompletedBusDimensionSequenceGroup(); IMrfBusAuxGroup GetCompletedBus_HVACSystemGroup(); + IMrfBusAuxGroup GetCompletedBus_xEVHVACSystemGroup(); IMrfVehicleType GetBoostingLimitationsType(); } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFNinjectModule.cs index 5c0d7081eca3c1aee755506ba15f1a8e2e5d6b36..88853e05dbaea1bd26f7e507a70244066343c091 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFNinjectModule.cs @@ -634,8 +634,26 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. Bind<IMRFBusAuxiliariesType>().To<MRFConventionalCompletedBus_HVACSystemType>().When(AccessedViaMRFFactory) .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetConventionalCompletedBus_HVACSystemType()); - Bind<IMRFBusAuxiliariesType>().To<MRFCompletedBusElectricSystemType>().When(AccessedViaMRFFactory) - .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetCompletedBusElectricSystemType()); + Bind<IMRFBusAuxiliariesType>().To<MRFConventionalCompletedBusElectricSystemType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetConventionalCompletedBusElectricSystemType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFHEVCompletedBusAuxType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetHEVCompletedBusAuxType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFHEVCompletedBus_HVACSystemType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetHEVCompletedBus_HVACSystemType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFHEVCompletedBusElectricSystemType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetHEVCompletedBusElectricSystemType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFPEVCompletedBusAuxType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetPEVCompletedBusAuxType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFPEVCompletedBus_HVACSystemType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetPEVCompletedBus_HVACSystemType()); + + Bind<IMRFBusAuxiliariesType>().To<MRFPEVCompletedBusElectricSystemType>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetPEVCompletedBusElectricSystemType()); #region Groups @@ -672,13 +690,22 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. Bind<IReportVehicleOutputGroup>().To<CompletedBusDimensionsSequenceOutputGroup>().When(AccessedViaMRFFactory) .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetCompletedBusDimensionSequenceGroup()); - Bind<IReportOutputGroup>().To<CompletedBusGeneralVehicleOutputGroup>().When(AccessedViaMRFFactory) - .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetCompletedBusGeneralVehicleOutputGroup()); + Bind<IReportOutputGroup>().To<ConventionalCompletedBusGeneralVehicleOutputGroup>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetConventionalCompletedBusGeneralVehicleOutputGroup()); + + Bind<IReportOutputGroup>().To<HEVCompletedBusGeneralVehicleOutputGroup>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetHEVCompletedBusGeneralVehicleOutputGroup()); + + Bind<IReportOutputGroup>().To<PEVCompletedBusGeneralVehicleOutputGroup>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetPEVCompletedBusGeneralVehicleOutputGroup()); Bind<IMrfBusAuxGroup>().To<CompletedBus_HVACSystem_Group>().When(AccessedViaMRFFactory) .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetCompletedBus_HVACSystemGroup()); + Bind<IMrfBusAuxGroup>().To<CompletedBus_xEVHVACSystem_Group>().When(AccessedViaMRFFactory) + .NamedLikeFactoryMethod((IManufacturerReportFactory f) => f.GetCompletedBus_xEVHVACSystemGroup()); + #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs index e1407573d1d3800098004bff66ee49d763fbde21..34e73aec05bfc2fb667be3e220cd015b28db720e 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs @@ -37,7 +37,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { Vehicle = _mRFReportFactory.GetConventional_CompletedBusVehicleType().GetElement(inputData); - GenerateReport(OutputDataType); + //GenerateReport(OutputDataType); } @@ -50,12 +50,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType { get; } + public override string OutputDataType => "HEVCompletedBusManufacturerOutputDataType"; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { - Vehicle = _mRFReportFactory.GetConventional_CompletedBusVehicleType().GetElement(inputData); - GenerateReport("HEVCompletedBusManufacturerOutputDataType"); + Vehicle = _mRFReportFactory.GetHEV_CompletedBusVehicleType().GetElement(inputData); + //GenerateReport("HEVCompletedBusManufacturerOutputDataType"); } #endregion @@ -67,12 +67,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #region Overrides of AbstractManufacturerReport - public override string OutputDataType => "PEV_CompletedBusManufacturerOutputDataType"; + public override string OutputDataType => "PEVCompletedBusManufacturerOutputDataType"; public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { - Vehicle = _mRFReportFactory.GetConventional_CompletedBusVehicleType().GetElement(inputData); - GenerateReport(OutputDataType); + Vehicle = _mRFReportFactory.GetPEV_CompletedBusVehicleType().GetElement(inputData); + //GenerateReport(OutputDataType); } #endregion @@ -89,7 +89,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public override void InitializeVehicleData(IDeclarationInputDataProvider inputData) { Vehicle = _mRFReportFactory.GetExempted_CompletedBusVehicleType().GetElement(inputData); - GenerateReport(OutputDataType); + //GenerateReport(OutputDataType); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBus.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBus.cs index a3fa397336dd95840bf4b6ff1a81a7298c8cb9a2..c354b23e426a2ab65ed0d66aea62307a44e8af3d 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBus.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBus.cs @@ -11,16 +11,10 @@ using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.Manu namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter.Vehicle.CompletedBus { - internal class CompletedBusGeneralVehicleOutputGroup : AbstractReportOutputGroup + internal class ConventionalCompletedBusGeneralVehicleOutputGroup : AbstractReportOutputGroup { - protected XElement GetManufacturerAndAddress(string manufacturer, string address, int stepCount) - { - return new XElement(_mrf + "Step", - new XAttribute("Count", stepCount), - new XElement(_mrf + XMLNames.Component_Manufacturer, manufacturer), - new XElement(_mrf + XMLNames.Component_ManufacturerAddress, address)); - } - public CompletedBusGeneralVehicleOutputGroup(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + public ConventionalCompletedBusGeneralVehicleOutputGroup(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } #region Overrides of AbstractMrfXmlGroup @@ -30,23 +24,71 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. if (multiStageInputData == null) { throw new ArgumentException($"inputdata must implement {nameof(IMultistageBusInputDataProvider)}"); } - var primaryVehicleData = multiStageInputData.JobInputData.PrimaryVehicle.Vehicle; var consolidatedVehicleData = multiStageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle; var result = new List<XElement>(); + result.Add(GetManufacturers(multiStageInputData)); + result.AddRange(_mrfFactory.GetGeneralVehicleOutputGroup().GetElements(multiStageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle)); + result.AddRange(_mrfFactory.GetCompletedBusSequenceGroup().GetElements(consolidatedVehicleData)); + result.AddRange(_mrfFactory.GetCompletedBusDimensionSequenceGroup().GetElements(consolidatedVehicleData)); + result.Add(new XElement(_mrf + XMLNames.Bus_DoorDriveTechnology, consolidatedVehicleData.DoorDriveTechnology.ToXMLFormat())); + result.Add(GetNGTankSystem(multiStageInputData)); + return result; + } + + protected virtual XElement GetNGTankSystem(IMultistageBusInputDataProvider multiStageInputData) + { + var consolidatedVehicleData = multiStageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle; + return new XElement(_mrf + XMLNames.Vehicle_NgTankSystem, consolidatedVehicleData.TankSystem); + } + + protected virtual XElement GetManufacturers(IMultistageBusInputDataProvider multiStageInputData) + { + var primaryVehicleData = multiStageInputData.JobInputData.PrimaryVehicle.Vehicle; var manufacturers = new XElement(_mrf + "Manufacturers"); - result.Add(manufacturers); - manufacturers.Add(GetManufacturerAndAddress(primaryVehicleData.Manufacturer, primaryVehicleData.ManufacturerAddress, 1)); + manufacturers.Add(GetManufacturerAndAddress(primaryVehicleData.Manufacturer, primaryVehicleData.ManufacturerAddress, + 1)); foreach (var manufacturingStageInputData in multiStageInputData.JobInputData.ManufacturingStages) { manufacturers.Add(GetManufacturerAndAddress(manufacturingStageInputData.Vehicle.Manufacturer, manufacturingStageInputData.Vehicle.ManufacturerAddress, stepCount: manufacturingStageInputData.StepCount)); } - result.AddRange(_mrfFactory.GetGeneralVehicleOutputGroup().GetElements(multiStageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle)); - result.AddRange(_mrfFactory.GetCompletedBusSequenceGroup().GetElements(consolidatedVehicleData)); - result.AddRange(_mrfFactory.GetCompletedBusDimensionSequenceGroup().GetElements(consolidatedVehicleData)); - result.Add(new XElement(_mrf + XMLNames.Bus_DoorDriveTechnology, consolidatedVehicleData.DoorDriveTechnology.ToXMLFormat())); - result.Add(new XElement(_mrf + XMLNames.Vehicle_NgTankSystem, consolidatedVehicleData.TankSystem)); - return result; + + return manufacturers; + } + + protected XElement GetManufacturerAndAddress(string manufacturer, string address, int stepCount) + { + return new XElement(_mrf + "Step", + new XAttribute("Count", stepCount), + new XElement(_mrf + XMLNames.Component_Manufacturer, manufacturer), + new XElement(_mrf + XMLNames.Component_ManufacturerAddress, address)); + } + + #endregion + } + + internal class HEVCompletedBusGeneralVehicleOutputGroup : ConventionalCompletedBusGeneralVehicleOutputGroup + { + + public HEVCompletedBusGeneralVehicleOutputGroup(IManufacturerReportFactory mrfFactory) : + base(mrfFactory) { } + + } + + + + internal class PEVCompletedBusGeneralVehicleOutputGroup : ConventionalCompletedBusGeneralVehicleOutputGroup + { + + public PEVCompletedBusGeneralVehicleOutputGroup(IManufacturerReportFactory mrfFactory) : + base(mrfFactory) + { } + + #region Overrides of ConventionalCompletedBusGeneralVehicleOutputGroup + + protected override XElement GetNGTankSystem(IMultistageBusInputDataProvider multiStageInputData) + { + return null; } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBusAuxiliaries.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBusAuxiliaries.cs index 5775b44746e970a0902287c1e0109e39c3b3aeeb..d2687e41f1daec389b4e60bc85796f0054a777d1 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBusAuxiliaries.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportGroupWriter/CompletedBus/CompletedBusAuxiliaries.cs @@ -55,4 +55,32 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #endregion } + + internal class CompletedBus_xEVHVACSystem_Group : AbstractReportOutputGroup, IMrfBusAuxGroup + { + public CompletedBus_xEVHVACSystem_Group(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + #region Overrides of AbstractMrfXmlGroup + + public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData) + { + throw new NotImplementedException(); + } + + #endregion + + #region Implementation of IMrfBusAuxGroup + + public IList<XElement> GetElements(IBusAuxiliariesDeclarationData busAuxiliaries) + { + return new List<XElement>() { + new XElement(_mrf + XMLNames.Bus_WaterElectricHeater, + busAuxiliaries.HVACAux.WaterElectricHeater), + new XElement(_mrf + XMLNames.Bus_AirElectricHeater, busAuxiliaries.HVACAux.AirElectricHeater), + new XElement(_mrf + XMLNames.Bus_OtherHeatingTechnology, busAuxiliaries.HVACAux.OtherHeatingTechnology) + }; + } + + #endregion + } } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFBusAuxiliaryTypes.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFBusAuxiliaryTypes.cs index e677e684743aa124026ec379cad99097662dfe10..04123cf28c60e423cdfa04bcc189ccfb6e39305e 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFBusAuxiliaryTypes.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFBusAuxiliaryTypes.cs @@ -169,12 +169,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public XElement GetElement(IBusAuxiliariesDeclarationData auxData) { var result = new XElement(_mrf + XMLNames.Component_Auxiliaries, - new XElement(_mrf + XMLNames.BusAux_ElectricSystem, - new XElement(_mrf + "DayRunningLightsLED", auxData.ElectricConsumers.DayrunninglightsLED), - new XElement(_mrf + "HeadLightsLED", auxData.ElectricConsumers.HeadlightsLED), - new XElement(_mrf + "PositionLightsLED", auxData.ElectricConsumers.PositionlightsLED), - new XElement(_mrf + "BrakeLightsLED", auxData.ElectricConsumers.BrakelightsLED), - new XElement(_mrf + "InteriorLightsLED", auxData.ElectricConsumers.InteriorLightsLED)), + _mrfFactory.GetConventionalCompletedBusElectricSystemType().GetElement(auxData), _mrfFactory.GetConventionalCompletedBus_HVACSystemType().GetElement(auxData) ); return result; @@ -183,14 +178,67 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #endregion } + internal class MRFHEVCompletedBusAuxType : AbstractMrfXmlType, IMRFBusAuxiliariesType + { + public MRFHEVCompletedBusAuxType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + #region Overrides of AbstractMrfXmlType - internal class MRFCompletedBusElectricSystemType : AbstractMrfXmlType, IMRFBusAuxiliariesType + public XElement GetXmlType(IDeclarationInputDataProvider inputData) + { + throw new NotImplementedException(); + } + + #endregion + + #region Implementation of IMRFBusAuxiliariesType + + public XElement GetElement(IBusAuxiliariesDeclarationData auxData) + { + var result = new XElement(_mrf + XMLNames.Component_Auxiliaries, + _mrfFactory.GetHEVCompletedBusElectricSystemType().GetElement(auxData), + _mrfFactory.GetHEVCompletedBus_HVACSystemType().GetElement(auxData) + ); + return result; + } + + #endregion + } + + internal class MRFPEVCompletedBusAuxType : AbstractMrfXmlType, IMRFBusAuxiliariesType { - public MRFCompletedBusElectricSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + public MRFPEVCompletedBusAuxType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + #region Overrides of AbstractMrfXmlType + + public XElement GetXmlType(IDeclarationInputDataProvider inputData) + { + throw new NotImplementedException(); + } + + #endregion #region Implementation of IMRFBusAuxiliariesType public XElement GetElement(IBusAuxiliariesDeclarationData auxData) + { + var result = new XElement(_mrf + XMLNames.Component_Auxiliaries, + _mrfFactory.GetPEVCompletedBusElectricSystemType().GetElement(auxData), + _mrfFactory.GetPEVCompletedBus_HVACSystemType().GetElement(auxData) + ); + return result; + } + + #endregion + } + + internal class MRFConventionalCompletedBusElectricSystemType : AbstractMrfXmlType, IMRFBusAuxiliariesType + { + public MRFConventionalCompletedBusElectricSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + #region Implementation of IMRFBusAuxiliariesType + + public virtual XElement GetElement(IBusAuxiliariesDeclarationData auxData) { return new XElement(_mrf + XMLNames.BusAux_ElectricSystem, new XElement(_mrf + "DayRunningLightsLED", auxData.ElectricConsumers.DayrunninglightsLED), @@ -203,6 +251,18 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #endregion } + internal class MRFHEVCompletedBusElectricSystemType : MRFConventionalCompletedBusElectricSystemType + { + public MRFHEVCompletedBusElectricSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + } + + internal class MRFPEVCompletedBusElectricSystemType : MRFConventionalCompletedBusElectricSystemType + { + public MRFPEVCompletedBusElectricSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + } + internal class MRFConventionalCompletedBus_HVACSystemType : AbstractMrfXmlType, IMRFBusAuxiliariesType { public MRFConventionalCompletedBus_HVACSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } @@ -218,6 +278,29 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. #endregion } + internal class MRFHEVCompletedBus_HVACSystemType : AbstractMrfXmlType, IMRFBusAuxiliariesType + { + public MRFHEVCompletedBus_HVACSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + #region Implementation of IMRFBusAuxiliariesType + + public virtual XElement GetElement(IBusAuxiliariesDeclarationData auxData) + { + return new XElement(_mrf + "HVACSystem", + _mrfFactory.GetCompletedBus_HVACSystemGroup().GetElements(auxData), + _mrfFactory.GetCompletedBus_xEVHVACSystemGroup().GetElements(auxData)); + } + + #endregion + } + + internal class MRFPEVCompletedBus_HVACSystemType : MRFHEVCompletedBus_HVACSystemType + { + public MRFPEVCompletedBus_HVACSystemType(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } + + + } + internal class MRFPrimaryBusElectricSystemType_Conventional_HEV : AbstractMrfXmlType, IMRFBusAuxiliariesType { public MRFPrimaryBusElectricSystemType_Conventional_HEV(IManufacturerReportFactory mrfFactory) : base(mrfFactory) { } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFComponentsType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFComponentsType.cs index d46737c96a787bebf287cb4c0e63e233f3ffc1dc..4482bfa612bdf9ea91931565820e0b944da0e6ae 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFComponentsType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/Components/MRFComponentsType.cs @@ -552,7 +552,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public XElement GetElement(IDeclarationInputDataProvider inputData) { - throw new NotImplementedException(); + var multistageInputData = inputData as IMultistageBusInputDataProvider; + if (multistageInputData == null) { + throw new ArgumentException($"inputData must implement {nameof(IMultistageBusInputDataProvider)}"); + } + return new XElement(_mrf + XMLNames.Vehicle_Components, + multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.AirdragInputData != null + ? _mrfFactory.GetAirdragType().GetXmlType(multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.AirdragInputData) : null, + _mrfFactory.GetHEVCompletedBusAuxType().GetElement(multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.BusAuxiliaries) + ); } #endregion @@ -566,7 +574,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public XElement GetElement(IDeclarationInputDataProvider inputData) { - throw new NotImplementedException(); + var multistageInputData = inputData as IMultistageBusInputDataProvider; + if (multistageInputData == null) { + throw new ArgumentException($"inputData must implement {nameof(IMultistageBusInputDataProvider)}"); + } + return new XElement(_mrf + XMLNames.Vehicle_Components, + multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.AirdragInputData != null + ? _mrfFactory.GetAirdragType().GetXmlType(multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.AirdragInputData) : null, + _mrfFactory.GetPEVCompletedBusAuxType().GetElement(multistageInputData.JobInputData.ConsolidateManufacturingStage.Vehicle.Components.BusAuxiliaries) + ); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/MRFVehicleWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/MRFVehicleWriter.cs index f9a6540d999b574bafcf6cf3d812e4f2b3bc7015..de3e5fe332afcd574a7eb87ecc7b8c27b9a03ace 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/MRFVehicleWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReportXMLTypeWriter/MRFVehicleWriter.cs @@ -414,7 +414,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. throw new ArgumentException($"inputdata must implement {nameof(IMultistageBusInputDataProvider)}"); } return new XElement(_mrf + XMLNames.Component_Vehicle, - _mrfFactory.GetCompletedBusGeneralVehicleOutputGroup().GetElements(inputData), + _mrfFactory.GetConventionalCompletedBusGeneralVehicleOutputGroup().GetElements(inputData), _mrfFactory.GetConventionalADASType().GetXmlType(multistageInputdata.JobInputData.ConsolidateManufacturingStage.Vehicle.ADAS), _mrfFactory.GetConventional_CompletedBusComponentsType().GetElement(inputData) ); @@ -432,7 +432,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public override XElement GetElement(IDeclarationInputDataProvider inputData) { - throw new NotImplementedException(); + var multistageInputdata = inputData as IMultistageBusInputDataProvider; + if (multistageInputdata == null) { + throw new ArgumentException($"inputdata must implement {nameof(IMultistageBusInputDataProvider)}"); + } + return new XElement(_mrf + XMLNames.Component_Vehicle, + _mrfFactory.GetHEVCompletedBusGeneralVehicleOutputGroup().GetElements(inputData), + _mrfFactory.GetHEVADASType().GetXmlType(multistageInputdata.JobInputData.ConsolidateManufacturingStage.Vehicle.ADAS), + _mrfFactory.GetHEV_CompletedBusComponentsType().GetElement(inputData) + ); } #endregion @@ -446,7 +454,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public override XElement GetElement(IDeclarationInputDataProvider inputData) { - throw new NotImplementedException(); + var multistageInputdata = inputData as IMultistageBusInputDataProvider; + if (multistageInputdata == null) { + throw new ArgumentException($"inputdata must implement {nameof(IMultistageBusInputDataProvider)}"); + } + return new XElement(_mrf + XMLNames.Component_Vehicle, + _mrfFactory.GetPEVCompletedBusGeneralVehicleOutputGroup().GetElements(inputData), + _mrfFactory.GetPEVADASType().GetXmlType(multistageInputdata.JobInputData.ConsolidateManufacturingStage.Vehicle.ADAS), + _mrfFactory.GetPEV_CompletedBusComponentsType().GetElement(inputData) + ); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs index 29674414bf64185d75da24b9f634df76d5e06814..508035f2812112b33d240ddb3a5e086815d33a27 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs @@ -33,6 +33,14 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF IXmlMultistepTypeWriter GetConventionalVehicleType(); + IXmlMultistepTypeWriter GetHEVVehicleType(); + + IXmlMultistepTypeWriter GetPEVVehicleType(); + + IXmlMultistepTypeWriter GetIEPCVehicleType(); + + IXmlMultistepTypeWriter GetExemptedVehicleType(); + #endregion IReportMultistepCompletedBusOutputGroup GetCompletedBusGeneralParametersGroup(); @@ -40,12 +48,24 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF IReportMultistepCompletedBusOutputGroup GetCompletedBusPassengerCountGroup(); IReportMultistepCompletedBusOutputGroup GetCompletedBusDimensionsGroup(); - IReportMultistepCompletedBusTypeWriter GetCompletedComponentsType(); + IReportMultistepCompletedBusTypeWriter GetConventionalInterimComponentsType(); + + IReportMultistepCompletedBusTypeWriter GetxEVInterimComponentsType(); + + + IReportMultistepCompletedBusTypeWriter GetInterimAirdragType(); + IReportMultistepCompletedBusTypeWriter GetInterimConventionalAuxiliariesType(); + + IReportMultistepCompletedBusTypeWriter GetInterimxEVAuxiliariesType(); + + IVIFFAdasType GetConventionalInterimADASType(); + + IVIFFAdasType GetHEVInterimADASType(); + + IVIFFAdasType GetPEVInterimADASType(); - IReportMultistepCompletedBusTypeWriter GetCompletedAirdragType(); - IReportMultistepCompletedBusTypeWriter GetCompletedAuxiliariesType(); + IVIFFAdasType GetIEPCInterimADASType(); - IVIFFAdasType GetCompletedADASType(); } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponentVIFType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponentVIFType.cs index 19328435baf28d78c756258e8562e1b95895d942..cfc23d3ec1232081a00402d14b5585764c06aa67 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponentVIFType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponentVIFType.cs @@ -32,8 +32,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public override XElement GetElement(IMultistageVIFInputData inputData) { - var airDrag = _vifReportFactory.GetCompletedAirdragType().GetElement(inputData); - var auxiliaries = _vifReportFactory.GetCompletedAuxiliariesType().GetElement(inputData); + var airDrag = _vifReportFactory.GetInterimAirdragType().GetElement(inputData); + var auxiliaries = _vifReportFactory.GetInterimConventionalAuxiliariesType().GetElement(inputData); if (airDrag == null && auxiliaries == null) { return null; @@ -48,4 +48,30 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF #endregion } + + + public class XEVComponentsInterimVIFType : CompletedComponentVIFType + { + public XEVComponentsInterimVIFType(IVIFReportInterimFactory vifReportFactory) : base(vifReportFactory) { } + + #region Overrides of CompletedComponentVIFType + + public override XElement GetElement(IMultistageVIFInputData inputData) + { + var airDrag = _vifReportFactory.GetInterimAirdragType().GetElement(inputData); + var auxiliaries = _vifReportFactory.GetInterimxEVAuxiliariesType().GetElement(inputData); + + if (airDrag == null && auxiliaries == null) { + return null; + } + + return new XElement(_v24 + XMLNames.Vehicle_Components, + new XAttribute(_xsi + XMLNames.XSIType, "Components_xEV_CompletedBusType"), + airDrag, + auxiliaries); + + } + + #endregion + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs index 764326c76277776b1a6d8872116b9fdccf3a3a6a..03c65264aa420e6eed82a20d3078292739ec6d1b 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs @@ -21,6 +21,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF protected XNamespace v23 = "urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3"; protected XNamespace v24 = "urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4"; + public AirdragInterimType() {} + #region Implementation of IReportMultistepCompletedBusTypeWriter public XElement GetElement(IMultistageVIFInputData inputData) diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAuxiliaryType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAuxiliaryType.cs index f006e7b8de5be033e96fae004af261fc5c52629f..a6abe6982eb10be5bc60edfd4882354f470810e7 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAuxiliaryType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAuxiliaryType.cs @@ -1,4 +1,5 @@ using System.Xml.Linq; +using NLog.LayoutRenderers; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; @@ -29,6 +30,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF { public ConventionalInterimAuxiliaryType(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + protected virtual string XMLType => "AUX_Conventional_CompletedBusType"; + #region Overrides of InterimVIFAuxiliaryType public override XElement GetElement(IMultistageVIFInputData inputData) @@ -45,7 +48,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF return new XElement(_v24 + XMLNames.Component_Auxiliaries, new XElement(_v24 + XMLNames.ComponentDataWrapper, - new XAttribute(_xsi + XMLNames.Attr_Type, "AUX_Conventional_CompletedBusType"), + new XAttribute(_xsi + XMLNames.Attr_Type, XMLType), electricSystemEntry != null ? GetElectricSystem(busAux.ElectricConsumers) : null, hvacEntry != null @@ -55,7 +58,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF #endregion - private XElement GetElectricSystem(IElectricConsumersDeclarationData electricConsumer) + protected virtual XElement GetElectricSystem(IElectricConsumersDeclarationData electricConsumer) { if (electricConsumer == null) return null; @@ -80,7 +83,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF )); } - private XElement GetHVAC(IHVACBusAuxiliariesDeclarationData hvac) + protected virtual XElement GetHVAC(IHVACBusAuxiliariesDeclarationData hvac) { if (hvac == null) return null; @@ -111,14 +114,37 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF hvac.AdjustableAuxiliaryHeater != null ? new XElement(_v24 + XMLNames.Bus_AdjustableAuxiliaryHeater, hvac.AdjustableAuxiliaryHeater) : null, hvac.SeparateAirDistributionDucts != null - ? new XElement(_v24 + XMLNames.Bus_SeparateAirDistributionDucts, hvac.SeparateAirDistributionDucts) : null, - hvac.WaterElectricHeater != null - ? new XElement(_v24 + XMLNames.Bus_WaterElectricHeater, hvac.WaterElectricHeater) : null, - hvac.AirElectricHeater != null - ? new XElement(_v24 + XMLNames.Bus_AirElectricHeater, hvac.AirElectricHeater) : null, - hvac.OtherHeatingTechnology != null - ? new XElement(_v24 + XMLNames.Bus_OtherHeatingTechnology, hvac.OtherHeatingTechnology) : null + ? new XElement(_v24 + XMLNames.Bus_SeparateAirDistributionDucts, hvac.SeparateAirDistributionDucts) : null ); } + + } + + public class XEVInterimAuxiliaryType : ConventionalInterimAuxiliaryType + { + public XEVInterimAuxiliaryType(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + + protected override string XMLType => "AUX_xEV_CompletedBusType"; + + protected override XElement GetHVAC(IHVACBusAuxiliariesDeclarationData hvac) + { + var retVal = base.GetHVAC(hvac); + retVal.Add(GetxEVHVAC(hvac)); + + return retVal; + + } + + protected virtual XElement[] GetxEVHVAC(IHVACBusAuxiliariesDeclarationData hvac) + { + return new[] { + hvac.WaterElectricHeater.HasValue ? + new XElement(_v24 + XMLNames.Bus_WaterElectricHeater, hvac.WaterElectricHeater) :null, + hvac.AirElectricHeater.HasValue ? + new XElement(_v24 + XMLNames.Bus_AirElectricHeater, hvac.AirElectricHeater) : null, + hvac.OtherHeatingTechnology.HasValue ? + new XElement(_v24 + XMLNames.Bus_OtherHeatingTechnology, hvac.OtherHeatingTechnology) : null + }; + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimVIFAdasType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimVIFAdasType.cs index b2bdbb10d03941fb6bf00ad5af98fc04ea0b8c9a..c81e29f9a5fcafd752930bfc27a28c680abcbf8b 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimVIFAdasType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimVIFAdasType.cs @@ -17,7 +17,6 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF return null; return new XElement(_v24 + XMLNames.Vehicle_ADAS, - //new XAttribute("xmlns", _v24), new XAttribute(_xsi + XMLNames.XSIType, "ADAS_Conventional_Type"), new XElement(_v24 + XMLNames.Vehicle_ADAS_EngineStopStart, adas.EngineStopStart), new XElement(_v24 + XMLNames.Vehicle_ADAS_EcoRollWithoutEngineStop, adas.EcoRoll == EcoRollType.WithoutEngineStop), @@ -27,4 +26,63 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF #endregion } + + + public class VIFCompletedHEVAdasType : AbstractVIFXmlType, IVIFFAdasType + { + public VIFCompletedHEVAdasType(IVIFReportFactory vifFactory) : base(vifFactory) { } + + #region Implementation of IXmlTypeWriter + + public XElement GetXmlType(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + if (adas == null) + return null; + + return new XElement(_v24 + XMLNames.Vehicle_ADAS, + new XAttribute(_xsi + XMLNames.XSIType, "ADAS_HEV_Type"), + new XElement(_v24 + XMLNames.Vehicle_ADAS_EngineStopStart, adas.EngineStopStart), + new XElement(_v24 + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + } + + #endregion + } + + public class VIFCompletedPEVAdasType : AbstractVIFXmlType, IVIFFAdasType + { + public VIFCompletedPEVAdasType(IVIFReportFactory vifFactory) : base(vifFactory) { } + + #region Implementation of IXmlTypeWriter + + public XElement GetXmlType(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + if (adas == null) + return null; + + return new XElement(_v24 + XMLNames.Vehicle_ADAS, + new XAttribute(_xsi + XMLNames.XSIType, "ADAS_PEV_Type"), + new XElement(_v24 + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + } + + #endregion + } + + public class VIFCompletedIEPCAdasType : AbstractVIFXmlType, IVIFFAdasType + { + public VIFCompletedIEPCAdasType(IVIFReportFactory vifFactory) : base(vifFactory) { } + + #region Implementation of IXmlTypeWriter + + public XElement GetXmlType(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + if (adas == null) + return null; + + return new XElement(_v24 + XMLNames.Vehicle_ADAS, + new XAttribute(_xsi + XMLNames.XSIType, "ADAS_IEPC_Type"), + new XElement(_v24 + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + } + + #endregion + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimVehicleWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimVehicleWriter.cs index 80e85833233fe29216840c931ca85b95bcd8fbe6..2c778cdd51ba502b3b5c82869ac9f21b7efcef26 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimVehicleWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimVehicleWriter.cs @@ -4,6 +4,7 @@ using TUGraz.VectoCommon.Hashing; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile.VehicleInformationFile_0_1 @@ -26,6 +27,11 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public abstract XElement GetElement(IMultistageVIFInputData inputData); #endregion + + protected string GetVehicleID() + { + return $"{VectoComponents.Vehicle.HashIdPrefix()}{XMLHelper.GetGUID()}"; + } } public class ConventionalInterimVehicleType : InterimVehicleWriter @@ -36,7 +42,6 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public override XElement GetElement(IMultistageVIFInputData inputData) { - var vehicleId = $"{VectoComponents.Vehicle.HashIdPrefix()}{XMLHelper.GetGUID()}"; var vehicleInput = inputData.VehicleInputData; var ngTankSystem = vehicleInput.TankSystem.HasValue ? new XElement(_v24 + XMLNames.Vehicle_NgTankSystem, vehicleInput.TankSystem.ToString()) @@ -56,7 +61,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF : new XElement(_v24 + XMLNames.VehicleTypeApprovalNumber, vehicleInput.VehicleTypeApprovalNumber); return new XElement(_vif + XMLNames.Component_Vehicle, - new XAttribute(XMLNames.Component_ID_Attr, vehicleId), + new XAttribute(XMLNames.Component_ID_Attr, GetVehicleID()), new XAttribute(_xsi + XMLNames.XSIType, "Vehicle_Conventional_CompletedBusDeclarationType"), new XAttribute("xmlns", _v24), //new XAttribute(XNamespace.Xmlns + "xsi", _xsi), @@ -71,8 +76,191 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF new XElement(_v24 + XMLNames.Bus_VehicleDeclarationType, inputData.VehicleInputData.VehicleDeclarationType.GetLabel()), vehicleTypeApprovalNumber, - _vifReportFactory.GetCompletedADASType().GetXmlType(inputData.VehicleInputData.ADAS), - _vifReportFactory.GetCompletedComponentsType().GetElement(inputData) + _vifReportFactory.GetConventionalInterimADASType().GetXmlType(inputData.VehicleInputData.ADAS), + _vifReportFactory.GetConventionalInterimComponentsType().GetElement(inputData) + ); + } + + #endregion + } + + public class HEVInterimVehicleType : InterimVehicleWriter + { + public HEVInterimVehicleType(IVIFReportInterimFactory vifReportFactory) : base(vifReportFactory) { } + + #region Overrides of InterimVehicleWriter + + public override XElement GetElement(IMultistageVIFInputData inputData) + { + var vehicleInput = inputData.VehicleInputData; + var ngTankSystem = vehicleInput.TankSystem.HasValue + ? new XElement(_v24 + XMLNames.Vehicle_NgTankSystem, vehicleInput.TankSystem.ToString()) + : null; + var bodyworkCode = vehicleInput.VehicleCode.HasValue + ? new XElement(_v24 + XMLNames.Vehicle_BodyworkCode, vehicleInput.VehicleCode.ToXMLFormat()) + : null; + var lowEntry = vehicleInput.LowEntry.HasValue + ? new XElement(_v24 + XMLNames.Bus_LowEntry, vehicleInput.LowEntry) + : null; + var doordriveTechnology = vehicleInput.DoorDriveTechnology.HasValue + ? new XElement(_v24 + XMLNames.Bus_DoorDriveTechnology, + vehicleInput.DoorDriveTechnology.ToXMLFormat()) + : null; + var vehicleTypeApprovalNumber = string.IsNullOrWhiteSpace(vehicleInput.VehicleTypeApprovalNumber) + ? null + : new XElement(_v24 + XMLNames.VehicleTypeApprovalNumber, vehicleInput.VehicleTypeApprovalNumber); + + return new XElement(_vif + XMLNames.Component_Vehicle, + new XAttribute(XMLNames.Component_ID_Attr, GetVehicleID()), + new XAttribute(_xsi + XMLNames.XSIType, "Vehicle_HEV_CompletedBusDeclarationType"), + new XAttribute("xmlns", _v24), + //new XAttribute(XNamespace.Xmlns + "xsi", _xsi), + _vifReportFactory.GetCompletedBusGeneralParametersGroup().GetElements(inputData), + _vifReportFactory.GetCompletedBusParametersGroup().GetElements(inputData), + ngTankSystem, + _vifReportFactory.GetCompletedBusPassengerCountGroup().GetElements(inputData), + bodyworkCode, + lowEntry, + _vifReportFactory.GetCompletedBusDimensionsGroup().GetElements(inputData), + doordriveTechnology, + new XElement(_v24 + XMLNames.Bus_VehicleDeclarationType, + inputData.VehicleInputData.VehicleDeclarationType.GetLabel()), + vehicleTypeApprovalNumber, + _vifReportFactory.GetHEVInterimADASType().GetXmlType(inputData.VehicleInputData.ADAS), + _vifReportFactory.GetxEVInterimComponentsType().GetElement(inputData) + ); + } + + #endregion + } + + public class PEVInterimVehicleType : InterimVehicleWriter + { + public PEVInterimVehicleType(IVIFReportInterimFactory vifReportFactory) : base(vifReportFactory) { } + + #region Overrides of InterimVehicleWriter + + public override XElement GetElement(IMultistageVIFInputData inputData) + { + var vehicleInput = inputData.VehicleInputData; + var bodyworkCode = vehicleInput.VehicleCode.HasValue + ? new XElement(_v24 + XMLNames.Vehicle_BodyworkCode, vehicleInput.VehicleCode.ToXMLFormat()) + : null; + var lowEntry = vehicleInput.LowEntry.HasValue + ? new XElement(_v24 + XMLNames.Bus_LowEntry, vehicleInput.LowEntry) + : null; + var doordriveTechnology = vehicleInput.DoorDriveTechnology.HasValue + ? new XElement(_v24 + XMLNames.Bus_DoorDriveTechnology, + vehicleInput.DoorDriveTechnology.ToXMLFormat()) + : null; + var vehicleTypeApprovalNumber = string.IsNullOrWhiteSpace(vehicleInput.VehicleTypeApprovalNumber) + ? null + : new XElement(_v24 + XMLNames.VehicleTypeApprovalNumber, vehicleInput.VehicleTypeApprovalNumber); + + return new XElement(_vif + XMLNames.Component_Vehicle, + new XAttribute(XMLNames.Component_ID_Attr, GetVehicleID()), + new XAttribute(_xsi + XMLNames.XSIType, "Vehicle_PEV_CompletedBusDeclarationType"), + new XAttribute("xmlns", _v24), + //new XAttribute(XNamespace.Xmlns + "xsi", _xsi), + _vifReportFactory.GetCompletedBusGeneralParametersGroup().GetElements(inputData), + _vifReportFactory.GetCompletedBusParametersGroup().GetElements(inputData), + _vifReportFactory.GetCompletedBusPassengerCountGroup().GetElements(inputData), + bodyworkCode, + lowEntry, + _vifReportFactory.GetCompletedBusDimensionsGroup().GetElements(inputData), + doordriveTechnology, + new XElement(_v24 + XMLNames.Bus_VehicleDeclarationType, + inputData.VehicleInputData.VehicleDeclarationType.GetLabel()), + vehicleTypeApprovalNumber, + _vifReportFactory.GetPEVInterimADASType().GetXmlType(inputData.VehicleInputData.ADAS), + _vifReportFactory.GetxEVInterimComponentsType().GetElement(inputData) + ); + } + + #endregion + } + + public class IEPCInterimVehicleType : InterimVehicleWriter + { + public IEPCInterimVehicleType(IVIFReportInterimFactory vifReportFactory) : base(vifReportFactory) { } + + #region Overrides of InterimVehicleWriter + + public override XElement GetElement(IMultistageVIFInputData inputData) + { + var vehicleInput = inputData.VehicleInputData; + var bodyworkCode = vehicleInput.VehicleCode.HasValue + ? new XElement(_v24 + XMLNames.Vehicle_BodyworkCode, vehicleInput.VehicleCode.ToXMLFormat()) + : null; + var lowEntry = vehicleInput.LowEntry.HasValue + ? new XElement(_v24 + XMLNames.Bus_LowEntry, vehicleInput.LowEntry) + : null; + var doordriveTechnology = vehicleInput.DoorDriveTechnology.HasValue + ? new XElement(_v24 + XMLNames.Bus_DoorDriveTechnology, + vehicleInput.DoorDriveTechnology.ToXMLFormat()) + : null; + var vehicleTypeApprovalNumber = string.IsNullOrWhiteSpace(vehicleInput.VehicleTypeApprovalNumber) + ? null + : new XElement(_v24 + XMLNames.VehicleTypeApprovalNumber, vehicleInput.VehicleTypeApprovalNumber); + + return new XElement(_vif + XMLNames.Component_Vehicle, + new XAttribute(XMLNames.Component_ID_Attr, GetVehicleID()), + new XAttribute(_xsi + XMLNames.XSIType, "Vehicle_IEPC_CompletedBusDeclarationType"), + new XAttribute("xmlns", _v24), + //new XAttribute(XNamespace.Xmlns + "xsi", _xsi), + _vifReportFactory.GetCompletedBusGeneralParametersGroup().GetElements(inputData), + _vifReportFactory.GetCompletedBusParametersGroup().GetElements(inputData), + _vifReportFactory.GetCompletedBusPassengerCountGroup().GetElements(inputData), + bodyworkCode, + lowEntry, + _vifReportFactory.GetCompletedBusDimensionsGroup().GetElements(inputData), + doordriveTechnology, + new XElement(_v24 + XMLNames.Bus_VehicleDeclarationType, + inputData.VehicleInputData.VehicleDeclarationType.GetLabel()), + vehicleTypeApprovalNumber, + _vifReportFactory.GetIEPCInterimADASType().GetXmlType(inputData.VehicleInputData.ADAS), + _vifReportFactory.GetxEVInterimComponentsType().GetElement(inputData) + ); + } + + #endregion + } + + public class ExemptedInterimVehicleType : InterimVehicleWriter + { + public ExemptedInterimVehicleType(IVIFReportInterimFactory vifReportFactory) : base(vifReportFactory) { } + + #region Overrides of InterimVehicleWriter + + public override XElement GetElement(IMultistageVIFInputData inputData) + { + var vehicleInput = inputData.VehicleInputData; + return new XElement(_vif + XMLNames.Component_Vehicle, + new XAttribute(XMLNames.Component_ID_Attr, GetVehicleID()), + new XAttribute(_xsi + XMLNames.XSIType, "Vehicle_Exempted_CompletedBusDeclarationType"), + new XAttribute("xmlns", _v24), + _vifReportFactory.GetCompletedBusGeneralParametersGroup().GetElements(inputData), + vehicleInput.Model != null + ? new XElement(_v24 + XMLNames.Component_Model, vehicleInput.Model) : null, + vehicleInput.LegislativeClass != null + ? new XElement(_v24 + XMLNames.Vehicle_LegislativeCategory, vehicleInput.LegislativeClass.ToXMLFormat()) : null, + vehicleInput.CurbMassChassis != null + ? new XElement(_v24 + XMLNames.CorrectedActualMass, vehicleInput.CurbMassChassis.ToXMLFormat(0)) : null, + vehicleInput.GrossVehicleMassRating != null + ? new XElement(_v24 + XMLNames.TPMLM, vehicleInput.GrossVehicleMassRating.ToXMLFormat(0)) : null, + vehicleInput.AirdragModifiedMultistep != null ? + new XElement(_v24 + XMLNames.Bus_AirdragModifiedMultistep, vehicleInput.AirdragModifiedMultistep) : null, + vehicleInput.RegisteredClass != null && vehicleInput.RegisteredClass != RegistrationClass.unknown + ? new XElement(_v24 + XMLNames.Vehicle_RegisteredClass, vehicleInput.RegisteredClass.ToXMLFormat()) : null, + _vifReportFactory.GetCompletedBusPassengerCountGroup().GetElements(inputData), + vehicleInput.VehicleCode.HasValue + ? new XElement(_v24 + XMLNames.Vehicle_BodyworkCode, vehicleInput.VehicleCode.ToXMLFormat()) + : null, + vehicleInput.LowEntry != null + ? new XElement(_v24 + XMLNames.Bus_LowEntry, vehicleInput.LowEntry) : null, + vehicleInput.Height != null + ? new XElement(_v24 + XMLNames.Bus_HeightIntegratedBody, vehicleInput.Height.ConvertToMilliMeter().ToXMLFormat(0)) : null + ); } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponentGroup.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponentGroup.cs index 79b781899acb30c8dd43847c0041fb28294950a1..91d28916197f0d64dac5a390e266b2cc77dbb201 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponentGroup.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponentGroup.cs @@ -107,6 +107,9 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF _vifReportFactory.GetElectricMachineGENType().GetElement(inputData), _vifReportFactory.GetElectricEnergyStorageType().GetElement(inputData), _vifReportFactory.GetElectricMachineType().GetElement(inputData), + _vifReportFactory.GetTransmissionType().GetElement(inputData), + _vifReportFactory.GetTorqueConvertType().GetElement(inputData), + _vifReportFactory.GetAngelDriveType().GetElement(inputData), _vifReportFactory.GetAxlegearType().GetElement(inputData), _vifReportFactory.GetAxleWheelsType().GetElement(inputData), _vifReportFactory.GetAuxiliaryHevSType().GetElement(inputData)); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAuxiliaryType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAuxiliaryType.cs index 2c0908c63cddbf1f511e7a71bdb74688a30407aa..5057efcf978e067367591c9e772e301fe085969a 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAuxiliaryType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/PrimaryComponents/VIFAuxiliaryType.cs @@ -26,7 +26,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF return new XElement(_vif + XMLNames.Component_Auxiliaries, new XElement(_vif + XMLNames.ComponentDataWrapper, - new XAttribute(_xsi + XMLNames.XSIType, "AuxiliaryDataVIFType"), + new XAttribute(_xsi + XMLNames.XSIType, "AUX_Convetional_PrimaryBusType"), new XElement(_vif + XMLNames.BusAux_Fan, new XElement(_vif + XMLNames.Auxiliaries_Auxiliary_Technology, aux.FanTechnology)), GetSteeringPumpElement(aux.SteeringPumpTechnology), diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs index 8c744906c6c6c7b6a4a14ed6f3affe23db43adf2..d6478350d9f017957f5b9248d56958818547934c 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs @@ -123,6 +123,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF #region Complete(d) Primary Vehicle Information File Reports + // -- Reports + Bind<IXMLMultistepIntermediateReport>().To<Conventional_CompletedBus_VIF>().Named(nameCombinationMethod.Invoke( ToParams(VehicleCategoryHelper.PrimaryBus, VectoSimulationJobType.ConventionalVehicle, @@ -131,23 +133,95 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF false, false))); + Bind<IXMLMultistepIntermediateReport>().To<HEV_CompletedBus_VIF>().Named(nameCombinationMethod.Invoke( + ToParams(VehicleCategoryHelper.PrimaryBus, + VectoSimulationJobType.ParallelHybridVehicle, + ArchitectureID.UNKNOWN, + false, + false, + false))); + + Bind<IXMLMultistepIntermediateReport>().To<HEV_CompletedBus_VIF>().Named(nameCombinationMethod.Invoke( + ToParams(VehicleCategoryHelper.PrimaryBus, + VectoSimulationJobType.SerialHybridVehicle, + ArchitectureID.UNKNOWN, + false, + false, + false))); + + Bind<IXMLMultistepIntermediateReport>().To<PEV_CompletedBus_VIF>().Named(nameCombinationMethod.Invoke( + ToParams(VehicleCategoryHelper.PrimaryBus, + VectoSimulationJobType.BatteryElectricVehicle, + ArchitectureID.UNKNOWN, + false, + false, + false))); + + Bind<IXMLMultistepIntermediateReport>().To<Exempted_CompletedBus_VIF>().Named(nameCombinationMethod.Invoke( + ToParams(VehicleCategoryHelper.PrimaryBus, + VectoSimulationJobType.ConventionalVehicle, + ArchitectureID.UNKNOWN, + true, + false, + false))); + + // -- Vehicle type writers + Bind<IXmlMultistepTypeWriter>().To<ConventionalInterimVehicleType>().When(AccessedViaInterimVIFFactory) .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetConventionalVehicleType()); + Bind<IXmlMultistepTypeWriter>().To<HEVInterimVehicleType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetHEVVehicleType()); + + Bind<IXmlMultistepTypeWriter>().To<PEVInterimVehicleType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetPEVVehicleType()); + + Bind<IXmlMultistepTypeWriter>().To<IEPCInterimVehicleType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetIEPCVehicleType()); + + + Bind<IXmlMultistepTypeWriter>().To<ExemptedInterimVehicleType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetExemptedVehicleType()); + + // -- Components type writers Bind<IReportMultistepCompletedBusTypeWriter>().To<ConventionalComponentsInterimVIFType>().When(AccessedViaInterimVIFFactory) - .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetCompletedComponentsType()); + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetConventionalInterimComponentsType()); + + Bind<IReportMultistepCompletedBusTypeWriter>().To<XEVComponentsInterimVIFType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetxEVInterimComponentsType()); + + // -- ADAS type writers Bind<IVIFFAdasType>().To<VIFCompletedConventionalAdasType>().When(AccessedViaInterimVIFFactory) - .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetCompletedADASType()); + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetConventionalInterimADASType()); + + Bind<IVIFFAdasType>().To<VIFCompletedHEVAdasType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetHEVInterimADASType()); + + Bind<IVIFFAdasType>().To<VIFCompletedPEVAdasType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetPEVInterimADASType()); + + Bind<IVIFFAdasType>().To<VIFCompletedIEPCAdasType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetIEPCInterimADASType()); + + + // -- Airdrag type writers + + Bind<IReportMultistepCompletedBusTypeWriter>().To<AirdragInterimType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetInterimAirdragType()); + + // -- Aux type writers + + Bind<IReportMultistepCompletedBusTypeWriter>().To<ConventionalInterimAuxiliaryType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetInterimConventionalAuxiliariesType()); - Bind<IReportMultistepCompletedBusTypeWriter>().To<AirdragInterimType>().When(AccessedViaInterimVIFFactory) - .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetCompletedAirdragType()); + Bind<IReportMultistepCompletedBusTypeWriter>().To<XEVInterimAuxiliaryType>().When(AccessedViaInterimVIFFactory) + .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetInterimxEVAuxiliariesType()); - Bind<IReportMultistepCompletedBusTypeWriter>().To<ConventionalInterimAuxiliaryType>().When(AccessedViaInterimVIFFactory) - .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetCompletedAuxiliariesType()); + // -- Parameter Groups - Bind<IReportMultistepCompletedBusOutputGroup>().To<CompletedBusGeneralParametersGroup>().When(AccessedViaInterimVIFFactory) + Bind<IReportMultistepCompletedBusOutputGroup>().To<CompletedBusGeneralParametersGroup>().When(AccessedViaInterimVIFFactory) .NamedLikeFactoryMethod((IVIFReportInterimFactory f) => f.GetCompletedBusGeneralParametersGroup()); Bind<IReportMultistepCompletedBusOutputGroup>().To<GetCompletedBusParametersGroup>().When(AccessedViaInterimVIFFactory) diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs index 8188ef345adc302dfbb229f5cba40535115ec004..287f6703d2d5e8d2b4c0664a1155444856328523 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs @@ -236,4 +236,72 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF #endregion } + + // ---------------------------------- + + internal class HEV_CompletedBus_VIF : VehicleInformationFile_InterimStep + { + public HEV_CompletedBus_VIF(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + + + #region Overrides of VehicleInformationFile_InterimStep + + protected override XElement GetVehicleElement() + { + return _vifFactory.GetHEVVehicleType().GetElement(_inputData); + } + + #endregion + } + + // ---------------------------------- + + internal class PEV_CompletedBus_VIF : VehicleInformationFile_InterimStep + { + public PEV_CompletedBus_VIF(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + + + #region Overrides of VehicleInformationFile_InterimStep + + protected override XElement GetVehicleElement() + { + return _vifFactory.GetPEVVehicleType().GetElement(_inputData); + } + + #endregion + } + + // ---------------------------------- + + internal class IEPC_CompletedBus_VIF : VehicleInformationFile_InterimStep + { + public IEPC_CompletedBus_VIF(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + + + #region Overrides of VehicleInformationFile_InterimStep + + protected override XElement GetVehicleElement() + { + return _vifFactory.GetIEPCVehicleType().GetElement(_inputData); + } + + #endregion + } + + // ---------------------------------- + + internal class Exempted_CompletedBus_VIF : VehicleInformationFile_InterimStep + { + public Exempted_CompletedBus_VIF(IVIFReportInterimFactory vifFactory) : base(vifFactory) { } + + + #region Overrides of VehicleInformationFile_InterimStep + + protected override XElement GetVehicleElement() + { + return _vifFactory.GetExemptedVehicleType().GetElement(_inputData); + } + + #endregion + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLPrimaryBusVehicleReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLPrimaryBusVehicleReport.cs index 1f1a7615f98a1be7ede9096adb16ed9306c9d17c..9394b1ae666bbcbdc01b798ae5995133f9f33f33 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLPrimaryBusVehicleReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLPrimaryBusVehicleReport.cs @@ -266,7 +266,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF var result = new XElement(tns + XMLNames.Component_Auxiliaries, new XElement(tns + XMLNames.ComponentDataWrapper, - new XAttribute(xsi + XMLNames.XSIType, "AuxiliaryDataVIFType"), + new XAttribute(xsi + XMLNames.XSIType, "AUX_Convetional_PrimaryBusType"), //new XAttribute("xmlns", tns.NamespaceName), //automically created new XElement(tns + XMLNames.BusAux_Fan, new XElement(tns + XMLNames.BusAux_Technology, aux.FanTechnology)), GetSteeringPumpElement(aux.SteeringPumpTechnology), diff --git a/VectoMockup/VectoMockup/MockupResultReader.cs b/VectoMockup/VectoMockup/MockupResultReader.cs index ecd34867b168d6c87a0211dcd53da0d0395ba315..789c5460d5f74e1ef7a71251380474a9a37df5a2 100644 --- a/VectoMockup/VectoMockup/MockupResultReader.cs +++ b/VectoMockup/VectoMockup/MockupResultReader.cs @@ -109,8 +109,9 @@ namespace TUGraz.VectoMockup { bool ovc = false; var jobType = VectoSimulationJobType.ConventionalVehicle; - if (runData.InputData is IXMLMultistageInputDataProvider) { + if (runData.InputData is IXMLMultistageInputDataProvider mst) { ovc = false; //TODO implement + jobType = mst.JobInputData.JobType; //runData.InputData.JobInputData.JobType; } else { ovc = runData.InputData.JobInputData.Vehicle.OvcHev; jobType = runData.InputData.JobInputData.JobType; diff --git a/VectoMockup/VectoMockup/Ninject/MRFMockupModule.cs b/VectoMockup/VectoMockup/Ninject/MRFMockupModule.cs index 747f08b7d38f7d18fdc82afb8e89a11255cad827..a3162f9c637c5be5a34a3236a61b7ef3f2e4911d 100644 --- a/VectoMockup/VectoMockup/Ninject/MRFMockupModule.cs +++ b/VectoMockup/VectoMockup/Ninject/MRFMockupModule.cs @@ -497,22 +497,62 @@ namespace TUGraz.VectoMockup.Ninject return _manufacturerReportFactoryImplementation.GetConventionalCompletedBus_HVACSystemType(); } - public IMRFBusAuxiliariesType GetCompletedBusElectricSystemType() + public IMRFBusAuxiliariesType GetConventionalCompletedBusElectricSystemType() { - return _manufacturerReportFactoryImplementation.GetCompletedBusElectricSystemType(); + return _manufacturerReportFactoryImplementation.GetConventionalCompletedBusElectricSystemType(); } - public IReportOutputGroup GetPEV_PrimaryBusVehicleOutputGroup() + public IMRFBusAuxiliariesType GetHEVCompletedBusAuxType() + { + return _manufacturerReportFactoryImplementation.GetHEVCompletedBusAuxType(); + } + + public IMRFBusAuxiliariesType GetHEVCompletedBus_HVACSystemType() + { + return _manufacturerReportFactoryImplementation.GetHEVCompletedBus_HVACSystemType(); + } + + public IMRFBusAuxiliariesType GetHEVCompletedBusElectricSystemType() + { + return _manufacturerReportFactoryImplementation.GetHEVCompletedBusElectricSystemType(); + } + + public IMRFBusAuxiliariesType GetPEVCompletedBusAuxType() + { + return _manufacturerReportFactoryImplementation.GetPEVCompletedBusAuxType(); + } + + public IMRFBusAuxiliariesType GetPEVCompletedBus_HVACSystemType() + { + return _manufacturerReportFactoryImplementation.GetPEVCompletedBus_HVACSystemType(); + } + + public IMRFBusAuxiliariesType GetPEVCompletedBusElectricSystemType() + { + return _manufacturerReportFactoryImplementation.GetPEVCompletedBusElectricSystemType(); + } + + public IReportOutputGroup GetPEV_PrimaryBusVehicleOutputGroup() { return _manufacturerReportFactoryImplementation.GetPEV_PrimaryBusVehicleOutputGroup(); } - public IReportOutputGroup GetCompletedBusGeneralVehicleOutputGroup() + public IReportOutputGroup GetConventionalCompletedBusGeneralVehicleOutputGroup() { - return _manufacturerReportFactoryImplementation.GetCompletedBusGeneralVehicleOutputGroup(); + return _manufacturerReportFactoryImplementation.GetConventionalCompletedBusGeneralVehicleOutputGroup(); } - public IReportVehicleOutputGroup GetCompletedBusSequenceGroup() + public IReportOutputGroup GetHEVCompletedBusGeneralVehicleOutputGroup() + { + return _manufacturerReportFactoryImplementation.GetHEVCompletedBusGeneralVehicleOutputGroup(); + } + + public IReportOutputGroup GetPEVCompletedBusGeneralVehicleOutputGroup() + { + return _manufacturerReportFactoryImplementation.GetPEVCompletedBusGeneralVehicleOutputGroup(); + } + + public IReportVehicleOutputGroup GetCompletedBusSequenceGroup() { return _manufacturerReportFactoryImplementation.GetCompletedBusSequenceGroup(); } @@ -527,7 +567,12 @@ namespace TUGraz.VectoMockup.Ninject return _manufacturerReportFactoryImplementation.GetCompletedBus_HVACSystemGroup(); } - public IMrfVehicleType GetBoostingLimitationsType() + public IMrfBusAuxGroup GetCompletedBus_xEVHVACSystemGroup() + { + return _manufacturerReportFactoryImplementation.GetCompletedBus_xEVHVACSystemGroup(); + } + + public IMrfVehicleType GetBoostingLimitationsType() { return _manufacturerReportFactoryImplementation.GetBoostingLimitationsType(); } diff --git a/VectoMockup/VectoMockup/Ninject/VIFMockupModule.cs b/VectoMockup/VectoMockup/Ninject/VIFMockupModule.cs index 131f4046c30af77f600efe7893300697539bc444..6bd27d4ae1c55a53a33e8629c58811dc3e9fe44f 100644 --- a/VectoMockup/VectoMockup/Ninject/VIFMockupModule.cs +++ b/VectoMockup/VectoMockup/Ninject/VIFMockupModule.cs @@ -66,6 +66,26 @@ namespace TUGraz.VectoMockup.Ninject return _interimFactory.GetConventionalVehicleType(); } + public IXmlMultistepTypeWriter GetHEVVehicleType() + { + return _interimFactory.GetHEVVehicleType(); + } + + public IXmlMultistepTypeWriter GetPEVVehicleType() + { + return _interimFactory.GetPEVVehicleType(); + } + + public IXmlMultistepTypeWriter GetIEPCVehicleType() + { + return _interimFactory.GetIEPCVehicleType(); + } + + IXmlMultistepTypeWriter IVIFReportInterimFactory.GetExemptedVehicleType() + { + return _interimFactory.GetExemptedVehicleType(); + } + public IReportMultistepCompletedBusOutputGroup GetCompletedBusGeneralParametersGroup() { return _interimFactory.GetCompletedBusGeneralParametersGroup(); @@ -86,24 +106,49 @@ namespace TUGraz.VectoMockup.Ninject return _interimFactory.GetCompletedBusDimensionsGroup(); } - public IReportMultistepCompletedBusTypeWriter GetCompletedAuxiliariesType() + public IReportMultistepCompletedBusTypeWriter GetInterimConventionalAuxiliariesType() + { + return _interimFactory.GetInterimConventionalAuxiliariesType(); + } + + public IReportMultistepCompletedBusTypeWriter GetInterimxEVAuxiliariesType() + { + return _interimFactory.GetInterimxEVAuxiliariesType(); + } + + public IVIFFAdasType GetConventionalInterimADASType() + { + return _interimFactory.GetConventionalInterimADASType(); + } + + public IVIFFAdasType GetHEVInterimADASType() + { + return _interimFactory.GetHEVInterimADASType(); + } + + public IVIFFAdasType GetPEVInterimADASType() + { + return _interimFactory.GetPEVInterimADASType(); + } + + public IVIFFAdasType GetIEPCInterimADASType() { - return _interimFactory.GetCompletedAuxiliariesType(); + return _interimFactory.GetIEPCInterimADASType(); } - public IVIFFAdasType GetCompletedADASType() + public IReportMultistepCompletedBusTypeWriter GetConventionalInterimComponentsType() { - return _interimFactory.GetCompletedADASType(); + return _interimFactory.GetConventionalInterimComponentsType(); } - public IReportMultistepCompletedBusTypeWriter GetCompletedComponentsType() + public IReportMultistepCompletedBusTypeWriter GetxEVInterimComponentsType() { - return _interimFactory.GetCompletedComponentsType(); + return _interimFactory.GetxEVInterimComponentsType(); } - public IReportMultistepCompletedBusTypeWriter GetCompletedAirdragType() + public IReportMultistepCompletedBusTypeWriter GetInterimAirdragType() { - return _interimFactory.GetCompletedAirdragType(); + return _interimFactory.GetInterimAirdragType(); } public IXmlTypeWriter GetConventionalVehicleType() diff --git a/VectoMockup/VectoMockup/Simulation/RundataFactories/CompletedBusRunDataFactory.cs b/VectoMockup/VectoMockup/Simulation/RundataFactories/CompletedBusRunDataFactory.cs index 8fe61ea5d4c61cfbe92020e73ac4cbb4f568e3c3..970e75fc97cf1c088f932ac832afd7ef83763365 100644 --- a/VectoMockup/VectoMockup/Simulation/RundataFactories/CompletedBusRunDataFactory.cs +++ b/VectoMockup/VectoMockup/Simulation/RundataFactories/CompletedBusRunDataFactory.cs @@ -87,7 +87,9 @@ namespace TUGraz.VectoMockup.Simulation.RundataFactories //VehicleDesignSpeed = _segmentCompletedBus.DesignSpeed, //GearshiftParameters = _gearshiftData, }; - simulationRunData.EngineData.FuelMode = 0; + if (simulationRunData.EngineData != null) { + simulationRunData.EngineData.FuelMode = 0; + } simulationRunData.VehicleData.VehicleClass = _segmentCompletedBus.VehicleClass; simulationRunData.BusAuxiliaries = DataAdapterSpecific.CreateBusAuxiliariesData(mission, PrimaryVehicle, CompletedVehicle, simulationRunData); diff --git a/VectoMockup/VectoMockupTest/MockUpVectoTest.cs b/VectoMockup/VectoMockupTest/MockUpVectoTest.cs index a2afd9aa6c75eff78f829b2b1896b77d85a7a8db..23303a05b0e6cc98f8907cffc97a663dea4dc2a3 100644 --- a/VectoMockup/VectoMockupTest/MockUpVectoTest.cs +++ b/VectoMockup/VectoMockupTest/MockUpVectoTest.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.Design; using System.IO; using System.IO.Compression; +using System.Linq; using System.Xml; using System.Xml.Linq; using System.Xml.XPath; @@ -13,6 +14,7 @@ using NUnit.Framework; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.XML; @@ -68,7 +70,9 @@ namespace VectoMockupTest protected const string Conventional_PrimaryBus = BasePath + @"PrimaryBus\Conventional_primaryBus_AMT.xml"; protected const string Conventional_PrimaryBus_Tyres = BasePath + @"PrimaryBus\Conventional_primaryBus_AMT_DifferentTyres.xml"; protected const string HEV_Px_IHPC_PrimaryBus = BasePath + @"PrimaryBus\HEV_primaryBus_AMT_Px.xml"; + protected const string HEV_Px_PrimaryBus_SuperCap = BasePath + "NOT_AVAILABLE"; protected const string HEV_S2_PrimaryBus = BasePath + @"PrimaryBus\HEV-S_primaryBus_AMT_S2.xml"; + protected const string HEV_S2_PrimaryBus_GenSetADC = BasePath + @"PrimaryBus\HEV-S_primaryBus_AMT_S2_GenSetADC.xml"; protected const string HEV_S3_PrimaryBus = BasePath + @"PrimaryBus\HEV-S_primaryBus_S3.xml"; protected const string HEV_S4_PrimaryBus = BasePath + @"PrimaryBus\HEV-S_primaryBus_S4.xml"; protected const string HEV_IEPC_S_PrimaryBus = BasePath + @"PrimaryBus\HEV-S_primaryBus_IEPC-S.xml"; @@ -92,6 +96,9 @@ namespace VectoMockupTest #region Interim Bus Input protected const string Conventional_InterimBusInput = BasePathMockup + @"CompletedBus\Conventional_InterimBus_Min.xml"; + protected const string Conventional_InterimBusInput_AirdragV10 = BasePathMockup + @"CompletedBus\Conventional_InterimBus_AirdragV10.xml"; + protected const string Conventional_InterimBusInput_AirdragV20 = BasePathMockup + @"CompletedBus\Conventional_InterimBus_AirdragV23.xml"; + protected const string Conventional_InterimBusInput_AirdragV24 = BasePathMockup + @"CompletedBus\Conventional_InterimBus_AirdragV24.xml"; protected const string HEV_InterimBusInput = BasePathMockup + @"CompletedBus\HEV_InterimBus_Min.xml"; protected const string PEV_InterimBusInput = BasePathMockup + @"CompletedBus\PEV_InterimBus_Min.xml"; protected const string PEV_IEPC_InterimBusInput = BasePathMockup + @"CompletedBus\IEPC_InterimBus_Min.xml"; @@ -236,7 +243,9 @@ namespace VectoMockupTest [TestCase(Conventional_PrimaryBus_Tyres, TestName = "ConventionalPrimaryBus Tyres")] [TestCase(HEV_IEPC_S_PrimaryBus, TestName="HEV_IEPC_S_PrimaryBus")] [TestCase(HEV_Px_IHPC_PrimaryBus, TestName="HEV_Px_PrimaryBus")] + [TestCase(HEV_Px_PrimaryBus_SuperCap, TestName = "HEV_Px_PrimaryBus_SuperCap")] [TestCase(HEV_S2_PrimaryBus, TestName="HEV_S2_PrimaryBus")] + [TestCase(HEV_S2_PrimaryBus_GenSetADC, TestName = "HEV_S2_PrimaryBus_GenSetADC")] [TestCase(HEV_S3_PrimaryBus, TestName = "HEV_S3_PrimaryBus")] [TestCase(HEV_S4_PrimaryBus, TestName = "HEV_S4_PrimaryBus")] [TestCase(PEV_E2_PrimaryBus, TestName="PEV_E2_PrimaryBus")] @@ -349,17 +358,20 @@ namespace VectoMockupTest } - [TestCase(Conventional_PrimaryBus_Tyres, Conventional_InterimBusInput, "Conventional", TestName = "Interim Conventional Bus Different Tyres")] - [TestCase(HEV_IEPC_S_PrimaryBus, HEV_InterimBusInput, "IEPC-S", TestName = "Interim HEV_IEPC_S_Bus")] - [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_InterimBusInput, "Px", TestName = "Interim HEV_Px_Bus")] - [TestCase(HEV_S2_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "Interim HEV_S2_Bus")] - [TestCase(HEV_S3_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "Interim HEV_S3_Bus")] - [TestCase(HEV_S4_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "Interim HEV_S4_Bus")] - [TestCase(PEV_E2_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "Interim PEV_E2_Bus")] - [TestCase(PEV_E3_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "Interim PEV_E3_Bus")] - [TestCase(PEV_E4_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "Interim PEV_E4_Bus")] + [TestCase(Conventional_PrimaryBus_Tyres, Conventional_InterimBusInput, "Conventional", TestName = "Interim_Conventional_Bus_DifferentTyres")] + [TestCase(Conventional_PrimaryBus, Conventional_InterimBusInput_AirdragV10, "Conventional", TestName = "InterimConventionalBusAirdrag_v1_0")] + [TestCase(Conventional_PrimaryBus, Conventional_InterimBusInput_AirdragV20, "Conventional", TestName = "InterimConventionalBusAirdrag_v2_0")] + [TestCase(Conventional_PrimaryBus, Conventional_InterimBusInput_AirdragV24, "Conventional", TestName = "InterimConventionalBusAirdrag_v2_4")] + [TestCase(HEV_IEPC_S_PrimaryBus, HEV_InterimBusInput, "IEPC-S", "HEV", TestName = "Interim HEV_IEPC_S_Bus")] + [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_InterimBusInput, "Px", "HEV", TestName = "Interim HEV_Px_Bus")] + [TestCase(HEV_S2_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "Interim HEV_S2_Bus")] + [TestCase(HEV_S3_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "Interim HEV_S3_Bus")] + [TestCase(HEV_S4_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "Interim HEV_S4_Bus")] + [TestCase(PEV_E2_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "Interim PEV_E2_Bus")] + [TestCase(PEV_E3_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "Interim PEV_E3_Bus")] + [TestCase(PEV_E4_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "Interim PEV_E4_Bus")] [TestCase(PEV_IEPC_PrimaryBus, PEV_IEPC_InterimBusInput, "IEPC", TestName = "Interim PEV_IEPC_Bus")] - public void InterimTest(string primaryBusInput, string interimBusInput, string expectedType) + public void InterimTest(string primaryBusInput, string interimBusInput, params string[] expectedType) { // VIF + interim input => VIF // (approach: first simulate primary on its own to have an up-to-date VIF @@ -409,16 +421,16 @@ namespace VectoMockupTest } [TestCase(Conventional_PrimaryBus_Tyres, Conventional_InterimBusInput, "Conventional", TestName = "PrimaryAndInterim Conventional Bus Different Tyres")] - [TestCase(HEV_IEPC_S_PrimaryBus, HEV_InterimBusInput, "IEPC-S", TestName = "PrimaryAndInterim HEV_IEPC_S_PrimaryBus")] - [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_InterimBusInput, "Px", TestName = "PrimaryAndInterim HEV_Px_PrimaryBus")] - [TestCase(HEV_S2_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "PrimaryAndInterim HEV_S2_PrimaryBus")] - [TestCase(HEV_S3_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "PrimaryAndInterim HEV_S3_PrimaryBus")] - [TestCase(HEV_S4_PrimaryBus, HEV_InterimBusInput, "Sx", TestName = "PrimaryAndInterim HEV_S4_PrimaryBus")] - [TestCase(PEV_E2_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "PrimaryAndInterim PEV_E2_PrimaryBus")] - [TestCase(PEV_E3_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "PrimaryAndInterim PEV_E3_PrimaryBus")] - [TestCase(PEV_E4_PrimaryBus, PEV_InterimBusInput, "Ex", TestName = "PrimaryAndInterim PEV_E4_PrimaryBus")] + [TestCase(HEV_IEPC_S_PrimaryBus, HEV_InterimBusInput, "IEPC-S", "HEV", TestName = "PrimaryAndInterim HEV_IEPC_S_PrimaryBus")] + [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_InterimBusInput, "Px", "HEV", TestName = "PrimaryAndInterim HEV_Px_PrimaryBus")] + [TestCase(HEV_S2_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "PrimaryAndInterim HEV_S2_PrimaryBus")] + [TestCase(HEV_S3_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "PrimaryAndInterim HEV_S3_PrimaryBus")] + [TestCase(HEV_S4_PrimaryBus, HEV_InterimBusInput, "Sx", "HEV", TestName = "PrimaryAndInterim HEV_S4_PrimaryBus")] + [TestCase(PEV_E2_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "PrimaryAndInterim PEV_E2_PrimaryBus")] + [TestCase(PEV_E3_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "PrimaryAndInterim PEV_E3_PrimaryBus")] + [TestCase(PEV_E4_PrimaryBus, PEV_InterimBusInput, "Ex", "PEV", TestName = "PrimaryAndInterim PEV_E4_PrimaryBus")] [TestCase(PEV_IEPC_PrimaryBus, PEV_IEPC_InterimBusInput, "IEPC", TestName = "PrimaryAndInterim PEV_IEPC_PrimaryBus")] - public void PrimaryWithInterimTest(string primaryBusInput, string interimInput, string expectedType) + public void PrimaryWithInterimTest(string primaryBusInput, string interimInput, params string[] expectedType) { // complete: primary input + complete input (full) => MRF Primary, VIF (step 1), MRF Complete, CIF Complete // (approach: first simulate primary on its own to have an up-to-date VIF @@ -449,16 +461,16 @@ namespace VectoMockupTest [TestCase(Conventional_PrimaryBus_Tyres, Conventional_CompletedBusInput, "Conventional", TestName = "Complete Conventional Bus Different Tyres")] - [TestCase(HEV_IEPC_S_PrimaryBus, HEV_CompletedBusInput, "IEPC-S", TestName = "Complete HEV_IEPC_S_PrimaryBus")] - [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_CompletedBusInput, "Px", TestName = "Complete HEV_Px_PrimaryBus")] - [TestCase(HEV_S2_PrimaryBus, HEV_CompletedBusInput, "S2", TestName = "Complete HEV_S2_PrimaryBus")] - [TestCase(HEV_S3_PrimaryBus, HEV_CompletedBusInput, "S3", TestName = "Complete HEV_S3_PrimaryBus")] - [TestCase(HEV_S4_PrimaryBus, HEV_CompletedBusInput, "S4", TestName = "Complete HEV_S4_PrimaryBus")] - [TestCase(PEV_E2_PrimaryBus, PEV_CompletedBusInput, "E2", TestName = "Complete PEV_E2_PrimaryBus")] - [TestCase(PEV_E3_PrimaryBus, PEV_CompletedBusInput, "E3", TestName = "Complete PEV_E3_PrimaryBus")] - [TestCase(PEV_E4_PrimaryBus, PEV_CompletedBusInput, "E4", TestName = "Complete PEV_E4_PrimaryBus")] + [TestCase(HEV_IEPC_S_PrimaryBus, HEV_CompletedBusInput, "IEPC-S", "HEV", TestName = "Complete HEV_IEPC_S_PrimaryBus")] + [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_CompletedBusInput, "Px", "HEV", TestName = "Complete HEV_Px_PrimaryBus")] + [TestCase(HEV_S2_PrimaryBus, HEV_CompletedBusInput, "S2", "HEV", TestName = "Complete HEV_S2_PrimaryBus")] + [TestCase(HEV_S3_PrimaryBus, HEV_CompletedBusInput, "S3", "HEV", TestName = "Complete HEV_S3_PrimaryBus")] + [TestCase(HEV_S4_PrimaryBus, HEV_CompletedBusInput, "S4", "HEV", TestName = "Complete HEV_S4_PrimaryBus")] + [TestCase(PEV_E2_PrimaryBus, PEV_CompletedBusInput, "E2", "PEV", TestName = "Complete PEV_E2_PrimaryBus")] + [TestCase(PEV_E3_PrimaryBus, PEV_CompletedBusInput, "E3", "PEV", TestName = "Complete PEV_E3_PrimaryBus")] + [TestCase(PEV_E4_PrimaryBus, PEV_CompletedBusInput, "E4", "PEV", TestName = "Complete PEV_E4_PrimaryBus")] [TestCase(PEV_IEPC_PrimaryBus, PEV_IEPC_CompletedBusInput, "IEPC", TestName = "Complete PEV_IEPC_PrimaryBus")] - public void CompleteTest(string primaryBusInput, string completeBusInput, string expectedType) + public void CompleteTest(string primaryBusInput, string completeBusInput, params string[] expectedType) { // complete: primary input + complete input (full) => MRF Primary, VIF (step 1), MRF Complete, CIF Complete // (approach: first simulate primary on its own to have an up-to-date VIF @@ -489,16 +501,16 @@ namespace VectoMockupTest [TestCase(Conventional_PrimaryBus_Tyres, Conventional_CompletedBusInput, "Conventional", TestName = "Completed Conventional Bus Different Tyres")] - [TestCase(HEV_IEPC_S_PrimaryBus, HEV_CompletedBusInput, "IEPC-S", TestName = "Completed HEV_IEPC_S_PrimaryBus")] - [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_CompletedBusInput, "Px", TestName = "Completed HEV_Px_PrimaryBus")] - [TestCase(HEV_S2_PrimaryBus, HEV_CompletedBusInput, "Sx", TestName = "Completed HEV_S2_PrimaryBus")] - [TestCase(HEV_S3_PrimaryBus, HEV_CompletedBusInput, "Sx", TestName = "Completed HEV_S3_PrimaryBus")] - [TestCase(HEV_S4_PrimaryBus, HEV_CompletedBusInput, "Sx", TestName = "Completed HEV_S4_PrimaryBus")] - [TestCase(PEV_E2_PrimaryBus, PEV_CompletedBusInput, "Ex", TestName = "Completed PEV_E2_PrimaryBus")] - [TestCase(PEV_E3_PrimaryBus, PEV_CompletedBusInput, "Ex", TestName = "Completed PEV_E3_PrimaryBus")] - [TestCase(PEV_E4_PrimaryBus, PEV_CompletedBusInput, "Ex", TestName = "Completed PEV_E4_PrimaryBus")] + [TestCase(HEV_IEPC_S_PrimaryBus, HEV_CompletedBusInput, "IEPC-S", "HEV", TestName = "Completed HEV_IEPC_S_PrimaryBus")] + [TestCase(HEV_Px_IHPC_PrimaryBus, HEV_CompletedBusInput, "Px", "HEV", TestName = "Completed HEV_Px_PrimaryBus")] + [TestCase(HEV_S2_PrimaryBus, HEV_CompletedBusInput, "Sx", "HEV", TestName = "Completed HEV_S2_PrimaryBus")] + [TestCase(HEV_S3_PrimaryBus, HEV_CompletedBusInput, "Sx", "HEV", TestName = "Completed HEV_S3_PrimaryBus")] + [TestCase(HEV_S4_PrimaryBus, HEV_CompletedBusInput, "Sx", "HEV", TestName = "Completed HEV_S4_PrimaryBus")] + [TestCase(PEV_E2_PrimaryBus, PEV_CompletedBusInput, "Ex", "PEV", TestName = "Completed PEV_E2_PrimaryBus")] + [TestCase(PEV_E3_PrimaryBus, PEV_CompletedBusInput, "Ex", "PEV", TestName = "Completed PEV_E3_PrimaryBus")] + [TestCase(PEV_E4_PrimaryBus, PEV_CompletedBusInput, "Ex", "PEV", TestName = "Completed PEV_E4_PrimaryBus")] [TestCase(PEV_IEPC_PrimaryBus, PEV_IEPC_CompletedBusInput, "IEPC", TestName = "Completed PEV_IEPC_PrimaryBus")] - public void CompletedTest(string primaryBusInput, string completeBusInput, string expectedType) + public void CompletedTest(string primaryBusInput, string completeBusInput, params string[] expectedType) { // completed: VIF + complete input (full) => VIF , MRF Completed, CIF Completed // (approach: first simulate primary on its own to have an up-to-date VIF @@ -548,7 +560,7 @@ namespace VectoMockupTest } - private static void CheckElementTypeNameContains(string fileName, string elementName, string expectedType) + private static void CheckElementTypeNameContains(string fileName, string elementName, params string[] expectedType) { var xmlDoc = new XmlDocument(); xmlDoc.Load(XmlReader.Create(fileName)); @@ -558,7 +570,8 @@ namespace VectoMockupTest var vehicleNodes = xmlDoc.SelectNodes($"//*[local-name()='{elementName}']"); foreach (XmlNode vehicleNode in vehicleNodes) { var typeName = vehicleNode?.SchemaInfo?.SchemaType?.Name ?? ""; - Assert.IsTrue(typeName.Contains(expectedType, StringComparison.InvariantCultureIgnoreCase), typeName); + var contains = expectedType.Select(x => typeName.Contains(x, StringComparison.InvariantCultureIgnoreCase)); + Assert.IsTrue(contains.Any(x => x), $"{typeName} -- {expectedType.Join()}"); } }