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

GUI: Corrected Errors saving and reading the PTOCycle / PTOLossMap

parent 6cec041a
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,9 @@ Partial Class F_VEH
Me.PnAll = New System.Windows.Forms.Panel()
Me.gbPTO = New System.Windows.Forms.GroupBox()
Me.pnPTO = New System.Windows.Forms.Panel()
Me.btPTOCycle = New System.Windows.Forms.Button()
Me.Label16 = New System.Windows.Forms.Label()
Me.tbPTOCycle = New System.Windows.Forms.TextBox()
Me.btPTOLossMapBrowse = New System.Windows.Forms.Button()
Me.Label7 = New System.Windows.Forms.Label()
Me.tbPTOLossMap = New System.Windows.Forms.TextBox()
......@@ -831,10 +834,13 @@ Partial Class F_VEH
Me.gbPTO.Size = New System.Drawing.Size(564, 86)
Me.gbPTO.TabIndex = 4
Me.gbPTO.TabStop = False
Me.gbPTO.Text = "PTO Transmission"
Me.gbPTO.Text = "PTO Consumer"
'
'pnPTO
'
Me.pnPTO.Controls.Add(Me.btPTOCycle)
Me.pnPTO.Controls.Add(Me.Label16)
Me.pnPTO.Controls.Add(Me.tbPTOCycle)
Me.pnPTO.Controls.Add(Me.btPTOLossMapBrowse)
Me.pnPTO.Controls.Add(Me.Label7)
Me.pnPTO.Controls.Add(Me.tbPTOLossMap)
......@@ -844,11 +850,40 @@ Partial Class F_VEH
Me.pnPTO.Size = New System.Drawing.Size(558, 41)
Me.pnPTO.TabIndex = 4
'
'btPTOCycle
'
Me.btPTOCycle.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btPTOCycle.Image = Global.VECTO.My.Resources.Resources.Open_icon
Me.btPTOCycle.Location = New System.Drawing.Point(529, 16)
Me.btPTOCycle.Name = "btPTOCycle"
Me.btPTOCycle.Size = New System.Drawing.Size(24, 24)
Me.btPTOCycle.TabIndex = 17
Me.btPTOCycle.UseVisualStyleBackColor = True
'
'Label16
'
Me.Label16.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.Label16.Location = New System.Drawing.Point(287, -1)
Me.Label16.Name = "Label16"
Me.Label16.Size = New System.Drawing.Size(201, 16)
Me.Label16.TabIndex = 18
Me.Label16.Text = "PTO Cycle (.vdri)"
Me.Label16.TextAlign = System.Drawing.ContentAlignment.BottomLeft
'
'tbPTOCycle
'
Me.tbPTOCycle.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.tbPTOCycle.Location = New System.Drawing.Point(290, 18)
Me.tbPTOCycle.Name = "tbPTOCycle"
Me.tbPTOCycle.Size = New System.Drawing.Size(239, 20)
Me.tbPTOCycle.TabIndex = 16
Me.ToolTip1.SetToolTip(Me.tbPTOCycle, "PTO Consumer Loss Map")
'
'btPTOLossMapBrowse
'
Me.btPTOLossMapBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btPTOLossMapBrowse.Image = Global.VECTO.My.Resources.Resources.Open_icon
Me.btPTOLossMapBrowse.Location = New System.Drawing.Point(529, 15)
Me.btPTOLossMapBrowse.Location = New System.Drawing.Point(245, 16)
Me.btPTOLossMapBrowse.Name = "btPTOLossMapBrowse"
Me.btPTOLossMapBrowse.Size = New System.Drawing.Size(24, 24)
Me.btPTOLossMapBrowse.TabIndex = 14
......@@ -869,7 +904,7 @@ Partial Class F_VEH
Me.tbPTOLossMap.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.tbPTOLossMap.Location = New System.Drawing.Point(6, 18)
Me.tbPTOLossMap.Name = "tbPTOLossMap"
Me.tbPTOLossMap.Size = New System.Drawing.Size(523, 20)
Me.tbPTOLossMap.Size = New System.Drawing.Size(239, 20)
Me.tbPTOLossMap.TabIndex = 13
Me.ToolTip1.SetToolTip(Me.tbPTOLossMap, "PTO Consumer Loss Map")
'
......@@ -928,7 +963,7 @@ Partial Class F_VEH
'
'Label12
'
Me.Label12.Location = New System.Drawing.Point(6, 24)
Me.Label12.Location = New System.Drawing.Point(6, 23)
Me.Label12.Name = "Label12"
Me.Label12.Size = New System.Drawing.Size(263, 16)
Me.Label12.TabIndex = 17
......@@ -1154,4 +1189,7 @@ Partial Class F_VEH
Friend WithEvents btPTOLossMapBrowse As System.Windows.Forms.Button
Friend WithEvents cbPTOType As System.Windows.Forms.ComboBox
Friend WithEvents pnPTO As System.Windows.Forms.Panel
Friend WithEvents btPTOCycle As System.Windows.Forms.Button
Friend WithEvents Label16 As System.Windows.Forms.Label
Friend WithEvents tbPTOCycle As System.Windows.Forms.TextBox
End Class
......@@ -59,11 +59,10 @@ Public Class F_VEH
Dim vehC = CType(CbCat.SelectedIndex, tVehCat)
Dim axlC = CType(CbAxleConfig.SelectedIndex, tAxleConf)
Dim maxMass = CSng(fTextboxToNumString(TbMassMass.Text))
Dim s0 As cSegmentTableEntry = Declaration.SegmentTable.SetRef(vehC, axlC, maxMass)
Dim segmentEntry As cSegmentTableEntry = Declaration.SegmentTable.SetRef(vehC, axlC, maxMass)
_hdVclass = "-"
If Not s0 Is Nothing Then
_hdVclass = s0.HDVclass
If Not segmentEntry Is Nothing Then
_hdVclass = segmentEntry.HDVclass
End If
TbHDVclass.Text = _hdVclass
......@@ -338,6 +337,7 @@ Public Class F_VEH
cbPTOType.SelectedIndex = CType(veh.PTOType, Integer)
tbPTOLossMap.Text = veh.PTOLossMap.OriginalPath
tbPTOCycle.Text = veh.PTOCycle.OriginalPath
DeclInit()
......@@ -406,6 +406,7 @@ Public Class F_VEH
veh.PTOType = CType(cbPTOType.SelectedIndex, tPTOType)
veh.PTOLossMap.Init(fPATH(file), tbPTOLossMap.Text)
veh.PTOCycle.Init(fPATH(file), tbPTOCycle.Text)
If Not Cfg.DeclMode AndAlso Math.Abs(axleShareCheck - 1) > 0.000001 Then
MsgBox("Relative axle loads must sum up to 1.0. Current value: " & axleShareCheck, MsgBoxStyle.Critical)
......@@ -780,5 +781,11 @@ Public Class F_VEH
tbPTOLossMap.Text = fFileWoDir(fbPTOLM.Files(0), fPATH(_vehFile))
End If
End Sub
Private Sub btPTOCycle_Click(sender As Object, e As EventArgs) Handles btPTOCycle.Click
If fbDRI.OpenDialog(fFileRepl(tbPTOCycle.Text, fPATH(_vehFile))) Then
tbPTOCycle.Text = fFileWoDir(fbDRI.Files(0), fPATH(_vehFile))
End If
End Sub
End Class
......@@ -64,6 +64,7 @@ Public Class cVEH
Public PTOType As tPTOType
Public PTOLossMap As cSubPath
Public PTOCycle As cSubPath
Public Class cAxle
Public RRC As Single
......@@ -108,6 +109,7 @@ Public Class cVEH
RtM = New List(Of Single)
Axles = New List(Of cAxle)
PTOLossMap = New cSubPath()
PTOCycle = New cSubPath()
SetDefault()
End Sub
......@@ -139,6 +141,7 @@ Public Class cVEH
PTOType = tPTOType.None
PTOLossMap.Clear()
PTOCycle.Clear()
Axles.Clear()
VehCat = tVehCat.Undef
......@@ -283,8 +286,10 @@ Public Class cVEH
If Not PTOType = tPTOType.None Then
PTOLossMap.Init(MyPath, body("PTO")("LossMap"))
PTOCycle.Init(MyPath, body("PTO")("Cycle"))
End If
Catch ex As Exception
If showMsg Then WorkerMsg(tMsgID.Err, "Failed to read Vehicle file! " & ex.Message, msgSrc)
Return False
......@@ -328,7 +333,8 @@ Public Class cVEH
{"LossMap", AngularGearLossMapFile.PathOrDummy}}},
{"PTO", New Dictionary(Of String, Object) From {
{"Type", GetPTOString(PTOType)},
{"LossMap", PTOLossMap.PathOrDummy}}},
{"LossMap", PTOLossMap.PathOrDummy},
{"Cycle", PTOCycle.PathOrDummy}}},
{"AxleConfig", New Dictionary(Of String, Object) From {
{"Type", ConvAxleConf(AxleConf)},
{"Axles", (From axle In Axles Select New Dictionary(Of String, Object) From {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment