Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

Merge pull request #582 in VECTO/vecto-sim from...

Merge pull request #582 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:feature/VECTO-637-creation-of-trucks-cl-15-and-17 to develop

* commit '250c3ea6':
  vehicle form: when editing a vehicle in declaration mode, only show axle configurations that are allowed in declaration mode
parents f87760cf 250c3ea6
No related branches found
No related tags found
No related merge requests found
......@@ -81,9 +81,17 @@ Public Class VehicleForm
CbAxleConfig.ValueMember = "Value"
CbAxleConfig.DisplayMember = "Label"
CbAxleConfig.DataSource = [Enum].GetValues(GetType(AxleConfiguration)) _
.Cast(Of AxleConfiguration) _
.Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList()
If (cfg.DeclMode) Then
CbAxleConfig.DataSource = DeclarationData.Segments.GetAxleConfigurations() _
.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.DisplayMember = "Label"
......@@ -477,12 +485,12 @@ Public Class VehicleForm
Dim a0 As AxleInputData = New AxleInputData()
a0.AxleWeightShare = entry.SubItems(AxleTbl.RelativeLoad).Text.ToDouble(0)
a0.TwinTyres = (entry.SubItems(AxleTbl.TwinTyres).Text = "yes")
a0.AxleType = entry.SubItems(AxleTbl.AxleType).Text.ParseEnum(Of AxleType)()
dim tyre as TyreInputData = New TyreInputData()
tyre.RollResistanceCoefficient = entry.SubItems(AxleTbl.RRC).Text.ToDouble(0)
tyre.TyreTestLoad = entry.SubItems(AxleTbl.FzISO).Text.ToDouble(0).SI(Of Newton)()
tyre.Dimension = entry.SubItems(AxleTbl.WheelsDimension).Text
tyre.Inertia = entry.SubItems(AxleTbl.Inertia).Text.ToDouble(0).SI(Of KilogramSquareMeter)()
a0.AxleType = entry.SubItems(AxleTbl.AxleType).Text.ParseEnum(Of AxleType)()
dim tyre as TyreInputData = New TyreInputData()
tyre.RollResistanceCoefficient = entry.SubItems(AxleTbl.RRC).Text.ToDouble(0)
tyre.TyreTestLoad = entry.SubItems(AxleTbl.FzISO).Text.ToDouble(0).SI(Of Newton)()
tyre.Dimension = entry.SubItems(AxleTbl.WheelsDimension).Text
tyre.Inertia = entry.SubItems(AxleTbl.Inertia).Text.ToDouble(0).SI(Of KilogramSquareMeter)()
a0.Tyre = tyre
veh.Axles.Add(a0)
Next
......
......@@ -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();
}
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,
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