diff --git a/VECTO/GUI/GearboxForm.vb b/VECTO/GUI/GearboxForm.vb index 74aca6f0da5c811eadac8059ff06fec88b7a8b7f..4bfdc0635d726dd97b226469313048165831ea7d 100644 --- a/VECTO/GUI/GearboxForm.vb +++ b/VECTO/GUI/GearboxForm.vb @@ -81,17 +81,54 @@ Public Class GearboxForm CbGStype.ValueMember = "Value" CbGStype.DisplayMember = "Label" - CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ - .Cast(Of GearboxType)() _ - .Where(Function(type) type.ManualTransmission() OrElse type.AutomaticTransmission() OrElse type = GearboxType.IHPC OrElse type = GearboxType.IEPC) _ - .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + ' CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + ' .Cast(Of GearboxType)() _ + ' .Where(Function(type) type.ManualTransmission() OrElse type.AutomaticTransmission() OrElse type = GearboxType.IHPC OrElse type = GearboxType.IEPC) _ + ' .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + SetupTransmissionTypes() DeclInit() _changed = False NewGbx() End Sub + private sub SetupTransmissionTypes() + Select case VectoJobForm.JobType + Case VectoSimulationJobType.ConventionalVehicle + CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + .Cast(Of GearboxType)() _ + .Where(Function(type) Not type = GearboxType.APTN And (type.ManualTransmission() OrElse type = GearboxType.ATSerial)) _ + .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + + Case VectoSimulationJobType.IHPC + CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + .Cast(Of GearboxType)() _ + .Where(Function(type) type = GearboxType.IHPC ) _ + .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + + Case VectoSimulationJobType.IEPC_E,VectoSimulationJobType.IEPC_S + CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + .Cast(Of GearboxType)() _ + .Where(Function(type) type = GearboxType.IEPC) _ + .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + + Case VectoSimulationJobType.ParallelHybridVehicle, VectoSimulationJobType.SerialHybridVehicle + CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + .Cast(Of GearboxType)() _ + .Where(Function(type) type.ManualTransmission() OrElse type.AutomaticTransmission() and not type = GearboxType.IHPC ) _ + .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + + Case Else + CbGStype.DataSource = [Enum].GetValues(GetType(GearboxType)) _ + .Cast(Of GearboxType)() _ + .Where(Function(type) type.ManualTransmission() OrElse type.AutomaticTransmission() OrElse type = GearboxType.IHPC OrElse type = GearboxType.IEPC) _ + .Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList() + + End Select + + End sub + 'Set generic values for Declaration mode. Private Sub DeclInit() Dim gbxType As GearboxType diff --git a/VECTO/GUI/IEPCForm.vb b/VECTO/GUI/IEPCForm.vb index e68ed1cb681b0a7e504938471487b3c05a9508ff..2d923213a8e4276c9dd3485b0a4fdacebb686ff7 100644 --- a/VECTO/GUI/IEPCForm.vb +++ b/VECTO/GUI/IEPCForm.vb @@ -848,5 +848,5 @@ Public Class IEPCForm Else MsgBox("File not found!") End If - End Subs + End Sub End Class \ No newline at end of file