From fba261fe2d8995fa32dd9e4a61b7d7fa3be346ce Mon Sep 17 00:00:00 2001
From: Raphael Luz <luz@ivt.tugraz.at>
Date: Wed, 5 Feb 2014 17:54:39 +0100
Subject: [PATCH] * Target deceleration (.vacc file) doesn't work right if
 distance-steps in driving cycle are too large. Now limited to 1[m]. * Bugfix:
 When moving job files up or down in job list the "checked jobs" counter was
 incorrectly reduced. * Bugfix: Vehicle Editor: "New file" had invalid axle
 configuration (caused crash when trying to edit).

---
 User Manual/fileformat/VDRI.html | 5 ++++-
 VECTO Changelog.txt              | 7 ++++++-
 VECTO/GUI/F_MAINForm.Designer.vb | 4 ++--
 VECTO/GUI/F_MAINForm.vb          | 5 +++--
 VECTO/GUI/F_VEH.vb               | 9 ---------
 VECTO/Input Files/cDRI.vb        | 8 ++++++++
 6 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/User Manual/fileformat/VDRI.html b/User Manual/fileformat/VDRI.html
index fd1ddf370d..763b49c4e9 100644
--- a/User Manual/fileformat/VDRI.html	
+++ b/User Manual/fileformat/VDRI.html	
@@ -18,7 +18,10 @@ Manual</span></a><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman
 <h2><a href="index.html">Input Files</a> / Driving Cycle (.vdri)</h2>
 </div><div style="text-align: left;"><span style="font-family: Verdana;"></span>The
 Driving Cycle defines vehicle speed, road gradient and other parameters
-either time- or distance-based. It's open format requires&nbsp;<span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">Idenfiers<span class="Apple-converted-space"> to</span></span> define the content of each column. <br><br><br><br><big><big><span style="font-weight: bold;">Supported Identifiers:</span></big></big><br><table style="text-align: left; width: 100%; height: 116px;" border="1" cellpadding="5" cellspacing="0"><tbody><tr><td style="font-weight: bold; width: 95px;">Identifier</td><td style="width: 112px;"><span style="font-weight: bold;">Quantity</span></td><td style="width: 58px;"><span style="font-weight: bold;">Unit</span></td><td style="width: 665px;"><span style="font-weight: bold;">Description</span></td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;s&gt;</td><td style="width: 112px;">Distance</td><td style="width: 58px;">[m]</td><td style="width: 665px;"><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">Travelled distance used for distance-based cycles. If &lt;t&gt; is also defined this column will be ignored.</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;"></span></td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;t&gt;</td><td style="width: 112px;">Time</td><td style="width: 58px;">[s]</td><td style="width: 665px;">Used for time-based cycles. If neither this nor the distance &lt;s&gt; is defined the data will be <span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">interpreted as 1Hz.</span></td></tr><tr><td style="font-weight: bold;">&lt;v&gt;</td><td>Vehicle Speed</td><td>[km/h]</td><td>Required except for <a href="../GUI/VECTO-Editor.html#engonly">Engine Only Mode</a> calculations.</td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;grad&gt;</td><td style="width: 112px;">Road Gradient</td><td style="width: 58px;">[%]</td><td style="width: 665px;">Optional.</td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;stop&gt;</td><td style="width: 112px;">Stopping Time</td><td style="width: 58px;">[s]</td><td style="width: 665px;">Required
+either time- or distance-based. It's open format requires&nbsp;<span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">Idenfiers<span class="Apple-converted-space"> to</span></span> define the content of each column. <br><br><big><big><span style="font-weight: bold;">Important notes:</span></big></big><br><ul><li>For distance-based cycles there is a minimum distance-step of 1[m] required. The calculation will abort if larger steps are used.</li><li>Time-based
+cycles can be defined in any given time resolution, including variable
+time steps. If the time identifier "&lt;t&gt;" is not used the data
+will be interpreted in 1[s] resolution (1Hz).</li></ul><br><big><big><span style="font-weight: bold;">Supported Identifiers:</span></big></big><br><table style="text-align: left; width: 100%; height: 116px;" border="1" cellpadding="5" cellspacing="0"><tbody><tr><td style="font-weight: bold; width: 95px;">Identifier</td><td style="width: 112px;"><span style="font-weight: bold;">Quantity</span></td><td style="width: 58px;"><span style="font-weight: bold;">Unit</span></td><td style="width: 665px;"><span style="font-weight: bold;">Description</span></td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;s&gt;</td><td style="width: 112px;">Distance</td><td style="width: 58px;">[m]</td><td style="width: 665px;"><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">Travelled distance used for distance-based cycles. If &lt;t&gt; is also defined this column will be ignored.</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;"></span></td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;t&gt;</td><td style="width: 112px;">Time</td><td style="width: 58px;">[s]</td><td style="width: 665px;">Used for time-based cycles. If neither this nor the distance &lt;s&gt; is defined the data will be <span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">interpreted as 1Hz.</span></td></tr><tr><td style="font-weight: bold;">&lt;v&gt;</td><td>Vehicle Speed</td><td>[km/h]</td><td>Required except for <a href="../GUI/VECTO-Editor.html#engonly">Engine Only Mode</a> calculations.</td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;grad&gt;</td><td style="width: 112px;">Road Gradient</td><td style="width: 58px;">[%]</td><td style="width: 665px;">Optional.</td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;stop&gt;</td><td style="width: 112px;">Stopping Time</td><td style="width: 58px;">[s]</td><td style="width: 665px;">Required
 for distance-based cycles. Not used in time based cycles. &lt;stop&gt;
 defines the time the vehicle spends in stop phases.</td></tr><tr><td style="font-weight: bold; width: 95px;">&lt;Aux_xxx&gt;</td><td style="width: 112px;">Auxiliary Supply Power</td><td style="width: 58px;">[kW]</td><td style="width: 665px;"><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">Supply Power input for each auxiliary defined in the <a href="../GUI/VECTO-Editor.html">.vecto file</a> where<span class="Apple-converted-space">&nbsp;</span></span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-style: italic; font-weight: bold;">xxx</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;"><span class="Apple-converted-space">&nbsp;</span>matches the ID of the corresponding <a href="../GUI/VECTO-Editor_Aux.html">Auxiliary</a>.&nbsp;</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">ID's are not case sensitive and must not contain space or special characters.</span></td></tr><tr><td><span style="font-weight: bold;">&lt;n&gt;</span></td><td style="width: 112px;">Engine Speed</td><td style="width: 58px;">[rpm]</td><td style="width: 665px;">If &lt;n&gt; is defined VECTO uses that instead of the calculated engine speed value.</td></tr><tr><td><span style="font-weight: bold;">&lt;gear&gt;</span></td><td style="width: 112px;">Gear</td><td style="width: 58px;">[-]</td><td style="width: 665px;">Gear input. Overwrites the gear shift model.</td></tr><tr><td><span style="font-weight: bold;">&lt;Padd&gt;</span></td><td style="width: 112px;">Additional Aux Power Demand</td><td style="width: 58px;">[kW]</td><td style="width: 665px;">This power input will be directly added to the engine power in addition to possible other auxiliaries. Also used in <a href="../GUI/VECTO-Editor.html#engonly">Engine Only Mode</a>.</td></tr><tr><td><span style="font-weight: bold;">&lt;vair_res&gt;</span></td><td style="width: 112px;">Air speed relative to vehicle</td><td style="width: 58px;">[km/h]</td><td style="width: 665px;">Only required if <span style="font-weight: bold;">Cross Wind Correction</span> is set to<span style="font-family: 'Times New Roman';">&nbsp;</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none; font-weight: bold;">Vair &amp; Beta Input</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">. See <a href="../GUI/VEH-Editor.html#wind">here</a> for details.</span></td></tr><tr><td style="font-weight: bold;">&lt;vair_beta&gt;</td><td style="width: 112px;">Wind Yaw Angle</td><td style="width: 58px;">[°]</td><td style="width: 665px;">Only required if <span style="font-weight: bold;">Cross Wind Correction</span> is set to<span style="font-family: 'Times New Roman';">&nbsp;</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none; font-weight: bold;">Vair &amp; Beta Input</span><span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">. See <a href="../GUI/VEH-Editor.html#wind">here</a> for details.</span></td></tr><tr><td><span style="font-weight: bold;">&lt;Pe&gt;</span></td><td>Engine power</td><td>[kW]</td><td>Effective engine power at clutch. Only required in <a href="../GUI/VECTO-Editor.html#engonly">Engine Only Mode</a>. Alternatively torque &lt;Me&gt; can be defined. Use &lt;DRAG&gt; to define motoring operation.</td></tr><tr><td><span style="font-weight: bold;">&lt;Me&gt;</span></td><td>Engine torque</td><td>[Nm]</td><td>Effective engine torque at clutch. Only required in <a href="../GUI/VECTO-Editor.html#engonly">Engine Only Mode</a>. Alternatively power &lt;Pe&gt; can be defined.&nbsp;Use &lt;DRAG&gt; to define motoring operation.</td></tr></tbody></table><big><big><span style="color: red; font-weight: bold;">Note: The Identifiers line is no comment line and therefore does not start with "c"</span></big></big><br><big><big><span style="font-weight: bold;"><br>Examples:</span></big></big><br>The demo data provided with VECTO contains several .vdri files that may be used as template.<br><br><big><big><small><small><span style="font-weight: bold;">Example 1: </span></small></small></big></big>Distance-based cycle with<span style="font-weight: bold;"> Road Gradient</span> and two <span style="font-weight: bold;">Auxiliaries</span> (as provided in the demo data)<span style="font-family: Verdana;"></span><br><span style="font-family: Verdana;"></span><span style="font-family: Verdana;"><img style="width: 590px; height: 219px;" alt="" src="pics/VDRI01.png"></span><br><big><big><small><small><span style="font-weight: bold;">Example 2:</span> Time</small></small></big></big>-based cycle with Engine Speed, <span style="font-weight: bold;">Vair &amp; Beta Input</span>, one <span style="font-weight: bold;">Auxiliary</span> and  <span style="font-weight: bold;">Additional Aux Demand</span><br><span style="font-family: Verdana;"></span><span style="font-family: Verdana;"><img style="width: 632px; height: 189px;" alt="" src="pics/VDRI02.png"></span><br><br><br><span style="font-family: Verdana;"></span></div><span style="font-family: Verdana;"></span><br>
 <div style="text-align: left;">
diff --git a/VECTO Changelog.txt b/VECTO Changelog.txt
index cf130c297b..36e3ea8155 100644
--- a/VECTO Changelog.txt	
+++ b/VECTO Changelog.txt	
@@ -3,11 +3,16 @@ VECTO ?.? (future release) TODO
 	JSON
 
 
-VECTO 1.4.RC8 (current source - next release)
+VECTO 1.4.xxx (current source - next release)
+
+
+VECTO 1.4.RC8 
+
 * Bugfix: Eco Roll didn't go into motoring operation when Overspeed-Limit was reached (could cause higher FC than Overspeed Mode)
 * Minor update in demo data (12t motoring curve)
 
 VECTO 1.4.RC7
+
 * Speed reduction in smaller steps to get closer to full load curve (before speed was sometimes reduced too much and caused problem with gear shifting)
 * Updates in demo data
 
diff --git a/VECTO/GUI/F_MAINForm.Designer.vb b/VECTO/GUI/F_MAINForm.Designer.vb
index dca853e94a..47a7e48592 100644
--- a/VECTO/GUI/F_MAINForm.Designer.vb
+++ b/VECTO/GUI/F_MAINForm.Designer.vb
@@ -750,7 +750,7 @@ Partial Class F_MAINForm
         '
         Me.ConMenFilelist.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SaveListToolStripMenuItem, Me.LoadListToolStripMenuItem, Me.LoadDefaultListToolStripMenuItem, Me.ClearListToolStripMenuItem, Me.ToolStripSeparator5, Me.RemovePathsToolStripMenuItem2})
         Me.ConMenFilelist.Name = "ConMenFilelist"
-        Me.ConMenFilelist.Size = New System.Drawing.Size(176, 142)
+        Me.ConMenFilelist.Size = New System.Drawing.Size(176, 120)
         '
         'SaveListToolStripMenuItem
         '
@@ -1021,7 +1021,7 @@ Partial Class F_MAINForm
         '
         Me.CmOpenFile.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.OpenWithGRAPHiToolStripMenuItem, Me.OpenWithToolStripMenuItem, Me.ShowInFolderToolStripMenuItem})
         Me.CmOpenFile.Name = "CmOpenFile"
-        Me.CmOpenFile.Size = New System.Drawing.Size(175, 92)
+        Me.CmOpenFile.Size = New System.Drawing.Size(175, 70)
         '
         'OpenWithGRAPHiToolStripMenuItem
         '
diff --git a/VECTO/GUI/F_MAINForm.vb b/VECTO/GUI/F_MAINForm.vb
index 14eef85590..30cf588e46 100644
--- a/VECTO/GUI/F_MAINForm.vb
+++ b/VECTO/GUI/F_MAINForm.vb
@@ -1372,8 +1372,8 @@ lbFound:
         Dim y As Int32
         Dim y1 As Int32
         Dim items() As String
-        Dim check() As String
-        Dim index() As String
+        Dim check() As Boolean
+        Dim index() As Integer
         Dim ListViewItem0 As ListViewItem
 
         If GUIlocked Then Exit Sub
@@ -1407,6 +1407,7 @@ lbFound:
         'Items select and Insert
         'For y = y1 To 0 Step -1
         For y = 0 To y1
+            If Not check(y) Then GENchecked += 1
             ListViewItem0 = ListV.Items.Insert(index(y), items(y))
             ListViewItem0.SubItems.Add(" ")
             ListViewItem0.Checked = check(y)
diff --git a/VECTO/GUI/F_VEH.vb b/VECTO/GUI/F_VEH.vb
index 6d5be1bee9..6c8bfce766 100644
--- a/VECTO/GUI/F_VEH.vb
+++ b/VECTO/GUI/F_VEH.vb
@@ -138,13 +138,6 @@ Public Class F_VEH
         Me.CbCat.SelectedIndex = 0
 
         Me.LvRRC.Items.Clear()
-        For i = 1 To 2
-            lvi = New ListViewItem
-            lvi.SubItems(0).Text = i.ToString
-            lvi.SubItems.Add("0")
-            lvi.SubItems.Add("0")
-            LvRRC.Items.Add(lvi)
-        Next
 
         Me.TbMassMax.Text = ""
         Me.TbMassExtra.Text = ""
@@ -642,8 +635,6 @@ Public Class F_VEH
         Dim lv0 As ListViewItem
         Dim i As Integer
 
-        If LvRRC.Items.Count = 2 Then Exit Sub
-
         If LvRRC.SelectedItems.Count = 0 Then
             If LvRRC.Items.Count = 0 Then
                 Exit Sub
diff --git a/VECTO/Input Files/cDRI.vb b/VECTO/Input Files/cDRI.vb
index 30de7d7171..d45ac55aa9 100644
--- a/VECTO/Input Files/cDRI.vb	
+++ b/VECTO/Input Files/cDRI.vb	
@@ -837,6 +837,14 @@ lbEr:
             Next
         End If
 
+        'Check if smallest distance step is smaller or equal 1m
+        For i = 1 To tDim
+            If Dist(i) - Dist(i - 1) > 1 Then
+                WorkerMsg(tMsgID.Err, "Distance-based cycles must not include larger distance-steps than 1[m]!", MsgSrc)
+                Return False
+            End If
+        Next
+
         '*********************************** Deceleration(Verzögerung) limit ********************************
         For i = tDim To 1 Step -1
 
-- 
GitLab