diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs index 96b39572624f64bd3e3e23fd05e06771cb5ac8a9..0b72434ca692daa961c8eddedb0c08045cd0e06d 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs +++ b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs @@ -2,9 +2,13 @@ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ @@ -14,11 +18,16 @@ namespace TUGraz.VectoCommon.Resources { /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. + /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -34,6 +43,7 @@ namespace TUGraz.VectoCommon.Resources { /// <summary> /// Returns the cached ResourceManager instance used by this class. + /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -49,6 +59,8 @@ namespace TUGraz.VectoCommon.Resources { /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -6189,6 +6201,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to Vocational. + /// </summary> + public static string XMLCustomerReportIsVocational { + get { + return ResourceManager.GetString("XMLCustomerReportIsVocational", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to torqueLimit. /// </summary> diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.resx b/VectoCommon/VectoCommon/Resources/XMLNames.resx index e2d5214c50f42c9b6857344d20c5ab40d0f9e39f..2c0ea6ed6d48b391c8a7805050548eef3a7b444f 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.resx +++ b/VectoCommon/VectoCommon/Resources/XMLNames.resx @@ -2175,4 +2175,10 @@ <data name="MonitoringElectricMachineGEN" xml:space="preserve"> <value>ElectricMachineGEN</value> </data> + <data name="REESS" xml:space="preserve"> + <value>REESS</value> + </data> + <data name="XMLCustomerReportIsVocational" xml:space="preserve"> + <value>Vocational</value> + </data> </root> \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index 890ca899666ac0bee0bc1b1aba90b3e32fc5de29..f78cafdbf9ea349ad54def78f376e3ccf5f4bcb3 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -255,7 +255,7 @@ namespace TUGraz.VectoCore.Models.Declaration case VehicleCategory.Tractor: var vehicleGroup = GetVehicleGroupGroup(vehicleData); var propulsionPower = GetReferencePropulsionPower(vehicleData); - var co2Group = WeightingGroup.Lookup(vehicleGroup.Item1, vehicleGroup.Item2 ?? false, vehicleData.SleeperCab ?? false, propulsionPower); + var co2Group = WeightingGroup.Lookup(vehicleGroup.Item1, vehicleData.SleeperCab ?? false, propulsionPower); return co2Group; default: return Declaration.WeightingGroup.Unknown; diff --git a/VectoCore/VectoCore/Models/Declaration/WeightingFactors.cs b/VectoCore/VectoCore/Models/Declaration/WeightingFactors.cs index 7cbb8bd48867675bb917cfa4c3a2810792eae48b..81a862bdfc9545ac48ef4d2377b5e64b9b34fdb5 100644 --- a/VectoCore/VectoCore/Models/Declaration/WeightingFactors.cs +++ b/VectoCore/VectoCore/Models/Declaration/WeightingFactors.cs @@ -90,7 +90,12 @@ namespace TUGraz.VectoCore.Models.Declaration foreach (var entry in Data) { var sum = entry.Value.Sum(item => item.Value); - if (!sum.IsEqual(1.0, 1e-12)) { + + bool hasVocationalWeights = sum.IsEqual(2.0, 1e-12); + bool isNormalWeights = sum.IsEqual(1.0, 1e-12); + + if (!isNormalWeights && !hasVocationalWeights) + { throw new VectoException("Weighting Factors for {0} do not sum up to 1.0! sum: {1}", entry.Key, sum); } } diff --git a/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs b/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs index 678a3e0268786e2e1344f09b8362420d0c8d5133..b50cec54ecf85ad3a8d0a585d6175c122d3da5c3 100644 --- a/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs +++ b/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs @@ -177,7 +177,7 @@ namespace TUGraz.VectoCore.Models.Declaration } } - public class WeightingGroups : LookupData<VehicleClass, bool, bool, Watt, WeightingGroup> + public class WeightingGroups : LookupData<VehicleClass, bool, Watt, WeightingGroup> { protected readonly List<Entry> Entries = new List<Entry>(); @@ -192,7 +192,6 @@ namespace TUGraz.VectoCore.Models.Declaration foreach (DataRow row in table.Rows) { Entries.Add(new Entry() { VehicleGroup = VehicleClassHelper.Parse(row.Field<string>("vehiclegroup")), - Vocational = "1".Equals(row.Field<string>("Vocational"), StringComparison.InvariantCultureIgnoreCase), SleeperCab = "SleeperCab".Equals(row.Field<string>("cabintype"), StringComparison.InvariantCultureIgnoreCase), RatedPowerMin = row.ParseDouble("engineratedpowermin").SI(Unit.SI.Kilo.Watt).Cast<Watt>(), RatedPowerMax = row.ParseDouble("engineratedpowermax").SI(Unit.SI.Kilo.Watt).Cast<Watt>(), @@ -202,10 +201,10 @@ namespace TUGraz.VectoCore.Models.Declaration } - public override WeightingGroup Lookup(VehicleClass group, bool vocational, bool sleeperCab, Watt engineRatedPower) + public override WeightingGroup Lookup(VehicleClass group, bool sleeperCab, Watt engineRatedPower) { var rows = Entries.FindAll( - x => x.VehicleGroup == group && x.Vocational == vocational && x.SleeperCab == sleeperCab && engineRatedPower >= x.RatedPowerMin && + x => x.VehicleGroup == group && x.SleeperCab == sleeperCab && engineRatedPower >= x.RatedPowerMin && engineRatedPower < x.RatedPowerMax); return rows.Count == 0 ? WeightingGroup.Unknown : rows.First().WeightingGroup; } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs index e588f692ed3b8b9e325c7876afee649bb16771b9..a409f75d173d1bf57b150b570540b5ade70d7c16 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs @@ -32,21 +32,13 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common public XElement[] GetElements(IWeightedResult entry) { - if (entry.Status == VectoRun.Status.PrimaryBusSimulationIgnore) - { - List<XElement> fcElementsIgnore = new List<XElement>(); - foreach (var fcEntry in entry.FuelConsumptionPerMeter) - { - fcElementsIgnore.Add(GetElementIgnore(fcEntry.Value, fcEntry.Key, entry.Payload, entry.CargoVolume, entry.PassengerCount)); - } - - return fcElementsIgnore.ToArray(); - } - List<XElement> fcElements = new List<XElement>(); foreach (var fcEntry in entry.FuelConsumptionPerMeter) { - fcElements.Add(GetElement(fcEntry.Value, fcEntry.Key, entry.Payload, entry.CargoVolume, entry.PassengerCount)); + XElement element = entry.Status == VectoRun.Status.PrimaryBusSimulationIgnore + ? GetElementIgnore(fcEntry.Value, fcEntry.Key, entry.Payload, entry.CargoVolume, entry.PassengerCount) + : GetElement(fcEntry.Value, fcEntry.Key, entry.Payload, entry.CargoVolume, entry.PassengerCount); + fcElements.Add(element); } return fcElements.ToArray(); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs index 5aff2701fc60534a03ad9878f96c1095319b24b1..56a6f4006d69e0188d94042bafcbd95fe1c03acb 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs @@ -147,9 +147,9 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common public interface IReportResultsSummaryWriter { - XElement GetElement(IList<IResultEntry> entries); + XElement[] GetElement(IList<IResultEntry> entries); - XElement GetElement(IList<IOVCResultEntry> entries); + XElement[] GetElement(IList<IOVCResultEntry> entries); } public interface IElectricRangeWriter diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/SummaryWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/SummaryWriter.cs index 3f0a30051b85e50229f766f2109e866b39a686d5..edc5e026447957473c667b62b593376413e4a943 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/SummaryWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/ResultWriter/SummaryWriter.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Linq; +using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Declaration; @@ -11,40 +12,56 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation { public abstract class SummaryWriterBase : AbstractResultWriter, IReportResultsSummaryWriter { + private MissionType[] vocationalMissions = new[] { MissionType.Construction, MissionType.MunicipalUtility }; + protected SummaryWriterBase(ICIFResultsWriterFactory factory, XNamespace ns) : base(factory, ns) { } #region Implementation of ICifSummaryWriter - public XElement GetElement(IList<IResultEntry> entries) + public XElement[] GetElement(IList<IResultEntry> entries) { - var weighted = DeclarationData.CalculateWeightedSummary(entries); - return DoGetElement(weighted); + var weighted = DeclarationData.CalculateWeightedSummary(entries.Where(e => !vocationalMissions.Contains(e.Mission)).ToList()); + var weightedVocationals = DeclarationData.CalculateWeightedSummary(entries.Where(e => vocationalMissions.Contains(e.Mission)).ToList()); + return DoGetElement(weighted, weightedVocationals); } - public XElement GetElement(IList<IOVCResultEntry> entries) + public XElement[] GetElement(IList<IOVCResultEntry> entries) { - var weighted = DeclarationData.CalculateWeightedSummary(entries); - return DoGetElement(weighted); + var weighted = DeclarationData.CalculateWeightedSummary(entries.Where(e => !vocationalMissions.Contains(e.ChargeDepletingResult.Mission)).ToList()); + var weightedVocationals = DeclarationData.CalculateWeightedSummary(entries.Where(e => vocationalMissions.Contains(e.ChargeDepletingResult.Mission)).ToList()); + return DoGetElement(weighted, weightedVocationals); } - protected virtual XElement DoGetElement(IWeightedResult weighted) + protected virtual XElement[] DoGetElement(IWeightedResult weighted, IWeightedResult weightedVocationals) { - if (weighted == null) { - return null; + bool isVocational = false; + List<XElement> results = new List<XElement>(); + foreach (IWeightedResult weightedResult in new[] { weighted, weightedVocationals }) + { + if (weightedResult == null) + { + results.Add(null); + continue; + } + + XElement element = new XElement(TNS + XMLNames.Report_Results_Summary, + new XAttribute(xsi + XMLNames.XSIType, ResultSummaryXMLType), + new XElement(TNS + XMLNames.XMLCustomerReportIsVocational, isVocational), + GetSummary(weightedResult), + FuelConsumptionWriter != null + ? weightedResult.FuelConsumption.Select(x => + FuelConsumptionWriter.GetElements(weightedResult)) + : null, + ElectricEnergyConsumptionWriter?.GetElement(weightedResult), + CO2Writer?.GetElements(weightedResult), + ElectricRangeWriter?.GetElements(weightedResult) + ); + + results.Add(element); + isVocational = !isVocational; } - var fcWriter = FuelConsumptionWriter; - return new XElement(TNS + XMLNames.Report_Results_Summary, - new XAttribute(xsi + XMLNames.XSIType, ResultSummaryXMLType), - GetSummary(weighted), - fcWriter != null - ? weighted.FuelConsumption.Select(x => - fcWriter.GetElements(weighted)) - : null, - ElectricEnergyConsumptionWriter?.GetElement(weighted), - CO2Writer?.GetElements(weighted), - ElectricRangeWriter?.GetElements(weighted) - ); + return results.ToArray(); } public abstract string ResultSummaryXMLType { get; } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ResultWriter/SummaryWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ResultWriter/SummaryWriter.cs index af3ef5822aa22c36d479a1b3177d52981c654258..f15c14b4ace7f5d3127d0cd0566762475434bfc3 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ResultWriter/SummaryWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ResultWriter/SummaryWriter.cs @@ -8,12 +8,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. { #region Implementation of IReportResultsSummaryWriter - public XElement GetElement(IList<IResultEntry> entries) + public XElement[] GetElement(IList<IResultEntry> entries) { return null; } - public XElement GetElement(IList<IOVCResultEntry> entries) + public XElement[] GetElement(IList<IOVCResultEntry> entries) { return null; } diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index ddc57d94d260c6b2637ce0a32db0d81b229d1928..3cf6892855a90eda949fa6bc0eb76411bb88251e 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -293,9 +293,11 @@ namespace TUGraz.VectoCore.OutputData.XML protected override void WriteResult(ResultEntry result) { - var sumWeightinFactors = _weightingFactors.Values.Sum(x => x); - if (!sumWeightinFactors.IsEqual(0) && !sumWeightinFactors.IsEqual(1)) { - throw new VectoException("Mission Profile Weighting factors do not sum up to 1!"); + var sumWeightingFactors = _weightingFactors.Values.Sum(x => x); + bool isNormalWeights = sumWeightingFactors.IsEqual(0) || sumWeightingFactors.IsEqual(1, 1e-12); + bool isVocationalWeights = sumWeightingFactors.IsEqual(2.0, 1e-12); ; + if (!isNormalWeights && !isVocationalWeights) { + throw new VectoException("Mission Profile Weighting factors or Mission Profile Weighting factors for Vocational misisons do not sum up to 1!"); } ManufacturerRpt.WriteResult(result); @@ -340,7 +342,6 @@ namespace TUGraz.VectoCore.OutputData.XML var propulsionPower = DeclarationData.GetReferencePropulsionPower(modelData.VehicleData.InputData); WeightingGroup = DeclarationData.WeightingGroup.Lookup( modelData.VehicleData.VehicleClass, - modelData.VehicleData.VocationalVehicle, modelData.VehicleData.SleeperCab.Value, propulsionPower); } diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs index 82344d839e11522179a4a21658cdaa735fa3e6f3..0eccc41ecd40bedc8f2369fe0756f91e71c58f05 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs @@ -76,7 +76,6 @@ namespace TUGraz.VectoCore.OutputData.XML } else { WeightingGroup = DeclarationData.WeightingGroup.Lookup( modelData.VehicleData.VehicleClass, - modelData.VehicleData.VocationalVehicle, false, 0.SI<Watt>()); _weightingFactors = diff --git a/VectoCore/VectoCore/Resources/Declaration/CO2Standards/MissionProfileWeights.csv b/VectoCore/VectoCore/Resources/Declaration/CO2Standards/MissionProfileWeights.csv index 1b214e4e3c7a54758857129de377caf31d34129a..18307786e59b4a1bd3cfec7a7ee1bccecea96fcd 100644 --- a/VectoCore/VectoCore/Resources/Declaration/CO2Standards/MissionProfileWeights.csv +++ b/VectoCore/VectoCore/Resources/Declaration/CO2Standards/MissionProfileWeights.csv @@ -3,21 +3,17 @@ Weighting Group , LongHaul , LongHaul EMS , Regional Delivery , Regional Delive 1 , 0/0 , 0/0 , 0.1/0.3 , 0/0 , 0.18/0.42 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 2 , 0/0 , 0/0 , 0.125/0.375 , 0/0 , 0.15/0.35 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 3 , 0/0 , 0/0 , 0.125/0.375 , 0/0 , 0.15/0.35 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -4-UD , 0/0 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -4-RD , 0.05/0.05 , 0/0 , 0.45/0.45 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -4-LH , 0.45/0.45 , 0/0 , 0.05/0.05 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -4-V , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +4-UD , 0/0 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +4-RD , 0.05/0.05 , 0/0 , 0.45/0.45 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +4-LH , 0.45/0.45 , 0/0 , 0.05/0.05 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 5-RD , 0.03/0.07 , 0/0 , 0.27/0.63 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -5-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -5-V , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -9-RD , 0.03/0.07 , 0/0 , 0.27/0.63 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -9-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -9-V , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -10-RD , 0.03/0.07 , 0/0 , 0.27/0.63 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -10-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -10-V , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -11 , 0/0 , 0/0 , 0.15/0.35 , 0/0 , 0/0 , 0/0 , 0.15/0.35 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 -12 , 0/0 , 0/0 , 0.21/0.49 , 0/0 , 0/0 , 0/0 , 0.09/0.21 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +5-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +9-RD , 0.03/0.07 , 0/0 , 0.27/0.63 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +9-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0.25/0.25 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +10-RD , 0.03/0.07 , 0/0 , 0.27/0.63 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +10-LH , 0.27/0.63 , 0/0 , 0.03/0.07 , 0/0 , 0/0 , 0/0 , 0.5/0.5 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +11 , 0/0 , 0/0 , 0.3/0.7 , 0/0 , 0/0 , 0.1/0.23 , 0.3/0.37 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 +12 , 0/0 , 0/0 , 0.3/0.7 , 0/0 , 0/0 , 0/0 , 0.3/0.7 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 16 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0.30/0.70 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 # medium lorries 51 , 0/0 , 0/0 , 0.25/0.25 , 0/0 , 0.25/0.25 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 , 0/0 diff --git a/VectoCore/VectoCore/Resources/Declaration/CO2Standards/WeightingGroups.csv b/VectoCore/VectoCore/Resources/Declaration/CO2Standards/WeightingGroups.csv index 62ddefa346f09657e3736c6329e9efd3a9f64caf..0d3939ee62ce7df8b767ab5e30be320678000ad3 100644 --- a/VectoCore/VectoCore/Resources/Declaration/CO2Standards/WeightingGroups.csv +++ b/VectoCore/VectoCore/Resources/Declaration/CO2Standards/WeightingGroups.csv @@ -1,105 +1,97 @@ -Vehicle Group , Vocational , Cabin Type , Engine Rated Power Min [kw] , Engine Rated Power Max [kW] , Weighting Group -1s , 0 , DayCab , 0 , 999999 , 1s -1s , 0 , SleeperCab , 0 , 999999 , 1s -1 , 0 , DayCab , 0 , 999999 , 1 -1 , 0 , SleeperCab , 0 , 999999 , 1 -2 , 0 , DayCab , 0 , 999999 , 2 -2 , 0 , SleeperCab , 0 , 999999 , 2 -3 , 0 , DayCab , 0 , 999999 , 3 -3 , 0 , SleeperCab , 0 , 999999 , 3 -4 , 0 , DayCab , 0 , 170 , 4-UD -4 , 0 , SleeperCab , 0 , 170 , 4-UD -4 , 0 , DayCab , 170 , 999999 , 4-RD -4 , 0 , SleeperCab , 170 , 265 , 4-RD -4 , 0 , SleeperCab , 265 , 999999 , 4-LH -4 , 1 , DayCab , 0 , 999999 , 4-V -4 , 1 , SleeperCab , 0 , 999999 , 4-V -5 , 0 , DayCab , 0 , 999999 , 5-RD -5 , 0 , SleeperCab , 0 , 265 , 5-RD -5 , 0 , SleeperCab , 265 , 999999 , 5-LH -5 , 1 , DayCab , 0 , 999999 , 5-V -5 , 1 , SleeperCab , 0 , 999999 , 5-V -9 , 0 , DayCab , 0 , 999999 , 9-RD -9 , 0 , SleeperCab , 0 , 999999 , 9-LH -9 , 1 , DayCab , 0 , 999999 , 9-V -9 , 1 , SleeperCab , 0 , 999999 , 9-V -10 , 0 , DayCab , 0 , 999999 , 10-RD -10 , 0 , SleeperCab , 0 , 999999 , 10-LH -10 , 1 , DayCab , 0 , 999999 , 10-V -10 , 1 , SleeperCab , 0 , 999999 , 10-V -11 , 0 , DayCab , 0 , 999999 , 11 -11 , 0 , SleeperCab , 0 , 999999 , 11 -12 , 0 , DayCab , 0 , 999999 , 12 -12 , 0 , SleeperCab , 0 , 999999 , 12 -16 , 0 , DayCab , 0 , 999999 , 16 -16 , 0 , SleeperCab , 0 , 999999 , 16 +Vehicle Group , Cabin Type , Engine Rated Power Min [kw] , Engine Rated Power Max [kW] , Weighting Group +1s , DayCab , 0 , 999999 , 1s +1s , SleeperCab , 0 , 999999 , 1s +1 , DayCab , 0 , 999999 , 1 +1 , SleeperCab , 0 , 999999 , 1 +2 , DayCab , 0 , 999999 , 2 +2 , SleeperCab , 0 , 999999 , 2 +3 , DayCab , 0 , 999999 , 3 +3 , SleeperCab , 0 , 999999 , 3 +4 , DayCab , 0 , 170 , 4-UD +4 , SleeperCab , 0 , 170 , 4-UD +4 , DayCab , 170 , 999999 , 4-RD +4 , SleeperCab , 170 , 265 , 4-RD +4 , SleeperCab , 265 , 999999 , 4-LH +5 , DayCab , 0 , 999999 , 5-RD +5 , SleeperCab , 0 , 265 , 5-RD +5 , SleeperCab , 265 , 999999 , 5-LH +9 , DayCab , 0 , 999999 , 9-RD +9 , SleeperCab , 0 , 999999 , 9-LH +10 , DayCab , 0 , 999999 , 10-RD +10 , SleeperCab , 0 , 999999 , 10-LH +11 , DayCab , 0 , 999999 , 11 +11 , SleeperCab , 0 , 999999 , 11 +12 , DayCab , 0 , 999999 , 12 +12 , SleeperCab , 0 , 999999 , 12 +16 , DayCab , 0 , 999999 , 16 +16 , SleeperCab , 0 , 999999 , 16 # -51 , 0 , DayCab , 0 , 999999 , 51 -51 , 0 , SleeperCab , 0 , 999999 , 51 -52 , 0 , DayCab , 0 , 999999 , 52 -52 , 0 , SleeperCab , 0 , 999999 , 52 -53 , 0 , DayCab , 0 , 999999 , 53 -53 , 0 , SleeperCab , 0 , 999999 , 53 -54 , 0 , DayCab , 0 , 999999 , 54 -54 , 0 , SleeperCab , 0 , 999999 , 54 -55 , 0 , DayCab , 0 , 999999 , 55 -55 , 0 , SleeperCab , 0 , 999999 , 55 -56 , 0 , DayCab , 0 , 999999 , 56 -56 , 0 , SleeperCab , 0 , 999999 , 56 +51 , DayCab , 0 , 999999 , 51 +51 , SleeperCab , 0 , 999999 , 51 +52 , DayCab , 0 , 999999 , 52 +52 , SleeperCab , 0 , 999999 , 52 +53 , DayCab , 0 , 999999 , 53 +53 , SleeperCab , 0 , 999999 , 53 +54 , DayCab , 0 , 999999 , 54 +54 , SleeperCab , 0 , 999999 , 54 +55 , DayCab , 0 , 999999 , 55 +55 , SleeperCab , 0 , 999999 , 55 +56 , DayCab , 0 , 999999 , 56 +56 , SleeperCab , 0 , 999999 , 56 # -31a , 0 , DayCab , 0 , 999999 , 31a -31b1 , 0 , DayCab , 0 , 999999 , 31b1 -31b2 , 0 , DayCab , 0 , 999999 , 31b2 -31c , 0 , DayCab , 0 , 999999 , 31c -31d , 0 , DayCab , 0 , 999999 , 31d -31e , 0 , DayCab , 0 , 999999 , 31e -32a , 0 , DayCab , 0 , 999999 , 32a -32b , 0 , DayCab , 0 , 999999 , 32b -32c , 0 , DayCab , 0 , 999999 , 32c -32d , 0 , DayCab , 0 , 999999 , 32d -32e , 0 , DayCab , 0 , 999999 , 32e -32f , 0 , DayCab , 0 , 999999 , 32f -33a , 0 , DayCab , 0 , 999999 , 33a -33b1 , 0 , DayCab , 0 , 999999 , 33b1 -33b2 , 0 , DayCab , 0 , 999999 , 33b2 -33c , 0 , DayCab , 0 , 999999 , 33c -33d , 0 , DayCab , 0 , 999999 , 33d -33e , 0 , DayCab , 0 , 999999 , 33e -34a , 0 , DayCab , 0 , 999999 , 34a -34b , 0 , DayCab , 0 , 999999 , 34b -34c , 0 , DayCab , 0 , 999999 , 34c -34d , 0 , DayCab , 0 , 999999 , 34d -34e , 0 , DayCab , 0 , 999999 , 34e -34f , 0 , DayCab , 0 , 999999 , 34f -35a , 0 , DayCab , 0 , 999999 , 35a -35b1 , 0 , DayCab , 0 , 999999 , 35b1 -35b2 , 0 , DayCab , 0 , 999999 , 35b2 -35c , 0 , DayCab , 0 , 999999 , 35c -36a , 0 , DayCab , 0 , 999999 , 36a -36b , 0 , DayCab , 0 , 999999 , 36b -36c , 0 , DayCab , 0 , 999999 , 36c -36d , 0 , DayCab , 0 , 999999 , 36d -36e , 0 , DayCab , 0 , 999999 , 36e -36f , 0 , DayCab , 0 , 999999 , 36f -37a , 0 , DayCab , 0 , 999999 , 37a -37b1 , 0 , DayCab , 0 , 999999 , 37b1 -37b2 , 0 , DayCab , 0 , 999999 , 37b2 -37c , 0 , DayCab , 0 , 999999 , 37c -37d , 0 , DayCab , 0 , 999999 , 37d -37e , 0 , DayCab , 0 , 999999 , 37e -38a , 0 , DayCab , 0 , 999999 , 38a -38b , 0 , DayCab , 0 , 999999 , 38b -38c , 0 , DayCab , 0 , 999999 , 38c -38d , 0 , DayCab , 0 , 999999 , 38d -38e , 0 , DayCab , 0 , 999999 , 38e -38f , 0 , DayCab , 0 , 999999 , 38f -39a , 0 , DayCab , 0 , 999999 , 39a -39b1 , 0 , DayCab , 0 , 999999 , 39b1 -39b2 , 0 , DayCab , 0 , 999999 , 39b2 -39c , 0 , DayCab , 0 , 999999 , 39c -40a , 0 , DayCab , 0 , 999999 , 40a -40b , 0 , DayCab , 0 , 999999 , 40b -40c , 0 , DayCab , 0 , 999999 , 40c -40d , 0 , DayCab , 0 , 999999 , 40d -40e , 0 , DayCab , 0 , 999999 , 40e -40f , 0 , DayCab , 0 , 999999 , 40f \ No newline at end of file +31a , DayCab , 0 , 999999 , 31a +31b1 , DayCab , 0 , 999999 , 31b1 +31b2 , DayCab , 0 , 999999 , 31b2 +31c , DayCab , 0 , 999999 , 31c +31d , DayCab , 0 , 999999 , 31d +31e , DayCab , 0 , 999999 , 31e +32a , DayCab , 0 , 999999 , 32a +32b , DayCab , 0 , 999999 , 32b +32c , DayCab , 0 , 999999 , 32c +32d , DayCab , 0 , 999999 , 32d +32e , DayCab , 0 , 999999 , 32e +32f , DayCab , 0 , 999999 , 32f +33a , DayCab , 0 , 999999 , 33a +33b1 , DayCab , 0 , 999999 , 33b1 +33b2 , DayCab , 0 , 999999 , 33b2 +33c , DayCab , 0 , 999999 , 33c +33d , DayCab , 0 , 999999 , 33d +33e , DayCab , 0 , 999999 , 33e +34a , DayCab , 0 , 999999 , 34a +34b , DayCab , 0 , 999999 , 34b +34c , DayCab , 0 , 999999 , 34c +34d , DayCab , 0 , 999999 , 34d +34e , DayCab , 0 , 999999 , 34e +34f , DayCab , 0 , 999999 , 34f +35a , DayCab , 0 , 999999 , 35a +35b1 , DayCab , 0 , 999999 , 35b1 +35b2 , DayCab , 0 , 999999 , 35b2 +35c , DayCab , 0 , 999999 , 35c +36a , DayCab , 0 , 999999 , 36a +36b , DayCab , 0 , 999999 , 36b +36c , DayCab , 0 , 999999 , 36c +36d , DayCab , 0 , 999999 , 36d +36e , DayCab , 0 , 999999 , 36e +36f , DayCab , 0 , 999999 , 36f +37a , DayCab , 0 , 999999 , 37a +37b1 , DayCab , 0 , 999999 , 37b1 +37b2 , DayCab , 0 , 999999 , 37b2 +37c , DayCab , 0 , 999999 , 37c +37d , DayCab , 0 , 999999 , 37d +37e , DayCab , 0 , 999999 , 37e +38a , DayCab , 0 , 999999 , 38a +38b , DayCab , 0 , 999999 , 38b +38c , DayCab , 0 , 999999 , 38c +38d , DayCab , 0 , 999999 , 38d +38e , DayCab , 0 , 999999 , 38e +38f , DayCab , 0 , 999999 , 38f +39a , DayCab , 0 , 999999 , 39a +39b1 , DayCab , 0 , 999999 , 39b1 +39b2 , DayCab , 0 , 999999 , 39b2 +39c , DayCab , 0 , 999999 , 39c +40a , DayCab , 0 , 999999 , 40a +40b , DayCab , 0 , 999999 , 40b +40c , DayCab , 0 , 999999 , 40c +40d , DayCab , 0 , 999999 , 40d +40e , DayCab , 0 , 999999 , 40e +40f , DayCab , 0 , 999999 , 40f \ No newline at end of file diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd index db8b07718ba7265176e8a187a69aaf0f67df2d2a..de3cddefdc1481b0f4b39f703ddd1a0267809d91 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputCustomer.0.9.xsd @@ -2182,7 +2182,7 @@ <xs:choice> <xs:sequence> <xs:element name="Result" type="AbstractResultType" maxOccurs="unbounded"/> - <xs:element name="Summary" type="AbstractResultSummaryType" minOccurs="0"/> + <xs:element name="Summary" type="AbstractResultSummaryType" minOccurs="0" maxOccurs="2"/> </xs:sequence> <xs:element name="ExemptedVehicle"> <xs:complexType/> @@ -2615,6 +2615,7 @@ <xs:complexContent> <xs:extension base="AbstractResultSummaryType"> <xs:sequence> + <xs:element name="Vocational" type="xs:boolean"></xs:element> <xs:choice> <xs:element name="AveragePayload"> <xs:annotation> @@ -2655,6 +2656,7 @@ <xs:complexContent> <xs:extension base="AbstractResultSummaryType"> <xs:sequence> + <xs:element name="Vocational" type="xs:boolean"></xs:element> <xs:choice> <xs:element name="AveragePayload"> <xs:annotation> @@ -2707,6 +2709,7 @@ <xs:complexContent> <xs:extension base="AbstractResultSummaryType"> <xs:sequence> + <xs:element name="Vocational" type="xs:boolean"></xs:element> <xs:choice> <xs:element name="AveragePayload"> <xs:annotation> diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 88e61cfdccd3e8612feffea501dd7108322339e9..63475b24dca669891da76e498fcb667c91cbb14b 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -2463,28 +2463,25 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration TestCase(VehicleClass.Class9, true, true, 265, WeightingGroup.Group9V), TestCase(VehicleClass.Class9, true, false, 265, WeightingGroup.Group9V), - TestCase(VehicleClass.Class10, false, false, 169.9, WeightingGroup.Group10RD), - TestCase(VehicleClass.Class10, false, false, 264.9, WeightingGroup.Group10RD), - TestCase(VehicleClass.Class10, false, false, 265, WeightingGroup.Group10RD), - TestCase(VehicleClass.Class10, false, true, 169.9, WeightingGroup.Group10LH), - TestCase(VehicleClass.Class10, false, true, 264.9, WeightingGroup.Group10LH), - TestCase(VehicleClass.Class10, false, true, 265, WeightingGroup.Group10LH), - TestCase(VehicleClass.Class10, true, true, 265, WeightingGroup.Group10V), - TestCase(VehicleClass.Class10, true, false, 265, WeightingGroup.Group10V), + TestCase(VehicleClass.Class10, false, 169.9, WeightingGroup.Group10RD), + TestCase(VehicleClass.Class10, false, 264.9, WeightingGroup.Group10RD), + TestCase(VehicleClass.Class10, false, 265, WeightingGroup.Group10RD), + TestCase(VehicleClass.Class10, true, 169.9, WeightingGroup.Group10LH), + TestCase(VehicleClass.Class10, true, 264.9, WeightingGroup.Group10LH), + TestCase(VehicleClass.Class10, true, 265, WeightingGroup.Group10LH), - TestCase(VehicleClass.Class11, false, true, 169.9, WeightingGroup.Group11), - TestCase(VehicleClass.Class11, false, false, 265, WeightingGroup.Group11), - TestCase(VehicleClass.Class12, false, true, 169.9, WeightingGroup.Group12), - TestCase(VehicleClass.Class12, false, false, 265, WeightingGroup.Group12), - TestCase(VehicleClass.Class16, false, true, 169.9, WeightingGroup.Group16), - TestCase(VehicleClass.Class16, false, false, 265, WeightingGroup.Group16), + TestCase(VehicleClass.Class11, true, 169.9, WeightingGroup.Group11), + TestCase(VehicleClass.Class11, false, 265, WeightingGroup.Group11), + TestCase(VehicleClass.Class12, true, 169.9, WeightingGroup.Group12), + TestCase(VehicleClass.Class12, false, 265, WeightingGroup.Group12), + TestCase(VehicleClass.Class16, true, 169.9, WeightingGroup.Group16), + TestCase(VehicleClass.Class16, false, 265, WeightingGroup.Group16), ] public void TestWeightingGroupLookup( VehicleClass vehicleGroup, bool vocational, bool sleeperCab, double ratedPowerkWm, WeightingGroup expectedWeightingGroup) { var wGroup = DeclarationData.WeightingGroup.Lookup( vehicleGroup, - vocational, sleeperCab, ratedPowerkWm.SI(Unit.SI.Kilo.Watt).Cast<Watt>()); Assert.AreEqual(expectedWeightingGroup, wGroup);