diff --git a/VectoCore/VectoCore/Models/Declaration/Mission.cs b/VectoCore/VectoCore/Models/Declaration/Mission.cs index 307e7b7a71dcc896f52ef0d8a9e8577867a93b77..7df3a8328840c6573bd95e35ff6c5d35fa547e7e 100644 --- a/VectoCore/VectoCore/Models/Declaration/Mission.cs +++ b/VectoCore/VectoCore/Models/Declaration/Mission.cs @@ -80,10 +80,11 @@ namespace TUGraz.VectoCore.Models.Declaration public Kilogram RefLoad; public Kilogram MaxLoad; + public CubicMeter CargoVolume; + public Dictionary<LoadingType, Kilogram> Loadings { - get - { + get { return new Dictionary<LoadingType, Kilogram> { { LoadingType.EmptyLoading, MinLoad }, { LoadingType.ReferenceLoad, RefLoad }, diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index a596eb77b47b9ad4d91a9522b979d6b7486cf704..99495073ea211e1f835cbda37cb8a6b99f7320e1 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -176,6 +176,7 @@ namespace TUGraz.VectoCore.Models.Declaration MaxLoad = maxLoad, RefLoad = refLoad, TrailerAxleWeightDistribution = GetTrailerAxleWeightDistribution(row, missionType), + CargoVolume = body.CargoVolume + trailer.CargoVolume, }; missions.Add(mission); } diff --git a/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs b/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs index d27ba9c3eb414fbf79f87ce28248f365b2255fc5..184bf9cb48a971f2b4cbbf6b1e93c56a9199cb84 100644 --- a/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs +++ b/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs @@ -43,6 +43,7 @@ namespace TUGraz.VectoCore.Models.Declaration public SquareMeter DeltaCrossWindArea; public string Name; public Wheels.Entry Wheels; + public CubicMeter CargoVolume; public Kilogram MaxPayLoad { @@ -50,21 +51,23 @@ namespace TUGraz.VectoCore.Models.Declaration } public StandardBody(string name, Kilogram curbWeight, Kilogram grossVehicleWeight, SquareMeter deltaCrossWindArea, - Wheels.Entry wheels) + Wheels.Entry wheels, CubicMeter volume) { Name = name; CurbWeight = curbWeight; GrossVehicleWeight = grossVehicleWeight; DeltaCrossWindArea = deltaCrossWindArea; Wheels = wheels; + CargoVolume = volume; } + public static StandardBody operator +(StandardBody first, StandardBody second) { return new StandardBody(first.Name + second.Name, first.CurbWeight + second.CurbWeight, first.GrossVehicleWeight + second.GrossVehicleWeight, first.DeltaCrossWindArea + second.DeltaCrossWindArea, - null); + null, first.CargoVolume + second.CargoVolume); } } @@ -80,7 +83,7 @@ namespace TUGraz.VectoCore.Models.Declaration public sealed class StandardBodies : LookupData<string, StandardBody> { public static readonly StandardBody Empty = new StandardBody("", 0.SI<Kilogram>(), 0.SI<Kilogram>(), - 0.SI<SquareMeter>(), null); + 0.SI<SquareMeter>(), null, 0.SI<CubicMeter>()); protected override string ResourceId { @@ -106,7 +109,8 @@ namespace TUGraz.VectoCore.Models.Declaration k.ParseDoubleOrGetDefault("deltacdxafortraileroperationinlonghaul").SI<SquareMeter>(), !string.IsNullOrWhiteSpace(k.Field<string>("wheels")) ? DeclarationData.Wheels.Lookup(k.Field<string>("wheels")) - : null)) + : null, + k.ParseDouble("cargovolume").SI<CubicMeter>())) .ToDictionary(kv => kv.Name); } } diff --git a/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv b/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv index fa08747c07ff1c9d6cae580cfd8b0e04a5d0857d..f48c09b984c9c1a378e1ce74be9b1e8d010a2cf6 100644 --- a/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv +++ b/VectoCore/VectoCore/Resources/Declaration/Body_Trailers_Weights.csv @@ -1,12 +1,12 @@ -name,curb mass,max gross mass,delta CdxA for trailer operation in long haul,Wheels,remark -#,[kg],[kg],[m�],, -B1,1600,-,-,,--- -B2,1900,-,-,,--- -B3,2000,-,-,,--- -B4,2100,-,-,,--- -B5,2200,-,-,,"""B6"" changed to ""B5"" as ""old B5"" not applicable anymore" -T1,3400,10500,0.6,235/75 R17.5, -T2,5400,18000,0.6,385/65 R22.5, -ST1,7500,24000,-,,relevant for fully loaded is GVM of tractor semitrailer combination = 40000kg -ST1-v2,7500,-,-,, -Dolly,2500,-,-,,only relevant for EMS +name,curb mass,max gross mass,delta CdxA for trailer operation in long haul,Wheels,cargo volume,remark +#,[kg],[kg],[m�],,[m�], +B1,1600,-,-,,36.5,--- +B2,1900,-,-,,45.2,--- +B3,2000,-,-,,47.7,--- +B4,2100,-,-,,49.4,--- +B5,2200,-,-,,51.9,"""B6"" changed to ""B5"" as ""old B5"" not applicable anymore" +T1,3400,10500,0.6,235/75 R17.5,39.8, +T2,5400,18000,0.6,385/65 R22.5,49.5, +ST1,7500,24000,-,,91.0,relevant for fully loaded is GVM of tractor semitrailer combination = 40000kg +ST1-v2,7500,-,-,,91.0, +Dolly,2500,-,-,,0.0,only relevant for EMS diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 296e7079ce9462448014d8bc3fdeb75dcc0ea48e..d33a57df2588cd2d36737084550ebb227e33ac24 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -543,6 +543,46 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } } + [Test, + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 7500, 0, VehicleClass.Class1, + new[] { 36.5, 36.5 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 7500, 0, VehicleClass.Class1, new[] { 36.5, 36.5 } + ), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 12000, 0, VehicleClass.Class2, + new[] { 85.0, 45.2, 45.2 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 12000, 0, VehicleClass.Class2, + new[] { 85.0, 45.2, 45.2 }), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 16000, 0, VehicleClass.Class3, + new[] { 47.7, 47.7 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 16000, 0, VehicleClass.Class3, + new[] { 47.7, 47.7 }), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 18000, 0, VehicleClass.Class4, + new[] { 98.9, 49.4, 49.4 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 18000, 0, VehicleClass.Class5, + new[] { 91.0, 91.0 }), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 16000, 0, VehicleClass.Class9, + new[] { 101.4, 51.9, 51.9 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 16000, 0, VehicleClass.Class10, + new[] { 91.0, 91.0 }), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x4, 40000, 0, VehicleClass.Class11, + new[] { 101.4, 51.9, 51.9, 51.9 }), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x4, 99000, 0, VehicleClass.Class12, + new[] { 91.0, 91.0, 91.0, 91.0 }), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_8x4, 99000, 0, VehicleClass.Class16, new[] { 0.0 }) + ] + public void SegmentLookupCargoVolumeTest(VehicleCategory category, AxleConfiguration axleConfiguration, + double grossWeight, + double curbWeight, VehicleClass expectedClass, double[] expectedCargoVolume) + { + var segment = DeclarationData.Segments.Lookup(category, axleConfiguration, grossWeight.SI<Kilogram>(), + curbWeight.SI<Kilogram>()); + Assert.AreEqual(expectedClass, segment.VehicleClass); + Assert.AreEqual(expectedCargoVolume.Length, segment.Missions.Length); + for (var i = 0; i < expectedCargoVolume.Length; i++) { + Assert.AreEqual(expectedCargoVolume[i], segment.Missions[i].CargoVolume.Value()); + } + } + /// <summary> /// trailer in longhaul, always pc formula /// </summary>