Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 401f99d6 authored by Harald MARTINI's avatar Harald MARTINI
Browse files

added CIF Testcase for HEV-Px Lorry, implemented several CIF group writers

parent f4cef17e
No related branches found
No related tags found
No related merge requests found
Showing
with 671 additions and 18 deletions
......@@ -13,9 +13,9 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
{
public abstract class AbstractCustomerReport : IXMLCustomerReport
{
private readonly ICustomerInformationFileFactory _cifFactory;
protected readonly ICustomerInformationFileFactory _cifFactory;
protected XElement Vehicle { get; private set; }
protected XElement Vehicle { get; set; }
protected AbstractCustomerReport(ICustomerInformationFileFactory cifFactory)
{
......@@ -23,7 +23,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
}
public abstract void InitializeVehicleData(IVehicleDeclarationInputData inputData);
public abstract void InitializeVehicleData(IDeclarationInputDataProvider inputData);
#region Implementation of IXMLCustomerReport
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Ninject.Activation;
using Ninject.Extensions.Factory;
using Ninject.Extensions.NamedScope;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CIFWriter;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CustomerInformationFile;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter;
using TUGraz.VectoCore.Utils.Ninject;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9
......@@ -16,19 +25,76 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
public override void Load()
{
Bind<ICustomerInformationFileFactory>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(
nameCombinationMethod,
4,
4,
typeof(ICustomerInformationFileFactory).GetMethod(nameof(ICustomerInformationFileFactory
nameCombinationMethod, 6, 6, typeof(ICustomerInformationFileFactory).GetMethod(nameof(ICustomerInformationFileFactory
.GetCustomerReport)))).InSingletonScope();
Bind<IXMLCustomerReport>().To<ConventionalLorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ConventionalVehicle,
ArchitectureID.UNKNOWN, false, false, false)));
Bind<IXMLCustomerReport>().To<HEV_PxLorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle,
ArchitectureID.UNKNOWN, false, false, false)));
Bind<IXMLCustomerReport>().To<HEV_S2_Lorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle,
ArchitectureID.S2, false, false, false)));
Bind<IXMLCustomerReport>().To<HEV_S3_Lorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle,
ArchitectureID.S3, false, false, false)));
Bind<IXMLCustomerReport>().To<HEV_S4_Lorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle,
ArchitectureID.S4, false, false, false)));
Bind<IXMLCustomerReport>().To<HEV_IEPC_Lorry_CIF>().Named(nameCombinationMethod(
ToParams(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle,
ArchitectureID.UNKNOWN, false,true, false)));
#region VehicleTypes
Bind<IXmlTypeWriter>().To<CIFConventionalLorryVehicleWriter>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetConventionalLorryVehicleType());
Bind<IXmlTypeWriter>().To<CIF_HEVPx_LorryVehicleWriter>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetHEV_PxLorryVehicleType());
#endregion
#region VehicleGroups
Bind<IMrfXmlGroup>().To<GeneralVehicleSequenceGroupCIF>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetGeneralVehicleSequenceGroupWriter());
Bind<IMrfXmlGroup>().To<LorryGeneralVehicleSequenceGroupCIF>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetLorryGeneralVehicleSequenceGroupWriter());
Bind<IMrfXmlGroup>().To<ConventionalLorryVehicleSequenceGroupCIF>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetConventionalLorryVehicleSequenceGroupWriter());
#endregion
#region ComponentGroups
Bind<IMrfXmlGroup>().To<ComponentGroupWriters>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetEngineGroup());
Bind<IMrfXmlGroup>().To<TransmissionGroup>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetTransmissionGroup());
Bind<IMrfXmlGroup>().To<AxleWheelsGroup>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetAxleWheelsGroup());
Bind<IMrfXmlGroup>().To<ElectricMachineGroup>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetElectricMachineGroup());
Bind<IMrfXmlGroup>().To<REESSGroup>()
.NamedLikeFactoryMethod((ICustomerInformationFileFactory f) => f.GetREESSGroup());
#endregion
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter
{
public abstract class AbstractCIFGroupWriter : IMrfXmlGroup
{
protected XNamespace _mrf = "urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.9";
protected XNamespace _cif = "urn:tugraz:ivt:VectoAPI:CustomerOutput:v0.9";
protected readonly ICustomerInformationFileFactory _cifFactory;
protected AbstractCIFGroupWriter(ICustomerInformationFileFactory cifFactory)
{
_cifFactory = cifFactory;
}
#region Implementation of IMRFGroupWriter
public abstract IList<XElement> GetElements(IDeclarationInputDataProvider inputData);
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CIFWriter
{
public class ComponentGroupWriters : AbstractCIFGroupWriter
{
public ComponentGroupWriters(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var engine = inputData.JobInputData.Vehicle.Components.EngineInputData;
var fuelTypesXElement = new XElement(_cif + XMLNames.Report_Vehicle_FuelTypes);
var fuelTypes = new HashSet<FuelType>();
foreach (var engineMode in engine.EngineModes)
{
foreach (var fuel in engineMode.Fuels) {
fuelTypes.Add(fuel.FuelType);
}
}
var sortedFuels = fuelTypes.ToList();
sortedFuels.Sort((fuelType1, fuelType2) => fuelType1.CompareTo(fuelType2));
sortedFuels.ForEach(type => fuelTypesXElement.Add(new XElement(_cif + XMLNames.Engine_FuelType, type)));
return new List<XElement>() {
new XElement(_cif + XMLNames.Engine_RatedPower, engine.RatedPowerDeclared.ValueAsUnit("kW")),
new XElement(_cif + "EngineCapacity", engine.Displacement.ValueAsUnit("ltr")),
fuelTypesXElement
};
}
#endregion
}
public class TransmissionGroup : AbstractCIFGroupWriter
{
public TransmissionGroup(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var gearbox = inputData.JobInputData.Vehicle.Components.GearboxInputData;
return new List<XElement>() {
new XElement(_cif + "TransmissionValues", gearbox.CertificationMethod.ToXMLFormat()),
new XElement(_cif + XMLNames.Gearbox_TransmissionType, gearbox.Type.ToXMLFormat()),
new XElement(_cif + "NrOfGears", gearbox.Gears.Count)
};
}
#endregion
}
public class AxleWheelsGroup : AbstractCIFGroupWriter
{
public AxleWheelsGroup(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var axleWheels = inputData.JobInputData.Vehicle.Components.AxleWheels;
double averageRRC = 0;
var result = new List<XElement>();
int axleCount = 0;
foreach (var axle in axleWheels.AxlesDeclaration) {
averageRRC += axle.Tyre.RollResistanceCoefficient;
result.Add(new XElement(_cif + XMLNames.AxleWheels_Axles_Axle,
new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, ++axleCount),
new XElement(_cif + XMLNames.Report_Tyre_TyreDimension, axle.Tyre.Dimension),
new XElement(_cif + "FuelEfficiencyClass", axle.Tyre.FuelEfficiencyClass),
new XElement(_cif + XMLNames.Report_Tyre_TyreCertificationNumber, axle.Tyre.CertificationNumber)));
}
averageRRC /= axleWheels.AxlesDeclaration.Count;
result.Insert(0, new XElement(_cif + "AverageRRC", averageRRC));
return result;
}
#endregion
}
public class LorryAuxGroup : AbstractCIFGroupWriter
{
public LorryAuxGroup(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
return new List<XElement>() {
new XElement(_cif + "SteeringPumpTechnology",
inputData.JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries
.Single(aux => aux.Type == AuxiliaryType.SteeringPump).Technology.Join())
};
}
#endregion
}
public class ElectricMachineGroup : AbstractCIFGroupWriter
{
public ElectricMachineGroup(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var result = new List<XElement>();
var totalRatedPropulsionPower =
inputData.JobInputData.Vehicle.Components.ElectricMachines.Entries
.Where(e => e.Position != PowertrainPosition.GEN).Sum((e => e.ElectricMachine.R85RatedPower));
result.Add(new XElement(_cif + "TotalRatedPropulsionPower", totalRatedPropulsionPower.ValueAsUnit("kW")));
result.Add(new XElement(_cif + "MaxContinousPropulsionPower", "TODO"));
return result;
}
#endregion
}
public class REESSGroup : AbstractCIFGroupWriter
{
public REESSGroup(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var reess = inputData.JobInputData.Vehicle.Components.ElectricStorage;
var batteries = reess.ElectricStorageElements
.Where(es => es.REESSPack.StorageType == REESSType.Battery)
.Select(es => es.REESSPack as IBatteryPackDeclarationInputData);
var totalStorageCapacity = batteries
.Sum(bp => bp.Capacity);
var totalUsableCapacity = batteries.Sum(bp => bp.TotalUsableCapacityInSimulation());
return new List<XElement>() {
new XElement(_cif + "TotalStorageCapacity", totalUsableCapacity),
new XElement(_cif + "UsableStorageCapacity", totalStorageCapacity)
};
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CIFWriter
{
public class GeneralVehicleSequenceGroupCIF : AbstractCIFGroupWriter
{
public GeneralVehicleSequenceGroupCIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var vehicleData = inputData.JobInputData.Vehicle;
var result = new List<XElement>() {
new XElement(_cif + XMLNames.Vehicle_VIN, vehicleData.VIN),
new XElement(_cif + XMLNames.Vehicle_VehicleCategory, vehicleData.LegislativeClass.ToXMLFormat()),
new XElement(_cif + XMLNames.Vehicle_AxleConfiguration, vehicleData.AxleConfiguration.ToXMLFormat()),
new XElement(_cif + XMLNames.Vehicle_TPMLM, XMLHelper.ValueAsUnit(vehicleData.GrossVehicleMassRating, "kg")),
new XElement(_cif + XMLNames.Report_Vehicle_VehicleGroup, vehicleData.VehicleCategory.ToXMLFormat())
};
return result;
}
#endregion
}
public class LorryGeneralVehicleSequenceGroupCIF : AbstractCIFGroupWriter
{
public LorryGeneralVehicleSequenceGroupCIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var vehicleData = inputData.JobInputData.Vehicle;
var result = new List<XElement>() {
new XElement(_cif + "VehicleGroupCO2", "todo"),
new XElement(_cif + XMLNames.Component_Manufacturer, vehicleData.Manufacturer),
new XElement(_cif + XMLNames.Component_ManufacturerAddress, vehicleData.ManufacturerAddress),
new XElement(_cif + XMLNames.Component_Model, vehicleData.Model),
new XElement(_cif + XMLNames.VehicleTypeApprovalNumber, vehicleData.VehicleTypeApprovalNumber),
new XElement(_cif + XMLNames.CorrectedActualMass, vehicleData.CurbMassChassis.ValueAsUnit("kg")),
new XElement(_cif + XMLNames.Vehicle_VocationalVehicle, vehicleData.VocationalVehicle),
new XElement(_cif + XMLNames.Vehicle_SleeperCab, vehicleData.SleeperCab),
new XElement(_cif + XMLNames.Vehicle_ZeroEmissionVehicle, vehicleData.ZeroEmissionVehicle),
new XElement(_cif + XMLNames.Vehicle_HybridElectricHDV, vehicleData.HybridElectricHDV)
};
return result;
}
#endregion
}
public class ConventionalLorryVehicleSequenceGroupCIF : AbstractCIFGroupWriter
{
public ConventionalLorryVehicleSequenceGroupCIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var vehicleData = inputData.JobInputData.Vehicle;
return new List<XElement>() {
new XElement(_cif + "WasteHeatRecovery",
vehicleData.Components.EngineInputData.WHRType != WHRType.None),
new XElement(_cif + XMLNames.Vehicle_DualFuelVehicle, vehicleData.DualFuelVehicle)
};
}
#endregion
}
public class HEV_LorryVehicleTypeGroupCIF : AbstractCIFGroupWriter
{
public HEV_LorryVehicleTypeGroupCIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var result = new List<XElement>();
result.AddRange(_cifFactory.GetGeneralVehicleSequenceGroupWriter().GetElements(inputData));
result.AddRange(_cifFactory.GetLorryGeneralVehicleSequenceGroupWriter().GetElements(inputData));
result.AddRange(_cifFactory.GetHEV_VehicleSequenceGroupWriter().GetElements(inputData));
return result;
}
#endregion
}
public class HEV_VehicleSequenceGroupWriter : AbstractCIFGroupWriter
{
public HEV_VehicleSequenceGroupWriter(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCIFGroupWriter
public override IList<XElement> GetElements(IDeclarationInputDataProvider inputData)
{
var result = new List<XElement>();
var ovCc = inputData.JobInputData.Vehicle.OvcHev;
result.AddRange(_cifFactory.GetConventionalLorryVehicleSequenceGroupWriter().GetElements(inputData));
result.AddRange(new List<XElement>() {
new XElement(_cif + "HEVArchitecture", inputData.JobInputData.Vehicle.ArchitectureID.GetLabel()),
new XElement(_cif + "OffVehicleChargingCapability", ovCc)
});
if (ovCc) {
result.Add(new XElement(_cif + "OffVehicleChargingMaxPower", inputData.JobInputData.Vehicle.MaxChargingPower.ValueAsUnit("kW")));
}
return result;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Castle.Components.DictionaryAdapter.Xml;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CustomerInformationFile;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CIFWriter
{
public abstract class VehicleWriter : IXmlTypeWriter
{
protected readonly ICustomerInformationFileFactory _cifFactory;
protected readonly IManufacturerReportFactory _mrfFactory;
protected XNamespace _cif = "urn:tugraz:ivt:VectoAPI:CustomerOutput:v0.9";
public VehicleWriter(ICustomerInformationFileFactory cifFactory, IManufacturerReportFactory mrfFactory)
{
_cifFactory = cifFactory;
_mrfFactory = mrfFactory;
}
#region Implementation of IXmlTypeWriter
public abstract XElement GetElement(IDeclarationInputDataProvider inputData);
#endregion
}
public class CIFConventionalLorryVehicleWriter : VehicleWriter
{
public CIFConventionalLorryVehicleWriter(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.GetGeneralVehicleSequenceGroupWriter().GetElements(inputData),
_cifFactory.GetLorryGeneralVehicleSequenceGroupWriter().GetElements(inputData),
_cifFactory.GetConventionalLorryVehicleSequenceGroupWriter().GetElements(inputData),
_mrfFactory.GetConventionalADASType().GetXmlType(inputData.JobInputData.Vehicle.ADAS),
_cifFactory.GetEngineGroup().GetElements(inputData),
_cifFactory.GetTransmissionGroup().GetElements(inputData),
new XElement(_cif + XMLNames.Component_Retarder, inputData.JobInputData.Vehicle.Components.RetarderInputData.Type != RetarderType.None),
new XElement(_cif + XMLNames.Axlegear_Ratio, inputData.JobInputData.Vehicle.Components.AxleGearInputData.Ratio.ToXMLFormat(2)),
_cifFactory.GetAxleWheelsGroup().GetElements(inputData),
_cifFactory.GetLorryAuxGroup().GetElements(inputData)
);
}
#endregion
}
public class CIF_HEVPx_LorryVehicleWriter : VehicleWriter
{
public CIF_HEVPx_LorryVehicleWriter(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.GetHEV_LorryVehicleTypeGroup().GetElements(inputData),
_mrfFactory.GetHEVADASType().GetXmlType(inputData.JobInputData.Vehicle.ADAS),
_cifFactory.GetEngineGroup().GetElements(inputData),
_cifFactory.GetTransmissionGroup().GetElements(inputData),
_cifFactory.GetElectricMachineGroup().GetElements(inputData),
_cifFactory.GetREESSGroup().GetElements(inputData),
_cifFactory.GetLorryAuxGroup().GetElements(inputData)
);
}
#endregion
}
}
......@@ -35,9 +35,135 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IVehicleDeclarationInputData inputData)
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
Vehicle = _cifFactory.GetConventionalLorryVehicleType(inputData);
Vehicle = _cifFactory.GetConventionalLorryVehicleType().GetElement(inputData);
}
#endregion
}
public class HEV_PxLorry_CIF : LorryCustomerInformationFile
{
public HEV_PxLorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
var vehicle = _cifFactory.GetHEV_PxLorryVehicleType();
Vehicle = _cifFactory.GetHEV_PxLorryVehicleType().GetElement(inputData);
}
#endregion
}
public class HEV_S2_Lorry_CIF : LorryCustomerInformationFile
{
public HEV_S2_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class HEV_S3_Lorry_CIF : LorryCustomerInformationFile
{
public HEV_S3_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class HEV_S4_Lorry_CIF : LorryCustomerInformationFile
{
public HEV_S4_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class HEV_IEPC_Lorry_CIF : LorryCustomerInformationFile
{
public HEV_IEPC_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class PEV_E2_Lorry_CIF : LorryCustomerInformationFile
{
public PEV_E2_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class PEV_E3_Lorry_CIF : LorryCustomerInformationFile
{
public PEV_E3_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class PEV_E4_Lorry_CIF : LorryCustomerInformationFile
{
public PEV_E4_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
}
public class PEV_IEPC_Lorry_CIF : LorryCustomerInformationFile
{
public PEV_IEPC_Lorry_CIF(ICustomerInformationFileFactory cifFactory) : base(cifFactory) { }
#region Overrides of AbstractCustomerReport
public override void InitializeVehicleData(IDeclarationInputDataProvider inputData)
{
throw new NotImplementedException();
}
#endregion
......
......@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportGroupWriter;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter;
namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9
......@@ -15,6 +16,29 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation
IXMLCustomerReport GetCustomerReport(VehicleCategory vehicleType, VectoSimulationJobType jobType,
ArchitectureID archId, bool exempted, bool iepc, bool ihpc);
IXmlTypeWriter GetConventionalLorryVehicleType(IVehicleDeclarationInputData inputData);
IXmlTypeWriter GetConventionalLorryVehicleType();
IXmlTypeWriter GetHEV_PxLorryVehicleType();
IXmlTypeWriter GetHEV_S2_LorryVehicleType();
IXmlTypeWriter GetHEV_S3_LorryVehicleType();
IXmlTypeWriter GetHEV_S4_LorryVehicleType();
IXmlTypeWriter GetHEV_IEPC_LorryVehicleType();
IXmlTypeWriter GetPEV_E2_LorryVehicleType();
IXmlTypeWriter GetPEV_E3_LorryVehicleType();
IXmlTypeWriter GetPEV_E4_LorryVehicleType();
IXmlTypeWriter GetPEV_IEPC_LorryVehicleType();
IMrfXmlGroup GetGeneralVehicleSequenceGroupWriter();
IMrfXmlGroup GetLorryGeneralVehicleSequenceGroupWriter();
IMrfXmlGroup GetConventionalLorryVehicleSequenceGroupWriter();
IMrfXmlGroup GetEngineGroup();
IMrfXmlGroup GetTransmissionGroup();
IMrfXmlGroup GetAxleWheelsGroup();
IMrfXmlGroup GetLorryAuxGroup();
IMrfXmlGroup GetHEV_VehicleSequenceGroupWriter();
IMrfXmlGroup GetHEV_LorryVehicleTypeGroup();
IMrfXmlGroup GetElectricMachineGroup();
IMrfXmlGroup GetREESSGroup();
}
}
......@@ -78,7 +78,7 @@ namespace TUGraz.VectoCore.Utils
.Replace(versionPrefix, string.Empty);
}
public static object[] ValueAsUnit(Kilogram mass, string unit, uint? decimals = 0)
public static object[] ValueAsUnit(this Kilogram mass, string unit, uint? decimals = 0)
{
switch (unit) {
case "t": return GetValueAsUnit(mass.ConvertToTon(), unit, decimals);
......@@ -88,7 +88,7 @@ namespace TUGraz.VectoCore.Utils
throw new NotImplementedException($"unknown unit '{unit}'");
}
public static object[] ValueAsUnit(Watt power, string unit, uint? decimals = 0)
public static object[] ValueAsUnit(this Watt power, string unit, uint? decimals = 0)
{
switch (unit) {
case "kW": return GetValueAsUnit(power?.ConvertToKiloWatt(), unit, decimals);
......@@ -98,7 +98,7 @@ namespace TUGraz.VectoCore.Utils
throw new NotImplementedException($"unknown unit '{unit}'");
}
public static object[] ValueAsUnit(CubicMeter volume, string unit, uint? decimals = 0)
public static object[] ValueAsUnit(this CubicMeter volume, string unit, uint? decimals = 0)
{
switch (unit) {
case "ltr": return GetValueAsUnit(volume.ConvertToCubicDeziMeter(), unit, decimals);
......@@ -109,7 +109,7 @@ namespace TUGraz.VectoCore.Utils
throw new NotImplementedException($"unknown unit '{unit}'");
}
public static object[] ValueAsUnit(PerSecond angSpeed, string unit, uint? decimals = 0)
public static object[] ValueAsUnit(this PerSecond angSpeed, string unit, uint? decimals = 0)
{
switch (unit) {
case "rpm": return GetValueAsUnit(angSpeed.ConvertToRoundsPerMinute(), unit, decimals);
......@@ -119,7 +119,7 @@ namespace TUGraz.VectoCore.Utils
}
public static object[] ValueAsUnit(MeterPerSecond speed, string unit, uint? decimals)
public static object[] ValueAsUnit(this MeterPerSecond speed, string unit, uint? decimals)
{
switch (unit) {
case "km/h": return GetValueAsUnit(speed.ConvertToKiloMeterPerHour(), unit, decimals);
......@@ -128,7 +128,7 @@ namespace TUGraz.VectoCore.Utils
throw new NotImplementedException($"unknown unit '{unit}'");
}
public static object[] ValueAsUnit(MeterPerSquareSecond acc, string unit, uint? decimals)
public static object[] ValueAsUnit(this MeterPerSquareSecond acc, string unit, uint? decimals)
{
switch (unit) {
case "m/s²": return GetValueAsUnit(acc.Value(), unit, decimals);
......@@ -137,7 +137,7 @@ namespace TUGraz.VectoCore.Utils
throw new NotImplementedException($"unknown unit '{unit}'");
}
public static object[] ValueAsUnit(Meter m, string unit, uint? decimals)
public static object[] ValueAsUnit(this Meter m, string unit, uint? decimals)
{
switch (unit) {
case "m": return GetValueAsUnit(m.Value(), unit, decimals);
......
......@@ -483,6 +483,10 @@
<Compile Include="OutputData\XML\ComponentWriter\IComponentWriterFactory.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\AbstractCustomerReport.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CIFNinjectModule.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CIFWriter\AbstractCIFGroupWriter.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CIFWriter\ComponentGroupWriters.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CIFWriter\VehicleGroups.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CIFWriter\VehicleWriter.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\CustomerInformationFile\LorryCustomerInformationFile.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\CustomerInformationFile_0_9\ICustomerInformationFileFactory.cs" />
<Compile Include="OutputData\XML\DeclarationReports\CustomerInformationFile\IXMLCustomerReport.cs" />
......
......@@ -7,6 +7,7 @@ using NUnit.Framework;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformationFile.CustomerInformationFile_0_9.CustomerInformationFile;
using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport;
namespace TUGraz.VectoCore.Tests.XML.Reports
......@@ -40,11 +41,26 @@ namespace TUGraz.VectoCore.Tests.XML.Reports
[TestCase(ConventionalHeavyLorry)]
public void ConventionalLorryCIFTest(string fileName)
{
var report = GetCustomerReport(fileName, out var dataProvider) as
var report = GetCustomerReport(fileName, out var dataProvider) as ConventionalLorry_CIF;
Assert.NotNull(report);
report.InitializeVehicleData(dataProvider);
Assert.IsTrue(ValidateAndPrint(report.Report));
}
[TestCase(HEV_Px_HeavyLorry)]
public void HEV_Px_IHPC_LorryCIFTest(string fileName)
{
var report = GetCustomerReport(fileName, out var dataProvider) as HEV_PxLorry_CIF;
Assert.NotNull(report);
report.InitializeVehicleData(dataProvider);
Assert.IsTrue(ValidateAndPrint(report.Report));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment