Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 88f3bcf5 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added setting of trailertype for mission, added logic for correct trailer type

parent e528504d
No related branches found
No related tags found
No related merge requests found
......@@ -110,8 +110,13 @@ namespace TUGraz.VectoCore.Models.Declaration
foreach (var missionType in missionTypes.Where(m => row.Field<string>(m.ToString()) != "-")) {
var body = DeclarationData.StandardWeights.Lookup(row.Field<string>("body"));
var trailer = ShouldTrailerBeUsed(row, missionType)
? DeclarationData.StandardWeights.Lookup(row.Field<string>("trailer"))
var trailerIsUsed = ShouldTrailerBeUsed(row, missionType);
var trailerField = row.Field<string>("trailer");
var trailerType = trailerIsUsed && !string.IsNullOrWhiteSpace(trailerField)
? trailerField.ParseEnum<TrailerType>()
: TrailerType.None;
var trailer = trailerIsUsed
? DeclarationData.StandardWeights.Lookup(trailerField)
: DeclarationData.StandardWeights.Empty;
var semiTrailerField = row.Field<string>("semitrailer");
......@@ -145,6 +150,7 @@ namespace TUGraz.VectoCore.Models.Declaration
CurbWeight = curbWeight,
BodyCurbWeight = body.CurbWeight,
BodyGrossVehicleWeight = grossVehicleWeight,
TrailerType = trailerType,
TrailerCurbWeight = trailer.CurbWeight,
TrailerGrossVehicleWeight = trailer.GrossVehicleWeight,
DeltaCdA = trailer.DeltaCrossWindArea,
......
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