diff --git a/User Manual/GUI/GBX-Editor.html b/User Manual/GUI/GBX-Editor.html index 99fec94775328afac77f3a56f4f226e0d5d9f761..83c559a4879b8c7f1a50d7653f433bbcc5ec082a 100644 --- a/User Manual/GUI/GBX-Editor.html +++ b/User Manual/GUI/GBX-Editor.html @@ -122,7 +122,7 @@ lines (header, comments, etc.) </span><span style="text-decoration: underline; font-style: italic; color: rgb(51, 102, 255);">must</span><span style="font-style: italic; color: rgb(51, 102, 255);"> start with "<span style="font-weight: bold;">c</span> "</span><br> <br> -<img style="width: 16px; height: 16px;" alt="rem" src="../pics/icons/minus-circle-icon.png"><a name="remgear"></a> Remove Gear (i.e. Ratio=0)<br> +<img style="width: 16px; height: 16px;" alt="rem" src="../pics/icons/minus-circle-icon.png"><a name="remgear"></a> Remove Gear<br> </div> <br><br><big><big><span style="font-weight: bold;">Gear shift parameters</span></big></big><br><div style="margin-left: 40px;"><span style="font-weight: bold;"><br><a name="polyfile"></a>Shift polygons file</span> (.vgbs)<br><div style="margin-left: 40px;">This file contains the up- and down- shift curves that control the gear diff --git a/VECTO Changelog.txt b/VECTO Changelog.txt index 63b8440298639aa4c8455201c0cb6a43fee57994..169cf71dc610a146a483f863bb42e3a29edf9bc4 100644 --- a/VECTO Changelog.txt +++ b/VECTO Changelog.txt @@ -1,8 +1,11 @@ VECTO ?.? (future release) -- Eco-Roll & Over-/Under-Speed - Gearbox Rules must be set when loading .gbx file to aviod invalid settings (e.g. AT with Skip Gears) -VECTO 1.2 x (current source - next release) +VECTO 1.3 (current source - next release) +- Some file-specific error messages link to files +- Eco-Roll, Overspeed, Look Ahead Coasting + + VECTO 1.2 - Bugfix: When opening the Gearbox Editor the Gear Shift Settings (e.g. Skip Gears) were not valid for MT @@ -18,7 +21,7 @@ VECTO 1.1 beta 3 - Transmission Type selection in Gearbox (.vgbx) file. - Enables/Disables transmission type-specific options - In Proof-Of-Concept mode "Custom" type is available with all options enabled. -- Automatic Transmission mode with Torque converter: Input parameters in Gearbox file !!still being tested!! +- Automatic Transmission mode with Torque Converter: Input parameters in Gearbox file !!still being tested!! - Option to open files with GRAPHi or user-defined tool - User Manual updated - Bugfix: Files with relative paths were not located correctly diff --git a/VECTO.sln b/VECTO.sln index 5568a2e9ef4c85be5dca188ceb8ad1aa8ca81052..de4468fc8c93962fdaf1cb079381cc90e2314654 100644 --- a/VECTO.sln +++ b/VECTO.sln @@ -6,13 +6,19 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Debug|x86.ActiveCfg = Debug|x86 + {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Debug|x86.Build.0 = Debug|x86 {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Release|Any CPU.ActiveCfg = Release|Any CPU {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Release|Any CPU.Build.0 = Release|Any CPU + {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Release|x86.ActiveCfg = Release|x86 + {AAC0F132-0A9F-45B3-B682-77AC9B24B352}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/VECTO/GUI/F_GBX.vb b/VECTO/GUI/F_GBX.vb index 104abdc45ccb66e2d4891a3f46a66353dff963a1..e4358af04284af1a24084fb38a92ca1fb48b19be 100644 --- a/VECTO/GUI/F_GBX.vb +++ b/VECTO/GUI/F_GBX.vb @@ -461,18 +461,41 @@ 'Clear Gear Private Sub ClearGear() Dim lv0 As ListViewItem + Dim i0 As Int16 + Dim i As Int16 If Me.LvGears.SelectedItems.Count = 0 Then Exit Sub - lv0 = Me.LvGears.SelectedItems(0) + i0 = Me.LvGears.SelectedItems(0).Index + + If i0 = 0 Then Exit Sub 'Must not remove axle + + Me.LvGears.SelectedItems(0).Remove() - lv0.SubItems(1).Text = "0" - lv0.SubItems(2).Text = "" + lv0 = New ListViewItem("") + lv0.SubItems.Add("0") + lv0.SubItems.Add("") lv0.ForeColor = Color.Gray + Me.LvGears.Items.Add(lv0) + + If Me.ChTCon.Checked Then + + Me.LvGears.Items(1).SubItems(0).Text = "TC" + + For i = 2 To 16 + Me.LvGears.Items(i).SubItems(0).Text = (i - 1).ToString("00") + Next + + Else + For i = 1 To 16 + Me.LvGears.Items(i).SubItems(0).Text = i.ToString("00") + Next + + End If - If lv0.Index < Me.LvGears.Items.Count - 1 Then - Me.LvGears.Items(lv0.Index + 1).Selected = True - Me.LvGears.Items(lv0.Index + 1).EnsureVisible() + If i0 < Me.LvGears.Items.Count Then + Me.LvGears.Items(i0).Selected = True + Me.LvGears.Items(i0).EnsureVisible() End If Me.LvGears.Focus() diff --git a/VECTO/GUI/F_GEN.Designer.vb b/VECTO/GUI/F_GEN.Designer.vb index 3c6980d9e2d8de9a12dae6d1aeb73e5b158e3ef0..585dd372e4df1388577f3711954598829ca7da02 100644 --- a/VECTO/GUI/F_GEN.Designer.vb +++ b/VECTO/GUI/F_GEN.Designer.vb @@ -109,12 +109,33 @@ Partial Class F_GEN Me.ComboBoxGearShift = New System.Windows.Forms.ComboBox() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabPgDriver = New System.Windows.Forms.TabPage() - Me.ChBStartStop = New System.Windows.Forms.CheckBox() + Me.GroupBox4 = New System.Windows.Forms.GroupBox() + Me.Label25 = New System.Windows.Forms.Label() + Me.CbLookAhead = New System.Windows.Forms.CheckBox() + Me.TbAlookahead = New System.Windows.Forms.TextBox() + Me.Label24 = New System.Windows.Forms.Label() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.Label21 = New System.Windows.Forms.Label() + Me.Label20 = New System.Windows.Forms.Label() + Me.Label14 = New System.Windows.Forms.Label() + Me.TbVmin = New System.Windows.Forms.TextBox() + Me.TbUnderSpeed = New System.Windows.Forms.TextBox() + Me.TbOverspeed = New System.Windows.Forms.TextBox() + Me.Label23 = New System.Windows.Forms.Label() + Me.Label22 = New System.Windows.Forms.Label() + Me.Label13 = New System.Windows.Forms.Label() + Me.RdEcoRoll = New System.Windows.Forms.RadioButton() + Me.RdOverspeed = New System.Windows.Forms.RadioButton() + Me.RdOff = New System.Windows.Forms.RadioButton() Me.GrStartStop = New System.Windows.Forms.GroupBox() + Me.PnStartStop = New System.Windows.Forms.Panel() + Me.Label27 = New System.Windows.Forms.Label() Me.TBSSspeed = New System.Windows.Forms.TextBox() - Me.TBSStime = New System.Windows.Forms.TextBox() - Me.LabelSStime = New System.Windows.Forms.Label() Me.LabelSSspeed = New System.Windows.Forms.Label() + Me.Label26 = New System.Windows.Forms.Label() + Me.LabelSStime = New System.Windows.Forms.Label() + Me.TBSStime = New System.Windows.Forms.TextBox() + Me.ChBStartStop = New System.Windows.Forms.CheckBox() Me.BtAccOpen = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.BtDesMaxBr = New System.Windows.Forms.Button() @@ -176,6 +197,10 @@ Partial Class F_GEN Me.OpenWithGRAPHiToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.OpenWithToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.PnLookAhead = New System.Windows.Forms.Panel() + Me.Label28 = New System.Windows.Forms.Label() + Me.TbVminLA = New System.Windows.Forms.TextBox() + Me.Label29 = New System.Windows.Forms.Label() Me.TabPgHEV.SuspendLayout() Me.TabPgColdSt.SuspendLayout() Me.GroupBox3.SuspendLayout() @@ -184,7 +209,10 @@ Partial Class F_GEN Me.GrAux.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabPgDriver.SuspendLayout() + Me.GroupBox4.SuspendLayout() + Me.GroupBox1.SuspendLayout() Me.GrStartStop.SuspendLayout() + Me.PnStartStop.SuspendLayout() Me.TabPgKF.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.TabPgTEST.SuspendLayout() @@ -193,6 +221,7 @@ Partial Class F_GEN Me.ToolStrip1.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.CmOpenFile.SuspendLayout() + Me.PnLookAhead.SuspendLayout() Me.SuspendLayout() ' 'ButOpenEXS @@ -1086,7 +1115,8 @@ Partial Class F_GEN ' 'TabPgDriver ' - Me.TabPgDriver.Controls.Add(Me.ChBStartStop) + Me.TabPgDriver.Controls.Add(Me.GroupBox4) + Me.TabPgDriver.Controls.Add(Me.GroupBox1) Me.TabPgDriver.Controls.Add(Me.GrStartStop) Me.TabPgDriver.Controls.Add(Me.BtAccOpen) Me.TabPgDriver.Controls.Add(Me.Label1) @@ -1100,62 +1130,267 @@ Partial Class F_GEN Me.TabPgDriver.Text = "Driver" Me.TabPgDriver.UseVisualStyleBackColor = True ' - 'ChBStartStop - ' - Me.ChBStartStop.AutoSize = True - Me.ChBStartStop.Checked = True - Me.ChBStartStop.CheckState = System.Windows.Forms.CheckState.Checked - Me.ChBStartStop.Location = New System.Drawing.Point(9, 94) - Me.ChBStartStop.Name = "ChBStartStop" - Me.ChBStartStop.Size = New System.Drawing.Size(101, 17) - Me.ChBStartStop.TabIndex = 39 - Me.ChBStartStop.Text = "ICE Start / Stop" - Me.ChBStartStop.UseVisualStyleBackColor = True + 'GroupBox4 + ' + Me.GroupBox4.Controls.Add(Me.PnLookAhead) + Me.GroupBox4.Controls.Add(Me.CbLookAhead) + Me.GroupBox4.Location = New System.Drawing.Point(12, 331) + Me.GroupBox4.Name = "GroupBox4" + Me.GroupBox4.Size = New System.Drawing.Size(375, 87) + Me.GroupBox4.TabIndex = 41 + Me.GroupBox4.TabStop = False + Me.GroupBox4.Text = "Look-Ahead Coasting" + ' + 'Label25 + ' + Me.Label25.AutoSize = True + Me.Label25.Location = New System.Drawing.Point(197, 12) + Me.Label25.Name = "Label25" + Me.Label25.Size = New System.Drawing.Size(34, 13) + Me.Label25.TabIndex = 3 + Me.Label25.Text = "[m/s²]" + ' + 'CbLookAhead + ' + Me.CbLookAhead.AutoSize = True + Me.CbLookAhead.Checked = True + Me.CbLookAhead.CheckState = System.Windows.Forms.CheckState.Checked + Me.CbLookAhead.Location = New System.Drawing.Point(16, 21) + Me.CbLookAhead.Name = "CbLookAhead" + Me.CbLookAhead.Size = New System.Drawing.Size(65, 17) + Me.CbLookAhead.TabIndex = 0 + Me.CbLookAhead.Text = "Enabled" + Me.CbLookAhead.UseVisualStyleBackColor = True + ' + 'TbAlookahead + ' + Me.TbAlookahead.Location = New System.Drawing.Point(127, 9) + Me.TbAlookahead.Name = "TbAlookahead" + Me.TbAlookahead.Size = New System.Drawing.Size(64, 20) + Me.TbAlookahead.TabIndex = 2 + ' + 'Label24 + ' + Me.Label24.AutoSize = True + Me.Label24.Location = New System.Drawing.Point(25, 12) + Me.Label24.Name = "Label24" + Me.Label24.Size = New System.Drawing.Size(96, 13) + Me.Label24.TabIndex = 1 + Me.Label24.Text = "Target Retardation" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.Label21) + Me.GroupBox1.Controls.Add(Me.Label20) + Me.GroupBox1.Controls.Add(Me.Label14) + Me.GroupBox1.Controls.Add(Me.TbVmin) + Me.GroupBox1.Controls.Add(Me.TbUnderSpeed) + Me.GroupBox1.Controls.Add(Me.TbOverspeed) + Me.GroupBox1.Controls.Add(Me.Label23) + Me.GroupBox1.Controls.Add(Me.Label22) + Me.GroupBox1.Controls.Add(Me.Label13) + Me.GroupBox1.Controls.Add(Me.RdEcoRoll) + Me.GroupBox1.Controls.Add(Me.RdOverspeed) + Me.GroupBox1.Controls.Add(Me.RdOff) + Me.GroupBox1.Location = New System.Drawing.Point(12, 192) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(372, 109) + Me.GroupBox1.TabIndex = 40 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Overspeed / Eco-Roll" + ' + 'Label21 + ' + Me.Label21.AutoSize = True + Me.Label21.Location = New System.Drawing.Point(314, 76) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(38, 13) + Me.Label21.TabIndex = 3 + Me.Label21.Text = "[km/h]" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.Location = New System.Drawing.Point(314, 50) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(38, 13) + Me.Label20.TabIndex = 3 + Me.Label20.Text = "[km/h]" + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(314, 24) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(38, 13) + Me.Label14.TabIndex = 3 + Me.Label14.Text = "[km/h]" + ' + 'TbVmin + ' + Me.TbVmin.Location = New System.Drawing.Point(244, 73) + Me.TbVmin.Name = "TbVmin" + Me.TbVmin.Size = New System.Drawing.Size(64, 20) + Me.TbVmin.TabIndex = 2 + ' + 'TbUnderSpeed + ' + Me.TbUnderSpeed.Location = New System.Drawing.Point(244, 47) + Me.TbUnderSpeed.Name = "TbUnderSpeed" + Me.TbUnderSpeed.Size = New System.Drawing.Size(64, 20) + Me.TbUnderSpeed.TabIndex = 2 + ' + 'TbOverspeed + ' + Me.TbOverspeed.Location = New System.Drawing.Point(244, 21) + Me.TbOverspeed.Name = "TbOverspeed" + Me.TbOverspeed.Size = New System.Drawing.Size(64, 20) + Me.TbOverspeed.TabIndex = 2 + ' + 'Label23 + ' + Me.Label23.AutoSize = True + Me.Label23.Location = New System.Drawing.Point(143, 76) + Me.Label23.Name = "Label23" + Me.Label23.Size = New System.Drawing.Size(95, 13) + Me.Label23.TabIndex = 1 + Me.Label23.Text = "Min. Target Speed" + ' + 'Label22 + ' + Me.Label22.AutoSize = True + Me.Label22.Location = New System.Drawing.Point(147, 50) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(91, 13) + Me.Label22.TabIndex = 1 + Me.Label22.Text = "Max. Underspeed" + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(153, 24) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(85, 13) + Me.Label13.TabIndex = 1 + Me.Label13.Text = "Max. Overspeed" + ' + 'RdEcoRoll + ' + Me.RdEcoRoll.AutoSize = True + Me.RdEcoRoll.Checked = True + Me.RdEcoRoll.Location = New System.Drawing.Point(13, 68) + Me.RdEcoRoll.Name = "RdEcoRoll" + Me.RdEcoRoll.Size = New System.Drawing.Size(65, 17) + Me.RdEcoRoll.TabIndex = 0 + Me.RdEcoRoll.TabStop = True + Me.RdEcoRoll.Text = "Eco-Roll" + Me.RdEcoRoll.UseVisualStyleBackColor = True + ' + 'RdOverspeed + ' + Me.RdOverspeed.AutoSize = True + Me.RdOverspeed.Location = New System.Drawing.Point(13, 45) + Me.RdOverspeed.Name = "RdOverspeed" + Me.RdOverspeed.Size = New System.Drawing.Size(77, 17) + Me.RdOverspeed.TabIndex = 0 + Me.RdOverspeed.Text = "Overspeed" + Me.RdOverspeed.UseVisualStyleBackColor = True + ' + 'RdOff + ' + Me.RdOff.AutoSize = True + Me.RdOff.Location = New System.Drawing.Point(13, 22) + Me.RdOff.Name = "RdOff" + Me.RdOff.Size = New System.Drawing.Size(39, 17) + Me.RdOff.TabIndex = 0 + Me.RdOff.Text = "Off" + Me.RdOff.UseVisualStyleBackColor = True ' 'GrStartStop ' - Me.GrStartStop.Controls.Add(Me.TBSSspeed) - Me.GrStartStop.Controls.Add(Me.TBSStime) - Me.GrStartStop.Controls.Add(Me.LabelSStime) - Me.GrStartStop.Controls.Add(Me.LabelSSspeed) - Me.GrStartStop.Location = New System.Drawing.Point(9, 117) + Me.GrStartStop.Controls.Add(Me.PnStartStop) + Me.GrStartStop.Controls.Add(Me.ChBStartStop) + Me.GrStartStop.Location = New System.Drawing.Point(9, 83) Me.GrStartStop.Name = "GrStartStop" - Me.GrStartStop.Size = New System.Drawing.Size(207, 87) + Me.GrStartStop.Size = New System.Drawing.Size(375, 87) Me.GrStartStop.TabIndex = 38 Me.GrStartStop.TabStop = False Me.GrStartStop.Text = "Engine Start Stop" ' + 'PnStartStop + ' + Me.PnStartStop.Controls.Add(Me.Label27) + Me.PnStartStop.Controls.Add(Me.TBSSspeed) + Me.PnStartStop.Controls.Add(Me.LabelSSspeed) + Me.PnStartStop.Controls.Add(Me.Label26) + Me.PnStartStop.Controls.Add(Me.LabelSStime) + Me.PnStartStop.Controls.Add(Me.TBSStime) + Me.PnStartStop.Location = New System.Drawing.Point(148, 10) + Me.PnStartStop.Name = "PnStartStop" + Me.PnStartStop.Size = New System.Drawing.Size(221, 71) + Me.PnStartStop.TabIndex = 0 + ' + 'Label27 + ' + Me.Label27.AutoSize = True + Me.Label27.Location = New System.Drawing.Point(169, 38) + Me.Label27.Name = "Label27" + Me.Label27.Size = New System.Drawing.Size(18, 13) + Me.Label27.TabIndex = 38 + Me.Label27.Text = "[s]" + ' 'TBSSspeed ' - Me.TBSSspeed.Location = New System.Drawing.Point(120, 19) + Me.TBSSspeed.Location = New System.Drawing.Point(99, 9) Me.TBSSspeed.Name = "TBSSspeed" Me.TBSSspeed.Size = New System.Drawing.Size(64, 20) Me.TBSSspeed.TabIndex = 34 ' - 'TBSStime + 'LabelSSspeed ' - Me.TBSStime.Location = New System.Drawing.Point(120, 45) - Me.TBSStime.Name = "TBSStime" - Me.TBSStime.Size = New System.Drawing.Size(64, 20) - Me.TBSStime.TabIndex = 36 + Me.LabelSSspeed.AutoSize = True + Me.LabelSSspeed.Location = New System.Drawing.Point(32, 12) + Me.LabelSSspeed.Name = "LabelSSspeed" + Me.LabelSSspeed.Size = New System.Drawing.Size(61, 13) + Me.LabelSSspeed.TabIndex = 37 + Me.LabelSSspeed.Text = "Max Speed" + ' + 'Label26 + ' + Me.Label26.AutoSize = True + Me.Label26.Location = New System.Drawing.Point(169, 12) + Me.Label26.Name = "Label26" + Me.Label26.Size = New System.Drawing.Size(38, 13) + Me.Label26.TabIndex = 38 + Me.Label26.Text = "[km/h]" ' 'LabelSStime ' Me.LabelSStime.AutoSize = True - Me.LabelSStime.Location = New System.Drawing.Point(13, 48) + Me.LabelSStime.Location = New System.Drawing.Point(6, 38) Me.LabelSStime.Name = "LabelSStime" - Me.LabelSStime.Size = New System.Drawing.Size(101, 13) + Me.LabelSStime.Size = New System.Drawing.Size(87, 13) Me.LabelSStime.TabIndex = 35 - Me.LabelSStime.Text = "Min ICE-On Time [s]" + Me.LabelSStime.Text = "Min ICE-On Time" ' - 'LabelSSspeed + 'TBSStime ' - Me.LabelSSspeed.AutoSize = True - Me.LabelSSspeed.Location = New System.Drawing.Point(19, 21) - Me.LabelSSspeed.Name = "LabelSSspeed" - Me.LabelSSspeed.Size = New System.Drawing.Size(95, 13) - Me.LabelSSspeed.TabIndex = 37 - Me.LabelSSspeed.Text = "Max Speed [km/h]" + Me.TBSStime.Location = New System.Drawing.Point(99, 35) + Me.TBSStime.Name = "TBSStime" + Me.TBSStime.Size = New System.Drawing.Size(64, 20) + Me.TBSStime.TabIndex = 36 + ' + 'ChBStartStop + ' + Me.ChBStartStop.AutoSize = True + Me.ChBStartStop.Checked = True + Me.ChBStartStop.CheckState = System.Windows.Forms.CheckState.Checked + Me.ChBStartStop.Location = New System.Drawing.Point(16, 21) + Me.ChBStartStop.Name = "ChBStartStop" + Me.ChBStartStop.Size = New System.Drawing.Size(65, 17) + Me.ChBStartStop.TabIndex = 39 + Me.ChBStartStop.Text = "Enabled" + Me.ChBStartStop.UseVisualStyleBackColor = True ' 'BtAccOpen ' @@ -1747,6 +1982,44 @@ Partial Class F_GEN Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(174, 22) Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder" ' + 'PnLookAhead + ' + Me.PnLookAhead.Controls.Add(Me.Label29) + Me.PnLookAhead.Controls.Add(Me.Label25) + Me.PnLookAhead.Controls.Add(Me.TbAlookahead) + Me.PnLookAhead.Controls.Add(Me.Label24) + Me.PnLookAhead.Controls.Add(Me.TbVminLA) + Me.PnLookAhead.Controls.Add(Me.Label28) + Me.PnLookAhead.Location = New System.Drawing.Point(117, 10) + Me.PnLookAhead.Name = "PnLookAhead" + Me.PnLookAhead.Size = New System.Drawing.Size(252, 71) + Me.PnLookAhead.TabIndex = 1 + ' + 'Label28 + ' + Me.Label28.AutoSize = True + Me.Label28.Location = New System.Drawing.Point(26, 38) + Me.Label28.Name = "Label28" + Me.Label28.Size = New System.Drawing.Size(95, 13) + Me.Label28.TabIndex = 1 + Me.Label28.Text = "Min. Target Speed" + ' + 'TbVminLA + ' + Me.TbVminLA.Location = New System.Drawing.Point(127, 35) + Me.TbVminLA.Name = "TbVminLA" + Me.TbVminLA.Size = New System.Drawing.Size(64, 20) + Me.TbVminLA.TabIndex = 2 + ' + 'Label29 + ' + Me.Label29.AutoSize = True + Me.Label29.Location = New System.Drawing.Point(197, 38) + Me.Label29.Name = "Label29" + Me.Label29.Size = New System.Drawing.Size(38, 13) + Me.Label29.TabIndex = 3 + Me.Label29.Text = "[km/h]" + ' 'F_GEN ' Me.AcceptButton = Me.ButOK @@ -1781,8 +2054,14 @@ Partial Class F_GEN Me.TabControl1.ResumeLayout(False) Me.TabPgDriver.ResumeLayout(False) Me.TabPgDriver.PerformLayout() + Me.GroupBox4.ResumeLayout(False) + Me.GroupBox4.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() Me.GrStartStop.ResumeLayout(False) Me.GrStartStop.PerformLayout() + Me.PnStartStop.ResumeLayout(False) + Me.PnStartStop.PerformLayout() Me.TabPgKF.ResumeLayout(False) Me.GroupBox2.ResumeLayout(False) Me.GroupBox2.PerformLayout() @@ -1796,6 +2075,8 @@ Partial Class F_GEN Me.ToolStrip1.PerformLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.CmOpenFile.ResumeLayout(False) + Me.PnLookAhead.ResumeLayout(False) + Me.PnLookAhead.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -1952,4 +2233,29 @@ Partial Class F_GEN Friend WithEvents TBSStime As System.Windows.Forms.TextBox Friend WithEvents LabelSStime As System.Windows.Forms.Label Friend WithEvents LabelSSspeed As System.Windows.Forms.Label + Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox + Friend WithEvents Label25 As System.Windows.Forms.Label + Friend WithEvents CbLookAhead As System.Windows.Forms.CheckBox + Friend WithEvents TbAlookahead As System.Windows.Forms.TextBox + Friend WithEvents Label24 As System.Windows.Forms.Label + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents Label21 As System.Windows.Forms.Label + Friend WithEvents Label20 As System.Windows.Forms.Label + Friend WithEvents Label14 As System.Windows.Forms.Label + Friend WithEvents TbVmin As System.Windows.Forms.TextBox + Friend WithEvents TbUnderSpeed As System.Windows.Forms.TextBox + Friend WithEvents TbOverspeed As System.Windows.Forms.TextBox + Friend WithEvents Label23 As System.Windows.Forms.Label + Friend WithEvents Label22 As System.Windows.Forms.Label + Friend WithEvents Label13 As System.Windows.Forms.Label + Friend WithEvents RdEcoRoll As System.Windows.Forms.RadioButton + Friend WithEvents RdOverspeed As System.Windows.Forms.RadioButton + Friend WithEvents RdOff As System.Windows.Forms.RadioButton + Friend WithEvents PnStartStop As System.Windows.Forms.Panel + Friend WithEvents Label27 As System.Windows.Forms.Label + Friend WithEvents Label26 As System.Windows.Forms.Label + Friend WithEvents PnLookAhead As System.Windows.Forms.Panel + Friend WithEvents Label29 As System.Windows.Forms.Label + Friend WithEvents TbVminLA As System.Windows.Forms.TextBox + Friend WithEvents Label28 As System.Windows.Forms.Label End Class diff --git a/VECTO/GUI/F_GEN.vb b/VECTO/GUI/F_GEN.vb index 6b72e993e047c74537fe06a856bfaafb83f3d08c..a2630362efc2b425aff8ff7ce7e9fde94ed6ea84 100644 --- a/VECTO/GUI/F_GEN.vb +++ b/VECTO/GUI/F_GEN.vb @@ -686,6 +686,22 @@ Public Class F_GEN Me.CbEngOnly.Checked = Gfile.EngOnly + If Gfile.EcoRollOn Then + Me.RdEcoRoll.Checked = True + ElseIf Gfile.OverSpeedOn Then + Me.RdOverspeed.Checked = True + Else + Me.RdOff.Checked = True + End If + Me.TbOverspeed.Text = CStr(Gfile.OverSpeed) + Me.TbUnderSpeed.Text = CStr(Gfile.UnderSpeed) + Me.TbVmin.Text = CStr(Gfile.vMin) + Me.CbLookAhead.Checked = Gfile.LookAheadOn + Me.TbAlookahead.Text = CStr(Gfile.a_lookahead) + Me.TbVminLA.Text = CStr(Gfile.vMinLA) + + + '------------------------------------------------------------- Gfile = Nothing @@ -814,6 +830,16 @@ Public Class F_GEN g.EngOnly = Me.CbEngOnly.Checked + g.EcoRollOn = RdEcoRoll.Checked + g.OverSpeedOn = RdOverspeed.Checked + g.OverSpeed = CSng(fTextboxToNumString(Me.TbOverspeed.Text)) + g.UnderSpeed = CSng(fTextboxToNumString(Me.TbUnderSpeed.Text)) + g.vMin = CSng(fTextboxToNumString(Me.TbVmin.Text)) + g.LookAheadOn = Me.CbLookAhead.Checked + g.a_lookahead = CSng(fTextboxToNumString(Me.TbAlookahead.Text)) + g.vMinLA = CSng(fTextboxToNumString(Me.TbVminLA.Text)) + + '------------------------------------------------------------ 'SAVE @@ -925,6 +951,14 @@ Public Class F_GEN Me.CbEngOnly.Checked = False + Me.RdOff.Checked = True + Me.CbLookAhead.Checked = True + Me.TbAlookahead.Text = "-0.5" + Me.TbOverspeed.Text = "" + Me.TbUnderSpeed.Text = "" + Me.TbVmin.Text = "" + Me.TbVminLA.Text = "50" + '--------------------------------------------------- Genfile = "" @@ -1072,6 +1106,22 @@ Public Class F_GEN Change() End Sub + Private Sub TbOverspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbOverspeed.TextChanged + Change() + End Sub + + Private Sub TbUnderSpeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbUnderSpeed.TextChanged + Change() + End Sub + + Private Sub TbVmin_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbVmin.TextChanged, TbVminLA.TextChanged + Change() + End Sub + + Private Sub TbAlookahead_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbAlookahead.TextChanged + Change() + End Sub + #End Region @@ -1327,9 +1377,44 @@ lbDlog: Private Sub ChBStartStop_CheckedChanged_1(sender As System.Object, e As System.EventArgs) Handles ChBStartStop.CheckedChanged Change() - Me.GrStartStop.Enabled = Me.ChBStartStop.Checked + Me.PnStartStop.Enabled = Me.ChBStartStop.Checked End Sub + +#Region "Overspeed / Eco-Roll / Look Ahead" + + Private Sub CbLookAhead_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CbLookAhead.CheckedChanged + Change() + Me.PnLookAhead.Enabled = CbLookAhead.Checked + + End Sub + + Private Sub RdOff_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RdOff.CheckedChanged, RdOverspeed.CheckedChanged, RdEcoRoll.CheckedChanged + Dim EcoR As Boolean + Dim Ovr As Boolean + + Change() + + EcoR = Me.RdEcoRoll.Checked + Ovr = Me.RdOverspeed.Checked + + Me.TbOverspeed.Enabled = Ovr Or EcoR + Me.Label13.Enabled = Ovr Or EcoR + Me.Label14.Enabled = Ovr Or EcoR + + Me.TbUnderSpeed.Enabled = EcoR + Me.Label22.Enabled = EcoR + Me.Label20.Enabled = EcoR + + Me.TbVmin.Enabled = Ovr Or EcoR + Me.Label23.Enabled = Ovr Or EcoR + Me.Label21.Enabled = Ovr Or EcoR + + End Sub + +#End Region + + #Region "Open File Context Menu" Private CmFiles As String() @@ -1369,7 +1454,6 @@ lbDlog: #End Region - - + End Class diff --git a/VECTO/GUI/F_MAINForm.Designer.vb b/VECTO/GUI/F_MAINForm.Designer.vb index 0a8d565786f7b23908627fcf536fddd120ed135c..4615895b103389827f0478341e9b42756b5bb979 100644 --- a/VECTO/GUI/F_MAINForm.Designer.vb +++ b/VECTO/GUI/F_MAINForm.Designer.vb @@ -103,6 +103,7 @@ Partial Class F_MAINForm Me.EngineEditorToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GearboxEditorToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ADVEditorToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() + Me.GRAPHiToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.CreateTEMFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SplitMODFilesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -872,7 +873,7 @@ Partial Class F_MAINForm ' 'ToolStripDrDnBtTools ' - Me.ToolStripDrDnBtTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GENEditorToolStripMenuItem1, Me.VEHEditorToolStripMenuItem, Me.EngineEditorToolStripMenuItem, Me.GearboxEditorToolStripMenuItem, Me.ADVEditorToolStripMenuItem1, Me.ToolStripSeparator1, Me.CreateTEMFileToolStripMenuItem, Me.SplitMODFilesToolStripMenuItem, Me.ToolStripSeparator4, Me.OpenLogToolStripMenuItem, Me.ChangeWorkingDirectoryToolStripMenuItem1, Me.SettingsToolStripMenuItem}) + Me.ToolStripDrDnBtTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GENEditorToolStripMenuItem1, Me.VEHEditorToolStripMenuItem, Me.EngineEditorToolStripMenuItem, Me.GearboxEditorToolStripMenuItem, Me.ADVEditorToolStripMenuItem1, Me.GRAPHiToolStripMenuItem, Me.ToolStripSeparator1, Me.CreateTEMFileToolStripMenuItem, Me.SplitMODFilesToolStripMenuItem, Me.ToolStripSeparator4, Me.OpenLogToolStripMenuItem, Me.ChangeWorkingDirectoryToolStripMenuItem1, Me.SettingsToolStripMenuItem}) Me.ToolStripDrDnBtTools.Image = Global.VECTO.My.Resources.Resources.Misc_Tools_icon Me.ToolStripDrDnBtTools.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripDrDnBtTools.Name = "ToolStripDrDnBtTools" @@ -910,6 +911,12 @@ Partial Class F_MAINForm Me.ADVEditorToolStripMenuItem1.Text = "ADV Editor" Me.ADVEditorToolStripMenuItem1.Visible = False ' + 'GRAPHiToolStripMenuItem + ' + Me.GRAPHiToolStripMenuItem.Name = "GRAPHiToolStripMenuItem" + Me.GRAPHiToolStripMenuItem.Size = New System.Drawing.Size(214, 22) + Me.GRAPHiToolStripMenuItem.Text = "GRAPHi" + ' 'ToolStripSeparator1 ' Me.ToolStripSeparator1.Name = "ToolStripSeparator1" @@ -1165,5 +1172,6 @@ Partial Class F_MAINForm Friend WithEvents OpenWithGRAPHiToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Friend WithEvents OpenWithToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Friend WithEvents ShowInFolderToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents GRAPHiToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem End Class diff --git a/VECTO/GUI/F_MAINForm.vb b/VECTO/GUI/F_MAINForm.vb index 275c7e68d86865bbeeec4f5d966a2063320aeeb0..658d24fb266a9782df864d61fbe98e852988db8e 100644 --- a/VECTO/GUI/F_MAINForm.vb +++ b/VECTO/GUI/F_MAINForm.vb @@ -40,11 +40,15 @@ Public Class F_MAINForm Private Declare Function SetThreadExecutionState Lib "kernel32" (ByVal esFlags As Long) As Long Private Sub AllowSleepOFF() +#If Not PLATFORM = "x86" Then SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS Or tEXECUTION_STATE.ES_SYSTEM_REQUIRED) +#End If End Sub Private Sub AllowSleepON() - SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS) +#If Not PLATFORM = "x86" Then + SetThreadExecutionState(tEXECUTION_STATE.ES_CONTINUOUS) +#End If End Sub Private Enum tEXECUTION_STATE As Integer @@ -1316,6 +1320,17 @@ lbFound: End If End Sub + Private Sub GRAPHiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GRAPHiToolStripMenuItem.Click + Dim PSI As New ProcessStartInfo + Dim fileStr As String = "" + PSI.FileName = ChrW(34) & MyAppPath & "GRAPHi\GRAPHi.exe" & ChrW(34) + Try + Process.Start(PSI) + Catch ex As Exception + MsgBox("Failed to open GRAPHi!", MsgBoxStyle.Critical) + End Try + End Sub + Private Sub CreateTEMFileToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CreateTEMFileToolStripMenuItem.Click F_TEM_Creator.Show() @@ -2124,7 +2139,7 @@ lbFound: If Link <> "" Then - If ID = tMsgID.Normal Then lv0.ForeColor = Color.Blue + lv0.ForeColor = Color.Blue lv0.SubItems(0).Font = New Font(Me.LvMsg.Font, FontStyle.Underline) lv0.Tag = Link @@ -2203,4 +2218,5 @@ lbFound: #End Region + End Class diff --git a/VECTO/Input Files/cDRI.vb b/VECTO/Input Files/cDRI.vb index 87f6f9889508af52a6558548a936e5e569477b80..7787c1795f05e23816c6bc8292ce230e57654d60 100644 --- a/VECTO/Input Files/cDRI.vb +++ b/VECTO/Input Files/cDRI.vb @@ -465,7 +465,7 @@ Public Class cDRI Loop Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & tDim + 1 & " (" & sFilePath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & tDim + 1 & " (" & sFilePath & ")", MsgSrc, sFilePath) GoTo lbEr End Try @@ -564,7 +564,7 @@ lbEr: If GNok Then GNlist.Add(CDbl(line(3))) If PaddVorg Then Values(tDriComp.Padd).Add(CDbl(line(4))) Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & tDim + 1 & " (" & sFilePath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & tDim + 1 & " (" & sFilePath & ")", MsgSrc, sFilePath) Return False End Try @@ -807,6 +807,7 @@ lbEr: Next + '*********************************** Create Time-sequence '*********************************** t = 0 s = Dist(0) @@ -994,6 +995,7 @@ lbEr: Values = hzValues VoglS = hzSpeedOgl + MODdata.Vh.Weg = hzDist If bExsCompDef Then ExsComponents = hzExsValues If bAuxDef Then AuxComponents = hzAuxValues tDim = Values(tDriComp.V).Count - 1 diff --git a/VECTO/Input Files/cFLD.vb b/VECTO/Input Files/cFLD.vb index ececd0ba77970e2bef3d599968551b418dd7f1d5..42aa692848c0098f88e519b0bf1dbf0bb87aa189 100644 --- a/VECTO/Input Files/cFLD.vb +++ b/VECTO/Input Files/cFLD.vb @@ -300,7 +300,7 @@ Public Class cFLD Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & iDim + 1 & " (" & sFilePath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & iDim + 1 & " (" & sFilePath & ")", MsgSrc, sFilePath) GoTo lbEr End Try diff --git a/VECTO/Input Files/cGEN.vb b/VECTO/Input Files/cGEN.vb index 163649c19c66a2cecbb6e2d44199850931628d4a..14fc94eaa866ea8655339b94d451e42df706e261 100644 --- a/VECTO/Input Files/cGEN.vb +++ b/VECTO/Input Files/cGEN.vb @@ -87,6 +87,15 @@ Public Class cGEN Public EngOnly As Boolean + Public a_lookahead As Single + Public vMin As Single + Public vMinLA As Single + Public LookAheadOn As Boolean + Public OverSpeedOn As Boolean + Public OverSpeed As Single + Public UnderSpeed As Single + Public EcoRollOn As Boolean + Public Sub New() @@ -354,6 +363,17 @@ Public Class cGEN siStStV = CSng(file.ReadLine(0)) siStStT = CSng(file.ReadLine(0)) + If file.EndOfFile Then GoTo lbClose + + a_lookahead = CSng(file.ReadLine(0)) + vMin = CSng(file.ReadLine(0)) + LookAheadOn = CBool(file.ReadLine(0)) + OverSpeedOn = CBool(file.ReadLine(0)) + EcoRollOn = CBool(file.ReadLine(0)) + OverSpeed = CSng(file.ReadLine(0)) + UnderSpeed = CSng(file.ReadLine(0)) + vMinLA = CSng(file.ReadLine(0)) + lbClose: file.Close() @@ -716,6 +736,26 @@ lbClose: fGEN.WriteLine("c Start/Stop Min ICE-On Time [s]") fGEN.WriteLine(siStStT) + + fGEN.WriteLine("c Look Ahead reference deceleration [m/2²]") + fGEN.WriteLine(CStr(a_lookahead)) + fGEN.WriteLine("c Minimum target speed for Overspeed/Eco-Roll [km/h]") + fGEN.WriteLine(CStr(vMin)) + fGEN.WriteLine("c Look-Ahead with Coasting 1/0") + fGEN.WriteLine(CStr(Math.Abs(CInt(LookAheadOn)))) + fGEN.WriteLine("c Overspeed 1/0") + fGEN.WriteLine(CStr(Math.Abs(CInt(OverSpeedOn)))) + fGEN.WriteLine("c Eco-Roll 1/0") + fGEN.WriteLine(CStr(Math.Abs(CInt(EcoRollOn)))) + fGEN.WriteLine("c Allowed OverSpeed [km/h]") + fGEN.WriteLine(CStr(OverSpeed)) + fGEN.WriteLine("c Allowed UnderSpeed [km/h]") + fGEN.WriteLine(CStr(UnderSpeed)) + fGEN.WriteLine("c Minimum target speed for Look-Ahead with Coasting [km/h]") + fGEN.WriteLine(CStr(vMinLA)) + + + fGEN.Close() fGEN = Nothing @@ -798,6 +838,15 @@ lbClose: EngOnly = False + a_lookahead = 0 + vMin = 0 + LookAheadOn = True + OverSpeedOn = False + EcoRollOn = False + OverSpeed = 0 + UnderSpeed = 0 + vMinLA = 0 + End Sub 'This Sub reads those Input-files that do not have their own class, etc. @@ -1339,7 +1388,7 @@ lbClose: 'Extrapolation for x < x(1) If laDesV(0) >= v Then - If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v + If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]" i = 1 GoTo lbInt End If @@ -1351,7 +1400,7 @@ lbClose: 'Extrapolation for x > x(imax) If laDesV(i) < v Then - MODdata.ModErrors.DesMaxExtr = "v= " & v + MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]" End If lbInt: @@ -1365,7 +1414,7 @@ lbInt: 'Extrapolation for x < x(1) If laDesV(0) >= v Then - If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v + If laDesV(0) > v Then MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]" i = 1 GoTo lbInt End If @@ -1377,7 +1426,7 @@ lbInt: 'Extrapolation for x > x(imax) If laDesV(i) < v Then - MODdata.ModErrors.DesMaxExtr = "v= " & v + MODdata.ModErrors.DesMaxExtr = "v= " & v * 3.6 & "[km/h]" End If lbInt: diff --git a/VECTO/Input Files/cMAP.vb b/VECTO/Input Files/cMAP.vb index 88f64af355fd0c3e57fe3ac79949c5b1a91581a1..2f29f8dc532fe240011e69ac92d5c3b4e93fcb39 100644 --- a/VECTO/Input Files/cMAP.vb +++ b/VECTO/Input Files/cMAP.vb @@ -466,7 +466,7 @@ Public Class cMAP Loop Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file input! Line number " & iMapDim + 1 & " (" & sFilePath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file input! Line number " & iMapDim + 1 & " (" & sFilePath & ")", MsgSrc, sFilePath) GoTo lbEr End Try @@ -951,7 +951,7 @@ lbEr: Return FuelMap.Intpol(nnorm, Pnorm) Catch ex As Exception WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nnormTonU(nnorm).ToString("0") & " [U/min], Me= " & PnormToM(nnorm, Pnorm).ToString("0.0") & " [Nm]", "MAP/FC_Intp") - Return -1000 + Return -10000 End Try End Function diff --git a/VECTO/Input Files/cTRS.vb b/VECTO/Input Files/cTRS.vb index 4cf5ad20c39663fa4eb2798c66f6ea953ef92c52..fe24513f04f3b24ace8ae3193ccf8d4195c4f52b 100644 --- a/VECTO/Input Files/cTRS.vb +++ b/VECTO/Input Files/cTRS.vb @@ -124,7 +124,7 @@ Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & l & " (" & sFilePath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & l & " (" & sFilePath & ")", MsgSrc, sFilePath) GoTo lbEr End Try diff --git a/VECTO/Input Files/cVEH.vb b/VECTO/Input Files/cVEH.vb index 386cacc167a5462d37f92aa5f6d55903524fe996..1fe83e6d5d2630dc1ee4aded21d898a3c6e204d6 100644 --- a/VECTO/Input Files/cVEH.vb +++ b/VECTO/Input Files/cVEH.vb @@ -566,7 +566,7 @@ lbError: 'old version: Power instead of torque: GBmap0.AddPoints(nU, nMtoPe(nU, M_out), nMtoPe(nU, M_in)) GBmap0.AddPoints(nU, M_out, M_in) Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & l & " (" & path & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & l & " (" & path & ")", MsgSrc, path) file.Close() MyGBmaps = Nothing Return False @@ -576,7 +576,7 @@ lbError: file.Close() If Not GBmap0.Triangulate Then - WorkerMsg(tMsgID.Err, "Map triangulation failed! File: " & path, MsgSrc) + WorkerMsg(tMsgID.Err, "Map triangulation failed! File: " & path, MsgSrc, path) MyGBmaps = Nothing Return False End If @@ -967,7 +967,7 @@ lbAuxError: CdX.Add(CSng(line(0))) CdY.Add(CSng(line(1))) Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & CdDim + 1 & " (" & CdFile.FullPath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & CdDim + 1 & " (" & CdFile.FullPath & ")", MsgSrc, CdFile.FullPath) file.Close() Return False End Try @@ -977,7 +977,7 @@ lbAuxError: file.Close() If CdDim < 1 Then - WorkerMsg(tMsgID.Err, "Cd input file invalid! Two or more lines required! (" & CdFile.FullPath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Cd input file invalid! Two or more lines required! (" & CdFile.FullPath & ")", MsgSrc, CdFile.FullPath) Return False End If @@ -1059,7 +1059,7 @@ lbInt: RtnU.Add(CSng(line(0))) RtM.Add(CSng(line(1))) Catch ex As Exception - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & RtDim + 1 & " (" & RtFile.FullPath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & RtDim + 1 & " (" & RtFile.FullPath & ")", MsgSrc, RtFile.FullPath) file.Close() Return False End Try @@ -1069,7 +1069,7 @@ lbInt: file.Close() If RtDim < 1 Then - WorkerMsg(tMsgID.Err, "Retarder input file invalid! Two or more lines required! (" & RtFile.FullPath & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "Retarder input file invalid! Two or more lines required! (" & RtFile.FullPath & ")", MsgSrc, RtFile.FullPath) Return False End If diff --git a/VECTO/MODcalc/cPower.vb b/VECTO/MODcalc/cPower.vb index fa1204de0efcd8a23e91431294aa4926f7d7a4d7..26c03251827d4c0e2e1d539620daa87d31c7e0a4 100644 --- a/VECTO/MODcalc/cPower.vb +++ b/VECTO/MODcalc/cPower.vb @@ -390,6 +390,339 @@ lb10: #End Region + Public Function PreRun() As Boolean + Dim i As Integer + Dim i0 As Integer + Dim Vh As cVh + Dim P As Single + Dim Pmin As Single + Dim Pmax As Single + Dim PlossGB As Single + Dim PlossDiff As Single + Dim PlossRt As Single + Dim PaMot As Single + Dim PaGetr As Single + Dim Pkup As Single + Dim Paux As Single + Dim Gear As Integer + Dim nU As Single + Dim nn As Single + Dim vCoasting As Single + Dim Positions As New List(Of Short) + Dim Vmax As Single + Dim Vmin As Single + Dim Tlookahead As Integer + Dim vset1 As Single + Dim vset2 As Single + Dim j As Integer + Dim t As Integer + Dim adec As Single + Dim LookAheadDone As Boolean + Dim aCoasting As Single + Dim aRollout As Single + Dim Gears As New List(Of Integer) + Dim vRollout As Single + + Dim MsgSrc As String + + MsgSrc = "Power/PreRun" + + 'Check Input + If GEN.a_lookahead >= 0 Then + WorkerMsg(tMsgID.Err, "Lookahead deceleration invalid! Value must be below zero.", MsgSrc) + Return False + End If + + If GEN.OverSpeedOn And GEN.EcoRollOn Then + WorkerMsg(tMsgID.Err, "Overrun and Ecoroll can't be enabled both at the same time!", MsgSrc) + Return False + End If + + ' Initialize + Vh = MODdata.Vh + Gvorg = DRI.Gvorg + Nvorg = DRI.Nvorg + + 'Generate Positions List + For i = 0 To MODdata.tDim + Positions.Add(0) + Next + + '*** Positions *** + '0... Normal (Cruise/Acc) + '1... Brake or Coasting + '2... Brake corrected with v(a) (.vacc file) + '3... Coasting + '4... Eco-Roll + + 'Overspeed / Eco-Roll Loop (Forward) + i = -1 + Do + i += 1 + + Vist = Vh.V(i) + aist = Vh.a(i) + + 'Determine Driving-state ------------------------- + Pplus = False + Pminus = False + + If Vist < 0.0001 Then + VehState0 = tVehState.Stopped + Else + If aist >= 0.01 Then + VehState0 = tVehState.Acc + ElseIf aist < -0.01 Then + VehState0 = tVehState.Dec + Else + VehState0 = tVehState.Cruise + End If + End If + + 'Wheel-Power + PvorD = fPvD(i) + + Select Case PvorD + Case Is > 0.0001 + Pplus = True + Case Is < -0.0001 + Pminus = True + Case Else + P = 0 + End Select + + 'Gear + If VehState0 = tVehState.Stopped Then + Gear = 0 + Else + If Gvorg Then + Gear = Math.Min(Vh.GearVorg(i), VEH.ganganz) + Else + Gear = fFastGearCalc(Vist, PvorD) + End If + End If + + 'Engine Speed + 'ICE-inertia + If Nvorg Then + nU = MODdata.nUvorg(i) + PaMot = (VEH.I_mot * MODdata.dnUvorg(i) * 0.01096 * MODdata.nUvorg(i)) * 0.001 + Else + nU = fnU(Vist, Gear, False) + PaMot = ((VEH.I_mot * (VEH.AchsI * VEH.Igetr(Gear) / (0.5 * VEH.Dreifen)) ^ 2) * aist * Vist) * 0.001 + End If + + nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + + 'Aux Demand + Paux = fPaux(i, nU) + + 'Engine Power (at Clutch) + If Pplus Or Pminus Then + + PlossGB = fPlossGB(PvorD, Vist, Gear) + PlossDiff = fPlossDiff(PvorD, Vist) + PlossRt = fPlossRt(Vist, Gear) + PaGetr = fPaG(Vist, aist) + + Pkup = PvorD + PlossGB + PlossDiff + PaGetr + PlossRt + P = Pkup + Paux + PaMot + + Else + + Pkup = 0 + P = Paux + PaMot + + End If + + 'Full load / motoring + Pmax = FLD.Pfull(nn) + Pmin = FLD.Pdrag(nn) + + If Vh.Vsoll(i) >= GEN.vMin / 3.6 Then + + If GEN.EcoRollOn Then + + If Vh.Grad(i) < 0 Then + + Vmax = MODdata.Vh.Vsoll(i) + GEN.OverSpeed / 3.6 + Vmin = Math.Max(0, MODdata.Vh.Vsoll(i) - GEN.UnderSpeed / 3.6) + vRollout = fRolloutSpeed(i, 1) + aRollout = (2 * vRollout - Vh.V0(i)) - Vh.V0(i) + + If vRollout <= Vmax Then + + If 2 * vRollout - Vh.V0(i) > Vmax Then + Vh.SetSpeed0(i, Vmax) + ElseIf 2 * vRollout - Vh.V0(i) < Vmin Then + Vh.SetSpeed0(i, Vmin) + Else + Vh.SetSpeed(i, vRollout) + 'Vh.SetAcc(i, aRollout) + End If + + Positions(i) = 4 + Vh.EcoRoll(i) = True + + Else + + If 2 * Vmax - Vh.V0(i) >= Vmax Then + Vh.SetSpeed0(i, Vmax) + Else + Vh.SetSpeed(i, Vmax) + End If + + Positions(i) = 1 + + End If + + + End If + + Else + + If P < Pmin Then + + If GEN.OverSpeedOn Then + + vCoasting = fCoastingSpeed(i, Gear, False) + Vmax = MODdata.Vh.Vsoll(i) + GEN.OverSpeed / 3.6 + + If vCoasting <= Vmax Then + + If 2 * vCoasting - Vh.V0(i) > Vmax Then + Vh.SetSpeed0(i, Vmax) + Else + Vh.SetSpeed(i, vCoasting) + End If + + Else + + If 2 * Vmax - Vh.V0(i) > Vmax Then + Vh.SetSpeed0(i, Vmax) + Else + Vh.SetSpeed(i, Vmax) + End If + + End If + + End If + + End If + + End If + + End If + + + Gears.Add(Gear) + + Loop Until i >= MODdata.tDim + + + 'Look Ahead & Limit Acc (Backward) + + 'Mark Brake Positions + For i = MODdata.tDim To 1 Step -1 + If Vh.V(i - 1) - Vh.V(i) > 0.0001 And Not Positions(i) = 4 Then Positions(i) = 1 + Next + + 'Mark Look-Ahead Coasting Positions + i = MODdata.tDim + 1 + Do + i -= 1 + + If Positions(i) = 1 Then + vset2 = Vh.V(i) + For j = i To 0 Step -1 + If Positions(j) = 0 Or Positions(j) = 4 Then + vset1 = Vh.V(j) + Exit For + End If + Next + + Tlookahead = CInt((vset2 - vset1) / GEN.a_lookahead) + + t = Math.Max(0, i - Tlookahead) + LookAheadDone = False + + adec = GEN.aDesMin(Vist) + If Vh.a(i) < adec Then Vh.SetAccBackw(i, adec) + + i0 = i + + Do + i -= 1 + aist = Vh.a(i) + Vist = Vh.V(i) + adec = GEN.aDesMin(Vist) + + If aist < adec Then + Vh.SetAccBackw(i, adec) + Positions(i) = 2 + Else + 'Coasting (Forward) + If GEN.LookAheadOn And Vh.Vsoll(i) >= GEN.vMinLA / 3.6 Then + + For j = t To i0 + Vist = Vh.V(j) + vCoasting = fCoastingSpeed(j, Gears(j), True) + aCoasting = (2 * vCoasting - Vh.V0(j)) - Vh.V0(j) + If vCoasting < Vist And aCoasting >= GEN.aDesMin(Vist) Then + 'If Vrollout < Vist Then + Vh.SetSpeed(j, vCoasting) + Positions(j) = 3 + Else + Exit For + End If + Next + + End If + + LookAheadDone = True + End If + + Loop Until LookAheadDone + + 'Correct distance error + 'If t - 1 > 0 Then + ' DistError = 0 + ' For i = t To i0 + ' DistError += (Vh.Vsoll(i) - Vh.V(i)) + ' Next + + ' DistError0 = DistError + + ' Do While DistError - Vh.V(t) > 0 'Math.Abs(DistError - Vh.V(t - 1)) < Math.Abs(DistError) + ' Vh.DuplicatePreRun(t - 1) + ' DistError -= Vh.V(t) + ' MODdata.tDim += 1 + ' Loop + + + + ' 'Vh.Weg(i0) += DistError0 + + ' 'For i = t To i0 + ' ' Vh.NoDistCorr(i) = True + ' 'Next + + ' 'For i = i0 To 0 Step -1 + ' ' Vh.Weg(i) -= DistError0 + ' 'Next + + 'End If + + i = i0 + + End If + + Loop Until i = 0 + + Return True + + End Function + Public Function Calc() As Boolean Dim i As Integer @@ -439,10 +772,6 @@ lb10: Dim LastPmax As Single - Dim Vcoasting As Single - - - Dim MsgSrc As String MsgSrc = "Power/Calc" @@ -561,6 +890,7 @@ lb10: 'Secondary Progressbar If NotAdvMode Then ProgBarCtrl.ProgJobInt = CInt(100 * jz / MODdata.tDim) + ' Determine State lbGschw: @@ -748,6 +1078,12 @@ lbGschw: Return False End If + 'Eco-Roll + If Vh.EcoRoll(jz) AndAlso Math.Abs(PvorD) < 0.01 * VEH.Pnenn Then + Clutch = tEngClutch.Opened + Gear = 0 + + End If ' Important checks lbCheck: @@ -1040,10 +1376,10 @@ lb_nOK: 'If Pmax < 0 or Pmin > 0 then Abort with Error! If Pmin >= 0 And P < 0 Then - WorkerMsg(tMsgID.Err, "Pe_drag > 0! n_norm= " & nn, MsgSrc & "/t= " & jz + 1) + WorkerMsg(tMsgID.Err, "Pe_drag > 0! n= " & nU & " [1/min]", MsgSrc & "/t= " & jz + 1, FLD.FilePath) Return False ElseIf Pmax <= 0 And P > 0 Then - WorkerMsg(tMsgID.Err, "Pe_full < 0! n_norm= " & nn, MsgSrc & "/t= " & jz + 1) + WorkerMsg(tMsgID.Err, "Pe_full < 0! n= " & nU & " [1/min]", MsgSrc & "/t= " & jz + 1, FLD.FilePath) Return False End If @@ -1068,16 +1404,24 @@ lb_nOK: If P < Pmin Then 'Overspeed - If DEV.OverSpeedOn Then - Vcoasting = fCoastingSpeed(jz, Gear, nU, Pmin) + 'If Not OvrSpeed AndAlso Not VehState0 = tVehState.Dec Then + ' OvrSpeed = True + ' If DEV.OverSpeedOn And (Pmin - P) / VEH.Pnenn > DEV.SpeedPeEps Then - End If - - + ' Vcoasting = fCoastingSpeed(jz, Gear) + ' If Vcoasting <= MODdata.Vh.Vsoll(jz) + DEV.OverSpeed / 3.6 Then + ' Vh.SetSpeed(jz, Vcoasting) + ' GoTo lbGschw + ' ElseIf Vist < 0.999 * (MODdata.Vh.Vsoll(jz) + DEV.OverSpeed / 3.6) Then + ' Vh.SetSpeed(jz, MODdata.Vh.Vsoll(jz) + DEV.OverSpeed / 3.6) + ' GoTo lbGschw + ' End If + ' End If + 'End If MODdata.ModErrors.TrLossMapExtr = "" @@ -1301,7 +1645,7 @@ lb_nOK: If NotAdvMode Then If Cfg.WegKorJa Then - If MODdata.tDim > MODdata.tDimOgl Then WorkerMsg(tMsgID.Normal, "Cycle extended by " & MODdata.tDim - MODdata.tDimOgl & " seconds.", MsgSrc) + If MODdata.tDim > MODdata.tDimOgl Then WorkerMsg(tMsgID.Normal, "Cycle extended by " & MODdata.tDim - MODdata.tDimOgl & " seconds to meet target distance.", MsgSrc) End If If SecSpeedRed > 0 Then WorkerMsg(tMsgID.Normal, "Speed reduction > 1.5 m/s in " & SecSpeedRed & " time steps.", MsgSrc) @@ -1388,10 +1732,10 @@ lb_nOK: 'If Pmax < 0 or Pmin > 0 then Abort with Error! If PminN >= 0 AndAlso MODdata.Pe(t) < 0 Then - WorkerMsg(tMsgID.Err, "Pe_drag > 0! n_norm= " & MODdata.nn(t), MsgSrc & "/t= " & t + 1) + WorkerMsg(tMsgID.Err, "Pe_drag > 0! n= " & MODdata.nU(t) & " [1/min]", MsgSrc & "/t= " & t + 1, FLD.FilePath) Return False ElseIf PmaxN <= 0 AndAlso MODdata.Pe(t) > 0 Then - WorkerMsg(tMsgID.Err, "Pe_full < 0! n_norm= " & MODdata.nn(t), MsgSrc & "/t= " & t + 1) + WorkerMsg(tMsgID.Err, "Pe_full < 0! n= " & MODdata.nU(t) & " [1/min]", MsgSrc & "/t= " & t + 1, FLD.FilePath) Return False End If @@ -1455,7 +1799,7 @@ lb_nOK: If v <= vMin Then Return vMin vstep = 0.1 - eps = 0.001 + eps = 0.00005 a = MODdata.Vh.a(t) PvD = fPvD(t, v, a) @@ -1482,7 +1826,7 @@ lb_nOK: v += vVorz * vstep - If v < vmin Then + If v < vMin Then LastPvD = 0 v -= vVorz * vstep @@ -1503,52 +1847,54 @@ lb_nOK: End Function - - - - Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer, ByVal nU As Single, ByVal Pdrag As Single) As Single + Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer, ByVal NoPosGrad As Boolean) As Single Dim vstep As Double Dim vVorz As Integer Dim Pe As Single Dim a As Single Dim v As Single - Dim eps As Single Dim PvD As Single Dim LastDiff As Single Dim Diff As Single + Dim nU As Single + Dim Pdrag As Single + Dim Grad As Single v = MODdata.Vh.V(t) vstep = 0.1 - eps = 0.001 a = MODdata.Vh.a(t) + nU = fnU(v, Gear, False) + Pdrag = FLD.Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) - 'PlossGB = fPlossGBfwd(Pkup, v, Gear) - 'Pe = fPvD(t, v, a) + PlossGB + fPlossDiffFwd(Pkup - PlossGB, Vist) + fPaG(v, a) + fPlossRt(v, Gear) + 'Do not allow positive road gradients + If NoPosGrad Then + Grad = Math.Min(MODdata.Vh.Grad(t), 0) + Else + Grad = MODdata.Vh.Grad(t) + End If - PvD = fPvD(t, v, a) - Pe = PvD + fPlossGB(PvD, v, Gear) + fPlossDiff(PvD, v) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear) + PvD = fPvD(t, v, a, Grad) + Pe = PvD + fPlossGB(PvD, v, Gear) + fPlossDiff(PvD, v) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear, v, a) Diff = Math.Abs(Pdrag - Pe) / VEH.Pnenn - If Diff > eps Then - vVorz = -1 - ElseIf PvD < -eps Then + If Diff > DEV.SpeedPeEps Then vVorz = 1 Else Return v End If - LastDiff = Math.Abs(Pdrag - Pe) / VEH.Pnenn + LastDiff = Diff + 10 * DEV.SpeedPeEps - Do While Diff > eps And Math.Abs(LastDiff - Diff) > eps + Do While Diff > DEV.SpeedPeEps 'And Math.Abs(LastDiff - Diff) > eps - If LastDiff < Diff Then + If LastDiff < Diff Or v + vVorz * vstep <= 0.0001 Then vVorz *= -1 vstep *= 0.5 - If vstep = 0 Then Exit Do + If vstep < 0.00001 Then Exit Do End If @@ -1556,10 +1902,13 @@ lb_nOK: a = 2 * (v - MODdata.Vh.V0(t)) / 1 'dt = 1[s] + nU = fnU(v, Gear, False) + Pdrag = FLD.Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) + LastDiff = Diff - PvD = fPvD(t, v, a) - Pe = PvD + fPlossGB(PvD, v, Gear) + fPlossDiff(PvD, v) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear) + PvD = fPvD(t, v, a, Grad) + Pe = PvD + fPlossGB(PvD, v, Gear) + fPlossDiff(PvD, v) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear, v, a) Diff = Math.Abs(Pdrag - Pe) / VEH.Pnenn @@ -1572,6 +1921,36 @@ lb_nOK: #Region "Schaltmodelle" + Private Function fFastGearCalc(ByVal V As Single, ByVal Pe As Single) As Integer + Dim Gear As Integer + Dim Md As Single + Dim nU As Single + Dim nn As Single + Dim nnUp As Single + Dim nnDown As Single + + For Gear = VEH.ganganz To 1 Step -1 + + nU = CSng(Vist * 60.0 * VEH.AchsI * VEH.Igetr(Gear) / (VEH.Dreifen * Math.PI)) + nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + + 'Current torque demand with previous gear + Md = Pe * 1000 / (nU * 2 * Math.PI / 60) + + 'Up/Downshift rpms + nnUp = GBX.fGSnnUp(Md) + nnDown = GBX.fGSnnDown(Md) + + If nn > nnDown Then Return Gear + + Next + + Return 1 + + MODdata.ModErrors.GSextrapol = "" + + End Function + Private Function fStartGear(ByVal t As Integer) As Integer Dim Gear As Integer Dim nn As Single @@ -1652,7 +2031,7 @@ lb_nOK: nnUp = GBX.fGSnnUp(Md) nnDown = GBX.fGSnnDown(Md) - Debug.Print(CurrentCycleFile & "," & Gear & "," & Md & "," & MdMax & "," & nn & "," & nnDown & "," & nnUp) + ' Debug.Print(CurrentCycleFile & "," & Gear & "," & Md & "," & MdMax & "," & nn & "," & nnDown & "," & nnUp) If nn > nnDown And nU >= VEH.nLeerl And (1 - Md / MdMax >= GBX.gs_TorqueResvStart / 100 Or Md < 0) Then Exit For @@ -3374,6 +3753,10 @@ lb20: Return fPr(v) + fPair(v, t) + fPaFZ(v, a) + fPs(v, t) End Function + Private Function fPvD(ByVal t As Integer, ByVal v As Single, ByVal a As Single, ByVal Grad As Single) As Single + Return fPr(v) + fPair(v, t) + fPaFZ(v, a) + fPs(v, Grad) + End Function + '----------------Rolling-resistance---------------- Private Function fPr(ByVal v As Single) As Single Return CSng((VEH.Loading + VEH.Mass + VEH.MassExtra) * 9.81 * (VEH.Fr0 + VEH.Fr1 * v + VEH.Fr2 * v ^ 2 + VEH.Fr3 * v ^ 3 + VEH.Fr4 * v ^ 4) * v * 0.001) @@ -3419,9 +3802,21 @@ lb20: End If End Function + Private Function fPaMot(ByVal t As Integer, ByVal Gear As Integer, ByVal v As Single, ByVal a As Single) As Single + If Nvorg Then + Return (VEH.I_mot * MODdata.dnUvorg(t) * 0.01096 * MODdata.nUvorg(t)) * 0.001 + Else + Return ((VEH.I_mot * (VEH.AchsI * VEH.Igetr(Gear) / (0.5 * VEH.Dreifen)) ^ 2) * a * v) * 0.001 + End If + End Function + '----------------Slope resistance ---------------- Private Function fPs(ByVal v As Single, ByVal t As Integer) As Single - fPs = CSng(((VEH.Loading + VEH.Mass + VEH.MassExtra) * 9.81 * MODdata.Vh.Grad(t) * 0.01 * v) * 0.001) + Return CSng(((VEH.Loading + VEH.Mass + VEH.MassExtra) * 9.81 * MODdata.Vh.Grad(t) * 0.01 * v) * 0.001) + End Function + + Private Function fPs(ByVal v As Single, ByVal Grad As Single) As Single + Return CSng(((VEH.Loading + VEH.Mass + VEH.MassExtra) * 9.81 * Grad * 0.01 * v) * 0.001) End Function '----------------Ancillaries(Nebenaggregate) ---------------- diff --git a/VECTO/MODcalc/cVh.vb b/VECTO/MODcalc/cVh.vb index 3d9df9be2459d5545ed68f2aed96b76d31758b9c..f80e1fe9fad80722ac3b80473598a2fd84201812 100644 --- a/VECTO/MODcalc/cVh.vb +++ b/VECTO/MODcalc/cVh.vb @@ -11,14 +11,16 @@ Public Class cVh Private lPadd As List(Of Single) Private lVairVres As List(Of Single) Private lVairBeta As List(Of Single) + Public EcoRoll As List(Of Boolean) 'Calculated Private la As List(Of Single) 'WegKor |@@| Route(Weg)Correct - Private WegIst As Single - Private Weg As List(Of Single) + Private WegIst As Double + Public Weg As List(Of Double) Private WegX As Integer + Private WegV As List(Of Single) Public Sub Init() @@ -29,11 +31,10 @@ Public Class cVh lGears = New List(Of Short) lPadd = New List(Of Single) la = New List(Of Single) - Weg = New List(Of Single) + Weg = New List(Of Double) lVairVres = New List(Of Single) lVairBeta = New List(Of Single) - WegX = 0 - WegIst = 0 + EcoRoll = New List(Of Boolean) End Sub Public Sub CleanUp() @@ -47,6 +48,7 @@ Public Class cVh Weg = Nothing lVairVres = Nothing lVairBeta = Nothing + EcoRoll = Nothing End Sub Public Sub VehCylceInit() @@ -77,10 +79,12 @@ Public Class cVh End If 'Strecke (aus Zwischensekunden sonst passiert Fehler) |@@| Segment (from Intermediate-seconds, otherwise Error) - Weg.Add(lV(0)) - For s = 1 To MODdata.tDim - Weg.Add(Weg(s - 1) + lV(s)) - Next + If Not DRI.Scycle Then + Weg.Add(lV(0)) + For s = 1 To MODdata.tDim + Weg.Add(Weg(s - 1) + lV(s)) + Next + End If End If @@ -146,6 +150,10 @@ Public Class cVh End If + For s = 0 To MODdata.tDim + EcoRoll.Add(False) + Next + End Sub @@ -166,7 +174,7 @@ Public Class cVh If lV(s) < 0.001 Then lV(s) = 0 '<= aus Leistg Next - 'Strecke |@@| Segment + 'Distance Weg.Add(lV(0)) For s = 1 To MODdata.tDim Weg.Add(Weg(s - 1) + lV(s)) @@ -233,6 +241,9 @@ Public Class cVh End Sub Public Sub SetSpeed(ByVal t As Integer, ByVal v As Single) + + If 2 * v - lV0(t) < 0 Then v = lV0(t) / 2 + lV0(t + 1) = 2 * v - lV0(t) lV(t) = v la(t) = lV0(t + 1) - lV0(t) @@ -252,53 +263,96 @@ Public Class cVh End If End Sub - Public Sub DistCorrection(ByVal t As Integer, ByVal VehState As tVehState) + Public Sub SetAcc(ByVal t As Integer, ByVal a As Single) + la(t) = a + lV0(t + 1) = lV0(t) + a + lV(t) = (lV0(t + 1) + lV0(t)) / 2 + If t < MODdata.tDim Then + lV(t + 1) = (lV0(t + 2) + lV0(t + 1)) / 2 + la(t + 1) = lV0(t + 2) - lV0(t + 1) + End If + End Sub + + + Public Sub SetAccBackw(ByVal t As Integer, ByVal a As Single) + la(t) = a + lV0(t) = lV0(t + 1) - a + lV(t) = (lV0(t + 1) + lV0(t)) / 2 + If t > 0 Then + lV(t - 1) = (lV0(t) + lV0(t - 1)) / 2 + la(t - 1) = lV0(t) - lV0(t - 1) + End If + End Sub + + Public Sub DistCorrInit() + Dim i As Int16 + + WegX = 0 + WegIst = 0 + + WegV = New List(Of Single) + + For i = 0 To MODdata.tDim + 1 + WegV.Add(lV0(i)) + Next - 'TODO: If veh faster than cycle ... + End Sub + Public Function DistCorrection(ByVal t As Integer, ByVal VehState As tVehState) As Boolean Dim v As Single - Dim a As Single - If t + 1 > MODdata.tDim Then Exit Sub + If t + 1 > MODdata.tDim Then Return False v = lV(t) - a = la(t) WegIst += v If WegX < MODdata.tDimOgl Then - - - 'Falls Zeitschritt wiederholen näher an Wegvorgabe als aktueller Weg => Zeitschritt wiederholen |@@| If the repeating Time-step is closer to the Specified-route than the Actual-route => Repeat Time-step - If (VehState = tVehState.Acc Or VehState = tVehState.Cruise) AndAlso (Math.Abs(WegIst + Vsoll(t) - Weg(WegX)) < Math.Abs(WegIst - Weg(WegX))) And v > 0.1 Then + 'If repeating of current time-step is closer to the target distance => Repeat time-step + If (Math.Abs(WegIst + Vsoll(t) - Weg(WegX)) < Math.Abs(WegIst - Weg(WegX))) And v > 1 Then Duplicate(t + 1) MODdata.tDim += 1 + 'Debug.Print("Duplicate," & t & "," & WegIst & "," & Weg(WegX)) + Return True - 'Falls nächsten Zeitschritt löschen näher an Wegvorgabe als aktueller Weg => Nächsten Zeitschritt löschen |@@| If the next Time-step to Delete closer to specified Route than the Actual-route => Delete Next Time-step - 'ElseIf WegX < MODdata.tDimOgl - 1 AndAlso t < MODdata.tDim - 1 AndAlso WegIst > Weg(WegX + 1) AndAlso Math.Abs(WegIst - Weg(WegX + 1)) <= Math.Abs(WegIst - Weg(WegX)) Then + 'If deleting the next time-step is closer to target distance => Delete Next Time-step + ElseIf WegX < MODdata.tDimOgl - 1 AndAlso t < MODdata.tDim - 1 AndAlso Math.Abs(WegIst - Weg(WegX + 1)) <= Math.Abs(WegIst - Weg(WegX)) AndAlso v > 1 Then - ' Do - ' Cut(t + 1) - ' MODdata.tDim -= 1 - ' WegX += 1 - ' Loop While WegX < MODdata.tDimOgl - 1 AndAlso t < MODdata.tDim - 1 AndAlso WegIst > Weg(WegX + 1) AndAlso Math.Abs(WegIst - Weg(WegX + 1)) <= Math.Abs(WegIst - Weg(WegX)) - ' WegX += 1 + Cut(t + 1) + MODdata.tDim -= 1 + 'Debug.Print("Cut," & t & "," & WegIst & "," & Weg(WegX)) + WegX += 2 + Return True Else 'No correction WegX += 1 + Return False End If + End If - End Sub + Return False + + End Function Private Sub Duplicate(ByVal t As Integer) - lV0.Insert(t + 1, lV0ogl(t + 1)) + lV0.Insert(t + 1, (WegV(t + 1) + WegV(t)) / 2) + WegV.Insert(t + 1, (WegV(t + 1) + WegV(t)) / 2) + + 'If t + 1 < MODdata.tDim Then + ' lV0.Insert(t + 1, (WegV(t + 1) + WegV(t + 2)) / 2) + ' WegV.Insert(t + 1, (WegV(t + 1) + WegV(t + 2)) / 2) + 'Else + ' lV0.Insert(t + 1, WegV(t + 1)) + ' WegV.Insert(t + 1, WegV(t + 1)) + 'End If + lV0ogl.Insert(t + 1, lV0ogl(t + 1)) lV.Insert(t, (lV0(t + 1) + lV0(t)) / 2) la.Insert(t, lV0(t + 1) - lV0(t)) @@ -311,6 +365,41 @@ Public Class cVh lGrad.Insert(t, lGrad(t)) lGears.Insert(t, lGears(t)) lPadd.Insert(t, lPadd(t)) + EcoRoll.Insert(t, EcoRoll(t)) + + If DRI.VairVorg Then + lVairVres.Insert(t, lVairVres(t)) + lVairBeta.Insert(t, lVairBeta(t)) + End If + + MODdata.Duplicate(t) + + If PHEMmode = tPHEMmode.ModeADVANCE Then + ADV.aWorldX.Insert(t, ADV.aWorldX(t)) + ADV.aWorldY.Insert(t, ADV.aWorldY(t)) + ADV.aStrId.Insert(t, ADV.aStrId(t)) + End If + + + End Sub + + Public Sub DuplicatePreRun(ByVal t As Integer) + + lV0.Insert(t, lV0(t)) + + lV0ogl.Insert(t, lV0ogl(t)) + lV.Insert(t, (lV0(t + 1) + lV0(t)) / 2) + la.Insert(t, lV0(t + 1) - lV0(t)) + + If t > 0 Then + lV(t - 1) = (lV0(t) + lV0(t - 1)) / 2 + la(t - 1) = lV0(t) - lV0(t - 1) + End If + + lGrad.Insert(t, lGrad(t)) + lGears.Insert(t, lGears(t)) + lPadd.Insert(t, lPadd(t)) + EcoRoll.Insert(t, EcoRoll(t)) If DRI.VairVorg Then lVairVres.Insert(t, lVairVres(t)) @@ -332,6 +421,7 @@ Public Class cVh lV0.RemoveAt(t + 1) lV0ogl.RemoveAt(t + 1) + WegV.RemoveAt(t + 1) lV.RemoveAt(t) la.RemoveAt(t) @@ -348,6 +438,7 @@ Public Class cVh lGrad.RemoveAt(t) lGears.RemoveAt(t) lPadd.RemoveAt(t) + EcoRoll.RemoveAt(t) If DRI.VairVorg Then lVairVres.RemoveAt(t) diff --git a/VECTO/M_Lese.vb b/VECTO/M_Lese.vb index 9a1f892dce3aa3bfbfa5345089dcdea6d931457f..5dd6983acb744fb0a73f688b3b7feef3b548479e 100644 --- a/VECTO/M_Lese.vb +++ b/VECTO/M_Lese.vb @@ -28,7 +28,7 @@ Module M_Lese Return False End If Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GenFile & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & GenFile & ")", MsgSrc, GenFile) Return False End Try @@ -56,7 +56,7 @@ Module M_Lese Try If Not VEH.ReadFile Then Return False Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathVEH & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathVEH & ")", MsgSrc, GEN.PathVEH) Return False End Try @@ -72,7 +72,7 @@ Module M_Lese Try If Not ENG.ReadFile Then Return False Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathENG & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathENG & ")", MsgSrc, GEN.PathENG) Return False End Try @@ -85,7 +85,7 @@ Module M_Lese Try If Not GBX.ReadFile Then Return False Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathGBX & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & GEN.PathGBX & ")", MsgSrc, GEN.PathGBX) Return False End Try End If @@ -137,7 +137,7 @@ Module M_Lese Try If Not FLD.ReadFile Then Return False 'Fehlermeldung hier nicht notwendig weil schon von in ReadFile Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & ENG.PathFLD & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & ENG.PathFLD & ")", MsgSrc, ENG.PathFLD) Return False End Try @@ -158,7 +158,7 @@ Module M_Lese Try If Not MAP.ReadFile Then Return False 'Fehlermeldung hier nicht notwendig weil schon von in ReadFile Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & ENG.PathMAP & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & ENG.PathMAP & ")", MsgSrc, ENG.PathMAP) Return False End Try @@ -184,7 +184,7 @@ Module M_Lese Try If Not TRS.ReadFile Then Return False Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN.dynspez & ")", MsgSrc) + WorkerMsg(tMsgID.Err, "File read error! (" & GEN.dynspez & ")", MsgSrc, GEN.dynspez) Return False End Try diff --git a/VECTO/M_MAIN.vb b/VECTO/M_MAIN.vb index 49446e08de8f966211f7da6986463bf38c1689c9..1912d5de8b461cb09f185ef120228ff51c7ce281 100644 --- a/VECTO/M_MAIN.vb +++ b/VECTO/M_MAIN.vb @@ -431,8 +431,18 @@ lbADV: Else + If DEV.PreRun Then + If MsgOut Then WorkerMsg(tMsgID.Normal, "Driving Cycle Preprocessing", MsgSrc) + If Not MODdata.Px.PreRun Then + CyclAbrtedByErr = True + GoTo lbAusg + End If + End If + If MsgOut Then WorkerMsg(tMsgID.Normal, "Vehicle Calc", MsgSrc) + MODdata.Vh.DistCorrInit() + If Not MODdata.Px.Calc() Then CyclAbrtedByErr = True GoTo lbAusg @@ -472,13 +482,15 @@ lbADV: MAP.Norm() End If - If MsgOut Then WorkerMsg(tMsgID.Normal, "Em Calc: Raw", MsgSrc) + If MsgOut Then WorkerMsg(tMsgID.Normal, "FC Interpolation", MsgSrc) 'Calculate Raw emissions If Not MODdata.Em.Raw_Calc() Then - CyclAbrtedByErr = True - WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc) - GoTo lbAusg + If Not DEV.IgnoreFCextrapol Then + CyclAbrtedByErr = True + WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc) + GoTo lbAusg + End If End If 'TC Parameter umrechnen in Differenz zu Kennfeld-TC-Parameter |@@| Convert TC parameters to differences with Map-TC-parameters diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 976a53a48967a3dcfca9d3c0c621cb772c59b18e..16700c5f4632b35d30769c470593db0a09498ccc 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -57,6 +57,30 @@ <PropertyGroup> <ApplicationManifest>My Project\app.manifest</ApplicationManifest> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <DebugSymbols>true</DebugSymbols> + <DefineDebug>true</DefineDebug> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x86\Debug\</OutputPath> + <DocumentationFile>VECTO.xml</DocumentationFile> + <NoWarn>41999,42016,42017,42018,42019,42032,42036</NoWarn> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> + <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> + <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x86\Release\</OutputPath> + <DocumentationFile>VECTO.xml</DocumentationFile> + <NoWarn>41999,42016,42017,42018,42019,42032,42036</NoWarn> + <DebugType>None</DebugType> + <PlatformTarget>x86</PlatformTarget> + <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> + <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> + <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> + </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> diff --git a/VECTO/VECTO_Global.vb b/VECTO/VECTO_Global.vb index 83727f4029d99ae89f259971534e802cc302ea99..871f41150413adbf8a2a9fa4570692567949d3ea 100644 --- a/VECTO/VECTO_Global.vb +++ b/VECTO/VECTO_Global.vb @@ -2,7 +2,7 @@ Module VECTO_Global - Public Const VECTOvers As String = "1.2" + Public Const VECTOvers As String = "1.3 beta" Public MyAppPath As String Public MyConfPath As String Public MyDeclPath As String diff --git a/VECTO/cDEV.vb b/VECTO/cDEV.vb index 8343fa0ff053226a08f0e55fe2663f985f1a3a57..7544b6bef25a637c0cfb8e917366c6db251019e0 100644 --- a/VECTO/cDEV.vb +++ b/VECTO/cDEV.vb @@ -13,10 +13,11 @@ Public Class cDEV Public TCnUstep As Single Public TCnUstepMin As Single - Public OverSpeedOn As Boolean - Public OverSpeed As Single - Public UnderSpeed As Single - Public EcoRollOn As Boolean + Public SpeedPeEps As Single + Public PreRun As Boolean + Public IgnoreFCextrapol As Boolean + + '************************************************************************************************************** '************************************************************************************************************** @@ -141,22 +142,17 @@ Public Class cDEV MyOptions.Add("TCnUstepMin", Conf0) - Conf0 = New cDEVoption(tDEVconfType.tBoolean, "OverSpeed", False) - Conf0.BoolVal = False - MyOptions.Add("OverSpeedOn", Conf0) - - Conf0 = New cDEVoption(tDEVconfType.tBoolean, "EcoRoll", False) - Conf0.BoolVal = False - MyOptions.Add("EcoRollOn", Conf0) + Conf0 = New cDEVoption(tDEVconfType.tSingleVal, "Epsilon for Iteration Abort Criterion: eps >= |Pdrag - Pe| / VEH.Pnenn [-]") + Conf0.SingleVal = 0.0001 + MyOptions.Add("SpeedPeEps", Conf0) - Conf0 = New cDEVoption(tDEVconfType.tSingleVal, "OverSpeed [km/h]") - Conf0.SingleVal = 10 - MyOptions.Add("OverSpeed", Conf0) - - Conf0 = New cDEVoption(tDEVconfType.tSingleVal, "UnderSpeed [km/h]") - Conf0.SingleVal = 10 - MyOptions.Add("UnderSpeed", Conf0) + Conf0 = New cDEVoption(tDEVconfType.tBoolean, "PreRun", False) + Conf0.BoolVal = True + MyOptions.Add("PreRun", Conf0) + Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Don't abort calculation if extrapolation in FC map. FC output is not valid!!", False) + Conf0.BoolVal = False + MyOptions.Add("IgnoreFCextrapol", Conf0) '**************************** END: Parameters Configuration '***************************** '***************************************************************************************** @@ -173,10 +169,11 @@ Public Class cDEV TCnUstep = MyOptions("TCnUstep").SingleVal TCnUstepMin = MyOptions("TCnUstepMin").SingleVal - OverSpeedOn = MyOptions("OverSpeedOn").BoolVal - OverSpeed = MyOptions("EcoRollOn").BoolVal - UnderSpeed = MyOptions("OverSpeed").SingleVal - EcoRollOn = MyOptions("UnderSpeed").SingleVal + SpeedPeEps = MyOptions("SpeedPeEps").SingleVal + + PreRun = MyOptions("PreRun").BoolVal + IgnoreFCextrapol = MyOptions("IgnoreFCextrapol").BoolVal + End Sub 'Demo for Delegate Function diff --git a/VECTO/cDelaunayMap.vb b/VECTO/cDelaunayMap.vb index e30874864a791c6b891013a8c19871678c556a95..307b75ecdafb789286f5f8a7a873ec481ae307cd 100644 --- a/VECTO/cDelaunayMap.vb +++ b/VECTO/cDelaunayMap.vb @@ -48,17 +48,17 @@ Public Class cDelaunayMap -#If DEBUG Then - Dim i As Int16 - Debug.Print("#,x1,y1,z1,x2,y2,z2") - i = -1 - For Each tr In lDT - i += 1 - Debug.Print(i & "," & tr.P1.X & "," & tr.P1.Y & "," & tr.P1.Z & "," & tr.P2.X & "," & tr.P2.Y & "," & tr.P2.Z) - Debug.Print(i & "," & tr.P3.X & "," & tr.P3.Y & "," & tr.P3.Z & "," & tr.P2.X & "," & tr.P2.Y & "," & tr.P2.Z) - Debug.Print(i & "," & tr.P1.X & "," & tr.P1.Y & "," & tr.P1.Z & "," & tr.P3.X & "," & tr.P3.Y & "," & tr.P3.Z) - Next -#End If + '#If DEBUG Then + ' Dim i As Int16 + ' Debug.Print("#,x1,y1,z1,x2,y2,z2") + ' i = -1 + ' For Each tr In lDT + ' i += 1 + ' Debug.Print(i & "," & tr.P1.X & "," & tr.P1.Y & "," & tr.P1.Z & "," & tr.P2.X & "," & tr.P2.Y & "," & tr.P2.Z) + ' Debug.Print(i & "," & tr.P3.X & "," & tr.P3.Y & "," & tr.P3.Z & "," & tr.P2.X & "," & tr.P2.Y & "," & tr.P2.Z) + ' Debug.Print(i & "," & tr.P1.X & "," & tr.P1.Y & "," & tr.P1.Z & "," & tr.P3.X & "," & tr.P3.Y & "," & tr.P3.Z) + ' Next + '#End If @@ -104,9 +104,9 @@ Public Class cDelaunayMap 'ERROR: Extrapolation -#If DEBUG Then - Debug.Print(x & "," & y) -#End If + '#If DEBUG Then + ' Debug.Print(x & "," & y) + '#End If Throw New ArgumentException("Extrapolation not possible!")