diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index c95664d566e8009be2d9e57dfd56e22d2346e487..981f6cfda298e32a9c93dcc56cb15100bca421a7 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -45,6 +45,7 @@ namespace TUGraz.VectoCore.Models.Declaration { private DataTable _segmentTable; + protected override string ResourceId { get { return RessourceHelper.Namespace + "SegmentTable.csv"; } @@ -67,6 +68,12 @@ namespace TUGraz.VectoCore.Models.Declaration public override Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration, Kilogram grossVehicleMassRating, Kilogram curbWeight) + { + return Lookup(vehicleCategory, axleConfiguration, grossVehicleMassRating, curbWeight, false); + } + + public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration, + Kilogram grossVehicleMassRating, Kilogram curbWeight, bool considerInvalid) { if (grossVehicleMassRating == null || grossVehicleMassRating < 7.5.SI().Ton) { throw new VectoException("Gross vehicle mass must be greater than 7.5 tons"); @@ -80,7 +87,7 @@ namespace TUGraz.VectoCore.Models.Declaration var axleConf = r.Field<string>("axleconf."); var massMin = r.ParseDouble("gvw_min").SI().Ton; var massMax = r.ParseDouble("gvw_max").SI().Ton; - return isValid == "1" + return (considerInvalid || isValid == "1") && category == vehicleCategory.ToString() && axleConf == axleConfiguration.GetName() // MK 2016-06-07: normally the next condition should be "mass > massMin", except for 7.5t where is should be ">="