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

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

vehicle form: when editing a vehicle in declaration mode, only show axle...

vehicle form: when editing a vehicle in declaration mode, only show axle configurations that are allowed in declaration mode
parent f87760cf
No related branches found
No related tags found
No related merge requests found
...@@ -81,9 +81,17 @@ Public Class VehicleForm ...@@ -81,9 +81,17 @@ Public Class VehicleForm
CbAxleConfig.ValueMember = "Value" CbAxleConfig.ValueMember = "Value"
CbAxleConfig.DisplayMember = "Label" CbAxleConfig.DisplayMember = "Label"
CbAxleConfig.DataSource = [Enum].GetValues(GetType(AxleConfiguration)) _ If (cfg.DeclMode) Then
.Cast(Of AxleConfiguration) _ CbAxleConfig.DataSource = DeclarationData.Segments.GetAxleConfigurations() _
.Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList() .Cast(Of AxleConfiguration) _
.Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList()
else
CbAxleConfig.DataSource = [Enum].GetValues(GetType(AxleConfiguration)) _
.Cast(Of AxleConfiguration) _
.Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList()
End If
CbCat.ValueMember = "Value" CbCat.ValueMember = "Value"
CbCat.DisplayMember = "Label" CbCat.DisplayMember = "Label"
...@@ -477,12 +485,12 @@ Public Class VehicleForm ...@@ -477,12 +485,12 @@ Public Class VehicleForm
Dim a0 As AxleInputData = New AxleInputData() Dim a0 As AxleInputData = New AxleInputData()
a0.AxleWeightShare = entry.SubItems(AxleTbl.RelativeLoad).Text.ToDouble(0) a0.AxleWeightShare = entry.SubItems(AxleTbl.RelativeLoad).Text.ToDouble(0)
a0.TwinTyres = (entry.SubItems(AxleTbl.TwinTyres).Text = "yes") a0.TwinTyres = (entry.SubItems(AxleTbl.TwinTyres).Text = "yes")
a0.AxleType = entry.SubItems(AxleTbl.AxleType).Text.ParseEnum(Of AxleType)() a0.AxleType = entry.SubItems(AxleTbl.AxleType).Text.ParseEnum(Of AxleType)()
dim tyre as TyreInputData = New TyreInputData() dim tyre as TyreInputData = New TyreInputData()
tyre.RollResistanceCoefficient = entry.SubItems(AxleTbl.RRC).Text.ToDouble(0) tyre.RollResistanceCoefficient = entry.SubItems(AxleTbl.RRC).Text.ToDouble(0)
tyre.TyreTestLoad = entry.SubItems(AxleTbl.FzISO).Text.ToDouble(0).SI(Of Newton)() tyre.TyreTestLoad = entry.SubItems(AxleTbl.FzISO).Text.ToDouble(0).SI(Of Newton)()
tyre.Dimension = entry.SubItems(AxleTbl.WheelsDimension).Text tyre.Dimension = entry.SubItems(AxleTbl.WheelsDimension).Text
tyre.Inertia = entry.SubItems(AxleTbl.Inertia).Text.ToDouble(0).SI(Of KilogramSquareMeter)() tyre.Inertia = entry.SubItems(AxleTbl.Inertia).Text.ToDouble(0).SI(Of KilogramSquareMeter)()
a0.Tyre = tyre a0.Tyre = tyre
veh.Axles.Add(a0) veh.Axles.Add(a0)
Next Next
......
...@@ -75,6 +75,12 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -75,6 +75,12 @@ namespace TUGraz.VectoCore.Models.Declaration
return _segmentTable.AsEnumerable().Where(r => !declarationOnly || r.Field<string>("valid") == "1").Select(r => EnumHelper.ParseEnum<VehicleCategory>(r.Field<string>("vehiclecategory"))).Distinct().ToArray(); return _segmentTable.AsEnumerable().Where(r => !declarationOnly || r.Field<string>("valid") == "1").Select(r => EnumHelper.ParseEnum<VehicleCategory>(r.Field<string>("vehiclecategory"))).Distinct().ToArray();
} }
public IEnumerable<AxleConfiguration> GetAxleConfigurations()
{
return _segmentTable.AsEnumerable().Where(row => row.Field<string>("valid") == "1")
.Select(row => AxleConfigurationHelper.Parse(row.Field<string>("axleconf."))).Distinct();
}
public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration, public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration,
Kilogram grossVehicleMassRating, Kilogram curbWeight, bool considerInvalid) Kilogram grossVehicleMassRating, Kilogram curbWeight, bool considerInvalid)
{ {
......
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