diff --git a/VectoCore/VectoCore/Models/Declaration/Segment.cs b/VectoCore/VectoCore/Models/Declaration/Segment.cs index 53f2f6d1149fc02f41b496d2e66f1e44ff4fabd9..1b84124604aaaa4a3bf989286cbb473d36d03cd5 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segment.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segment.cs @@ -55,6 +55,8 @@ namespace TUGraz.VectoCore.Models.Declaration public Meter VehicleHeight { get; internal set; } + public MeterPerSecond DesignSpeed { get; internal set; } + public SquareMeter CdAConstruction { get; internal set; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index 75f4608a1516f3f7372c14e2dea89aea2662f5b3..5d907cc2524abc071d07895abeb3ee7ff67b5824 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -46,7 +46,6 @@ namespace TUGraz.VectoCore.Models.Declaration { private DataTable _segmentTable; - protected override string ResourceId { get { return DeclarationData.DeclarationDataResourcePrefix + ".SegmentTable.csv"; } @@ -54,7 +53,8 @@ namespace TUGraz.VectoCore.Models.Declaration protected override string ErrorMessage { - get { + get + { return "ERROR: Could not find the declaration segment for vehicle. Category: {0}, AxleConfiguration: {1}, GrossVehicleWeight: {2}"; } @@ -89,13 +89,14 @@ namespace TUGraz.VectoCore.Models.Declaration 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 ">=" - // in any case ">=" is also correct, because the segment table is sorted by weight. + // MK 2016-06-07: normally the next condition should be "mass > massMin", except for 7.5t where is should be ">=" + // in any case ">=" is also correct, because the segment table is sorted by weight. && grossVehicleMassRating >= massMin && grossVehicleMassRating <= massMax; }); } catch (InvalidOperationException e) { - var errorMessage = string.Format(ErrorMessage, vehicleCategory, axleConfiguration.GetName(), grossVehicleMassRating); + var errorMessage = string.Format(ErrorMessage, vehicleCategory, axleConfiguration.GetName(), + grossVehicleMassRating); Log.Fatal(errorMessage); throw new VectoException(errorMessage, e); } @@ -110,6 +111,7 @@ namespace TUGraz.VectoCore.Models.Declaration row.Field<string>(".vaccfile")), Missions = CreateMissions(ref grossVehicleMassRating, curbWeight, row), VehicleHeight = row.ParseDouble("height").SI<Meter>(), + DesignSpeed = row.ParseDouble("designspeed").KMPHtoMeterPerSecond(), GrossVehicleMassRating = grossVehicleMassRating, CdAConstruction = string.IsNullOrEmpty(row["cdxa_construction"].ToString()) @@ -164,7 +166,8 @@ namespace TUGraz.VectoCore.Models.Declaration throw new VectoException( "Error in segmentation table: number of trailers and list of weight shares does not match!"); } - trailers.AddRange(trailerWeightShares.Select((t, i) => CreateTrailer(trailerList[i], t.ToDouble() / 100.0, i == 0))); + trailers.AddRange( + trailerWeightShares.Select((t, i) => CreateTrailer(trailerList[i], t.ToDouble() / 100.0, i == 0))); } else { if (ShouldTrailerBeUsed(row, missionType)) { var trailerValue = row.Field<string>("trailer"); @@ -175,7 +178,6 @@ namespace TUGraz.VectoCore.Models.Declaration } } - //var semiTrailerField = row.Field<string>("semitrailer"); //var semiTrailer = !string.IsNullOrWhiteSpace(semiTrailerField) // ? DeclarationData.StandardBodies.Lookup(semiTrailerField) diff --git a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv index 35fdbce7e3d75bb03107b1f48d3b6c7a35aab37b..565e107743bfe129f9274e12922ae8128d07a1bf 100644 --- a/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv +++ b/VectoCore/VectoCore/Resources/Declaration/SegmentTable.csv @@ -1,29 +1,29 @@ -Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Height,Body,Trailer,EMS ,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - EMS,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Truck Axles - Long haul EMS,Truck Axles - Other EMS,Trailer Axles - Long haul EMS,Trailer Axles - Other EMS,Long haul,Long haul EMS,Regional delivery,Regional delivery EMS,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach,CdxA_Construction -## 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- , ,pc(R) , ,pc(R) ,- ,- ,- ,- ,- ,- ,- , , -1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,3.0 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,3.0 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,3.0 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc(R) ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,10 ,12 ,2 ,3.0 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc(R) ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,3.0 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,12 ,16 ,3 ,3.0 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,3.0 ,B4 ,T2 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,20/30 ,45/55 ,50 , , , , , ,14000 ,- ,4400 ,- ,- ,4400 ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,4x2 ,16 ,99 ,5 ,3.0 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,20/25 ,25/25 ,55 ,50 ,15/20 ,17.5/25 ,40/25 ,35/22.5 ,19300 ,26500 ,12900 ,17500 ,- ,- ,- ,- ,- ,- ,- ,- , -0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- , -0 ,RigidTruck ,4x4 ,16 ,99 ,7 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,Tractor ,4x4 ,16 ,99 ,8 ,3.0 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,3.0 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,19300 ,26500 ,7100 ,17500 ,- ,7100 ,- ,- ,- ,- ,- ,- , -1 ,Tractor ,6x2 ,0 ,99 ,10 ,3.0 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,19300 ,26500 ,12900 ,17500 ,- ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,6x4 ,0 ,99 ,11 ,3.0 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/22.5/22.5 ,35/35/30 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,19300 ,26500 ,7100 ,17500 ,- ,7100 ,7100 ,- ,- ,- ,- ,- ,8.5 -1 ,Tractor ,6x4 ,0 ,99 ,12 ,3.0 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/15/15 ,20/15/15 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,19300 ,26500 ,12900 ,17500 ,- ,- ,12900 ,- ,- ,- ,- ,- ,8.8 -0 ,RigidTruck ,6x6 ,0 ,99 ,13 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,Tractor ,6x6 ,0 ,99 ,14 ,3.0 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,RigidTruck ,8x2 ,0 ,99 ,15 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- ,- , -1 ,RigidTruck ,8x4 ,0 ,99 ,16 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , ,25/25/25/25 , , , , , , ,- ,- ,- ,- ,- ,- ,12900 ,- ,- ,- ,- ,- , -0 ,RigidTruck ,8x6 ,0 ,99 ,17 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- ,9.0 -0 ,RigidTruck ,8x8 ,0 ,99 ,17 ,3.0 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , -0 ,CityBus ,4x2 ,0 ,18 ,B1 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , -0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , -0 ,Coach ,4x2 ,0 ,18 ,B3 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , -0 ,CityBus ,6x2 ,18 ,99 ,B4 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , -0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , -0 ,Coach ,6x2 ,18 ,99 ,B6 ,3.0 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , \ No newline at end of file +Valid,Vehicle Category,Axle Conf.,GVW_Min,GVW_Max,HDV class,Height,DesignSpeed,Body,Trailer,EMS ,.vacc file,Cross Wind Correction - Long haul,Cross Wind Correction - EMS,Cross Wind Correction - Other,Truck Axles - Long haul,Truck Axles - Other,Trailer Axles - Long haul,Trailer Axles - Other,Truck Axles - Long haul EMS,Truck Axles - Other EMS,Trailer Axles - Long haul EMS,Trailer Axles - Other EMS,Long haul,Long haul EMS,Regional delivery,Regional delivery EMS,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach,CdxA_Construction +## 0 ,RigidTruck ,4x2 ,0 ,7.5 ,0 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- , ,pc(R) , ,pc(R) ,- ,- ,- ,- ,- ,- ,- , , +1 ,RigidTruck ,4x2 ,7.5 ,10 ,1 ,3.0 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,7.5 ,10 ,1 ,3.0 ,85 ,B1 , , ,Truck.vacc, , ,RigidSolo , ,45/55 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,10 ,12 ,2 ,3.0 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc(R) ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,10 ,12 ,2 ,3.0 ,85 ,B2 ,T1 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,22.5/32.5 ,45/55 ,45 , , , , , ,pc(R) ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,12 ,16 ,3 ,3.0 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,12 ,16 ,3 ,3.0 ,85 ,B3 , , ,Truck.vacc, , ,RigidSolo , ,40/60 , , , , , , ,- ,- ,pc(R) ,- ,pc(R) ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,4x2 ,16 ,99 ,4 ,3.0 ,85 ,B4 ,T2 , ,Truck.vacc,RigidTrailer , ,RigidSolo ,20/30 ,45/55 ,50 , , , , , ,14000 ,- ,4400 ,- ,- ,4400 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,4x2 ,16 ,99 ,5 ,3.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,20/25 ,25/25 ,55 ,50 ,15/20 ,17.5/25 ,40/25 ,35/22.5 ,19300 ,26500 ,12900 ,17500 ,- ,- ,- ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,7.5 ,16 ,6 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,??? ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,4x4 ,16 ,99 ,7 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,4x4 ,16 ,99 ,8 ,3.0 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x2 ,0 ,99 ,9 ,3.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/30/15 ,35/40/25 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,19300 ,26500 ,7100 ,17500 ,- ,7100 ,- ,- ,- ,- ,- ,- , +1 ,Tractor ,6x2 ,0 ,99 ,10 ,3.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/10/20 ,20/10/20 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,19300 ,26500 ,12900 ,17500 ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,6x4 ,0 ,99 ,11 ,3.0 ,85 ,B5 ,T2 ,D+ST1 ,Truck.vacc,RigidTrailer ,RigidTrailer ,RigidSolo ,20/22.5/22.5 ,35/35/30 ,35 , ,15/20/10 ,17.5/20/10 ,22.5/32.5 ,22.5/30 ,19300 ,26500 ,7100 ,17500 ,- ,7100 ,7100 ,- ,- ,- ,- ,- ,8.5 +1 ,Tractor ,6x4 ,0 ,99 ,12 ,3.0 ,85 , ,ST1 ,ST1+T2,Truck.vacc,TractorSemitrailer ,RigidTrailer ,TractorSemitrailer ,15/15/15 ,20/15/15 ,55 ,50 ,12.5/15/10 ,15/15/10 ,37.5/25 ,35/25 ,19300 ,26500 ,12900 ,17500 ,- ,- ,12900 ,- ,- ,- ,- ,- ,8.8 +0 ,RigidTruck ,6x6 ,0 ,99 ,13 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,Tractor ,6x6 ,0 ,99 ,14 ,3.0 ,85 , , , ,Truck.vacc, , ,TractorSemitrailer , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x2 ,0 ,99 ,15 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,??? ,- ,- ,- ,- ,- ,- ,- ,- ,- , +1 ,RigidTruck ,8x4 ,0 ,99 ,16 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , ,25/25/25/25 , , , , , , ,- ,- ,- ,- ,- ,- ,12900 ,- ,- ,- ,- ,- , +0 ,RigidTruck ,8x6 ,0 ,99 ,17 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- ,9.0 +0 ,RigidTruck ,8x8 ,0 ,99 ,17 ,3.0 ,85 , , , ,Truck.vacc, , ,RigidSolo , , , , , , , , ,- ,- ,- ,- ,- ,- ,??? ,- ,- ,- ,- ,- , +0 ,CityBus ,4x2 ,0 ,18 ,B1 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,4x2 ,0 ,18 ,B2 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,4x2 ,0 ,18 ,B3 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , +0 ,CityBus ,6x2 ,18 ,99 ,B4 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,??? ,??? ,??? ,- ,- , +0 ,InterurbanBus ,6x2 ,18 ,99 ,B5 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? ,- , +0 ,Coach ,6x2 ,18 ,99 ,B6 ,3.0 ,85 , , , , , , ,CoachBus , , , , , , , , ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,- ,??? , \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 0571a2043364c5b699580bdadf8331923d20de4d..40c21c4f6f8a35cb2155a011a73bad09dd272def 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -419,9 +419,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration null, null), TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 289, "Dual displacement", null, null, null), - TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 255, "Variable displacement mech. controlled", null, null, + TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 255, "Variable displacement mech. controlled", null, + null, null), - TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 204, "Variable displacement elec. controlled", null, null, + TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 204, "Variable displacement elec. controlled", null, + null, null), TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 92.8571, "Electric", null, null, null), TestCase(MissionType.RegionalDelivery, VehicleClass.Class2, 665, "Fixed displacement", "Fixed displacement", null, @@ -465,11 +467,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X2(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x2, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x2, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -482,11 +484,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void SegmentWeightOutOfRange4X4(double weight) { AssertHelper.Exception<VectoException>(() => - DeclarationData.Segments.Lookup( - VehicleCategory.RigidTruck, - AxleConfiguration.AxleConfig_4x4, - weight.SI<Kilogram>(), - 0.SI<Kilogram>()), + DeclarationData.Segments.Lookup( + VehicleCategory.RigidTruck, + AxleConfiguration.AxleConfig_4x4, + weight.SI<Kilogram>(), + 0.SI<Kilogram>()), "Gross vehicle mass must be greater than 7.5 tons"); } @@ -530,6 +532,26 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration Assert.AreEqual(expectedClass, segment.VehicleClass); } + [TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 7500, 0, VehicleClass.Class1, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 10001, 0, VehicleClass.Class2, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 12001, 0, VehicleClass.Class3, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 16001, 0, VehicleClass.Class4, 85), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 16001, 0, VehicleClass.Class5, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 7500, 0, VehicleClass.Class9, 85), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 7500, 0, VehicleClass.Class10, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x4, 7500, 0, VehicleClass.Class11, 85), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x4, 7500, 0, VehicleClass.Class12, 85), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_8x4, 7500, 0, VehicleClass.Class16, 85), + ] + public void SegmentDesignSpeedTest(VehicleCategory category, AxleConfiguration axleConfiguration, double grossWeight, + double curbWeight, VehicleClass expectedClass, double speed) + { + var segment = DeclarationData.Segments.Lookup(category, axleConfiguration, grossWeight.SI<Kilogram>(), + curbWeight.SI<Kilogram>()); + + Assert.AreEqual(speed.KMPHtoMeterPerSecond(), segment.DesignSpeed); + } + [Test, TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 10000, 0, VehicleClass.Class1, 1600, null, TestName = "SegmentLookupBodyWeight Class1 Rigid"), @@ -784,7 +806,6 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration refLoad: 17500, trailerGrossVehicleWeight: new[] { 24000.0, 18000 }, deltaCdA: 0.6, maxLoad: 39600, ems: true); } - /// <summary> /// Segment 9: fixed reference weight, trailer always used /// </summary> @@ -1117,7 +1138,8 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration public void Declaration_WheelsForT2_Class4() { var dataProvider = - JSONInputDataFactory.ReadJsonJob(@"TestData\Jobs\Class4_40t_Long_Haul_Truck.vecto") as IDeclarationInputDataProvider; + JSONInputDataFactory.ReadJsonJob( + @"TestData\Jobs\Class4_40t_Long_Haul_Truck.vecto") as IDeclarationInputDataProvider; var dataReader = new DeclarationModeVectoRunDataFactory(dataProvider, null); var runs = dataReader.NextRun().ToList();