Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit dc4c726f authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

allow lookup of (currently) disabled vehicle classes (for GUI)

parent 78e952a8
No related branches found
No related tags found
No related merge requests found
......@@ -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 ">="
......
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