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 fc27dbd2 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

VehicleForm: Solved Problem of Binding for Tabs of EM and GENSet by setting...

VehicleForm: Solved Problem of Binding for Tabs of EM and GENSet by setting the BindingContext again
parent 75b20a8b
Branches
Tags
No related merge requests found
...@@ -461,8 +461,8 @@ Public Class VehicleForm ...@@ -461,8 +461,8 @@ Public Class VehicleForm
tbEmADCLossMap.Text = If(em.MechanicalTransmissionLossMap Is Nothing, em.MechanicalTransmissionEfficiency.ToGUIFormat(), tbEmADCLossMap.Text = If(em.MechanicalTransmissionLossMap Is Nothing, em.MechanicalTransmissionEfficiency.ToGUIFormat(),
GetRelativePath(em.MechanicalTransmissionLossMap.Source, basePath)) GetRelativePath(em.MechanicalTransmissionLossMap.Source, basePath))
tbRatioEm.Text = em.RatioADC.ToGUIFormat() tbRatioEm.Text = em.RatioADC.ToGUIFormat()
cbEmPos.SelectedValue = em.Position cbEmPos.SelectedValue = em.Position
UpdateRetarderPosition(em.Position)
If (em.Position = PowertrainPosition.HybridP2_5) AndAlso Not em.RatioPerGear Is Nothing Then If (em.Position = PowertrainPosition.HybridP2_5) AndAlso Not em.RatioPerGear Is Nothing Then
lvRatioPerGear.Items.Clear() lvRatioPerGear.Items.Clear()
...@@ -545,6 +545,7 @@ Public Class VehicleForm ...@@ -545,6 +545,7 @@ Public Class VehicleForm
cbEcoRoll.Enabled = True cbEcoRoll.Enabled = True
If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then
tcVehicleComponents.TabPages.Insert(2, tpElectricComponents) tcVehicleComponents.TabPages.Insert(2, tpElectricComponents)
tpElectricComponents.BindingContext = BindingContext
End If End If
Case VectoSimulationJobType.SerialHybridVehicle Case VectoSimulationJobType.SerialHybridVehicle
gbRetarderLosses.Enabled = False gbRetarderLosses.Enabled = False
...@@ -559,6 +560,7 @@ Public Class VehicleForm ...@@ -559,6 +560,7 @@ Public Class VehicleForm
gbEMTorqueLimits.Enabled = False gbEMTorqueLimits.Enabled = False
If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then
tcVehicleComponents.TabPages.Insert(2, tpElectricComponents) tcVehicleComponents.TabPages.Insert(2, tpElectricComponents)
tpElectricComponents.BindingContext = BindingContext
End If End If
If Not tcVehicleComponents.TabPages.Contains(tpGensetComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpGensetComponents) Then
tcVehicleComponents.TabPages.Insert(3, tpGensetComponents) tcVehicleComponents.TabPages.Insert(3, tpGensetComponents)
...@@ -579,13 +581,16 @@ Public Class VehicleForm ...@@ -579,13 +581,16 @@ Public Class VehicleForm
gbEMTorqueLimits.Enabled = False gbEMTorqueLimits.Enabled = False
If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then
tcVehicleComponents.TabPages.Insert(2, tpElectricComponents) tcVehicleComponents.TabPages.Insert(2, tpElectricComponents)
tpElectricComponents.BindingContext = BindingContext
End If End If
Case Else Case Else
If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpElectricComponents) Then
tcVehicleComponents.TabPages.Insert(2, tpElectricComponents) tcVehicleComponents.TabPages.Insert(2, tpElectricComponents)
tpElectricComponents.BindingContext = BindingContext
End If End If
If Not tcVehicleComponents.TabPages.Contains(tpGensetComponents) Then If Not tcVehicleComponents.TabPages.Contains(tpGensetComponents) Then
tcVehicleComponents.TabPages.Insert(3, tpGensetComponents) tcVehicleComponents.TabPages.Insert(3, tpGensetComponents)
tpGensetComponents.BindingContext = BindingContext
End If End If
End Select End Select
...@@ -1235,20 +1240,15 @@ Public Class VehicleForm ...@@ -1235,20 +1240,15 @@ Public Class VehicleForm
Private Sub cbEmPos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbEmPos.SelectedIndexChanged Private Sub cbEmPos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbEmPos.SelectedIndexChanged
gbRatiosPerGear.Enabled = PowertrainPosition.HybridP2_5.Equals(cbEmPos.SelectedValue) gbRatiosPerGear.Enabled = PowertrainPosition.HybridP2_5.Equals(cbEmPos.SelectedValue)
UpdateRetarderPosition(CType(cbEmPos.SelectedValue, PowertrainPosition))
End Sub
Private Sub UpdateRetarderPosition(pos As PowertrainPosition)
Dim selectedValue = CbRtType.SelectedValue Dim selectedValue = CbRtType.SelectedValue
If PowertrainPosition.BatteryElectricE4.Equals(pos) OrElse PowertrainPosition.BatteryElectricE2.Equals(pos) Then If PowertrainPosition.BatteryElectricE4.Equals(cbEmPos.SelectedValue) OrElse PowertrainPosition.BatteryElectricE2.Equals(cbEmPos.SelectedValue) Then
gbRetarderLosses.Enabled = False gbRetarderLosses.Enabled = False
TbRtRatio.Text = "" TbRtRatio.Text = ""
TbRtPath.Text = "" TbRtPath.Text = ""
CbRtType.SelectedIndex = 0 CbRtType.SelectedIndex = 0
CType(CbRtType.DataSource, DataView).RowFilter = $"Key <> {CInt(RetarderType.AxlegearInputRetarder)}" CType(CbRtType.DataSource, DataView).RowFilter = $"Key <> {CInt(RetarderType.AxlegearInputRetarder)}"
ElseIf PowertrainPosition.BatteryElectricE3.Equals(pos) Then ElseIf PowertrainPosition.BatteryElectricE3.Equals(cbEmPos.SelectedValue) Then
gbRetarderLosses.Enabled = True gbRetarderLosses.Enabled = True
CType(CbRtType.DataSource, DataView).RowFilter = $"Key in ({CInt(RetarderType.None)}, {CInt(RetarderType.AxlegearInputRetarder)})" CType(CbRtType.DataSource, DataView).RowFilter = $"Key in ({CInt(RetarderType.None)}, {CInt(RetarderType.AxlegearInputRetarder)})"
Else Else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment