Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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

pictures for additional vehicle groups, fix: axleweight distribution for undefined vehicle groups

parent 1cee3b34
Branches
Tags
No related merge requests found
......@@ -42,20 +42,20 @@ Module MainModule
Public Function ConvPicPath(hdVclass As Integer, isLongHaul As Boolean) As Bitmap
Select Case hdVclass
Case 1, 2, 3
Return My.Resources._4x2r ' resourcePath & "4x2r.png"
Case 1, 2, 3, 6, 7
Return My.Resources._4x2r
Case 4
If isLongHaul Then Return My.Resources._4x2rt
Return My.Resources._4x2r 'resourcePath & "4x2r" & longHaulFlag & ".png"
Case 5
Return My.Resources._4x2tt ' resourcePath & "4x2tt.png"
Case 9
Return My.Resources._4x2r
Case 5, 8
Return My.Resources._4x2tt
Case 9, 11, 13
If isLongHaul Then Return My.Resources._6x2rt
Return My.Resources._6x2r ' resourcePath & "6x2r" & longHaulFlag & ".png"
Case 10
Return My.Resources._6x2tt ' resourcePath & "6x2tt.png"
Return My.Resources._6x2r
Case 10, 12, 14
Return My.Resources._6x2tt
Case Else
Return My.Resources.Undef ' resourcePath & "Undef.png"
Return My.Resources.Undef
End Select
End Function
......
......@@ -96,7 +96,7 @@ namespace TUGraz.VectoCore.Models.Declaration
VehicleHeight = LookupHeight(vehicleCategory, axleConfiguration, grossVehicleMassRating),
DesignSpeed = row.ParseDouble("designspeed").KMPHtoMeterPerSecond(),
GrossVehicleMassRating = grossVehicleMassRating,
CdADefault = row.ParseDouble("cdxa_default").SI<SquareMeter>(),
CdADefault = string.IsNullOrEmpty(row["cdxa_default"].ToString()) ? null : row.ParseDouble("cdxa_default").SI<SquareMeter>(),
CdAConstruction = string.IsNullOrEmpty(row["cdxa_construction"].ToString())
? null
: row.ParseDouble("cdxa_construction").SI<SquareMeter>(),
......@@ -282,9 +282,11 @@ namespace TUGraz.VectoCore.Models.Declaration
private static double[] GetAxleWeightDistribution(DataRow row, MissionType missionType)
{
return
row.Field<string>("truckaxles" + GetMissionSuffix(missionType))
.Split('/').ToDouble().Select(x => x / 100.0).ToArray();
var axleDistribution = row.Field<string>("truckaxles" + GetMissionSuffix(missionType));
if (string.IsNullOrWhiteSpace(axleDistribution)) {
return new double[]{};
}
return axleDistribution.Split('/').ToDouble().Select(x => x / 100.0).ToArray();
}
private static string GetMissionSuffix(MissionType missionType, bool ignoreEMS = false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment