diff --git a/VECTO/GUI/VehicleForm.Designer.vb b/VECTO/GUI/VehicleForm.Designer.vb index cf507acce3165bd9030c73ba99ccfd10fa8386cb..f993c58c7b5ef883ac442136e1247c02e50de55b 100644 --- a/VECTO/GUI/VehicleForm.Designer.vb +++ b/VECTO/GUI/VehicleForm.Designer.vb @@ -228,7 +228,7 @@ Partial Class VehicleForm Me.gbPTO = New System.Windows.Forms.GroupBox() Me.pnPTO = New System.Windows.Forms.FlowLayoutPanel() Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.ComboBox1 = New System.Windows.Forms.ComboBox() + Me.cbPTOStandstillCycleType = New System.Windows.Forms.ComboBox() Me.gbPTOICEGroupBox = New System.Windows.Forms.GroupBox() Me.pnPtoMode3 = New System.Windows.Forms.GroupBox() Me.btPTOCycleDrive = New System.Windows.Forms.Button() @@ -2373,7 +2373,7 @@ Partial Class VehicleForm ' 'GroupBox2 ' - Me.GroupBox2.Controls.Add(Me.ComboBox1) + Me.GroupBox2.Controls.Add(Me.cbPTOStandstillCycleType) Me.GroupBox2.Location = New System.Drawing.Point(4, 3) Me.GroupBox2.Margin = New System.Windows.Forms.Padding(4, 3, 4, 3) Me.GroupBox2.Name = "GroupBox2" @@ -2383,15 +2383,16 @@ Partial Class VehicleForm Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Stand still PTO cycle type" ' - 'ComboBox1 + 'cbPTOStandstillCycleType ' - Me.ComboBox1.Dock = System.Windows.Forms.DockStyle.Fill - Me.ComboBox1.FormattingEnabled = True - Me.ComboBox1.Location = New System.Drawing.Point(4, 20) - Me.ComboBox1.Margin = New System.Windows.Forms.Padding(4, 3, 4, 3) - Me.ComboBox1.Name = "ComboBox1" - Me.ComboBox1.Size = New System.Drawing.Size(548, 23) - Me.ComboBox1.TabIndex = 3 + Me.cbPTOStandstillCycleType.Dock = System.Windows.Forms.DockStyle.Fill + Me.cbPTOStandstillCycleType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cbPTOStandstillCycleType.FormattingEnabled = True + Me.cbPTOStandstillCycleType.Location = New System.Drawing.Point(4, 20) + Me.cbPTOStandstillCycleType.Margin = New System.Windows.Forms.Padding(4, 3, 4, 3) + Me.cbPTOStandstillCycleType.Name = "cbPTOStandstillCycleType" + Me.cbPTOStandstillCycleType.Size = New System.Drawing.Size(548, 23) + Me.cbPTOStandstillCycleType.TabIndex = 3 ' 'gbPTOICEGroupBox ' @@ -2991,5 +2992,6 @@ Partial Class VehicleForm Friend WithEvents GroupBox5 As GroupBox Friend WithEvents tbPTOElectricCycle As TextBox Friend WithEvents gbPTOICEGroupBox As GroupBox + Friend WithEvents cbPTOStandstillCycleType As ComboBox '>>>>>>> VECTO_CERT/master End Class diff --git a/VECTO/GUI/VehicleForm.vb b/VECTO/GUI/VehicleForm.vb index ab0c5fa2bc41ee12bdbc9671a50dfc76de684273..58ff65e73d9d1041015487584d9e5867c82329c8 100644 --- a/VECTO/GUI/VehicleForm.vb +++ b/VECTO/GUI/VehicleForm.vb @@ -53,6 +53,11 @@ Public Class VehicleForm StringId = 2 End Enum + Private Enum PTOStandStillType + Mechanical = 0 + Electrical = 1 + End Enum + Private _axlDlog As VehicleAxleDialog Private _hdVclass As VehicleClass @@ -132,6 +137,9 @@ Public Class VehicleForm cbPTOType.DataSource = DeclarationData.PTOTransmission.GetTechnologies.Select( Function(technology) New With {.Key = technology, .Value = technology}).ToList() + cbPTOStandstillCycleType.DataSource = + EnumHelper.GetValues(Of PTOStandStillType) + cbPTOStandstillCycleType.SelectedIndex = -1 cbLegislativeClass.DataSource = EnumHelper.GetKeyValuePairs(Of LegislativeClass)(Function(t) t.GetLabel()) @@ -458,6 +466,8 @@ Public Class VehicleForm tbVehicleHeight.Text = If(vehicle.Height Is Nothing, "", vehicle.Height.ToGUIFormat()) cbPTOType.SelectedValue = pto.PTOTransmissionType + + tbPTOLossMap.Text = If(Cfg.DeclMode OrElse pto.PTOLossMap Is Nothing, "", GetRelativePath(pto.PTOLossMap.Source, basePath)) tbPTOCycle.Text = If(Cfg.DeclMode OrElse pto.PTOCycleDuringStop Is Nothing, "", GetRelativePath(pto.PTOCycleDuringStop.Source, basePath)) @@ -1347,6 +1357,7 @@ Public Class VehicleForm pnPTO.Enabled = False gbPTODrive.Enabled = False tbPTOLossMap.Text = "" + cbPTOStandstillCycleType.SelectedIndex = -1 Else pnPTO.Enabled = True gbPTODrive.Enabled = True @@ -1767,5 +1778,19 @@ Public Class VehicleForm End If End Sub + Private Sub cbPTOStandstillCycleType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbPTOStandstillCycleType.SelectedIndexChanged + Dim cb = TryCast(sender, ComboBox) + If ((cb Is Nothing) Or (cb.SelectedIndex = -1)) Then + Return + End If + Dim val = CType(cb.SelectedValue, PTOStandStillType) + If (val = PTOStandStillType.Electrical) Then + gbPTOICEGroupBox.Enabled = False + gbEPTO.Enabled = True + Else + gbPTOICEGroupBox.Enabled = True + gbEPTO.Enabled = False + End If + End Sub End Class \ No newline at end of file