Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 44962b0f authored by Michael KRISPER's avatar Michael KRISPER
Browse files

changed PTO Cycle extension from "vdri" to "vptoc" (added new file browser)

parent 42974a58
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ Public Module FileBrowserModule
Public TextFileBrowser As FileBrowser
Public VehicleFileBrowser As FileBrowser
Public DrivingCycleFileBrowser As FileBrowser
Public PTODrivingCycleFileBrowser As FileBrowser
Public FuelConsumptionMapFileBrowser As FileBrowser
Public FullLoadCurveFileBrowser As FileBrowser
......
......@@ -52,7 +52,7 @@ Imports TUGraz.VectoCore.Utils
''' </summary>
''' <remarks></remarks>
Public Class MainForm
Public Class MainForm
Private _jobListView As FileListView
Private _cycleListView As FileListView
......@@ -70,7 +70,7 @@ Public Class MainForm
#Region "SLEEP Control - Prevent sleep while VECTO is running"
Private Declare Function SetThreadExecutionState Lib "kernel32" (esFlags As Long) As Long
Private Declare Function SetThreadExecutionState Lib "kernel32"(esFlags As Long) As Long
Private Shared Sub AllowSleepOff()
#If Not PLATFORM = "x86" Then
......@@ -112,6 +112,7 @@ Public Class MainForm
VehicleFileBrowser = New FileBrowser("vveh")
FuelConsumptionMapFileBrowser = New FileBrowser("vmap")
DrivingCycleFileBrowser = New FileBrowser("vdri")
PTODrivingCycleFileBrowser = New FileBrowser("vptoc")
FullLoadCurveFileBrowser = New FileBrowser("vfld")
EngineFileBrowser = New FileBrowser("veng")
GearboxFileBrowser = New FileBrowser("vgbx")
......@@ -138,6 +139,7 @@ Public Class MainForm
VehicleFileBrowser.Extensions = New String() {"vveh"}
FuelConsumptionMapFileBrowser.Extensions = New String() {"vmap"}
DrivingCycleFileBrowser.Extensions = New String() {"vdri"}
PTODrivingCycleFileBrowser.Extensions = New String() {"vptoc"}
FullLoadCurveFileBrowser.Extensions = New String() {"vfld"}
EngineFileBrowser.Extensions = New String() {"veng"}
GearboxFileBrowser.Extensions = New String() {"vgbx"}
......@@ -161,6 +163,7 @@ Public Class MainForm
VehicleFileBrowser.Close()
FuelConsumptionMapFileBrowser.Close()
DrivingCycleFileBrowser.Close()
PTODrivingCycleFileBrowser.Close()
FullLoadCurveFileBrowser.Close()
EngineFileBrowser.Close()
GearboxFileBrowser.Close()
......@@ -229,8 +232,8 @@ Public Class MainForm
LoadOptions()
'Resize columns ... after Loading the @file-lists
LvGEN.Columns(1).Width = -2
LvMsg.Columns(2).Width = -2
LvGEN.Columns(1).Width = - 2
LvMsg.Columns(2).Width = - 2
'Initialize BackgroundWorker
......@@ -506,7 +509,7 @@ Public Class MainForm
lastindx = LvGEN.SelectedIndices(LvGEN.SelectedItems.Count - 1)
For i = UBound(selIx) To 0 Step -1
For i = UBound(selIx) To 0 Step - 1
LvGEN.Items.RemoveAt(selIx(i))
Next
......@@ -566,7 +569,7 @@ Public Class MainForm
Dim p As Integer
Dim f As Integer
Dim fList As String()
Dim fListDim As Integer = -1
Dim fListDim As Integer = - 1
Dim listViewItem As ListViewItem
'If VECTO runs: Cancel operation (because Mode-change during calculation is not very clever)
......@@ -621,7 +624,7 @@ Public Class MainForm
listViewItem.Selected = True
LvGEN.Items.Add(listViewItem)
listViewItem.EnsureVisible()
lbFound:
lbFound:
Next
LvGEN.EndUpdate()
......@@ -918,7 +921,7 @@ lbFound:
Status("Launching VECTO ...")
JobFileList.Clear()
JobFileList.AddRange(
From listViewItem As ListViewItem In LvGEN.CheckedItems.Cast(Of ListViewItem)()
From listViewItem As ListViewItem In LvGEN.CheckedItems.Cast (Of ListViewItem)()
Select fFileRepl = FileRepl(listViewItem.SubItems(0).Text))
SetOptions()
......@@ -959,8 +962,8 @@ lbFound:
mode = ExecutionMode.Declaration
Else
mode = ExecutionMode.Engineering
Physics.FuelDensity = New SI(Cfg.FuelDens).Kilo.Gramm.Per.Cubic.Dezi.Meter.Cast(Of KilogramPerCubicMeter)()
Physics.AirDensity = New SI(Cfg.AirDensity).Kilo.Gramm.Per.Cubic.Meter.Cast(Of KilogramPerCubicMeter)()
Physics.FuelDensity = New SI(Cfg.FuelDens).Kilo.Gramm.Per.Cubic.Dezi.Meter.Cast (Of KilogramPerCubicMeter)()
Physics.AirDensity = New SI(Cfg.AirDensity).Kilo.Gramm.Per.Cubic.Meter.Cast (Of KilogramPerCubicMeter)()
Physics.CO2PerFuelWeight = Cfg.Co2PerFc
End If
......@@ -1022,10 +1025,10 @@ lbFound:
Dim sumProgress As Double = progress.Sum(Function(pair) pair.Value.Progress)
Dim duration As Double = (DateTime.Now() - start).TotalSeconds
sender.ReportProgress(Convert.ToInt32((sumProgress * 100.0) / progress.Count),
sender.ReportProgress(Convert.ToInt32((sumProgress*100.0)/progress.Count),
New VectoProgress With {.Target = "Status",
.Message = _
String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, sumProgress / progress.Count,
String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, sumProgress/progress.Count,
String.Join(", ", progress.Select(Function(pair) String.Format("{0,4:P}", pair.Value.Progress))))})
Dim justFinished As Dictionary(Of Integer, JobContainer.ProgressEntry) =
......@@ -1049,7 +1052,7 @@ lbFound:
.Message = String.Format("{0,-60} {1,8:P} {2,10:F2}s - {3}",
String.Format("{0} {1} {2}", progressEntry.Value.RunName, progressEntry.Value.CycleName,
progressEntry.Value.RunSuffix),
progressEntry.Value.Progress, progressEntry.Value.ExecTime / 1000.0,
progressEntry.Value.Progress, progressEntry.Value.ExecTime/1000.0,
IIf(progressEntry.Value.Success, "Success", "Aborted"))})
If (Not progressEntry.Value.Success) Then
sender.ReportProgress(100,
......@@ -1339,9 +1342,9 @@ lbFound:
ToolStripProgBarJob.Value = .ProgJobInt
If .ProgOverallStartInt > -1 Then
If .ProgOverallStartInt > - 1 Then
ToolStripProgBarOverall.Value =
CInt(.ProgOverallStartInt + (.PgroOverallEndInt - .ProgOverallStartInt) * .ProgJobInt / 100)
CInt(.ProgOverallStartInt + (.PgroOverallEndInt - .ProgOverallStartInt)*.ProgJobInt/100)
End If
End With
......@@ -1658,7 +1661,7 @@ lbFound:
_mainForm.LvMsg.Items.Insert(RowLim - 4, Space(ColLim - 30) & " " & Space(10) & "*| |*")
End Select
Exit Sub
LbRace:
LbRace:
_pRbAlt = Not _pRbAlt
......@@ -1686,17 +1689,17 @@ LbRace:
Abort()
Exit Sub
End If
_scr += 5 * _diffLvl
_scr += 5*_diffLvl
End If
_scr += _diffLvl
_diffC += 1
'Erhöhe Schwierigkeitsgrad
If _diffC = (_diffLvl + 3) * 4 Then
If _diffC = (_diffLvl + 3)*4 Then
_diffC = 0
_diffLvl += 1
If _diffLvl > 2 And _diffLvl < 7 Then _mainForm.TmProgSec.Interval = 300 - (_diffLvl) * 30
If _diffLvl > 2 And _diffLvl < 7 Then _mainForm.TmProgSec.Interval = 300 - (_diffLvl)*30
_scr += 100
Select Case _diffLvl
Case 3
......@@ -1780,10 +1783,10 @@ LbRace:
_ctrls(RowLim + 1) = 0
_ctrlC += 1
If _ctrlC < _ctrlCl Then Exit Sub
Select Case CInt(Int((_ctrlRnd * Rnd()) + 1))
Select Case CInt(Int((_ctrlRnd*Rnd()) + 1))
Case 1, 2
_ctrlC = 0
x = CInt(Int((7 * Rnd()) + 1))
x = CInt(Int((7*Rnd()) + 1))
_ctrls(RowLim + 1) = x
End Select
End Sub
......@@ -1826,7 +1829,7 @@ LbRace:
s = s.Insert(_ctrls(RowLim + 1) + 1, "X")
End If
Select Case _xPanel - _pnls(RowLim)
Case -1
Case - 1
s = Replace(s, "|", "\")
Case 1
s = Replace(s, "|", "/")
......@@ -1838,15 +1841,15 @@ LbRace:
_pnDirC += 1
If _pnDirC < _pnDirCl Then GoTo Lb1
_pnDirC = 0
Select Case CInt(Int((_pnDirRnd * Rnd()) + 1))
Select Case CInt(Int((_pnDirRnd*Rnd()) + 1))
Case 1
_pnDir = 1
Case 2
_pnDir = -1
_pnDir = - 1
Case Else
_pnDir = 0
End Select
Lb1:
Lb1:
_xPanel += _pnDir
If _xPanel > ColLim Then
_xPanel = ColLim
......@@ -1897,7 +1900,7 @@ Lb1:
Dim builder As StringBuilder = New StringBuilder()
For Each selectedItem As ListViewItem In LvMsg.SelectedItems
builder.AppendLine(String.Join(", ",
selectedItem.SubItems.Cast(Of ListViewItem.ListViewSubItem).Select(
selectedItem.SubItems.Cast (Of ListViewItem.ListViewSubItem).Select(
Function(item) item.Text)))
Next
Clipboard.SetText(builder.ToString())
......
......@@ -867,7 +867,7 @@ Partial Class VehicleForm
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.Text = "PTO Cycle (.vptoc)"
Me.Label16.TextAlign = System.Drawing.ContentAlignment.BottomLeft
'
'tbPTOCycle
......
......@@ -62,31 +62,31 @@ Public Class VehicleForm
CbCdMode.ValueMember = "Value"
CbCdMode.DisplayMember = "Label"
CbCdMode.DataSource = [Enum].GetValues(GetType(CrossWindCorrectionMode)) _
.Cast(Of CrossWindCorrectionMode) _
.Cast (Of CrossWindCorrectionMode) _
.Select(Function(mode) New With {Key .Value = mode, .Label = mode.GetLabel()}).ToList()
CbRtType.ValueMember = "Value"
CbRtType.DisplayMember = "Label"
CbRtType.DataSource = [Enum].GetValues(GetType(RetarderType)) _
.Cast(Of RetarderType) _
.Cast (Of RetarderType) _
.Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList()
CbAxleConfig.ValueMember = "Value"
CbAxleConfig.DisplayMember = "Label"
CbAxleConfig.DataSource = [Enum].GetValues(GetType(AxleConfiguration)) _
.Cast(Of AxleConfiguration) _
.Cast (Of AxleConfiguration) _
.Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList()
CbCat.ValueMember = "Value"
CbCat.DisplayMember = "Label"
CbCat.DataSource = [Enum].GetValues(GetType(VehicleCategory)) _
.Cast(Of VehicleCategory) _
.Cast (Of VehicleCategory) _
.Select(Function(category) New With {Key .Value = category, .label = category.GetLabel()}).ToList()
cbAngledriveType.ValueMember = "Value"
cbAngledriveType.DisplayMember = "Label"
cbAngledriveType.DataSource = [Enum].GetValues(GetType(AngledriveType)) _
.Cast(Of AngledriveType).Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList()
.Cast (Of AngledriveType).Select(Function(type) New With {Key .Value = type, .Label = type.GetLabel()}).ToList()
_axlDlog = New VehicleAxleDialog
cbPTOType.ValueMember = "Value"
......@@ -108,12 +108,12 @@ Public Class VehicleForm
End If
Dim vehC As VehicleCategory = CType(CbCat.SelectedValue, VehicleCategory)
Dim axlC As AxleConfiguration = CType(CbAxleConfig.SelectedValue, AxleConfiguration)
Dim maxMass As Kilogram = (TbMassMass.Text.ToDouble() * 1000).SI(Of Kilogram)()
Dim maxMass As Kilogram = (TbMassMass.Text.ToDouble()*1000).SI (Of Kilogram)()
_hdVclass = "-"
Dim s0 As Segment = Nothing
Try
s0 = DeclarationData.Segments.Lookup(vehC, axlC, maxMass, 0.SI(Of Kilogram), True)
s0 = DeclarationData.Segments.Lookup(vehC, axlC, maxMass, 0.SI (Of Kilogram), True)
Catch
' no segment found - ignore
......@@ -124,7 +124,7 @@ Public Class VehicleForm
TbHDVclass.Text = _hdVclass
PicVehicle.Image = ConvPicPath(If(s0 Is Nothing, -1, _hdVclass.ToInt()), False)
PicVehicle.Image = ConvPicPath(If(s0 Is Nothing, - 1, _hdVclass.ToInt()), False)
End Sub
......@@ -138,11 +138,11 @@ Public Class VehicleForm
End If
Dim vehC As VehicleCategory = CType(CbCat.SelectedValue, VehicleCategory)
Dim axlC As AxleConfiguration = CType(CbAxleConfig.SelectedValue, AxleConfiguration)
Dim maxMass As Kilogram = (TbMassMass.Text.ToDouble() * 1000).SI(Of Kilogram)()
Dim maxMass As Kilogram = (TbMassMass.Text.ToDouble()*1000).SI (Of Kilogram)()
Dim s0 As Segment = Nothing
Try
s0 = DeclarationData.Segments.Lookup(vehC, axlC, maxMass, 0.SI(Of Kilogram), True)
s0 = DeclarationData.Segments.Lookup(vehC, axlC, maxMass, 0.SI (Of Kilogram), True)
Catch
' no segment found - ignore
End Try
......@@ -176,7 +176,7 @@ Public Class VehicleForm
TbCdFile.Text = ""
Dim rdyn As Double
rdyn = -1
rdyn = - 1
If rdyn < 0 Then
TBrdyn.Text = "-"
......@@ -321,7 +321,7 @@ Public Class VehicleForm
If ChangeCheckCancel() Then Exit Sub
Dim inputData As IEngineeringInputDataProvider = TryCast(JSONInputDataFactory.ReadComponentData(file),
Dim inputData As IEngineeringInputDataProvider = TryCast(JSONInputDataFactory.ReadComponentData(file),
IEngineeringInputDataProvider)
Dim vehicle As IVehicleEngineeringInputData = inputData.VehicleInputData
Dim retarder As IRetarderInputData = inputData.RetarderInputData
......@@ -334,7 +334,7 @@ Public Class VehicleForm
Close()
MainForm.RbDecl.Checked = Not MainForm.RbDecl.Checked
MainForm.OpenVectoFile(file)
Case -1
Case - 1
Exit Sub
End Select
End If
......@@ -342,12 +342,12 @@ Public Class VehicleForm
Dim basePath As String = Path.GetDirectoryName(file)
CbCat.SelectedValue = vehicle.VehicleCategory
CbAxleConfig.SelectedValue = vehicle.AxleConfiguration
TbMassMass.Text = (vehicle.GrossVehicleMassRating.Value() / 1000).ToGUIFormat()
TbMassMass.Text = (vehicle.GrossVehicleMassRating.Value()/1000).ToGUIFormat()
TbMass.Text = vehicle.CurbWeightChassis.ToGUIFormat()
TbMassExtra.Text = vehicle.CurbWeightExtra.ToGUIFormat()
TbLoad.Text = vehicle.Loading.ToGUIFormat()
TBrdyn.Text = (vehicle.DynamicTyreRadius.Value() * 1000).ToGUIFormat()
TBrdyn.Text = (vehicle.DynamicTyreRadius.Value()*1000).ToGUIFormat()
CbCdMode.SelectedValue = vehicle.CrossWindCorrectionMode
TbCdFile.Text =
......@@ -649,7 +649,7 @@ Public Class VehicleForm
Private Sub SetMaxLoad()
If Not Cfg.DeclMode Then
If IsNumeric(TbMass.Text) And IsNumeric(TbMassExtra.Text) And IsNumeric(TbMassMass.Text) Then
TbLoadingMax.Text = CStr(CSng(TbMassMass.Text) * 1000 - CSng(TbMass.Text) - CSng(TbMassExtra.Text))
TbLoadingMax.Text = CStr(CSng(TbMassMass.Text)*1000 - CSng(TbMass.Text) - CSng(TbMassExtra.Text))
Else
TbLoadingMax.Text = ""
End If
......@@ -822,8 +822,8 @@ Public Class VehicleForm
End Sub
Private Sub btPTOCycle_Click(sender As Object, e As EventArgs) Handles btPTOCycle.Click
If DrivingCycleFileBrowser.OpenDialog(FileRepl(tbPTOCycle.Text, GetPath(_vehFile))) Then
tbPTOCycle.Text = GetFilenameWithoutDirectory(DrivingCycleFileBrowser.Files(0), GetPath(_vehFile))
If PTODrivingCycleFileBrowser.OpenDialog(FileRepl(tbPTOCycle.Text, GetPath(_vehFile))) Then
tbPTOCycle.Text = GetFilenameWithoutDirectory(PTODrivingCycleFileBrowser.Files(0), GetPath(_vehFile))
End If
End Sub
End Class
......
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