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

Skip to content
Snippets Groups Projects
Commit 7bd38bab authored by Raphael LUZ's avatar Raphael LUZ
Browse files

- Cleaning speed profile for very small values. (Caused shifting back to first...

- Cleaning speed profile for very small values. (Caused shifting back to first gear when decelerating.)
- DEV Option for advanced CSV format output (units line, additional info)
parent 30c262fa
No related branches found
No related tags found
No related merge requests found
......@@ -694,6 +694,11 @@ lbEr:
If AuxDef Then AuxComponents = hzAuxValues
tDim = Values(tDriComp.V).Count - 1
For i = 0 To tDim
If Values(tDriComp.V)(i) < 0.5 Then Values(tDriComp.V)(i) = 0
Next
Return True
End Function
......
......@@ -446,6 +446,7 @@ Public Class cMOD
Dim f As cFile_V3
Dim s As System.Text.StringBuilder
Dim su As System.Text.StringBuilder
Dim t As Integer
Dim t1 As Integer
......@@ -459,6 +460,8 @@ Public Class cMOD
Dim AuxList As New List(Of String)
Dim HeaderList As New List(Of String())
Dim Gear As Integer
MsgSrc = "MOD/Output"
......@@ -496,56 +499,99 @@ Public Class cMOD
Next
'f.WriteLine("VECTO modal results")
'f.WriteLine("VECTO " & VECTOvers)
'f.WriteLine(Now.ToString)
'f.WriteLine("Input File: " & JobFile)
If DEV.AdvFormat Then
f.WriteLine("VECTO " & VECTOvers)
f.WriteLine(Now.ToString)
f.WriteLine("Input File: " & JobFile)
End If
'***********************************************************************************************
'***********************************************************************************************
'***********************************************************************************************
'*** Header & Units ****************************************************************************
s.Length = 0
s.Append("time [s]")
If Not VEC.EngOnly Then
HeaderList.Add(New String() {"time", "s"})
s.Append(",dist [m],v_act [km/h],v_targ [km/h],acc [m/s^2],grad [%]")
If Not VEC.EngOnly Then
HeaderList.Add(New String() {"dist", "m"})
HeaderList.Add(New String() {"v_act", "km/h"})
HeaderList.Add(New String() {"v_targ", "km/h"})
HeaderList.Add(New String() {"acc", "m/s²"})
HeaderList.Add(New String() {"grad", "%"})
dist = 0
End If
s.Append(",n [1/min],Tq_eng [Nm],Tq_clutch [Nm],Tq_full [Nm],Tq_drag [Nm],Pe_eng [kW],Pe_full [kW],Pe_drag [kW],Pe_clutch [kW],Pa Eng [kW],Paux [kW]")
HeaderList.Add(New String() {"n", "1/min"})
HeaderList.Add(New String() {"Tq_eng", "Nm"})
HeaderList.Add(New String() {"Tq_clutch", "Nm"})
HeaderList.Add(New String() {"Tq_full", "Nm"})
HeaderList.Add(New String() {"Tq_drag", "Nm"})
HeaderList.Add(New String() {"Pe_eng", "kW"})
HeaderList.Add(New String() {"Pe_full", "kW"})
HeaderList.Add(New String() {"Pe_drag", "kW"})
HeaderList.Add(New String() {"Pe_clutch", "kW"})
HeaderList.Add(New String() {"Pa", "Eng", "kW"})
HeaderList.Add(New String() {"Paux", "kW"})
If Not VEC.EngOnly Then
s.Append(",Gear [-],Ploss GB [kW],Ploss Diff [kW],Ploss Retarder [kW],Pa GB [kW],Pa Veh [kW],Proll [kW],Pair [kW],Pgrad [kW],Pwheel [kW],Pbrake [kW]")
HeaderList.Add(New String() {"Gear", "-"})
HeaderList.Add(New String() {"Ploss GB", "kW"})
HeaderList.Add(New String() {"Ploss Diff", "kW"})
HeaderList.Add(New String() {"Ploss Retarder", "kW"})
HeaderList.Add(New String() {"Pa GB", "kW"})
HeaderList.Add(New String() {"Pa Veh", "kW"})
HeaderList.Add(New String() {"Proll", "kW"})
HeaderList.Add(New String() {"Pair", "kW"})
HeaderList.Add(New String() {"Pgrad", "kW"})
HeaderList.Add(New String() {"Pwheel", "kW"})
HeaderList.Add(New String() {"Pbrake", "kW"})
If GBX.TCon Then
s.Append(",TCν [-],TCμ [-],TC_T_Out [Nm],TC_n_Out [1/min]")
HeaderList.Add(New String() {"TCν", "-"})
HeaderList.Add(New String() {"TCµ", "-"})
HeaderList.Add(New String() {"TC_T_Out", "Nm"})
HeaderList.Add(New String() {"TC_n_Out", "1/min"})
End If
'Auxiliaries
For Each StrKey In AuxList
s.Append(",Paux_" & StrKey & " [kW]")
HeaderList.Add(New String() {"Paux_" & StrKey, "kW"})
Next
End If
HeaderList.Add(New String() {"FC", "g/h"})
HeaderList.Add(New String() {"FC-AUXc", "g/h"})
HeaderList.Add(New String() {"FC-WHTCc", "g/h"})
'FC
s.Append(Sepp & "FC [g/h]")
s.Append(Sepp & "FC-AUXc [g/h]")
'Write to File
If DEV.AdvFormat Then
su = New System.Text.StringBuilder
s.Append(HeaderList(0)(0))
su.Append("[" & HeaderList(0)(1) & "]")
For t = 1 To HeaderList.Count - 1
s.Append(Sepp & HeaderList(t)(0))
su.Append(Sepp & "[" & HeaderList(t)(1) & "]")
Next
f.WriteLine(s.ToString)
f.WriteLine(su.ToString)
Else
s.Append(HeaderList(0)(0) & " [" & HeaderList(0)(1) & "]")
For t = 1 To HeaderList.Count - 1
s.Append(Sepp & HeaderList(t)(0) & " [" & HeaderList(t)(1) & "]")
Next
f.WriteLine(s.ToString)
End If
s.Append(Sepp & "FC-WHTCc [g/h]")
'Write to File
' Header
f.WriteLine(s.ToString)
'***********************************************************************************************
......
......@@ -21,7 +21,7 @@ Public Class cDEV
Public TCnUstep As Single
Public TCnUstepMin As Single
Public AdvFormat As Boolean
'**************************************************************************************************************
......@@ -132,6 +132,10 @@ Public Class cDEV
Conf0.SingleVal = 0.01
MyOptions.Add("TCnUstepMin", Conf0)
Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Better output files format")
Conf0.BoolVal = False
MyOptions.Add("AdvFormat", Conf0)
'**************************** END: Parameters Configuration '*****************************
'*****************************************************************************************
'*****************************************************************************************
......@@ -145,6 +149,7 @@ Public Class cDEV
TCiterPrec = MyOptions("TCiterPrec").SingleVal
TCnUstep = MyOptions("TCnUstep").SingleVal
TCnUstepMin = MyOptions("TCnUstepMin").SingleVal
AdvFormat = MyOptions("AdvFormat").BoolVal
End Sub
'Demo for Delegate Function
......
......@@ -38,7 +38,27 @@ Class cVSUM
First = True
For Each key In VSUMentryList
If Not First Then s.Append(",")
s.Append(VSUMentries(key).Head & " " & VSUMentries(key).Unit)
If DEV.AdvFormat Then
s.Append(VSUMentries(key).Head)
Else
s.Append(VSUMentries(key).Head & " " & VSUMentries(key).Unit)
End If
First = False
Next
Return s.ToString
End Function
Public Function VSUMunit() As String
Dim s As New System.Text.StringBuilder
Dim key As String
Dim First As Boolean
First = True
For Each key In VSUMentryList
If Not First Then s.Append(",")
s.Append(VSUMentries(key).Unit)
First = False
Next
......@@ -308,7 +328,12 @@ Class cVSUM
End Try
'*** Header / Units
Fvsum.WriteLine("Job [-],Input File [-],Cycle [-]," & VSUMhead())
If DEV.AdvFormat Then
Fvsum.WriteLine("Job,Input File,Cycle," & VSUMhead())
Fvsum.WriteLine("[-],[-],[-]," & VSUMunit())
Else
Fvsum.WriteLine("Job [-],Input File [-],Cycle [-]," & VSUMhead())
End If
'Close file (will open after each job)
Fvsum.Close()
......@@ -505,15 +530,11 @@ Class cVSUM
ResList = New List(Of Dictionary(Of String, Object))
'Info
'Fvsum.WriteLine("VECTO results")
'Fvsum.WriteLine("VECTO " & VECTOvers)
'Fvsum.WriteLine(Now.ToString)
'Fvsum.WriteLine("air density [kg/m3]: " & Cfg.AirDensity)
'If Cfg.DistCorr Then
' Fvsum.WriteLine("Distance Correction ON")
'Else
' Fvsum.WriteLine("Distance Correction OFF")
'End If
If DEV.AdvFormat Then
Fvsum.WriteLine("VECTO " & VECTOvers)
Fvsum.WriteLine(Now.ToString)
Fvsum.WriteLine("Input File: " & JobFile)
End If
'Close file (will open after each job)
Fvsum.Close()
......
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