From 12b843d790cc6623ce7abe4e5ef68f1e3688f47d Mon Sep 17 00:00:00 2001 From: Raphael Luz <luz@ivt.tugraz.at> Date: Fri, 7 Feb 2014 13:41:00 +0100 Subject: [PATCH] * Cleaned up source code * Removed rated power (not used anymore) * Removed rated engine speed form engine file. Now calculated form vfld file. --- VECTO Changelog.txt | 12 +- VECTO/GUI/F_ENG.Designer.vb | 110 +- VECTO/GUI/F_ENG.vb | 10 +- VECTO/GUI/F_GEN.Designer.vb | 1248 ------------- VECTO/GUI/F_GEN.vb | 652 +------ VECTO/GUI/F_MAINForm.Designer.vb | 48 - VECTO/GUI/F_MAINForm.resx | 3 - VECTO/GUI/F_MAINForm.vb | 24 - VECTO/GUI/F_Options.Designer.vb | 182 +- VECTO/GUI/F_Options.vb | 26 - VECTO/GUI/F_VEH.vb | 2 - VECTO/Input Files/cDRI.vb | 171 +- VECTO/Input Files/cEMO.vb | 171 -- VECTO/Input Files/cENG.vb | 20 +- VECTO/Input Files/cFLD.vb | 416 +---- VECTO/Input Files/cGBX.vb | 43 +- VECTO/Input Files/cGEN.vb | 529 +----- VECTO/Input Files/cMAP.vb | 2003 +-------------------- VECTO/Input Files/cTRS.vb | 262 --- VECTO/Input Files/cVEH.vb | 182 +- VECTO/MODcalc/Em Calc.vb | 2846 +----------------------------- VECTO/MODcalc/cBatModel.vb | 400 ----- VECTO/MODcalc/cMOD.vb | 271 +-- VECTO/MODcalc/cPower.vb | 613 ++----- VECTO/M_FCCor.vb | 75 - VECTO/M_Lese.vb | 82 +- VECTO/M_MAIN.vb | 132 +- VECTO/M_OptInterface.vb | 232 --- VECTO/M_SOC_Iter.vb | 476 ----- VECTO/VECTO.vbproj | 8 - VECTO/VECTO_Global.vb | 23 +- VECTO/VECTO_Types.vb | 14 +- VECTO/cConfig.vb | 56 +- VECTO/cCustomMap.vb | 148 -- VECTO/cDEV.vb | 22 - VECTO/cDelaunayMap.vb | 24 +- VECTO/cERG.vb | 388 +--- VECTO/cEmComp.vb | 52 +- VECTO/cHEVctrl.vb | 87 - 39 files changed, 581 insertions(+), 11482 deletions(-) delete mode 100644 VECTO/Input Files/cEMO.vb delete mode 100644 VECTO/Input Files/cTRS.vb delete mode 100644 VECTO/MODcalc/cBatModel.vb delete mode 100644 VECTO/M_FCCor.vb delete mode 100644 VECTO/M_OptInterface.vb delete mode 100644 VECTO/M_SOC_Iter.vb delete mode 100644 VECTO/cCustomMap.vb delete mode 100644 VECTO/cHEVctrl.vb diff --git a/VECTO Changelog.txt b/VECTO Changelog.txt index 36e3ea8155..621d643526 100644 --- a/VECTO Changelog.txt +++ b/VECTO Changelog.txt @@ -4,9 +4,15 @@ VECTO ?.? (future release) TODO VECTO 1.4.xxx (current source - next release) +* Cleaned up source code +* Removed rated power (not used anymore) +* Removed rated engine speed form engine file. Now calculated form vfld file. +* NOTE: These changes have inevitable influence on the calculation and results because several methods now use absolute instead of normalised values. Notable (but still negligible) differences may arise due to the following effects: +** Different Shift times +** Distance correction +** Altitude to gradient conversion - -VECTO 1.4.RC8 +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) @@ -16,7 +22,7 @@ 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 -VECTO 1.4.RC6 (internal release) +VECTO 1.4.RC6 * Bugfix in torque converter calculation diff --git a/VECTO/GUI/F_ENG.Designer.vb b/VECTO/GUI/F_ENG.Designer.vb index 3a8c120e1c..a7ef0f5885 100644 --- a/VECTO/GUI/F_ENG.Designer.vb +++ b/VECTO/GUI/F_ENG.Designer.vb @@ -26,16 +26,10 @@ Partial Class F_ENG Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(F_ENG)) Me.TbNleerl = New System.Windows.Forms.TextBox() Me.Label11 = New System.Windows.Forms.Label() - Me.TbNnenn = New System.Windows.Forms.TextBox() - Me.Label10 = New System.Windows.Forms.Label() Me.TbInertia = New System.Windows.Forms.TextBox() Me.Label41 = New System.Windows.Forms.Label() Me.Label40 = New System.Windows.Forms.Label() - Me.Label39 = New System.Windows.Forms.Label() - Me.Label36 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() - Me.TbPnenn = New System.Windows.Forms.TextBox() - Me.Label9 = New System.Windows.Forms.Label() Me.ButCancel = New System.Windows.Forms.Button() Me.ButOK = New System.Windows.Forms.Button() Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() @@ -82,7 +76,7 @@ Partial Class F_ENG ' 'TbNleerl ' - Me.TbNleerl.Location = New System.Drawing.Point(400, 118) + Me.TbNleerl.Location = New System.Drawing.Point(123, 108) Me.TbNleerl.Name = "TbNleerl" Me.TbNleerl.Size = New System.Drawing.Size(57, 20) Me.TbNleerl.TabIndex = 4 @@ -90,31 +84,15 @@ Partial Class F_ENG 'Label11 ' Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(292, 121) + Me.Label11.Location = New System.Drawing.Point(15, 111) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(102, 13) Me.Label11.TabIndex = 15 Me.Label11.Text = "Idling Engine Speed" ' - 'TbNnenn - ' - Me.TbNnenn.Location = New System.Drawing.Point(400, 144) - Me.TbNnenn.Name = "TbNnenn" - Me.TbNnenn.Size = New System.Drawing.Size(57, 20) - Me.TbNnenn.TabIndex = 5 - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(288, 147) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(106, 13) - Me.Label10.TabIndex = 13 - Me.Label10.Text = "Rated Engine Speed" - ' 'TbInertia ' - Me.TbInertia.Location = New System.Drawing.Point(123, 170) + Me.TbInertia.Location = New System.Drawing.Point(388, 108) Me.TbInertia.Name = "TbInertia" Me.TbInertia.Size = New System.Drawing.Size(57, 20) Me.TbInertia.TabIndex = 3 @@ -122,7 +100,7 @@ Partial Class F_ENG 'Label41 ' Me.Label41.AutoSize = True - Me.Label41.Location = New System.Drawing.Point(186, 173) + Me.Label41.Location = New System.Drawing.Point(451, 111) Me.Label41.Name = "Label41" Me.Label41.Size = New System.Drawing.Size(36, 13) Me.Label41.TabIndex = 24 @@ -131,60 +109,26 @@ Partial Class F_ENG 'Label40 ' Me.Label40.AutoSize = True - Me.Label40.Location = New System.Drawing.Point(463, 121) + Me.Label40.Location = New System.Drawing.Point(186, 111) Me.Label40.Name = "Label40" Me.Label40.Size = New System.Drawing.Size(30, 13) Me.Label40.TabIndex = 24 Me.Label40.Text = "[rpm]" ' - 'Label39 - ' - Me.Label39.AutoSize = True - Me.Label39.Location = New System.Drawing.Point(463, 147) - Me.Label39.Name = "Label39" - Me.Label39.Size = New System.Drawing.Size(30, 13) - Me.Label39.TabIndex = 24 - Me.Label39.Text = "[rpm]" - ' - 'Label36 - ' - Me.Label36.AutoSize = True - Me.Label36.Location = New System.Drawing.Point(186, 121) - Me.Label36.Name = "Label36" - Me.Label36.Size = New System.Drawing.Size(30, 13) - Me.Label36.TabIndex = 24 - Me.Label36.Text = "[kW]" - ' 'Label5 ' Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 173) + Me.Label5.Location = New System.Drawing.Point(280, 111) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(102, 13) Me.Label5.TabIndex = 0 Me.Label5.Text = "Inertia incl. Flywheel" ' - 'TbPnenn - ' - Me.TbPnenn.Location = New System.Drawing.Point(123, 118) - Me.TbPnenn.Name = "TbPnenn" - Me.TbPnenn.Size = New System.Drawing.Size(57, 20) - Me.TbPnenn.TabIndex = 1 - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(12, 121) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(105, 13) - Me.Label9.TabIndex = 11 - Me.Label9.Text = "Rated Engine Power" - ' 'ButCancel ' Me.ButCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.ButCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.ButCancel.Location = New System.Drawing.Point(418, 473) + Me.ButCancel.Location = New System.Drawing.Point(418, 439) Me.ButCancel.Name = "ButCancel" Me.ButCancel.Size = New System.Drawing.Size(75, 23) Me.ButCancel.TabIndex = 13 @@ -194,7 +138,7 @@ Partial Class F_ENG 'ButOK ' Me.ButOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButOK.Location = New System.Drawing.Point(337, 473) + Me.ButOK.Location = New System.Drawing.Point(337, 439) Me.ButOK.Name = "ButOK" Me.ButOK.Size = New System.Drawing.Size(75, 23) Me.ButOK.TabIndex = 12 @@ -283,7 +227,7 @@ Partial Class F_ENG 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.LbStatus}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 499) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 465) Me.StatusStrip1.Name = "StatusStrip1" Me.StatusStrip1.Size = New System.Drawing.Size(505, 22) Me.StatusStrip1.SizingGrip = False @@ -299,7 +243,7 @@ Partial Class F_ENG 'Label1 ' Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(186, 147) + Me.Label1.Location = New System.Drawing.Point(186, 137) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(33, 13) Me.Label1.TabIndex = 24 @@ -308,7 +252,7 @@ Partial Class F_ENG 'Label2 ' Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(46, 147) + Me.Label2.Location = New System.Drawing.Point(46, 137) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(71, 13) Me.Label2.TabIndex = 13 @@ -316,7 +260,7 @@ Partial Class F_ENG ' 'TbDispl ' - Me.TbDispl.Location = New System.Drawing.Point(123, 144) + Me.TbDispl.Location = New System.Drawing.Point(123, 134) Me.TbDispl.Name = "TbDispl" Me.TbDispl.Size = New System.Drawing.Size(57, 20) Me.TbDispl.TabIndex = 2 @@ -339,7 +283,7 @@ Partial Class F_ENG ' 'TbMAP ' - Me.TbMAP.Location = New System.Drawing.Point(12, 388) + Me.TbMAP.Location = New System.Drawing.Point(12, 351) Me.TbMAP.Name = "TbMAP" Me.TbMAP.Size = New System.Drawing.Size(418, 20) Me.TbMAP.TabIndex = 8 @@ -347,7 +291,7 @@ Partial Class F_ENG 'Label6 ' Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 372) + Me.Label6.Location = New System.Drawing.Point(12, 335) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(115, 13) Me.Label6.TabIndex = 38 @@ -355,7 +299,7 @@ Partial Class F_ENG ' 'BtMAP ' - Me.BtMAP.Location = New System.Drawing.Point(436, 386) + Me.BtMAP.Location = New System.Drawing.Point(436, 349) Me.BtMAP.Name = "BtMAP" Me.BtMAP.Size = New System.Drawing.Size(28, 23) Me.BtMAP.TabIndex = 9 @@ -366,7 +310,7 @@ Partial Class F_ENG 'TbWHTC ' Me.TbWHTC.Enabled = False - Me.TbWHTC.Location = New System.Drawing.Point(12, 438) + Me.TbWHTC.Location = New System.Drawing.Point(12, 401) Me.TbWHTC.Name = "TbWHTC" Me.TbWHTC.Size = New System.Drawing.Size(447, 20) Me.TbWHTC.TabIndex = 10 @@ -375,7 +319,7 @@ Partial Class F_ENG ' Me.Label7.AutoSize = True Me.Label7.Enabled = False - Me.Label7.Location = New System.Drawing.Point(12, 422) + Me.Label7.Location = New System.Drawing.Point(12, 385) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(109, 13) Me.Label7.TabIndex = 38 @@ -384,7 +328,7 @@ Partial Class F_ENG 'BtWHTC ' Me.BtWHTC.Enabled = False - Me.BtWHTC.Location = New System.Drawing.Point(465, 436) + Me.BtWHTC.Location = New System.Drawing.Point(465, 399) Me.BtWHTC.Name = "BtWHTC" Me.BtWHTC.Size = New System.Drawing.Size(28, 23) Me.BtWHTC.TabIndex = 11 @@ -429,7 +373,7 @@ Partial Class F_ENG 'BtMAPopen ' Me.BtMAPopen.Image = Global.VECTO.My.Resources.Resources.application_export_icon_small - Me.BtMAPopen.Location = New System.Drawing.Point(470, 386) + Me.BtMAPopen.Location = New System.Drawing.Point(470, 349) Me.BtMAPopen.Name = "BtMAPopen" Me.BtMAPopen.Size = New System.Drawing.Size(23, 23) Me.BtMAPopen.TabIndex = 40 @@ -485,7 +429,7 @@ Partial Class F_ENG Me.GroupBox1.Controls.Add(Me.LvFLDs) Me.GroupBox1.Controls.Add(Me.BtRemFLD) Me.GroupBox1.Controls.Add(Me.BtAddFLD) - Me.GroupBox1.Location = New System.Drawing.Point(12, 196) + Me.GroupBox1.Location = New System.Drawing.Point(12, 160) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(481, 162) Me.GroupBox1.TabIndex = 44 @@ -507,7 +451,7 @@ Partial Class F_ENG Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButCancel - Me.ClientSize = New System.Drawing.Size(505, 521) + Me.ClientSize = New System.Drawing.Size(505, 487) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.BtMAPopen) Me.Controls.Add(Me.PictureBox1) @@ -520,24 +464,18 @@ Partial Class F_ENG Me.Controls.Add(Me.Label11) Me.Controls.Add(Me.ToolStrip1) Me.Controls.Add(Me.TbDispl) - Me.Controls.Add(Me.TbNnenn) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.ButCancel) - Me.Controls.Add(Me.Label10) Me.Controls.Add(Me.ButOK) Me.Controls.Add(Me.TbWHTC) Me.Controls.Add(Me.TbMAP) Me.Controls.Add(Me.TbInertia) Me.Controls.Add(Me.Label41) Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label9) Me.Controls.Add(Me.Label40) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.TbName) - Me.Controls.Add(Me.TbPnenn) - Me.Controls.Add(Me.Label39) Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label36) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.MaximizeBox = False @@ -558,16 +496,10 @@ Partial Class F_ENG End Sub Friend WithEvents TbNleerl As System.Windows.Forms.TextBox Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents TbNnenn As System.Windows.Forms.TextBox - Friend WithEvents Label10 As System.Windows.Forms.Label Friend WithEvents TbInertia As System.Windows.Forms.TextBox Friend WithEvents Label41 As System.Windows.Forms.Label Friend WithEvents Label40 As System.Windows.Forms.Label - Friend WithEvents Label39 As System.Windows.Forms.Label - Friend WithEvents Label36 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents TbPnenn As System.Windows.Forms.TextBox - Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents ButCancel As System.Windows.Forms.Button Friend WithEvents ButOK As System.Windows.Forms.Button Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip diff --git a/VECTO/GUI/F_ENG.vb b/VECTO/GUI/F_ENG.vb index 9e5d8f8f97..9036dd620a 100644 --- a/VECTO/GUI/F_ENG.vb +++ b/VECTO/GUI/F_ENG.vb @@ -80,11 +80,9 @@ If ChangeCheckCancel() Then Exit Sub Me.TbName.Text = "" - Me.TbPnenn.Text = "" Me.TbDispl.Text = "" Me.TbInertia.Text = "" Me.TbNleerl.Text = "" - Me.TbNnenn.Text = "" Me.LvFLDs.Items.Clear() Me.TbMAP.Text = "" Me.TbWHTC.Text = "" @@ -114,11 +112,9 @@ End If Me.TbName.Text = ENG0.ModelName - Me.TbPnenn.Text = ENG0.Pnenn.ToString Me.TbDispl.Text = ENG0.Displ.ToString Me.TbInertia.Text = ENG0.I_mot.ToString Me.TbNleerl.Text = ENG0.nleerl.ToString - Me.TbNnenn.Text = ENG0.nnenn.ToString Me.LvFLDs.Items.Clear() For i = 0 To ENG0.fFLD.Count - 1 @@ -169,11 +165,9 @@ ENG0.ModelName = Me.TbName.Text If Trim(ENG0.ModelName) = "" Then ENG0.ModelName = "Undefined" - ENG0.Pnenn = CSng(fTextboxToNumString(Me.TbPnenn.Text)) ENG0.Displ = CSng(fTextboxToNumString(Me.TbDispl.Text)) ENG0.I_mot = CSng(fTextboxToNumString(Me.TbInertia.Text)) ENG0.nleerl = CSng(fTextboxToNumString(Me.TbNleerl.Text)) - ENG0.nnenn = CSng(fTextboxToNumString(Me.TbNnenn.Text)) For i = 0 To Me.LvFLDs.Items.Count - 1 ENG0.fFLD.Add(New cSubPath) @@ -241,7 +235,7 @@ Change() End Sub - Private Sub TbPnenn_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbPnenn.TextChanged + Private Sub TbPnenn_TextChanged(sender As System.Object, e As System.EventArgs) Change() End Sub @@ -257,7 +251,7 @@ Change() End Sub - Private Sub TbNnenn_TextChanged(sender As System.Object, e As System.EventArgs) Handles TbNnenn.TextChanged + Private Sub TbNnenn_TextChanged(sender As System.Object, e As System.EventArgs) Change() End Sub diff --git a/VECTO/GUI/F_GEN.Designer.vb b/VECTO/GUI/F_GEN.Designer.vb index 9e96b310a7..87817b408d 100644 --- a/VECTO/GUI/F_GEN.Designer.vb +++ b/VECTO/GUI/F_GEN.Designer.vb @@ -24,56 +24,6 @@ Partial Class F_GEN Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(F_GEN)) - Me.ButOpenEXS = New System.Windows.Forms.Button() - Me.ButtonEXS = New System.Windows.Forms.Button() - Me.TabPgHEV = New System.Windows.Forms.TabPage() - Me.CbSOCnIter = New System.Windows.Forms.CheckBox() - Me.Label10 = New System.Windows.Forms.Label() - Me.TbSOCstart = New System.Windows.Forms.TextBox() - Me.TextBoxEKF = New System.Windows.Forms.TextBox() - Me.TextBoxSTE = New System.Windows.Forms.TextBox() - Me.TextBoxGET = New System.Windows.Forms.TextBox() - Me.TextBoxEAN = New System.Windows.Forms.TextBox() - Me.TextBoxEMO = New System.Windows.Forms.TextBox() - Me.TextBoxBAT = New System.Windows.Forms.TextBox() - Me.ButOpenEKF = New System.Windows.Forms.Button() - Me.ButOpenSTE = New System.Windows.Forms.Button() - Me.ButOpenGET = New System.Windows.Forms.Button() - Me.ButOpenEAN = New System.Windows.Forms.Button() - Me.ButOpenEMO = New System.Windows.Forms.Button() - Me.ButOpenBAT = New System.Windows.Forms.Button() - Me.ButtonBAT = New System.Windows.Forms.Button() - Me.ButtonEKF = New System.Windows.Forms.Button() - Me.ButtonSTE = New System.Windows.Forms.Button() - Me.ButtonGET = New System.Windows.Forms.Button() - Me.ButtonEMO = New System.Windows.Forms.Button() - Me.ButtonEAN = New System.Windows.Forms.Button() - Me.TabPgColdSt = New System.Windows.Forms.TabPage() - Me.TextBoxATC = New System.Windows.Forms.TextBox() - Me.TextBoxCDW = New System.Windows.Forms.TextBox() - Me.TextBoxWUC = New System.Windows.Forms.TextBox() - Me.TextBoxWUA = New System.Windows.Forms.TextBox() - Me.TextBoxMAC = New System.Windows.Forms.TextBox() - Me.TextBoxMAA = New System.Windows.Forms.TextBox() - Me.ButOpenATC = New System.Windows.Forms.Button() - Me.ButOpenCDW = New System.Windows.Forms.Button() - Me.ButOpenWUC = New System.Windows.Forms.Button() - Me.ButOpenWUA = New System.Windows.Forms.Button() - Me.GroupBox3 = New System.Windows.Forms.GroupBox() - Me.Label6 = New System.Windows.Forms.Label() - Me.TextBoxTofSt = New System.Windows.Forms.TextBox() - Me.TextBoxTKW = New System.Windows.Forms.TextBox() - Me.TextBoxTKat = New System.Windows.Forms.TextBox() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.ButOpenMAC = New System.Windows.Forms.Button() - Me.ButOpenMAA = New System.Windows.Forms.Button() - Me.ButtonMAA = New System.Windows.Forms.Button() - Me.ButtonATC = New System.Windows.Forms.Button() - Me.ButtonCDW = New System.Windows.Forms.Button() - Me.ButtonWUC = New System.Windows.Forms.Button() - Me.ButtonMAC = New System.Windows.Forms.Button() - Me.ButtonWUA = New System.Windows.Forms.Button() Me.TabPgGen = New System.Windows.Forms.TabPage() Me.GroupBox5 = New System.Windows.Forms.GroupBox() Me.Label2 = New System.Windows.Forms.Label() @@ -98,16 +48,6 @@ Partial Class F_GEN Me.ButtonVEH = New System.Windows.Forms.Button() Me.ButtonGBX = New System.Windows.Forms.Button() Me.ButtonMAP = New System.Windows.Forms.Button() - Me.Label11 = New System.Windows.Forms.Label() - Me.CbTransLossModel = New System.Windows.Forms.ComboBox() - Me.TextBoxEXS = New System.Windows.Forms.TextBox() - Me.TextBoxTRS = New System.Windows.Forms.TextBox() - Me.CheckBoxDynKor = New System.Windows.Forms.CheckBox() - Me.CheckBoxSCR = New System.Windows.Forms.CheckBox() - Me.CheckBoxColdSt = New System.Windows.Forms.CheckBox() - Me.ButOpenTRS = New System.Windows.Forms.Button() - Me.ButtonTRS = New System.Windows.Forms.Button() - Me.ComboBoxGearShift = New System.Windows.Forms.ComboBox() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabPgDriver = New System.Windows.Forms.TabPage() Me.GroupBox4 = New System.Windows.Forms.GroupBox() @@ -148,44 +88,6 @@ Partial Class F_GEN Me.Label1 = New System.Windows.Forms.Label() Me.BtDesMaxBr = New System.Windows.Forms.Button() Me.TbDesMaxFile = New System.Windows.Forms.TextBox() - Me.TabPgKF = New System.Windows.Forms.TabPage() - Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.Label12 = New System.Windows.Forms.Label() - Me.CbDragIntp = New System.Windows.Forms.ComboBox() - Me.ChInsertDrag = New System.Windows.Forms.CheckBox() - Me.ChCutDrag = New System.Windows.Forms.CheckBox() - Me.ChCutFull = New System.Windows.Forms.CheckBox() - Me.CheckBoxGS = New System.Windows.Forms.CheckBox() - Me.Label9 = New System.Windows.Forms.Label() - Me.TextBoxAvPerofModVal = New System.Windows.Forms.TextBox() - Me.TextBoxIncn = New System.Windows.Forms.TextBox() - Me.Label8 = New System.Windows.Forms.Label() - Me.Label7 = New System.Windows.Forms.Label() - Me.TextBoxIncPe = New System.Windows.Forms.TextBox() - Me.TabPgTEST = New System.Windows.Forms.TabPage() - Me.GrGearShift = New System.Windows.Forms.GroupBox() - Me.TBpfast = New System.Windows.Forms.TextBox() - Me.TBpspar = New System.Windows.Forms.TextBox() - Me.Label19 = New System.Windows.Forms.Label() - Me.Label18 = New System.Windows.Forms.Label() - Me.Label44 = New System.Windows.Forms.Label() - Me.Label43 = New System.Windows.Forms.Label() - Me.Label42 = New System.Windows.Forms.Label() - Me.Label17 = New System.Windows.Forms.Label() - Me.TBlhinunter = New System.Windows.Forms.TextBox() - Me.TBlhinauf = New System.Windows.Forms.TextBox() - Me.TBhinunter = New System.Windows.Forms.TextBox() - Me.Label16 = New System.Windows.Forms.Label() - Me.Label15 = New System.Windows.Forms.Label() - Me.TBhinauf = New System.Windows.Forms.TextBox() - Me.Label3 = New System.Windows.Forms.Label() - Me.ChbDesMax = New System.Windows.Forms.CheckBox() - Me.CbVehMode = New System.Windows.Forms.ComboBox() - Me.ChCreateMap = New System.Windows.Forms.CheckBox() - Me.ChEngAnalysis = New System.Windows.Forms.CheckBox() - Me.ComboBoxEngType = New System.Windows.Forms.ComboBox() - Me.ComboBoxEclass = New System.Windows.Forms.ComboBox() - Me.ComboBoxVehType = New System.Windows.Forms.ComboBox() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.ToolStripStatusLabelGEN = New System.Windows.Forms.ToolStripStatusLabel() Me.ButOK = New System.Windows.Forms.Button() @@ -205,9 +107,6 @@ 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.TabPgHEV.SuspendLayout() - Me.TabPgColdSt.SuspendLayout() - Me.GroupBox3.SuspendLayout() Me.TabPgGen.SuspendLayout() Me.GroupBox5.SuspendLayout() Me.GrAux.SuspendLayout() @@ -218,549 +117,12 @@ Partial Class F_GEN Me.GroupBox1.SuspendLayout() Me.GrStartStop.SuspendLayout() Me.PnStartStop.SuspendLayout() - Me.TabPgKF.SuspendLayout() - Me.GroupBox2.SuspendLayout() - Me.TabPgTEST.SuspendLayout() - Me.GrGearShift.SuspendLayout() Me.StatusStrip1.SuspendLayout() Me.ToolStrip1.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.CmOpenFile.SuspendLayout() Me.SuspendLayout() ' - 'ButOpenEXS - ' - Me.ButOpenEXS.Location = New System.Drawing.Point(3, 227) - Me.ButOpenEXS.Name = "ButOpenEXS" - Me.ButOpenEXS.Size = New System.Drawing.Size(51, 21) - Me.ButOpenEXS.TabIndex = 24 - Me.ButOpenEXS.TabStop = False - Me.ButOpenEXS.Text = "EXS" - Me.ButOpenEXS.UseVisualStyleBackColor = True - ' - 'ButtonEXS - ' - Me.ButtonEXS.Location = New System.Drawing.Point(612, 227) - Me.ButtonEXS.Name = "ButtonEXS" - Me.ButtonEXS.Size = New System.Drawing.Size(28, 21) - Me.ButtonEXS.TabIndex = 15 - Me.ButtonEXS.TabStop = False - Me.ButtonEXS.Text = "..." - Me.ButtonEXS.UseVisualStyleBackColor = True - ' - 'TabPgHEV - ' - Me.TabPgHEV.Controls.Add(Me.CbSOCnIter) - Me.TabPgHEV.Controls.Add(Me.Label10) - Me.TabPgHEV.Controls.Add(Me.TbSOCstart) - Me.TabPgHEV.Controls.Add(Me.TextBoxEKF) - Me.TabPgHEV.Controls.Add(Me.TextBoxSTE) - Me.TabPgHEV.Controls.Add(Me.TextBoxGET) - Me.TabPgHEV.Controls.Add(Me.TextBoxEAN) - Me.TabPgHEV.Controls.Add(Me.TextBoxEMO) - Me.TabPgHEV.Controls.Add(Me.TextBoxBAT) - Me.TabPgHEV.Controls.Add(Me.ButOpenEKF) - Me.TabPgHEV.Controls.Add(Me.ButOpenSTE) - Me.TabPgHEV.Controls.Add(Me.ButOpenGET) - Me.TabPgHEV.Controls.Add(Me.ButOpenEAN) - Me.TabPgHEV.Controls.Add(Me.ButOpenEMO) - Me.TabPgHEV.Controls.Add(Me.ButOpenBAT) - Me.TabPgHEV.Controls.Add(Me.ButtonBAT) - Me.TabPgHEV.Controls.Add(Me.ButtonEKF) - Me.TabPgHEV.Controls.Add(Me.ButtonSTE) - Me.TabPgHEV.Controls.Add(Me.ButtonGET) - Me.TabPgHEV.Controls.Add(Me.ButtonEMO) - Me.TabPgHEV.Controls.Add(Me.ButtonEAN) - Me.TabPgHEV.Location = New System.Drawing.Point(4, 22) - Me.TabPgHEV.Name = "TabPgHEV" - Me.TabPgHEV.Padding = New System.Windows.Forms.Padding(3) - Me.TabPgHEV.Size = New System.Drawing.Size(646, 442) - Me.TabPgHEV.TabIndex = 2 - Me.TabPgHEV.Text = "HEV" - Me.TabPgHEV.UseVisualStyleBackColor = True - ' - 'CbSOCnIter - ' - Me.CbSOCnIter.AutoSize = True - Me.CbSOCnIter.Enabled = False - Me.CbSOCnIter.Location = New System.Drawing.Point(196, 183) - Me.CbSOCnIter.Name = "CbSOCnIter" - Me.CbSOCnIter.Size = New System.Drawing.Size(197, 17) - Me.CbSOCnIter.TabIndex = 18 - Me.CbSOCnIter.Text = "Iterate (not supported in this version)" - Me.CbSOCnIter.UseVisualStyleBackColor = True - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(71, 184) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(54, 13) - Me.Label10.TabIndex = 17 - Me.Label10.Text = "SOC Start" - ' - 'TbSOCstart - ' - Me.TbSOCstart.Location = New System.Drawing.Point(131, 181) - Me.TbSOCstart.Name = "TbSOCstart" - Me.TbSOCstart.Size = New System.Drawing.Size(57, 20) - Me.TbSOCstart.TabIndex = 10 - ' - 'TextBoxEKF - ' - Me.TextBoxEKF.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxEKF.Location = New System.Drawing.Point(60, 145) - Me.TextBoxEKF.Name = "TextBoxEKF" - Me.TextBoxEKF.Size = New System.Drawing.Size(546, 20) - Me.TextBoxEKF.TabIndex = 6 - ' - 'TextBoxSTE - ' - Me.TextBoxSTE.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxSTE.Location = New System.Drawing.Point(60, 118) - Me.TextBoxSTE.Name = "TextBoxSTE" - Me.TextBoxSTE.Size = New System.Drawing.Size(546, 20) - Me.TextBoxSTE.TabIndex = 5 - ' - 'TextBoxGET - ' - Me.TextBoxGET.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxGET.Location = New System.Drawing.Point(60, 91) - Me.TextBoxGET.Name = "TextBoxGET" - Me.TextBoxGET.Size = New System.Drawing.Size(546, 20) - Me.TextBoxGET.TabIndex = 4 - ' - 'TextBoxEAN - ' - Me.TextBoxEAN.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxEAN.Location = New System.Drawing.Point(60, 64) - Me.TextBoxEAN.Name = "TextBoxEAN" - Me.TextBoxEAN.Size = New System.Drawing.Size(546, 20) - Me.TextBoxEAN.TabIndex = 3 - ' - 'TextBoxEMO - ' - Me.TextBoxEMO.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxEMO.Location = New System.Drawing.Point(60, 36) - Me.TextBoxEMO.Name = "TextBoxEMO" - Me.TextBoxEMO.Size = New System.Drawing.Size(546, 20) - Me.TextBoxEMO.TabIndex = 2 - ' - 'TextBoxBAT - ' - Me.TextBoxBAT.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxBAT.Location = New System.Drawing.Point(60, 10) - Me.TextBoxBAT.Name = "TextBoxBAT" - Me.TextBoxBAT.Size = New System.Drawing.Size(546, 20) - Me.TextBoxBAT.TabIndex = 1 - ' - 'ButOpenEKF - ' - Me.ButOpenEKF.Location = New System.Drawing.Point(3, 144) - Me.ButOpenEKF.Name = "ButOpenEKF" - Me.ButOpenEKF.Size = New System.Drawing.Size(51, 21) - Me.ButOpenEKF.TabIndex = 13 - Me.ButOpenEKF.TabStop = False - Me.ButOpenEKF.Text = "EKF" - Me.ButOpenEKF.UseVisualStyleBackColor = True - ' - 'ButOpenSTE - ' - Me.ButOpenSTE.Location = New System.Drawing.Point(3, 117) - Me.ButOpenSTE.Name = "ButOpenSTE" - Me.ButOpenSTE.Size = New System.Drawing.Size(51, 21) - Me.ButOpenSTE.TabIndex = 13 - Me.ButOpenSTE.TabStop = False - Me.ButOpenSTE.Text = "STE" - Me.ButOpenSTE.UseVisualStyleBackColor = True - ' - 'ButOpenGET - ' - Me.ButOpenGET.Location = New System.Drawing.Point(3, 90) - Me.ButOpenGET.Name = "ButOpenGET" - Me.ButOpenGET.Size = New System.Drawing.Size(51, 21) - Me.ButOpenGET.TabIndex = 13 - Me.ButOpenGET.TabStop = False - Me.ButOpenGET.Text = "GET" - Me.ButOpenGET.UseVisualStyleBackColor = True - ' - 'ButOpenEAN - ' - Me.ButOpenEAN.Location = New System.Drawing.Point(3, 63) - Me.ButOpenEAN.Name = "ButOpenEAN" - Me.ButOpenEAN.Size = New System.Drawing.Size(51, 21) - Me.ButOpenEAN.TabIndex = 13 - Me.ButOpenEAN.TabStop = False - Me.ButOpenEAN.Text = "EAN" - Me.ButOpenEAN.UseVisualStyleBackColor = True - ' - 'ButOpenEMO - ' - Me.ButOpenEMO.Location = New System.Drawing.Point(3, 36) - Me.ButOpenEMO.Name = "ButOpenEMO" - Me.ButOpenEMO.Size = New System.Drawing.Size(51, 21) - Me.ButOpenEMO.TabIndex = 13 - Me.ButOpenEMO.TabStop = False - Me.ButOpenEMO.Text = "EMO" - Me.ButOpenEMO.UseVisualStyleBackColor = True - ' - 'ButOpenBAT - ' - Me.ButOpenBAT.Location = New System.Drawing.Point(3, 9) - Me.ButOpenBAT.Name = "ButOpenBAT" - Me.ButOpenBAT.Size = New System.Drawing.Size(51, 21) - Me.ButOpenBAT.TabIndex = 13 - Me.ButOpenBAT.TabStop = False - Me.ButOpenBAT.Text = "BAT" - Me.ButOpenBAT.UseVisualStyleBackColor = True - ' - 'ButtonBAT - ' - Me.ButtonBAT.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonBAT.Location = New System.Drawing.Point(612, 9) - Me.ButtonBAT.Name = "ButtonBAT" - Me.ButtonBAT.Size = New System.Drawing.Size(28, 21) - Me.ButtonBAT.TabIndex = 1 - Me.ButtonBAT.TabStop = False - Me.ButtonBAT.Text = "..." - Me.ButtonBAT.UseVisualStyleBackColor = True - ' - 'ButtonEKF - ' - Me.ButtonEKF.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonEKF.Location = New System.Drawing.Point(612, 144) - Me.ButtonEKF.Name = "ButtonEKF" - Me.ButtonEKF.Size = New System.Drawing.Size(28, 21) - Me.ButtonEKF.TabIndex = 11 - Me.ButtonEKF.TabStop = False - Me.ButtonEKF.Text = "..." - Me.ButtonEKF.UseVisualStyleBackColor = True - ' - 'ButtonSTE - ' - Me.ButtonSTE.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonSTE.Location = New System.Drawing.Point(612, 117) - Me.ButtonSTE.Name = "ButtonSTE" - Me.ButtonSTE.Size = New System.Drawing.Size(28, 21) - Me.ButtonSTE.TabIndex = 9 - Me.ButtonSTE.TabStop = False - Me.ButtonSTE.Text = "..." - Me.ButtonSTE.UseVisualStyleBackColor = True - ' - 'ButtonGET - ' - Me.ButtonGET.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonGET.Location = New System.Drawing.Point(612, 90) - Me.ButtonGET.Name = "ButtonGET" - Me.ButtonGET.Size = New System.Drawing.Size(28, 21) - Me.ButtonGET.TabIndex = 7 - Me.ButtonGET.TabStop = False - Me.ButtonGET.Text = "..." - Me.ButtonGET.UseVisualStyleBackColor = True - ' - 'ButtonEMO - ' - Me.ButtonEMO.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonEMO.Location = New System.Drawing.Point(612, 36) - Me.ButtonEMO.Name = "ButtonEMO" - Me.ButtonEMO.Size = New System.Drawing.Size(28, 21) - Me.ButtonEMO.TabIndex = 3 - Me.ButtonEMO.TabStop = False - Me.ButtonEMO.Text = "..." - Me.ButtonEMO.UseVisualStyleBackColor = True - ' - 'ButtonEAN - ' - Me.ButtonEAN.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonEAN.Location = New System.Drawing.Point(612, 63) - Me.ButtonEAN.Name = "ButtonEAN" - Me.ButtonEAN.Size = New System.Drawing.Size(28, 21) - Me.ButtonEAN.TabIndex = 5 - Me.ButtonEAN.TabStop = False - Me.ButtonEAN.Text = "..." - Me.ButtonEAN.UseVisualStyleBackColor = True - ' - 'TabPgColdSt - ' - Me.TabPgColdSt.Controls.Add(Me.TextBoxATC) - Me.TabPgColdSt.Controls.Add(Me.TextBoxCDW) - Me.TabPgColdSt.Controls.Add(Me.TextBoxWUC) - Me.TabPgColdSt.Controls.Add(Me.TextBoxWUA) - Me.TabPgColdSt.Controls.Add(Me.TextBoxMAC) - Me.TabPgColdSt.Controls.Add(Me.TextBoxMAA) - Me.TabPgColdSt.Controls.Add(Me.ButOpenATC) - Me.TabPgColdSt.Controls.Add(Me.ButOpenCDW) - Me.TabPgColdSt.Controls.Add(Me.ButOpenWUC) - Me.TabPgColdSt.Controls.Add(Me.ButOpenWUA) - Me.TabPgColdSt.Controls.Add(Me.GroupBox3) - Me.TabPgColdSt.Controls.Add(Me.ButOpenMAC) - Me.TabPgColdSt.Controls.Add(Me.ButOpenMAA) - Me.TabPgColdSt.Controls.Add(Me.ButtonMAA) - Me.TabPgColdSt.Controls.Add(Me.ButtonATC) - Me.TabPgColdSt.Controls.Add(Me.ButtonCDW) - Me.TabPgColdSt.Controls.Add(Me.ButtonWUC) - Me.TabPgColdSt.Controls.Add(Me.ButtonMAC) - Me.TabPgColdSt.Controls.Add(Me.ButtonWUA) - Me.TabPgColdSt.Location = New System.Drawing.Point(4, 22) - Me.TabPgColdSt.Name = "TabPgColdSt" - Me.TabPgColdSt.Padding = New System.Windows.Forms.Padding(3) - Me.TabPgColdSt.Size = New System.Drawing.Size(646, 442) - Me.TabPgColdSt.TabIndex = 1 - Me.TabPgColdSt.Text = "Cold Start" - Me.TabPgColdSt.UseVisualStyleBackColor = True - ' - 'TextBoxATC - ' - Me.TextBoxATC.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxATC.Location = New System.Drawing.Point(60, 145) - Me.TextBoxATC.Name = "TextBoxATC" - Me.TextBoxATC.Size = New System.Drawing.Size(546, 20) - Me.TextBoxATC.TabIndex = 6 - ' - 'TextBoxCDW - ' - Me.TextBoxCDW.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxCDW.Location = New System.Drawing.Point(60, 118) - Me.TextBoxCDW.Name = "TextBoxCDW" - Me.TextBoxCDW.Size = New System.Drawing.Size(546, 20) - Me.TextBoxCDW.TabIndex = 5 - ' - 'TextBoxWUC - ' - Me.TextBoxWUC.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxWUC.Location = New System.Drawing.Point(60, 91) - Me.TextBoxWUC.Name = "TextBoxWUC" - Me.TextBoxWUC.Size = New System.Drawing.Size(546, 20) - Me.TextBoxWUC.TabIndex = 4 - ' - 'TextBoxWUA - ' - Me.TextBoxWUA.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxWUA.Location = New System.Drawing.Point(60, 64) - Me.TextBoxWUA.Name = "TextBoxWUA" - Me.TextBoxWUA.Size = New System.Drawing.Size(546, 20) - Me.TextBoxWUA.TabIndex = 3 - ' - 'TextBoxMAC - ' - Me.TextBoxMAC.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxMAC.Location = New System.Drawing.Point(60, 36) - Me.TextBoxMAC.Name = "TextBoxMAC" - Me.TextBoxMAC.Size = New System.Drawing.Size(546, 20) - Me.TextBoxMAC.TabIndex = 2 - ' - 'TextBoxMAA - ' - Me.TextBoxMAA.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TextBoxMAA.Location = New System.Drawing.Point(60, 10) - Me.TextBoxMAA.Name = "TextBoxMAA" - Me.TextBoxMAA.Size = New System.Drawing.Size(546, 20) - Me.TextBoxMAA.TabIndex = 1 - ' - 'ButOpenATC - ' - Me.ButOpenATC.Location = New System.Drawing.Point(3, 144) - Me.ButOpenATC.Name = "ButOpenATC" - Me.ButOpenATC.Size = New System.Drawing.Size(51, 21) - Me.ButOpenATC.TabIndex = 12 - Me.ButOpenATC.TabStop = False - Me.ButOpenATC.Text = "ATC" - Me.ButOpenATC.UseVisualStyleBackColor = True - ' - 'ButOpenCDW - ' - Me.ButOpenCDW.Location = New System.Drawing.Point(3, 117) - Me.ButOpenCDW.Name = "ButOpenCDW" - Me.ButOpenCDW.Size = New System.Drawing.Size(51, 21) - Me.ButOpenCDW.TabIndex = 12 - Me.ButOpenCDW.TabStop = False - Me.ButOpenCDW.Text = "CDW" - Me.ButOpenCDW.UseVisualStyleBackColor = True - ' - 'ButOpenWUC - ' - Me.ButOpenWUC.Location = New System.Drawing.Point(3, 90) - Me.ButOpenWUC.Name = "ButOpenWUC" - Me.ButOpenWUC.Size = New System.Drawing.Size(51, 21) - Me.ButOpenWUC.TabIndex = 12 - Me.ButOpenWUC.TabStop = False - Me.ButOpenWUC.Text = "WUC" - Me.ButOpenWUC.UseVisualStyleBackColor = True - ' - 'ButOpenWUA - ' - Me.ButOpenWUA.Location = New System.Drawing.Point(3, 63) - Me.ButOpenWUA.Name = "ButOpenWUA" - Me.ButOpenWUA.Size = New System.Drawing.Size(51, 21) - Me.ButOpenWUA.TabIndex = 12 - Me.ButOpenWUA.TabStop = False - Me.ButOpenWUA.Text = "WUA" - Me.ButOpenWUA.UseVisualStyleBackColor = True - ' - 'GroupBox3 - ' - Me.GroupBox3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.GroupBox3.Controls.Add(Me.Label6) - Me.GroupBox3.Controls.Add(Me.TextBoxTofSt) - Me.GroupBox3.Controls.Add(Me.TextBoxTKW) - Me.GroupBox3.Controls.Add(Me.TextBoxTKat) - Me.GroupBox3.Controls.Add(Me.Label5) - Me.GroupBox3.Controls.Add(Me.Label4) - Me.GroupBox3.Location = New System.Drawing.Point(6, 171) - Me.GroupBox3.Name = "GroupBox3" - Me.GroupBox3.Size = New System.Drawing.Size(634, 154) - Me.GroupBox3.TabIndex = 10 - Me.GroupBox3.TabStop = False - Me.GroupBox3.Text = "Parameters" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(465, 22) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(84, 13) - Me.Label6.TabIndex = 4 - Me.Label6.Text = "Time of Start [s]:" - ' - 'TextBoxTofSt - ' - Me.TextBoxTofSt.Location = New System.Drawing.Point(555, 19) - Me.TextBoxTofSt.Name = "TextBoxTofSt" - Me.TextBoxTofSt.Size = New System.Drawing.Size(62, 20) - Me.TextBoxTofSt.TabIndex = 2 - ' - 'TextBoxTKW - ' - Me.TextBoxTKW.Location = New System.Drawing.Point(302, 19) - Me.TextBoxTKW.Name = "TextBoxTKW" - Me.TextBoxTKW.Size = New System.Drawing.Size(62, 20) - Me.TextBoxTKW.TabIndex = 1 - ' - 'TextBoxTKat - ' - Me.TextBoxTKat.Location = New System.Drawing.Point(112, 19) - Me.TextBoxTKat.Name = "TextBoxTKat" - Me.TextBoxTKat.Size = New System.Drawing.Size(62, 20) - Me.TextBoxTKat.TabIndex = 0 - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(200, 22) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(103, 13) - Me.Label5.TabIndex = 1 - Me.Label5.Text = "Coolant Temp [°C]:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(9, 22) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(104, 13) - Me.Label4.TabIndex = 0 - Me.Label4.Text = "Catalyst Temp [°C]:" - ' - 'ButOpenMAC - ' - Me.ButOpenMAC.Location = New System.Drawing.Point(3, 36) - Me.ButOpenMAC.Name = "ButOpenMAC" - Me.ButOpenMAC.Size = New System.Drawing.Size(51, 21) - Me.ButOpenMAC.TabIndex = 12 - Me.ButOpenMAC.TabStop = False - Me.ButOpenMAC.Text = "MAC" - Me.ButOpenMAC.UseVisualStyleBackColor = True - ' - 'ButOpenMAA - ' - Me.ButOpenMAA.Location = New System.Drawing.Point(3, 9) - Me.ButOpenMAA.Name = "ButOpenMAA" - Me.ButOpenMAA.Size = New System.Drawing.Size(51, 21) - Me.ButOpenMAA.TabIndex = 12 - Me.ButOpenMAA.TabStop = False - Me.ButOpenMAA.Text = "MAA" - Me.ButOpenMAA.UseVisualStyleBackColor = True - ' - 'ButtonMAA - ' - Me.ButtonMAA.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonMAA.Location = New System.Drawing.Point(612, 9) - Me.ButtonMAA.Name = "ButtonMAA" - Me.ButtonMAA.Size = New System.Drawing.Size(28, 21) - Me.ButtonMAA.TabIndex = 1 - Me.ButtonMAA.TabStop = False - Me.ButtonMAA.Text = "..." - Me.ButtonMAA.UseVisualStyleBackColor = True - ' - 'ButtonATC - ' - Me.ButtonATC.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonATC.Location = New System.Drawing.Point(612, 144) - Me.ButtonATC.Name = "ButtonATC" - Me.ButtonATC.Size = New System.Drawing.Size(28, 21) - Me.ButtonATC.TabIndex = 11 - Me.ButtonATC.TabStop = False - Me.ButtonATC.Text = "..." - Me.ButtonATC.UseVisualStyleBackColor = True - ' - 'ButtonCDW - ' - Me.ButtonCDW.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonCDW.Location = New System.Drawing.Point(612, 117) - Me.ButtonCDW.Name = "ButtonCDW" - Me.ButtonCDW.Size = New System.Drawing.Size(28, 21) - Me.ButtonCDW.TabIndex = 9 - Me.ButtonCDW.TabStop = False - Me.ButtonCDW.Text = "..." - Me.ButtonCDW.UseVisualStyleBackColor = True - ' - 'ButtonWUC - ' - Me.ButtonWUC.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonWUC.Location = New System.Drawing.Point(612, 90) - Me.ButtonWUC.Name = "ButtonWUC" - Me.ButtonWUC.Size = New System.Drawing.Size(28, 21) - Me.ButtonWUC.TabIndex = 7 - Me.ButtonWUC.TabStop = False - Me.ButtonWUC.Text = "..." - Me.ButtonWUC.UseVisualStyleBackColor = True - ' - 'ButtonMAC - ' - Me.ButtonMAC.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonMAC.Location = New System.Drawing.Point(612, 36) - Me.ButtonMAC.Name = "ButtonMAC" - Me.ButtonMAC.Size = New System.Drawing.Size(28, 21) - Me.ButtonMAC.TabIndex = 3 - Me.ButtonMAC.TabStop = False - Me.ButtonMAC.Text = "..." - Me.ButtonMAC.UseVisualStyleBackColor = True - ' - 'ButtonWUA - ' - Me.ButtonWUA.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.ButtonWUA.Location = New System.Drawing.Point(612, 63) - Me.ButtonWUA.Name = "ButtonWUA" - Me.ButtonWUA.Size = New System.Drawing.Size(28, 21) - Me.ButtonWUA.TabIndex = 5 - Me.ButtonWUA.TabStop = False - Me.ButtonWUA.Text = "..." - Me.ButtonWUA.UseVisualStyleBackColor = True - ' 'TabPgGen ' Me.TabPgGen.Controls.Add(Me.GroupBox5) @@ -1010,116 +372,12 @@ Partial Class F_GEN Me.ButtonMAP.Text = "..." Me.ButtonMAP.UseVisualStyleBackColor = True ' - 'Label11 - ' - Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(380, 81) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(128, 13) - Me.Label11.TabIndex = 11 - Me.Label11.Text = "Transmission Loss Model:" - ' - 'CbTransLossModel - ' - Me.CbTransLossModel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbTransLossModel.FormattingEnabled = True - Me.CbTransLossModel.Items.AddRange(New Object() {"Basic", "Detailed"}) - Me.CbTransLossModel.Location = New System.Drawing.Point(514, 78) - Me.CbTransLossModel.Name = "CbTransLossModel" - Me.CbTransLossModel.Size = New System.Drawing.Size(126, 21) - Me.CbTransLossModel.TabIndex = 20 - ' - 'TextBoxEXS - ' - Me.TextBoxEXS.Location = New System.Drawing.Point(60, 228) - Me.TextBoxEXS.Name = "TextBoxEXS" - Me.TextBoxEXS.Size = New System.Drawing.Size(546, 20) - Me.TextBoxEXS.TabIndex = 7 - ' - 'TextBoxTRS - ' - Me.TextBoxTRS.Location = New System.Drawing.Point(60, 161) - Me.TextBoxTRS.Name = "TextBoxTRS" - Me.TextBoxTRS.Size = New System.Drawing.Size(546, 20) - Me.TextBoxTRS.TabIndex = 5 - ' - 'CheckBoxDynKor - ' - Me.CheckBoxDynKor.AutoSize = True - Me.CheckBoxDynKor.Checked = True - Me.CheckBoxDynKor.CheckState = System.Windows.Forms.CheckState.Checked - Me.CheckBoxDynKor.Location = New System.Drawing.Point(6, 137) - Me.CheckBoxDynKor.Name = "CheckBoxDynKor" - Me.CheckBoxDynKor.Size = New System.Drawing.Size(121, 17) - Me.CheckBoxDynKor.TabIndex = 4 - Me.CheckBoxDynKor.Text = "Transient Correction" - Me.CheckBoxDynKor.UseVisualStyleBackColor = True - ' - 'CheckBoxSCR - ' - Me.CheckBoxSCR.AutoSize = True - Me.CheckBoxSCR.Checked = True - Me.CheckBoxSCR.CheckState = System.Windows.Forms.CheckState.Checked - Me.CheckBoxSCR.Location = New System.Drawing.Point(6, 204) - Me.CheckBoxSCR.Name = "CheckBoxSCR" - Me.CheckBoxSCR.Size = New System.Drawing.Size(152, 17) - Me.CheckBoxSCR.TabIndex = 6 - Me.CheckBoxSCR.Text = "Exhaust System Simulation" - Me.CheckBoxSCR.UseVisualStyleBackColor = True - ' - 'CheckBoxColdSt - ' - Me.CheckBoxColdSt.AutoSize = True - Me.CheckBoxColdSt.Checked = True - Me.CheckBoxColdSt.CheckState = System.Windows.Forms.CheckState.Checked - Me.CheckBoxColdSt.Enabled = False - Me.CheckBoxColdSt.Location = New System.Drawing.Point(19, 76) - Me.CheckBoxColdSt.Name = "CheckBoxColdSt" - Me.CheckBoxColdSt.Size = New System.Drawing.Size(213, 17) - Me.CheckBoxColdSt.TabIndex = 8 - Me.CheckBoxColdSt.Text = "Cold Start (not supported in this version)" - Me.CheckBoxColdSt.UseVisualStyleBackColor = True - ' - 'ButOpenTRS - ' - Me.ButOpenTRS.Location = New System.Drawing.Point(3, 160) - Me.ButOpenTRS.Name = "ButOpenTRS" - Me.ButOpenTRS.Size = New System.Drawing.Size(51, 21) - Me.ButOpenTRS.TabIndex = 23 - Me.ButOpenTRS.TabStop = False - Me.ButOpenTRS.Text = "TRS" - Me.ButOpenTRS.UseVisualStyleBackColor = True - ' - 'ButtonTRS - ' - Me.ButtonTRS.Location = New System.Drawing.Point(612, 160) - Me.ButtonTRS.Name = "ButtonTRS" - Me.ButtonTRS.Size = New System.Drawing.Size(28, 21) - Me.ButtonTRS.TabIndex = 14 - Me.ButtonTRS.TabStop = False - Me.ButtonTRS.Text = "..." - Me.ButtonTRS.UseVisualStyleBackColor = True - ' - 'ComboBoxGearShift - ' - Me.ComboBoxGearShift.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ComboBoxGearShift.FormattingEnabled = True - Me.ComboBoxGearShift.Items.AddRange(New Object() {"NEDC", "FTP", "Model - MT"}) - Me.ComboBoxGearShift.Location = New System.Drawing.Point(514, 51) - Me.ComboBoxGearShift.Name = "ComboBoxGearShift" - Me.ComboBoxGearShift.Size = New System.Drawing.Size(126, 21) - Me.ComboBoxGearShift.TabIndex = 10 - ' 'TabControl1 ' Me.TabControl1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl1.Controls.Add(Me.TabPgGen) Me.TabControl1.Controls.Add(Me.TabPgDriver) - Me.TabControl1.Controls.Add(Me.TabPgColdSt) - Me.TabControl1.Controls.Add(Me.TabPgHEV) - Me.TabControl1.Controls.Add(Me.TabPgKF) - Me.TabControl1.Controls.Add(Me.TabPgTEST) Me.TabControl1.Location = New System.Drawing.Point(1, 107) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 @@ -1507,401 +765,6 @@ Partial Class F_GEN Me.TbDesMaxFile.Size = New System.Drawing.Size(571, 20) Me.TbDesMaxFile.TabIndex = 0 ' - 'TabPgKF - ' - Me.TabPgKF.Controls.Add(Me.GroupBox2) - Me.TabPgKF.Location = New System.Drawing.Point(4, 22) - Me.TabPgKF.Name = "TabPgKF" - Me.TabPgKF.Padding = New System.Windows.Forms.Padding(3) - Me.TabPgKF.Size = New System.Drawing.Size(646, 442) - Me.TabPgKF.TabIndex = 3 - Me.TabPgKF.Text = "MAP Creation" - Me.TabPgKF.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.GroupBox2.Controls.Add(Me.Label12) - Me.GroupBox2.Controls.Add(Me.CbDragIntp) - Me.GroupBox2.Controls.Add(Me.ChInsertDrag) - Me.GroupBox2.Controls.Add(Me.ChCutDrag) - Me.GroupBox2.Controls.Add(Me.ChCutFull) - Me.GroupBox2.Controls.Add(Me.CheckBoxGS) - Me.GroupBox2.Controls.Add(Me.Label9) - Me.GroupBox2.Controls.Add(Me.TextBoxAvPerofModVal) - Me.GroupBox2.Controls.Add(Me.TextBoxIncn) - Me.GroupBox2.Controls.Add(Me.Label8) - Me.GroupBox2.Controls.Add(Me.Label7) - Me.GroupBox2.Controls.Add(Me.TextBoxIncPe) - Me.GroupBox2.Location = New System.Drawing.Point(6, 6) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(634, 319) - Me.GroupBox2.TabIndex = 2 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Parameters" - ' - 'Label12 - ' - Me.Label12.AutoSize = True - Me.Label12.Location = New System.Drawing.Point(262, 127) - Me.Label12.Name = "Label12" - Me.Label12.Size = New System.Drawing.Size(118, 13) - Me.Label12.TabIndex = 14 - Me.Label12.Text = "Drag curve interpolaten" - ' - 'CbDragIntp - ' - Me.CbDragIntp.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbDragIntp.FormattingEnabled = True - Me.CbDragIntp.Items.AddRange(New Object() {"Use values from .fld file", "Use measurement data"}) - Me.CbDragIntp.Location = New System.Drawing.Point(386, 124) - Me.CbDragIntp.Name = "CbDragIntp" - Me.CbDragIntp.Size = New System.Drawing.Size(196, 21) - Me.CbDragIntp.TabIndex = 13 - ' - 'ChInsertDrag - ' - Me.ChInsertDrag.AutoSize = True - Me.ChInsertDrag.Location = New System.Drawing.Point(22, 172) - Me.ChInsertDrag.Name = "ChInsertDrag" - Me.ChInsertDrag.Size = New System.Drawing.Size(115, 17) - Me.ChInsertDrag.TabIndex = 12 - Me.ChInsertDrag.Text = "Include drag curve" - Me.ChInsertDrag.UseVisualStyleBackColor = True - ' - 'ChCutDrag - ' - Me.ChCutDrag.AutoSize = True - Me.ChCutDrag.Location = New System.Drawing.Point(22, 149) - Me.ChCutDrag.Name = "ChCutDrag" - Me.ChCutDrag.Size = New System.Drawing.Size(127, 17) - Me.ChCutDrag.TabIndex = 11 - Me.ChCutDrag.Text = "Cut below drag curve" - Me.ChCutDrag.UseVisualStyleBackColor = True - ' - 'ChCutFull - ' - Me.ChCutFull.AutoSize = True - Me.ChCutFull.Location = New System.Drawing.Point(22, 126) - Me.ChCutFull.Name = "ChCutFull" - Me.ChCutFull.Size = New System.Drawing.Size(144, 17) - Me.ChCutFull.TabIndex = 10 - Me.ChCutFull.Text = "Cut above full load curve" - Me.ChCutFull.UseVisualStyleBackColor = True - ' - 'CheckBoxGS - ' - Me.CheckBoxGS.AutoSize = True - Me.CheckBoxGS.Checked = True - Me.CheckBoxGS.CheckState = System.Windows.Forms.CheckState.Checked - Me.CheckBoxGS.Enabled = False - Me.CheckBoxGS.Location = New System.Drawing.Point(405, 29) - Me.CheckBoxGS.Name = "CheckBoxGS" - Me.CheckBoxGS.Size = New System.Drawing.Size(116, 17) - Me.CheckBoxGS.TabIndex = 3 - Me.CheckBoxGS.Text = "Include Gear Shifts" - Me.CheckBoxGS.UseVisualStyleBackColor = True - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(89, 85) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(176, 13) - Me.Label9.TabIndex = 7 - Me.Label9.Text = "Averageing Period for Modal Values" - Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight - ' - 'TextBoxAvPerofModVal - ' - Me.TextBoxAvPerofModVal.Location = New System.Drawing.Point(22, 82) - Me.TextBoxAvPerofModVal.Name = "TextBoxAvPerofModVal" - Me.TextBoxAvPerofModVal.Size = New System.Drawing.Size(61, 20) - Me.TextBoxAvPerofModVal.TabIndex = 2 - ' - 'TextBoxIncn - ' - Me.TextBoxIncn.Location = New System.Drawing.Point(22, 56) - Me.TextBoxIncn.Name = "TextBoxIncn" - Me.TextBoxIncn.Size = New System.Drawing.Size(61, 20) - Me.TextBoxIncn.TabIndex = 1 - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(89, 58) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(63, 13) - Me.Label8.TabIndex = 9 - Me.Label8.Text = "Increment n" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(89, 33) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(70, 13) - Me.Label7.TabIndex = 8 - Me.Label7.Text = "Increment Pe" - ' - 'TextBoxIncPe - ' - Me.TextBoxIncPe.Location = New System.Drawing.Point(22, 30) - Me.TextBoxIncPe.Name = "TextBoxIncPe" - Me.TextBoxIncPe.Size = New System.Drawing.Size(61, 20) - Me.TextBoxIncPe.TabIndex = 0 - ' - 'TabPgTEST - ' - Me.TabPgTEST.Controls.Add(Me.GrGearShift) - Me.TabPgTEST.Controls.Add(Me.Label3) - Me.TabPgTEST.Controls.Add(Me.ComboBoxGearShift) - Me.TabPgTEST.Controls.Add(Me.ChbDesMax) - Me.TabPgTEST.Controls.Add(Me.CbVehMode) - Me.TabPgTEST.Controls.Add(Me.ChCreateMap) - Me.TabPgTEST.Controls.Add(Me.ChEngAnalysis) - Me.TabPgTEST.Controls.Add(Me.CheckBoxColdSt) - Me.TabPgTEST.Controls.Add(Me.Label11) - Me.TabPgTEST.Controls.Add(Me.CbTransLossModel) - Me.TabPgTEST.Controls.Add(Me.ComboBoxEngType) - Me.TabPgTEST.Controls.Add(Me.CheckBoxDynKor) - Me.TabPgTEST.Controls.Add(Me.ComboBoxEclass) - Me.TabPgTEST.Controls.Add(Me.CheckBoxSCR) - Me.TabPgTEST.Controls.Add(Me.ButOpenTRS) - Me.TabPgTEST.Controls.Add(Me.ComboBoxVehType) - Me.TabPgTEST.Controls.Add(Me.ButOpenEXS) - Me.TabPgTEST.Controls.Add(Me.ButtonTRS) - Me.TabPgTEST.Controls.Add(Me.ButtonEXS) - Me.TabPgTEST.Controls.Add(Me.TextBoxTRS) - Me.TabPgTEST.Controls.Add(Me.TextBoxEXS) - Me.TabPgTEST.Location = New System.Drawing.Point(4, 22) - Me.TabPgTEST.Name = "TabPgTEST" - Me.TabPgTEST.Padding = New System.Windows.Forms.Padding(3) - Me.TabPgTEST.Size = New System.Drawing.Size(646, 442) - Me.TabPgTEST.TabIndex = 6 - Me.TabPgTEST.Text = "TEST" - Me.TabPgTEST.UseVisualStyleBackColor = True - ' - 'GrGearShift - ' - Me.GrGearShift.Controls.Add(Me.TBpfast) - Me.GrGearShift.Controls.Add(Me.TBpspar) - Me.GrGearShift.Controls.Add(Me.Label19) - Me.GrGearShift.Controls.Add(Me.Label18) - Me.GrGearShift.Controls.Add(Me.Label44) - Me.GrGearShift.Controls.Add(Me.Label43) - Me.GrGearShift.Controls.Add(Me.Label42) - Me.GrGearShift.Controls.Add(Me.Label17) - Me.GrGearShift.Controls.Add(Me.TBlhinunter) - Me.GrGearShift.Controls.Add(Me.TBlhinauf) - Me.GrGearShift.Controls.Add(Me.TBhinunter) - Me.GrGearShift.Controls.Add(Me.Label16) - Me.GrGearShift.Controls.Add(Me.Label15) - Me.GrGearShift.Controls.Add(Me.TBhinauf) - Me.GrGearShift.Location = New System.Drawing.Point(19, 277) - Me.GrGearShift.Name = "GrGearShift" - Me.GrGearShift.Size = New System.Drawing.Size(183, 128) - Me.GrGearShift.TabIndex = 34 - Me.GrGearShift.TabStop = False - Me.GrGearShift.Text = "Gear Shift Parameters" - ' - 'TBpfast - ' - Me.TBpfast.Location = New System.Drawing.Point(69, 90) - Me.TBpfast.Name = "TBpfast" - Me.TBpfast.Size = New System.Drawing.Size(40, 20) - Me.TBpfast.TabIndex = 4 - ' - 'TBpspar - ' - Me.TBpspar.Location = New System.Drawing.Point(115, 90) - Me.TBpspar.Name = "TBpspar" - Me.TBpspar.Size = New System.Drawing.Size(40, 20) - Me.TBpspar.TabIndex = 5 - ' - 'Label19 - ' - Me.Label19.AutoSize = True - Me.Label19.Location = New System.Drawing.Point(28, 93) - Me.Label19.Name = "Label19" - Me.Label19.Size = New System.Drawing.Size(35, 13) - Me.Label19.TabIndex = 8 - Me.Label19.Text = "Share" - ' - 'Label18 - ' - Me.Label18.AutoSize = True - Me.Label18.Location = New System.Drawing.Point(121, 18) - Me.Label18.Name = "Label18" - Me.Label18.Size = New System.Drawing.Size(25, 13) - Me.Label18.TabIndex = 7 - Me.Label18.Text = "eco" - ' - 'Label44 - ' - Me.Label44.AutoSize = True - Me.Label44.Location = New System.Drawing.Point(161, 92) - Me.Label44.Name = "Label44" - Me.Label44.Size = New System.Drawing.Size(16, 13) - Me.Label44.TabIndex = 5 - Me.Label44.Text = "[-]" - ' - 'Label43 - ' - Me.Label43.AutoSize = True - Me.Label43.Location = New System.Drawing.Point(161, 66) - Me.Label43.Name = "Label43" - Me.Label43.Size = New System.Drawing.Size(16, 13) - Me.Label43.TabIndex = 5 - Me.Label43.Text = "[-]" - ' - 'Label42 - ' - Me.Label42.AutoSize = True - Me.Label42.Location = New System.Drawing.Point(161, 41) - Me.Label42.Name = "Label42" - Me.Label42.Size = New System.Drawing.Size(16, 13) - Me.Label42.TabIndex = 5 - Me.Label42.Text = "[-]" - ' - 'Label17 - ' - Me.Label17.AutoSize = True - Me.Label17.Location = New System.Drawing.Point(76, 18) - Me.Label17.Name = "Label17" - Me.Label17.Size = New System.Drawing.Size(24, 13) - Me.Label17.TabIndex = 6 - Me.Label17.Text = "fast" - ' - 'TBlhinunter - ' - Me.TBlhinunter.Location = New System.Drawing.Point(115, 64) - Me.TBlhinunter.Name = "TBlhinunter" - Me.TBlhinunter.Size = New System.Drawing.Size(40, 20) - Me.TBlhinunter.TabIndex = 3 - ' - 'TBlhinauf - ' - Me.TBlhinauf.Location = New System.Drawing.Point(115, 38) - Me.TBlhinauf.Name = "TBlhinauf" - Me.TBlhinauf.Size = New System.Drawing.Size(40, 20) - Me.TBlhinauf.TabIndex = 1 - ' - 'TBhinunter - ' - Me.TBhinunter.Location = New System.Drawing.Point(69, 64) - Me.TBhinunter.Name = "TBhinunter" - Me.TBhinunter.Size = New System.Drawing.Size(40, 20) - Me.TBhinunter.TabIndex = 2 - ' - 'Label16 - ' - Me.Label16.AutoSize = True - Me.Label16.Location = New System.Drawing.Point(4, 67) - Me.Label16.Name = "Label16" - Me.Label16.Size = New System.Drawing.Size(59, 13) - Me.Label16.TabIndex = 2 - Me.Label16.Text = "Shift Down" - ' - 'Label15 - ' - Me.Label15.AutoSize = True - Me.Label15.Location = New System.Drawing.Point(18, 41) - Me.Label15.Name = "Label15" - Me.Label15.Size = New System.Drawing.Size(45, 13) - Me.Label15.TabIndex = 1 - Me.Label15.Text = "Shift Up" - ' - 'TBhinauf - ' - Me.TBhinauf.Location = New System.Drawing.Point(69, 38) - Me.TBhinauf.Name = "TBhinauf" - Me.TBhinauf.Size = New System.Drawing.Size(40, 20) - Me.TBhinauf.TabIndex = 0 - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(427, 54) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(81, 13) - Me.Label3.TabIndex = 27 - Me.Label3.Text = "Gear shift mode" - ' - 'ChbDesMax - ' - Me.ChbDesMax.AutoSize = True - Me.ChbDesMax.Checked = True - Me.ChbDesMax.CheckState = System.Windows.Forms.CheckState.Checked - Me.ChbDesMax.Location = New System.Drawing.Point(19, 53) - Me.ChbDesMax.Name = "ChbDesMax" - Me.ChbDesMax.Size = New System.Drawing.Size(108, 17) - Me.ChbDesMax.TabIndex = 26 - Me.ChbDesMax.Text = "Limit acceleration" - Me.ChbDesMax.UseVisualStyleBackColor = True - ' - 'CbVehMode - ' - Me.CbVehMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbVehMode.FormattingEnabled = True - Me.CbVehMode.Items.AddRange(New Object() {"Standard", "Engine Only", "HEV", "EV"}) - Me.CbVehMode.Location = New System.Drawing.Point(300, 6) - Me.CbVehMode.Name = "CbVehMode" - Me.CbVehMode.Size = New System.Drawing.Size(96, 21) - Me.CbVehMode.TabIndex = 5 - ' - 'ChCreateMap - ' - Me.ChCreateMap.AutoSize = True - Me.ChCreateMap.Location = New System.Drawing.Point(33, 8) - Me.ChCreateMap.Name = "ChCreateMap" - Me.ChCreateMap.Size = New System.Drawing.Size(125, 17) - Me.ChCreateMap.TabIndex = 7 - Me.ChCreateMap.Text = "Create Emission Map" - Me.ChCreateMap.UseVisualStyleBackColor = True - ' - 'ChEngAnalysis - ' - Me.ChEngAnalysis.AutoSize = True - Me.ChEngAnalysis.Location = New System.Drawing.Point(164, 8) - Me.ChEngAnalysis.Name = "ChEngAnalysis" - Me.ChEngAnalysis.Size = New System.Drawing.Size(100, 17) - Me.ChEngAnalysis.TabIndex = 6 - Me.ChEngAnalysis.Text = "Engine Analysis" - Me.ChEngAnalysis.UseVisualStyleBackColor = True - ' - 'ComboBoxEngType - ' - Me.ComboBoxEngType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ComboBoxEngType.FormattingEnabled = True - Me.ComboBoxEngType.Items.AddRange(New Object() {"Otto", "Diesel"}) - Me.ComboBoxEngType.Location = New System.Drawing.Point(504, 6) - Me.ComboBoxEngType.Name = "ComboBoxEngType" - Me.ComboBoxEngType.Size = New System.Drawing.Size(61, 21) - Me.ComboBoxEngType.TabIndex = 4 - ' - 'ComboBoxEclass - ' - Me.ComboBoxEclass.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ComboBoxEclass.FormattingEnabled = True - Me.ComboBoxEclass.Items.AddRange(New Object() {"EURO 0", "EURO 1", "EURO 2", "EURO 3", "EURO 4", "EURO 5", "EURO 6", "EURO 7", "EURO 8", "EURO 9"}) - Me.ComboBoxEclass.Location = New System.Drawing.Point(571, 6) - Me.ComboBoxEclass.Name = "ComboBoxEclass" - Me.ComboBoxEclass.Size = New System.Drawing.Size(69, 21) - Me.ComboBoxEclass.TabIndex = 4 - ' - 'ComboBoxVehType - ' - Me.ComboBoxVehType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ComboBoxVehType.FormattingEnabled = True - Me.ComboBoxVehType.Items.AddRange(New Object() {"Heavy Duty", "Passenger Car"}) - Me.ComboBoxVehType.Location = New System.Drawing.Point(402, 6) - Me.ComboBoxVehType.Name = "ComboBoxVehType" - Me.ComboBoxVehType.Size = New System.Drawing.Size(96, 21) - Me.ComboBoxVehType.TabIndex = 1 - ' 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabelGEN}) @@ -2082,12 +945,6 @@ Partial Class F_GEN Me.Name = "F_GEN" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "GEN Editor" - Me.TabPgHEV.ResumeLayout(False) - Me.TabPgHEV.PerformLayout() - Me.TabPgColdSt.ResumeLayout(False) - Me.TabPgColdSt.PerformLayout() - Me.GroupBox3.ResumeLayout(False) - Me.GroupBox3.PerformLayout() Me.TabPgGen.ResumeLayout(False) Me.TabPgGen.PerformLayout() Me.GroupBox5.ResumeLayout(False) @@ -2107,13 +964,6 @@ Partial Class F_GEN Me.GrStartStop.PerformLayout() Me.PnStartStop.ResumeLayout(False) Me.PnStartStop.PerformLayout() - Me.TabPgKF.ResumeLayout(False) - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.TabPgTEST.ResumeLayout(False) - Me.TabPgTEST.PerformLayout() - Me.GrGearShift.ResumeLayout(False) - Me.GrGearShift.PerformLayout() Me.StatusStrip1.ResumeLayout(False) Me.StatusStrip1.PerformLayout() Me.ToolStrip1.ResumeLayout(False) @@ -2124,102 +974,21 @@ Partial Class F_GEN Me.PerformLayout() End Sub - Friend WithEvents TabPgHEV As System.Windows.Forms.TabPage - Friend WithEvents TabPgColdSt As System.Windows.Forms.TabPage Friend WithEvents TabPgGen As System.Windows.Forms.TabPage Friend WithEvents TabControl1 As System.Windows.Forms.TabControl - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox - Friend WithEvents CheckBoxDynKor As System.Windows.Forms.CheckBox - Friend WithEvents ComboBoxGearShift As System.Windows.Forms.ComboBox - Friend WithEvents ComboBoxVehType As System.Windows.Forms.ComboBox - Friend WithEvents CheckBoxColdSt As System.Windows.Forms.CheckBox - Friend WithEvents ComboBoxEclass As System.Windows.Forms.ComboBox - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents TextBoxTofSt As System.Windows.Forms.TextBox - Friend WithEvents TextBoxTKW As System.Windows.Forms.TextBox - Friend WithEvents TextBoxTKat As System.Windows.Forms.TextBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents TextBoxAvPerofModVal As System.Windows.Forms.TextBox - Friend WithEvents TextBoxIncn As System.Windows.Forms.TextBox - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents TextBoxIncPe As System.Windows.Forms.TextBox - Friend WithEvents CheckBoxGS As System.Windows.Forms.CheckBox - Friend WithEvents ComboBoxEngType As System.Windows.Forms.ComboBox - Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip - Friend WithEvents CheckBoxSCR As System.Windows.Forms.CheckBox Friend WithEvents ButtonVEH As System.Windows.Forms.Button Friend WithEvents ButtonMAP As System.Windows.Forms.Button Friend WithEvents ButtonGBX As System.Windows.Forms.Button - Friend WithEvents ButtonTRS As System.Windows.Forms.Button - Friend WithEvents ButtonMAA As System.Windows.Forms.Button - Friend WithEvents ButtonCDW As System.Windows.Forms.Button - Friend WithEvents ButtonWUC As System.Windows.Forms.Button - Friend WithEvents ButtonMAC As System.Windows.Forms.Button - Friend WithEvents ButtonWUA As System.Windows.Forms.Button - Friend WithEvents ButtonATC As System.Windows.Forms.Button - Friend WithEvents ButtonBAT As System.Windows.Forms.Button - Friend WithEvents ButtonEKF As System.Windows.Forms.Button - Friend WithEvents ButtonSTE As System.Windows.Forms.Button - Friend WithEvents ButtonGET As System.Windows.Forms.Button - Friend WithEvents ButtonEMO As System.Windows.Forms.Button - Friend WithEvents ButtonEAN As System.Windows.Forms.Button - Friend WithEvents ButtonEXS As System.Windows.Forms.Button Friend WithEvents ButOpenVEH As System.Windows.Forms.Button - Friend WithEvents ButOpenTRS As System.Windows.Forms.Button Friend WithEvents ButOpenGBX As System.Windows.Forms.Button Friend WithEvents ButOpenENG As System.Windows.Forms.Button - Friend WithEvents ButOpenMAA As System.Windows.Forms.Button - Friend WithEvents ButOpenATC As System.Windows.Forms.Button - Friend WithEvents ButOpenCDW As System.Windows.Forms.Button - Friend WithEvents ButOpenWUC As System.Windows.Forms.Button - Friend WithEvents ButOpenWUA As System.Windows.Forms.Button - Friend WithEvents ButOpenMAC As System.Windows.Forms.Button Friend WithEvents ToolStripStatusLabelGEN As System.Windows.Forms.ToolStripStatusLabel - Friend WithEvents ButOpenBAT As System.Windows.Forms.Button - Friend WithEvents ButOpenEKF As System.Windows.Forms.Button - Friend WithEvents ButOpenSTE As System.Windows.Forms.Button - Friend WithEvents ButOpenGET As System.Windows.Forms.Button - Friend WithEvents ButOpenEAN As System.Windows.Forms.Button - Friend WithEvents ButOpenEMO As System.Windows.Forms.Button - Friend WithEvents ButOpenEXS As System.Windows.Forms.Button Friend WithEvents ButOK As System.Windows.Forms.Button - Friend WithEvents TextBoxEXS As System.Windows.Forms.TextBox - Friend WithEvents TextBoxTRS As System.Windows.Forms.TextBox Friend WithEvents TbGBX As System.Windows.Forms.TextBox Friend WithEvents TbENG As System.Windows.Forms.TextBox Friend WithEvents TextBoxVEH As System.Windows.Forms.TextBox - Friend WithEvents TextBoxEKF As System.Windows.Forms.TextBox - Friend WithEvents TextBoxSTE As System.Windows.Forms.TextBox - Friend WithEvents TextBoxGET As System.Windows.Forms.TextBox - Friend WithEvents TextBoxEAN As System.Windows.Forms.TextBox - Friend WithEvents TextBoxEMO As System.Windows.Forms.TextBox - Friend WithEvents TextBoxBAT As System.Windows.Forms.TextBox - Friend WithEvents TextBoxATC As System.Windows.Forms.TextBox - Friend WithEvents TextBoxCDW As System.Windows.Forms.TextBox - Friend WithEvents TextBoxWUC As System.Windows.Forms.TextBox - Friend WithEvents TextBoxWUA As System.Windows.Forms.TextBox - Friend WithEvents TextBoxMAC As System.Windows.Forms.TextBox - Friend WithEvents TextBoxMAA As System.Windows.Forms.TextBox - Friend WithEvents TabPgKF As System.Windows.Forms.TabPage - Friend WithEvents CbSOCnIter As System.Windows.Forms.CheckBox - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents TbSOCstart As System.Windows.Forms.TextBox Friend WithEvents ButCancel As System.Windows.Forms.Button - Friend WithEvents CbTransLossModel As System.Windows.Forms.ComboBox - Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents ChInsertDrag As System.Windows.Forms.CheckBox - Friend WithEvents ChCutDrag As System.Windows.Forms.CheckBox - Friend WithEvents ChCutFull As System.Windows.Forms.CheckBox - Friend WithEvents Label12 As System.Windows.Forms.Label - Friend WithEvents CbDragIntp As System.Windows.Forms.ComboBox - Friend WithEvents ChCreateMap As System.Windows.Forms.CheckBox - Friend WithEvents ChEngAnalysis As System.Windows.Forms.CheckBox - Friend WithEvents CbVehMode As System.Windows.Forms.ComboBox - Friend WithEvents ChbDesMax As System.Windows.Forms.CheckBox Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip Friend WithEvents ToolStripBtNew As System.Windows.Forms.ToolStripButton Friend WithEvents ToolStripBtOpen As System.Windows.Forms.ToolStripButton @@ -2227,8 +996,6 @@ Partial Class F_GEN Friend WithEvents ToolStripBtSaveAs As System.Windows.Forms.ToolStripButton Friend WithEvents ToolStripBtSendTo As System.Windows.Forms.ToolStripButton Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents TabPgTEST As System.Windows.Forms.TabPage - Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents GrAux As System.Windows.Forms.GroupBox Friend WithEvents LvAux As System.Windows.Forms.ListView Friend WithEvents ColumnHeader4 As System.Windows.Forms.ColumnHeader @@ -2248,21 +1015,6 @@ Partial Class F_GEN Friend WithEvents BtDRIadd As System.Windows.Forms.Button Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents GrGearShift As System.Windows.Forms.GroupBox - Friend WithEvents TBpfast As System.Windows.Forms.TextBox - Friend WithEvents TBpspar As System.Windows.Forms.TextBox - Friend WithEvents Label19 As System.Windows.Forms.Label - Friend WithEvents Label18 As System.Windows.Forms.Label - Friend WithEvents Label44 As System.Windows.Forms.Label - Friend WithEvents Label43 As System.Windows.Forms.Label - Friend WithEvents Label42 As System.Windows.Forms.Label - Friend WithEvents Label17 As System.Windows.Forms.Label - Friend WithEvents TBlhinunter As System.Windows.Forms.TextBox - Friend WithEvents TBlhinauf As System.Windows.Forms.TextBox - Friend WithEvents TBhinunter As System.Windows.Forms.TextBox - Friend WithEvents Label16 As System.Windows.Forms.Label - Friend WithEvents Label15 As System.Windows.Forms.Label - Friend WithEvents TBhinauf As System.Windows.Forms.TextBox Friend WithEvents CbEngOnly As System.Windows.Forms.CheckBox Friend WithEvents BtAccOpen As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label diff --git a/VECTO/GUI/F_GEN.vb b/VECTO/GUI/F_GEN.vb index e3d1a9098e..59533ca5b3 100644 --- a/VECTO/GUI/F_GEN.vb +++ b/VECTO/GUI/F_GEN.vb @@ -4,27 +4,11 @@ Public Class F_GEN Private Genfile As String Private Changed As Boolean = False - Private DRIext As String - Private pgColdSt As TabPage - Private pgHEV As TabPage - Private pgMapCr As TabPage - Private pgTest As TabPage Private pgDriver As TabPage - Private pgColdStON As Boolean = True - Private pgHevON As Boolean = True - Private pgMapCrON As Boolean = True - Private pgStStopON As Boolean = True - Private pgTestON As Boolean = True Private pgDriverON As Boolean = True - Private MyVehMode As tVehMode - - 'Cache Coolant System Simulation - Private CoolantsimJa As Boolean = False - Private CoolantSimPath As String = "" - Private AuxDlog As F_VEH_AuxDlog 'Initialize form (Load Drives, Combo-lists, ...) @@ -33,14 +17,8 @@ Public Class F_GEN AuxDlog = New F_VEH_AuxDlog - pgColdSt = Me.TabPgColdSt - pgHEV = Me.TabPgHEV - pgMapCr = Me.TabPgKF - pgTest = Me.TabPgTEST pgDriver = Me.TabPgDriver - MyVehMode = tVehMode.StandardMode - 'Damit Combobox-Inhalte aktuell sind |@@| So Combo-content is current For x = 0 To Me.TabControl1.TabCount - 1 Me.TabControl1.TabPages(x).Show() @@ -48,9 +26,6 @@ Public Class F_GEN Me.LvAux.Columns(2).Width = -2 - - HEVCheck() - Changed = False End Sub @@ -62,202 +37,9 @@ Public Class F_GEN End If End Sub - 'Shown - Private Sub F_GEN_Shown(sender As Object, e As System.EventArgs) Handles Me.Shown - - If Not DEV.Options("TestOptions").BoolVal Then Me.TabControl1.Controls.Remove(pgTest) - - End Sub - - -#Region "Schaltflächen Ein-/Ausblenden (und ggf. Change() aufrufen)" - 'Change the DynKor checkbox - Private Sub CheckBoxDynKor_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxDynKor.CheckedChanged - Me.ButOpenTRS.Enabled = Me.CheckBoxDynKor.Checked - Me.TextBoxTRS.Enabled = Me.CheckBoxDynKor.Checked - Me.ButtonTRS.Enabled = Me.CheckBoxDynKor.Checked - Call Change() - End Sub - - 'Change the Cold-start checkbox - Private Sub CheckBoxColdSt_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxColdSt.CheckedChanged - SetCStab(Me.CheckBoxColdSt.Checked) - Call Change() - End Sub - - 'Change the SCR checkbox - Private Sub CheckBoxSCR_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxSCR.CheckedChanged - Me.ButOpenEXS.Enabled = Me.CheckBoxSCR.Checked - Me.TextBoxEXS.Enabled = Me.CheckBoxSCR.Checked - Me.ButtonEXS.Enabled = Me.CheckBoxSCR.Checked - Call Change() - End Sub - - Private Sub CbVehMode_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CbVehMode.SelectedIndexChanged - - Select Case Me.CbVehMode.SelectedIndex - Case 0 - MyVehMode = tVehMode.StandardMode - Case 1 - MyVehMode = tVehMode.EngineOnly - Case 2 - MyVehMode = tVehMode.HEV - Case Else '3 - MyVehMode = tVehMode.EV - End Select - - Select Case MyVehMode - Case tVehMode.EV - If Me.ChCreateMap.Checked Then Me.ChCreateMap.Checked = False - If Me.ChEngAnalysis.Checked Then Me.ChEngAnalysis.Checked = False - Me.ChCreateMap.Enabled = False - Me.ChEngAnalysis.Enabled = False - Case tVehMode.HEV - If Me.ChCreateMap.Checked Then Me.ChCreateMap.Checked = False - Me.ChCreateMap.Enabled = False - Me.ChEngAnalysis.Enabled = True - Case Else - Me.ChCreateMap.Enabled = True - Me.ChEngAnalysis.Enabled = True - End Select - - ModeCheck() - HEVCheck() - - Change() - - End Sub - - Private Sub ModeCheck() - - Dim CMmode As Boolean - - If MyVehMode = tVehMode.EngineOnly Then - DRIext = "npi" - Else - If Me.ChEngAnalysis.Checked Or Me.ChCreateMap.Checked Then - DRIext = "mes" - Else - DRIext = "vdri" - End If - End If - - CMmode = Me.ChCreateMap.Checked - - SetMapCtab(CMmode) - Me.TabPgKF.Enabled = CMmode - - Me.ButOpenENG.Enabled = Not CMmode - Me.TbENG.Enabled = Not CMmode - Me.ButtonMAP.Enabled = Not CMmode - - If CMmode Then Me.TbENG.Text = "" - - End Sub - - Private Sub HEVCheck() - Dim HEVja As Boolean - Dim EVja As Boolean - If MyVehMode = tVehMode.HEV Then - EVja = True - HEVja = True - SetHEVtab(True) - ElseIf MyVehMode = tVehMode.EV Then - EVja = True - HEVja = False - SetHEVtab(True) - Else - EVja = False - HEVja = False - SetHEVtab(False) - End If - Me.ButOpenBAT.Enabled = EVja - Me.ButOpenEMO.Enabled = EVja - Me.ButOpenEAN.Enabled = HEVja - Me.ButOpenGET.Enabled = EVja - Me.ButOpenSTE.Enabled = HEVja - Me.ButOpenEKF.Enabled = HEVja - Me.TextBoxBAT.Enabled = EVja - Me.TextBoxEMO.Enabled = EVja - Me.TextBoxEAN.Enabled = HEVja - Me.TextBoxGET.Enabled = EVja - Me.TextBoxSTE.Enabled = HEVja - Me.TextBoxEKF.Enabled = HEVja - Me.ButtonBAT.Enabled = EVja - Me.ButtonEMO.Enabled = EVja - Me.ButtonEAN.Enabled = HEVja - Me.ButtonGET.Enabled = EVja - Me.ButtonSTE.Enabled = HEVja - Me.ButtonEKF.Enabled = HEVja - - Me.TbSOCstart.Enabled = EVja - Me.CbSOCnIter.Enabled = HEVja - - If EVja Then - Me.ChBStartStop.Checked = False - Me.CbSOCnIter.Checked = False - End If - - Me.ChBStartStop.Enabled = Not EVja - - End Sub - - - Private Sub ChEngAnalysis_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles ChEngAnalysis.CheckedChanged - ModeCheck() - Change() - End Sub - - Private Sub ChCreateMap_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles ChCreateMap.CheckedChanged - ModeCheck() - Change() - End Sub - - -#End Region #Region "Tabs" - Private Sub SetHEVtab(ByVal OnOff As Boolean) - If OnOff Then - If Not pgHevON Then - pgHevON = True - Me.TabControl1.TabPages.Insert(1, pgHEV) - End If - Else - If pgHevON Then - pgHevON = False - Me.TabControl1.Controls.Remove(pgHEV) - End If - End If - End Sub - - Private Sub SetCStab(ByVal OnOff As Boolean) - If OnOff Then - If Not pgColdStON Then - pgColdStON = True - Me.TabControl1.TabPages.Insert(1, pgColdSt) - End If - Else - If pgColdStON Then - pgColdStON = False - Me.TabControl1.Controls.Remove(pgColdSt) - End If - End If - End Sub - Private Sub SetMapCtab(ByVal OnOff As Boolean) - If OnOff Then - If Not pgMapCrON Then - pgMapCrON = True - Me.TabControl1.TabPages.Insert(1, pgMapCr) - End If - Else - If pgMapCrON Then - pgMapCrON = False - Me.TabControl1.Controls.Remove(pgMapCr) - End If - End If - End Sub Private Sub SetDrivertab(ByVal OnOff As Boolean) If OnOff Then @@ -288,53 +70,7 @@ Public Class F_GEN Private Sub ButtonFLD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGBX.Click If fbGBX.OpenDialog(fFileRepl(Me.TbGBX.Text, fPATH(Genfile))) Then Me.TbGBX.Text = fFileWoDir(fbGBX.Files(0), fPATH(Genfile)) End Sub - Private Sub ButtonTRS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTRS.Click - If fbTRS.OpenDialog(fFileRepl(Me.TextBoxTRS.Text, fPATH(Genfile))) Then Me.TextBoxTRS.Text = fFileWoDir(fbTRS.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonEXS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEXS.Click - If fbEXS.OpenDialog(fFileRepl(Me.TextBoxEXS.Text, fPATH(Genfile))) Then Me.TextBoxEXS.Text = fFileWoDir(fbEXS.Files(0), fPATH(Genfile)) - End Sub - - 'Cold Start - Private Sub ButtonMAA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonMAA.Click - If fbMAA.OpenDialog(fFileRepl(Me.TextBoxMAA.Text, fPATH(Genfile))) Then Me.TextBoxMAA.Text = fFileWoDir(fbMAA.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonMAC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonMAC.Click - If fbMAC.OpenDialog(fFileRepl(Me.TextBoxMAC.Text, fPATH(Genfile))) Then Me.TextBoxMAC.Text = fFileWoDir(fbMAC.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonWUA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonWUA.Click - If fbWUA.OpenDialog(fFileRepl(Me.TextBoxWUA.Text, fPATH(Genfile))) Then Me.TextBoxWUA.Text = fFileWoDir(fbWUA.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonWUC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonWUC.Click - If fbWUC.OpenDialog(fFileRepl(Me.TextBoxWUC.Text, fPATH(Genfile))) Then Me.TextBoxWUC.Text = fFileWoDir(fbWUC.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonCDW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCDW.Click - If fbCDW.OpenDialog(fFileRepl(Me.TextBoxCDW.Text, fPATH(Genfile))) Then Me.TextBoxCDW.Text = fFileWoDir(fbCDW.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonATC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonATC.Click - If fbATC.OpenDialog(fFileRepl(Me.TextBoxATC.Text, fPATH(Genfile))) Then Me.TextBoxATC.Text = fFileWoDir(fbATC.Files(0), fPATH(Genfile)) - End Sub - - 'HEV - Private Sub ButtonBAT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonBAT.Click - If fbBAT.OpenDialog(fFileRepl(Me.TextBoxBAT.Text, fPATH(Genfile))) Then Me.TextBoxBAT.Text = fFileWoDir(fbBAT.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonEMO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEMO.Click - If fbEMO.OpenDialog(fFileRepl(Me.TextBoxEMO.Text, fPATH(Genfile))) Then Me.TextBoxEMO.Text = fFileWoDir(fbEMO.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonEAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEAN.Click - If fbEAN.OpenDialog(fFileRepl(Me.TextBoxEAN.Text, fPATH(Genfile))) Then Me.TextBoxEAN.Text = fFileWoDir(fbEAN.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonGET_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGET.Click - If fbGET.OpenDialog(fFileRepl(Me.TextBoxGET.Text, fPATH(Genfile))) Then Me.TextBoxGET.Text = fFileWoDir(fbGET.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonSTE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSTE.Click - If fbSTE.OpenDialog(fFileRepl(Me.TextBoxSTE.Text, fPATH(Genfile))) Then Me.TextBoxSTE.Text = fFileWoDir(fbSTE.Files(0), fPATH(Genfile)) - End Sub - Private Sub ButtonEKF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEKF.Click - If fbEKF.OpenDialog(fFileRepl(Me.TextBoxEKF.Text, fPATH(Genfile))) Then Me.TextBoxEKF.Text = fFileWoDir(fbEKF.Files(0), fPATH(Genfile)) - End Sub - + 'a_DesMax Private Sub BtDesMaxBr_Click_1(sender As System.Object, e As System.EventArgs) Handles BtDesMaxBr.Click If fbACC.OpenDialog(fFileRepl(Me.TbDesMaxFile.Text, fPATH(Genfile))) Then Me.TbDesMaxFile.Text = fFileWoDir(fbACC.Files(0), fPATH(Genfile)) @@ -427,50 +163,6 @@ Public Class F_GEN End Sub - Private Sub ButOpenTRS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenTRS.Click - FileOpenAlt(fFileRepl(Me.TextBoxTRS.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenEXS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenEXS.Click - FileOpenAlt(fFileRepl(Me.TextBoxEXS.Text, fPATH(Genfile))) - End Sub - 'Cold Start - Private Sub ButOpenMAA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenMAA.Click - FileOpenAlt(fFileRepl(Me.TextBoxMAA.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenMAC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenMAC.Click - FileOpenAlt(fFileRepl(Me.TextBoxMAC.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenWUA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenWUA.Click - FileOpenAlt(fFileRepl(Me.TextBoxWUA.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenWUC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenWUC.Click - FileOpenAlt(fFileRepl(Me.TextBoxWUC.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenCDW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenCDW.Click - FileOpenAlt(fFileRepl(Me.TextBoxCDW.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenATC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenATC.Click - FileOpenAlt(fFileRepl(Me.TextBoxATC.Text, fPATH(Genfile))) - End Sub - 'HEV - Private Sub ButOpenBAT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenBAT.Click - FileOpenAlt(fFileRepl(Me.TextBoxBAT.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenEMO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenEMO.Click - FileOpenAlt(fFileRepl(Me.TextBoxEMO.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenEAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenEAN.Click - FileOpenAlt(fFileRepl(Me.TextBoxEAN.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenGET_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenGET.Click - FileOpenAlt(fFileRepl(Me.TextBoxGET.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenSTE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenSTE.Click - FileOpenAlt(fFileRepl(Me.TextBoxSTE.Text, fPATH(Genfile))) - End Sub - Private Sub ButOpenEKF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButOpenEKF.Click - FileOpenAlt(fFileRepl(Me.TextBoxEKF.Text, fPATH(Genfile))) - End Sub #End Region #Region "Menüleiste / Toolbar" @@ -560,81 +252,11 @@ Public Class F_GEN End Try 'Update Form - If Gfile.PKWja Then - Me.ComboBoxVehType.SelectedIndex = 1 - Else - Me.ComboBoxVehType.SelectedIndex = 0 - End If - Me.CheckBoxDynKor.Checked = Gfile.dynkorja - Me.ComboBoxEclass.SelectedIndex = Gfile.eklasse - Me.ComboBoxGearShift.SelectedIndex = Gfile.izykwael - If Gfile.ottoJa Then - Me.ComboBoxEngType.SelectedIndex = 0 - Else - Me.ComboBoxEngType.SelectedIndex = 1 - End If - - Select Case Gfile.VehMode - Case tVehMode.StandardMode - Me.CbVehMode.SelectedIndex = 0 - Case tVehMode.EngineOnly - Me.CbVehMode.SelectedIndex = 1 - Case tVehMode.HEV - Me.CbVehMode.SelectedIndex = 2 - Case tVehMode.EV - Me.CbVehMode.SelectedIndex = 3 - End Select - Me.ChCreateMap.Checked = Gfile.CreateMap - Me.ChEngAnalysis.Checked = Gfile.EngAnalysis - - 'Map creation ----------------- - Me.TextBoxIncPe.Text = Gfile.Pschrit - Me.TextBoxIncn.Text = Gfile.nschrit - Me.CheckBoxGS.Checked = Gfile.MapSchaltja - Me.TextBoxAvPerofModVal.Text = Gfile.iMsek - Me.ChCutFull.Checked = Gfile.KFcutFull - Me.ChCutDrag.Checked = Gfile.KFcutDrag - Me.ChInsertDrag.Checked = Gfile.KFinsertDrag - If Gfile.KFDragIntp Then - Me.CbDragIntp.SelectedIndex = 1 - Else - Me.CbDragIntp.SelectedIndex = 0 - End If - - 'Cold start -------------------------- - If Gfile.kaltst1 Then MsgBox("Cold Start is not supported in this version!") - Me.CheckBoxColdSt.Checked = False ' Gfile.kaltst1 - Me.TextBoxTKat.Text = Gfile.tkat1 - Me.TextBoxTKW.Text = Gfile.tkw1 - Me.TextBoxTofSt.Text = Gfile.hsstart 'Files ----------------------------- TextBoxVEH.Text = Gfile.PathVEH(True) TbENG.Text = Gfile.PathENG(True) - - - TbGBX.Text = Gfile.PathGBX(True) - TextBoxTRS.Text = Gfile.dynspez(True) - - 'Cold start - TextBoxMAA.Text = Gfile.katmap(True) - TextBoxMAC.Text = Gfile.kwmap(True) - TextBoxWUA.Text = Gfile.katkurv(True) - TextBoxWUC.Text = Gfile.kwkurv(True) - TextBoxCDW.Text = Gfile.cooldown(True) - TextBoxATC.Text = Gfile.tumgebung(True) - - 'HEV - TextBoxBAT.Text = Gfile.Batfile(True) - TextBoxEMO.Text = Gfile.Emospez(True) - TextBoxEAN.Text = Gfile.EANfile(True) - TextBoxGET.Text = Gfile.Getspez(True) - TextBoxSTE.Text = Gfile.STEnam(True) - TextBoxEKF.Text = Gfile.EKFnam(True) - 'EXS - Me.CheckBoxSCR.Checked = Gfile.EXSja - TextBoxEXS.Text = Gfile.PathExs(True) 'Start/Stop Me.ChBStartStop.Checked = Gfile.StartStop @@ -642,24 +264,7 @@ Public Class F_GEN Me.TBSStime.Text = Gfile.StStT Me.TbStStDelay.Text = Gfile.StStDelay - 'SOC Start/Iteration - Me.TbSOCstart.Text = Gfile.SOCstart - Me.CbSOCnIter.Checked = Gfile.SOCnJa - - 'Transm.Loss Model - Select Case Gfile.TransmModel - Case tTransLossModel.Basic - Me.CbTransLossModel.SelectedIndex = 0 - Case tTransLossModel.Detailed - Me.CbTransLossModel.SelectedIndex = 1 - End Select - - 'Coolant Sim - CoolantsimJa = Gfile.CoolantsimJa - CoolantSimPath = Gfile.CoolantSimPath(True) - - 'a_DesMax - Me.ChbDesMax.Checked = Gfile.DesMaxJa + 'VACC Me.TbDesMaxFile.Text = Gfile.DesMaxFile(True) Me.LvAux.Items.Clear() @@ -671,13 +276,6 @@ Public Class F_GEN LvAux.Items.Add(LV0) Next - Me.TBhinauf.Text = Gfile.hinauf - Me.TBhinunter.Text = Gfile.hinunter - Me.TBlhinauf.Text = Gfile.lhinauf - Me.TBlhinunter.Text = Gfile.lhinunter - Me.TBpspar.Text = Gfile.pspar - Me.TBpfast.Text = 1 - Gfile.pmodell - Gfile.pspar - For Each sb In Gfile.CycleFiles LV0 = New ListViewItem LV0.Text = sb.OriginalPath @@ -736,32 +334,6 @@ Public Class F_GEN g = New cGEN g.FilePath = file - g.PKWja = (Me.ComboBoxVehType.SelectedIndex = 1) - g.dynkorja = Me.CheckBoxDynKor.Checked - g.eklasse = Me.ComboBoxEclass.SelectedIndex - g.izykwael = Me.ComboBoxGearShift.SelectedIndex - g.ottoJa = (Me.ComboBoxEngType.SelectedIndex = 0) - g.VehMode = MyVehMode - g.CreateMap = Me.ChCreateMap.Checked - g.EngAnalysis = Me.ChEngAnalysis.Checked - - - 'Map creation ------------------------------------------------ ------ - g.Pschrit = CShort(fTextboxToNumString(Me.TextBoxIncPe.Text)) - g.nschrit = CShort(fTextboxToNumString(Me.TextBoxIncn.Text)) - g.MapSchaltja = Math.Abs(CInt(Me.CheckBoxGS.Checked)) - g.iMsek = CShort(fTextboxToNumString(Me.TextBoxAvPerofModVal.Text)) - g.KFcutFull = Me.ChCutFull.Checked - g.KFcutDrag = Me.ChCutDrag.Checked - g.KFinsertDrag = Me.ChInsertDrag.Checked - g.KFDragIntp = (Me.CbDragIntp.SelectedIndex = 1) - - 'Cold start ------------------------------------------------ --------------- - g.kaltst1 = Me.CheckBoxColdSt.Checked - g.tkat1 = CSng(fTextboxToNumString(Me.TextBoxTKat.Text)) - g.tkw1 = CSng(fTextboxToNumString(Me.TextBoxTKW.Text)) - g.hsstart = CSng(fTextboxToNumString(Me.TextBoxTofSt.Text)) - 'Files ------------------------------------------------- ----------------- g.PathVEH = Me.TextBoxVEH.Text @@ -774,27 +346,7 @@ Public Class F_GEN Next g.PathGBX = Me.TbGBX.Text - g.dynspez = Me.TextBoxTRS.Text - - 'Cold start - g.katmap = Me.TextBoxMAA.Text - g.kwmap = Me.TextBoxMAC.Text - g.katkurv = Me.TextBoxWUA.Text - g.kwkurv = Me.TextBoxWUC.Text - g.cooldown = Me.TextBoxCDW.Text - g.tumgebung = Me.TextBoxATC.Text - - 'HEV - g.Batfile = Me.TextBoxBAT.Text - g.Emospez = Me.TextBoxEMO.Text - g.EANfile = Me.TextBoxEAN.Text - g.Getspez = Me.TextBoxGET.Text - g.STEnam = Me.TextBoxSTE.Text - g.EKFnam = Me.TextBoxEKF.Text - - 'EXS - g.EXSja = Me.CheckBoxSCR.Checked - g.PathExs = Me.TextBoxEXS.Text + 'Start/Stop g.StartStop = Me.ChBStartStop.Checked @@ -802,24 +354,7 @@ Public Class F_GEN g.StStT = CSng(fTextboxToNumString(Me.TBSStime.Text)) g.StStDelay = CInt(fTextboxToNumString(Me.TbStStDelay.Text)) - 'SOC - g.SOCnJa = Me.CbSOCnIter.Checked - g.SOCstart = CSng(fTextboxToNumString(Me.TbSOCstart.Text)) - - 'Transm.Loss Model - Select Case Me.CbTransLossModel.SelectedIndex - Case 0 - g.TransmModel = tTransLossModel.Basic - Case 1 - g.TransmModel = tTransLossModel.Detailed - End Select - - 'Coolant Sim - g.CoolantsimJa = CoolantsimJa - g.CoolantSimPath = CoolantSimPath - 'a_DesMax - g.DesMaxJa = Me.ChbDesMax.Checked g.DesMaxFile = Me.TbDesMaxFile.Text For Each LV0 In LvAux.Items @@ -829,13 +364,6 @@ Public Class F_GEN g.AuxPaths.Add(LV0.SubItems(0).Text, AuxEntry) Next - g.hinauf = CSng(fTextboxToNumString(Me.TBhinauf.Text)) - g.hinunter = CSng(fTextboxToNumString(Me.TBhinunter.Text)) - g.lhinauf = CSng(fTextboxToNumString(Me.TBlhinauf.Text)) - g.lhinunter = CSng(fTextboxToNumString(Me.TBlhinunter.Text)) - g.pspar = CSng(fTextboxToNumString(Me.TBpspar.Text)) - g.pmodell = CSng(1 - CSng(fTextboxToNumString(Me.TBpfast.Text)) - CSng(fTextboxToNumString(Me.TBpspar.Text))) - g.EngOnly = Me.CbEngOnly.Checked g.EcoRollOn = RdEcoRoll.Checked @@ -877,86 +405,20 @@ Public Class F_GEN If ChangeCheckCancel() Then Exit Sub - 'General----------------------------- - Me.ComboBoxVehType.SelectedIndex = 0 - Me.CheckBoxDynKor.Checked = False - Me.ComboBoxEclass.SelectedIndex = 6 - Me.ComboBoxGearShift.SelectedIndex = 2 - Me.ComboBoxEngType.SelectedIndex = 1 - Me.CbVehMode.SelectedIndex = 0 - Me.ChEngAnalysis.Checked = False - Me.ChCreateMap.Checked = False - - 'Map creation ----------------- - Me.TextBoxIncPe.Text = 20 - Me.TextBoxIncn.Text = 20 - Me.CheckBoxGS.Checked = True - Me.TextBoxAvPerofModVal.Text = 3 - Me.ChCutFull.Checked = True - Me.ChCutDrag.Checked = True - Me.ChInsertDrag.Checked = True - Me.CbDragIntp.SelectedIndex = 1 - - 'Cold start -------------------------- - Me.CheckBoxColdSt.Checked = False - Me.TextBoxTKat.Text = 20 - Me.TextBoxTKW.Text = 20 - Me.TextBoxTofSt.Text = 1 - - 'Files ----------------------------- - 'Cold start - - 'HEV - Me.TbSOCstart.Text = "0.5" - Me.CbSOCnIter.Checked = True - - 'SCR - Me.CheckBoxSCR.Checked = False - + 'Files Me.TextBoxVEH.Text = "" Me.TbENG.Text = "" Me.LvCycles.Items.Clear() Me.TbGBX.Text = "" - Me.TextBoxTRS.Text = "" - Me.TextBoxMAA.Text = "" - Me.TextBoxMAC.Text = "" - Me.TextBoxWUA.Text = "" - Me.TextBoxWUC.Text = "" - Me.TextBoxCDW.Text = "" - Me.TextBoxATC.Text = "" - Me.TextBoxBAT.Text = "" - Me.TextBoxEMO.Text = "" - Me.TextBoxEAN.Text = "" - Me.TextBoxGET.Text = "" - Me.TextBoxSTE.Text = "" - Me.TextBoxEKF.Text = "" - Me.TextBoxEXS.Text = "" + Me.TbDesMaxFile.Text = "" 'Start/Stop Me.TBSSspeed.Text = "5" Me.TBSStime.Text = "5" Me.ChBStartStop.Checked = False - 'Transm.Loss Model - Me.CbTransLossModel.SelectedIndex = 1 - - 'Coolant Sim - CoolantsimJa = False - CoolantSimPath = "" - - 'a_Desmax - Me.ChbDesMax.Checked = True - Me.TbDesMaxFile.Text = "" - Me.LvAux.Items.Clear() - Me.TBlhinauf.Text = "0.45" - Me.TBlhinunter.Text = "0.40" - Me.TBhinauf.Text = "0.73" - Me.TBhinunter.Text = "0.51" - Me.TBpspar.Text = "1" - Me.TBpfast.Text = "0" - Me.CbEngOnly.Checked = False Me.RdOff.Checked = True @@ -983,18 +445,7 @@ Public Class F_GEN #Region "Event Handler für Formänderungen" 'Event handler for the form changes - Private Sub FormChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _ - ComboBoxVehType.SelectedIndexChanged, _ - ComboBoxGearShift.SelectedIndexChanged, _ - ComboBoxEclass.SelectedIndexChanged, _ - TextBoxTKat.TextChanged, _ - TextBoxTKW.TextChanged, _ - TextBoxTofSt.TextChanged, _ - TextBoxIncPe.TextChanged, _ - TextBoxIncn.TextChanged, _ - CheckBoxGS.CheckedChanged, _ - TextBoxAvPerofModVal.TextChanged, _ - ComboBoxEngType.SelectedIndexChanged + Private Sub FormChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Call Change() End Sub @@ -1010,102 +461,13 @@ Public Class F_GEN Private Sub TextBoxFLD_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbGBX.TextChanged Change() End Sub - Private Sub TextBoxTRS_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxTRS.TextChanged - Change() - End Sub - Private Sub TextBoxEXS_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEXS.TextChanged - Change() - End Sub - Private Sub TextBoxMAA_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxMAA.TextChanged - Change() - End Sub - Private Sub TextBoxMAC_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxMAC.TextChanged - Change() - End Sub - Private Sub TextBoxWUA_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxWUA.TextChanged - Change() - End Sub - Private Sub TextBoxWUC_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxWUC.TextChanged - Change() - End Sub - Private Sub TextBoxCDW_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxCDW.TextChanged - Change() - End Sub - Private Sub TextBoxATC_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxATC.TextChanged - Change() - End Sub - Private Sub TextBoxBAT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxBAT.TextChanged - Change() - End Sub - Private Sub TextBoxEMO_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEMO.TextChanged - Change() - End Sub - Private Sub TextBoxEAN_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEAN.TextChanged - Change() - End Sub - Private Sub TextBoxGET_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxGET.TextChanged - Change() - End Sub - Private Sub TextBoxSTE_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxSTE.TextChanged - Change() - End Sub - Private Sub TextBoxEKF_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEKF.TextChanged - Change() - End Sub - Private Sub CbSOCnIter_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbSOCnIter.CheckedChanged - Change() - End Sub - Private Sub TbSOCstart_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbSOCstart.TextChanged - Change() - End Sub - - Private Sub CbTransLossModel_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbTransLossModel.SelectedIndexChanged - Change() - End Sub - - Private Sub ChCutFull_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles ChCutFull.CheckedChanged, ChCutDrag.CheckedChanged, ChInsertDrag.CheckedChanged - Change() - End Sub - - Private Sub CbDragIntp_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CbDragIntp.SelectedIndexChanged - Change() - End Sub - - Private Sub ChbDesMax_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles ChbDesMax.CheckedChanged - Change() - Me.TbDesMaxFile.Enabled = Me.ChbDesMax.Checked - Me.BtDesMaxBr.Enabled = Me.ChbDesMax.Checked - End Sub + Private Sub TbDesMaxFile_TextChanged_1(sender As System.Object, e As System.EventArgs) Handles TbDesMaxFile.TextChanged Change() End Sub - Private Sub TBhinauf_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - - Private Sub TBlhinauf_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - - Private Sub TBhinunter_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - - Private Sub TBlhinunter_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - - Private Sub TBpfast_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - - Private Sub TBpspar_TextChanged(sender As System.Object, e As System.EventArgs) - Change() - End Sub - Private Sub TBSSspeed_TextChanged(sender As System.Object, e As System.EventArgs) Handles TBSSspeed.TextChanged Change() End Sub diff --git a/VECTO/GUI/F_MAINForm.Designer.vb b/VECTO/GUI/F_MAINForm.Designer.vb index 47a7e48592..e184d45705 100644 --- a/VECTO/GUI/F_MAINForm.Designer.vb +++ b/VECTO/GUI/F_MAINForm.Designer.vb @@ -53,9 +53,6 @@ Partial Class F_MAINForm Me.ButtonDRIremove = New System.Windows.Forms.Button() Me.ButtonDRIadd = New System.Windows.Forms.Button() Me.TabPgOptions = New System.Windows.Forms.TabPage() - Me.GrbxTest = New System.Windows.Forms.GroupBox() - Me.ChBoxFCkor = New System.Windows.Forms.CheckBox() - Me.ChBoxFinalEm = New System.Windows.Forms.CheckBox() Me.GrBoxADV = New System.Windows.Forms.GroupBox() Me.ChBoxFzpSort = New System.Windows.Forms.CheckBox() Me.ChBoxFzpExport = New System.Windows.Forms.CheckBox() @@ -89,7 +86,6 @@ Partial Class F_MAINForm Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator() Me.RemovePathsToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem() Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() - Me.ComMsgTimer = New System.Windows.Forms.Timer(Me.components) Me.LvMsg = New System.Windows.Forms.ListView() Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) Me.ColumnHeader2 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) @@ -131,7 +127,6 @@ Partial Class F_MAINForm CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabPageDRI.SuspendLayout() Me.TabPgOptions.SuspendLayout() - Me.GrbxTest.SuspendLayout() Me.GrBoxADV.SuspendLayout() Me.GrBoxBATCH.SuspendLayout() Me.PanelOptAllg.SuspendLayout() @@ -455,7 +450,6 @@ Partial Class F_MAINForm ' 'TabPgOptions ' - Me.TabPgOptions.Controls.Add(Me.GrbxTest) Me.TabPgOptions.Controls.Add(Me.GrBoxADV) Me.TabPgOptions.Controls.Add(Me.GrBoxSTD) Me.TabPgOptions.Controls.Add(Me.GrBoxBATCH) @@ -469,39 +463,6 @@ Partial Class F_MAINForm Me.TabPgOptions.Text = "Options" Me.TabPgOptions.UseVisualStyleBackColor = True ' - 'GrbxTest - ' - Me.GrbxTest.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.GrbxTest.Controls.Add(Me.ChBoxFCkor) - Me.GrbxTest.Controls.Add(Me.ChBoxFinalEm) - Me.GrbxTest.Location = New System.Drawing.Point(575, 67) - Me.GrbxTest.Name = "GrbxTest" - Me.GrbxTest.Size = New System.Drawing.Size(537, 109) - Me.GrbxTest.TabIndex = 15 - Me.GrbxTest.TabStop = False - Me.GrbxTest.Text = "Hidden Options" - ' - 'ChBoxFCkor - ' - Me.ChBoxFCkor.AutoSize = True - Me.ChBoxFCkor.Location = New System.Drawing.Point(6, 19) - Me.ChBoxFCkor.Name = "ChBoxFCkor" - Me.ChBoxFCkor.Size = New System.Drawing.Size(116, 17) - Me.ChBoxFCkor.TabIndex = 5 - Me.ChBoxFCkor.Text = "HDV FC Correction" - Me.ChBoxFCkor.UseVisualStyleBackColor = True - ' - 'ChBoxFinalEm - ' - Me.ChBoxFinalEm.AutoSize = True - Me.ChBoxFinalEm.Location = New System.Drawing.Point(6, 42) - Me.ChBoxFinalEm.Name = "ChBoxFinalEm" - Me.ChBoxFinalEm.Size = New System.Drawing.Size(133, 17) - Me.ChBoxFinalEm.TabIndex = 0 - Me.ChBoxFinalEm.Text = "Tailpipe emissions only" - Me.ChBoxFinalEm.UseVisualStyleBackColor = True - ' 'GrBoxADV ' Me.GrBoxADV.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ @@ -790,9 +751,6 @@ Partial Class F_MAINForm 'BackgroundWorker1 ' ' - 'ComMsgTimer - ' - ' 'LvMsg ' Me.LvMsg.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ @@ -1063,8 +1021,6 @@ Partial Class F_MAINForm Me.TabPageDRI.PerformLayout() Me.TabPgOptions.ResumeLayout(False) Me.TabPgOptions.PerformLayout() - Me.GrbxTest.ResumeLayout(False) - Me.GrbxTest.PerformLayout() Me.GrBoxADV.ResumeLayout(False) Me.GrBoxADV.PerformLayout() Me.GrBoxBATCH.ResumeLayout(False) @@ -1106,7 +1062,6 @@ Partial Class F_MAINForm Friend WithEvents ClearListToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker Friend WithEvents ToolStripProgBarOverall As System.Windows.Forms.ToolStripProgressBar - Friend WithEvents ComMsgTimer As System.Windows.Forms.Timer Friend WithEvents LvGEN As System.Windows.Forms.ListView Friend WithEvents ColGENpath As System.Windows.Forms.ColumnHeader Friend WithEvents ColGENstatus As System.Windows.Forms.ColumnHeader @@ -1130,8 +1085,6 @@ Partial Class F_MAINForm Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents ButBObrowse As System.Windows.Forms.Button Friend WithEvents ChBoxBatchSubD As System.Windows.Forms.CheckBox - Friend WithEvents ChBoxFinalEm As System.Windows.Forms.CheckBox - Friend WithEvents ChBoxFCkor As System.Windows.Forms.CheckBox Friend WithEvents LvMsg As System.Windows.Forms.ListView Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader Friend WithEvents SplitContainer1 As System.Windows.Forms.SplitContainer @@ -1168,7 +1121,6 @@ Partial Class F_MAINForm Friend WithEvents ToolStripProgBarJob As System.Windows.Forms.ToolStripProgressBar Friend WithEvents TmProgSec As System.Windows.Forms.Timer Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox - Friend WithEvents GrbxTest As System.Windows.Forms.GroupBox Friend WithEvents EngineEditorToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Friend WithEvents GearboxEditorToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem Friend WithEvents UserManualToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem diff --git a/VECTO/GUI/F_MAINForm.resx b/VECTO/GUI/F_MAINForm.resx index 6e9b1673e4..9d5467eac9 100644 --- a/VECTO/GUI/F_MAINForm.resx +++ b/VECTO/GUI/F_MAINForm.resx @@ -208,9 +208,6 @@ <metadata name="BackgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>357, 12</value> </metadata> - <metadata name="ComMsgTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>518, 13</value> - </metadata> <metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>654, 13</value> </metadata> diff --git a/VECTO/GUI/F_MAINForm.vb b/VECTO/GUI/F_MAINForm.vb index 30cf588e46..517ebe4ad8 100644 --- a/VECTO/GUI/F_MAINForm.vb +++ b/VECTO/GUI/F_MAINForm.vb @@ -419,12 +419,6 @@ Public Class F_MAINForm Result = e.Result - 'Falls Optimierer aktiv werden hier die Zielfunktion ausgegeben und Signal an Interface |@@| If Optimizers(Optimierer ) are active here, then dump the Objective-function(Zielfunktion ) and Signal to interface - If bOptOn Then - If Result = tCalcResult.Err Or Result = tCalcResult.Abort Then OptERstat = True - OptEND() - End If - 'ShutDown when Unexpected Error If e.Error IsNot Nothing Then MsgBox("An Unexpected Error occurred!" & ChrW(10) & ChrW(10) & _ @@ -543,8 +537,6 @@ Public Class F_MAINForm LoadDEVconfigs() End If - Me.GrbxTest.Visible = False - End Sub 'Shown Event (Form-Load finished) ... here StartUp Forms are loaded (DEV, GEN/ADV- Editor ..) @@ -1769,18 +1761,6 @@ lbFound: End Select End Sub - '*** ComMsgTimer_Tick Tick - Check whether new Message - Private Sub ComMsgTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComMsgTimer.Tick - If OptMsgTxt <> "" Then - If OptMsgTxt = "START" Then - OptSTART() - Else - GUImsg(tMsgID.Normal, "PHEM_Launcher: " & OptMsgTxt) - End If - OptMsgTxt = "" - End If - End Sub - #Region "Sekundäre Progressbar (ToolStripProgBarSec) ...auch Update von ToolStripProgBarPrim möglich" @@ -1836,7 +1816,6 @@ lbFound: Me.ChBoxUseGears.Checked = Cfg.GnVorgab Me.ChBoxModOut.Checked = Cfg.ModOut Me.ChBoxFzpExport.Checked = Cfg.FZPsortExp - Me.ChBoxFinalEm.Checked = Cfg.FinalEmOnly CbBOmode.SelectedIndex = -1 Select Case UCase(Cfg.BATCHoutpath) Case sKey.WorkDir @@ -1848,7 +1827,6 @@ lbFound: Me.TbBOpath.Text = Cfg.BATCHoutpath End Select Me.ChBoxBatchSubD.Checked = Cfg.BATCHoutSubD - Me.ChBoxFCkor.Checked = Cfg.FCcorrection 'Set Mode LastModeIndex = Cfg.LastMode @@ -1870,7 +1848,6 @@ lbFound: 'General(Allgemein) Cfg.WegKorJa = Me.ChBoxCyclDistCor.Checked Cfg.GnVorgab = Me.ChBoxUseGears.Checked - Cfg.FinalEmOnly = Me.ChBoxFinalEm.Checked 'ADVANCE Cfg.FZPsortExp = Me.ChBoxFzpExport.Checked @@ -1888,7 +1865,6 @@ lbFound: If Microsoft.VisualBasic.Right(Cfg.BATCHoutpath, 1) <> "\" Then Cfg.BATCHoutpath &= "\" End Select Cfg.BATCHoutSubD = Me.ChBoxBatchSubD.Checked - Cfg.FCcorrection = Me.ChBoxFCkor.Checked DEV.SetOptions() diff --git a/VECTO/GUI/F_Options.Designer.vb b/VECTO/GUI/F_Options.Designer.vb index 33e6f0f24e..4bbe18a3dd 100644 --- a/VECTO/GUI/F_Options.Designer.vb +++ b/VECTO/GUI/F_Options.Designer.vb @@ -28,6 +28,7 @@ Partial Class F_Options Me.ButtonOK = New System.Windows.Forms.Button() Me.ButtonCancel = New System.Windows.Forms.Button() Me.GroupBox3 = New System.Windows.Forms.GroupBox() + Me.CbJSON = New System.Windows.Forms.CheckBox() Me.GroupBox5 = New System.Windows.Forms.GroupBox() Me.TbOpenCmdName = New System.Windows.Forms.TextBox() Me.Label7 = New System.Windows.Forms.Label() @@ -47,31 +48,14 @@ Partial Class F_Options Me.Label8 = New System.Windows.Forms.Label() Me.TbAirDensity = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() - Me.TabPgTest = New System.Windows.Forms.TabPage() - Me.Label6 = New System.Windows.Forms.Label() - Me.TbnnormEngStop = New System.Windows.Forms.TextBox() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.GroupBox1 = New System.Windows.Forms.GroupBox() - Me.ButtonTD = New System.Windows.Forms.Button() - Me.ButTDdefault = New System.Windows.Forms.Button() - Me.TextBoxTD = New System.Windows.Forms.TextBox() - Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.Label1 = New System.Windows.Forms.Label() - Me.LabelEAVal = New System.Windows.Forms.Label() - Me.TextBoxEAVal = New System.Windows.Forms.TextBox() Me.ButReset = New System.Windows.Forms.Button() Me.BtHelp = New System.Windows.Forms.Button() - Me.CbJSON = New System.Windows.Forms.CheckBox() Me.GroupBoxWorDir.SuspendLayout() Me.GroupBox3.SuspendLayout() Me.GroupBox5.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabPage2.SuspendLayout() Me.GroupBox4.SuspendLayout() - Me.TabPgTest.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.GroupBox2.SuspendLayout() Me.SuspendLayout() ' 'TextBoxWorDir @@ -136,6 +120,16 @@ Partial Class F_Options Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "Interface" ' + 'CbJSON + ' + Me.CbJSON.AutoSize = True + Me.CbJSON.Location = New System.Drawing.Point(21, 80) + Me.CbJSON.Name = "CbJSON" + Me.CbJSON.Size = New System.Drawing.Size(168, 17) + Me.CbJSON.TabIndex = 15 + Me.CbJSON.Text = "In- and Output in JSON format" + Me.CbJSON.UseVisualStyleBackColor = True + ' 'GroupBox5 ' Me.GroupBox5.Controls.Add(Me.TbOpenCmdName) @@ -203,7 +197,6 @@ Partial Class F_Options Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.TabControl1.Controls.Add(Me.TabPage2) - Me.TabControl1.Controls.Add(Me.TabPgTest) Me.TabControl1.Location = New System.Drawing.Point(3, 3) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 @@ -316,130 +309,6 @@ Partial Class F_Options Me.Label2.TabIndex = 14 Me.Label2.Text = "Air Density" ' - 'TabPgTest - ' - Me.TabPgTest.Controls.Add(Me.Label6) - Me.TabPgTest.Controls.Add(Me.TbnnormEngStop) - Me.TabPgTest.Controls.Add(Me.Label5) - Me.TabPgTest.Controls.Add(Me.Label4) - Me.TabPgTest.Controls.Add(Me.GroupBox1) - Me.TabPgTest.Controls.Add(Me.GroupBox2) - Me.TabPgTest.Location = New System.Drawing.Point(4, 22) - Me.TabPgTest.Name = "TabPgTest" - Me.TabPgTest.Padding = New System.Windows.Forms.Padding(3) - Me.TabPgTest.Size = New System.Drawing.Size(500, 302) - Me.TabPgTest.TabIndex = 2 - Me.TabPgTest.Text = "TEST" - Me.TabPgTest.UseVisualStyleBackColor = True - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(11, 160) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(169, 13) - Me.Label6.TabIndex = 22 - Me.Label6.Text = "(ICE Start/Stop must be activated)" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) - ' - 'TbnnormEngStop - ' - Me.TbnnormEngStop.Location = New System.Drawing.Point(217, 138) - Me.TbnnormEngStop.Name = "TbnnormEngStop" - Me.TbnnormEngStop.Size = New System.Drawing.Size(54, 20) - Me.TbnnormEngStop.TabIndex = 21 - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(277, 141) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(16, 13) - Me.Label5.TabIndex = 17 - Me.Label5.Text = "[-]" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(11, 141) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(200, 13) - Me.Label4.TabIndex = 20 - Me.Label4.Text = "Engine stop when input n_norm is below " - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.ButtonTD) - Me.GroupBox1.Controls.Add(Me.ButTDdefault) - Me.GroupBox1.Controls.Add(Me.TextBoxTD) - Me.GroupBox1.Location = New System.Drawing.Point(5, 16) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(490, 53) - Me.GroupBox1.TabIndex = 18 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Temperature-Table for TEM creation" - ' - 'ButtonTD - ' - Me.ButtonTD.Location = New System.Drawing.Point(456, 19) - Me.ButtonTD.Name = "ButtonTD" - Me.ButtonTD.Size = New System.Drawing.Size(26, 20) - Me.ButtonTD.TabIndex = 2 - Me.ButtonTD.Text = "..." - Me.ButtonTD.UseVisualStyleBackColor = True - ' - 'ButTDdefault - ' - Me.ButTDdefault.Location = New System.Drawing.Point(9, 19) - Me.ButTDdefault.Name = "ButTDdefault" - Me.ButTDdefault.Size = New System.Drawing.Size(99, 20) - Me.ButTDdefault.TabIndex = 8 - Me.ButTDdefault.Text = "Set To Default" - Me.ButTDdefault.UseVisualStyleBackColor = True - ' - 'TextBoxTD - ' - Me.TextBoxTD.Location = New System.Drawing.Point(119, 19) - Me.TextBoxTD.Name = "TextBoxTD" - Me.TextBoxTD.Size = New System.Drawing.Size(331, 20) - Me.TextBoxTD.TabIndex = 6 - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.Label1) - Me.GroupBox2.Controls.Add(Me.LabelEAVal) - Me.GroupBox2.Controls.Add(Me.TextBoxEAVal) - Me.GroupBox2.Location = New System.Drawing.Point(6, 75) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(184, 50) - Me.GroupBox2.TabIndex = 19 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Engine Analysis" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(6, 23) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(93, 13) - Me.Label1.TabIndex = 14 - Me.Label1.Text = "Averaging Range:" - ' - 'LabelEAVal - ' - Me.LabelEAVal.AutoSize = True - Me.LabelEAVal.Location = New System.Drawing.Point(155, 22) - Me.LabelEAVal.Name = "LabelEAVal" - Me.LabelEAVal.Size = New System.Drawing.Size(18, 13) - Me.LabelEAVal.TabIndex = 3 - Me.LabelEAVal.Text = "[s]" - ' - 'TextBoxEAVal - ' - Me.TextBoxEAVal.Location = New System.Drawing.Point(105, 19) - Me.TextBoxEAVal.Name = "TextBoxEAVal" - Me.TextBoxEAVal.Size = New System.Drawing.Size(44, 20) - Me.TextBoxEAVal.TabIndex = 2 - ' 'ButReset ' Me.ButReset.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -460,16 +329,6 @@ Partial Class F_Options Me.BtHelp.TabIndex = 14 Me.BtHelp.UseVisualStyleBackColor = True ' - 'CbJSON - ' - Me.CbJSON.AutoSize = True - Me.CbJSON.Location = New System.Drawing.Point(21, 80) - Me.CbJSON.Name = "CbJSON" - Me.CbJSON.Size = New System.Drawing.Size(168, 17) - Me.CbJSON.TabIndex = 15 - Me.CbJSON.Text = "In- and Output in JSON format" - Me.CbJSON.UseVisualStyleBackColor = True - ' 'F_Options ' Me.AcceptButton = Me.ButtonOK @@ -497,12 +356,6 @@ Partial Class F_Options Me.TabPage2.ResumeLayout(False) Me.GroupBox4.ResumeLayout(False) Me.GroupBox4.PerformLayout() - Me.TabPgTest.ResumeLayout(False) - Me.TabPgTest.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() Me.ResumeLayout(False) End Sub @@ -523,19 +376,6 @@ Partial Class F_Options Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents TbAirDensity As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents TabPgTest As System.Windows.Forms.TabPage - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents TbnnormEngStop As System.Windows.Forms.TextBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents ButtonTD As System.Windows.Forms.Button - Friend WithEvents ButTDdefault As System.Windows.Forms.Button - Friend WithEvents TextBoxTD As System.Windows.Forms.TextBox - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents LabelEAVal As System.Windows.Forms.Label - Friend WithEvents TextBoxEAVal As System.Windows.Forms.TextBox Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents TbFuelDens As System.Windows.Forms.TextBox Friend WithEvents Label8 As System.Windows.Forms.Label diff --git a/VECTO/GUI/F_Options.vb b/VECTO/GUI/F_Options.vb index aad47855d8..f09129de32 100644 --- a/VECTO/GUI/F_Options.vb +++ b/VECTO/GUI/F_Options.vb @@ -7,19 +7,12 @@ LoadConfig() End Sub - Private Sub F_Options_Shown(sender As Object, e As System.EventArgs) Handles Me.Shown - If Not DEV.Options("TestOptions").BoolVal Then Me.TabControl1.Controls.Remove(TabPgTest) - End Sub - 'Load Config Private Sub LoadConfig() Me.TextBoxWorDir.Text = Cfg.WorkDPath WD = Cfg.WorkDPath - Me.TextBoxTD.Text = Cfg.TEMpath - Me.TextBoxEAVal.Text = Cfg.EAAvInt Me.TextBoxLogSize.Text = Cfg.LogSize Me.TbAirDensity.Text = CStr(Cfg.AirDensity) - Me.TbnnormEngStop.Text = CStr(Cfg.nnormEngStop) Me.TbOpenCmd.Text = Cfg.OpenCmd Me.TbOpenCmdName.Text = Cfg.OpenCmdName Me.TbFuelDens.Text = Cfg.FuelDens.ToString @@ -39,11 +32,8 @@ 'OK Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOK.Click Cfg.SetWorkDir(Me.TextBoxWorDir.Text) - Cfg.TEMpath = Me.TextBoxTD.Text - Cfg.EAAvInt = CShort(Me.TextBoxEAVal.Text) Cfg.LogSize = CSng(Me.TextBoxLogSize.Text) Cfg.AirDensity = CSng(Me.TbAirDensity.Text) - Cfg.nnormEngStop = CSng(Me.TbnnormEngStop.Text) Cfg.OpenCmd = Me.TbOpenCmd.Text Cfg.OpenCmdName = Me.TbOpenCmdName.Text Cfg.FuelDens = CSng(Me.TbFuelDens.Text) @@ -69,22 +59,6 @@ End If End Sub - Private Sub ButtonTD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) - Dim p0 As String - If UCase(Trim(Cfg.TEMpath)) = "<DEFAULT>" Then - p0 = "" - Else - p0 = Cfg.TEMpath - End If - If fbTEM.OpenDialog(p0, False, "csv") Then - Me.TextBoxTD.Text = fbTEM.Files(0) - End If - End Sub - - Private Sub ButTDdefault_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) - Me.TextBoxTD.Text = "<default>" - End Sub - Private Sub BtHelp_Click(sender As System.Object, e As System.EventArgs) Handles BtHelp.Click If IO.File.Exists(MyAppPath & "User Manual\GUI\settings.html") Then System.Diagnostics.Process.Start(MyAppPath & "User Manual\GUI\settings.html") diff --git a/VECTO/GUI/F_VEH.vb b/VECTO/GUI/F_VEH.vb index 6c8bfce766..ec26ff4c62 100644 --- a/VECTO/GUI/F_VEH.vb +++ b/VECTO/GUI/F_VEH.vb @@ -110,8 +110,6 @@ Public Class F_VEH 'New VEH Private Sub newVEH() - Dim i As Integer - Dim lvi As ListViewItem If ChangeCheckCancel() Then Exit Sub diff --git a/VECTO/Input Files/cDRI.vb b/VECTO/Input Files/cDRI.vb index d45ac55aa9..810c77f854 100644 --- a/VECTO/Input Files/cDRI.vb +++ b/VECTO/Input Files/cDRI.vb @@ -19,10 +19,6 @@ Public Class cDRI Public Gvorg As Boolean Public GradVorg As Boolean - Public PeNormed As Boolean - Public nNormed As Boolean - Public PaddNormed As Boolean - Private bEmCompDef As Boolean Public EmComponents As Dictionary(Of String, cEmComp) Public EmDefRef As Dictionary(Of tMapComp, cEmComp) @@ -59,9 +55,6 @@ Public Class cDRI Nvorg = False Gvorg = False Pvorg = False - PeNormed = False - nNormed = False - PaddNormed = False tDim = -1 t0 = 1 'Ist Standardwert falls Converter nicht verwendet wird EmComponents.Clear() @@ -136,7 +129,7 @@ Public Class cDRI DRIcheck.Add(tDriComp.t, False) DRIcheck.Add(tDriComp.V, False) DRIcheck.Add(tDriComp.Grad, False) - DRIcheck.Add(tDriComp.nn, False) + DRIcheck.Add(tDriComp.nU, False) DRIcheck.Add(tDriComp.Gears, False) DRIcheck.Add(tDriComp.Padd, False) DRIcheck.Add(tDriComp.Pe, False) @@ -316,7 +309,7 @@ Public Class cDRI Vvorg = DRIcheck(tDriComp.V) Svorg = DRIcheck(tDriComp.s) Gvorg = DRIcheck(tDriComp.Gears) - Nvorg = DRIcheck(tDriComp.nn) + Nvorg = DRIcheck(tDriComp.nU) Pvorg = DRIcheck(tDriComp.Pe) PaddVorg = DRIcheck(tDriComp.Padd) GradVorg = DRIcheck(tDriComp.Grad) @@ -332,22 +325,6 @@ Public Class cDRI '*** Third row: Units/Normalization 'VECTO: nothing read. Fixed Units (line = file.ReadLine) - 'Normalization-compatible DRI-components - If DRIcheck(tDriComp.Pe) Then - 'PeNormed = (UCase(Trim(line(Spalten(tDriComp.Pe)))) = sKey.Normed) - PeNormed = False - End If - - If DRIcheck(tDriComp.nn) Then - 'nNormed = (UCase(Trim(line(Spalten(tDriComp.nn)))) = sKey.Normed) - nNormed = False - End If - - If DRIcheck(tDriComp.Padd) Then - 'PaddNormed = (UCase(Trim(line(Spalten(tDriComp.Padd)))) = sKey.Normed) - PaddNormed = False - End If - 'VECTO MAP-components: Always [g/h]! For Each Em0 In EmComponents.Values @@ -478,7 +455,7 @@ Public Class cDRI Values.Add(tDriComp.Pe, New List(Of Double)) Pvorg = True For s = 0 To tDim - Values(tDriComp.Pe).Add(nMtoPe(Values(tDriComp.nn)(s), Values(tDriComp.Torque)(s))) + Values(tDriComp.Pe).Add(nMtoPe(Values(tDriComp.nU)(s), Values(tDriComp.Torque)(s))) Next End If @@ -491,111 +468,6 @@ lbEr: End Function - Private Function ReadOldFormat() As Boolean - - Dim File As cFile_V3 - Dim line As String() - Dim s1 As Integer - Dim t As Integer - Dim GNok As Boolean - Dim STGok As Boolean - Dim GNmax As Single - Dim GNlist As List(Of Double) - Dim MsgSrc As String - - MsgSrc = "Main/ReadInp/DRI" - - 'Open file - File = New cFile_V3 - If Not File.OpenRead(sFilePath, ",", True, True) Then - File = Nothing - Return False - End If - - Values = New Dictionary(Of tDriComp, List(Of Double)) - GNlist = New List(Of Double) - - Do While Not File.EndOfFile - tDim += 1 'wird in ResetMe zurück gesetzt - line = File.ReadLine - - If tDim = 0 Then - - s1 = UBound(line) - - GNok = (s1 > 2) - PaddVorg = (s1 > 3) - - If s1 > 1 Then - STGok = True - GradVorg = True - Values.Add(tDriComp.Grad, New List(Of Double)) - Else - If s1 < 1 Then - 'TODO... - Return False - End If - STGok = False - End If - - Tvorg = True - Values.Add(tDriComp.t, New List(Of Double)) - - Vvorg = True - Values.Add(tDriComp.V, New List(Of Double)) - - If PaddVorg Then - PaddNormed = True - Values.Add(tDriComp.Padd, New List(Of Double)) - End If - - End If - - Try - Values(tDriComp.t).Add(CDbl(line(0))) - Values(tDriComp.V).Add(CDbl(line(1))) - If STGok Then Values(tDriComp.Grad).Add(CDbl(line(2))) - 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, sFilePath) - Return False - End Try - - - Loop - - File.Close() - - 'ResetMe resets Nvorg / Gvorg - - If GNok Then - - GNmax = GNlist(0) - For t = 1 To tDim - If GNlist(t) > GNmax Then GNmax = GNlist(t) - Next - - If GNmax > 50 Then - Nvorg = True - nNormed = False - Values.Add(tDriComp.nn, GNlist) - - ElseIf GNmax > 0 Then - Gvorg = True - Values.Add(tDriComp.Gears, GNlist) - - End If - - End If - - File = Nothing - GNlist = Nothing - - Return True - - End Function - Public Function ExsCompDef() As Boolean Return bExsCompDef End Function @@ -620,7 +492,6 @@ lbEr: Public Sub DeNorm() Dim s As Integer - Dim L As List(Of Double) 'Convert Speed to m/s If Vvorg Then @@ -630,37 +501,6 @@ lbEr: Next End If - 'Normalize, if necessary - If Nvorg Then - If Not nNormed Then - L = Values(tDriComp.nn) - For s = 0 To tDim - L(s) = (L(s) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - Next - End If - End If - - 'Padd unnormalised, if neccesary - If PaddVorg Then - If PaddNormed Then - L = Values(tDriComp.Padd) - For s = 0 To tDim - L(s) = L(s) * VEH.Pnenn - Next - End If - End If - - 'Pe normalize, if necessary - If Pvorg Then - If Not PeNormed Then - L = Values(tDriComp.Pe) - For s = 0 To tDim - L(s) = L(s) / VEH.Pnenn - Next - End If - End If - - L = Nothing '!!!!!!!! Emissions are only accepted in x/h or x (see ReadFile)!!!!!!!! @@ -773,11 +613,6 @@ lbEr: MsgSrc = "Main/DRI/ConvStoT" - If Not GEN.DesMaxJa Then - WorkerMsg(tMsgID.Err, "No a(v) data defined!", MsgSrc) - Return False - End If - If Not Values.ContainsKey(tDriComp.StopTime) Then WorkerMsg(tMsgID.Err, "Stop time not defined in cycle (" & sKey.DRI.StopTime & ")!", MsgSrc) Return False diff --git a/VECTO/Input Files/cEMO.vb b/VECTO/Input Files/cEMO.vb deleted file mode 100644 index be6636f6e3..0000000000 --- a/VECTO/Input Files/cEMO.vb +++ /dev/null @@ -1,171 +0,0 @@ -Imports System.Collections.Generic - -Public Class cEMO - - Private sFilePath As String - - Public Pnenn As Single - Public I_mot As Single - - Private lnU As List(Of Single) - Private lAntr As List(Of Single) - Private lGen As List(Of Single) - Private fldDIM As Integer - - Private EtaKF As cCustomMap - - 'TODO... - Private ULok As Boolean = False - Private ULfactor As Single = 1.1 - - Public Sub CleanUp() - lnU = Nothing - lAntr = Nothing - lGen = Nothing - EtaKF = Nothing - End Sub - - Public Function ReadFile() As Boolean - Dim file As cFile_V3 - Dim line As String() - Dim FLDdone As Boolean - - lnU = New List(Of Single) - lAntr = New List(Of Single) - lGen = New List(Of Single) - fldDIM = -1 - - EtaKF = New cCustomMap - - 'Abort if there's no file - If sFilePath = "" Then Return False - If Not IO.File.Exists(sFilePath) Then Return False - - 'Open file - file = New cFile_V3 - If Not file.OpenRead(sFilePath) Then - file = Nothing - Return False - End If - - 'Map-Config - EtaKF.Init() - - 'Read FLD and MAP - FLDdone = False - Do While Not file.EndOfFile - line = file.ReadLine - - If FLDdone Then - EtaKF.Add(line) - Else - If Trim(UCase(line(0))) = sKey.HEV.EtaMap Then - FLDdone = True - Else - lnU.Add(line(0)) - lAntr.Add(line(1)) - lGen.Add(line(2)) - fldDIM += 1 - End If - End If - - Loop - - file.Close() - - 'Normalize Map - EtaKF.Norm() - - Return True - - End Function - - 'Returns the maximum available Drivetrain-power for given Revolutions - Public Function PeMax(ByVal nU As Single) As Single - Dim i As Int32 - - 'Extrapolation for x < x(1) - If lnU(0) >= nU Then - If lnU(0) > nU Then MODdata.ModErrors.FLDextrapol = "EMO: nU= " & nU - i = 1 - GoTo lbInt - End If - - i = 0 - Do While lnU(i) < nU And i < fldDIM - i += 1 - Loop - - 'Extrapolation for x > x(imax) - If lnU(i) < nU Then - MODdata.ModErrors.FLDextrapol = "EMO: nU= " & nU - End If - -lbInt: - 'Interpolation - If ULok Then - Return ULfactor * ((nU - lnU(i - 1)) * (lAntr(i) - lAntr(i - 1)) / (lnU(i) - lnU(i - 1)) + lAntr(i - 1)) - Else - Return (nU - lnU(i - 1)) * (lAntr(i) - lAntr(i - 1)) / (lnU(i) - lnU(i - 1)) + lAntr(i - 1) - End If - - End Function - - 'Returns the maximum available Generator-power for the given Revolutions - Public Function PeMin(ByVal nU As Single) As Single - Dim i As Int32 - - 'Extrapolation for x < x(1) - If lnU(0) >= nU Then - If lnU(0) > nU Then MODdata.ModErrors.FLDextrapol = "EMO: nU= " & nU - i = 1 - GoTo lbInt - End If - - i = 0 - Do While lnU(i) < nU And i < fldDIM - i += 1 - Loop - - 'Extrapolation for x > x(imax) - If lnU(i) < nU Then - MODdata.ModErrors.FLDextrapol = "EMO: nU= " & nU - End If - -lbInt: - 'Interpolation - If ULok Then - Return ULfactor * ((nU - lnU(i - 1)) * (lGen(i) - lGen(i - 1)) / (lnU(i) - lnU(i - 1)) + lGen(i - 1)) - Else - Return (nU - lnU(i - 1)) * (lGen(i) - lGen(i - 1)) / (lnU(i) - lnU(i - 1)) + lGen(i - 1) - End If - - End Function - - Public Function PiEM(ByVal nU As Single, ByVal PeEM As Single) As Single - Dim Eta As Single - - If PeEM = 0 Then Return 0 - - Eta = EtaKF.Intp(nU, PeEM) - - If PeEM > 0 Then - Return PeEM / Eta - Else - Return PeEM * Eta - End If - - End Function - - - Public Property FilePath() As String - Get - Return sFilePath - End Get - Set(ByVal value As String) - sFilePath = value - End Set - End Property - - -End Class diff --git a/VECTO/Input Files/cENG.vb b/VECTO/Input Files/cENG.vb index 3a82ebe98a..ed0e81c05e 100644 --- a/VECTO/Input Files/cENG.vb +++ b/VECTO/Input Files/cENG.vb @@ -6,9 +6,7 @@ Public Class cENG Private FileVersion As String Public ModelName As String - Public Pnenn As Single Public Displ As Single - Public nnenn As Single Public nleerl As Single Public I_mot As Single @@ -54,9 +52,7 @@ Public Class cENG Private Sub SetDefault() ModelName = "Undefined" - Pnenn = 0 Displ = 0 - nnenn = 0 nleerl = 0 I_mot = 0 @@ -85,12 +81,12 @@ Public Class cENG file.WriteLine("c Make & Model") file.WriteLine(ModelName.Replace(",", "\c\")) - file.WriteLine("c Rated power [kW]") - file.WriteLine(Pnenn.ToString) + file.WriteLine("c NOT USED") + file.WriteLine("0") file.WriteLine("c Displacement [ccm]") file.WriteLine(Displ.ToString) - file.WriteLine("c Rated speed [rpm]") - file.WriteLine(nnenn.ToString) + file.WriteLine("c NOT USED") + file.WriteLine("0") file.WriteLine("c Idling speed [rpm]") file.WriteLine(nleerl.ToString) file.WriteLine("c Inertia [kgm2]") @@ -141,9 +137,9 @@ Public Class cENG Try ModelName = file.ReadLine(0).Replace("\c\", ",") - Pnenn = CSng(file.ReadLine(0)) + file.ReadLine() 'NOT USED (Pnenn) Displ = CSng(file.ReadLine(0)) - nnenn = CSng(file.ReadLine(0)) + file.ReadLine() 'NOT USED (nnenn) nleerl = CSng(file.ReadLine(0)) I_mot = CSng(file.ReadLine(0)) @@ -208,8 +204,6 @@ Public Class cENG dic.Add("ModelName", ModelName) dic.Add("Displacement", Displ) - dic.Add("RatedPower", Pnenn) - dic.Add("RatedSpeed", nnenn) dic.Add("IdlingSpeed", nleerl) dic.Add("Inertia", I_mot) @@ -268,9 +262,7 @@ Public Class cENG ModelName = JSON.Content("Body")("ModelName") - Pnenn = JSON.Content("Body")("RatedPower") Displ = JSON.Content("Body")("Displacement") - nnenn = JSON.Content("Body")("RatedSpeed") nleerl = JSON.Content("Body")("IdlingSpeed") I_mot = JSON.Content("Body")("Inertia") diff --git a/VECTO/Input Files/cFLD.vb b/VECTO/Input Files/cFLD.vb index 39ed145df3..10abcfbc22 100644 --- a/VECTO/Input Files/cFLD.vb +++ b/VECTO/Input Files/cFLD.vb @@ -9,55 +9,32 @@ Public Class cFLD Private LPfull As List(Of Single) Private LPdrag As List(Of Single) - Private Lnn As List(Of Single) + Private LnU As List(Of Single) Private LPT1 As List(Of Single) Private LPtarget As List(Of Single) - Private PtargetDef As Boolean = False - Private PtargetNormed As Boolean - Private PfullNormed As Boolean - Private PdragNormed As Boolean - Private nNormed As Boolean Private iDim As Integer - Private bEmDef As Boolean - Private EmDragD As Dictionary(Of String, List(Of Single)) - Private EmDragNormed As Dictionary(Of String, Boolean) - Private Sub ResetMe() LPfull = Nothing LPdrag = Nothing - Lnn = Nothing + LnU = Nothing LPT1 = Nothing iDim = -1 - PfullNormed = False - PdragNormed = False - PtargetDef = False - PtargetNormed = False - bEmDef = False - EmDragD = Nothing - EmDragNormed = Nothing End Sub Public Function ReadFile() As Boolean Dim file As cFile_V3 Dim line As String() - 'Dim txt As String Dim s1 As Integer - 'Dim s As Integer - 'Dim ID As tFldComp - Dim sTarget As Integer Dim sPT1 As Integer Dim PT1 As Single - Dim sEmDrag As Dictionary(Of String, Integer) - Dim EmKV As KeyValuePair(Of String, Integer) Dim nU As Double Dim MsgSrc As String MsgSrc = "Main/ReadInp/FLD" - sTarget = -1 sPT1 = -1 PT1 = 0 '=> Defaultwert falls nicht in FLD vorgegeben @@ -81,181 +58,13 @@ Public Class cFLD 'Initialize Lists LPfull = New System.Collections.Generic.List(Of Single) LPdrag = New System.Collections.Generic.List(Of Single) - Lnn = New System.Collections.Generic.List(Of Single) + LnU = New System.Collections.Generic.List(Of Single) LPT1 = New System.Collections.Generic.List(Of Single) - EmDragD = New Dictionary(Of String, List(Of Single)) - EmDragNormed = New Dictionary(Of String, Boolean) - sEmDrag = New Dictionary(Of String, Integer) - - ''*** - ''*** First line: Version - 'line = file.ReadLine - 'txt = Trim(UCase(line(0))) - 'If Microsoft.VisualBasic.Left(txt, 1) = "V" Then - ' ' "V" entfernen => Zahl bleibt übrig - ' txt = txt.Replace("V", "") - ' If Not IsNumeric(txt) Then - ' 'If invalid version: Abort - ' WorkerMsg(tMsgID.Err, "File Version invalid!", MsgSrc) - ' GoTo lbEr - ' Else - ' 'Set Version - ' FileVersion = CInt(txt) - ' End If - - 'Else - ' 'If no version information: Old format - ' file.Close() - ' Return ReadOldFormat() - 'End If - - ''Version Check: Abort if input file format is newer than PHEM-version - 'If FileVersion > FormatVersion Then - ' WorkerMsg(tMsgID.Err, "File Version not supported!", MsgSrc) - ' GoTo lbEr - 'End If - - - - '*** - '*** Second Line: Name/Identification of components (Drag-Emissions create-KF) - 'line = file.ReadLine - - ''Column count check, - 's1 = UBound(line) - - ''Abort if less than 3 columns - 'If s1 < 3 Then - ' WorkerMsg(tMsgID.Err, "Format invalid!", MsgSrc) - ' GoTo lbEr - 'End If - - 'If s1 > 3 Then - ' For s = 4 To s1 - - ' txt = Trim(UCase(line(s))) - ' ID = fFldComp(txt) - - ' Select Case ID - ' Case tFldComp.PeTarget - - ' sTarget = s - ' PtargetDef = True - - ' 'Case tFldComp.PT1 - - ' ' sPT1 = s - - ' Case Else 'tFldComp.Undefined - - ' bEmDef = True - - ' If EmDragD.ContainsKey(txt) Then - ' WorkerMsg(tMsgID.Err, "Em-Component '" & txt & "' already defined!", MsgSrc) - ' GoTo lbEr - ' Else - ' EmDragD.Add(txt, New List(Of Single)) - ' EmDragNormed.Add(txt, False) - ' sEmDrag.Add(txt, s) - ' End If - - ' End Select - - ' Next - 'End If 'VECTO: No Header/Unit column. Always PT1! s1 = 3 sPT1 = 3 - bEmDef = False - - '*** - '*** Third Line: Normalized/Measured - 'line = file.ReadLine - - ''Abort when fewer Columns than in the second Line - 'If UBound(line) < s1 Then - ' WorkerMsg(tMsgID.Err, "Format invalid!", MsgSrc) - ' GoTo lbEr - 'End If - - 'nNormed = (Trim(UCase(line(0))) = sKey.Normed) - nNormed = False - - 'If Not nNormed Then - ' Select Case Trim(UCase(line(0))) - ' Case "[U/MIN]", "RPM", "[1/MIN]", "[MIN^-1]" - ' 'Everything is okay - ' Case Else - ' WorkerMsg(tMsgID.Err, "Engine Speed Unit '" & line(0) & "' unknown! '[U/min]' expected.", MsgSrc) - ' End Select - 'Else - ' WorkerMsg(tMsgID.Err, "Engine Speed Unit '" & line(0) & "' unknown! '[U/min]' expected.", MsgSrc) - 'End If - - 'PfullNormed = (Trim(UCase(line(1))) = sKey.Normed) - PfullNormed = False - - 'If Not PfullNormed Then - ' If Trim(UCase(line(1))) <> "[NM]" Then - ' WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(1) & "' unknown! '[Nm]' expected.", MsgSrc) - ' End If - 'Else - ' WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(1) & "' unknown! '[Nm]' expected.", MsgSrc) - 'End If - - 'PdragNormed = (Trim(UCase(line(2))) = sKey.Normed) - PdragNormed = False - - 'If Not PdragNormed Then - ' If Trim(UCase(line(1))) <> "[NM]" Then - ' WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(2) & "' unknown! '[Nm]' expected.", MsgSrc) - ' End If - 'Else - ' WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(2) & "' unknown! '[Nm]' expected.", MsgSrc) - 'End If - - 'If PtargetDef Then - ' LPtarget = New System.Collections.Generic.List(Of Single) - ' PtargetNormed = (Trim(UCase(line(sTarget))) = sKey.Normed) - - ' If Not PtargetNormed Then - ' If Trim(UCase(line(1))) <> "[KW]" Then - ' WorkerMsg(tMsgID.Err, "Engine Power Unit '" & line(sTarget) & "' unknown! '[kW]' or '" & sKey.Normed & "' expected.", MsgSrc) - ' End If - ' End If - - 'End If - - ''Additional Components - 'If bEmDef Then - ' For Each EmKV In sEmDrag - - ' txt = line(EmKV.Value) - - ' 'Remove brackets - ' txt = txt.Replace("[", "") - ' txt = txt.Replace("]", "") - - ' 'Set Scaling and Unit - ' If txt.Contains("/") Then - ' Select Case UCase(Right(txt, txt.Length - txt.IndexOf("/") - 1)) - ' Case "H" - ' EmDragNormed(EmKV.Key) = False - ' Case "KWH" - ' WorkerMsg(tMsgID.Err, "Unit '" & line(EmKV.Value) & "' is not supported in this file!", MsgSrc) - ' GoTo lbEr - ' Case "H" & sKey.Normed - ' EmDragNormed(EmKV.Key) = True - ' End Select - ' Else - ' EmDragNormed(EmKV.Key) = False - ' End If - - ' Next - 'End If - 'From Line 4: Values Try @@ -268,10 +77,9 @@ Public Class cFLD 'VECTO: M => Pe nU = CDbl(line(0)) - Lnn.Add(nU) + LnU.Add(nU) LPfull.Add(nMtoPe(nU, CDbl(line(1)))) LPdrag.Add(nMtoPe(nU, CDbl(line(2)))) - If PtargetDef Then LPtarget.Add(CSng(line(sTarget))) 'If PT1 not given, use default value (see above) If sPT1 > -1 Then @@ -287,12 +95,6 @@ Public Class cFLD LPT1.Add(PT1) - If bEmDef Then - For Each EmKV In sEmDrag - EmDragD(EmKV.Key).Add(line(sEmDrag(EmKV.Key))) - Next - End If - 'Line-counter up (was reset in ResetMe) iDim += 1 @@ -321,234 +123,107 @@ lbEr: End Function - Private Function ReadOldFormat() As Boolean - Dim File As cFile_V3 - Dim line As String() - - 'Open file - File = New cFile_V3 - If Not File.OpenRead(sFilePath, ",", True, True) Then - File = Nothing - Return False - End If - - nNormed = True - PfullNormed = True - PdragNormed = True - - Do While Not File.EndOfFile - line = File.ReadLine - - Lnn.Add(CSng(line(0))) - LPfull.Add(CSng(line(1))) - LPdrag.Add(CSng(line(2))) - - LPT1.Add(0) - - 'Line counter up (was reset in ResetMe) - iDim += 1 - - Loop - - 'Close file - File.Close() - - Return True - - End Function - - Public Sub Norm() - Dim i As Integer - Dim Pnenn As Single - Dim nleerl As Single - Dim nnenn As Single - Dim EmKV As KeyValuePair(Of String, Boolean) - - Pnenn = VEH.Pnenn - nleerl = VEH.nLeerl - nnenn = VEH.nNenn - - 'Normalized Revolutions - If Not nNormed Then - For i = 0 To iDim - Lnn(i) = (Lnn(i) - nleerl) / (nnenn - nleerl) - Next - End If - - 'Normalized Power - If Not PfullNormed Then - For i = 0 To iDim - LPfull(i) /= Pnenn - Next - End If - - 'Normalized Power - If Not PdragNormed Then - For i = 0 To iDim - LPdrag(i) /= Pnenn - Next - End If - - 'Normalized Pe-Target - If PtargetDef AndAlso Not PtargetNormed Then - For i = 0 To iDim - LPtarget(i) /= Pnenn - Next - End If - - 'Em ent-normalize - If bEmDef Then - For Each EmKV In EmDragNormed - If EmKV.Value Then - For i = 0 To iDim - EmDragD(EmKV.Key)(i) *= Pnenn - Next - End If - Next - End If - - End Sub - - Public Function Pdrag(ByVal nnorm As Single) As Single + Public Function Pdrag(ByVal nU As Single) As Single Dim i As Int32 'Extrapolation for x < x(1) - If Lnn(0) >= nnorm Then - If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(0) >= nU Then + If LnU(0) > nU Then MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" i = 1 GoTo lbInt End If i = 0 - Do While Lnn(i) < nnorm And i < iDim + Do While LnU(i) < nU And i < iDim i += 1 Loop 'Extrapolation for x > x(imax) - If Lnn(i) < nnorm Then - MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(i) < nU Then + MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" End If lbInt: 'Interpolation - Return VEH.Pnenn * ((nnorm - Lnn(i - 1)) * (LPdrag(i) - LPdrag(i - 1)) / (Lnn(i) - Lnn(i - 1)) + LPdrag(i - 1)) + Return (nU - LnU(i - 1)) * (LPdrag(i) - LPdrag(i - 1)) / (LnU(i) - LnU(i - 1)) + LPdrag(i - 1) End Function - Public Function Pfull(ByVal nnorm As Single, ByVal LastPenorm As Single) As Single + Public Function Pfull(ByVal nU As Single, ByVal LastPe As Single) As Single Dim i As Int32 Dim PfullStat As Single Dim PT1 As Single 'Extrapolation for x < x(1) - If Lnn(0) >= nnorm Then - If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(0) >= nU Then + If LnU(0) > nU Then MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" i = 1 GoTo lbInt End If i = 0 - Do While Lnn(i) < nnorm And i < iDim + Do While LnU(i) < nU And i < iDim i += 1 Loop 'Extrapolation for x > x(imax) - If Lnn(i) < nnorm Then - MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(i) < nU Then + MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" End If lbInt: 'Interpolation - PfullStat = (nnorm - Lnn(i - 1)) * (LPfull(i) - LPfull(i - 1)) / (Lnn(i) - Lnn(i - 1)) + LPfull(i - 1) - PT1 = (nnorm - Lnn(i - 1)) * (LPT1(i) - LPT1(i - 1)) / (Lnn(i) - Lnn(i - 1)) + LPT1(i - 1) + PfullStat = (nU - LnU(i - 1)) * (LPfull(i) - LPfull(i - 1)) / (LnU(i) - LnU(i - 1)) + LPfull(i - 1) + PT1 = (nU - LnU(i - 1)) * (LPT1(i) - LPT1(i - 1)) / (LnU(i) - LnU(i - 1)) + LPT1(i - 1) 'Dynamic Full-load - Return Math.Min(VEH.Pnenn * (1 / (PT1 + 1)) * (PfullStat + PT1 * LastPenorm), PfullStat * VEH.Pnenn) + Return Math.Min((1 / (PT1 + 1)) * (PfullStat + PT1 * LastPe), PfullStat) End Function - - Public Function Pfull(ByVal nnorm As Single) As Single + Public Function Pfull(ByVal nU As Single) As Single Dim i As Int32 'Extrapolation for x < x(1) - If Lnn(0) >= nnorm Then - If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(0) >= nU Then + If LnU(0) > nU Then MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" i = 1 GoTo lbInt End If i = 0 - Do While Lnn(i) < nnorm And i < iDim + Do While LnU(i) < nU And i < iDim i += 1 Loop 'Extrapolation for x > x(imax) - If Lnn(i) < nnorm Then - MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" + If LnU(i) < nU Then + MODdata.ModErrors.FLDextrapol = "n= " & nU & " [1/min]" End If lbInt: 'Interpolation - Return VEH.Pnenn * ((nnorm - Lnn(i - 1)) * (LPfull(i) - LPfull(i - 1)) / (Lnn(i) - Lnn(i - 1)) + LPfull(i - 1)) + Return (nU - LnU(i - 1)) * (LPfull(i) - LPfull(i - 1)) / (LnU(i) - LnU(i - 1)) + LPfull(i - 1) End Function - Public Function Ptarget(ByVal nnorm As Single) As Single - Dim i As Int32 - - 'Extrapolation for x < x(1) - If Lnn(0) >= nnorm Then - If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" - i = 1 - GoTo lbInt - End If - - i = 0 - Do While Lnn(i) < nnorm And i < iDim - i += 1 - Loop - - 'Extrapolation for x > x(imax) - If Lnn(i) < nnorm Then - MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" - End If - -lbInt: - 'Interpolation - Return VEH.Pnenn * ((nnorm - Lnn(i - 1)) * (LPtarget(i) - LPtarget(i - 1)) / (Lnn(i) - Lnn(i - 1)) + LPtarget(i - 1)) - End Function - - Public Function EmDrag(ByVal EmComp As String, ByVal nnorm As Single) As Single - Dim i As Int32 - Dim EmL As List(Of Single) - - If Not EmDragD.ContainsKey(EmComp) Then Return -1 - - EmL = EmDragD(EmComp) - - 'Extrapolation for x <x(1) - If Lnn(0) >= nnorm Then - If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" - i = 1 - GoTo lbInt - End If - - i = 0 - Do While Lnn(i) < nnorm And i < iDim - i += 1 - Loop + Public Function nRated() As Single + Dim i As Int16 + Dim PeMax As Single + Dim nU As Single + + PeMax = LPfull(0) + nU = LnU(0) + For i = 1 To iDim + If LPfull(i) >= PeMax Then + PeMax = LPfull(i) + nU = LnU(i) + End If + Next - 'Extrapolation for x > x(imax) - If Lnn(i) < nnorm Then - MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]" - End If + Return nU -lbInt: - 'Interpolation - Return ((nnorm - Lnn(i - 1)) * (EmL(i) - EmL(i - 1)) / (Lnn(i) - Lnn(i - 1)) + EmL(i - 1)) End Function - Public Property FilePath() As String Get Return sFilePath @@ -558,14 +233,5 @@ lbInt: End Set End Property - Public ReadOnly Property EmDef(ByVal EmComp As String) As Boolean - Get - If Not bEmDef Then - Return False - Else - Return EmDragD.ContainsKey(EmComp) - End If - End Get - End Property End Class diff --git a/VECTO/Input Files/cGBX.vb b/VECTO/Input Files/cGBX.vb index 92e9c6b4db..d6e56e05bd 100644 --- a/VECTO/Input Files/cGBX.vb +++ b/VECTO/Input Files/cGBX.vb @@ -21,8 +21,8 @@ Public Class cGBX 'Gear shift polygons Private gs_file As New cSubPath Private gs_M As New List(Of Single) - Private gs_nnUp As New List(Of Single) - Private gs_nnDown As New List(Of Single) + Private gs_nUup As New List(Of Single) + Private gs_nUdown As New List(Of Single) Private gs_Dim As Integer Public gs_TorqueResv As Single Public gs_SkipGears As Boolean @@ -103,8 +103,8 @@ Public Class cGBX iganganz = 0 gs_M.Clear() - gs_nnDown.Clear() - gs_nnUp.Clear() + gs_nUdown.Clear() + gs_nUup.Clear() gs_file.Clear() gs_Dim = -1 gs_TorqueResv = 0 @@ -565,8 +565,8 @@ Public Class cGBX Min = Mout / mu 'Up/Downshift rpms - nUup = GBX.fGSnnUup(Min) - nUdown = GBX.fGSnnUdown(Min) + nUup = GBX.fGSnUup(Min) + nUdown = GBX.fGSnUdown(Min) 'If nUin > 1.05 * nUup - 0.0001 Then If nUin > VEH.nNenn - 0.0001 Then @@ -707,7 +707,6 @@ lbInt: Public Function GSinit() As Boolean Dim file As cFile_V3 Dim line As String() - Dim i As Integer Dim gserror As Boolean Dim MsgSrc As String @@ -773,8 +772,8 @@ lbInt: 'Clear lists gs_M.Clear() - gs_nnDown.Clear() - gs_nnUp.Clear() + gs_nUdown.Clear() + gs_nUup.Clear() gs_Dim = -1 'Read file @@ -783,8 +782,8 @@ lbInt: line = file.ReadLine gs_Dim += 1 gs_M.Add(CSng(line(0))) - gs_nnDown.Add(CSng(line(1))) - gs_nnUp.Add(CSng(line(2))) + gs_nUdown.Add(CSng(line(1))) + gs_nUup.Add(CSng(line(2))) Loop Catch ex As Exception WorkerMsg(tMsgID.Err, "Error while reading Gear Shift Polygon File! (" & ex.Message & ")", MsgSrc) @@ -797,17 +796,11 @@ lbInt: Return False End If - 'Normalize rpm - For i = 0 To gs_Dim - gs_nnDown(i) = (gs_nnDown(i) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - gs_nnUp(i) = (gs_nnUp(i) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - Next - Return True End Function - Public Function fGSnnDown(ByVal Md As Single) As Single + Public Function fGSnUdown(ByVal Md As Single) As Single Dim i As Int32 'Extrapolation for x < x(1) @@ -829,19 +822,11 @@ lbInt: lbInt: 'Interpolation - Return (Md - gs_M(i - 1)) * (gs_nnDown(i) - gs_nnDown(i - 1)) / (gs_M(i) - gs_M(i - 1)) + gs_nnDown(i - 1) - - End Function - - Public Function fGSnnUup(ByVal Md As Single) As Single - Return fGSnnUp(Md) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl - End Function + Return (Md - gs_M(i - 1)) * (gs_nUdown(i) - gs_nUdown(i - 1)) / (gs_M(i) - gs_M(i - 1)) + gs_nUdown(i - 1) - Public Function fGSnnUdown(ByVal Md As Single) As Single - Return fGSnnDown(Md) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl End Function - Public Function fGSnnUp(ByVal Md As Single) As Single + Public Function fGSnUup(ByVal Md As Single) As Single Dim i As Int32 'Extrapolation for x < x(1) @@ -863,7 +848,7 @@ lbInt: lbInt: 'Interpolation - Return (Md - gs_M(i - 1)) * (gs_nnUp(i) - gs_nnUp(i - 1)) / (gs_M(i) - gs_M(i - 1)) + gs_nnUp(i - 1) + Return (Md - gs_M(i - 1)) * (gs_nUup(i) - gs_nUup(i - 1)) / (gs_M(i) - gs_M(i - 1)) + gs_nUup(i - 1) End Function diff --git a/VECTO/Input Files/cGEN.vb b/VECTO/Input Files/cGEN.vb index 76a7eabde4..fbbe9181d3 100644 --- a/VECTO/Input Files/cGEN.vb +++ b/VECTO/Input Files/cGEN.vb @@ -9,65 +9,16 @@ Public Class cGEN Private MyPath As String - 'Mode - Public VehMode As tVehMode - Public EngAnalysis As Boolean - Public CreateMap As Boolean - Public ModeHorEV As Boolean - - Private boPKWja As Boolean - Private bodynkorja As Boolean - Private ineklasse As Int16 - Private inizykwael As Int16 - Private inPschrit As Int16 - Private innschrit As Int16 - Private boMapSchaltja As Boolean - Private iniMsek As Int16 - Private boottoJa As Boolean - Private bokaltst1 As Boolean - Private sitkat1 As Single - Private sitkw1 As Single - Private sihsstart As Single - + 'Input parameters Private stPathVEH As cSubPath Private stPathENG As cSubPath Private stPathGBX As cSubPath - Private stdynspez As cSubPath - - Private stkatmap As cSubPath - Private stkwmap As cSubPath - Private stkatkurv As cSubPath - Private stkwkurv As cSubPath - Private stcooldown As cSubPath - Private sttumgebung As cSubPath - - Private stBatfile As cSubPath - Private stEmospez As cSubPath - Private stEANfile As cSubPath - Private stGetspez As cSubPath - Private stSTEnam As cSubPath - Private stEKFnam As cSubPath - Private stPathExs As cSubPath - - Private boEXSja As Boolean Private boStartStop As Boolean Private siStStV As Single Private siStStT As Single Public StStDelay As Integer - Private boSOCnJa As Boolean - Private siSOCstart As Single - Private GetrMod As tTransLossModel - - Private bKFcutFull As Boolean - Private bKFcutDrag As Boolean - Private bKFinsertDrag As Boolean - Private bKFDragIntp As Boolean - Public CoolantsimJa As Boolean - Private stCoolantSimPath As cSubPath - - Public DesMaxJa As Boolean Private stDesMaxFile As cSubPath Private laDesV As List(Of Single) Private laDesMax As List(Of Single) @@ -77,13 +28,6 @@ Public Class cGEN Public AuxPaths As Dictionary(Of String, cVEH.cAuxEntry) Public AuxDef As Boolean 'True wenn ein oder mehrere Nebenverbraucher definiert sind - Public hinauf As Single - Public hinunter As Single - Public lhinauf As Single - Public lhinunter As Single - Public pspar As Single - Public pmodell As Single - Public CycleFiles As List(Of cSubPath) Public EngOnly As Boolean @@ -180,25 +124,6 @@ Public Class cGEN stPathVEH = New cSubPath stPathENG = New cSubPath stPathGBX = New cSubPath - stdynspez = New cSubPath - - stkatmap = New cSubPath - stkwmap = New cSubPath - stkatkurv = New cSubPath - stkwkurv = New cSubPath - stcooldown = New cSubPath - sttumgebung = New cSubPath - - stBatfile = New cSubPath - stEmospez = New cSubPath - stEANfile = New cSubPath - stGetspez = New cSubPath - stSTEnam = New cSubPath - stEKFnam = New cSubPath - - stPathExs = New cSubPath - - stCoolantSimPath = New cSubPath stDesMaxFile = New cSubPath @@ -426,12 +351,6 @@ Public Class cGEN If Not file.EndOfFile Then EngOnly = CBool(file.ReadLine(0)) - If EngOnly Then - VehMode = tVehMode.EngineOnly - Else - VehMode = tVehMode.StandardMode - End If - If file.EndOfFile Then GoTo lbClose boStartStop = CBool(file.ReadLine(0)) @@ -874,12 +793,6 @@ lbEr: EngOnly = JSON.Content("Body")("EngineOnlyMode") - If EngOnly Then - VehMode = tVehMode.EngineOnly - Else - VehMode = tVehMode.StandardMode - End If - If Not JSON.Content("Body")("StartStop") Is Nothing Then dic = JSON.Content("Body")("StartStop") boStartStop = dic("Enabled") @@ -942,63 +855,17 @@ lbEr: End Function Private Sub SetDefault() - boPKWja = False - bodynkorja = False - ineklasse = 6 - inizykwael = 2 - inPschrit = 20 - innschrit = 20 - boMapSchaltja = True - iniMsek = 3 - boottoJa = False - bokaltst1 = False - sitkat1 = 20 - sitkw1 = 20 - sihsstart = 1 - boEXSja = False boStartStop = False siStStV = 5 siStStT = 5 StStDelay = 0 - boSOCnJa = False - siSOCstart = 0.5 - GetrMod = tTransLossModel.Detailed - bKFcutDrag = True - bKFcutFull = True - bKFinsertDrag = True - bKFDragIntp = True - 'FileVersion = 0 - VehMode = tVehMode.StandardMode - EngAnalysis = False - CreateMap = False - ModeHorEV = False - CoolantsimJa = False + FileVersion = 0 stPathVEH.Clear() stPathENG.Clear() CycleFiles.Clear() stPathGBX.Clear() - stdynspez.Clear() - stkatmap.Clear() - stkwmap.Clear() - stkatkurv.Clear() - stkwkurv.Clear() - stcooldown.Clear() - sttumgebung.Clear() - - stBatfile.Clear() - stEmospez.Clear() - stEANfile.Clear() - stGetspez.Clear() - stSTEnam.Clear() - stEKFnam.Clear() - - stPathExs.Clear() - - stCoolantSimPath.Clear() - - DesMaxJa = True stDesMaxFile.Clear() laDesV.Clear() laDesMax.Clear() @@ -1008,13 +875,6 @@ lbEr: AuxPaths.Clear() AuxDef = False - hinauf = 0 - hinunter = 0 - lhinauf = 0 - lhinunter = 0 - pspar = 0 - pmodell = 0 - EngOnly = False a_lookahead = 0 @@ -1037,7 +897,7 @@ lbEr: MsgSrc = "GEN/Init" - If DesMaxJa And Not EngOnly Then + If Not EngOnly Then file = New cFile_V3 @@ -1091,50 +951,6 @@ lbEr: End Get End Property - Public Property KFcutFull As Boolean - Get - Return bKFcutFull - End Get - Set(value As Boolean) - bKFcutFull = value - End Set - End Property - - Public Property KFinsertDrag As Boolean - Get - Return bKFinsertDrag - End Get - Set(value As Boolean) - bKFinsertDrag = value - End Set - End Property - - Public Property KFcutDrag As Boolean - Get - Return bKFcutDrag - End Get - Set(value As Boolean) - bKFcutDrag = value - End Set - End Property - - Public Property KFDragIntp As Boolean - Get - Return bKFDragIntp - End Get - Set(value As Boolean) - bKFDragIntp = value - End Set - End Property - - Public Property TransmModel() As tTransLossModel - Get - Return GetrMod - End Get - Set(ByVal value As tTransLossModel) - GetrMod = value - End Set - End Property Public Property FilePath() As String Get @@ -1146,122 +962,6 @@ lbEr: End Set End Property - Public Property PKWja() As Boolean - Get - Return boPKWja - End Get - Set(ByVal value As Boolean) - boPKWja = value - End Set - End Property - - Public Property dynkorja() As Boolean - Get - Return bodynkorja - End Get - Set(ByVal value As Boolean) - bodynkorja = value - End Set - End Property - - Public Property eklasse() As Int16 - Get - Return ineklasse - End Get - Set(ByVal value As Int16) - ineklasse = value - End Set - End Property - - Public Property izykwael() As Int16 - Get - Return inizykwael - End Get - Set(ByVal value As Int16) - inizykwael = value - End Set - End Property - - Public Property Pschrit() As Int16 - Get - Return inPschrit - End Get - Set(ByVal value As Int16) - inPschrit = value - End Set - End Property - - Public Property nschrit() As Int16 - Get - Return innschrit - End Get - Set(ByVal value As Int16) - innschrit = value - End Set - End Property - - Public Property MapSchaltja() As Boolean - Get - Return boMapSchaltja - End Get - Set(ByVal value As Boolean) - boMapSchaltja = value - End Set - End Property - - Public Property iMsek() As Int16 - Get - Return iniMsek - End Get - Set(ByVal value As Int16) - iniMsek = value - End Set - End Property - - Public Property ottoJa() As Boolean - Get - Return boottoJa - End Get - Set(ByVal value As Boolean) - boottoJa = value - End Set - End Property - - Public Property kaltst1() As Boolean - Get - Return bokaltst1 - End Get - Set(ByVal value As Boolean) - bokaltst1 = value - End Set - End Property - - Public Property tkat1() As Single - Get - Return sitkat1 - End Get - Set(ByVal value As Single) - sitkat1 = value - End Set - End Property - - Public Property tkw1() As Single - Get - Return sitkw1 - End Get - Set(ByVal value As Single) - sitkw1 = value - End Set - End Property - - Public Property hsstart() As Single - Get - Return sihsstart - End Get - Set(ByVal value As Single) - sihsstart = value - End Set - End Property Public Property PathVEH(Optional ByVal Original As Boolean = False) As String Get @@ -1302,198 +1002,6 @@ lbEr: End Set End Property - Public Property dynspez(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stdynspez.OriginalPath - Else - Return stdynspez.FullPath - End If - End Get - Set(ByVal value As String) - stdynspez.Init(MyPath, value) - End Set - End Property - - Public Property katmap(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stkatmap.OriginalPath - Else - Return stkatmap.FullPath - End If - End Get - Set(ByVal value As String) - stkatmap.Init(MyPath, value) - End Set - End Property - - Public Property kwmap(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stkwmap.OriginalPath - Else - Return stkwmap.FullPath - End If - End Get - Set(ByVal value As String) - stkwmap.Init(MyPath, value) - End Set - End Property - - Public Property katkurv(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stkatkurv.OriginalPath - Else - Return stkatkurv.FullPath - End If - End Get - Set(ByVal value As String) - stkatkurv.Init(MyPath, value) - End Set - End Property - - Public Property kwkurv(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stkwkurv.OriginalPath - Else - Return stkwkurv.FullPath - End If - End Get - Set(ByVal value As String) - stkwkurv.Init(MyPath, value) - End Set - End Property - - Public Property cooldown(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stcooldown.OriginalPath - Else - Return stcooldown.FullPath - End If - End Get - Set(ByVal value As String) - stcooldown.Init(MyPath, value) - End Set - End Property - - Public Property tumgebung(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return sttumgebung.OriginalPath - Else - Return sttumgebung.FullPath - End If - End Get - Set(ByVal value As String) - sttumgebung.Init(MyPath, value) - End Set - End Property - - Public Property Batfile(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stBatfile.OriginalPath - Else - Return stBatfile.FullPath - End If - End Get - Set(ByVal value As String) - stBatfile.Init(MyPath, value) - End Set - End Property - - Public Property Emospez(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stEmospez.OriginalPath - Else - Return stEmospez.FullPath - End If - End Get - Set(ByVal value As String) - stEmospez.Init(MyPath, value) - End Set - End Property - - Public Property EANfile(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stEANfile.OriginalPath - Else - Return stEANfile.FullPath - End If - End Get - Set(ByVal value As String) - stEANfile.Init(MyPath, value) - End Set - End Property - - Public Property Getspez(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stGetspez.OriginalPath - Else - Return stGetspez.FullPath - End If - End Get - Set(ByVal value As String) - stGetspez.Init(MyPath, value) - End Set - End Property - - Public Property STEnam(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stSTEnam.OriginalPath - Else - Return stSTEnam.FullPath - End If - End Get - Set(ByVal value As String) - stSTEnam.Init(MyPath, value) - End Set - End Property - - Public Property EKFnam(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stEKFnam.OriginalPath - Else - Return stEKFnam.FullPath - End If - End Get - Set(ByVal value As String) - stEKFnam.Init(MyPath, value) - End Set - End Property - - Public Property PathExs(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stPathExs.OriginalPath - Else - Return stPathExs.FullPath - End If - End Get - Set(ByVal value As String) - stPathExs.Init(MyPath, value) - End Set - End Property - - Public Property EXSja() As Boolean - Get - Return boEXSja - End Get - Set(ByVal value As Boolean) - boEXSja = value - End Set - End Property - - Public Property StartStop() As Boolean Get @@ -1522,37 +1030,6 @@ lbEr: End Set End Property - Public Property SOCnJa() As Boolean - Get - Return boSOCnJa - End Get - Set(ByVal value As Boolean) - boSOCnJa = value - End Set - End Property - - Public Property SOCstart() As Single - Get - Return siSOCstart - End Get - Set(ByVal value As Single) - siSOCstart = value - End Set - End Property - - Public Property CoolantSimPath(Optional ByVal Original As Boolean = False) As String - Get - If Original Then - Return stCoolantSimPath.OriginalPath - Else - Return stCoolantSimPath.FullPath - End If - End Get - Set(ByVal value As String) - stCoolantSimPath.Init(MyPath, value) - End Set - End Property - Public Property DesMaxFile(Optional ByVal Original As Boolean = False) As String Get If Original Then diff --git a/VECTO/Input Files/cMAP.vb b/VECTO/Input Files/cMAP.vb index bebb0ea01d..7a708d9df3 100644 --- a/VECTO/Input Files/cMAP.vb +++ b/VECTO/Input Files/cMAP.vb @@ -5,120 +5,31 @@ Public Class cMAP 'Private Const FormatVersion As Integer = 1 'Private FileVersion As Integer - Private bPKWja As Boolean - - Public TransMap As Boolean - Public EmComponents As Dictionary(Of String, cEmComp) Public EmDefRef As Dictionary(Of tMapComp, cEmComp) Private MyEmList As List(Of String) Public LPe As List(Of Single) - Public Lnn As List(Of Single) + Public LnU As List(Of Single) Private sFilePath As String Private iMapDim As Integer - Private Ln As System.Collections.Generic.List(Of Single) - Private PeNormed As Boolean - Private nNormed As Boolean Private MapIntp As cMapInterpol Private FuelMap As cDelaunayMap - Public Sub New(ByVal PKWja As Boolean) - bPKWja = PKWja - End Sub - Private Sub ResetMe() - 'FileVersion = 0 - TransMap = False MapIntp = Nothing EmComponents = Nothing MyEmList = Nothing LPe = Nothing - Lnn = Nothing - Ln = Nothing + LnU = Nothing EmDefRef = Nothing iMapDim = -1 - PeNormed = False - nNormed = False FuelMap = New cDelaunayMap End Sub - Private Function fDefIntpV2(ByVal DefEm As tMapComp) As Boolean - - Select Case DefEm - Case tMapComp.ExhTemp, tMapComp.MassFlow, tMapComp.Lambda - Return True - Case Else - Return False - End Select - - End Function - - Private Function fDefPeCorMode(ByVal DefEm As tMapComp) As tIntpPeCorMode - - Select Case DefEm - - Case tMapComp.FC - Return tIntpPeCorMode.PeCorNull - - Case tMapComp.NOx, tMapComp.CO, tMapComp.HC, tMapComp.PM, tMapComp.PN, tMapComp.NO - - If bPKWja Then - Return tIntpPeCorMode.PeCorOff 'Früher: tMapIntpol.ShepNoCor - Else - Return tIntpPeCorMode.PeCorNullPmin 'Früher: tMapIntpol.ShepPwCorMin - End If - - Case tMapComp.ExhTemp, tMapComp.Lambda, tMapComp.MassFlow - Return tIntpPeCorMode.PeCorEmDrag - - Case Else 'DynKor-Parameter, Eta - Return tIntpPeCorMode.PeCorOff - - End Select - - End Function - - Private Function fDefPeCorModeOld(ByVal DefEm As tMapComp) As tIntpPeCorMode - - Select Case DefEm - - Case tMapComp.FC - Return tIntpPeCorMode.PeCorNull - - Case tMapComp.NOx, tMapComp.CO, tMapComp.HC, tMapComp.PM, tMapComp.PN, tMapComp.NO - - If bPKWja Then - Return tIntpPeCorMode.PeCorOff 'Früher: tMapIntpol.ShepNoCor - Else - Return tIntpPeCorMode.PeCorNullPmin 'Früher: tMapIntpol.ShepPwCorMin - End If - - Case Else 'MassFlow, ExhTemp und DynKor-Parameter - Return tIntpPeCorMode.PeCorOff - - End Select - - End Function - - Private Function fDefEmNormID(ByVal DefEm As tMapComp) As tEmNorm - Select Case DefEm - Case tMapComp.FC - Return tEmNorm.x_hPnenn - Case tMapComp.NOx, tMapComp.CO, tMapComp.HC, tMapComp.PM, tMapComp.PN, tMapComp.NO - If bPKWja Then - Return tEmNorm.x_h - Else - Return tEmNorm.x_hPnenn - End If - Case Else - Return tEmNorm.x - End Select - End Function - Public Function ReadFile(Optional ByVal MsgOutput As Boolean = True) As Boolean Dim file As cFile_V3 Dim line As String() @@ -127,7 +38,6 @@ Public Class cMAP 'Dim txt As String Dim Em0 As cEmComp Dim EmKV As System.Collections.Generic.KeyValuePair(Of String, cEmComp) - Dim SwitchOn As Boolean Dim nU As Double Dim MsgSrc As String @@ -156,127 +66,11 @@ Public Class cMAP EmComponents = New System.Collections.Generic.Dictionary(Of String, cEmComp) EmDefRef = New System.Collections.Generic.Dictionary(Of tMapComp, cEmComp) LPe = New System.Collections.Generic.List(Of Single) - Lnn = New System.Collections.Generic.List(Of Single) - Ln = New System.Collections.Generic.List(Of Single) - SwitchOn = False - - 'Now checking whether MIP or MAP - '...is Read. - - ''*** - ''*** First line: Version - 'line = file.ReadLine - 'txt = Trim(UCase(line(0))) - 'If Microsoft.VisualBasic.Left(txt, 1) = "V" Then - ' ' "V" entfernen => Zahl bleibt übrig - ' txt = txt.Replace("V", "") - ' If Not IsNumeric(txt) Then - ' WorkerMsg(tMsgID.Err, "File Version invalid!", MsgSrc) - ' GoTo lbEr - ' Else - ' 'Specify Version - ' FileVersion = CInt(txt) - ' End If - 'Else - ' file.Close() - ' Return ReadOldFormat() - 'End If - - ''Version Check: abort if input file format is newer than version PHEM - 'If FileVersion > FormatVersion Then - ' WorkerMsg(tMsgID.Err, "File Version not supported!", MsgSrc) - ' GoTo lbEr - 'End If - - ''Column 2: Option "+" = parameter for KF creation - 'If UBound(line) > 0 Then - ' If Trim(line(1)) = "+" Then - ' SwitchOn = True - ' If MsgOutput Then WorkerMsg(tMsgID.Normal, "Advanced settings found.", MsgSrc) - ' End If - 'End If - - '*** - '*** Second Line: Name/Identification of Components (Only Em. Power, Revolutions is fixed!) - 'line = file.ReadLine - - ''Column-count check - 's1 = UBound(line) - s1 = 2 - - ''Abort if less than 3 columns - 'If s1 < 2 Then GoTo lbEr - - ' ''Check whether Power/Revolutions swapped - ''If UCase(line(0)).Contains("PE") Then - '' If MsgOutput Then WorkerMsg(tMsgID.Warn, "Expected Emission Map format: 1st column = Engine Speed, 2nd column = Engine Power (Header Check failed)", MsgSrc) - ''End If - - ''Em-components initialize - 'For s = 3 To s1 - - ' Em0 = New cEmComp - ' Em0.Col = s - ' Em0.Name = line(s) 'wird bei Default-Komponenten noch geändert - ' Em0.IDstring = Trim(UCase(line(s))) - ' Em0.MapCompID = fMapComp(Em0.Name) - ' Em0.NormID = tEmNorm.x 'wird ggf. weiter unten korrigiert! - ' 'Default interpolator defined in Em0 = New cEmComp - ' 'Default Correction Pe defined in Em0 = New cEmComp - - ' If EmComponents.ContainsKey(UCase(Em0.Name)) Then - - ' 'Abbruch falls schon definiert - ' WorkerMsg(tMsgID.Err, "Component '" & Em0.Name & "' already defined! Col. " & s + 1, MsgSrc) - ' GoTo lbEr - - ' Else - - ' 'Dictionary .... fill - ' If Em0.MapCompID = tMapComp.Undefined Then - - ' 'ERROR when Component in angle brackets but unknown - ' If Em0.IDstring.Length > 1 Then - ' If Left(Em0.IDstring, 1) = "<" And Right(Em0.IDstring, 1) = ">" Then - ' If MsgOutput Then WorkerMsg(tMsgID.Err, "'" & Em0.Name & "' is no valid Default Map Component!", MsgSrc) - ' End If - ' End If - - ' 'Custom Em-Components Dictionary: - ' EmComponents.Add(Em0.IDstring, Em0) - ' MyEmList.Add(Em0.IDstring) - - ' Else - - ' '*** Default Em components *** + LnU = New System.Collections.Generic.List(Of Single) - ' 'Default-Interpolator - ' Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - - ' 'Default Pe-Correction - ' Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - - ' 'Default-Name - ' Em0.Name = fMapCompName(Em0.MapCompID) - - ' 'TC-components are not dumped - ' If fMapCompIsTC(Em0.MapCompID) Then - ' TransMap = True - ' Em0.WriteOutput = False - ' End If - - ' 'Custom Em-Components Dictionary: - ' EmComponents.Add(Em0.IDstring, Em0) - ' MyEmList.Add(Em0.IDstring) - - ' 'Entry in Reference-dictionary - ' EmDefRef.Add(Em0.MapCompID, Em0) - - ' End If - ' End If - 'Next + s1 = 2 - 'VECTO: Column 3 alwaysd consumption(Verbrauch) + 'Column 3: fuel consumption s = 2 Em0 = New cEmComp Em0.Col = s @@ -290,149 +84,12 @@ Public Class cMAP WorkerMsg(tMsgID.Err, "Component '" & Em0.Name & "' already defined! Col. " & s + 1, MsgSrc) GoTo lbEr Else - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) Em0.Name = fMapCompName(Em0.MapCompID) EmComponents.Add(Em0.IDstring, Em0) MyEmList.Add(Em0.IDstring) EmDefRef.Add(Em0.MapCompID, Em0) End If - '*** - '*** Read Normalized/Measured - 'line = file.ReadLine - - ''Abort when fewer columns than in the second Line - 'If UBound(line) < s1 Then GoTo lbEr - - ''Read Normalized/Measured - 'For Each EmKV In EmComponents - - ' 'EM-component reference - ' Em0 = EmKV.Value - - ' 'Store Unit in String for further checks - ' txt = Trim(line(Em0.Col)) - - ' 'Remove brackets - ' txt = txt.Replace("[", "") - ' txt = txt.Replace("]", "") - - ' 'Normalize and set Unit - ' If txt.Contains("/") Then - ' Select Case UCase(Right(txt, txt.Length - txt.IndexOf("/") - 1)) - - ' Case "H" - ' Em0.NormID = tEmNorm.x_h - ' Em0.Unit = "[" & Left(txt, txt.IndexOf("/")) & "/h]" - - ' Case "KWH" - ' Em0.NormID = tEmNorm.x_kWh - ' Em0.Unit = "[" & Left(txt, txt.IndexOf("/")) & "/h]" - - ' Case "H" & sKey.Normed - ' Em0.NormID = tEmNorm.x_hPnenn - ' Em0.Unit = "[" & Left(txt, txt.IndexOf("/")) & "/h]" - - ' Case Else - ' Em0.NormID = tEmNorm.x - ' Em0.Unit = "[" & txt & "]" - - ' End Select - ' Else - ' Em0.NormID = tEmNorm.x - ' Em0.Unit = "[" & txt & "]" - ' End If - - 'Next - 'nNormed = Trim(UCase(line(0))) = sKey.Normed - 'PeNormed = Trim(UCase(line(1))) = sKey.Normed - nNormed = False - PeNormed = False - - ''Check whether n/Pe measured(Einheiten) OK: - 'If Not nNormed Then - ' Select Case Trim(UCase(line(0))) - ' Case "[U/MIN]", "RPM", "[1/MIN]", "[MIN^-1]" - ' 'Everything is okay - ' Case Else - ' If MsgOutput Then WorkerMsg(tMsgID.Err, "Engine Speed Unit '" & line(0) & "' unknown! '[U/min]' expected.", MsgSrc) - ' End Select - 'Else - ' If MsgOutput Then WorkerMsg(tMsgID.Err, "Engine Speed Unit '" & line(0) & "' unknown! '[U/min]' expected.", MsgSrc) - 'End If - - 'If Not PeNormed Then - ' If Trim(UCase(line(1))) <> "[NM]" Then - ' If MsgOutput Then WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(1) & "' unknown! '[Nm]' expected.", MsgSrc) - ' End If - 'Else - ' If MsgOutput Then WorkerMsg(tMsgID.Err, "Engine Torque Unit '" & line(1) & "' unknown! '[Nm]' expected.", MsgSrc) - 'End If - - - '*** - '*** Line 4.5: (optional when "+"): Settings for Pe-Cor (old PfAK) - ' If not "+", use default Interpolators (see above) - If SwitchOn Then - - 'Line 4 Reading - line = file.ReadLine - - 'Loop over Em-components - For Each EmKV In EmComponents - - If UBound(line) < EmKV.Value.Col Then - WorkerMsg(tMsgID.Err, "Power Correction settings line invalid! (UBound(line) < Em.Col)", MsgSrc) - GoTo lbEr - ElseIf Not IsNumeric(line(EmKV.Value.Col)) Then - WorkerMsg(tMsgID.Err, "Power Correction settings for '" & EmKV.Value.Name & "' (Col. " & EmKV.Value.Col + 1 & ") invalid!", MsgSrc) - GoTo lbEr - End If - - Select Case line(EmKV.Value.Col) - Case 0 - EmKV.Value.PeCorMode = tIntpPeCorMode.PeCorOff - Case 1 - EmKV.Value.PeCorMode = tIntpPeCorMode.PeCorNull - Case 2 - EmKV.Value.PeCorMode = tIntpPeCorMode.PeCorEmDrag - Case Else - WorkerMsg(tMsgID.Err, "Power Correction Mode Nr. " & line(EmKV.Value.Col) & " is invalid!", MsgSrc) - GoTo lbEr - End Select - - Next - - - 'Line 5 Reading - line = file.ReadLine - - 'Loop over Em-components - For Each EmKV In EmComponents - - If UBound(line) < EmKV.Value.Col Then - WorkerMsg(tMsgID.Err, "Interpolator settings line invalid! (UBound(line) < Em.Col)", MsgSrc) - GoTo lbEr - ElseIf Not IsNumeric(line(EmKV.Value.Col)) Then - WorkerMsg(tMsgID.Err, "Interpolator settings for '" & EmKV.Value.Name & "' (Col. " & EmKV.Value.Col + 1 & ") invalid!", MsgSrc) - GoTo lbEr - End If - - Select Case line(EmKV.Value.Col) - Case 1 - EmKV.Value.IntpolV2 = False - Case 2 - EmKV.Value.IntpolV2 = True - Case Else - WorkerMsg(tMsgID.Err, "Interpolator Mode Nr. " & line(EmKV.Value.Col) & " is invalid!", MsgSrc) - GoTo lbEr - End Select - - Next - - End If - 'From line 4 (or 6): Values Try Do While Not file.EndOfFile @@ -446,20 +103,12 @@ Public Class cMAP 'Revolutions nU = CDbl(line(0)) - Lnn.Add(nU) + LnU.Add(nU) 'Power - 'If Trim(UCase(line(1))) = sKey.MAP.Drag Then - ' If PeNormed Then - ' LPe.Add(FLD.Pdrag(Lnn(iMapDim)) / VEH.Pnenn) - ' Else - ' LPe.Add(FLD.Pdrag(Lnn(iMapDim))) - ' End If - 'Else LPe.Add(nMtoPe(nU, CDbl(line(1)))) - 'End If - 'Emissions + 'FC For Each EmKV In EmComponents EmKV.Value.RawVals.Add(CSng(line(EmKV.Value.Col))) Next @@ -495,356 +144,10 @@ lbEr: End Function - Private Function ReadOldFormat() As Boolean - Dim File As cFile_V3 - Dim line As String() - Dim Em0 As cEmComp - Dim EmKV As System.Collections.Generic.KeyValuePair(Of String, cEmComp) - Dim s1 As Integer - Dim s As Integer - - 'Open file - File = New cFile_V3 - If Not File.OpenRead(sFilePath, ",", True, True) Then - File = Nothing - Return False - End If - - 'Old maps have always TC-factors are (possibly null) - TransMap = True - - Em0 = New cEmComp - Em0.Col = 2 - Em0.NormID = tEmNorm.x_hPnenn - Em0.MapCompID = tMapComp.FC - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.FC - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 3 - Em0.MapCompID = tMapComp.NOx - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.NOx - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 4 - Em0.MapCompID = tMapComp.CO - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.CO - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 5 - Em0.MapCompID = tMapComp.HC - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.HC - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 6 - Em0.MapCompID = tMapComp.PM - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.PM - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 7 - Em0.MapCompID = tMapComp.PN - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[#/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.PN - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 8 - Em0.MapCompID = tMapComp.NO - Em0.NormID = fDefEmNormID(Em0.MapCompID) - Em0.Unit = "[g/h]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.NO - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Name = "E3" - Em0.IDstring = "E3" - Em0.Col = 9 - Em0.NormID = tEmNorm.x_h - Em0.MapCompID = tMapComp.Undefined - Em0.Unit = "[?/h]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 10 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.Lambda - Em0.Unit = "[-]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Lambda - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 11 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.ExhTemp - Em0.Unit = "[°C]" - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Temp - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCdP2s) - Em0.IDstring = sKey.MAP.dP2s - Em0.Col = 12 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdP2s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCPneg3s) - Em0.IDstring = sKey.MAP.Pneg3s - Em0.Col = 13 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCPneg3s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCPpos3s) - Em0.IDstring = sKey.MAP.Ppos3s - Em0.Col = 14 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCPpos3s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCAmpl3s) - Em0.IDstring = sKey.MAP.Ampl3s - Em0.Col = 15 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCAmpl3s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCLW3p3s) - Em0.IDstring = sKey.MAP.LW3p3s - Em0.Col = 16 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCLW3p3s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCP40sABS) - Em0.IDstring = sKey.MAP.P40sABS - Em0.Col = 17 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCP40sABS - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCabsdn2s) - Em0.IDstring = sKey.MAP.absdn2s - Em0.Col = 18 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCabsdn2s - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCP10sn10s3) - Em0.IDstring = sKey.MAP.P10sn10s3 - Em0.Col = 19 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCP10sn10s3 - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCdynV) - Em0.IDstring = sKey.MAP.dynV - Em0.Col = 20 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynV - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCdynAV) - Em0.IDstring = sKey.MAP.dynAV - Em0.Col = 21 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynAV - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.WriteOutput = False - Em0.Name = fMapCompName(tMapComp.TCdynDAV) - Em0.IDstring = sKey.MAP.dynDAV - Em0.Col = 22 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynDAV - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - Em0 = New cEmComp - Em0.Col = 23 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.Extrapol - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Extrapol - Em0.Unit = "[-]" - Em0.PeCorMode = fDefPeCorModeOld(Em0.MapCompID) - EmComponents.Add(Em0.IDstring, Em0) - MyEmList.Add(Em0.IDstring) - - For Each EmKV In EmComponents - If EmKV.Value.MapCompID <> tMapComp.Undefined Then EmDefRef.Add(EmKV.Value.MapCompID, EmKV.Value) - Next - - nNormed = True - PeNormed = True - - 'Values - Do While Not File.EndOfFile - 'Line read - line = File.ReadLine - - 'Line counter up (was reset in ResetMe) - iMapDim += 1 - - 'Revolutions - Lnn.Add(CSng(line(1))) - - 'Power - LPe.Add(CSng(line(0))) - - If iMapDim = 0 Then s1 = UBound(line) - - 'Emissions - For Each EmKV In EmComponents - s = EmKV.Value.Col - If s > s1 Then - EmKV.Value.RawVals.Add(0) - Else - EmKV.Value.RawVals.Add(CSng(line(s))) - End If - Next - Loop - - 'Shep-Init - MapIntp = New cMapInterpol(Me) - - 'Close file - File.Close() - - Return True - - End Function - - Public Function InitTCcomp(ByVal sK As String, ByVal TCvalues As System.Collections.Generic.Dictionary(Of tMapComp, Double)) As Boolean - Dim KV As System.Collections.Generic.KeyValuePair(Of tMapComp, Double) - Dim StringID As String - Dim ID As tMapComp - - ID = fMapComp(sK) - StringID = Trim(UCase(sK)) - - 'Abort when Em-component not in MAP - If ID = tMapComp.Undefined Then - If Not EmComponents.ContainsKey(StringID) Then Return False - Else - If Not EmDefRef.ContainsKey(ID) Then Return False - End If - - 'Abort if TC-factors for the component already defined - If EmComponents(StringID).TCdef Then Return False - - EmComponents(StringID).InitTC() - - For Each KV In TCvalues - EmComponents(StringID).TCfactors(KV.Key) = KV.Value - Next - - Return True - - End Function - Public Sub Norm() Dim i As Integer - Dim j As Integer - Dim MapCheck As Boolean Dim Em0 As cEmComp - Dim Pnenn As Single Dim nleerl As Single Dim nnenn As Single @@ -852,81 +155,13 @@ lbEr: MsgSrc = "MAP/Norm" - Pnenn = VEH.Pnenn nleerl = VEH.nLeerl nnenn = VEH.nNenn - 'Speed Normalized - If Not nNormed Then - For i = 0 To iMapDim - Lnn(i) = (Lnn(i) - nleerl) / (nnenn - nleerl) - Next - End If - - ' "otherwise calculate normalized Revolutions - For i = 0 To iMapDim - Ln.Add((Lnn(i) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / VEH.nNenn) - Next - - 'Normalized Power - If Not PeNormed Then - For i = 0 To iMapDim - LPe(i) /= Pnenn - Next - End If - - 'Emissions unnormalised - ' CAUTION: Even if x_kWh and x_hPnenn are to be transformed into x_h, the Normed must remain the same because otherwise the DynKor will not be right! - For Each Em0 In EmComponents.Values - Select Case Em0.NormID - Case tEmNorm.x_hPnenn - For i = 0 To iMapDim - Em0.RawVals(i) *= Pnenn - Next - Case tEmNorm.x_kWh - For i = 0 To iMapDim - Em0.RawVals(i) *= LPe(i) * Pnenn - Next - Case Else - 'Values are already specified in absolute - 'Distinction between [x] and [x/h] currently not used/supported - End Select - Next - - 'Check whether Revolutions/Power reversed - For i = 0 To iMapDim - - If Lnn(i) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl < 0 Then - - MapCheck = False - - For j = 0 To iMapDim - - If LPe(i) < -0.1 Then - - MapCheck = True - - ElseIf LPe(i) > 1.1 Then - - MapCheck = False - Exit For - - End If - - Next - - If Not MapCheck Then WorkerMsg(tMsgID.Warn, "Expected Emission Map format: 1st column = Engine Speed, 2nd column = Engine Power (rpm values < 0)", MsgSrc) - - Exit For - - End If - - Next - 'FC Delauney Em0 = EmDefRef(tMapComp.FC) For i = 0 To iMapDim - FuelMap.AddPoints(Lnn(i), LPe(i), Em0.RawVals(i)) + FuelMap.AddPoints(LnU(i), LPe(i), Em0.RawVals(i)) Next FuelMap.Triangulate() @@ -934,930 +169,16 @@ lbEr: End Sub - Public Sub Intp_Init(ByVal Pnorm As Single, ByVal nnorm As Single) - MapIntp.ShepInit(Pnorm, nnorm) - End Sub - - Public Function fShep_Intp(ByRef EmComp As cEmComp) As Single - Return MapIntp.fIntShepDef(EmComp) - End Function - - Public Function fFCdelaunay_Intp(ByVal nnorm As Single, ByVal Pnorm As Single) As Single + Public Function fFCdelaunay_Intp(ByVal nU As Single, ByVal Pe As Single) As Single Try - Return FuelMap.Intpol(nnorm, Pnorm) + Return FuelMap.Intpol(nU, Pe) Catch ex As Exception - WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nnormTonU(nnorm).ToString("0") & " [1/min], Me= " & PnormToM(nnorm, Pnorm).ToString("0.0") & " [Nm]", "MAP/FC_Intp") + WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nU.ToString("0") & " [1/min], Me= " & nPeToM(nU, Pe).ToString("0.0") & " [Nm]", "MAP/FC_Intp") Return -10000 End Try End Function - 'Map creation - Public Function CreateMAP() As Boolean - - Dim file As cFile_V3 - Dim str As System.Text.StringBuilder - Dim Em0 As cEmComp - Dim EmExtra As cEmComp - Dim Extra As Boolean - Dim EmKV As KeyValuePair(Of String, cEmComp) - Dim s As Integer - Dim i As Integer - Dim j As Integer - Dim EmMW As Dictionary(Of String, List(Of Single)) - Dim EmMW0 As KeyValuePair(Of String, List(Of Single)) - Dim TCcomponents As System.Collections.Generic.Dictionary(Of tMapComp, cEmComp) - Dim nn As List(Of Single) - Dim pe As List(Of Single) - Dim px As Single - Dim nnx As Single - Dim dp As Single - Dim dp0 As Single - Dim dnn As Single - Dim dnn0 As Single - Dim pf As Single - Dim pm As Single - Dim EmCheck As List(Of Boolean) - Dim KFanz As List(Of Integer) - Dim KFradproz As List(Of Single) - Dim KFmin As Dictionary(Of String, List(Of Single)) - Dim KFmax As Dictionary(Of String, List(Of Single)) - Dim ValMin As Dictionary(Of String, Single) - Dim ValMax As Dictionary(Of String, Single) - Dim anz As Integer - Dim sum As Single - Dim EmSum As Dictionary(Of String, Double) - Dim EmDrag As Single - Dim Pfak As List(Of Single) - Dim IntpPe As Single - Dim NrUsed As List(Of Integer) - Dim Used As List(Of Boolean) - - Dim IsDrag As List(Of Boolean) - Dim nnAb As Single - Dim MsgSrc As String - - Dim KeyListFull As List(Of String) - Dim KeyListLog As List(Of String) - Dim Key As String - - MsgSrc = "MAP/CreateMAP" - - file = New cFile_V3 - - If Not file.OpenWrite(sFilePath) Then - WorkerMsg(tMsgID.Err, "Cannot access map file (" & sFilePath & ")", MsgSrc) - Return False - End If - - 'Reset - ResetMe() - - If GEN.nschrit < 1 Or GEN.Pschrit < 1 Or GEN.iMsek < 1 Then - WorkerMsg(tMsgID.Err, "Invalid 'Create Map' settings in input file!", MsgSrc) - Return False - End If - - '****************************************************************** - '***************** Initialize Em-components ******************* - MyEmList = New List(Of String) - EmComponents = New Dictionary(Of String, cEmComp) - TCcomponents = New Dictionary(Of tMapComp, cEmComp) - EmDefRef = New Dictionary(Of tMapComp, cEmComp) - EmMW = New Dictionary(Of String, List(Of Single)) - nn = New List(Of Single) - pe = New List(Of Single) - LPe = New List(Of Single) - Lnn = New List(Of Single) - Ln = New System.Collections.Generic.List(Of Single) - EmCheck = New List(Of Boolean) - KFanz = New List(Of Integer) - KFmin = New Dictionary(Of String, List(Of Single)) - KFmax = New Dictionary(Of String, List(Of Single)) - ValMin = New Dictionary(Of String, Single) - ValMax = New Dictionary(Of String, Single) - KFradproz = New List(Of Single) - EmSum = New Dictionary(Of String, Double) - NrUsed = New List(Of Integer) - Used = New List(Of Boolean) - Pfak = New List(Of Single) - IsDrag = New List(Of Boolean) - KeyListFull = New List(Of String) - KeyListLog = New List(Of String) - - TransMap = True - 'FileVersion = FormatVersion - nNormed = True - PeNormed = True - - s = 1 '0 = n, 1 = pe - For Each EmKV In DRI.EmComponents - s += 1 - Em0 = New cEmComp - Em0.Col = s - Em0.Name = EmKV.Value.Name 'das ist schon der "schöne" Name! D.h. "NOx" und nicht "<NOX>" - Em0.Unit = EmKV.Value.Unit - Em0.MapCompID = EmKV.Value.MapCompID - Em0.NormID = EmKV.Value.NormID - Em0.IDstring = EmKV.Value.IDstring - - 'PeCorMode: Falls nicht in MES/NPI vorgegeben gilt bei Nicht-Default-Em was in cEmComp.New() eingestellt ist |@@| PeCorMode: Unless specified in MES/NPI with non-default Em what is in cEmComp.New() - If DRI.CreateMapParDef Then - Em0.PeCorMode = DRI.MapPfak(EmKV.Key) - ElseIf Em0.MapCompID <> tMapComp.Undefined Then - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - End If - - If Em0.MapCompID <> tMapComp.Undefined Then - - If fMapCompIsTC(Em0.MapCompID) Then - - 'If TC specified, then Abort - WorkerMsg(tMsgID.Err, "Component '" & Em0.Name & "' is invalid (Trans.Corr. Parameter)!", MsgSrc) - Return False - - Else - - 'Select interpolator - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - - 'Entry in Reference Dictionary (It does not check whether Em-Comp occurs twice since it has been caught in DRI.ReadFile) - EmDefRef.Add(Em0.MapCompID, Em0) - - End If - - End If - - EmComponents.Add(EmKV.Key, Em0) - MyEmList.Add(EmKV.Key) - - 'Dump Infos - WorkerMsg(tMsgID.Normal, " '" & Em0.Name & "': Unit = " & Em0.Unit & ", PeCorMode = " & fPwCorName(Em0.PeCorMode), MsgSrc) - - Next - - 'Dynamic parameters and Extrapol to be added - Em0 = New cEmComp - Em0.Col = s + 1 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdP2s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.dP2s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 2 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCPneg3s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Pneg3s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 3 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCPpos3s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Ppos3s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 4 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCAmpl3s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.Ampl3s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 5 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCLW3p3s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.LW3p3s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 6 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCP40sABS - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.P40sABS - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 7 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCabsdn2s - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.absdn2s - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 8 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCP10sn10s3 - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.P10sn10s3 - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 8 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynV - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.dynV - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 9 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynAV - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.dynAV - TCcomponents.Add(Em0.MapCompID, Em0) - - Em0 = New cEmComp - Em0.Col = s + 10 - Em0.NormID = tEmNorm.x - Em0.MapCompID = tMapComp.TCdynDAV - Em0.Unit = "[-]" - Em0.WriteOutput = False - Em0.IntpolV2 = fDefIntpV2(Em0.MapCompID) - Em0.PeCorMode = fDefPeCorMode(Em0.MapCompID) - Em0.Name = fMapCompName(Em0.MapCompID) - Em0.IDstring = sKey.MAP.dynDAV - TCcomponents.Add(Em0.MapCompID, Em0) - - EmExtra = New cEmComp - EmExtra.Col = s + 11 - EmExtra.NormID = tEmNorm.x - EmExtra.MapCompID = tMapComp.Extrapol - EmExtra.Unit = "[-]" - EmExtra.IntpolV2 = fDefIntpV2(tMapComp.Extrapol) - EmExtra.PeCorMode = fDefPeCorMode(tMapComp.Extrapol) - EmExtra.Name = fMapCompName(tMapComp.Extrapol) - EmExtra.IDstring = sKey.MAP.Extrapol - - - '****************************************************************** - '************* Initialize Mean-value Dictionary *************** - For Each EmKV In EmComponents - - EmMW.Add(EmKV.Key, New List(Of Single)) - EmSum.Add(EmKV.Key, 0) - - KFmin.Add(EmKV.Key, New List(Of Single)) - KFmax.Add(EmKV.Key, New List(Of Single)) - - ValMin.Add(EmKV.Key, -1) - ValMax.Add(EmKV.Key, -1) - - KeyListLog.Add(EmKV.Key) - - Next - - For Each Em0 In TCcomponents.Values - - EmMW.Add(Em0.Name, New List(Of Single)) - EmSum.Add(Em0.Name, 0) - - Next - - '****************************************************************** - '********************* Calculate Mean-values ********************** - - 'Main-loop - If GEN.iMsek > 1 Then - - 'Create Lists - For i = 0 To MODdata.tDim - - pe.Add(0) - nn.Add(0) - - For Each EmKV In EmComponents - EmMW(EmKV.Key).Add(0) - Next - For Each Em0 In TCcomponents.Values - EmMW(Em0.Name).Add(0) - Next - - Next - - 'Loop over Measurement-values - For i = 0 To MODdata.tDim - - If i + 1 < GEN.iMsek Then - - 'Fill the Area below iMsek with Measurement-values - pe(i) = MODdata.Pe(i) - nn(i) = MODdata.nn(i) - - For Each EmKV In EmComponents - EmMW(EmKV.Key)(i) = DRI.EmComponents(EmKV.Key).RawVals(i) - Next - - For Each Em0 In TCcomponents.Values - EmMW(Em0.Name)(i) = MODdata.TC.TCcomponents(Em0.MapCompID)(i) - Next - - Else - - 'Fill the Area above iMsek with the Mean-values of the Measurement-values - For j = 0 To (GEN.iMsek - 1) - - pe(i) += MODdata.Pe(i - j) / GEN.iMsek - nn(i) += MODdata.nn(i - j) / GEN.iMsek - - For Each EmKV In EmComponents - EmMW(EmKV.Key)(i) += DRI.EmComponents(EmKV.Key).RawVals(i - j) / GEN.iMsek - Next - - For Each Em0 In TCcomponents.Values - EmMW(Em0.Name)(i) += MODdata.TC.TCcomponents(Em0.MapCompID)(i - j) / GEN.iMsek - Next - - Next - End If - - Next - - Else - - 'No averaging - For i = 0 To MODdata.tDim - - pe.Add(MODdata.Pe(i)) - nn.Add(MODdata.nn(i)) - - For Each EmKV In EmComponents - EmMW(EmKV.Key).Add(DRI.EmComponents(EmKV.Key).RawVals(i)) - Next - For Each Em0 In TCcomponents.Values - EmMW(Em0.Name).Add(MODdata.TC.TCcomponents(Em0.MapCompID)(i)) - Next - Next - - End If - - 'EmCheck: False = Wert noch nicht verwendet, True = Wert wurde bereits in Kennfeld verwurschtet |@@| EmCheck: False = value is not used, True = Value is already(verwurschtet) in the Map - For j = 0 To MODdata.tDim - EmCheck.Add(False) - Next - - '****************************************************************** - '*************************** Rasterung **************************** |@@| Grd-ing(Rasterung) **************************** - - dnn = 1.2 / (GEN.nschrit) - dp = 1.4 / (GEN.Pschrit) - - nnx = 0 - dnn 'wird beim ersten Durchgang durch dn erhöht => Startwert = 0 - - iMapDim = -1 - Do While nnx + dnn <= 1.20001 'nn-Schleife - - nnx += dnn - - pf = FLD(0).Pfull(nnx) / VEH.Pnenn - pm = FLD(0).Pdrag(nnx) / VEH.Pnenn - - If GEN.KFcutDrag Then - - px = -0.4 - 5 * dp - Do Until px + dp > pm - px += dp - Loop - px -= dp 'wird beim ersten Durchgang durch dp erhöht! - - Else - - px = -0.4 - dp 'wird beim ersten Durchgang durch dp erhöht => Startwert = -0.4 - - End If - - - If GEN.KFcutFull Then - - Do While px <= pf + 0.0001 'pe-Schleife bis eine Reihe über Volllast - - px += dp - - If Not (Math.Abs(px) < 0.00001 And nnx < 0.00001) Then - LPe.Add(Math.Round(px, 6)) - Lnn.Add(Math.Round(nnx, 6)) - IsDrag.Add(False) - iMapDim += 1 - End If - - Loop - - Else - - Do While px <= 1 'pe-Schleife bis 1 - - px += dp - - If Not (Math.Abs(px) < 0.00001 And nnx < 0.00001) Then - LPe.Add(px) - Lnn.Add(nnx) - IsDrag.Add(False) - iMapDim += 1 - End If - - Loop - - End If - - - Loop - - 'Add Drag at half nn-increments. Needed for PfAK. If GEN.KFinsertDrag is disabled, it will be deleted later. - nnx = 0 - dnn / 2 - Do While nnx + dnn / 2 <= 1.20001 - nnx += dnn / 2 - LPe.Add(FLD(0).Pdrag(nnx) / VEH.Pnenn) - Lnn.Add(nnx) - IsDrag.Add(True) - iMapDim += 1 - Loop - - 'Add Idle-point - LPe.Add(0) - Lnn.Add(0) - IsDrag.Add(False) - iMapDim += 1 - - '****************************************************************** - '**************** Create NrUsed / Set to zero set ***************** - For j = 0 To MODdata.tDim - NrUsed.Add(0) - Used.Add(False) - Next - - '****************************************************************** - '**************** Expect pure Measurement-values in Grid ***************** - - 'Basis Schrittweite zwischenspeichern |@@| Basis for step-size buffering - dnn0 = dnn - dp0 = dp - - 'Loop over Grid-points(i) - For i = 0 To iMapDim - - 'Return Totals/Numbers/Flags - Extra = False - dnn = dnn0 - dp = dp0 - - 'Drag-Power - pm = FLD(0).Pdrag(Lnn(i)) / VEH.Pnenn - - 'Loop until enough Values found in Radius - Do - - 'Reset Counter/Totals - anz = 0 - For Each EmMW0 In EmMW - EmSum(EmMW0.Key) = 0 - Next - IntpPe = 0 - - 'Loop over Measured-values ​​(j) - For j = 0 To MODdata.tDim - - 'If within Radius ... - If Math.Abs(pe(j) - LPe(i)) <= dp / 2 And Math.Abs(nn(j) - Lnn(i)) <= dnn / 2 Then - - 'Num + 1 - anz += 1 - - 'Loop over all Em-comp. - For Each EmMW0 In EmMW - - 'Total + - EmSum(EmMW0.Key) += EmMW0.Value(j) - - 'Calculate Min/Max (for Log-output) - If anz = 1 Then - ValMin(EmMW0.Key) = EmMW0.Value(j) - ValMax(EmMW0.Key) = EmMW0.Value(j) - Else - ValMin(EmMW0.Key) = Math.Min(EmMW0.Value(j), ValMin(EmMW0.Key)) - ValMax(EmMW0.Key) = Math.Max(EmMW0.Value(j), ValMax(EmMW0.Key)) - End If - - Next - - 'Interpolierte Leistung aufsummieren (wird dann durch Anz dividiert) |@@| Sum-up Interpolated Power (then divided by Num) - IntpPe += pe(j) - - 'Count how many Measurement-values exist for the Grid-points (Log-output) - Used(j) = True - - Else - - Used(j) = False - - End If - - Next - - 'If none Measured-value in Radius (Num = 0), then enlarge Radius and set Extra-flag - If anz < 2 Then - Extra = True - dp *= 1.1 - dnn *= 1.1 - End If - - Loop Until anz > 1 - - 'Allocate NrUsed - For j = 0 To MODdata.tDim - If Used(j) Then NrUsed(j) += 1 - Next - - 'Interpolated-Power = Sum / number - IntpPe /= anz - - 'Calculate PfAK: - ' If above Drag then PfAK according to Formula, or 1 when the difference between Pe-Interpol and Drag-power is too low - ' If below Drag, Pfak=0 => Em-value = Zero - If LPe(i) > pm Then - If (IntpPe - pm) > 0.05 Then - Pfak.Add(Math.Abs((LPe(i) - pm) / (IntpPe - pm))) - Else - Pfak.Add(1) - End If - Else - Pfak.Add(0) - End If - - 'Get the Extrapol flag from the Extrapol-column (1/0) - If Extra Then - EmExtra.RawVals.Add(1) - Else - EmExtra.RawVals.Add(0) - End If - - 'For Log-output - KFanz.Add(anz) - KFradproz.Add(dnn / dnn0) - - 'Loop through Em-Comp (within Grid-points-loop) - For Each EmKV In EmComponents - - 'Falls Option 'Schlepp-Em aus .FLD' belegen und Rasterpunkt-Leistung <= Schleppleistung |@@| If Option 'Drag-Em' from .FLD 'and Power-gridpoints <= Drag-power - If Not GEN.KFDragIntp And LPe(i) <= pm + 0.0001 Then - - 'If Drag-Em exists in .FLD, then use it otherwise alocate with zero - If FLD(0).EmDef(EmKV.Key) Then - EmKV.Value.RawVals.Add(FLD(0).EmDrag(EmKV.Key, Lnn(i))) - Else - EmKV.Value.RawVals.Add(0) - End If - - Else 'Option 'Schlepp-Em aus Messwerten' bzw. Punkte über Schleppleistung - - 'Em-allocation without PfAK (=> PfAK is crafted later) - EmKV.Value.RawVals.Add(CSng(EmSum(EmKV.Key) / anz)) - - End If - - 'For Log-output - KFmin(EmKV.Key).Add(ValMin(EmKV.Key)) - KFmax(EmKV.Key).Add(ValMax(EmKV.Key)) - - Next - - 'Assume TC-factors without Pfak - For Each Em0 In TCcomponents.Values - Em0.RawVals.Add(CSng(EmSum(Em0.Name) / anz)) - Next - - Next - - '****************************************************************** - '***************************** Pfak ****************************** - - '!!! IMPORTANT !!! - 'Loop passes over all Grid-points (also for Pe <= PeDrag and respectively for PeIntpol near Pdrag). - ' That's OK because PfAK is in anyway allocated with 1s. - - 'Loop through Em-Comp - For Each EmKV In EmComponents - - 'Falls keine Create Map Einstellungen (in .NPI/.MES) oder Pfak explizit aktiviert => Pfak verwenden |@@| If no Create Map is set (in .NPI/.MES) or PfAK activated explicitly => Use PfAK - If EmKV.Value.PeCorMode <> tIntpPeCorMode.PeCorOff Then - - 'Loop over Grid-points (i) - For i = 0 To iMapDim - - If EmKV.Value.PeCorMode = tIntpPeCorMode.PeCorNull Then - - 'Altes Pfak mit Extrapolation von Null weg |@@| Old PfAK with Extrapolation from Zero route? - EmDrag = 0 - - Else 'PeCorMode = tIntpPeCorMode.PeCorEmDrag - - 'Schlepp-Emission raus suchen |@@| Pick Drag-Emission - ' Schlepp-Em aus nächstgelegenen Rasterpunkt nehmen. Das geht weil Schleppkurve |@@| Take the Drag-Em from the nearest Grid-point. This is because the Drag-curve - ' immer ins Map kommt (auch wenn sie dann später raus gelöscht wird) !! |@@| always comes into the Map (even if it is later deleted) !! - ' Option 'Schlepp-Em aus .FLD' spielt keine Rolle weil das nur die Belegungs-Methode der Schleppkurve betrifft (s.o.) |@@| Option 'Drag-Em(Schlepp-Em)' from .FLD plays no role because it affects only the Allocation-method of the Drag-curve (see above) - EmDrag = 0 - nnAb = dnn0 - For j = 0 To iMapDim - If IsDrag(j) Then - If Math.Abs(Lnn(i) - Lnn(j)) < nnAb Then - nnAb = Math.Abs(Lnn(i) - Lnn(j)) - EmDrag = EmKV.Value.RawVals(j) - End If - End If - Next - - End If - - 'Apply PfAK - EmKV.Value.RawVals(i) = CSng(Pfak(i) * (EmKV.Value.RawVals(i) - EmDrag) + EmDrag) - - Next - - End If - - Next - - '****************************************************************** - '******************* Normalize (Value and Unit) ******************** - For Each EmKV In EmComponents - - 'Use them If specified in MES/NPI-files - If DRI.CreateMapParDef Then - - If DRI.MapUnitsNormed(EmKV.Key) Then - - 'Values normalized - For i = 0 To iMapDim - EmKV.Value.RawVals(i) /= VEH.Pnenn - Next - - EmKV.Value.NormID = tEmNorm.x_hPnenn - - End If - - Else - - 'Otherwise, use a standard normalization - If EmKV.Value.MapCompID <> tMapComp.Undefined Then - - If fDefEmNormID(EmKV.Value.MapCompID) = tEmNorm.x_hPnenn Then - - 'Normalized Values - For i = 0 To iMapDim - EmKV.Value.RawVals(i) /= VEH.Pnenn - Next - - EmKV.Value.NormID = tEmNorm.x_hPnenn - - End If - - End If - - End If - - Next - - '****************************************************************** - '****************** EmComponents zusammenfassen ******************* |@@| Summarized EmComponents ******************* - For Each Em0 In TCcomponents.Values - EmComponents.Add(Em0.Name, Em0) - MyEmList.Add(Em0.Name) - Next - - EmComponents.Add(EmExtra.Name, EmExtra) - MyEmList.Add(EmExtra.Name) - - For Each EmKV In EmComponents - KeyListFull.Add(EmKV.Key) - Next - - - '****************************************************************** - '*********** Schleppkurve wieder raus nehmen (optional) *********** |@@| Get Load-curve again (optional) *********** - If Not GEN.KFinsertDrag Then - - 'Schleife über Rasterpunkte (i). Keine For-Schleife weil iMapDim reduziert wird |@@| Loop over Grid-points(i). No For-loop because iMapDim is reduced - i = -1 - Do While i < iMapDim - i += 1 - If IsDrag(i) Then - Lnn.RemoveAt(i) - LPe.RemoveAt(i) - IsDrag.RemoveAt(i) - - For Each EmKV In EmComponents - EmKV.Value.RawVals.RemoveAt(i) - Next - - iMapDim -= 1 - i -= 1 - End If - Loop - - End If - - - '****************************************************************** - '************************** Dump Map '************************** - - str = New System.Text.StringBuilder - - file.WriteLine("c VECTO Engine Map") - file.WriteLine("c VECTO " & VECTOvers) - file.WriteLine("c " & Now.ToString) - file.WriteLine("c Input File: " & JobFile) - file.WriteLine("c Measurement Data: " & CurrentCycleFile) - file.WriteLine("c Rated engine power: " & VEH.Pnenn) - file.WriteLine("c Rated engine speed: " & VEH.nNenn) - file.WriteLine("c Idle engine speed: " & VEH.nLeerl) - - 'file.WriteLine("V" & FormatVersion) - - 'Header - str.Append("n_norm,Pe_norm") - - For Each Key In KeyListFull - 'CAUTION: Not Name but sKey !!! - str.Append("," & EmComponents(Key).IDstring) - Next - - file.WriteLine(str.ToString) - - str.Length = 0 - - 'Unit - str.Append(sKey.Normed & "," & sKey.Normed) - For Each Key In KeyListFull - If EmComponents(Key).NormID = tEmNorm.x_hPnenn Then - str.Append("," & EmComponents(Key).Unit & sKey.Normed) - Else - str.Append("," & EmComponents(Key).Unit) - End If - Next - file.WriteLine(str.ToString) - - 'Values - For i = 0 To iMapDim - str.Length = 0 - str.Append(CStr(Lnn(i))) - str.Append("," & CStr(LPe(i))) - For Each Key In KeyListFull - str.Append("," & EmComponents(Key).RawVals(i)) - Next - file.WriteLine(str.ToString) - Next - - file.Close() - - '****************************************************************** - '********************** Dump Extended-Info '*********************** - - If Not file.OpenWrite(fFileWoExt(sFilePath) & ".log") Then - WorkerMsg(tMsgID.Err, "Cannot access file (" & fFileWoExt(sFilePath) & ".log" & ")!", MsgSrc) - Return False - End If - - file.WriteLine("c VECTO Engine Map Creation Detailed Information") - file.WriteLine("c VECTO " & VECTOvers) - file.WriteLine("c " & Now.ToString) - file.WriteLine("c Input File: " & JobFile) - file.WriteLine("c Measurement Data: " & CurrentCycleFile) - file.WriteLine("c Output Emission Map:" & sFilePath) - file.WriteLine(" ") - - sum = 0 - For i = 0 To iMapDim - sum += EmExtra.RawVals(i) 'EmComponents(sKey.MAP.Extr) - Next - file.WriteLine("c Nr. of extrapolated points: " & sum) - - file.WriteLine(" ") - file.WriteLine("Load points of created Emission Map") - file.WriteLine("NrIntPts" & vbTab & "...Number of load points (from Measurement Data) interpolated for the Emission Map load point.") - file.WriteLine("RngExtRat" & vbTab & "...Extension Ratio of Interpolation Range. RngExtRat > 1 means Extrapolation.") - file.WriteLine("Em Min/Max" & vbTab & "...Extremum values of the interpolated load points (from Measurement Data) for the Emission Map load point (if NrIntPts > 1). Units not normalized.") - file.WriteLine("PeCor" & vbTab & "...Engine Power Correction Factor. PeCor = (Emission Map engine power - Drag) / (Interpolated engine power - Drag). PeCor = 1 for pe < 0.") - file.WriteLine(" ") - - 'Header (MAP) - str.Length = 0 - str.Append("n,pe,PeCor,NrIntPts,RngExtRat") - For Each Key In KeyListLog - If Not KFmin.ContainsKey(Key) Then Exit For - str.Append("," & EmComponents(Key).Name & " Min") - str.Append("," & EmComponents(Key).Name & " Max") - Next - file.WriteLine(str.ToString) - - 'Values - str.Length = 0 - For i = 0 To iMapDim - - str.Length = 0 - - str.Append(CStr(Lnn(i))) - str.Append("," & CStr(LPe(i))) - str.Append("," & CStr(Pfak(i))) - str.Append("," & KFanz(i)) - str.Append("," & KFradproz(i)) - - For Each Key In KeyListLog - str.Append("," & KFmin(Key)(i)) - str.Append("," & KFmax(Key)(i)) - Next - - file.WriteLine(str.ToString) - - Next - - file.WriteLine(" ") - file.WriteLine("Load points of Measurement Data.") - file.WriteLine("Averaging interval [s]: " & GEN.iMsek) - file.WriteLine("NrUsed" & vbTab & "...Number of times used for interpolation.") - file.WriteLine(" ") - - 'Header (MES/NPI) - str.Length = 0 - - str.Append("n,pe,NrUsed") - - For Each Key In KeyListLog - str.Append("," & EmComponents(Key).Name) - Next - - file.WriteLine(str.ToString) - - For j = 0 To MODdata.tDim - - str.Length = 0 - - str.Append(nn(j) & "," & pe(j) & "," & NrUsed(j)) - - For Each Key In KeyListLog - str.Append("," & EmMW(Key)(j)) - Next - - file.WriteLine(str.ToString) - Next - - file.Close() - - 'Shep-Init - MapIntp = New cMapInterpol(Me) - - Return True - - End Function - - 'Default Shepard in intpshep () + 'Default Shepard in intpshep () Private Class cMapInterpol Private iMapDim As Integer @@ -1887,305 +208,7 @@ lbEr: myMap = Nothing End Sub - Public Sub ShepInit(ByVal nnorm As Single, ByVal Pnorm As Single) - Dim ab0 As Double() - Dim i As Integer - Dim i0 As Integer - Dim sumo As Double - Dim iminMin As Integer - Dim Radius As Double - Dim inim As Integer - - '***************************************************************************** - '***************************************************************************** - '******************************** V1 & V2 ********************************** - '***************************************************************************** - '***************************************************************************** - - Pe0 = Pnorm - n0 = (nnorm * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / VEH.nNenn - PeDrag = FLD(0).Pdrag(nnorm) / VEH.Pnenn 'Schleppkurve für die geg. Drehzahl - - ReDim ab0(iMapDim) - - - '***************************************************************************** - '***************************************************************************** - '*********************************** V1 ************************************ - '***************************************************************************** - '***************************************************************************** - - ReDim abOK(iMapDim) - - 'Calculate Distance and Correction. - For i = 0 To iMapDim - If (Pnorm < 0.05 And Pnorm >= 0.0) Then - - 'Um Nullleistung werden Kennfeldpunkte um Pe=0 hoeher gewichtet und Drehzahlabstand geringer, |@@| ????The Map-points with zero-Power (Pe=0) will be weighted higher and Revolution-distances lower, - ' da Interpolation aus Punkten mit hoeherer last dort schlecht passt: |@@| because interpolation of Points with higher Load is fitted badly: - ab0(i) = (Pnorm - myMap.LPe(i)) ^ 2 + (n0 - myMap.Ln(i)) ^ 2 * 888.9 * (Math.Abs(Pnorm) ^ 3 + 0.001) - ab0(i) = ab0(i) * (Math.Abs(Pnorm) + Math.Abs(myMap.LPe(i)) + 0.005) * 9.52 - - Else - - 'Square of the distance: - ab0(i) = (Pnorm - myMap.LPe(i)) ^ 2 + (n0 - myMap.Ln(i)) ^ 2 - - 'Falls Vorzeichen von Pe unterschiedlich (Last/Schlepp-Trennung) wird Abstand vergroessert um Schlepp bei Schlepp mehr zu gewichten: |@@| ????If the Sign of Pe unequal (Load /Drag separation), then Distance increases more weight to Drag by Drag: - If Pnorm * myMap.LPe(i) < 0 Then ab0(i) *= 50 - - End If - - Next - - 'Punkte innerhalb Radius zählen und ggf. Radius erhöhen |@@| Points are within radius and possibly within a bigger Radius - Radius = 0.01 '<= Startwert ist Radius * 2 weil in Do-Schleife gleich verdoppelt wird! - iminMin = 2 - - Do - Radius *= 2 - inim = 0 - For i = 0 To iMapDim - If ab0(i) <= Radius Then - inim += 1 - abOK(i) = True - Else - abOK(i) = False - End If - Next - Loop Until inim >= iminMin - - 'Abstand-Array erstellen und Leistung interpolieren für Pe-Korrektur |@@| Distance array and create Power interpolate for Pe-correction - ReDim ab(inim - 1) - i0 = -1 - sumo = 0 - For i = 0 To iMapDim - If abOK(i) Then - i0 += 1 - ab(i0) = Math.Max(ab0(i), 0.00000001) - sumo += myMap.LPe(i) / ab(i0) - End If - Next - - 'Calculation of Wisum - wisum = 0 - For i = 0 To inim - 1 - wisum = wisum + 1.0 / ab(i) - Next - - 'Calcluate Interpolated Power - PeIntp = sumo / wisum - - - '***************************************************************************** - '***************************************************************************** - '*********************************** V2 ************************************ - '***************************************************************************** - '***************************************************************************** - - ReDim abOKV2(iMapDim) - - 'Calculate Distance and Correction. - For i = 0 To iMapDim - - 'Square of the distance: - ab0(i) = (Pnorm - myMap.LPe(i)) ^ 2 + (nnorm - myMap.Lnn(i)) ^ 2 - - Next - - 'Punkte innerhalb Radius zählen und ggf. Radius erhöhen |@@| Points are within radius and possibly within a bigger Radius - Radius = 0.0001 '<= Startwert ist Radius * 2 weil in Do-Schleife gleich verdoppelt wird! '0.0001 - iminMin = 3 - - Do - Radius *= 2 - inim = 0 - For i = 0 To iMapDim - If ab0(i) <= Radius Then - inim += 1 - abOKV2(i) = True - Else - abOKV2(i) = False - End If - Next - Loop Until inim >= iminMin - - 'Abstand-Array erstellen und Leistung interpolieren für Pe-Korrektur |@@| Distance array and create Power interpolate for Pe-correction - ReDim abV2(inim - 1) - i0 = -1 - sumo = 0 - For i = 0 To iMapDim - If abOKV2(i) Then - i0 += 1 - abV2(i0) = Math.Max(ab0(i), 0.00000001) - sumo += myMap.LPe(i) / abV2(i0) - End If - Next - - 'Calculation of wisumV2 - wisumV2 = 0 - For i = 0 To inim - 1 - wisumV2 = wisumV2 + 1.0 / abV2(i) - Next - - 'Calculate Interpolated Power - PeIntpV2 = sumo / wisumV2 - - End Sub - - Public Function fIntShepDef(ByRef EmComp As cEmComp) As Single - - Dim i As Integer - Dim i0 As Integer - Dim sumo As Double - Dim EmDrag As Single - Dim wisum0 As Double - Dim PeIntp0 As Single - - i0 = -1 - sumo = 0 - - If EmComp.IntpolV2 Then - - For i = 0 To iMapDim - If abOKV2(i) Then - i0 += 1 - sumo += EmComp.RawVals(i) / abV2(i0) - End If - Next - - wisum0 = wisumV2 - PeIntp0 = PeIntpV2 - - Else - - For i = 0 To iMapDim - If abOK(i) Then - i0 += 1 - sumo += EmComp.RawVals(i) / ab(i0) - End If - Next - - wisum0 = wisum - PeIntp0 = PeIntp - - End If - - Select Case EmComp.PeCorMode - - Case tIntpPeCorMode.PeCorOff - Return sumo / wisum0 - - Case tIntpPeCorMode.PeCorNull - - If (PeIntp0 - PeDrag) > 0.05 Then - Return Math.Abs((Pe0 - PeDrag) / (PeIntp0 - PeDrag)) * sumo / wisum0 - Else - Return sumo / wisum0 - End If - - Case tIntpPeCorMode.PeCorNullPmin - - If (PeIntp0 - PeDrag) > 0.05 And Math.Abs(Pe0) > 0.01 Then - Return Math.Abs((Pe0 - PeDrag) / (PeIntp0 - PeDrag)) * sumo / wisum0 - Else - Return sumo / wisum0 - End If - - Case Else 'tIntpPeCorMode.PeCorEmDrag - - If PeIntp0 - PeDrag > 0.05 Then - EmDrag = fEmDrag(EmComp) - Return (Math.Abs(Pe0 - PeDrag) / (PeIntp0 - PeDrag)) * (sumo / wisum0 - EmDrag) + EmDrag - Else - Return sumo / wisum0 - End If - - End Select - - End Function - - 'Berechnet Emission an Schleppkurve |@@| Calculated Emission on Drag-curve - Private Function fEmDrag(ByRef EmComp As cEmComp) As Single - Dim ab0 As Double() - Dim abOK_loc As Boolean() - Dim ab_loc As Double() - Dim i As Integer - Dim i0 As Integer - Dim sumo As Double - Dim iminMin As Integer - Dim Pnorm As Single - Dim Radius As Double - Dim wisum_loc As Double - - ReDim ab0(iMapDim) - ReDim abOK_loc(iMapDim) - Dim inim As Integer - - 'Es wird an Schleppkurve gesucht |@@| Search on Drag-curve - Pnorm = PeDrag - 'n0 has already been defined in Init - - 'Calculate Distance and Correction. - For i = 0 To iMapDim - - 'Square of the Distances: - ab0(i) = (Pnorm - myMap.LPe(i)) ^ 2 + (n0 - myMap.Ln(i)) ^ 2 - - 'Falls Vorzeichen von Pe unterschiedlich (Last/Schlepp-Trennung) wird Abstand vergroessert um Schlepp bei Schlepp mehr zu gewichten: |@@| ????If the Sign of Pe unequal (Load /Drag separation), then Distance increases more weight to Drag by Drag: - If Not EmComp.IntpolV2 Then - If Pnorm * myMap.LPe(i) < 0 Then ab0(i) *= 50 - End If - - Next - - 'Punkte innerhalb Radius zählen und ggf. Radius erhöhen |@@| Points are within radius and possibly within a bigger Radius - Radius = 0.0001 '<= Startwert ist Radius * 2 weil in Do-Schleife gleich verdoppelt wird! '0.0001 - iminMin = 3 - - Do - Radius *= 2 - inim = 0 - For i = 0 To iMapDim - If ab0(i) <= Radius Then - inim += 1 - abOK_loc(i) = True - Else - abOK_loc(i) = False - End If - Next - Loop Until inim >= iminMin - - 'Create Distances-array - ReDim ab_loc(inim - 1) - i0 = -1 - For i = 0 To iMapDim - If abOK_loc(i) Then - i0 += 1 - ab_loc(i0) = Math.Max(ab0(i), 0.00000001) - End If - Next - - 'Calculation of wisum - wisum_loc = 0 - For i = 0 To inim - 1 - wisum_loc = wisum_loc + 1.0 / ab_loc(i) - Next - - 'Calculate emission - sumo = 0 - i0 = -1 - For i = 0 To iMapDim - If abOK_loc(i) Then - i0 += 1 - sumo += EmComp.RawVals(i) / ab_loc(i0) - End If - Next - - Return sumo / wisum_loc - - End Function - + End Class diff --git a/VECTO/Input Files/cTRS.vb b/VECTO/Input Files/cTRS.vb deleted file mode 100644 index fe24513f04..0000000000 --- a/VECTO/Input Files/cTRS.vb +++ /dev/null @@ -1,262 +0,0 @@ -Public Class cTRS - - Private Const FormatVersion As Integer = 1 - Private FileVersion As Integer - - Private sFilePath As String - - Private Sub ResetMe() - FileVersion = 0 - - End Sub - - Public Function ReadFile() As Boolean - Dim file As cFile_V3 - Dim line As String() - Dim txt As String - Dim s As Integer - Dim s1 As Integer - Dim sTC As System.Collections.Generic.Dictionary(Of tMapComp, Integer) - Dim KV As System.Collections.Generic.KeyValuePair(Of tMapComp, Integer) - Dim MapC As tMapComp - Dim TCvals As System.Collections.Generic.Dictionary(Of tMapComp, Double) - Dim MsgSrc As String - Dim l As Integer - - MsgSrc = "Main/ReadInp/TRS" - - - 'Reset - ResetMe() - - 'Stop if there's no file - If sFilePath = "" OrElse Not IO.File.Exists(sFilePath) Then - WorkerMsg(tMsgID.Err, "TRS file not found! (" & sFilePath & ")", MsgSrc) - Return False - End If - - 'Open file - file = New cFile_V3 - If Not file.OpenRead(sFilePath) Then - file = Nothing - WorkerMsg(tMsgID.Err, "Failed to open file (" & sFilePath & ") !", MsgSrc) - Return False - End If - - '*** - '*** First Line: Version - line = file.ReadLine - txt = Trim(UCase(line(0))) - If Microsoft.VisualBasic.Left(txt, 1) = "V" Then - ' "Remove "V" => Number remains - txt = txt.Replace("V", "") - If Not IsNumeric(txt) Then - 'If invalid version: Abort - WorkerMsg(tMsgID.Err, "File Version invalid!", MsgSrc) - GoTo lbEr - Else - 'Version set - FileVersion = CInt(txt) - End If - Else - 'If no version information: Old format - file.Close() - Return ReadOldFormat() - End If - - 'Version Check: Abort if Input-file-format is newer than PHEM-version - If FileVersion > FormatVersion Then - WorkerMsg(tMsgID.Err, "File Version not supported!", MsgSrc) - GoTo lbEr - End If - - - - sTC = New System.Collections.Generic.Dictionary(Of tMapComp, Integer) - - - '*** - '*** Second Line: Check which TC-factors exist in any column (from column 1!) - line = file.ReadLine - s1 = UBound(line) - - 'Abort if less than 2 Columns: - If s1 < 1 Then - WorkerMsg(tMsgID.Err, "Format invalid!", MsgSrc) - GoTo lbEr - End If - - For s = 1 To s1 - MapC = fMapComp(line(s)) - 'Abort if unknown TC-factor - If MapC = tMapComp.Undefined Then - WorkerMsg(tMsgID.Err, "Component '" & line(s) & "' is invalid!", MsgSrc) - GoTo lbEr - End If - 'Add to Dict - sTC.Add(MapC, s) - Next - - '*** - '*** From Line 3: TC-factors for each Em-component - ' l is for Error-output - l = 0 - Try - - Do While Not file.EndOfFile - - line = file.ReadLine - l += 1 - - TCvals = New System.Collections.Generic.Dictionary(Of tMapComp, Double) - For Each KV In sTC - TCvals.Add(KV.Key, CDbl(line(KV.Value))) - Next - - If Not MAP.InitTCcomp(line(0), TCvals) Then - WorkerMsg(tMsgID.Err, "Component '" & line(0) & "' not defined in emission map!", MsgSrc) - GoTo lbEr - End If - - TCvals = Nothing - - Loop - - Catch ex As Exception - - WorkerMsg(tMsgID.Err, "Error during file read! Line number: " & l & " (" & sFilePath & ")", MsgSrc, sFilePath) - GoTo lbEr - - End Try - - - file.Close() - - KV = Nothing - sTC = Nothing - file = Nothing - TCvals = Nothing - - Return True - -lbEr: - file.Close() - KV = Nothing - sTC = Nothing - TCvals = Nothing - file = Nothing - - - Return False - - End Function - - Private Function ReadOldFormat() As Boolean - Dim File As cFile_V3 - Dim line As String() = New String() {""} - Dim z As Integer - Dim First As Boolean - Dim TCvals As System.Collections.Generic.Dictionary(Of tMapComp, Double) - Dim Em0 As cEmComp - Dim x As Short - - 'Open file - File = New cFile_V3 - If Not File.OpenRead(sFilePath) Then - File = Nothing - Return False - End If - - First = True - - For x = 0 To 9 - Select Case x - Case 0 - Em0 = MAP.EmDefRef(tMapComp.FC) - Case 1 - Em0 = MAP.EmDefRef(tMapComp.NOx) - Case 2 - Em0 = MAP.EmDefRef(tMapComp.CO) - Case 3 - Em0 = MAP.EmDefRef(tMapComp.HC) - Case 4 - Em0 = MAP.EmDefRef(tMapComp.PM) - Case 5 - Em0 = MAP.EmDefRef(tMapComp.PN) - Case 6 - Em0 = MAP.EmDefRef(tMapComp.NO) - Case 7 - Em0 = MAP.EmComponents("E3") - Case 8 - Em0 = MAP.EmDefRef(tMapComp.Lambda) - Case Else '9 - Em0 = MAP.EmDefRef(tMapComp.ExhTemp) - End Select - - If First Then - For z = 0 To GEN.eklasse - line = File.ReadLine - Next - First = False - Else - For z = 1 To 10 - line = File.ReadLine - Next - End If - - 'Abort if less than 11 Columns: - If UBound(line) < 10 Then GoTo lbEr - - TCvals = New System.Collections.Generic.Dictionary(Of tMapComp, Double) - TCvals.Add(tMapComp.TCAmpl3s, CDbl(line(0))) - TCvals.Add(tMapComp.TCP40sABS, CDbl(line(1))) - TCvals.Add(tMapComp.TCLW3p3s, CDbl(line(2))) - TCvals.Add(tMapComp.TCPneg3s, CDbl(line(3))) - TCvals.Add(tMapComp.TCPpos3s, CDbl(line(4))) - TCvals.Add(tMapComp.TCabsdn2s, CDbl(line(5))) - TCvals.Add(tMapComp.TCP10sn10s3, CDbl(line(6))) - TCvals.Add(tMapComp.TCdP2s, CDbl(line(7))) - TCvals.Add(tMapComp.TCdynV, CDbl(line(8))) - TCvals.Add(tMapComp.TCdynAV, CDbl(line(9))) - TCvals.Add(tMapComp.TCdynDAV, CDbl(line(10))) - - If Not MAP.InitTCcomp(Em0.Name, TCvals) Then GoTo lbEr - - TCvals = Nothing - - - Next - - - - - File.Close() - TCvals = Nothing - File = Nothing - - Return True - -lbEr: - File.Close() - TCvals = Nothing - File = Nothing - - - Return False - - - End Function - - - - Public Property FilePath() As String - Get - Return sFilePath - End Get - Set(ByVal value As String) - sFilePath = value - End Set - End Property - - -End Class diff --git a/VECTO/Input Files/cVEH.vb b/VECTO/Input Files/cVEH.vb index 484417a607..444e860de5 100644 --- a/VECTO/Input Files/cVEH.vb +++ b/VECTO/Input Files/cVEH.vb @@ -11,27 +11,13 @@ Public Class cVEH Private siMass As Single Private siLoading As Single Private siAquers As Single - 'Private siDelta As Single Private siI_mot As Single Private siI_wheels As Single Private siI_Getriebe As Single - Private siPaux0 As Single - Private siPnenn As Single Private sinNenn As Single Private sinLeerl As Single Private siFr0 As Single '<= wird aus Achs-RRC-Werten berechnet - Private siFr1 As Single - Private siFr2 As Single - Private siFr3 As Single - Private siFr4 As Single - Private sifGetr As Single Private siDreifen As Single - Private sihinauf As Single - Private sihinunter As Single - Private silhinauf As Single - Private silhinunter As Single - Private sipspar As Single - Private sipmodell As Single Private siCd0 As Single Public CdMode As tCdMode @@ -124,23 +110,10 @@ Public Class cVEH siI_mot = 0 siI_wheels = 0 siI_Getriebe = 0 - siPaux0 = 0 - siPnenn = 0 sinNenn = 0 sinLeerl = 0 siFr0 = 0 - siFr1 = 0 - siFr2 = 0 - siFr3 = 0 - siFr4 = 0 - sifGetr = 0 siDreifen = 0 - sihinauf = 0 - sihinunter = 0 - silhinauf = 0 - silhinunter = 0 - sipspar = 0 - sipmodell = 0 siGetrI = New List(Of Single) GetrEffDef = New List(Of Boolean) @@ -622,11 +595,9 @@ lbError: If Not CdInit() Then Return False 'Transmission Loss Maps - If GEN.TransmModel = tTransLossModel.Detailed Then - If Not VEH.TrLossMapInit Then - WorkerMsg(tMsgID.Err, "Failed to initialize Transmission Loss Maps!", MsgSrc) - Return False - End If + If Not VEH.TrLossMapInit Then + WorkerMsg(tMsgID.Err, "Failed to initialize Transmission Loss Maps!", MsgSrc) + Return False End If 'Retarder @@ -676,6 +647,17 @@ lbError: End Function + Public Sub nRatedInit() + Dim fl As cFLD + + nNenn = 0 + For Each fl In FLD + If nNenn < fl.nRated Then nNenn = fl.nRated + Next + + End Sub + + #Region "Transmission Loss Maps" Private Function TrLossMapInit() As Boolean @@ -693,7 +675,6 @@ lbError: Dim M_out As Double Dim dnU As Single - Dim nn As Single Dim dM As Single Dim P_In As Single Dim P_Loss As Single @@ -799,12 +780,11 @@ lbError: nU = VEH.nLeerl + dnU Do While nU <= nNenn - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - dM = nPeToM(nU, (2 / 3) * FLD(i).Pfull(nn) / 10) - M_in = nPeToM(nU, (1 / 3) * FLD(i).Pfull(nn)) + dM = nPeToM(nU, (2 / 3) * FLD(i).Pfull(nU) / 10) + M_in = nPeToM(nU, (1 / 3) * FLD(i).Pfull(nU)) - Do While M_in <= nPeToM(nU, FLD(i).Pfull(nn)) + Do While M_in <= nPeToM(nU, FLD(i).Pfull(nU)) P_In = nMtoPe(nU, M_in) @@ -1520,27 +1500,6 @@ lbInt: End Set End Property - - Public Property Paux0 As Single - Get - Return siPaux0 - End Get - Set(ByVal value As Single) - siPaux0 = value - End Set - End Property - - - Public Property Pnenn As Single - Get - Return siPnenn - End Get - Set(ByVal value As Single) - siPnenn = value - End Set - End Property - - Public Property nNenn As Single Get Return sinNenn @@ -1569,54 +1528,6 @@ lbInt: End Set End Property - Public Property Fr1 As Single - Get - Return siFr1 - End Get - Set(ByVal value As Single) - siFr1 = value - End Set - End Property - - Public Property Fr2 As Single - Get - Return siFr2 - End Get - Set(ByVal value As Single) - siFr2 = value - End Set - End Property - - Public Property Fr3 As Single - Get - Return siFr3 - End Get - Set(ByVal value As Single) - siFr3 = value - End Set - End Property - - Public Property Fr4 As Single - Get - Return siFr4 - End Get - Set(ByVal value As Single) - siFr4 = value - End Set - End Property - - Public Property fGetr As Single - Get - Return sifGetr - End Get - Set(ByVal value As Single) - sifGetr = value - End Set - End Property - - - - Public Property Dreifen As Single Get Return siDreifen @@ -1627,65 +1538,6 @@ lbInt: End Property - Public Property hinauf As Single - Get - Return sihinauf - End Get - Set(ByVal value As Single) - sihinauf = value - End Set - End Property - - - Public Property hinunter As Single - Get - Return sihinunter - End Get - Set(ByVal value As Single) - sihinunter = value - End Set - End Property - - - Public Property lhinauf As Single - Get - Return silhinauf - End Get - Set(ByVal value As Single) - silhinauf = value - End Set - End Property - - - Public Property lhinunter As Single - Get - Return silhinunter - End Get - Set(ByVal value As Single) - silhinunter = value - End Set - End Property - - - Public Property pspar As Single - Get - Return sipspar - End Get - Set(ByVal value As Single) - sipspar = value - End Set - End Property - - - Public Property pmodell As Single - Get - Return sipmodell - End Get - Set(ByVal value As Single) - sipmodell = value - End Set - End Property - Public Property FilePath() As String Get Return sFilePath diff --git a/VECTO/MODcalc/Em Calc.vb b/VECTO/MODcalc/Em Calc.vb index 8572bd32b8..6fc83693c7 100644 --- a/VECTO/MODcalc/Em Calc.vb +++ b/VECTO/MODcalc/Em Calc.vb @@ -41,8 +41,6 @@ Public Class cEm For i = 0 To MODdata.tDim - MAP.Intp_Init(MODdata.nn(i), MODdata.Pe(i)) - For Each KV In MAP.EmComponents Select Case MODdata.EngState(i) @@ -53,28 +51,25 @@ Public Class cEm Case Else '<= Idle / Drag / FullLoad-Unterscheidung...? - If KV.Value.MapCompID = tMapComp.FC Then - 'Delaunay - v = MAP.fFCdelaunay_Intp(MODdata.nn(i), MODdata.Pe(i)) - If v < 0 And v > -999 Then - If v < DEV.negFCerr Then - WorkerMsg(tMsgID.Err, "FC= " & v & "!", "MAP/FC_Intp") - Result = False - Else - v = 0 - End If - End If + 'Delaunay + v = MAP.fFCdelaunay_Intp(MODdata.nU(i), MODdata.Pe(i)) - If Result Then - If v < -999 Then Result = False + If v < 0 And v > -999 Then + If v < -0.1 Then + WorkerMsg(tMsgID.Err, "FC= " & v & " at " & MODdata.nU(i) & " [1/min], " & MODdata.Pe(i) & " [kW]!", "MAP/FC_Intp") + Result = False + Else + v = 0 End If - EmComp(KV.Key).RawVals.Add(v) - Else - 'Normal interpolation - EmComp(KV.Key).RawVals.Add(MAP.fShep_Intp(KV.Value)) End If + If Result Then + If v < -999 Then Result = False + End If + EmComp(KV.Key).RawVals.Add(v) + + End Select Next @@ -92,55 +87,6 @@ Public Class cEm End Function - Public Sub TC_Calc() - Dim dynkor As Double - Dim Pnenn As Single - Dim i As Integer - Dim KV As KeyValuePair(Of String, cEmComp) - Dim MapTC As Dictionary(Of tMapComp, Double) - Dim ModTC As cTC - Dim MsgSrc As String - - MsgSrc = "EmCalc/TC_Calc" - - Dim EmL As List(Of Single) - - If PHEMmode = tPHEMmode.ModeSTANDARD Then WorkerMsg(tMsgID.Normal, "Transient Correction", MsgSrc) - - Pnenn = VEH.Pnenn - ModTC = MODdata.TC - - For Each KV In EmComp - - If MAP.EmComponents(KV.Key).TCdef Then - - MapTC = MAP.EmComponents(KV.Key).TCfactors - - KV.Value.InitTC() - - EmL = New List(Of Single) - - 'First two seconds, no correction: - EmL.Add(KV.Value.RawVals(0)) - - If MODdata.tDim > 0 Then - EmL.Add(KV.Value.RawVals(1)) - - For i = 2 To MODdata.tDim - dynkor = (MapTC(tMapComp.TCAmpl3s) * ModTC.Ampl3s(i) + MapTC(tMapComp.TCP40sABS) * ModTC.P40sABS(i) + MapTC(tMapComp.TCLW3p3s) * ModTC.LW3p3s(i) + MapTC(tMapComp.TCPneg3s) * ModTC.Pneg3s(i) + MapTC(tMapComp.TCPpos3s) * ModTC.Ppos3s(i) + MapTC(tMapComp.TCabsdn2s) * ModTC.abs_dn2s(i) + MapTC(tMapComp.TCP10sn10s3) * ModTC.P10s_n10s3(i) + MapTC(tMapComp.TCdP2s) * ModTC.dP_2s(i) + MapTC(tMapComp.TCdynV) * ModTC.dynV(i) + MapTC(tMapComp.TCdynAV) * ModTC.dynAV(i) + MapTC(tMapComp.TCdynDAV) * ModTC.dynDAV(i)) - If MAP.EmComponents(KV.Key).NormID = tEmNorm.x_hPnenn Then dynkor *= Pnenn - EmL.Add(CSng((KV.Value.RawVals(i) + dynkor))) - Next - End If - - KV.Value.TCVals = EmL - KV.Value.FinalVals = KV.Value.TCVals - - End If - Next - - End Sub - Public Sub SumCalc() Dim KV As KeyValuePair(Of String, cEmComp) For Each KV In EmComp @@ -148,2769 +94,5 @@ Public Class cEm Next End Sub - Public Function EngAnalysis() As Boolean - - Dim EmMesMW As Dictionary(Of String, Single) - Dim EmSimMW As Dictionary(Of String, Single) - Dim TCMW As Dictionary(Of String, Single) - Dim EAcomp As List(Of String) - Dim EAcomp0 As String - - Dim pe As Single - Dim nn As Single - - Dim TCKV As KeyValuePair(Of tMapComp, List(Of Single)) - Dim EmKV0 As KeyValuePair(Of String, cEmComp) - Dim DriEmRef As cEmComp - - Dim t As Integer - Dim t1 As Integer - - Dim isinterv As Integer - - Dim s As System.Text.StringBuilder - Dim sU As System.Text.StringBuilder - Dim file As cFile_V3 - - Dim reg As cRegression - Dim reginfo As cRegression.RegressionProcessInfo - Dim a As List(Of Double) - Dim b As List(Of Double) - Dim MsgSrc As String - - Dim UnitsErr As Dictionary(Of String, Boolean) - - MsgSrc = "EngAnalysis" - - EmMesMW = New Dictionary(Of String, Single) - EmSimMW = New Dictionary(Of String, Single) - TCMW = New Dictionary(Of String, Single) - s = New System.Text.StringBuilder - sU = New System.Text.StringBuilder - EAcomp = New List(Of String) - UnitsErr = New Dictionary(Of String, Boolean) - - isinterv = Cfg.EAAvInt - - If isinterv < 1 Then - WorkerMsg(tMsgID.Err, "Range for average values '" & isinterv & "' is not valid!", MsgSrc) - Return False - End If - - file = New cFile_V3 - - If Not file.OpenWrite(MODdata.ModOutpName & ".mwe") Then - WorkerMsg(tMsgID.Err, "Can't write to " & MODdata.ModOutpName & ".mwe", MsgSrc) - Return False - End If - - 'Create Dictionaries - For Each EmKV0 In DRI.EmComponents - If EmComp.ContainsKey(EmKV0.Key) Then - EmMesMW.Add(EmKV0.Key, 0) - EmSimMW.Add(EmKV0.Key, 0) - EAcomp.Add(EmKV0.Key) - - 'Unit-Check - If UCase(EmKV0.Value.Unit) <> UCase(EmComp(EmKV0.Key).Unit) Then - WorkerMsg(tMsgID.Warn, "Unit mismatch! Cycle Component '" & EmKV0.Value.Name & "', Unit '" & EmKV0.Value.Unit & "' <> '" & EmComp(EmKV0.Key).Unit & "'", MsgSrc) - UnitsErr.Add(EmKV0.Key, True) 'True ist wurscht... es geht nur drum, dass der Key drinnen ist - End If - - - Else - WorkerMsg(tMsgID.Warn, "Cycle Component '" & EmKV0.Value.Name & "' not found in Emission Map. Skipped for analysis.", MsgSrc) - End If - Next - - For Each TCKV In MODdata.TC.TCcomponents - TCMW.Add(TCKV.Key, 0) - Next - - 'Calculate sums - For Each EAcomp0 In EAcomp - - DriEmRef = DRI.EmComponents(EAcomp0) - - For t = 0 To MODdata.tDim - EmMesMW(EAcomp0) += DriEmRef.RawVals(t) - EmSimMW(EAcomp0) += EmComp(EAcomp0).FinalVals(t) - Next - - Next - - 'Mean-values - For Each EAcomp0 In EAcomp - - EmMesMW(EAcomp0) /= MODdata.tDim + 1 - EmSimMW(EAcomp0) /= MODdata.tDim + 1 - - Next - - '***************************************** 'Header '****************************************** - file.WriteLine("VECTO Engine Analysis averaged results") - file.WriteLine("VECTO " & VECTOvers) - file.WriteLine(Now.ToString) - file.WriteLine("Input File: " & JobFile) - file.WriteLine("Driving Cycle and Measurement Data: " & CurrentCycleFile) - file.WriteLine(" ") - file.WriteLine("Meas = Measured value (Input)") - file.WriteLine("Sim = Calculated value (PHEM Output)") - file.WriteLine("Diff = Sim - Meas") - file.WriteLine("Delta = Sim / Meas - 1") - file.WriteLine(" ") - file.WriteLine("Cycle average results") - file.WriteLine("EmComp,Unit,Meas,Sim,Diff,Delta,R" & ChrW(178)) - - '************************************ 'Cycle Mean-values ************************************ - For Each EAcomp0 In EAcomp - - s.Length = 0 - - '***** Name - s.Append(DRI.EmComponents(EAcomp0).Name) - - '***** Unit - If UnitsErr.ContainsKey(EAcomp0) Then - s.Append(",?!") - Else - s.Append("," & DRI.EmComponents(EAcomp0).Unit) - End If - - '***** Measurement-value - s.Append("," & EmMesMW(EAcomp0)) - - '***** PHEM value - s.Append("," & EmSimMW(EAcomp0)) - - '***** Diff - CAUTION: No Pnom normalization! Beware of the Dynamic-correction! - s.Append("," & EmSimMW(EAcomp0) - EmMesMW(EAcomp0)) - - '***** Delta - If EmMesMW(EAcomp0) = 0 Then - s.Append("," & "-") - Else - s.Append("," & (EmSimMW(EAcomp0) / EmMesMW(EAcomp0)) - 1) - End If - - '***** R2 - reg = New cRegression - a = New List(Of Double) - b = New List(Of Double) - - 'Average values over x seconds and imediately put au - For t = isinterv To MODdata.tDim Step isinterv - - 'Set to zero - EmMesMW(EAcomp0) = 0 - EmSimMW(EAcomp0) = 0 - - 'Aufsummieren |@@| Accumulate(Aufsummieren) - For t1 = (t - isinterv) To t - 1 - EmMesMW(EAcomp0) += DRI.EmComponents(EAcomp0).RawVals(t1) / isinterv - EmSimMW(EAcomp0) += EmComp(EAcomp0).FinalVals(t1) / isinterv - Next - - 'Measurement-value - a.Add(CDbl(EmMesMW(EAcomp0))) - - 'PHEM-value - b.Add(CDbl(EmSimMW(EAcomp0))) - - Next - - reginfo = reg.Regress(a.ToArray, b.ToArray) - - s.Append("," & reginfo.PearsonsR ^ 2) - - reginfo = Nothing - reg = Nothing - - file.WriteLine(s.ToString) - - Next - - '************************************ Dump Modal '************************************ - file.WriteLine(" ") - file.WriteLine("Modal results averaged over " & isinterv & " seconds.") - - 'Header/Units - s.Length = 0 - s.Append("t,n_norm,Pe_norm") - sU.Append("[s],[-],[-]") - - For Each EAcomp0 In EAcomp - - DriEmRef = DRI.EmComponents(EAcomp0) - - 'Measurement-value - s.Append("," & DriEmRef.Name & "_Meas") - sU.Append("," & DriEmRef.Unit) - - 'PHEM-value - s.Append("," & EmComp(EAcomp0).Name & "_PHEM") - sU.Append("," & EmComp(EAcomp0).Unit) - - 'Diff - CAUTION: No Pnominal-normalized! Beware of the Dynamic-correction! - s.Append("," & DriEmRef.Name & "_Diff") - If UnitsErr.ContainsKey(EAcomp0) Then - sU.Append(",?!") - Else - sU.Append("," & DriEmRef.Unit) - End If - - 'Delta - s.Append("," & DriEmRef.Name & "_Delta") - sU.Append("," & "[-]") - - Next - - For Each TCKV In MODdata.TC.TCcomponents - s.Append("," & fMapCompName(TCKV.Key)) - sU.Append("," & "-") - Next - - 'Header and write units - file.WriteLine(s.ToString) - file.WriteLine(sU.ToString) - - 'Average Values over x seconds and imediately set au - For t = isinterv To MODdata.tDim Step isinterv - - 'to zero - For Each EAcomp0 In EAcomp - EmMesMW(EAcomp0) = 0 - EmSimMW(EAcomp0) = 0 - Next - - pe = 0 - nn = 0 - - For Each TCKV In MODdata.TC.TCcomponents - TCMW(TCKV.Key) = 0 - Next - - 'Aufsummieren |@@| Accumulati(Aufsummieren) - For t1 = (t - isinterv) To t - 1 - - pe += MODdata.Pe(t1) / isinterv - nn += MODdata.nn(t1) / isinterv - - For Each EAcomp0 In EAcomp - EmMesMW(EAcomp0) += DRI.EmComponents(EAcomp0).RawVals(t1) / isinterv - EmSimMW(EAcomp0) += EmComp(EAcomp0).FinalVals(t1) / isinterv - Next - - For Each TCKV In MODdata.TC.TCcomponents - TCMW(TCKV.Key) += TCKV.Value(t1) / isinterv - Next - - Next - - 'Output - s.Length = 0 - - s.Append(CStr(DRI.t0 + t - ((isinterv - 1) / 2) - 1)) - - 'Pe/nn - s.Append("," & nn) - s.Append("," & pe) - - For Each EAcomp0 In EAcomp - - 'Measurement-values - s.Append("," & EmMesMW(EAcomp0)) - - 'PHEM-value - s.Append("," & EmSimMW(EAcomp0)) - - 'Diff - If MAP.EmComponents(EAcomp0).NormID = tEmNorm.x_hPnenn Then - s.Append("," & (EmSimMW(EAcomp0) - EmMesMW(EAcomp0)) / VEH.Pnenn) - Else - s.Append("," & EmSimMW(EAcomp0) - EmMesMW(EAcomp0)) - End If - - 'Delta - If EmMesMW(EAcomp0) = 0 Then - s.Append("," & "-") - Else - s.Append("," & (EmSimMW(EAcomp0) / EmMesMW(EAcomp0)) - 1) - End If - - Next - - - 'TC - For Each TCKV In MODdata.TC.TCcomponents - s.Append("," & TCMW(TCKV.Key)) - Next - - file.WriteLine(s.ToString) - - Next - - - file.Close() - - Return True - - End Function - - -End Class - -Public Class cTC - - Public TCcomponents As Dictionary(Of tMapComp, List(Of Single)) - - Public Ppos3s As List(Of Single) - Public Pneg3s As List(Of Single) - Public Ampl3s As List(Of Single) - Public Ppos As List(Of Single) - Public Pneg As List(Of Single) - Public dP_2s As List(Of Single) - Public P10s_n10s3 As List(Of Single) - Public P40sABS As List(Of Single) - Public abs_dn2s As List(Of Single) - Public LW3p3s As List(Of Single) - Public dynV As List(Of Single) - Public dynAV As List(Of Single) - Public dynDAV As List(Of Single) - - Public Calculated As Boolean - - Public Sub Init() - Ppos3s = New List(Of Single) - Pneg3s = New List(Of Single) - Ampl3s = New List(Of Single) - Ppos = New List(Of Single) - Pneg = New List(Of Single) - dP_2s = New List(Of Single) - P10s_n10s3 = New List(Of Single) - P40sABS = New List(Of Single) - abs_dn2s = New List(Of Single) - LW3p3s = New List(Of Single) - dynV = New List(Of Single) - dynAV = New List(Of Single) - dynDAV = New List(Of Single) - - TCcomponents = New Dictionary(Of tMapComp, List(Of Single)) - - TCcomponents.Add(tMapComp.TCPpos3s, Ppos3s) - TCcomponents.Add(tMapComp.TCPneg3s, Pneg3s) - TCcomponents.Add(tMapComp.TCAmpl3s, Ampl3s) - TCcomponents.Add(tMapComp.TCdP2s, dP_2s) - TCcomponents.Add(tMapComp.TCP10sn10s3, P10s_n10s3) - TCcomponents.Add(tMapComp.TCP40sABS, P40sABS) - TCcomponents.Add(tMapComp.TCabsdn2s, abs_dn2s) - TCcomponents.Add(tMapComp.TCLW3p3s, LW3p3s) - TCcomponents.Add(tMapComp.TCdynV, dynV) - TCcomponents.Add(tMapComp.TCdynAV, dynAV) - TCcomponents.Add(tMapComp.TCdynDAV, dynDAV) - - Calculated = False - - End Sub - - Public Sub CleanUp() - TCcomponents = Nothing - Ppos3s = Nothing - Pneg3s = Nothing - Ampl3s = Nothing - Ppos = Nothing - Pneg = Nothing - dP_2s = Nothing - P10s_n10s3 = Nothing - P40sABS = Nothing - abs_dn2s = Nothing - LW3p3s = Nothing - dynV = Nothing - dynAV = Nothing - dynDAV = Nothing - Calculated = False - End Sub - - Public Sub Calc() - Dim LWzahl As Long, Pfind As Long - Dim LWja As Single - Dim Persatz As Single - Dim Ampl1 As Single - Dim Ampl2 As Single - Dim Ampl3 As Single - Dim MW_P10s As Single - Dim MW_n10s As Single - Dim MW_P40s As Single - Dim js As Int32 - Dim i As Integer - Dim iZahl As Int32 - Dim jk As Int32 - Dim xcheck As Single - - Dim maxmin(MODdata.tDim) As Single - Dim Ampl0(MODdata.tDim) As Single - - - Dim Pe As List(Of Single) - Dim nn As List(Of Single) - - Dim Pnenn As Single - - LWzahl = 0 - - Pnenn = VEH.Pnenn - - Pe = MODdata.Pe - nn = MODdata.nn - - For i = 0 To MODdata.tDim - Ppos3s.Add(0) - Pneg3s.Add(0) - Ampl3s.Add(0) - Ppos.Add(0) - Pneg.Add(0) - dP_2s.Add(0) - P10s_n10s3.Add(0) - P40sABS.Add(0) - abs_dn2s.Add(0) - LW3p3s.Add(0) - dynV.Add(0) - dynAV.Add(0) - dynDAV.Add(0) - Next - - For i = 1 To MODdata.tDim - - Pfind = 0 - 'C Lastwechsel (allgemeine Bedingung ausser bei Intervallen mit |@@| Load-cycle(lastwechsel) (general Qualification(Bedingung ) except for Intervals with - 'C Konstantfahrt: |@@| Constant-traveling: - 'C - If i = MODdata.tDim Then - LWja = 0 - Else - LWja = (Pe(i + 1) - Pe(i)) * (Pe(i) - Pe(i - 1)) - End If - 'C - 'C Damit werden Trapezfoermige Zyklen nicht als lastwechsel erkannt |@@| Thus Trapezoid-Cycles are not recognized as Load-cycle(lastwechsel) - 'C da LWje = 0. In diesem fall wird voraus der naechste Wert gesucht, |@@| since LWje = 0. In this case, search ahead of next Value, - 'C der nicht gleich Pe(jz) ist. Dieser wird anstelle von Pe(jz+1) |@@| which is not equal to Pe(jz). - 'C gesetzt: |@@| This will replace Pe(jz +1): - If i = MODdata.tDim Then - For js = i + 2 To MODdata.tDim - If (Pe(js) <> Pe(i)) Then - Persatz = Pe(js) - Pfind = 1 - Exit For - End If - Next js - If (Pfind = 1) Then - LWja = (Persatz - Pe(i)) * (Pe(i) - Pe(i - 1)) - End If - Else - If (Pe(i + 1) = Pe(i)) Then - For js = i + 2 To MODdata.tDim - If (Pe(js) <> Pe(i)) Then - Persatz = Pe(js) - Pfind = 1 - Exit For - End If - Next js - If (Pfind = 1) Then - LWja = (Persatz - Pe(i)) * (Pe(i) - Pe(i - 1)) - End If - End If - End If - - 'C - 'C lastwechsel werden nur als solche gezaehlt, wenn sie mehr als 0.05% von |@@| Load-cycles(lastwechsel) are accounted as such only if they exceed 0.05% of Pnom - 'C Pnenn betragen (sonst ist Ergebnis viel zu wackelig): |@@| otherwise Outcome is too unstable): - 'C (Lastwechsel wird gezaehlt, wenn LWja < 0) |@@| accounted as Load-cycle(lastwechsel) when LWja < 0) - 'C - If (LWja > -0.0005) Then LWja = 0.1 - 'C - 'C (1) Mittlere Amplitude vom Pe-Verlauf ("Ampl") |@@| 1) Mean Amplitude of the running(Verlauf) Pe ("Ampl") - 'C Zwischenrechnung fue Zyklusmittelwert: |@@| Intermediate calculation of Cycle-average: - 'C - If (LWja < 0) Then - LWzahl = LWzahl + 1 - maxmin(LWzahl) = Pe(i) - End If - 'C - 'C Berechnung der mittleren Amplitude in 3 Sekunden vor Emission (Ampl3s) |@@| Calculate the mean Amplitude in 3 seconds of(vor) Emissions (Ampl3s) - 'C and the number of Second-steps where Pe is 3% above the Nominal-power - 'C (LW3p3s): - LW3p3s(i) = 0 - If (i < 2) Then - Ampl3s(i) = Pe(i) - Pe(i - 1) - If (Ampl3s(i) < 0) Then Ampl3s(i) = Ampl3s(i) * (-1) - If (Ampl3s(i) >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - ElseIf (i < 3) Then - Ampl1 = Pe(i) - Pe(i - 1) - If (Ampl1 < 0) Then Ampl1 = Ampl1 * (-1) - If (Ampl1 >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - Ampl2 = Pe(i - 1) - Pe(i - 2) - If (Ampl2 < 0) Then Ampl2 = Ampl2 * (-1) - If (Ampl2 >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - Ampl3s(i) = (Ampl1 + Ampl2) / 2 - Else - Ampl1 = Pe(i) - Pe(i - 1) - If (Ampl1 < 0) Then Ampl1 = Ampl1 * (-1) - If (Ampl1 >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - Ampl2 = Pe(i - 1) - Pe(i - 2) - If (Ampl2 < 0) Then Ampl2 = Ampl2 * (-1) - If (Ampl2 >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - Ampl3 = Pe(i - 2) - Pe(i - 3) - If (Ampl3 < 0) Then Ampl3 = Ampl3 * (-1) - If (Ampl3 >= 0.03) Then LW3p3s(i) = LW3p3s(i) + 1 - Ampl3s(i) = (Ampl1 + Ampl2 + Ampl3) / 3 - End If - Next i - - - For i = 0 To MODdata.tDim - 'C - 'C (2) Change the current Engine-power (dP_2s): - 'C - If (i = 0) Then - dP_2s(i) = 0 - ElseIf (i < 2) Then - dP_2s(i) = Pe(i) - Pe(i - 1) - Else - dP_2s(i) = 0.5 * (Pe(i) - Pe(i - 2)) - End If - - Ppos(i) = Pe(i) - If (Ppos(i) <= 0) Then - Ppos(i) = 0 - End If - 'C Mittelwert 3 sec. vor Emission: |@@| Average 3 sec of(vor) Emission: - If (i >= 2) Then - Ppos3s(i) = (Ppos(i) + Ppos(i - 1) + Ppos(i - 2)) / 3 - ElseIf (i = 2) Then - Ppos3s(i) = (Ppos(i) + Ppos(i - 1)) / 2 - ElseIf (i = 1) Then - Ppos3s(i) = Ppos(i) - End If - 'C Counted only in dynamic operation: - xcheck = dP_2s(i) * dP_2s(i) - If (xcheck >= 0.0000001) Then - Ppos3s(i) = Ppos3s(i) - Else - Ppos3s(i) = 0 - End If - 'C - 'C - 'C (4) Average of the negative Engine-power ("PnegMW"): - 'C - Pneg(i) = Pe(i) - If (Pneg(i) >= 0) Then - Pneg(i) = 0 - End If - 'C Mittelwert 3 sec. vor Emission: |@@| Average 3 sec of(vor) Emission: - If (i >= 2) Then - Pneg3s(i) = (Pneg(i) + Pneg(i - 1) + Pneg(i - 2)) / 3 - ElseIf (i = 2) Then - Pneg3s(i) = (Pneg(i) + Pneg(i - 1)) / 2 - ElseIf (i = 1) Then - Pneg3s(i) = Pneg(i) - End If - 'C Counted only in dynamic operation: - xcheck = dP_2s(i) * dP_2s(i) - If (xcheck >= 0.0000001) Then - Pneg3s(i) = Pneg3s(i) - Else - Pneg3s(i) = 0 - End If - - Next i - - 'C - 'C - 'C Berechnung der absoluten Dynamikkenngroessen: |@@| Calculation of absolute Dynamic-map sizes: - 'C Addition of Pe Amplitudes (1 Pe-Value - 'C is counted also for Maxima and for Minima Amplitudes ) - 'C First Second: - If (LWzahl >= 1) Then - - 'C - 'C 2. Second to End: - For i = 2 To LWzahl - Ampl0(i) = maxmin(i) - maxmin(i - 1) - 'C Absolute-value: - If (Ampl0(i) < 0) Then - Ampl0(i) = Ampl0(i) * (-1) - End If - - Next i - 'C - Else - - End If - 'C - For i = 0 To MODdata.tDim - 'C - 'C - 'C (8) WM_n10sn**3 * MW_P_10s: - 'c - MW_P10s = 0 - MW_n10s = 0 - iZahl = 0 - If (i < 9) Then - For jk = 0 To i - MW_P10s = MW_P10s + Pe(jk) - MW_n10s = MW_n10s + (nn(jk) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / VEH.nNenn - iZahl = iZahl + 1 - Next jk - MW_P10s = MW_P10s / iZahl - MW_n10s = MW_n10s / iZahl - 'c - Else - For jk = (i - 9) To i - MW_P10s = MW_P10s + Pe(jk) - MW_n10s = MW_n10s + (nn(jk) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / VEH.nNenn - Next jk - MW_P10s = MW_P10s * 0.1 - MW_n10s = MW_n10s * 0.1 - 'c - End If - 'C - xcheck = dP_2s(i) * dP_2s(i) - If (xcheck >= 0.0000001) Then - P10s_n10s3(i) = MW_n10s ^ 3 * MW_P10s - Else - P10s_n10s3(i) = 0 - End If - 'c - 'C (9) MW_P40sABS: - 'c - MW_P40s = 0 - iZahl = 0 - If (i < 39) Then - For jk = 0 To i - MW_P40s = MW_P40s + Pe(jk) - iZahl = iZahl + 1 - Next jk - MW_P40s = MW_P40s / iZahl - Else - For jk = (i - 39) To i - MW_P40s = MW_P40s + Pe(jk) - Next jk - MW_P40s = MW_P40s * 0.025 - End If - 'C - P40sABS(i) = Pe(i) - MW_P40s - 'c - 'C (9) MW_abs_dn2s: - 'c - If (i < 2) Then - abs_dn2s(i) = 0 - Else - abs_dn2s(i) = 0.5 * (nn(i) - nn(i - 2)) - abs_dn2s(i) = Math.Abs(abs_dn2s(i)) - End If - - Next i - - 'Speed/Accel-dependent parameters only when not Eng-Only - If Not GEN.VehMode = tVehMode.EngineOnly Then - For i = 0 To MODdata.tDim - dynV(i) = MODdata.Vh.V(i) - dynAV(i) = MODdata.Vh.V(i) * MODdata.Vh.a(i) - If (i >= 1) Then - dynDAV(i) = (dynAV(i) - dynAV(i - 1)) / 1.0 - Else - dynDAV(i) = 0 - End If - Next i - End If - - 'Dynamic-parameters as the Differential of Dynamics of the Map - ' ...was here before. Now in its own method because of KF-creation invalidity - - Calculated = True - - End Sub - - 'Dynamic parameters as the Differential of Dynamics in the Map: - Public Sub CalcDiff() - Dim i As Integer - - For i = 0 To MODdata.tDim - Ampl3s(i) = Ampl3s(i) - MODdata.Em.EmDefComp(tMapComp.TCAmpl3s).RawVals(i) - P40sABS(i) = P40sABS(i) - MODdata.Em.EmDefComp(tMapComp.TCP40sABS).RawVals(i) - LW3p3s(i) = LW3p3s(i) - MODdata.Em.EmDefComp(tMapComp.TCLW3p3s).RawVals(i) - Pneg3s(i) = Pneg3s(i) - MODdata.Em.EmDefComp(tMapComp.TCPneg3s).RawVals(i) - Ppos3s(i) = Ppos3s(i) - MODdata.Em.EmDefComp(tMapComp.TCPpos3s).RawVals(i) - abs_dn2s(i) = abs_dn2s(i) - MODdata.Em.EmDefComp(tMapComp.TCabsdn2s).RawVals(i) - P10s_n10s3(i) = P10s_n10s3(i) - MODdata.Em.EmDefComp(tMapComp.TCP10sn10s3).RawVals(i) - dP_2s(i) = dP_2s(i) - MODdata.Em.EmDefComp(tMapComp.TCdP2s).RawVals(i) - dynV(i) = dynV(i) - MODdata.Em.EmDefComp(tMapComp.TCdynV).RawVals(i) - dynAV(i) = dynAV(i) - MODdata.Em.EmDefComp(tMapComp.TCdynAV).RawVals(i) - dynDAV(i) = dynDAV(i) - MODdata.Em.EmDefComp(tMapComp.TCdynDAV).RawVals(i) - Next - - End Sub - - - End Class - -''' <summary> -''' Class for calculating the Exhaust-temperatures -''' </summary> -''' <remarks></remarks> -Public Class cEXS - - Private TempMod() As cTempMod - Private ModAnz As Int16 - - '! Felder für Größen aus PHEM Hauptprogramm |@@| Fields for Quantities from PHEM main-program - Private vehspe(izykt) As Single - Private nnorm As List(Of Single) - Private p_norm As List(Of Single) - Private rpm As List(Of Single) - Private fc As List(Of Single) - Private lambda As List(Of Single) - Private tqs As List(Of Single) - Private p_rated As Single - - Private Pi_ As Single, R_air As Single, R_exh As Single, Pr_exh As Single, St_Boltz As Single - Private cp_steel As Single, rho_steel As Single, hc_soot As Single - Private H_reak_co As Single, H_reak_nox As Single, H_reak_hc As Single - Private M_co As Single, M_nox As Single, M_hc As Single - Private n_iter As Long, t_amb As Single, iter_mode As Boolean, iter_pos As Int16, iter_tol As Single - - Private DatExs As New cFile_V3 'PHEM inputfile with definition of exhaust system structure - Private DatTer As New cFile_V3 'PHEM resultfile with 1Hz Temperatures in Exhaust System - Private DatPath As New cFile_V3 'PHEM-DEV inputfile with paths for inputdata - Private DatPhe As New cFile_V3 'PHEM-DEV inputfile with data from PHEM main program - - 'variables for coolant simulation - Private surf_engine As Single, surf_temp_eng As Single, eng_mass1 As Single, eng_mass2 As Single - Private h_cap_mass1 As Single, h_cap_mass2 As Single, alpha_A1 As Single, alpha_A2 As Single - Private ratio_h_to_m1 As Single, ratio_h_to_m2 As Single, t_coolant As Single, t_start_m1_m2 As Single - Private t_mass1(izykt) As Single 'temperatur für 1. künstl. masse - Private t_mass2(izykt) As Single 'temperatur für 2. künstl. masse - Private qp_coolant1(izykt) As Single 'wärmestrom zur 1. masse - Private qp_coolant2(izykt) As Single 'wärmestrom zur 2. masse - Private qp_loss1(izykt) As Single 'wärmestrom 1. masse -> kühlsystem - Private qp_loss2(izykt) As Single 'wärmestrom 2. masse -> kühlsystem - Private qp_loss(izykt) As Single 'gesamtwärmestrom ins kühlsystem - Private qp_out(izykt) As Single 'wärmestrom nach außen (verlust der nicht ins kühlsystem geht) - - Private DatCsy As New cFile_V3 'input file for coolant simulation - - Private PathDev As String = "" - Private PathPhe As String = "" - Private PathTer As String = "" - - Public mpexh(izykt) As Single - Public eRawNOx(izykt) As Single - - Private ExsErg As System.IO.StreamWriter - Private ExsErgPath As String - - Public Xis(100) As Single - Public Yis(100) As Single - - '**** Reading about tgas from .npi (Project HERO) **** - ' => überschreibt tgas(jz) aus HtMass() |@@| overwrites tgas(jz) over(aus) HtMass() - ' Luz/Rexeis 16.05.2011 - Private t_gas1npi() As Single - Private t_gas2npi() As Single - '*************************************************** - - Private Function hc_exh(ByVal t_exh As Single) As Single 'Wärmeleitfähigkeit Abgas (Lambda, Druck vernachlässigt) - hc_exh = 0.0245 + (0.0000609 * t_exh) - End Function - - - Private Function kv_exh(ByVal t_exh As Single) As Single 'kinematische Viskosität Abgas (Lambda, Druck vernachlässigt) - kv_exh = 0.00000598 + (0.000000146 * t_exh) - End Function - - ''' <summary> - ''' Main-routine for EXS module - ''' </summary> - ''' <remarks></remarks> - Public Function Exs_Main() As Boolean 'aufzurufen im PHEM-Ablauf nach Dynamikkorrektur und vor Summenbildung - '! Calling from Exs_Main(true) -> Developer Version without PHEM main-program - - Dim ii As Long, ij As Long, Diff As Single - Dim t1 As Long - - '! Fields for Quantities from exs-file - Dim iMod As Int16, iSchad As Int16 - Dim efm_mode As Int16, cap_norm As Single, t_inl As Single, p_rel_inl As Single, fp4_efm As Single - Dim dummy As String = "" - Dim line1 As String, line2 As String - - Dim mpexh_fc As Single, mpexh_mot As Single, cap As Single, Vpexh_mot As Single, zaehler As Single, nenner As Single - - Dim eNOxOK As Boolean - Dim eHCOK As Boolean - Dim eCOOK As Boolean - Dim ePMOK As Boolean - Dim eEk1OK As Boolean - Dim eEk2OK As Boolean - - Dim jz As Integer - Dim Em0 As List(Of Single) - Dim MsgSrc As String - - Dim LambdaGegJa As Boolean - Dim HC As List(Of Single) - Dim NOx As List(Of Single) - Dim CO As List(Of Single) - - Dim qp_coolant As List(Of Single) = Nothing - - - MsgSrc = "EmCalc/EXS/Main" - - '------------------------------------------------------------------------------------------ - 'General Constants - Pi_ = 3.1416 - St_Boltz = 0.0000000567 'Stephan-Boltzmann Konstante - R_air = 287.0 '!Gaskonstante Luft [J/(kg*K)] - '!Exhaust Physical-values: - '!insensitive vs. lambda, see "Stoffwerte_vollständigeVerbrennung_neu.xls" - R_exh = 288.2 '!Gaskonstante Abgas [J/(kg*K)] - 'cp_exh = 1054.0 '!Exhaust heat-capacity [J/(kg*K)] is no longer used because it is now calculated directly in Abh from T and Lambda - Pr_exh = 0.73 '!Prandtlzahl [-] - '! - cp_steel = 460.0 '!Wärmekapazität Edelstahl [J/(kg*K)] - rho_steel = 7860.0 '!Dichte Edelstahl [[kg/m3] - hc_soot = 0.15 '!Wärmeleitfähigkeit Russ [W/(mK)] "in loser Schichtung" - '!Note: Average-value from searching the Internet, found no information in literature - '!kalibriert anhand Test an Thermoelement unter Annahme von Schichtdicke 0.1mm |@@| calibrated based on Test Thermocouple assuming Coating-thickness(Schichtdicke) 0.1mm - - 'Reaktionsenthalpien in J/mol |@@| Reaction-enthalpies in J/mol - H_reak_co = 283200.0 - H_reak_nox = 1928000.0 - H_reak_hc = 483000.0 - - 'Molecular-weights - M_co = 28.0 - M_nox = 46.0 - M_hc = 42.0 - - 'Compatibility with old EXS-structure Introduced before the new Concept for Em-components with cMap-class tMAP-class, etc. - eNOxOK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.NOx) - eHCOK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.HC) - eCOOK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.CO) - ePMOK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.PM) - eEk1OK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.PN) - eEk2OK = MODdata.Em.EmDefComp.ContainsKey(tMapComp.NO) - - 'References for Emissions: The given, if available, otherwise the calculated - If DRI.EmComponents.ContainsKey(sKey.MAP.HC) Then - HC = DRI.EmComponents(sKey.MAP.HC).FinalVals - Else - HC = MODdata.Em.EmDefComp(tMapComp.HC).FinalVals - End If - - If DRI.EmComponents.ContainsKey(sKey.MAP.NOx) Then - NOx = DRI.EmComponents(sKey.MAP.NOx).FinalVals - Else - NOx = MODdata.Em.EmDefComp(tMapComp.NOx).FinalVals - End If - - If DRI.EmComponents.ContainsKey(sKey.MAP.CO) Then - CO = DRI.EmComponents(sKey.MAP.CO).FinalVals - Else - CO = MODdata.Em.EmDefComp(tMapComp.CO).FinalVals - End If - - t1 = MODdata.tDim - - 'Dimensioning: - ReDim vehspe(t1) - - - If GEN.CoolantsimJa Then - ReDim qp_coolant1(t1) - ReDim qp_coolant2(t1) - ReDim qp_loss1(t1) - ReDim qp_loss2(t1) - ReDim qp_loss(t1) - ReDim qp_out(t1) - ReDim t_mass1(t1) - ReDim t_mass2(t1) - End If - - - - n_iter = 0 'Zählvariable für Iterationen zur Berechnung der zyklusrepräsentativen Starttemperaturen - - 'Übergabe der relevanten Größen aus dem PHEM Hauptprogramm |@@| Return of the relevant Quantities from(aus) the PHEM main-program - 'Read in DEV directly from the *. phe file - - PathTer = MODdata.ModOutpName & ".ter" 'Left(JobFile, Len(JobFile) - 4) & ".ter" - p_rated = VEH.Pnenn - - For jz = 0 To t1 - If DRI.Vvorg Then - vehspe(jz) = MODdata.Vh.V(jz) * 3.6 - Else - vehspe(jz) = 0 - End If - Next jz - - fc = MODdata.Em.EmDefComp(tMapComp.FC).FinalVals - nnorm = MODdata.nn - p_norm = MODdata.Pe - rpm = MODdata.nU - tqs = MODdata.Em.EmDefComp(tMapComp.ExhTemp).FinalVals - - 'Lambda - If MAP.EmDefRef.ContainsKey(tMapComp.Lambda) Then - LambdaGegJa = True - lambda = MODdata.Em.EmDefComp(tMapComp.Lambda).FinalVals - Else - LambdaGegJa = False - 'Wird weiter unten belegt weil mpexh vorhanden sein muss |@@| It is allocated below because there must be further mpexh - lambda = New List(Of Single) - End If - - '------------------------------------------------------------------------------------------ - 'Begin readning exs-file - If Not DatExs.OpenRead(GEN.PathExs) Then - WorkerMsg(tMsgID.Err, "Failed to open file '" & GEN.PathExs & "'!", MsgSrc) - DatExs = Nothing - Return False - End If - - ModAnz = CShort(DatExs.ReadLine(0)) - t_amb = CSng(DatExs.ReadLine(0)) - iter_mode = CBool(DatExs.ReadLine(0)) - iter_pos = CShort(DatExs.ReadLine(0)) - iter_tol = CSng(DatExs.ReadLine(0)) - efm_mode = CShort(DatExs.ReadLine(0)) - cap_norm = CSng(DatExs.ReadLine(0)) - t_inl = CSng(DatExs.ReadLine(0)) - p_rel_inl = CSng(DatExs.ReadLine(0)) - 'dummy = DatExs.ReadLine(0) 'old dummy line: caution for exs-file compatibility - 'dummy = DatExs.ReadLine(0) - 'dummy = DatExs.ReadLine(0) - fp4_efm = CSng(DatExs.ReadLine(0)) - - cap = cap_norm * p_rated 'Hubraum in [liter] - - 'Initialize the respective Number of Modules - ReDim TempMod(ModAnz) - For iMod = 1 To ModAnz - TempMod(iMod) = New cTempMod(iMod, Me) - Next - - 'Reading of the Data-blocks for each Module - For iMod = 1 To ModAnz - If Not TempMod(iMod).Read(DatExs) Then 'Dabei werden auch KonvMods initialisiert & Fileköpfe der entsprechenden Ausgabefiles geschrieben - 'Error-message in TempMod(iMod).Read(DatExs) - DatExs.Close() - DatExs = Nothing - Return False - End If - Next - - DatExs.Close() - 'End reading exs-file - '------------------------------------------------------------------------------------------ - - If GEN.CoolantsimJa Then - 'Beginning reading csy-file - If Not DatCsy.OpenRead(GEN.CoolantSimPath) Then - WorkerMsg(tMsgID.Err, "Failed to open file '" & GEN.CoolantSimPath & "'!", MsgSrc) - Return False - End If - - 't_amb_coolant = ... - surf_engine = CSng(DatCsy.ReadLine(0)) 'Gesamtoberfläche Motor - surf_temp_eng = CSng(DatCsy.ReadLine(0)) 'Oberflächentemperatur Motor - eng_mass1 = CSng(DatCsy.ReadLine(0)) 'Masse der 1. künstl. Zwischenmasse - eng_mass2 = CSng(DatCsy.ReadLine(0)) 'Masse der 2. künstl. Zwischenmasse - h_cap_mass1 = CSng(DatCsy.ReadLine(0)) 'Wärmekapazität 1. Masse - h_cap_mass2 = CSng(DatCsy.ReadLine(0)) 'Wärmekapazität 2. Masse - alpha_A1 = CSng(DatCsy.ReadLine(0)) 'Wärmeübergangskoeffizient * Oberfläche 1 - alpha_A2 = CSng(DatCsy.ReadLine(0)) 'Wärmeübergangskoeffizient * Oberfläche 2 - ratio_h_to_m1 = CSng(DatCsy.ReadLine(0)) 'Anteil des Wärmestroms (ins Kühlsystem aus Kennfeld) in Masse 1 - ratio_h_to_m2 = CSng(DatCsy.ReadLine(0)) 'Anteil des Wärmestroms (ins Kühlsystem aus Kennfeld) in Masse 2 - t_coolant = CSng(DatCsy.ReadLine(0)) 'Temperatur Kühlmittel (wird hier als konstant angenommen) - t_start_m1_m2 = CSng(DatCsy.ReadLine(0)) 'Starttemperatur für Masse 1 und 2 - - DatCsy.Close() - 'End reading csy-file - '------------------------------------------------------------------------------------------ - End If - - - - - '------------------------------------------------------------------------------------------ - - -lb100: 'Rücksprunglabel für iterativen Berechnungsmodus - '------------------------------------------------------------------------------------------ - 'Calculation loop: Per Time-step / per Module: 1. Temperatures, 2. Conversions - While True - 'Display per-second Results on each iteration Results - If Not (PHEMmode = tPHEMmode.ModeBATCH) Or Cfg.ModOut Then - - ' Write Header *.ter - DatTer.OpenWrite(PathTer, ",") - DatTer.WriteLine("result-file for temperatures in the exhaust system") - DatTer.WriteLine("VECTO " & VECTOvers) - line1 = "time,vehicle speed,nnorm,P_norm,rpm,fuel consumption,lambda,m_p exhaust,ta_41_qs" - line2 = "[s],[km/h],[-],[-],[min-1],[g/h],[-],[kg/s],[°C]" - For ii = 1 To ModAnz - If TempMod(ii).TgasGegJa Then - line1 = line1 & ",tm_" & ii & "_output" & ",ttc_" & ii & "_output" & ",tgas_" & ii & "_output" - Else - line1 = line1 & ",tm_" & ii & ",ttc_" & ii & ",tgas_" & ii - End If - line2 = line2 & ",[°C],[°C],[°C]" - Next - line1 = line1 & ",Q_p coolant" - line2 = line2 & ",[W]" - - DatTer.WriteLine(line1) - DatTer.WriteLine(line2) - - ' Write the Header for KonvMods - For ii = 1 To ModAnz - If TempMod(ii).ModTyp = 1 Or TempMod(ii).ModTyp = 2 Then - TempMod(ii).KonvMod.Header() - End If - Next - - End If - - - 'Start-values ​​for Cooling-system simulation: - t_mass1(0) = t_start_m1_m2 - t_mass2(0) = t_start_m1_m2 - - - 'Heat transfer into the Cooling-system (Map) - If GEN.CoolantsimJa Then - If MODdata.Em.EmDefComp.ContainsKey(tMapComp.Qp_coolant) Then - qp_coolant = MODdata.Em.EmDefComp(tMapComp.Qp_coolant).FinalVals - Else - WorkerMsg(tMsgID.Err, "qp_coolant not found!", MsgSrc) - Return False - End If - - End If - - - - For jz = 0 To t1 - - 'Cooling-System Simulation - If GEN.CoolantsimJa Then - 'Heat inputs in Masses 1 and 2 - qp_coolant1(jz) = ratio_h_to_m1 * qp_coolant(jz) - qp_coolant2(jz) = ratio_h_to_m2 * qp_coolant(jz) - - 'The Heat-transfer Mass 1 and 2 for Cooling -system - qp_loss1(jz) = alpha_A1 * (t_mass1(jz) - t_coolant) - qp_loss2(jz) = alpha_A2 * (t_mass2(jz) - t_coolant) - - 'Bulk-temperatures for the next Time-step - If jz <> t1 Then - t_mass1(jz + 1) = t_mass1(jz) + (qp_coolant1(jz) - qp_loss1(jz)) / (eng_mass1 * h_cap_mass1) - t_mass2(jz + 1) = t_mass2(jz) + (qp_coolant2(jz) - qp_loss2(jz)) / (eng_mass2 * h_cap_mass2) - End If - - 'Heat-loss to the outside - qp_out(jz) = 0.21 * vehspe(jz) * surf_engine * (surf_temp_eng - t_amb) - - 'Total Heat-input into the Cooling-system (Output value of the simulation) - qp_loss(jz) = qp_loss1(jz) + qp_loss2(jz) - qp_out(jz) - End If - - - 'EXS Simulation - If MODdata.EngState(jz) = tEngState.Stopped Then - mpexh(jz) = 0 - Else - If efm_mode = 0 Then - 'Calculation of the Exhaust-gas-flow from a given Fuel-consumption and lambda - 'Permitted only for engines without EGR - 'Unit mpexh ....... [kg/s] - 'Unit Vpexh ....... [m3/s] - 'Case 1: Calculation of Consumption and lambda - mpexh_fc = ((14.7 * lambda(jz)) + 1) * fc(jz) / 3600000 - '!Case 2: Calculation of pumped Airflow through engine - Vpexh_mot = ((cap / 1000) / 2) * (rpm(jz) / 60) - zaehler = ((1 + (p_rel_inl / 1000)) * 100000) * Vpexh_mot - nenner = (R_air * (t_inl + 273.15)) - mpexh_mot = zaehler / nenner - mpexh(jz) = Math.Max(mpexh_fc, mpexh_mot) - ElseIf efm_mode = 1 Then - 'Missing: Methodology for Mass-flow calculation for EGR Engines BMW HERO Project - mpexh(jz) = MODdata.Em.EmDefComp(tMapComp.MassFlow).FinalVals(jz) - Else - WorkerMsg(tMsgID.Err, "Ungültige Auswahl für Abgasmassenstromberechnung", MsgSrc) - Return False - End If - End If - - 'Calculate Lambda if not explicitly given - If Not LambdaGegJa Then - If fc(jz) < 1 Then - lambda.Add(1000) - Else - lambda.Add((mpexh(jz) - fc(jz) / 3600000) / (14.6 * fc(jz) / 3600000)) - End If - End If - - '------------------------------------------------------------------------------------------ - '-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!- - '------------------------------------------------------------------------------------------ - - 'The First Module in the Exhausts-system may not be a catalytically active Element, - 'therefore, emissions are always equal to the untreated emissions from the PHEM main-program - If eNOxOK Then TempMod(1).eEmKomp(2, jz) = NOx(jz) - If eHCOK Then TempMod(1).eEmKomp(3, jz) = HC(jz) - If eCOOK Then TempMod(1).eEmKomp(4, jz) = CO(jz) - If ePMOK Then TempMod(1).eEmKomp(5, jz) = MODdata.Em.EmDefComp(tMapComp.PM).FinalVals(jz) - If eEk1OK Then TempMod(1).eEmKomp(6, jz) = MODdata.Em.EmDefComp(tMapComp.PN).FinalVals(jz) - If eEk2OK Then TempMod(1).eEmKomp(7, jz) = MODdata.Em.EmDefComp(tMapComp.NO).FinalVals(jz) - - For iMod = 1 To ModAnz - TempMod(iMod).HtMass(jz) 'Berechnung WÜ zwischen Abgas und 0d-Massenelement - TempMod(iMod).HtTc(jz) 'Berechnung WÜ zwischen Abgas und Thermoelement - If TempMod(iMod).ModTyp = 1 Or TempMod(iMod).ModTyp = 2 Then 'SCR oder 3-W Kat - - TempMod(iMod).KonvMod.Konv(jz) 'Berechnung Konvertierung der Emissionskomponenten - - If (TempMod(iMod).ModTyp = 2) Then - 'Calculate Qp_reak: Mass-flow-rate * Conversion * Reactive-enthalpy / molar-mass - TempMod(iMod).Qp_reak(jz) = CO(jz) / 3600 * TempMod(iMod).KonvMod.KonvRate(tMapComp.CO)(jz) * H_reak_co / M_co + _ - HC(jz) / 3600 * TempMod(iMod).KonvMod.KonvRate(tMapComp.HC)(jz) * H_reak_hc / M_hc + _ - NOx(jz) / 3600 * TempMod(iMod).KonvMod.KonvRate(tMapComp.NOx)(jz) * H_reak_nox / M_nox - 'Compute Pollutant-components - For iSchad = 2 To 8 - TempMod(iMod).eEmKomp(iSchad, jz) = TempMod(iMod - 1).eEmKomp(iSchad, jz) - Next iSchad - 'Conversion of NOx, CO, HC -> old value * (1-conversion-rate) - TempMod(iMod).eEmKomp(2, jz) = TempMod(iMod - 1).eEmKomp(2, jz) * (1 - TempMod(iMod).KonvMod.KonvRate(tMapComp.NOx)(jz)) - TempMod(iMod).eEmKomp(3, jz) = TempMod(iMod - 1).eEmKomp(3, jz) * (1 - TempMod(iMod).KonvMod.KonvRate(tMapComp.HC)(jz)) - TempMod(iMod).eEmKomp(4, jz) = TempMod(iMod - 1).eEmKomp(4, jz) * (1 - TempMod(iMod).KonvMod.KonvRate(tMapComp.CO)(jz)) - TempMod(iMod).eEmKomp(7, jz) = TempMod(iMod - 1).eEmKomp(7, jz) * (1 - TempMod(iMod).KonvMod.KonvRate(tMapComp.NO)(jz)) - End If - - - If Not (PHEMmode = tPHEMmode.ModeBATCH) Or Cfg.ModOut Then - TempMod(iMod).KonvMod.Write(jz) 'Sekündliche Ausgabe - End If - - - Else - 'Falls Modul kein Konv-Element hat ändert sich nix (Anmerkung: Modul 1 hat immer ModTyp0) |@@| If Module has no Conv-element changes nothing (Note: Module 1 has always ModTyp0) - If iMod > 1 Then - - TempMod(iMod).Qp_reak(jz) = 0 - For iSchad = 2 To 8 - TempMod(iMod).eEmKomp(iSchad, jz) = TempMod(iMod - 1).eEmKomp(iSchad, jz) - Next iSchad - - End If - End If - - Next - - 'Write Line in *.ter. - If Not (PHEMmode = tPHEMmode.ModeBATCH) Or Cfg.ModOut Then - line1 = jz & "," & vehspe(jz) & "," & nnorm(jz) & "," & p_norm(jz) & "," & rpm(jz) & "," & fc(jz) & "," & lambda(jz) & "," & mpexh(jz) & "," & tqs(jz) - For ij = 1 To ModAnz - line1 = line1 & "," & TempMod(ij).t_m(jz) & "," & TempMod(ij).t_tc(jz) & "," & TempMod(ij).t_gas(jz) - Next - If GEN.CoolantsimJa Then - line1 = line1 & "," & qp_loss(jz) - End If - DatTer.WriteLine(line1) - End If - - '------------------------------------------------------------------------------------------ - '-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!- - '------------------------------------------------------------------------------------------ - - Next - 'End Calculation-loop - '---------------------------------------------------------------------------------------------- - - 'Close all second-by-second Result-files - If Not (PHEMmode = tPHEMmode.ModeBATCH) Or Cfg.ModOut Then - DatTer.Close() - For ii = 1 To ModAnz - If TempMod(ii).ModTyp = 1 Or TempMod(ii).ModTyp = 2 Then - TempMod(ii).KonvMod.Close() - End If - Next - End If - - '---------- Abfrage Rücksprung im iterativen Berechnungsmodus für Starttemp ------------------- |@@| Query return in the iterative Calculation-mode for Starttemp ------------------- - If (iter_mode = True) Then - 'Abbruchbedingung: Temperatur des Massenelementes "t_m" des in "iter_pos" spezifizierten Moduls |@@| Termination-condition: Temperature of the Mass-elements "t_M" in the "iter_pos" specified module - 'am Beginn und am Ende des Zyklus innerhalb vorzugebender Bandbreite "iter_tol" |@@| at the Beginning and End of the Cycle within vorzugebender bandwidth "iter_tol" - Diff = Math.Abs(TempMod(iter_pos).t_m(t1) - TempMod(iter_pos).t_m(0)) - If (Diff > iter_tol) Then - n_iter = n_iter + 1 - For ii = 1 To ModAnz - TempMod(ii).t_m(0) = TempMod(ii).t_m(t1) - Next ii - Else - Exit While - End If - Else - Exit While - End If - End While - '!------------------------------------------------------------------------ - - If eNOxOK Then - MODdata.Em.EmDefComp(tMapComp.NOx).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(2, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.NOx).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.NOx).FinalVals = Em0 - End If - - If eHCOK Then - MODdata.Em.EmDefComp(tMapComp.HC).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(3, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.HC).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.HC).FinalVals = Em0 - End If - - If eCOOK Then - MODdata.Em.EmDefComp(tMapComp.CO).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(4, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.CO).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.CO).FinalVals = Em0 - End If - - If ePMOK Then - MODdata.Em.EmDefComp(tMapComp.PM).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(5, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.PM).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.PM).FinalVals = Em0 - End If - - If eEk1OK Then - MODdata.Em.EmDefComp(tMapComp.PN).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(6, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.PN).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.PN).FinalVals = Em0 - End If - - If eEk2OK Then - MODdata.Em.EmDefComp(tMapComp.NO).InitAT() - Em0 = New List(Of Single) - For jz = 0 To t1 - Em0.Add(TempMod(ModAnz).eEmKomp(7, jz)) - Next - MODdata.Em.EmDefComp(tMapComp.NO).ATVals = Em0 - MODdata.Em.EmDefComp(tMapComp.NO).FinalVals = Em0 - End If - - '--- Write Output-file *. Ter --------------------------------------------- ------------- - - '--- End wrtting Output-file *. ter -------------------------------------------- --------- - - - 'Clean up - TempMod = Nothing - - Return True - - End Function - - - ''' <summary> - ''' Class for Temperature-modules - ''' </summary> - ''' <remarks>Type of module is defined with Mod\typ </remarks> - Class cTempMod - Dim Id As Int16 - Public ModTyp As Int16, PathConv As String, m_norm As Single, heat_cap_m As Single, t_m_init As Single 'Normierte Masse, Wärmekapazität Masse, Starttemp. Masse - Public ext_surface As Single, emissivity As Single, A_fak As Single, B_fak As Single, C_fak As Single 'Oberfl. außen, Emissivität der Masse, Faktoren für Wärmeübergang - Public T_relation_k As Single, T_relation_d As Single - Public FlowTyp As Int16, cht_norm As Single, crad_norm As Single, cs_norm As Single - Public p_rel_bk As Single, d_tc As Single, d_soot As Single - Public t_gas() As Single 'Temperatur Abgas an Stelle Thermoelement - Public t_m() As Single 'Temperatur Masse - Public t_tc() As Single 'Temperatur Thermoelement - Public Qp_exh() As Single 'Wärmestrom Masse -> Abgas - Public Qp_loss() As Single 'Wärmestrom Masse -> Umgebung - Public Qp_reak() As Single 'Wärmestrom Reaktion -> Masse - Public eEmKomp(,) As Single 'Emissionskomponenten - - Private T_m_Abk As cAbkKurv - Private T_tc_Abk As cAbkKurv - Private NoCoolDown As Boolean - - Public mass As Single, density As Single, cs_pipe As Single 'Masse, Dichte, Querschnitt - Public d_pipe As Single, l_pipe As Single, thickness_pipe As Single, Cht As Single, Crad As Single 'Durchmesser, Länge, Dicke, Wärmeübergang Konvektion und Strahlung - - Public cl_cyl As Single, cs_tc As Single, m_tc As Single, surf_tc As Single 'Thermoelement: char. Länge, Querschnittsfl., Masse, Oberfläche - - Private dummy As String = "" - Private ii As Long - Private a As Single, b As Single - - Public KonvMod As KonvInterf - - Private myEXS As cEXS - - Private bTgasGegJa As Boolean 'True wenn Abgastemperatur für Modul vorgegeben (Seiteneingang) - Private TgasGeg As List(Of Single) 'sekündliche Abgastemperatur für jeweiliges Modul aus npi bzw. dri - - - Public ReadOnly Property TgasGegJa As Boolean - Get - Return bTgasGegJa - End Get - End Property - - Public Sub New(ByVal IDval As Int16, ByRef EXSref As cEXS) - Id = IDval - myEXS = EXSref - ReDim t_gas(MODdata.tDim) - ReDim t_m(MODdata.tDim) - ReDim t_tc(MODdata.tDim) - ReDim Qp_exh(MODdata.tDim) - ReDim Qp_loss(MODdata.tDim) - ReDim Qp_reak(MODdata.tDim) - ReDim eEmKomp(8, MODdata.tDim) - T_m_Abk = New cAbkKurv - T_tc_Abk = New cAbkKurv - TgasGeg = Nothing - End Sub - - ''' <summary> - ''' Reading the EXS file - ''' </summary> - ''' <param name="Datei">Dateihandler |@@| param name="Datei"> File-handler </param> - ''' <remarks></remarks> - Public Function Read(ByVal Datei As cFile_V3) As Boolean - Dim TmAbkPfad As String = "" - Dim TtcAbkPfad As String = "" - Dim MsgSrc As String - - MsgSrc = "EmCalc/EXS/Temp/Read" - - NoCoolDown = False - bTgasGegJa = False - - If Id = 1 Then - ModTyp = 0 - Else - ModTyp = CShort(Datei.ReadLine(0)) - End If - - 'Path to Conversion-rates for Modules with Conversion - If ModTyp = 1 Or ModTyp = 2 Then - PathConv = Datei.ReadLine(0) - PathConv = fFileRepl(PathConv, fPATH(GEN.PathExs)) - Else - PathConv = "" - End If - - 'Initialize the modules & Read the Parameter-files, depending on Module - Select Case ModTyp - Case 0 'nach Turbolader - m_norm = CSng(Datei.ReadLine(0)) - heat_cap_m = CSng(Datei.ReadLine(0)) - t_m_init = CSng(Datei.ReadLine(0)) - FlowTyp = CShort(Datei.ReadLine(0)) - cht_norm = CSng(Datei.ReadLine(0)) - crad_norm = CSng(Datei.ReadLine(0)) - TmAbkPfad = Datei.ReadLine(0) - cs_norm = CSng(Datei.ReadLine(0)) - p_rel_bk = CSng(Datei.ReadLine(0)) - d_tc = CSng(Datei.ReadLine(0)) - d_soot = CSng(Datei.ReadLine(0)) - TtcAbkPfad = Datei.ReadLine(0) - - Case 1 'SCR - KonvMod = New cScrMod(Id, myEXS) - KonvMod.Read(PathConv) - - m_norm = CSng(Datei.ReadLine(0)) - heat_cap_m = CSng(Datei.ReadLine(0)) - t_m_init = CSng(Datei.ReadLine(0)) - FlowTyp = CShort(Datei.ReadLine(0)) - cht_norm = CSng(Datei.ReadLine(0)) - crad_norm = CSng(Datei.ReadLine(0)) - TmAbkPfad = Datei.ReadLine(0) - cs_norm = CSng(Datei.ReadLine(0)) - p_rel_bk = CSng(Datei.ReadLine(0)) - d_tc = CSng(Datei.ReadLine(0)) - d_soot = CSng(Datei.ReadLine(0)) - TtcAbkPfad = Datei.ReadLine(0) - - Case 2 '3-Wege-Kat - KonvMod = New c3WayCatMod(Id, myEXS) - KonvMod.Read(PathConv) - - m_norm = CSng(Datei.ReadLine(0)) - heat_cap_m = CSng(Datei.ReadLine(0)) - t_m_init = CSng(Datei.ReadLine(0)) - FlowTyp = CShort(Datei.ReadLine(0)) - 'Heat-transfer factor - cht_norm = CSng(Datei.ReadLine(0)) - 'surface of exterior - ext_surface = CSng(Datei.ReadLine(0)) - 'Emissivität |@@| Emissivity - emissivity = CSng(Datei.ReadLine(0)) - 'Factors for Heat-transfer to the outside - A_fak = CSng(Datei.ReadLine(0)) - B_fak = CSng(Datei.ReadLine(0)) - C_fak = CSng(Datei.ReadLine(0)) - 'Factors for Temperature related t_katsubstrat <-> t_kat_außen - T_relation_k = CSng(Datei.ReadLine(0)) - T_relation_d = CSng(Datei.ReadLine(0)) - 'Cooling-mass curve - TmAbkPfad = Datei.ReadLine(0) - 'Normalized Cross-sectional area - cs_norm = CSng(Datei.ReadLine(0)) - 'durchschnittlicher Gegendruck |@@| average backpressure(Gegendruck) - p_rel_bk = CSng(Datei.ReadLine(0)) - 'Thermocouple Diameter - d_tc = CSng(Datei.ReadLine(0)) - d_soot = CSng(Datei.ReadLine(0)) - 'Thermocouple Cooling-curve - TtcAbkPfad = Datei.ReadLine(0) - - Case 3 'Rohrmodul - d_pipe = CSng(Datei.ReadLine(0)) - l_pipe = CSng(Datei.ReadLine(0)) - thickness_pipe = CSng(Datei.ReadLine(0)) - density = CSng(Datei.ReadLine(0)) - heat_cap_m = CSng(Datei.ReadLine(0)) - t_m_init = CSng(Datei.ReadLine(0)) - cht_norm = CSng(Datei.ReadLine(0)) - emissivity = CSng(Datei.ReadLine(0)) - 'Heat-transfer-Factors to the outside - A_fak = CSng(Datei.ReadLine(0)) - B_fak = CSng(Datei.ReadLine(0)) - TmAbkPfad = Datei.ReadLine(0) - p_rel_bk = CSng(Datei.ReadLine(0)) - d_tc = CSng(Datei.ReadLine(0)) - d_soot = CSng(Datei.ReadLine(0)) - TtcAbkPfad = Datei.ReadLine(0) - - Case 4 'SCR mit 10s Mittelwertbildung für HERO - KonvMod = New cScrMod_10sMW(Id, myEXS) - - m_norm = CSng(Datei.ReadLine(0)) - heat_cap_m = CSng(Datei.ReadLine(0)) - t_m_init = CSng(Datei.ReadLine(0)) - FlowTyp = CShort(Datei.ReadLine(0)) - cht_norm = CSng(Datei.ReadLine(0)) - crad_norm = CSng(Datei.ReadLine(0)) - TmAbkPfad = Datei.ReadLine(0) - cs_norm = CSng(Datei.ReadLine(0)) - p_rel_bk = CSng(Datei.ReadLine(0)) - d_tc = CSng(Datei.ReadLine(0)) - d_soot = CSng(Datei.ReadLine(0)) - TtcAbkPfad = Datei.ReadLine(0) - End Select - - 'Check whether Tgas given in Cycle: - If Id > 1 Then - bTgasGegJa = DRI.ExsCompDef(tExsComp.Tgas, Id) - If bTgasGegJa = True Then - TgasGeg = DRI.ExsComponents(tExsComp.Tgas)(Id) - End If - End If - - 'Entnormierungen und Berechnung weiterer Größen |@@| Normalize(Entnormierungen) and Calculating other Variables - - - If ModTyp <> 3 Then - mass = m_norm * myEXS.p_rated - cs_pipe = cs_norm * myEXS.p_rated 'Rohrquerschnitt prop. Nennleistung - d_pipe = ((4 * cs_pipe) / myEXS.Pi_) ^ 0.5 'Rohrdurchmesser in mm - Cht = cht_norm * d_pipe 'WÜ-Faktor prop. Rohrdurchmesser - Else - 'Additionally calculated parameters for Pipe-module: - ext_surface = d_pipe * 0.001 * myEXS.Pi_ * l_pipe * 0.001 'Oberfläche in m^2 - mass = ext_surface * thickness_pipe * 0.001 * density 'Masse in kg - cs_pipe = (d_pipe * 0.5) ^ 2 * myEXS.Pi_ 'Querschnitt in mm^2 - - Cht = cht_norm 'Faktor für Wärmeübergang, z.B. wg. Rohrkrümmung - End If - - If ModTyp <> 2 And ModTyp <> 3 Then - Crad = crad_norm * myEXS.p_rated 'Abstrahlung prop. Nennleistung (Begründung siehe Diss) - End If - - 'Für Strömungsberechnungen in SI-Einheiten wird Querschnittsfäche in m2 umgerechnet |@@| For Flow-calculations in SI-units is Querschnittsfäche converted into m2 - cs_pipe = cs_pipe * (0.001 ^ 2) - - 'Geometrical Quantities calculated - 'Note: it is assumed that temperature sensors are - 'centered in the Pipe - cl_cyl = (d_tc * 0.001) * myEXS.Pi_ * 0.5 'char. Länge umström Zyl - cs_tc = (((d_tc * 0.001) / 2) ^ 2) * myEXS.Pi_ 'QS-Fläche t-sensor [m2] - m_tc = cs_tc * ((d_pipe / 2) * 0.001) * myEXS.rho_steel 'Masse t_sensor [kg] - surf_tc = (d_tc * 0.001) * myEXS.Pi_ * (d_pipe * 0.001) / 2 'Oberfläche t-sensor - ' Anmerkung: Kugelkalotte an t-sensor spitze wird in der Betrachtung als |@@| Note: Ball joint on t-sensor tip is neglected - ' umströmter Zylinder vernachlässigt |@@| in the analysis of Airstream-cylinder - - 'Read Cooling-curves - If Trim(UCase(TmAbkPfad)) = sKey.NoFile Then - If myEXS.n_iter = 0 And PHEMmode = tPHEMmode.ModeSTANDARD Then WorkerMsg(tMsgID.Warn, "EXS-Module " & Id & ": No cool down curve for mass component defined. Cool down calculation disabled.", MsgSrc) - NoCoolDown = True - Else - If Not T_m_Abk.Read(TmAbkPfad) Then - If myEXS.n_iter = 0 Then WorkerMsg(tMsgID.Err, "Error while reading cool down curve " & TmAbkPfad, MsgSrc) - Return False - End If - End If - - If Not NoCoolDown Then - If TtcAbkPfad = sKey.NoFile Then - If myEXS.n_iter = 0 And PHEMmode = tPHEMmode.ModeSTANDARD Then WorkerMsg(tMsgID.Err, "EXS-Module " & Id & ": No cool down curve for thermocouple defined. Cool down calculation disabled.", MsgSrc) - NoCoolDown = True - Else - If Not T_tc_Abk.Read(TtcAbkPfad) Then - If myEXS.n_iter = 0 Then WorkerMsg(tMsgID.Err, "Error while reading cool down curve " & TtcAbkPfad, MsgSrc) - Return False - End If - End If - End If - - Return True - - End Function - - ''' <summary> - ''' Heat-transfer mass - ''' </summary> - ''' <param name="jz">Zeit</param> - ''' <remarks></remarks> - Public Sub HtMass(ByVal jz As Integer) - Dim t_gas_in As Single, t_gas_out As Single, t_gas_mid As Single, dt_m As Single - Dim t_ober As Single, t_unter As Single, t_gas_out_alt As Single - Dim delta_t As Single, delta_tin As Single, delta_tout As Single - Dim ht_exp As Single, dt_schwell As Single, dt_konv As Single - Dim vp_exh_mid As Single, ht_factor As Single, Qp_ht As Single, Qp_thd As Single, diffQp As Single, diffTein As Single - Dim Qp_loss_rad As Single, Qp_loss_konv As Single - Dim i_iter As Integer - Dim AbbruchIter As Boolean - Dim cp_exh As Single - Dim T_aussen As Single - Dim Nus_exh As Single, Re_exh As Single - - 'Setting Threshold for Precision of the Temperature-calculation (needed for iterative Calculation-mode) - dt_schwell = 0.01 - - 'Return the Inlet-temperature of the Exhaust-gas from the Module above or from the Engine - If Id = 1 Then - t_gas_in = myEXS.tqs(jz) 'Motor - Else - - If bTgasGegJa Then - t_gas_in = TgasGeg(jz) - Else - t_gas_in = myEXS.TempMod(Id - 1).t_gas(jz) 'oberhalb liegendes Modul - End If - - End If - - If FlowTyp = 0 Then - ht_exp = 0 'Laminare Strömung. Keine Abhängigkeit Wärmeübergang von Volume Flow - Else - ht_exp = 0.8 'Turbulente Strömung. Keine Abhängigkeit Wärmeübergang von Volume Flow - End If - - 'Calculation of the current Mass-temperature - If ((jz = 0) And (myEXS.n_iter = 0)) Then - t_m(jz) = t_m_init '!Sekunde 1: Temperatur auf Startwert setzen - '! bei n_iter > 0 ist bereits der Endwert der letzten Iteration zugewiesen |@@| at n_iter > 0 the Final-value is already assigned to the last Iteration - ElseIf (jz > 0) Then - dt_m = (Qp_exh(jz - 1) + Qp_loss(jz - 1) - Qp_reak(jz - 1)) / (mass * heat_cap_m) 'Reaktionswärme geht derzeit zu 100% in die Katmasse - t_m(jz) = t_m(jz - 1) - dt_m - End If - - 'Falls Motor Aus wird nach Abkühlkurve gerechnet und Methode verlassen: |@@| If Engine-OFF, wait Cooling-curve and exit method: - If MODdata.EngState(jz) = tEngState.Stopped Then - t_gas(jz) = -1 - Qp_exh(jz) = -1 - Qp_loss(jz) = -1 - myEXS.tqs(jz) = -1 - If jz > 0 Then - If NoCoolDown Then - t_m(jz) = t_m(jz - 1) - Else - t_m(jz) = T_m_Abk.Temp(t_m(jz - 1)) - End If - End If - Exit Sub - End If - - diffTein = Math.Abs(t_gas_in - t_m(jz)) - If diffTein < dt_schwell Then 'Abfrage of Temperaturdifferenz zwischen Abgas und Masse am Eintritt sehr klein -> das mag log-Algorithmus nicht und muss daher explizit abgefangen werden - - t_gas_out = 0.5 * (t_gas_in + t_m(jz)) - t_gas_mid = 0.5 * (t_gas_in + t_gas_out) - - 'Heat-capacity (see Bogdanic) - cp_exh = 144.7 * (-3 * (0.0975 + (0.0485 / myEXS.lambda(jz) ^ 0.75)) * (t_gas_mid) ^ 2 / (10 ^ 6) + 2 * (7.768 + 3.36 / (myEXS.lambda(jz) ^ 0.8)) * (t_gas_mid) / (10 ^ 4) + (4.896 + 0.464 / (myEXS.lambda(jz) ^ 0.93))) + 287.7 - Qp_exh(jz) = myEXS.mpexh(jz) * cp_exh * (t_gas_out - t_gas_in) - t_gas(jz) = t_gas_out - - Else - - i_iter = 0 - dt_konv = dt_schwell + 1 - AbbruchIter = False - - If t_gas_in > t_m(jz) Then - t_ober = t_gas_in - t_unter = t_m(jz) - Else - t_ober = t_m(jz) - t_unter = t_gas_in - End If - - 'Iteration-loop for Heat-transfer - While True - i_iter = i_iter + 1 - If i_iter > 1 Then - t_gas_out_alt = t_gas_out - End If - - t_gas_out = 0.5 * (t_ober + t_unter) 'Solver halbiert fortschreitend Intervall, in dem die Temperatur des aus der Masse austretenden Abgases sein muss - ' Termination-criterion below - - If i_iter > 1 Then - dt_konv = Math.Abs(t_gas_out - t_gas_out_alt) - End If - - 'Determining the Temperature of the Exhaust-gas at the Center of Mass ("t_gas_mid") consists of a non-linear (logarithmic) Temperature-curve(verlauf) - delta_tin = t_m(jz) - t_gas_in - delta_tout = t_m(jz) - t_gas_out - delta_t = (delta_tin - delta_tout) / Math.Log(delta_tin / delta_tout) - t_gas_mid = t_m(jz) - delta_t - - vp_exh_mid = (myEXS.mpexh(jz) * myEXS.R_exh * (t_gas_mid + 273.15)) / ((1 + (p_rel_bk / 1000)) * 100000) - - If ModTyp <> 3 Then - 'Heat-transfer Convection inside all Modules (except for Pipe) - ht_factor = myEXS.hc_exh(t_gas_mid) * ((vp_exh_mid / myEXS.kv_exh(t_gas_mid)) ^ ht_exp) - Qp_ht = Cht * ht_factor * delta_t 'Cht -> hier: Faktor für Wärmeübergang - Else - 'for Pipe-modules: - Re_exh = d_pipe * 0.001 * (vp_exh_mid / cs_pipe) / myEXS.kv_exh(t_gas_mid) 'd_pipe in m - 'Nusselt Number: Density = 345/t_gas_mid, Term in Parenthesis: mu_Rohr / mu_Mitte - Nus_exh = 0.027 * Re_exh ^ 0.8 * myEXS.Pr_exh ^ 0.333 * ((myEXS.kv_exh(t_gas_mid) * 345 / t_gas_mid) / (myEXS.kv_exh(t_m(jz)) * 345 / t_m(jz))) ^ 0.14 - 'Heat-transfer (Convection inside) d_pipe, in m: char. Length - Qp_ht = Cht * Nus_exh * ext_surface * (myEXS.hc_exh(t_gas_mid) / (d_pipe * 0.001)) * delta_t 'Cht -> hier: Faktor für Rohrkrümmung - End If - - 'Heat-capacity (see Bogdanic) - cp_exh = 144.7 * (-3 * (0.0975 + (0.0485 / myEXS.lambda(jz) ^ 0.75)) * (t_gas_mid) ^ 2 / 10 ^ 6 + 2 * (7.768 + 3.36 / myEXS.lambda(jz) ^ 0.8) * (t_gas_mid) / 10 ^ 4 + (4.896 + 0.464 / myEXS.lambda(jz) ^ 0.93)) + 287.7 - Qp_thd = myEXS.mpexh(jz) * cp_exh * (t_gas_out - t_gas_in) - diffQp = Qp_ht - Qp_thd - - 'Termination-criterion: Change of the Exhaust Outlet-temperature compared to the last Iteration-step smaller than Threshold - If dt_konv < dt_schwell Then AbbruchIter = True - - If AbbruchIter Then - Qp_exh(jz) = Qp_thd - t_gas(jz) = t_gas_out - Exit While - Else - If diffQp > 0 Then - t_unter = t_gas_out - ElseIf diffQp < 0 Then - t_ober = t_gas_out - End If - End If - End While - End If - - - 'Calculate the Heat loss of the "thermal mass" to the outside - If ModTyp = 2 Then '3-W Kat - 'Parameters are read from EXS file: - 'Data for MuD: - ' Oberfl_Kat = 0.12 'Surface for Heat-transfer in m^2 - ' Emiss = 0.5 'Emissivität |@@| Emiss = 0.5 'emissivity - ' A = 7, B = 0.21, C = 8, k = 1, d = -340 - - 'Empirische Formel, passt für alle Rollentests recht gut |@@| Empirical formula, suitable for all OK Roll-tests - T_aussen = t_m(jz) - 340 - 'Note: Tests with direct Dependence on t_m -> does not work well - - 'Heat-loss by Radiation - Qp_loss_rad = C_fak * ext_surface * myEXS.St_Boltz * emissivity * ((T_aussen + 273.15) ^ 4 - (myEXS.t_amb + 273.15) ^ 4) - 'Heat-loss by Convection - Qp_loss_konv = (B_fak * myEXS.vehspe(jz) + A_fak) * ext_surface * (T_aussen - myEXS.t_amb) - - ElseIf ModTyp = 3 Then 'Rohr - 'Parameters are read from EXS file: - 'Data for MuD: - ' Module 3: - ' Oberfl_Mod3 = 0.169457508 'Surface for Heat-transfer in m^2 - ' Emiss = 0.5 'Emissivität |@@| Emiss = 0.5 'emissivity - ' A = 7 - ' B = 0.42 - ' Module 4: - ' Oberfl_Mod4 = 0.103596481 'Oberfläche für Wärmeübergang in m^2 |@@| Oberfl_Mod4 = 0.103596481 'Surface for Heat-transfer in m^2 - ' Emiss = 0.9 'Emissivität |@@| Emiss = 0.9 'emissivity - ' A = 7 - ' B = 0 - - 'Heat-loss by Radiation = View_factor * Emissivity * St.-Boltzm.-const * Surface * (T_Pipe^4 - T_Environ^4) - Qp_loss_rad = emissivity * myEXS.St_Boltz * ext_surface * ((t_m(jz) + 273.15) ^ 4 - (myEXS.t_amb + 273.15) ^ 4) - 'Heat-loss by Convection = Heat_transfer_coefficient * Surface * (T_Pipe - T_Environ) - Qp_loss_konv = (B_fak * myEXS.vehspe(jz) + A_fak) * ext_surface * (t_m(jz) - myEXS.t_amb) - Else - 'Standard: Crad constant, no Loss by Convection - Qp_loss_rad = Crad * (((t_m(jz) + 273.15) ^ 4) - ((myEXS.t_amb + 273.15) ^ 4)) - Qp_loss_konv = 0 - End If - - 'Total-heat-loss - Qp_loss(jz) = Qp_loss_rad + Qp_loss_konv - - - End Sub - - ''' <summary> - ''' Thermocouple-Heat-transfer - ''' </summary> - ''' <param name="jz">Zeit</param> - ''' <remarks></remarks> - Public Sub HtTc(ByVal jz As Integer) - Dim vp_exh_tc As Single, vms As Single - Dim Re As Single, Nu_lam As Single, Nu_turb As Single, Nu_ave As Single, alpha_conv As Single, alpha_tot As Single - Dim k_pt1 As Single - - If jz = 0 Then - t_tc(0) = t_m(0) 'Als Startwert für das Thermoelement wird die Temperatur der thermischen Masse verwendet - Else - - 'Falls Motor Aus wird nach Abkühlkurve gerechnet und Methode verlassen: |@@| If Engine-OFF, wait for Cooling-curve and exit method: - If MODdata.EngState(jz) = tEngState.Stopped Then - If NoCoolDown Then - t_tc(jz) = t_tc(jz - 1) - Else - t_tc(jz) = T_tc_Abk.Temp(t_tc(jz - 1)) - End If - Exit Sub '!!!!!!!!! - End If - - vp_exh_tc = (myEXS.mpexh(jz) * myEXS.R_exh * (t_gas(jz) + 273.15)) / ((1 + (p_rel_bk / 1000)) * 100000) '!lokaler Volumenstrom im [m3/s] - vms = vp_exh_tc / cs_pipe '!lokale Strömungsgeschwindigkeit [m/s] - - '!Formula Calculating Heat-transfer-flow around the Cylinder - Re = (cl_cyl * vms) / myEXS.kv_exh(t_gas(jz)) - Nu_lam = 0.664 * (Re ^ 0.5) * (myEXS.Pr_exh ^ 0.333) 'Nusselt laminar - Nu_turb = 0.037 * ((Re ^ 0.8) * myEXS.Pr_exh) / (1 + 2.443 * (Re ^ (-0.1)) * ((myEXS.Pr_exh ^ 0.667) - 1)) 'Nusselt turbulent - Nu_ave = (0.3 + (((Nu_lam ^ 2) + (Nu_turb ^ 2)) ^ 0.5)) * (((t_gas(jz) + 273.15) / (t_tc(jz - 1) + 273.15)) ^ 0.12) 'Nusselt durchschnittlich - - alpha_conv = Nu_ave * myEXS.hc_exh(t_gas(jz)) / cl_cyl - alpha_tot = 1 / ((1 / alpha_conv) + ((d_soot * 0.001) / myEXS.hc_soot)) - - 'Simplified solution of the Heat-flow-equation for the t-sensor - 'entspricht einer Diffgl. für ein PT1 glied |@@| corresponds to a Diffgl. for a PT1 section(glied) - k_pt1 = (m_tc * myEXS.cp_steel) / (alpha_tot * surf_tc) - 'Discrete-time Solution of the PT1-Diffgl - t_tc(jz) = (1 / (k_pt1 + 1)) * (t_gas(jz) + (k_pt1 * t_tc(jz - 1))) - End If - - End Sub - - Private Class cAbkKurv - Private tAr As Single() - Private TempAr As Single() - Private Adim As Int16 - - - Public Function Read(ByVal sPath As String) As Boolean - - Dim f As cFile_V3 - Dim line As String() - Dim tList As System.Collections.Generic.List(Of Single) - Dim TempList As System.Collections.Generic.List(Of Single) - - - sPath = fFileRepl(sPath, fPATH(GEN.PathExs)) - - If Not IO.File.Exists(sPath) Then Return False - - f = New cFile_V3 - If Not f.OpenRead(sPath) Then - f = Nothing - Return False - End If - - tList = New System.Collections.Generic.List(Of Single) - TempList = New System.Collections.Generic.List(Of Single) - - Do While Not f.EndOfFile - line = f.ReadLine - tList.Add(line(0)) - TempList.Add(line(1)) - Loop - - tAr = tList.ToArray.Clone - TempAr = TempList.ToArray.Clone - - Adim = UBound(tAr) - - f.Close() - f = Nothing - - tList = Nothing - TempList = Nothing - - Return True - - End Function - - Public Function Temp(ByVal LastTemp As Single) As Single - Dim i As Int32 - Dim t As Single - - If TempAr(0) >= LastTemp Then - i = 0 - Do While TempAr(i) > LastTemp And i < Adim - i += 1 - Loop - Else - i = 1 - End If - - ''Extrapolation for LastTemp > TempAR(0) - 'If TempAr(0) < LastTemp Then - ' 'TODO: StatusMSG(8, "Extrapolation of Cool Down Temperature! t = " & jz & ", Temp(t-1) = " & LastTemp) - ' i = 1 - ' GoTo lbInt - 'End If - - 'i = 0 - 'Do While TempAr(i) > LastTemp And i < Adim - ' i += 1 - 'Loop - - 'Extrapolation for LastTemp < TempAR(Adim) - - 'lbInt: - 'Interpolation - If TempAr(i) - TempAr(i - 1) = 0 Then - t = tAr(i - 1) - Else - t = (LastTemp - TempAr(i - 1)) * (tAr(i) - tAr(i - 1)) / (TempAr(i) - TempAr(i - 1)) + tAr(i - 1) - End If - - 'Einen Zeitschritt vor ( = 1 Sekunde) |@@| One Time-step forward(vor)( =1 second) - t += 1 - - i = 0 - Do While tAr(i) < t And i < Adim - i += 1 - Loop - - If tAr(i) - tAr(i - 1) = 0 Then - Return TempAr(i - 1) - Else - Return (t - tAr(i - 1)) * (TempAr(i) - TempAr(i - 1)) / (tAr(i) - tAr(i - 1)) + TempAr(i - 1) - End If - - End Function - - End Class - - End Class - - ''' <summary> - ''' SCR Modell - ''' </summary> - ''' <remarks></remarks> - Class cScrMod 'SCR Modell - - Implements KonvInterf - - 'Class initialized as a Subelement of TempMod - - Dim DatKonvOut As New cFile_V3 'PHEM SCR model result file - Dim PathKonvOut As String = "" - - Dim t_SCR As Single - 'c Prefix "c" means: use Cycle-value for Characteristic-correction - Dim ct_up As Single, cNOxraw As Single, cNOx60s As Single, cSV As Single - 'c Index "cc" means: Value of Charachteristic-curve (-> "c" - "cc" is the Derivative, corrected) - Dim denox_cc As Single, t_up_cc As Single, NOxraw_cc As Single, NOx60s_cc As Single, SV_cc As Single, deNOxmin As Single - Dim deNOx_cor As Single '! deNOx-Wert nach Korrektur as single, vor End-Filterung as single - Dim deNOx As Single '! Endwert zur Berechnung von NOx-tailpipe as single - 'Specify Filename for per-second Output-file - - Dim pt_SCR(izykt) As Single - Dim pdeNOx(izykt) As Single - Dim pt_up(izykt) As Single - Dim pNOxraw(izykt) As Single - Dim pNOx60s(izykt) As Single - Dim pSV(izykt) As Single - Dim Sharetdown As Single - - Dim DeNOxMax As Single - Dim tminCor As Single - Dim tmaxCor As Single - Dim Cor_tup As Single - Dim Cor_NOxraw As Single - Dim Cor_NOx60s As Single - Dim Cor_SV As Single - Dim specCatVol As Single - Dim iSCRAnz As Integer - - - Dim KonvRate(8) As Single - Dim iSchad As Long - Dim id As Int16 - - Private myEXS As cEXS - - Public Property DummyKonvRate As Dictionary(Of tMapComp, List(Of Single)) Implements KonvInterf.KonvRate - - Public Sub New(ByVal i As Int16, ByRef EXSref As cEXS) - id = i - myEXS = EXSref - - PathKonvOut = MODdata.ModOutpName & "_Mod" & id & ".den" - - End Sub - - - Public Function Read(ByVal Name As String) As Boolean Implements KonvInterf.Read - Dim DatKonvIn As New cFile_V3 'PHEM inputfile with definition of exhaust system structure - Dim iz As Long - Dim line() As String - Dim MsgSrc As String - - MsgSrc = "EmCalc/EXS/SCR/Read" - - If Not DatKonvIn.OpenRead(Name) Then - WorkerMsg(tMsgID.Err, "Cannot read " & Name & "!", MsgSrc) - DatKonvIn = Nothing - Return False - End If - - 'Abort if given no NOx - If Not MAP.EmDefRef.ContainsKey(tMapComp.NOx) Then - WorkerMsg(tMsgID.Err, "'NOx' not defined in emission map!", MsgSrc) - Return False - End If - - - Sharetdown = CSng(DatKonvIn.ReadLine(0)) - DeNOxMax = CSng(DatKonvIn.ReadLine(0)) - specCatVol = CSng(DatKonvIn.ReadLine(0)) - tminCor = CSng(DatKonvIn.ReadLine(0)) - tmaxCor = CSng(DatKonvIn.ReadLine(0)) - Cor_tup = CSng(DatKonvIn.ReadLine(0)) - Cor_NOxraw = CSng(DatKonvIn.ReadLine(0)) - Cor_NOx60s = CSng(DatKonvIn.ReadLine(0)) - Cor_SV = CSng(DatKonvIn.ReadLine(0)) - DatKonvIn.ReadLine() - DatKonvIn.ReadLine() - DatKonvIn.ReadLine() - - iz = 0 - 't-SCR (° C), deNOx (1-NOx-Exhaust/NOx-Raw), t-upstream (°C), NOx-raw (g/h)/kW_Nominal-power, total NOx over 60sec before g/h)/kW_Nominal-power, space velocity (1/h) - Do While Not DatKonvIn.EndOfFile - iz = iz + 1 - line = DatKonvIn.ReadLine - pt_SCR(iz) = CSng(line(0)) - pdeNOx(iz) = CSng(line(1)) - pt_up(iz) = CSng(line(2)) - pNOxraw(iz) = CSng(line(3)) - pNOx60s(iz) = CSng(line(4)) - pSV(iz) = CSng(line(5)) - Loop - iSCRAnz = iz - line = Nothing - DatKonvIn.Close() - DatKonvIn = Nothing - - Return True - End Function - - - Public Sub Konv(ByVal jz As Integer) Implements KonvInterf.Konv - - ' ----------------------------------------------------------------------- - ' Program to simulate SCR-fleet-model - ' Note: deNOx values less than zero are possible: - ' this corresponds to higher NOx-raw level than in the Base-map - ' ----------------------------------------------------------------------- - ' - Dim is0 As Long - Dim such As Single - Dim izpl As Int32 - Dim eNOx As System.Collections.Generic.List(Of Single) - - eNOx = MODdata.Em.EmDefComp(tMapComp.NOx).FinalVals - ' - ' ----------------------------------------------------------------- - ' 1.) Calculation of per-second Values ​​for Input-variables of the SCR-model - ' - ' a.) t_SCR: combined-weight of t_upstream and t_downstream - ' SCR-Model-intern werden dabei Temperaturen zwischen 50°C und 500°C begrenzt |@@| SCR-model-internally there are Temperatures between 50 ° C and 500 ° C limits - ' Temperature-model-values (eg Cold-start) will not be overwritten - - t_SCR = ((1 - Sharetdown) * myEXS.TempMod(id - 1).t_tc(jz)) + (Sharetdown * myEXS.TempMod(id).t_tc(jz)) - t_SCR = Math.Max(50.001, t_SCR) - t_SCR = Math.Min(499.999, t_SCR) - ' - ' b.) t_up, NOxraw, SV. 20s Moving-average in the past - ' Formula applied also to the first 20 seconds - ' - ct_up = 0 - cNOxraw = 0 - cSV = 0 - For is0 = Math.Max(0, jz - 19) To jz - ct_up = ct_up + myEXS.TempMod(id - 1).t_tc(is0) - cNOxraw = cNOxraw + (myEXS.TempMod(id - 1).eEmKomp(2, is0) / myEXS.p_rated) - cSV = cSV + ((((myEXS.mpexh(is0) * 3600) / myEXS.p_rated) / 1.29) / (specCatVol * 0.001)) - Next is0 - ct_up = ct_up / (jz - Math.Max(0, jz - 19) + 1) - cNOxraw = cNOxraw / (jz - Math.Max(0, jz - 19) + 1) - cSV = cSV / (jz - Math.Max(0, jz - 19) + 1) - ' - ' c.) NOx60s: Sum over the last 60s of the specific NOx-raw emissions - ' Formula applied to the first 60 seconds - - cNOx60s = 0 - For is0 = Math.Max(0, jz - 59) To jz - cNOx60s = cNOx60s + (eNOx(is0) / myEXS.p_rated) - Next is0 - ' for seconds 1-59 must Extrapolate total-value - cNOx60s = cNOx60s / (Math.Min(60, jz + 1) / 60.0) - - ' ----------------------------------------------------------------- - ' - ' - ' - ' Calculation of deNOxmin value from Characteristic-curves at 50 ° C - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pdeNOx(is0) - Next is0 - such = 50.001 - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - deNOxmin = such - ' - ' - ' ----------------------------------------------------------------- - ' 2.) Calculation deNOx - ' - ' a.) deNOx of characteristic: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pdeNOx(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - denox_cc = such - - 'c b.) If correction criteria are met: deNOx-correction compared against Characteristic - If ((t_SCR > tminCor) And (t_SCR < tmaxCor)) Then - 'c - 'c t_up from characteristics: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pt_up(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - t_up_cc = such - 'c - 'c NOx_raw of characteristics: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pNOxraw(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - NOxraw_cc = such - 'c - 'c Sum of the NOxraw in the last 60 seconds from characteristics: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pNOx60s(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - NOx60s_cc = such - 'c - 'c Raumgeschwindigkeit aus Kennlinie: |@@| Space/Velocity from(aus) characteristics: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pSV(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - SV_cc = such - 'c - deNOx_cor = denox_cc + Cor_tup * (ct_up - t_up_cc) + Cor_NOxraw * (cNOxraw - NOxraw_cc) + Cor_NOx60s * (cNOx60s - NOx60s_cc) + Cor_SV * (cSV - SV_cc) - 'c - deNOx = Math.Max(Math.Min(deNOx_cor, DeNOxMax), deNOxmin) - 'c - Else - deNOx = Math.Max(Math.Min(denox_cc, DeNOxMax), deNOxmin) - End If - - 'Schreiben der Ergebnisse auf die standardisierten Variablen eEmKomp (iSchad, jz) und Qp_reak(jz) |@@| Write the results on the standardized variables eEmKomp (iSchad, jz) and Qp_reak (jz) - For iSchad = 2 To 8 - KonvRate(iSchad) = 0 - Next iSchad - KonvRate(2) = deNOx - KonvRate(7) = deNOx - For iSchad = 2 To 8 - myEXS.TempMod(id).eEmKomp(iSchad, jz) = myEXS.TempMod(id - 1).eEmKomp(iSchad, jz) * (1 - KonvRate(iSchad)) - Next iSchad - myEXS.TempMod(id).Qp_reak(jz) = 0 - End Sub - - - Public Sub Header() Implements KonvInterf.Header - DatKonvOut.OpenWrite(PathKonvOut) - DatKonvOut.WriteLine("result-file VECTO SCR Model") - DatKonvOut.WriteLine("VECTO " & VECTOvers) - DatKonvOut.WriteLine("time,NOx_up,NOx_down,t_SCR,deNOx,deNOx_cc,t_tc_down,t_tc_up,20s t_tc_up,t_up_cc,NOx_raw,NOx_raw_cc,NOx60s,NOx60s_cc,SV,SV_cc ") - DatKonvOut.WriteLine("[s],[g/h],[g/h],[°C],[1],[1],[°C],[°C],[°C],[°C],[g/(h*kW_rated)],[g/(h*kW_rated)],[g/(h*kW_rated)],[g/(h*kW_rated)],[h-1],[h-1]") - End Sub - - - Public Sub Write(ByVal jz As Integer) Implements KonvInterf.Write - DatKonvOut.WriteLine(jz + 1 & "," & myEXS.TempMod(id - 1).eEmKomp(2, jz) & "," & myEXS.TempMod(id).eEmKomp(2, jz) & "," & t_SCR & "," & deNOx & "," & denox_cc & "," & myEXS.TempMod(id).t_tc(jz) & "," & myEXS.TempMod(id - 1).t_tc(jz) & "," & ct_up & "," & t_up_cc & "," & cNOxraw & "," & NOxraw_cc & "," & cNOx60s & "," & NOx60s_cc & "," & cSV & "," & SV_cc) - End Sub - - - Public Sub Close() Implements KonvInterf.Close - DatKonvOut.Close() - End Sub - - - End Class - - - ''' <summary> - ''' SCR model - ''' </summary> - ''' <remarks></remarks> - Class cScrMod_10sMW 'SCR Modell - - Implements KonvInterf - - 'Class initialized as a Subelement of TempMod - - Dim DatKonvOut As New cFile_V3 'PHEM SCR model result file - Dim PathKonvOut As String = "" - - Dim t_SCR As Single - 'c Prefix "c" means: use Cycle value for Characteristic-correction - Dim ct_up As Single, cNOxraw As Single, cNOx30s As Single, cSV As Single - 'c Index "cc" means: Value of Characteristic (-> "c" - "cc" is the Derivative, corrected) - Dim denox_cc As Single, t_up_cc As Single, NOxraw_cc As Single, NOx30s_cc As Single, SV_cc As Single, deNOxmin As Single - Dim deNOx_cor As Single '! deNOx-Wert nach Korrektur as single, vor End-Filterung as single - Dim deNOx As Single '! Endwert zur Berechnung von NOx-tailpipe as single - 'Specify Filename for per-second Output-file - - Dim pt_SCR(izykt) As Single - Dim pdeNOx(izykt) As Single - Dim pt_up(izykt) As Single - Dim pNOxraw(izykt) As Single - Dim pNOx60s(izykt) As Single - Dim pSV(izykt) As Single - Dim Sharetdown As Single - - Dim DeNOxMax As Single - Dim tminCor As Single - Dim tmaxCor As Single - Dim Cor_tup As Single - Dim Cor_NOxraw As Single - Dim Cor_NOx30s As Single - Dim Cor_SV As Single - Dim specCatVol As Single - Dim iSCRAnz As Integer - - - Dim KonvRate(8) As Single - Dim iSchad As Long - Dim id As Int16 - - Private myEXS As cEXS - - Public Property DummyKonvRate As Dictionary(Of tMapComp, List(Of Single)) Implements KonvInterf.KonvRate - - - - Public Sub New(ByVal i As Int16, ByRef EXSref As cEXS) - id = i - myEXS = EXSref - - PathKonvOut = MODdata.ModOutpName & "_Mod" & id & ".den" - - End Sub - - - Public Function Read(ByVal Name As String) As Boolean Implements KonvInterf.Read - Dim DatKonvIn As New cFile_V3 'PHEM inputfile with definition of exhaust system structure - Dim iz As Long - Dim line() As String - Dim MsgSrc As String - - MsgSrc = "EmCalc/EXS/SCR_10s/Read" - - If Not DatKonvIn.OpenRead(Name, , , True) Then - WorkerMsg(tMsgID.Err, "Cannot read " & Name & "!", MsgSrc) - DatKonvIn = Nothing - Return False - End If - - 'Abort if no NOx given - If Not MAP.EmDefRef.ContainsKey(tMapComp.NOx) Then - WorkerMsg(tMsgID.Err, "'NOx' not defined in emission map!", MsgSrc) - Return False - End If - - Sharetdown = CSng(DatKonvIn.ReadLine(0)) - DeNOxMax = CSng(DatKonvIn.ReadLine(0)) - specCatVol = CSng(DatKonvIn.ReadLine(0)) - tminCor = CSng(DatKonvIn.ReadLine(0)) - tmaxCor = CSng(DatKonvIn.ReadLine(0)) - Cor_tup = CSng(DatKonvIn.ReadLine(0)) - Cor_NOxraw = CSng(DatKonvIn.ReadLine(0)) - Cor_NOx30s = CSng(DatKonvIn.ReadLine(0)) - Cor_SV = CSng(DatKonvIn.ReadLine(0)) - DatKonvIn.ReadLine() - DatKonvIn.ReadLine() - DatKonvIn.ReadLine() - - iz = 0 - 't-SCR (°C), deNOx(1-NOx-Auspuff/NOx-Roh), -t-upstream(°C), NOx-Roh (g/h)/kW_Nennleistg, Summe NOx ueber 60Sek vorher g/h)/kW_Nennleistg, Raumgeschwindigkeit (1/h) |@@| t-SCR (° C), deNOx (1-NOx-Exhaust/NOx-raw), t-upstream (° C), NOx-raw (g/h) / kW_Nominal-power, total NOx over 60sec before g/h)/kW_Nominal-power, space velocity (1/h) - Do While Not DatKonvIn.EndOfFile - iz = iz + 1 - line = DatKonvIn.ReadLine - pt_SCR(iz) = CSng(line(0)) - pdeNOx(iz) = CSng(line(1)) - pt_up(iz) = CSng(line(2)) - pNOxraw(iz) = CSng(line(3)) - pNOx60s(iz) = CSng(line(4)) - pSV(iz) = CSng(line(5)) - Loop - iSCRAnz = iz - line = Nothing - DatKonvIn.Close() - DatKonvIn = Nothing - - Return True - - End Function - - - Public Sub Konv(ByVal jz As Integer) Implements KonvInterf.Konv - - ' ----------------------------------------------------------------------- - ' Program to Simulate SCR-fleet-model - ' Note: deNOx with values less than zero are possible: - ' this corresponds to higher NOx-raw level than in the Base-map - ' ----------------------------------------------------------------------- - ' - Dim is0 As Long - Dim such As Single - Dim izpl As Int32 - Dim eNOx As System.Collections.Generic.List(Of Single) - - eNOx = MODdata.Em.EmDefComp(tMapComp.NOx).FinalVals - - ' - ' ----------------------------------------------------------------- - ' 1.) Calculation of per-second Values ​for Input-variables of the SCR model - ' - ' a) t_SCR: combined-weight of the t_upstream and t_downstream - ' SCR-Model-intern werden dabei Temperaturen zwischen 50°C und 500°C begrenzt |@@| SCR model internally there are temperatures between 50 ° C and 500 ° C limits - ' Temperature-model values (eg cold start) will not be overwritten - - t_SCR = ((1 - Sharetdown) * myEXS.TempMod(id - 1).t_tc(jz)) + (Sharetdown * myEXS.TempMod(id).t_tc(jz)) - t_SCR = Math.Max(50.001, t_SCR) - t_SCR = Math.Min(499.999, t_SCR) - ' - ' b.) t_up, NOxraw, SV. 20s moving average in the past - ' Formula applies to the first 20 seconds - ' - ct_up = 0 - cNOxraw = 0 - cSV = 0 - For is0 = Math.Max(0, jz - 9) To jz - If Not MODdata.EngState(is0) = tEngState.Stopped Then - ct_up = ct_up + myEXS.TempMod(id - 1).t_tc(is0) - cNOxraw = cNOxraw + (myEXS.TempMod(id - 1).eEmKomp(2, is0) / myEXS.p_rated) - cSV = cSV + ((((myEXS.mpexh(is0) * 3600) / myEXS.p_rated) / 1.29) / (specCatVol * 0.001)) - End If - Next is0 - ct_up = ct_up / (jz - Math.Max(1, jz - 9) + 1) - cNOxraw = cNOxraw / (jz - Math.Max(1, jz - 9) + 1) - cSV = cSV / (jz - Math.Max(1, jz - 9) + 1) - ' - ' c.) NOx60s: Sum over the last 60s of the specific NOx-raw emissions - ' Formula applies to the first 60 seconds - - cNOx30s = 0 - For is0 = Math.Max(0, jz - 29) To jz - If Not MODdata.EngState(is0) = tEngState.Stopped Then - cNOx30s = cNOx30s + (eNOx(is0) / myEXS.p_rated) - End If - Next is0 - ' For seconds 1 to 59 must sum the projected values - cNOx30s = cNOx30s / (Math.Min(30, jz + 1) / 30.0) - - ' ----------------------------------------------------------------- - ' - ' - ' - ' Calculation of the Characteristic-curves for deNOxmin values at 50 ° C - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pdeNOx(is0) - Next is0 - such = 50.001 - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - deNOxmin = such - ' - ' - ' ----------------------------------------------------------------- - ' 2.) Calculation of deNOx - ' - ' a.) Characteristic of deNOx: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pdeNOx(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - denox_cc = such - - 'c b.) If Correction-criteria are met: Correct deNOx against the Characteristic - If ((t_SCR > tminCor) And (t_SCR < tmaxCor)) Then - 'c - 'c Characteristic of t_up: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pt_up(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - t_up_cc = such - 'c - 'c Characteristic-curve of the NOx_raw: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pNOxraw(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - NOxraw_cc = such - 'c - 'c Sum of NOxraw in the last 60 seconds of Characteristic-curve: - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pNOx60s(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - NOx30s_cc = such - 'c - 'c Characteristic-curve of Distnace-Speed(Raumgeschwindigkeit): - For is0 = 1 To iSCRAnz - myEXS.Xis(is0) = pt_SCR(is0) - myEXS.Yis(is0) = pSV(is0) - Next is0 - such = t_SCR - izpl = iSCRAnz - Call myEXS.Intlin(such, izpl) - SV_cc = such - 'c - deNOx_cor = denox_cc + Cor_tup * (ct_up - t_up_cc) + Cor_NOxraw * (cNOxraw - NOxraw_cc) + Cor_NOx30s * (cNOx30s - NOx30s_cc) + Cor_SV * (cSV - SV_cc) - 'c - deNOx = Math.Max(Math.Min(deNOx_cor, DeNOxMax), deNOxmin) - 'c - Else - deNOx = Math.Max(Math.Min(denox_cc, DeNOxMax), deNOxmin) - End If - - 'Write the results on the standardized variables eEmKomp(iSchad, jz) and Qp_reak(jz) - For iSchad = 2 To 8 - KonvRate(iSchad) = 0 - Next iSchad - KonvRate(2) = deNOx - KonvRate(7) = deNOx - For iSchad = 2 To 8 - myEXS.TempMod(id).eEmKomp(iSchad, jz) = myEXS.TempMod(id - 1).eEmKomp(iSchad, jz) * (1 - KonvRate(iSchad)) - Next iSchad - myEXS.TempMod(id).Qp_reak(jz) = 0 - End Sub - - Public Sub Header() Implements KonvInterf.Header - DatKonvOut.OpenWrite(PathKonvOut) - DatKonvOut.WriteLine("result-file VECTO SCR Model 10s HERO") - DatKonvOut.WriteLine("VECTO " & VECTOvers) - DatKonvOut.WriteLine("time,NOx_up,NOx_down,t_SCR,deNOx,deNOx_cc,t_tc_down,t_tc_up,10s t_tc_up,t_up_cc,NOx_raw,NOx_raw_cc,NOx30s,NOx30s_cc,SV,SV_cc ") - DatKonvOut.WriteLine("[s],[g/h],[g/h],[°C],[1],[1],[°C],[°C],[°C],[°C],[g/(h*kW_rated)],[g/(h*kW_rated)],[g/(h*kW_rated)],[g/(h*kW_rated)],[h-1],[h-1]") - End Sub - - Public Sub Write(ByVal jz As Integer) Implements KonvInterf.Write - DatKonvOut.WriteLine(jz & "," & myEXS.TempMod(id - 1).eEmKomp(2, jz) & "," & myEXS.TempMod(id).eEmKomp(2, jz) & "," & t_SCR & "," & deNOx & "," & denox_cc & "," & myEXS.TempMod(id).t_tc(jz) & "," & myEXS.TempMod(id - 1).t_tc(jz) & "," & ct_up & "," & t_up_cc & "," & cNOxraw & "," & NOxraw_cc & "," & cNOx30s & "," & NOx30s_cc & "," & cSV & "," & SV_cc) - End Sub - - Public Sub Close() Implements KonvInterf.Close - DatKonvOut.Close() - End Sub - - End Class - - - ''' <summary> - ''' KAT-model - ''' </summary> - ''' <remarks></remarks> - Class c3WayCatMod 'DOC Modell - - Implements KonvInterf - - 'Class initialized as a Sub-element of TempMod - Dim iSchad As Long - Dim id As Int16 - - Private myEXS As cEXS - - 'Mapped-data - 'Private Massflow As List(Of Single) - 'Private Temp_KAT As List(Of Single) - 'Private Massflow_Norm As List(Of Single) - 'Private Temp_KAT_Norm As List(Of Single) - 'Private Massflow_Min As Single - 'Private Massflow_Max As Single - 'Private Temp_KAT_Min As Single - 'Private Temp_KAT_Max As Single - 'Private ListDim As Integer - - Private KonvRateMap As Dictionary(Of tMapComp, cDelaunayMap) - 'Public KonvRate As Dictionary(Of tMapComp, List(Of Single)) - - Dim DatKonvOut As New cFile_V3 'PHEM 3waycat result file - Dim PathKonvOut As String = "" - - Public Property KonvRate As Dictionary(Of tMapComp, List(Of Single)) Implements KonvInterf.KonvRate - - - ''' <summary> - ''' Creating a new CAT module - ''' </summary> - ''' <param name="i">ID</param> - ''' <param name="EXSref">EXS-Klasse</param> - ''' <remarks></remarks> - Public Sub New(ByVal i As Int16, ByRef EXSref As cEXS) - id = i - myEXS = EXSref - - PathKonvOut = MODdata.ModOutpName & "_Mod" & id & ".kat" - - End Sub - - - ''' <summary> - ''' Interpolation-Function - ''' </summary> - ''' <param name="x">Mass-flow(Massenstrom)</param> - ''' <param name="y"> Temperature before(vor) KAT </param> - ''' <param name="MapID">The MapID of the corresponding Exhaust-gas-component</param> - ''' <returns>The interpolated value for x and y from the Map</returns> - ''' <remarks> It calculates the converted rate of the appropriate Exhaust-gas-component from the Mass-flow temperature Map</remarks> - Private Function Intpol(ByVal x As Double, ByVal y As Double, ByVal MapID As tMapComp) As Double - Try - Return KonvRateMap(MapID).Intpol(x, y) - Catch ex As Exception - WorkerMsg(tMsgID.Err, "Extrapolation nicht möglich! Massenstrom=" & x & ", Temp_Kat=" & y, "3WayCatMod.Intpol") - Return -1 - End Try - End Function - - - ''' <summary> - ''' Reading the Maps for Conversion-rates - ''' </summary> - ''' <param name="Name">Filename</param> - ''' <remarks></remarks> - Public Function Read(ByVal Name As String) As Boolean Implements KonvInterf.Read - Dim DatKonv As New cFile_V3 - Dim line As String() - Dim s As Integer - Dim s1 As Integer - Dim MapComp As tMapComp - Dim Spalten As Dictionary(Of tMapComp, Integer) - Dim Sp0 As KeyValuePair(Of tMapComp, Integer) - Dim KonvRate0 As KeyValuePair(Of tMapComp, cDelaunayMap) - Dim Massflow As Double - Dim Temp_KAT As Double - Dim MsgSrc As String - - MsgSrc = "EmCalc/EXS/c3WayCatMod/Read" - - If Not DatKonv.OpenRead(Name) Then - WorkerMsg(tMsgID.Err, "Cannot read " & Name & "!", MsgSrc) - DatKonv = Nothing - Return False - End If - - Spalten = New Dictionary(Of tMapComp, Integer) - - KonvRateMap = New Dictionary(Of tMapComp, cDelaunayMap) - - KonvRateMap.Add(tMapComp.NOx, New cDelaunayMap) - KonvRateMap.Add(tMapComp.HC, New cDelaunayMap) - KonvRateMap.Add(tMapComp.CO, New cDelaunayMap) - KonvRateMap.Add(tMapComp.NO, New cDelaunayMap) - - 'Header - line = DatKonv.ReadLine - line = DatKonv.ReadLine - s1 = UBound(line) - For s = 2 To s1 - - MapComp = fMapComp(line(s)) - - If Not KonvRateMap.ContainsKey(MapComp) Then - WorkerMsg(tMsgID.Err, "Komponente nicht vorgesehen!", MsgSrc) - Return False - End If - - If Spalten.ContainsKey(MapComp) Then - WorkerMsg(tMsgID.Err, "Komponente kommt doppelt vor!", MsgSrc) - Return False - End If - - Spalten.Add(MapComp, s) - - Next - - 'Units (are not evaluated) - line = DatKonv.ReadLine - - 'Values - Do While Not DatKonv.EndOfFile - - line = DatKonv.ReadLine - - Massflow = CDbl(line(0)) - Temp_KAT = CDbl(line(1)) - - For Each Sp0 In Spalten - KonvRateMap(Sp0.Key).AddPoints(Massflow, Temp_KAT, CDbl(line(Sp0.Value))) - Next - - 'Set KonvRaten to Zero when no component given - For Each KonvRate0 In KonvRateMap - If Not Spalten.ContainsKey(KonvRate0.Key) Then - KonvRate0.Value.AddPoints(Massflow, Temp_KAT, 0) - End If - Next - - Loop - - DatKonv.Close() - - 'Triangulating - For Each KonvRate0 In KonvRateMap - If Not KonvRate0.Value.Triangulate() Then - WorkerMsg(tMsgID.Err, "Triangulation-ERROR", MsgSrc) - Return False - End If - Next - - 'define Dic. for modal Konvrate - KonvRate = New Dictionary(Of tMapComp, List(Of Single)) - KonvRate.Add(tMapComp.NOx, New List(Of Single)) - KonvRate.Add(tMapComp.HC, New List(Of Single)) - KonvRate.Add(tMapComp.CO, New List(Of Single)) - KonvRate.Add(tMapComp.NO, New List(Of Single)) - - Return True - - End Function - - - ''' <summary> - ''' Calculation of the Conversion-rate from Map - ''' </summary> - ''' <param name="jz">Time</param> - ''' <remarks> Used to calculate the temperature of the Thermoelements on Kateingang (corresponds to Module-number i-1)!</remarks> - Public Sub Konv(ByVal jz As Integer) Implements KonvInterf.Konv - 'Conversion-rate calculated from Map - Dim massflow As Single - Dim temp As Single - - massflow = MODdata.Em.EmDefComp(tMapComp.MassFlow).FinalVals(jz) - - temp = myEXS.TempMod(id - 1).t_tc(jz) - - KonvRate(tMapComp.NOx).Add(Intpol(massflow, temp, tMapComp.NOx)) - KonvRate(tMapComp.HC).Add(Intpol(massflow, temp, tMapComp.HC)) - KonvRate(tMapComp.CO).Add(Intpol(massflow, temp, tMapComp.CO)) - KonvRate(tMapComp.NO).Add(Intpol(massflow, temp, tMapComp.NO)) - - End Sub - - ''' <summary> - ''' Header for Output-file - ''' </summary> - ''' <remarks></remarks> - Public Sub Header() Implements KonvInterf.Header - DatKonvOut.OpenWrite(PathKonvOut) - DatKonvOut.WriteLine("result-file VECTO 3waycat Model") - DatKonvOut.WriteLine("VECTO " & VECTOvers) - DatKonvOut.WriteLine("time,MassFlow,NOx_up,NOx_down,HC_up,HCdown,CO_up,CO_down,NO_up,NO_down,deNOx,deHC,deCO,deNO,t_gas,t_m,t_tc") - DatKonvOut.WriteLine("[s],[kg/s]N,[g/h],[g/h],[g/h],[g/h],[g/h],[g/h],[g/h],[g/h],[1],[1],[1],[1],[°C],[°C],[°C]") - End Sub - - ''' <summary> - ''' Data for Output-file - ''' </summary> - ''' <param name="jz">Time</param> - ''' <remarks></remarks> - Public Sub Write(ByVal jz As Integer) Implements KonvInterf.Write - DatKonvOut.WriteLine(jz & "," & MODdata.Em.EmDefComp(tMapComp.MassFlow).FinalVals(jz) & "," _ - & myEXS.TempMod(id - 1).eEmKomp(2, jz) & "," & myEXS.TempMod(id).eEmKomp(2, jz) & "," _ - & myEXS.TempMod(id - 1).eEmKomp(3, jz) & "," & myEXS.TempMod(id).eEmKomp(3, jz) & "," _ - & myEXS.TempMod(id - 1).eEmKomp(4, jz) & "," & myEXS.TempMod(id).eEmKomp(4, jz) & "," _ - & myEXS.TempMod(id - 1).eEmKomp(7, jz) & "," & myEXS.TempMod(id).eEmKomp(7, jz) & "," _ - & myEXS.TempMod(id).KonvMod.KonvRate(tMapComp.NOx)(jz) & "," & myEXS.TempMod(id).KonvMod.KonvRate(tMapComp.HC)(jz) & "," _ - & myEXS.TempMod(id).KonvMod.KonvRate(tMapComp.CO)(jz) & "," & myEXS.TempMod(id).KonvMod.KonvRate(tMapComp.NO)(jz) & "," _ - & myEXS.TempMod(id).t_gas(jz) & "," & myEXS.TempMod(id).t_m(jz) & "," & myEXS.TempMod(id).t_tc(jz)) - End Sub - - Public Sub Close() Implements KonvInterf.Close - DatKonvOut.Close() - End Sub - - - End Class - - ''' <summary> - ''' Interface to Converter-classes cScrMod, cDocMod, etc. .. - ''' </summary> - ''' <remarks></remarks> - Interface KonvInterf - 'Sub NewI(ByVal i As Int16) - Function Read(ByVal s As String) As Boolean - Sub Konv(ByVal t As Integer) - Sub Header() - Sub Write(ByVal t As Integer) - Sub Close() - Property KonvRate As Dictionary(Of tMapComp, List(Of Single)) - End Interface - - - Sub Intlin(ByRef such As Single, ByVal izpl As Long) - ''C - 'C Unterprogramm zu PHEM zur linearen INterpolation aus einem Polygonzug (z.B. in Vissimzs.for aufgerufen) |@@| Subroutine of(zu) PHEM for linear Interpolation of a Polygon (eg called by Vissimzs.for) - 'C uebergeben wid "such" als X-Wert, der dann als berechneter Y-Wert wieder zurueck gegeben wird |@@| It is given the X-value to "search", and it gives back the calculated Y-value - 'C Zu Belegen sind vorher: |@@| for previous Allocation: - 'C Xis(j) and Yis(j) - 'c Given the desired Value(search) and the Number of the existing Polygon-points (izpl) - 'c - 'C - ' INCLUDE "com.inc"<<<<<<<<<<<<<<<<<<<<<<<<<< - Dim i1min As Long, i2min As Long, igel As Int32 - Dim abstad(1000) As Single - Dim aminabst As Single - Dim ji As Int32 - Dim x As Single - 'C - 'c - 'C Search the closest points of the Revolutions from the input Full-load curve: - 'c Distance to Input-points and Search those Points with the smallest Distance: - aminabst = Math.Abs(such - Xis(1)) + 1 - For ji = 1 To izpl - x = such - Xis(ji) - abstad(ji) = Math.Abs(x) - If (abstad(ji) < aminabst) Then - aminabst = abstad(ji) - i1min = ji - End If - Next ji - 'c - 'C Fix the second Interpolation-points (only interpolation, no extrapolation) - 'C - x = such - Xis(i1min) - If (x >= 0) Then - i2min = i1min + 1 - If (i2min > izpl) Then - '!Extrapolation up - i2min = izpl - 1 - End If - Else - i2min = i1min - 1 - If (i2min < 1) Then - '!Extrapolation down - i2min = 2 - End If - End If - 'c - 'c Sort the 2 Values by ascending n: - 'c - If (Xis(i2min) < Xis(i1min)) Then - igel = i2min - i2min = i1min - i1min = igel - End If - 'c - 'c Interpolation of the associated Maximum-power (P/Pnom) - 'c - If ((Xis(i2min) - Xis(i1min)) = 0) Then - Xis(i2min) = Xis(i2min) + 0.000001 - End If - such = Yis(i1min) + (such - Xis(i1min)) * (Yis(i2min) - Yis(i1min)) / (Xis(i2min) - Xis(i1min)) - 'C - Exit Sub ' RETURN<<<<<<<<<<<<<<<<<<<<<<<<<< - End Sub - - -End Class - diff --git a/VECTO/MODcalc/cBatModel.vb b/VECTO/MODcalc/cBatModel.vb deleted file mode 100644 index 1b3a6b79b2..0000000000 --- a/VECTO/MODcalc/cBatModel.vb +++ /dev/null @@ -1,400 +0,0 @@ -Public Class cBatModel - - Private sFilePath As String - - Private a0 As Single, a1 As Single, a2 As Single, a3 As Single, a4 As Single, a5 As Single, a6 As Single - Private b0 As Single, b1 As Single, b2 As Single, b3 As Single, b4 As Single, b5 As Single, b6 As Single - Private c0 As Single, c1 As Single, c2 As Single, c3 As Single, c4 As Single - Private d0 As Single, d1 As Single, d2 As Single - Private NCELLS As Single - Private RI_20 As Single - Private T_AMB As Single - Private T_MAX As Single - Private CP As Single - Private MB As Single - - - Public SOC_Kap As Single - Public SOC_MAX As Single - Public SOC_MIN As Single - - 'Current data (ie the current (last calculated) Time-step) - - Public TempBat As Single - Public Ubat As Single 'Spannung [V] (Array) - Public Ibat As Single 'Strom [A] (Array) - Public SOC As Single - Public PbatV As Single 'Verluste in Batterie [kW] (Array) - - - Private LastTempBat As Single - Private LastSOC As Single - Private PmaxEntl As Single 'maximal zulässige Leistung zum Assistieren (Batterie entladen) [kW] Vorzeichen negativ (Renhart Standard) - Private PmaxLad As Single 'maximal zulässige Leistung zum Generieren (Batterie laden) [kW] Vorzeichen positiv (Renhart Standard) - - Private MyEV As cPower - - - Public Sub New(ByRef MycPower As cPower) - MyEV = MycPower - End Sub - - Public Sub CleanUp() - MyEV = Nothing - End Sub - - Public Function PiBat(ByVal PiEM As Single) As Single - 'TODO... - - Return PiEM / 0.9 - - - - End Function - - 'Maximum allowable Power for driving (Battery discharged) [kW] positive sign (PHEM Standard) - Public ReadOnly Property PmaxAntr As Single - Get - Return -PmaxEntl - End Get - End Property - - 'Maximum allowable power for Generating/Rekuperiren (Battery-charging) [kW] negative sign (PHEM Standard) - Public ReadOnly Property PmaxLaden As Single - Get - Return -PmaxLad - End Get - End Property - - - - '-------------------------------------------------------------------------------------------- - '--------------------------------- ~Renhart Battery model ~ --------------------------------- - '-------------------------------------------------------------------------------------------- - 'Method for initializaztion - it is called once - Public Function Bat_Init() As Boolean - - Dim BFile As New cFile_V3 - Dim FunkTemp As Single ' Temp-Funktion für Ri(Temp) - Dim U0_E As Single ' Ubatt(SOC(T), Ibatt=0), Entladekurve - Dim U0_L As Single ' Ubatt(SOC(T), Ibatt=0), Ladekurve - - 'Abort if there's no file - If sFilePath = "" Then Return False - If Not IO.File.Exists(sFilePath) Then Return False - - - If Not BFile.OpenRead(sFilePath) Then - Return False - End If - - 'Read the Parameters: - a0 = BFile.ReadLine(0) - a1 = BFile.ReadLine(0) - a2 = BFile.ReadLine(0) - a3 = BFile.ReadLine(0) - a4 = BFile.ReadLine(0) - a5 = BFile.ReadLine(0) - a6 = BFile.ReadLine(0) - b0 = BFile.ReadLine(0) - b1 = BFile.ReadLine(0) - b2 = BFile.ReadLine(0) - b3 = BFile.ReadLine(0) - b4 = BFile.ReadLine(0) - b5 = BFile.ReadLine(0) - b6 = BFile.ReadLine(0) - c0 = BFile.ReadLine(0) - c1 = BFile.ReadLine(0) - c2 = BFile.ReadLine(0) - c3 = BFile.ReadLine(0) - c4 = BFile.ReadLine(0) - d0 = BFile.ReadLine(0) - d1 = BFile.ReadLine(0) - d2 = BFile.ReadLine(0) - SOC_MIN = BFile.ReadLine(0) '0..1 SOC_MIN = SOCzulu - SOC_MAX = BFile.ReadLine(0) '0..1 SOC_MAX = SOCzulo - SOC_Kap = BFile.ReadLine(0) '[Ah] - NCELLS = BFile.ReadLine(0) 'Anzahl der NiMH-Zellen - RI_20 = BFile.ReadLine(0) 'RI_20 = RiOhm (abzuklären) - T_AMB = BFile.ReadLine(0) - T_MAX = BFile.ReadLine(0) - CP = BFile.ReadLine(0) - MB = BFile.ReadLine(0) - - BFile.Close() - BFile = Nothing - - TempBat = T_AMB - PbatV = 0.0 - SOC = GEN.SOCstart - LastSOC = MyEV.SOCstart - ' ---------------------------------------------------------------------------------------- - ' Calculation of the Battery-voltage at TempBat and SOC(0), Discharge curve - ' ---------------------------------------------------------------------------------------- - FunkTemp = Ftemp(TempBat) - U0_E = Uent(SOC) - (Uent(1) - Uent(0)) * 1.1 * (1 - FunkTemp) - Ubat = U0_E - ' ---------------------------------------------------------------------------------------- - ' Calculation of the Battery-voltage at TempBat and SOC(0), Charging-curve - ' ---------------------------------------------------------------------------------------- - U0_L = Ulad(SOC) - (Uent(1) - Uent(0)) * 1.1 * (1 - FunkTemp) - ' ---------------------------------------------------------------------------------------- - - - Return True - - End Function - - 'Method of calculating the allowable power - Invoked second by second - Public Sub Bat_Pzul(ByVal t As Integer) - Dim FunkTemp As Single ' Temp-Funktion für Ri(Temp) - Dim U0_E As Single ' Ubatt(SOC(T), Ibatt=0), Entladekurve - Dim U0_L As Single ' Ubatt(SOC(T), Ibatt=0), Ladekurve - - If t < 1 Then - LastTempBat = T_AMB - LastSOC = MyEV.SOCstart - Else - LastTempBat = MyEV.TempBat(t - 1) - LastSOC = MyEV.SOC(t - 1) - End If - - FunkTemp = Ftemp(LastTempBat) - U0_E = Uent(LastSOC) - (Uent(1) - Uent(0.0)) * 1.1 * (1 - FunkTemp) - PmaxEntl = -U0_E ^ 2 / (4.0 * RiTemp(LastTempBat) * 1000.0) ' in kW - U0_L = Ulad(LastSOC) - (Uent(1) - Uent(0.0)) * 1.1 * (1 - FunkTemp) - PmaxLad = U0_L ^ 2 / (4.0 * RiTemp(LastTempBat) * 1000.0) ' in kW - - 'PmaxEntl = -SOC_Kap * 3600 * (SOC(jz - 1) - SOC_MIN) - 'PmaxLad = SOC_Kap * 3600 * (SOC_MAX - SOC(jz - 1)) - - - End Sub - - 'Method of calculating the Batterie-losses and SOC for the given Power - Invoked second by second - Public Sub Bat_Calc(ByVal Perf As Single, ByVal t As Integer) - Dim epsilon As Single = 0.001 ' Abfrageschranke - - If t < 1 Then - LastTempBat = T_AMB - LastSOC = MyEV.SOCstart - Else - LastTempBat = MyEV.TempBat(t - 1) - LastSOC = MyEV.SOC(t - 1) - End If - - Perf *= -1 'Vozeichenwechsel PHEM-Standard => Renhart-Standard - - Select Case Perf - Case Is < -epsilon ' Assistieren (Entladen) der Batterie - ' MsgBox("negativ" + Str(Perf)) - Bat_Ent(Perf) - Case Is > epsilon ' Generieren (Laden) der Batterie - 'MsgBox("positiv" + Str(Perf)) - Bat_Lad(Perf) - Case Else ' Leistung ist zu klein, alles bleibt gleich - 'MsgBox(Str(jz) + ": Betrag von " + Str(Perf) + " ist kleiner gleich " + Str(epsilon)) - Bat_Nix() - End Select - - - 'Input: - ' Perf ... required Power Condition: PgMAX < Perf < PaMAX [kW] - ' all Paramers were determined/read in Bat_Init - ' jz ...Current time-step - ' All arrays from Time-step 1 to jz-1 - - 'Output: - ' SOC(jz) - ' Ubat(jz) - ' Ibat(jz) - ' PbatV(jz) - - '-------------TEST------------- - 'PbatV(jz) = 0.2 * Math.Abs(Perf) - 'SOC(jz) = SOC(jz - 1) + Perf / 5000 - 'Ubat(jz) = (SOC(jz) - SOC_MIN) / (SOC_MAX - SOC_MIN) * 80 + 120 - 'Ibat(jz) = Perf / Ubat(jz) - '-------------TEST------------- - - - - - End Sub - - 'Returns PeBat for the given PiBat (sign from PHEM) - Public Function fPeBat(ByVal PiBat As Single) As Single - If PiBat < 0 Then - Return -fPbatLad(-PiBat) - Else - Return -fPbatEnt(-PiBat) - End If - End Function - - - Public Property FilePath() As String - Get - Return sFilePath - End Get - Set(ByVal value As String) - sFilePath = value - End Set - End Property - - - - '-------------------------------------------------------------------------------------------- - '----------------------------------------- PRIVATE ------------------------------------------ - '-------------------------------------------------------------------------------------------- - - 'Battery discharged - Private Sub Bat_Ent(ByVal Perf As Single) - Dim FunkTemp As Single ' Temp-Funktion für Ri(Temp) - Dim U0_E As Single ' Ubatt(SOC(T), Ibatt=0), Entladekurve - Dim Ri_T As Single ' Ri bei Temperatur T, lokal - - 'Temperature Function - FunkTemp = Ftemp(LastTempBat) - - 'Determine Ri depending on temperature - Ri_T = RiTemp(LastTempBat) - - 'Voltage determined from SOC and Voltage-curve - U0_E = Uent(LastSOC) - (Uent(1) - Uent(0)) * 1.1 * (1 - FunkTemp) - - 'Current calculation - Ibat = -U0_E / 2 / Ri_T + Math.Sqrt((U0_E / 2 / Ri_T) ^ 2 + Perf * 1000 / Ri_T) - - 'Battery-losses - PbatV = Ibat ^ 2 * Ri_T / 1000.0 - - 'Battery-temperature - TempBat = LastTempBat + PbatV * 1000.0 * 1.0 / CP / MB - If TempBat >= T_MAX Then - TempBat = T_MAX - End If - - 'SOC calculation - SOC = LastSOC + Ibat * 1.0 / (SOC_Kap * 3600) - - 'Adjustment for the current time-step - FunkTemp = Ftemp(TempBat) - U0_E = Uent(SOC) - (Uent(1) - Uent(0)) * 1.1 * (1 - FunkTemp) - Ri_T = RiTemp(TempBat) - Ubat = U0_E + Ibat * Ri_T - End Sub - - 'Charging Battery - Private Sub Bat_Lad(ByVal Perf As Single) - Dim FunkTemp As Single ' Temp-Funktion für Ri(Temp) - Dim U0_L As Single ' Ubatt(SOC(T), Ibatt=0), Entladekurve - Dim Ri_T As Single ' Ri bei Temperatur T, lokal - - - 'Temperature-Function - FunkTemp = Ftemp(LastTempBat) - - 'Determine Ri depending on temperature - Ri_T = RiTemp(LastTempBat) - - 'Voltage determined from SOC and Voltage-curve - U0_L = Ulad(LastSOC) - (Ulad(1) - Ulad(0)) * 1.1 * (1 - FunkTemp) - - 'Current calculation - Ibat = +U0_L / 2 / Ri_T - Math.Sqrt((U0_L / 2 / Ri_T) ^ 2 - Perf * 1000 / Ri_T) - - 'Battery-losses - PbatV = Ibat ^ 2 * Ri_T / 1000.0 - - 'Battery-temperature - TempBat = LastTempBat + PbatV * 1000.0 * 1.0 / CP / MB - If TempBat >= T_MAX Then - TempBat = T_MAX - End If - - 'SOC calculation - SOC = LastSOC + Ibat * 1.0 / (SOC_Kap * 3600) - - 'Adjustment for the current time-step - FunkTemp = Ftemp(TempBat) - U0_L = Ulad(SOC) - (Ulad(1) - Ulad(0)) * 1.1 * (1 - FunkTemp) - Ri_T = RiTemp(TempBat) - Ubat = U0_L + Ibat * Ri_T - End Sub - - 'Battery do nothing - Private Sub Bat_Nix() - 'Dim SocProz As Single ' lokal, SOC in Prozent - 'Dim FunkTemp As Single ' Temp-Funktion für Ri(Temp) - 'Dim U0_L As Single ' Ubatt(SOC(T), Ibatt=0), Entladekurve - 'Dim Ri_T As Single ' Ri bei Temperatur T, lokal - - Ibat = 0.0 - PbatV = 0.0 - TempBat = LastTempBat - SOC = LastSOC - ' ALT: Ubat(jz) = Ubat(jz - 1) - End Sub - - - 'Returns PeBat when invoked(Laden) with PEmot (sign from(nach)Renhart) - Private Function fPbatLad(ByVal PEmot As Single) As Single - Dim FunkTemp As Single - Dim U0_L As Single - Dim Ri_T As Single - Dim Ibat0 As Single - Dim PbatV0 As Single - - Ri_T = RiTemp(LastTempBat) - FunkTemp = Ftemp(LastTempBat) - U0_L = Ulad(LastSOC) - (Ulad(1) - Ulad(0)) * 1.1 * (1 - FunkTemp) - - If (PEmot * 1000 / Ri_T) > (U0_L / 2 / Ri_T) ^ 2 Then - Return 0 - Else - Ibat0 = U0_L / 2 / Ri_T - Math.Sqrt((U0_L / 2 / Ri_T) ^ 2 - PEmot * 1000 / Ri_T) - PbatV0 = Ibat0 ^ 2 * Ri_T / 1000.0 - Return PEmot + PbatV0 - End If - - End Function - - 'Return PeBat when Unloaded(Entladen) with PEmot (sign from(nach) Renhart) - Private Function fPbatEnt(ByVal PEmot As Single) As Single - Dim FunkTemp As Single - Dim U0_E As Single - Dim Ri_T As Single - Dim Ibat0 As Single - Dim PbatV0 As Single - - Ri_T = RiTemp(LastTempBat) - FunkTemp = Ftemp(LastTempBat) - U0_E = Uent(LastSOC) - (Uent(1) - Uent(0)) * 1.1 * (1 - FunkTemp) - - Ibat0 = -U0_E / 2 / Ri_T + Math.Sqrt((U0_E / 2 / Ri_T) ^ 2 + PEmot * 1000 / Ri_T) - PbatV0 = Ibat0 ^ 2 * Ri_T / 1000.0 - - Return PEmot - PbatV0 - - End Function - - Private Function Uent(ByVal Socf As Single) As Single - Uent = (a0 + a1 * Socf + a2 * Socf ^ 2 + a3 * Socf ^ 3 + a4 * Socf ^ 4 + a5 * Socf ^ 5 + a6 * Socf ^ 6) * NCELLS - End Function - Private Function Ulad(ByVal Socf As Single) As Single - Ulad = (b0 + b1 * Socf + b2 * Socf ^ 2 + b3 * Socf ^ 3 + b4 * Socf ^ 4 + b5 * Socf ^ 5 + b6 * Socf ^ 6) * NCELLS - End Function - Private Function Ftemp(ByVal Tempf As Single) As Single - Ftemp = c0 + c1 * Tempf + c2 * Tempf ^ 2 + c3 * Tempf ^ 3 + c4 * Tempf ^ 4 - End Function - Private Function RiTemp(ByVal Ri_T As Single) As Single - RiTemp = RI_20 * (2.0 - (d0 + d1 * Ri_T + d2 * Ri_T ^ 2)) - End Function - - - - - - - -End Class diff --git a/VECTO/MODcalc/cMOD.vb b/VECTO/MODcalc/cMOD.vb index c096bab459..318d4ff91c 100644 --- a/VECTO/MODcalc/cMOD.vb +++ b/VECTO/MODcalc/cMOD.vb @@ -2,7 +2,6 @@ Public Class cMOD Public Pe As List(Of Single) - Public nn As List(Of Single) Public nU As List(Of Single) Public nUvorg As List(Of Single) Public dnUvorg As List(Of Single) @@ -10,7 +9,6 @@ Public Class cMOD Public tDimOgl As Integer Public Em As cEm Public Px As cPower - Public TC As cTC Public Vh As cVh Public CylceKin As cCycleKin Public ModOutpName As String @@ -52,11 +50,9 @@ Public Class cMOD Public Sub Init() Pe = New List(Of Single) - nn = New List(Of Single) nU = New List(Of Single) Em = New cEm Px = New cPower - TC = New cTC Vh = New cVh CylceKin = New cCycleKin @@ -86,9 +82,7 @@ Public Class cMOD TCnOut = New List(Of Single) Em.Init() - TC.Init() Vh.Init() - Px.Init() ModErrors = New cModErrors bInit = True End Sub @@ -96,15 +90,11 @@ Public Class cMOD Public Sub CleanUp() If bInit Then Em.CleanUp() - Px.CleanUp() - TC.CleanUp() Vh.CleanUp() Em = Nothing Px = Nothing - TC = Nothing Vh = Nothing Pe = Nothing - nn = Nothing nU = Nothing Proll = Nothing @@ -188,7 +178,7 @@ Public Class cMOD Public Sub CycleInit() - If GEN.VehMode = tVehMode.EngineOnly Then + If GEN.EngOnly Then EngCycleInit() Else VehCycleInit() @@ -218,16 +208,16 @@ Public Class cMOD MODdata.nUvorg = New List(Of Single) MODdata.dnUvorg = New List(Of Single) - L = DRI.Values(tDriComp.nn) + L = DRI.Values(tDriComp.nU) 'Revolutions For s = 0 To tDim - MODdata.nUvorg.Add(((L(s + 1) + L(s)) / 2) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) + MODdata.nUvorg.Add(((L(s + 1) + L(s)) / 2)) Next 'Angular acceleration For s = 0 To tDim - MODdata.dnUvorg.Add((L(s + 1) - L(s)) * (VEH.nNenn - VEH.nLeerl)) + MODdata.dnUvorg.Add(L(s + 1) - L(s)) Next End If @@ -284,17 +274,17 @@ Public Class cMOD MODdata.nUvorg = New List(Of Single) MODdata.dnUvorg = New List(Of Single) - L = DRI.Values(tDriComp.nn) + L = DRI.Values(tDriComp.nU) 'Revolutions For s = 0 To MODdata.tDim - MODdata.nUvorg.Add(L(s) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) + MODdata.nUvorg.Add(L(s)) Next 'Angular acceleration MODdata.dnUvorg.Add(L(1) - L(0)) For s = 1 To MODdata.tDim - 1 - MODdata.dnUvorg.Add((L(s + 1) - L(s - 1)) / 2 * (VEH.nNenn - VEH.nLeerl)) + MODdata.dnUvorg.Add((L(s + 1) - L(s - 1)) / 2) Next MODdata.dnUvorg.Add(L(MODdata.tDim) - L(MODdata.tDim - 1)) @@ -320,10 +310,6 @@ Public Class cMOD Dim Em0 As cEmComp Dim StrKey As String - Dim TcList As New List(Of tMapComp) - 'Dim TC0 As List(Of Single) - Dim TcKey As tMapComp - Dim AuxList As New List(Of String) Dim Gear As Integer @@ -351,7 +337,7 @@ Public Class cMOD '*********** Settings ************** Sepp = "," t1 = MODdata.tDim - If GEN.VehMode = tVehMode.EngineOnly Then + If GEN.EngOnly Then tdelta = 0 Else tdelta = 0.5 @@ -363,19 +349,11 @@ Public Class cMOD EmList.Add(StrKey) Next - If TC.Calculated Then - For Each TcKey In MODdata.TC.TCcomponents.Keys - TcList.Add(TcKey) - Next - End If - For Each StrKey In VEH.AuxRefs.Keys 'Wenn Engine Only dann wird das garnicht verwendet AuxList.Add(StrKey) Next - - f.WriteLine("VECTO modal results") f.WriteLine("VECTO " & VECTOvers) f.WriteLine(Now.ToString) @@ -391,7 +369,7 @@ Public Class cMOD s.Append("time") sU.Append("[s]") - If Not GEN.VehMode = tVehMode.EngineOnly Then + If Not GEN.EngOnly Then s.Append(",dist,v_act,v_targ,acc,grad") sU.Append(",[km],[km/h],[km/h],[m/s^2],[%]") @@ -399,24 +377,10 @@ Public Class cMOD End If - If GEN.ModeHorEV Then - - If Not GEN.VehMode = tVehMode.EV Then - s.Append(",engine speed,Pe,n_norm,Pe_norm") - sU.Append(",[1/min],[kW],[-],[-]") - End If - - s.Append(",engine speed,PeEM,PeBat,PiBat,Ubat,Ibat,SOC") - sU.Append(",[1/min],[kW],[kW],[kW],[V],[A],[-]") - - Else - - s.Append(",n,Tq_eng,Tq_clutch,Tq_full,Tq_drag,Pe_eng,Pe_full,Pe_drag,Pe_clutch,Pa Eng,Paux") - sU.Append(",[1/min],[Nm],[Nm],[Nm],[Nm],[kW],[kW],[kW],[kW],[kW],[kW]") - - End If + s.Append(",n,Tq_eng,Tq_clutch,Tq_full,Tq_drag,Pe_eng,Pe_full,Pe_drag,Pe_clutch,Pa Eng,Paux") + sU.Append(",[1/min],[Nm],[Nm],[Nm],[Nm],[kW],[kW],[kW],[kW],[kW],[kW]") - If Not GEN.VehMode = tVehMode.EngineOnly Then + If Not GEN.EngOnly Then s.Append(",Gear,Ploss GB,Ploss Diff,Ploss Retarder,Pa GB,Pa Veh,Proll,Pair,Pgrad,Pwheel,Pbrake") sU.Append(",[-],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW]") @@ -428,54 +392,24 @@ Public Class cMOD 'Auxiliaries For Each StrKey In AuxList - s.Append(",Paux_" & StrKey) sU.Append(",[kW]") - Next End If - If Cfg.FinalEmOnly Then - - For Each StrKey In EmList + For Each StrKey In EmList - Em0 = Em.EmComp(StrKey) + Em0 = Em.EmComp(StrKey) - If Em0.WriteOutput Then - s.Append(Sepp & Em0.Name) - sU.Append(Sepp & Em0.Unit) - End If - - Next - - Else - - For Each StrKey In EmList - - Em0 = Em.EmComp(StrKey) - - If Em0.WriteOutput Then - - s.Append(Sepp & Em0.Name & "_Raw") - sU.Append(Sepp & Em0.Unit) - - If Em0.TCdef Then - s.Append(Sepp & Em0.Name & "_TC") - sU.Append(Sepp & Em0.Unit) - End If - - If Em0.ATdef Then - s.Append(Sepp & Em0.Name & "_AT") - sU.Append(Sepp & Em0.Unit) - End If - - End If + If Em0.WriteOutput Then + s.Append(Sepp & Em0.Name) + sU.Append(Sepp & Em0.Unit) + End If - Next + Next - End If 'Berechnete Dynamikparameter (Diff zu Kennfeld) |@@| Calculated dynamics parameters (Diff to Map) 'If TC.Calculated Then @@ -502,7 +436,7 @@ Public Class cMOD For t = 0 To t1 'Predefine Gear for FLD assignment - If GEN.VehMode = tVehMode.EngineOnly Then + If GEN.EngOnly Then Gear = 0 Else Gear = .Gear(t) @@ -514,7 +448,7 @@ Public Class cMOD 'Time s.Append(t + DRI.t0 + tdelta) - If Not GEN.VehMode = tVehMode.EngineOnly Then + If Not GEN.EngOnly Then 'Strecke |@@| Route dist += .Vh.V(t) / 1000 @@ -534,105 +468,64 @@ Public Class cMOD End If - If GEN.ModeHorEV Then - - If Not GEN.VehMode = tVehMode.EV Then - - 'Revolutions - s.Append(Sepp & .nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) - - 'Power - s.Append(Sepp & .Pe(t) * VEH.Pnenn) - - 'Revolutions normalized - s.Append(Sepp & .nn(t)) - - 'Power normalized - s.Append(Sepp & .Pe(t)) - - End If - - 'Revolutions in U/min - s.Append(Sepp & .nU(t)) - - 'EM-power in kW - s.Append(Sepp & .Px.PeEMot(t)) - - 'Effective Battery-power - s.Append(Sepp & .Px.PeBat(t)) - - 'Internal Battery-power - s.Append(Sepp & .Px.PiBat(t)) - - 'Battery-voltage - s.Append(Sepp & .Px.Ubat(t)) - - 'Battery-Power - s.Append(Sepp & .Px.Ibat(t)) - - 'SOC - s.Append(Sepp & .Px.SOC(t)) + 'Revolutions + s.Append(Sepp & .nU(t)) + If Math.Abs(2 * Math.PI * .nU(t) / 60) < 0.00001 Then + s.Append(Sepp & "-" & Sepp & "-" & Sepp & "-" & Sepp & "-") Else - 'Revolutions - s.Append(Sepp & .nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) - - If Math.Abs(2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) < 0.00001 Then - s.Append(Sepp & "-" & Sepp & "-" & Sepp & "-" & Sepp & "-") - Else + 'Torque + s.Append(Sepp & 1000 * .Pe(t) / (2 * Math.PI * .nU(t) / 60)) - 'Torque - s.Append(Sepp & 1000 * .Pe(t) * VEH.Pnenn / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60)) + 'Torque at clutch + s.Append(Sepp & 1000 * (.Pe(t) - .PaEng(t) - .PauxSum(t)) / (2 * Math.PI * .nU(t) / 60)) - 'Torque at clutch - s.Append(Sepp & 1000 * (.Pe(t) * VEH.Pnenn - .PaEng(t) - .PauxSum(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60)) - - 'Full-load and Drag torque - If .EngState(t) = tEngState.Stopped Then - s.Append(Sepp & "-" & Sepp & "-") + 'Full-load and Drag torque + If .EngState(t) = tEngState.Stopped Then + s.Append(Sepp & "-" & Sepp & "-") + Else + If t = 0 Then + s.Append(Sepp & 1000 * FLD(Gear).Pfull(.nU(t)) / (2 * Math.PI * .nU(t) / 60) & Sepp & 1000 * FLD(Gear).Pdrag(.nU(t)) / (2 * Math.PI * .nU(t) / 60)) Else - If t = 0 Then - s.Append(Sepp & 1000 * FLD(Gear).Pfull(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) & Sepp & 1000 * FLD(Gear).Pdrag(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60)) - Else - s.Append(Sepp & 1000 * FLD(Gear).Pfull(.nn(t), .Pe(t - 1)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) & Sepp & 1000 * FLD(Gear).Pdrag(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60)) - End If + s.Append(Sepp & 1000 * FLD(Gear).Pfull(.nU(t), .Pe(t - 1)) / (2 * Math.PI * .nU(t) / 60) & Sepp & 1000 * FLD(Gear).Pdrag(.nU(t)) / (2 * Math.PI * .nU(t) / 60)) End If - End If - 'Power - s.Append(Sepp & .Pe(t) * VEH.Pnenn) + End If - 'Revolutions normalized - 's.Append(Sepp & .nn(t)) + 'Power + s.Append(Sepp & .Pe(t)) - 'Power normalized - 's.Append(Sepp & .Pe(t)) + 'Revolutions normalized + 's.Append(Sepp & .nn(t)) - 'Full-load and Drag - If .EngState(t) = tEngState.Stopped Then - s.Append(Sepp & "-" & Sepp & "-") + 'Power normalized + 's.Append(Sepp & .Pe(t)) + + 'Full-load and Drag + If .EngState(t) = tEngState.Stopped Then + s.Append(Sepp & "-" & Sepp & "-") + Else + If t = 0 Then + s.Append(Sepp & FLD(Gear).Pfull(.nU(t)) & Sepp & FLD(Gear).Pdrag(.nU(t))) Else - If t = 0 Then - s.Append(Sepp & FLD(Gear).Pfull(.nn(t)) & Sepp & FLD(Gear).Pdrag(.nn(t))) - Else - s.Append(Sepp & FLD(Gear).Pfull(.nn(t), .Pe(t - 1)) & Sepp & FLD(Gear).Pdrag(.nn(t))) - End If + s.Append(Sepp & FLD(Gear).Pfull(.nU(t), .Pe(t - 1)) & Sepp & FLD(Gear).Pdrag(.nU(t))) End If + End If - 'Power at Clutch - s.Append(Sepp & .Pe(t) * VEH.Pnenn - .PaEng(t) - .PauxSum(t)) + 'Power at Clutch + s.Append(Sepp & .Pe(t) - .PaEng(t) - .PauxSum(t)) - 'PaEng - s.Append(Sepp & .PaEng(t)) + 'PaEng + s.Append(Sepp & .PaEng(t)) - 'Aux.. - s.Append(Sepp & .PauxSum(t)) + 'Aux.. + s.Append(Sepp & .PauxSum(t)) - End If - If Not GEN.VehMode = tVehMode.EngineOnly Then + + If Not GEN.EngOnly Then 'Gear s.Append(Sepp & .Gear(t)) @@ -677,45 +570,23 @@ Public Class cMOD End If - If Cfg.FinalEmOnly Then - - 'Final-emissions (tailpipe) - For Each StrKey In EmList - - Em0 = .Em.EmComp(StrKey) + 'Final-emissions (tailpipe) + For Each StrKey In EmList - If Em0.WriteOutput Then + Em0 = .Em.EmComp(StrKey) - If Em0.FinalVals(t) > -0.0001 Then - s.Append(Sepp & Em0.FinalVals(t)) - Else - s.Append(Sepp & "ERROR") - End If + If Em0.WriteOutput Then + If Em0.FinalVals(t) > -0.0001 Then + s.Append(Sepp & Em0.FinalVals(t)) + Else + s.Append(Sepp & "ERROR") End If - Next - - Else - - For Each StrKey In EmList - - Em0 = .Em.EmComp(StrKey) - - If Em0.WriteOutput Then - 'Raw-emissions - s.Append(Sepp & Em0.RawVals(t)) - - 'TC-Emissions - If Em0.TCdef Then s.Append(Sepp & Em0.TCVals(t)) - - 'AT-Emissions (EXS) - If Em0.ATdef Then s.Append(Sepp & Em0.ATVals(t)) - End If + End If - Next + Next - End If 'Calculated Dynamics-parameters (Diff from(zu) Map) 'If TC.Calculated Then @@ -841,7 +712,7 @@ Public Class cMOD End Class - + diff --git a/VECTO/MODcalc/cPower.vb b/VECTO/MODcalc/cPower.vb index 72fb8a279a..1e733e3b5c 100644 --- a/VECTO/MODcalc/cPower.vb +++ b/VECTO/MODcalc/cPower.vb @@ -5,9 +5,6 @@ Public Class cPower Private Kuppln_norm As Single '... Einschleifdrehzahl Kupplung (Modell nach Leistg/Schinagl) Private KupplEta As Single '... Wirkungsgrad schleifende Kupplung - Private bHEVinit As Boolean - Private bHorEVinit As Boolean - 'Settings Private Gvorg As Boolean Private Nvorg As Boolean @@ -37,131 +34,6 @@ Public Class cPower Public Positions As New List(Of Short) - Public Sub New() - bHEVinit = False - bHorEVinit = False - End Sub - - -#Region "Schaltmodell Variablen" - - Private GangH() As Integer - Private GangL() As Integer - - Private avh(20) As Single - Private avl(20) As Single - -#End Region - -#Region "(H)EV Variablen" - - Private EMO As cEMO - Private HEV As cHEVctrl - - Public PeEMot As List(Of Single) - Public PiEMot As List(Of Single) - Public PeBat As List(Of Single) - Public PiBat As List(Of Single) - Public SOC As List(Of Single) - Public Ubat As List(Of Single) - Public Ibat As List(Of Single) - Public BAT As cBatModel - Public TempBat As List(Of Single) - Public HEVmode As List(Of tHEVparMode) - - Public SOCstart As Single - - Private PeBatMax As Single - Private PeBatMin As Single - - Private ULok As Boolean = True - - Private PeUL As Single - - Private PeL As List(Of Single) - Private PiL As List(Of Single) - Private nnL As List(Of Single) - Private WGL As List(Of Single) - Private Ldim As Integer - - 'Recuperation - ' Project HERO - BMW Mini Hybrid - ' Standard Mini One D Wheelbase 2467 mm - Private lSHv As Single = 1.2335 'Annahme 50/50 (Laut Internet Gewichtsverteilung vom MINI E) - Private lSHh As Single = 1.2335 - 'Specification of Center-of-gravity height (approximation) - ' from http://www.colliseum.net/wiki/Schwerpunkth% C3% B6he - ' X = 0.2 * m / 1000 = h/R - ' with R = 2467 [m], and m = 1335 [kg] - Private hSH As Single = 0.659 - Private RekupVorne As Boolean = True - Private muReifStr As Single = 1 - Private RekupS As Single = 1.25 - Private RekupVo As Single = 10 / 3.6 'Geschw. bei der Übergang zu rein mechanischen Bremsen beginnt - Private RekupVu As Single = 6 / 3.6 'Geschw. bei der Übergang zu rein mechanischen Bremsen endet - -#End Region - - Public Sub Init() - - ReDim GangH(40000) - ReDim GangL(40000) - bHEVinit = False - bHorEVinit = False - - If GEN.ModeHorEV Then - - PeEMot = New List(Of Single) - PiEMot = New List(Of Single) - PeBat = New List(Of Single) - PiBat = New List(Of Single) - Ubat = New List(Of Single) - Ibat = New List(Of Single) - SOC = New List(Of Single) - TempBat = New List(Of Single) - BAT = New cBatModel(Me) - bHorEVinit = True - - If Not GEN.VehMode = tVehMode.EV Then - HEV = New cHEVctrl - EMO = New cEMO - bHEVinit = True - End If - - End If - - End Sub - - Public Sub CleanUp() - - ReDim GangH(0) - ReDim GangL(0) - - If bHorEVinit Then - - BAT.CleanUp() - PeEMot = Nothing - PiEMot = Nothing - PeBat = Nothing - PiBat = Nothing - Ubat = Nothing - Ibat = Nothing - SOC = Nothing - TempBat = Nothing - BAT = Nothing - SOCstart = 0 - bHorEVinit = False - - If bHEVinit Then - HEV.CleanUp() - HEV = Nothing - EMO.CleanUp() - EMO = Nothing - bHEVinit = False - End If - - End If - End Sub Public Function PreRun() As Boolean Dim i As Integer @@ -178,7 +50,6 @@ Public Class cPower Dim Paux As Single Dim Gear As Integer Dim nU As Single - Dim nn As Single Dim vCoasting As Single Dim Vmax As Single Dim Vmin As Single @@ -317,8 +188,6 @@ Public Class cPower 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) @@ -341,7 +210,7 @@ Public Class cPower End If 'Full load / motoring - Pmin = FLD(Gear).Pdrag(nn) + Pmin = FLD(Gear).Pdrag(nU) If Vist >= GEN.vMin / 3.6 Then @@ -545,12 +414,10 @@ Public Class cPower Dim i As Integer Dim M As Single - Dim nn As Single Dim nU As Single Dim omega_p As Single Dim omega1 As Single Dim omega2 As Single - Dim nnx As Single Dim nUx As Single Dim PminX As Single @@ -644,15 +511,9 @@ Public Class cPower TracIntrOn = False TracIntrTurnOff = False - If GEN.izykwael = 4 Then - 'never - Kuppln_norm = 0.05 - KupplEta = 0.4 - Else - 'always - Kuppln_norm = 0.03 - KupplEta = 1 - End If + Kuppln_norm = 0.03 + KupplEta = 1 + LastClutch = tEngClutch.Opened @@ -703,43 +564,39 @@ lbGschw: GoTo lbGschw End If - 'a_DesMax - If GEN.DesMaxJa Then - - 'Check if Acceleration is too high - amax = GEN.aDesMax(Vist) - - If amax < 0.0001 Then - WorkerMsg(tMsgID.Err, "aDesMax(acc) invalid! v= " & Vist & ", aDesMax(acc) =" & amax, MsgSrc) - Return False - End If - - If aist > amax + 0.0001 Then + 'Check if Acceleration is too high + amax = GEN.aDesMax(Vist) - 'Vh.SetSpeed0(jz, Vh.V0(jz) + amax) - Vh.SetMaxAcc(jz) + If amax < 0.0001 Then + WorkerMsg(tMsgID.Err, "aDesMax(acc) invalid! v= " & Vist & ", aDesMax(acc) =" & amax, MsgSrc) + Return False + End If - GoTo lbGschw + If aist > amax + 0.0001 Then + 'Vh.SetSpeed0(jz, Vh.V0(jz) + amax) + Vh.SetMaxAcc(jz) - ElseIf FirstSecItar Then 'this is necessary to avoid speed reduction failure + GoTo lbGschw - 'Check whether Deceleration too high - amax = GEN.aDesMin(Vist) - If amax > -0.001 Then - WorkerMsg(tMsgID.Err, "aDesMax(dec) invalid! v= " & Vist & ", aDesMax(dec) =" & amax, MsgSrc) - Return False - End If - If aist < amax - 0.0001 Then - Vh.SetSpeed0(jz, Vh.V0(jz) + amax) - GoTo lbGschw - End If + ElseIf FirstSecItar Then 'this is necessary to avoid speed reduction failure + 'Check whether Deceleration too high + amax = GEN.aDesMin(Vist) + If amax > -0.001 Then + WorkerMsg(tMsgID.Err, "aDesMax(dec) invalid! v= " & Vist & ", aDesMax(dec) =" & amax, MsgSrc) + Return False End If + If aist < amax - 0.0001 Then + Vh.SetSpeed0(jz, Vh.V0(jz) + amax) + GoTo lbGschw + End If + End If + 'From Power ----- If aist < 0 Then If (Vist < 0.025) Then @@ -862,8 +719,8 @@ lbGschw: Return False End If - 'Eco-Roll - If Vh.EcoRoll(jz) AndAlso PvorD < 0.01 * VEH.Pnenn Then + 'Eco-Roll (triggers if Pwheel < 2 [kW]) + If Vh.EcoRoll(jz) AndAlso PvorD < 2 Then Clutch = tEngClutch.Opened Gear = 0 End If @@ -894,9 +751,9 @@ lbCheck: 'Check whether idling although Power > 0 - ' wenn Leistung vor Diff > 0.1% von Nennleistung dann Korrigieren! |@@| when Power before?(vor) Diff > 0.1% of Nominal-power, then Correct! + ' if power at wheels > 0.2 [kW], then clutch in If Clutch = tEngClutch.Opened Then - If PvorD > 0.001 * VEH.Pnenn Then + If PvorD > 0.2 Then If TracIntrOn Then Gear = TracIntrGear @@ -921,19 +778,19 @@ lbCheck: '*** If Revolutions specified then the next block is skipped *** If Nvorg Then - nn = (MODdata.nUvorg(jz) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + nU = MODdata.nUvorg(jz) 'If Start/Stop then it will be set at the same nn < -0.05 to nU = 0 - If GEN.StartStop And nn < Cfg.nnormEngStop Then + If GEN.StartStop And nU < VEH.nLeerl - 100 Then If Pplus Then - nn = 0 + nU = VEH.nLeerl If FirstSecItar Then WorkerMsg(tMsgID.Warn, "target rpm < rpm_idle while power demand > 0", MsgSrc & "/t= " & jz + 1) Else - nn = (0 - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + nU = 0 End If End If - If nn < -0.02 And Not GEN.StartStop Then + If nU < VEH.nLeerl - 100 And Not GEN.StartStop Then If FirstSecItar Then WorkerMsg(tMsgID.Warn, "target rpm < rpm_idle (Start/Stop disabled)", MsgSrc & "/t= " & jz + 1) End If @@ -944,17 +801,15 @@ lbCheck: 'Revolutions drop when decoupling If Clutch = tEngClutch.Opened Then If jz = 0 Then - nn = 0 + nU = VEH.nLeerl Else - If MODdata.nn(jz - 1) <= 0.00001 Then - nn = MODdata.nn(jz - 1) + If MODdata.nU(jz - 1) <= VEH.nLeerl + 0.00001 Then + nU = MODdata.nU(jz - 1) GoTo lb_nOK End If - - nnx = MODdata.nn(jz - 1) nUx = MODdata.nU(jz - 1) omega1 = nUx * 2 * Math.PI / 60 Pmin = 0 @@ -962,13 +817,13 @@ lbCheck: i = 0 Do PminX = Pmin - Pmin = FLD(Gear).Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) + Pmin = FLD(Gear).Pdrag(nU) 'Leistungsabfall limitieren auf Pe(t-1) minus 75% von (Pe(t-1) - Pschlepp) |@@| Limit Power-drop to Pe(t-1) minus 75% of (Pe(t-1) - Pdrag) ' aus Auswertung ETC des Motors mit dem dynamische Volllast parametriert wurde |@@| of the evaluated ETC of the Enginges with the dynamic parametrized Full-load ' Einfluss auf Beschleunigungsvermögen gering (Einfluss durch Pe(t-1) bei dynamischer Volllast mit PT1) |@@| Influence at low acceleration (influence dynamic Full-load through Pe(t-1) with PT1) ' Luz/Rexeis 21.08.2012 ' Iteration loop: 01.10.2012 - P = MODdata.Pe(jz - 1) * VEH.Pnenn - 0.75 * (MODdata.Pe(jz - 1) * VEH.Pnenn - Pmin) + P = MODdata.Pe(jz - 1) - 0.75 * (MODdata.Pe(jz - 1) - Pmin) M = -P * 1000 * 60 / (2 * Math.PI * nU) 'original: M = -Pmin * 1000 * 60 / (2 * Math.PI * ((nU + nUx) / 2)) omega_p = M / VEH.I_mot @@ -984,7 +839,7 @@ lbCheck: 'If i = 999 Then WorkerMsg(tMsgID.Warn, "i=999", MsgSrc & "/t= " & jz + 1) - nn = (Math.Max(VEH.nLeerl, nU) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + nU = Math.Max(VEH.nLeerl, nU) MODdata.ModErrors.FLDextrapol = "" @@ -1011,25 +866,25 @@ lbCheck: GoTo lbGschw End If - nn = (GBX.TCnUin - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + nU = GBX.TCnUin Else - nn = fnn(Vist, Gear, Clutch = tEngClutch.Slipping) + nU = fnU(Vist, Gear, Clutch = tEngClutch.Slipping) '*** Start: Revolutions Check 'Check whether Revolutions too high! => Upshift - Do While nn > 1.2 And Gear < VEH.ganganz + Do While nU > 1.2 * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl And Gear < VEH.ganganz Gear += 1 - nn = fnn(Vist, Gear, Clutch = tEngClutch.Slipping) + nU = fnU(Vist, Gear, Clutch = tEngClutch.Slipping) Loop 'Check whether Revolutions too low with the Clutch closed If Clutch = tEngClutch.Closed Then - If nn < 0.0001 Then + If nU < VEH.nLeerl + 0.0001 Then Gear -= 1 - nn = fnn(Vist, Gear, Clutch = tEngClutch.Slipping) + nU = fnU(Vist, Gear, Clutch = tEngClutch.Slipping) End If End If @@ -1044,8 +899,7 @@ lb_nOK: '************************************ Determine Engine-state ************************************ - ' fix nn here! - nU = nn * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl + ' nU is final here! 'Determine next Consumption (from VEH and DRI) Paux = fPaux(jz, nU) @@ -1106,7 +960,7 @@ lb_nOK: 'EngState If Clutch = tEngClutch.Opened Then - Select Case P / VEH.Pnenn + Select Case P Case Is > 0.0001 'Antrieb EngState0 = tEngState.Load @@ -1156,16 +1010,15 @@ lb_nOK: 'Revolutions Correction nU = 0 - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) Else - Pmin = FLD(Gear).Pdrag(nn) + Pmin = FLD(Gear).Pdrag(nU) If jz = 0 Then - Pmax = FLD(Gear).Pfull(nn) + Pmax = FLD(Gear).Pfull(nU) Else - Pmax = FLD(Gear).Pfull(nn, MODdata.Pe(jz - 1)) + Pmax = FLD(Gear).Pfull(nU, MODdata.Pe(jz - 1)) End If 'If Pmax < 0 or Pmin > 0 then Abort with Error! @@ -1322,8 +1175,7 @@ lb_nOK: End If 'Write Modal-values Fields - MODdata.Pe.Add(P / VEH.Pnenn) - MODdata.nn.Add(nn) + MODdata.Pe.Add(P) MODdata.nU.Add(nU) MODdata.EngState.Add(EngState0) @@ -1470,9 +1322,9 @@ lb_nOK: Dim Pmr As Single Dim t As Integer Dim t1 As Integer - Dim PminN As Single - Dim PmaxN As Single - Dim nnDRI As List(Of Double) + Dim Pmin As Single + Dim Pmax As Single + Dim nUDRI As List(Of Double) Dim PeDRI As List(Of Double) Dim PcorCount As Integer Dim StdMode As Boolean @@ -1491,13 +1343,12 @@ lb_nOK: PcorCount = 0 t1 = MODdata.tDim - nnDRI = DRI.Values(tDriComp.nn) + nUDRI = DRI.Values(tDriComp.nU) PeDRI = DRI.Values(tDriComp.Pe) 'Drehzahlen vorher weil sonst scheitert die Pmr-Berechnung bei MODdata.nU(t + 1) |@@| Revolutions previously, otherwise Pmr-calculation fails at MODdata.nU(t + 1) For t = 0 To t1 - MODdata.nn.Add(nnDRI(t)) - MODdata.nU.Add(Math.Max(0, nnDRI(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl)) + MODdata.nU.Add(Math.Max(0, nUDRI(t))) Next 'Power calculation @@ -1519,48 +1370,48 @@ lb_nOK: Padd = MODdata.Vh.Padd(t) 'Power = P_clutch + + Pa_eng + Padd - MODdata.Pe.Add(PeDRI(t) + (Pmr + Padd) / VEH.Pnenn) + MODdata.Pe.Add(PeDRI(t) + (Pmr + Padd)) 'Revolutions of the Cycle => Determined in Cycle-init 'If Revolutions under idle, assume Engine is stopped - If MODdata.nn(t) < Cfg.nnormEngStop Then + If MODdata.nU(t) < VEH.nLeerl - 100 Then EngState0 = tEngState.Stopped Else - PminN = FLD(0).Pdrag(MODdata.nn(t)) / VEH.Pnenn + Pmin = FLD(0).Pdrag(MODdata.nU(t)) If t = 0 Then - PmaxN = FLD(0).Pfull(MODdata.nn(t)) / VEH.Pnenn + Pmax = FLD(0).Pfull(MODdata.nU(t)) Else - PmaxN = FLD(0).Pfull(MODdata.nn(t), MODdata.Pe(t - 1)) / VEH.Pnenn + Pmax = FLD(0).Pfull(MODdata.nU(t), MODdata.Pe(t - 1)) End If 'If Pmax < 0 or Pmin > 0 then Abort with Error! - If PminN >= 0 AndAlso MODdata.Pe(t) < 0 Then + If Pmin >= 0 AndAlso MODdata.Pe(t) < 0 Then WorkerMsg(tMsgID.Err, "Pe_drag > 0! n= " & MODdata.nU(t) & " [1/min]", MsgSrc & "/t= " & t + 1, FLD(0).FilePath) Return False - ElseIf PmaxN <= 0 AndAlso MODdata.Pe(t) > 0 Then + ElseIf Pmax <= 0 AndAlso MODdata.Pe(t) > 0 Then WorkerMsg(tMsgID.Err, "Pe_full < 0! n= " & MODdata.nU(t) & " [1/min]", MsgSrc & "/t= " & t + 1, FLD(0).FilePath) Return False End If 'FLD Check - If MODdata.Pe(t) > PmaxN Then - If MODdata.Pe(t) / PmaxN > 1.05 Then PcorCount += 1 - MODdata.Pe(t) = PmaxN - ElseIf MODdata.Pe(t) < PminN Then - If MODdata.Pe(t) / PminN And MODdata.Pe(t) > -99999 > 1.05 Then PcorCount += 1 - MODdata.Pe(t) = PminN + If MODdata.Pe(t) > Pmax Then + If MODdata.Pe(t) / Pmax > 1.05 Then PcorCount += 1 + MODdata.Pe(t) = Pmax + ElseIf MODdata.Pe(t) < Pmin Then + If MODdata.Pe(t) / Pmin And MODdata.Pe(t) > -99999 > 1.05 Then PcorCount += 1 + MODdata.Pe(t) = Pmin End If Select Case MODdata.Pe(t) Case Is > 0.0001 'Antrieb - If Math.Abs(MODdata.Pe(t) / PmaxN - 1) < 0.01 Then + If Math.Abs(MODdata.Pe(t) / Pmax - 1) < 0.01 Then EngState0 = tEngState.FullLoad Else EngState0 = tEngState.Load End If Case Is < -0.0001 'Schlepp - If MODdata.Pe(t) < 1.01 * PminN Then + If MODdata.Pe(t) < 1.01 * Pmin Then EngState0 = tEngState.FullDrag Else EngState0 = tEngState.Drag @@ -1594,12 +1445,10 @@ lb_nOK: Dim omega_p As Single Dim omega1 As Single Dim omega2 As Single - Dim nnx As Single Dim nUx As Single Dim i As Integer - nnx = MODdata.nn(t - 1) nUx = MODdata.nU(t - 1) omega1 = nUx * 2 * Math.PI / 60 Pmin = 0 @@ -1608,13 +1457,13 @@ lb_nOK: Do PminX = Pmin - Pmin = FLD(gear).Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) + Pmin = FLD(Gear).Pdrag(nU) 'Leistungsabfall limitieren auf Pe(t-1) minus 75% von (Pe(t-1) - Pschlepp) |@@| Limit Power-drop to Pe(t-1) minus 75% of (Pe(t-1) - Pdrag) ' aus Auswertung ETC des Motors mit dem dynamische Volllast parametriert wurde |@@| of the evaluated ETC of the Enginges with the dynamic parametrized Full-load ' Einfluss auf Beschleunigungsvermögen gering (Einfluss durch Pe(t-1) bei dynamischer Volllast mit PT1) |@@| Influence at low acceleration (influence dynamic Full-load through Pe(t-1) with PT1) ' Luz/Rexeis 21.08.2012 ' Iteration loop: 01.10.2012 - P = MODdata.Pe(t - 1) * VEH.Pnenn - 0.75 * (MODdata.Pe(t - 1) * VEH.Pnenn - Pmin) + P = MODdata.Pe(t - 1) - 0.75 * (MODdata.Pe(t - 1) - Pmin) M = -P * 1000 * 60 / (2 * Math.PI * nU) 'original: M = -Pmin * 1000 * 60 / (2 * Math.PI * ((nU + nUx) / 2)) omega_p = M / VEH.I_mot @@ -1720,7 +1569,7 @@ lb_nOK: vstep = 5 nU = fnU(v, Gear, False) - Pdrag = FLD(Gear).Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) + Pdrag = FLD(Gear).Pdrag(nU) 'Do not allow positive road gradients Grad = MODdata.Vh.fGrad(s) @@ -1729,7 +1578,7 @@ lb_nOK: PvD = fPvD(t, v, a, Grad) Pe = PvD + fPlossGB(PvD, v, Gear, True) + fPlossDiff(PvD, v, True) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear, v, a) - Diff = Math.Abs(Pdrag - Pe) / VEH.Pnenn + Diff = Math.Abs(Pdrag - Pe) If Diff > DEV.SpeedPeEps Then vVorz = 1 @@ -1758,14 +1607,14 @@ lb_nOK: End If nU = fnU(v, Gear, False) - Pdrag = FLD(Gear).Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) + Pdrag = FLD(Gear).Pdrag(nU) LastDiff = Diff PvD = fPvD(t, v, a, Grad) Pe = PvD + fPlossGB(PvD, v, Gear, True) + fPlossDiff(PvD, v, True) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear, v, a) - Diff = Math.Abs(Pdrag - Pe) / VEH.Pnenn + Diff = Math.Abs(Pdrag - Pe) Loop @@ -1815,23 +1664,21 @@ lb_nOK: Dim Gear As Integer Dim Md As Single Dim nU As Single - Dim nn As Single - Dim nnUp As Single - Dim nnDown As Single + Dim nUup As Single + Dim nUdown 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) + nUup = GBX.fGSnUup(Md) + nUdown = GBX.fGSnUdown(Md) - If nn > nnDown Then Return Gear + If nU > nUdown Then Return Gear Next @@ -1843,11 +1690,10 @@ lb_nOK: Private Function fStartGear(ByVal t As Integer, ByVal Grad As Single) As Integer Dim Gear As Integer - Dim nn As Single Dim MsgSrc As String Dim nU As Single - Dim nnUp As Single - Dim nnDown As Single + Dim nUup As Single + Dim nUdown As Single Dim Md As Single Dim Pe As Single Dim MdMax As Single @@ -1863,30 +1709,27 @@ lb_nOK: 'rpm nU = fnU(Vist, Gear, Clutch = tEngClutch.Slipping) - 'normalized rpm - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - 'full load - Pmax = FLD(Gear).Pfull(nn) + Pmax = FLD(Gear).Pfull(nU) 'power demand - cut at full load / drag so that fGSnnUp and fGSnnDown don't extrapolate - Pe = Math.Min(fPeGearMod(Gear, t, Grad) * VEH.Pnenn, Pmax) - Pe = Math.Max(Pe, FLD(Gear).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear, t, Grad), Pmax) + Pe = Math.Max(Pe, FLD(Gear).Pdrag(nU)) 'torque demand Md = Pe * 1000 / (nU * 2 * Math.PI / 60) 'Up/Downshift rpms - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nUup = GBX.fGSnUup(Md) + nUdown = GBX.fGSnUdown(Md) 'Max torque MdMax = Pmax * 1000 / (nU * 2 * Math.PI / 60) 'Find highest gear with rpm below Upshift-rpm and with enough torque reserve - If nn < nnUp And nn > nnDown And 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 Then + If nU < nUup And nU > nUdown And 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 Then Exit For - ElseIf nn > nnUp And Gear < VEH.ganganz Then + ElseIf nU > nUup And Gear < VEH.ganganz Then MODdata.ModErrors.GSextrapol = "" Return Gear + 1 End If @@ -1901,29 +1744,24 @@ lb_nOK: 'rpm at StartSpeed [m/s] nU = GBX.gs_StartSpeed * 60.0 * VEH.AchsI * VEH.Igetr(Gear) / (VEH.Dreifen * Math.PI) - 'normalized rpm - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - 'full load - Pmax = FLD(Gear).Pfull(nn) + Pmax = FLD(Gear).Pfull(nU) 'Max torque MdMax = Pmax * 1000 / (nU * 2 * Math.PI / 60) 'power demand - Pe = Math.Min(fPeGearMod(Gear, t, GBX.gs_StartSpeed, GBX.gs_StartAcc, Grad) * VEH.Pnenn, Pmax) - Pe = Math.Max(Pe, FLD(Gear).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear, t, GBX.gs_StartSpeed, GBX.gs_StartAcc, Grad), Pmax) + Pe = Math.Max(Pe, FLD(Gear).Pdrag(nU)) 'torque demand Md = Pe * 1000 / (nU * 2 * Math.PI / 60) 'Up/Downshift rpms - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) - - ' Debug.Print(CurrentCycleFile & "," & Gear & "," & Md & "," & MdMax & "," & nn & "," & nnDown & "," & nnUp) + nUup = GBX.fGSnUup(Md) + nUdown = GBX.fGSnUdown(Md) - If nn > nnDown And nU >= VEH.nLeerl And (1 - Md / MdMax >= GBX.gs_TorqueResvStart / 100 Or Md < 0) Then Exit For + If nU > nUdown And nU >= VEH.nLeerl And (1 - Md / MdMax >= GBX.gs_TorqueResvStart / 100 Or Md < 0) Then Exit For Next @@ -1940,9 +1778,8 @@ lb_nOK: Dim LastGear As Int16 Dim tx As Int16 Dim nU As Single - Dim nn As Single - Dim nnUp As Single - Dim nnDown As Single + Dim nUup As Single + Dim nUdown As Single Dim Md As Single Dim Pe As Single Dim OutOfRpmRange As Boolean @@ -1968,9 +1805,8 @@ lb_nOK: 'Rpm nU = MODdata.nU(t - 1) - nn = MODdata.nn(t - 1) - OutOfRpmRange = (nn >= 1.2 Or nU < VEH.nLeerl) + OutOfRpmRange = (nU >= 1.2 * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl Or nU < VEH.nLeerl) 'No gear change 3s after last one -except rpm out of range If Not OutOfRpmRange AndAlso t - LastGearChange <= GBX.gs_ShiftTime And t > GBX.gs_ShiftTime - 1 Then Return LastGear @@ -1978,24 +1814,24 @@ lb_nOK: 'previous power demand - Pe = MODdata.Pe(t - 1) * VEH.Pnenn + Pe = MODdata.Pe(t - 1) 'previous torque demand Md = Pe * 1000 / (nU * 2 * Math.PI / 60) 'Up/Downshift rpms - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nUup = GBX.fGSnUup(Md) + nUdown = GBX.fGSnUdown(Md) - If nn > nnUp Then + If nU > nUup Then - If fnn(Vist, LastGear + 1, False) > nnDown Then + If fnn(Vist, LastGear + 1, False) > nUdown Then Return LastGear + 1 Else Return LastGear End If - ElseIf nn < nnDown Then + ElseIf nU < nUdown Then Return LastGear - 1 Else Return LastGear @@ -2006,7 +1842,6 @@ lb_nOK: Private Function fGearVECTO(ByVal t As Integer, ByVal Grad As Single) As Integer Dim nU As Single - Dim nn As Single Dim nnUp As Single Dim nnDown As Single Dim Md As Single @@ -2046,9 +1881,8 @@ lb_nOK: Loop nU = CSng(Vist * 60.0 * VEH.AchsI * VEH.Igetr(LastGear) / (VEH.Dreifen * Math.PI)) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - OutOfRpmRange = (nn >= 1.2 Or nU < VEH.nLeerl) + OutOfRpmRange = ((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) >= 1.2 Or nU < VEH.nLeerl) 'No gear change 3s after last one -except rpm out of range If Not OutOfRpmRange AndAlso t - LastGearChange <= GBX.gs_ShiftTime And t > GBX.gs_ShiftTime - 1 Then Return LastGear @@ -2073,23 +1907,20 @@ lb_nOK: 'Current rpm with previous gear nU = fnU(Vist, LastGear, Clutch = tEngClutch.Slipping) - 'Current normalized rpm with previous gear - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - 'Current power demand with previous gear - Pe = Math.Min(fPeGearMod(LastGear, t, grad) * VEH.Pnenn, FLD(LastGear).Pfull(nn)) - Pe = Math.Max(Pe, FLD(LastGear).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(LastGear, t, Grad), FLD(LastGear).Pfull(nU)) + Pe = Math.Max(Pe, FLD(LastGear).Pdrag(nU)) 'Current torque demand with previous gear Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - MdMax = FLD(LastGear).Pfull(nn, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) + MdMax = FLD(LastGear).Pfull(nU, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) 'Up/Downshift rpms - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Compare rpm with Up/Downshift rpms - If nn <= nnDown And LastGear > 1 Then + If nU <= nnDown And LastGear > 1 Then 'Shift DOWN Gear = LastGear - 1 @@ -2099,18 +1930,17 @@ lb_nOK: 'Calculate Shift-rpm for lower gear nU = fnU(Vist, Gear - 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Continue only if rpm (for lower gear) is above idling - If nn >= 0 Then - Pe = Math.Min(fPeGearMod(Gear - 1, t, Grad) * VEH.Pnenn, FLD(Gear - 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear - 1).Pdrag(nn)) + If nU >= VEH.nLeerl Then + Pe = Math.Min(fPeGearMod(Gear - 1, t, Grad), FLD(Gear - 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear - 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Shift down as long as Gear > 1 and rpm is below UpShift-rpm - Do While Gear > 1 AndAlso nn < nnUp + Do While Gear > 1 AndAlso nU < nnUp 'Shift DOWN Gear -= 1 @@ -2120,16 +1950,15 @@ lb_nOK: 'Calculate Shift-rpm for lower gear nU = fnU(Vist, Gear - 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Continue only if rpm (for lower gear) is above idling - If nn < 0 Then Exit Do + If nU < VEH.nLeerl Then Exit Do - Pe = Math.Min(fPeGearMod(Gear - 1, t, Grad) * VEH.Pnenn, FLD(Gear - 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear - 1).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear - 1, t, Grad), FLD(Gear - 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear - 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) Loop @@ -2137,7 +1966,7 @@ lb_nOK: End If - ElseIf LastGear < VEH.ganganz And nn > nnUp Then + ElseIf LastGear < VEH.ganganz And nU > nnUp Then 'Shift UP Gear = LastGear + 1 @@ -2146,24 +1975,23 @@ lb_nOK: If GBX.gs_SkipGears AndAlso Gear < VEH.ganganz Then If VEH.TracIntrSi > 0.001 Then - LastPeNorm = fTracIntPower(t, Gear) / VEH.Pnenn + LastPeNorm = fTracIntPower(t, Gear) End If 'Calculate Shift-rpm for higher gear nU = fnU(Vist, Gear + 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) - Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad) * VEH.Pnenn, FLD(Gear + 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad), FLD(Gear + 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Max Torque - MdMax = FLD(Gear + 1).Pfull(nn, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) + MdMax = FLD(Gear + 1).Pfull(nU, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) 'Shift up as long as Torque reserve is okay and Gear < Max-Gear and rpm is above DownShift-rpm - Do While Gear < VEH.ganganz AndAlso 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 AndAlso nn > nnDown '+ 0.1 * (nnUp - nnDown) + Do While Gear < VEH.ganganz AndAlso 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 AndAlso nU > nnDown '+ 0.1 * (nnUp - nnDown) 'Shift UP Gear += 1 @@ -2173,19 +2001,18 @@ lb_nOK: 'Calculate Shift-rpm for higher gear nU = fnU(Vist, Gear + 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Continue only if rpm (for higher gear) is below rated rpm - If nn > 1 Then Exit Do + If nU > VEH.nNenn Then Exit Do - Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad) * VEH.Pnenn, FLD(Gear + 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad), FLD(Gear + 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Max Torque - MdMax = FLD(Gear + 1).Pfull(nn, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) + MdMax = FLD(Gear + 1).Pfull(nU, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) Loop @@ -2201,21 +2028,20 @@ lb_nOK: 'Calculate Shift-rpm for higher gear nU = fnU(Vist, Gear + 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Continue only if rpm (for higher gear) is below rated rpm - If nn <= 1 Then - Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad) * VEH.Pnenn, FLD(Gear + 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nn)) + If nU <= VEH.nNenn Then + Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad), FLD(Gear + 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Max Torque - MdMax = FLD(Gear + 1).Pfull(nn, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) + MdMax = FLD(Gear + 1).Pfull(nU, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) 'Shift up as long as Torque reserve is okay and Gear < Max-Gear and rpm is above DownShift-rpm - Do While Gear < VEH.ganganz AndAlso 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 AndAlso nn > nnDown '+ 0.1 * (nnUp - nnDown) + Do While Gear < VEH.ganganz AndAlso 1 - Md / MdMax >= GBX.gs_TorqueResv / 100 AndAlso nU > nnDown '+ 0.1 * (nnUp - nnDown) 'Shift UP Gear += 1 @@ -2225,19 +2051,18 @@ lb_nOK: 'Calculate Shift-rpm for higher gear nU = fnU(Vist, Gear + 1, False) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Continue only if rpm (for higher gear) is below rated rpm - If nn > 1 Then Exit Do + If nU > VEH.nNenn Then Exit Do - Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad) * VEH.Pnenn, FLD(Gear + 1).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear + 1, t, Grad), FLD(Gear + 1).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear + 1).Pdrag(nU)) Md = Pe * 1000 / (nU * 2 * Math.PI / 60) - nnUp = GBX.fGSnnUp(Md) - nnDown = GBX.fGSnnDown(Md) + nnUp = GBX.fGSnUup(Md) + nnDown = GBX.fGSnUdown(Md) 'Max Torque - MdMax = FLD(Gear + 1).Pfull(nn, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) + MdMax = FLD(Gear + 1).Pfull(nU, LastPeNorm) * 1000 / (nU * 2 * Math.PI / 60) Loop @@ -2252,17 +2077,16 @@ lb10: '*** Error-Msg-Check *** 'Current rpm nU = fnU(Vist, Gear, Clutch = tEngClutch.Slipping) - nn = (nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) 'Current power demand - Pe = Math.Min(fPeGearMod(Gear, t, Grad) * VEH.Pnenn, FLD(Gear).Pfull(nn)) - Pe = Math.Max(Pe, FLD(Gear).Pdrag(nn)) + Pe = Math.Min(fPeGearMod(Gear, t, Grad), FLD(Gear).Pfull(nU)) + Pe = Math.Max(Pe, FLD(Gear).Pdrag(nU)) 'Current torque demand Md = Pe * 1000 / (nU * 2 * Math.PI / 60) 'Clear old errors MODdata.ModErrors.GSextrapol = "" 'Check for errors - GBX.fGSnnDown(Md) - GBX.fGSnnUp(Md) + GBX.fGSnUdown(Md) + GBX.fGSnUup(Md) 'If GearCorrection is OFF then return here @@ -2359,7 +2183,7 @@ lb10: 'Function calculating the Power easily for Gear-shift-model Private Function fPeGearModvD(ByVal t As Integer, ByVal Grad As Single) As Single - Return fPvD(t, Grad) / VEH.Pnenn + Return fPvD(t, Grad) End Function Private Function fPeGearMod(ByVal Gear As Integer, ByVal t As Integer, ByVal V As Single, ByVal a As Single, ByVal Grad As Single) As Single @@ -2378,9 +2202,9 @@ lb10: PaM = ((VEH.I_mot * (VEH.AchsI * VEH.Igetr(Gear) / (0.5 * VEH.Dreifen)) ^ 2) * a * V) * 0.001 End If If Clutch = tEngClutch.Closed Then - Return (PvD + fPlossGB(PvD, V, Gear, True) + fPlossDiff(PvD, V, True) + fPaG(V, a) + fPaux(t, nU) + PaM) / VEH.Pnenn + Return (PvD + fPlossGB(PvD, V, Gear, True) + fPlossDiff(PvD, V, True) + fPaG(V, a) + fPaux(t, nU) + PaM) Else 'Clutch = tEngClutch.Slipping - Return ((PvD + fPlossGB(PvD, V, Gear, True) + fPlossDiff(PvD, V, True) + fPaG(V, a)) / KupplEta + fPaux(t, nU) + PaM) / VEH.Pnenn + Return ((PvD + fPlossGB(PvD, V, Gear, True) + fPlossDiff(PvD, V, True) + fPaG(V, a)) / KupplEta + fPaux(t, nU) + PaM) End If @@ -2396,15 +2220,7 @@ lb10: #Region "Drehzahl" Private Function fnn(ByVal V As Single, ByVal Gear As Integer, ByVal ClutchSlip As Boolean) As Single - Dim akn As Single - Dim U As Single - U = CSng(V * 60.0 * VEH.AchsI * VEH.Igetr(Gear) / (VEH.Dreifen * Math.PI)) - If U < VEH.nLeerl Then U = VEH.nLeerl - If ClutchSlip Then - akn = Kuppln_norm / ((VEH.nLeerl + Kuppln_norm * (VEH.nNenn - VEH.nLeerl)) / VEH.nNenn) - U = (akn * U / VEH.nNenn) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl - End If - Return (U - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) + Return (fnU(V, Gear, ClutchSlip) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) End Function Private Function fnU(ByVal V As Single, ByVal Gear As Integer, ByVal ClutchSlip As Boolean) As Single @@ -2438,7 +2254,7 @@ lb10: '----------------Rolling-resistance---------------- Private Function fPr(ByVal v As Single, ByVal Grad As Single) As Single - Return CSng(Math.Cos(Math.Atan(Grad * 0.01)) * (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) + Return CSng(Math.Cos(Math.Atan(Grad * 0.01)) * (VEH.Loading + VEH.Mass + VEH.MassExtra) * 9.81 * VEH.Fr0 * v * 0.001) End Function '----------------Drag-resistance---------------- @@ -2496,19 +2312,13 @@ lb10: '----------------Ancillaries(Nebenaggregate) ---------------- Private Function fPaux(ByVal t As Integer, ByVal nU As Single) As Single - Return CSng(VEH.Paux0 * VEH.Pnenn + MODdata.Vh.Padd(t) + VEH.PauxSum(t, nU)) + Return CSng(MODdata.Vh.Padd(t) + VEH.PauxSum(t, nU)) End Function '-------------------Transmission(Getriebe)------------------- Private Function fPlossGB(ByVal PvD As Single, ByVal V As Single, ByVal Gear As Integer, ByVal TrLossApprox As Boolean) As Single Dim Pdiff As Single Dim P As Single - Dim P1_getr As Single - Dim P8_getr As Single - Dim P9_getr As Single - Dim P16_getr As Single - Dim n As Single - Dim iTemp As Single Dim nU As Single If Gear = 0 Then Return 0 @@ -2518,75 +2328,21 @@ lb10: 'Pdiff Pdiff = fPlossDiff(PvD, V, TrLossApprox) - Select Case GEN.TransmModel - - Case tTransLossModel.Basic - - n = nU / VEH.nNenn - - 'Leistung nach Getriebe (Getriebeausgang) |@@| Power to Transmission (Transmission-output) - P = Math.Abs(PvD) + Pdiff - - 'Calculate Losses (suitable only for Manual-transmission(Schaltgetriebe)) - ' Interpolation of the Transmission-power-loss - ' Between 1 and 8 Gear, as well as between 9 and 16 Gear: - If (Gear <= 8) Then - iTemp = VEH.Igetr(1) - P1_getr = VEH.Pnenn * 0.0025F * (-0.45F + 36.03F * (n / iTemp) + 14.97F * (P / VEH.Pnenn)) - iTemp = VEH.Igetr(8) - If iTemp <= 0.2 Then iTemp = 0.6 - P8_getr = VEH.Pnenn * 0.0025F * (-0.66F + 16.98F * (n / iTemp) + 5.33F * (P / VEH.Pnenn)) - P = P8_getr + (8 - Gear) * (P1_getr - P8_getr) / 7 - Else - iTemp = VEH.Igetr(9) - If iTemp <= 0.2 Then iTemp = 0.6 - P9_getr = VEH.Pnenn * 0.0025F * (-0.47F + 8.3F * (n / iTemp) + 9.53F * (P / VEH.Pnenn)) - iTemp = VEH.Igetr(16) - If iTemp <= 0.2 Then iTemp = 0.6 - P16_getr = VEH.Pnenn * 0.0025F * (-0.66F + 4.07F * (n / iTemp) + 0.000867F * (Math.Abs(P) / VEH.Pnenn)) - P = P16_getr + (16 - Gear) * (P9_getr - P16_getr) / 7 - End If - - If (P <= 0) Then P = 0 - - Return P * VEH.fGetr - Case Else 'tTransLossModel.Detailed + '***Differential + ' Power after Differential (before Transmission) + P = PvD + Pdiff - '***Differential - ' Power after Differential (before Transmission) - P = PvD + Pdiff - - Return Math.Max(VEH.IntpolPeLoss(Gear, nU, P, TrLossApprox), 0) - - End Select + Return Math.Max(VEH.IntpolPeLoss(Gear, nU, P, TrLossApprox), 0) End Function Private Function fPlossDiff(ByVal PvD As Single, ByVal V As Single, ByVal TrLossApprox As Boolean) As Single - Dim Pdiff As Single - Dim anrad As Single - - Select Case GEN.TransmModel - - Case tTransLossModel.Basic - - 'Pdiff - anrad = (60 * V) / (VEH.Dreifen * Math.PI) - Pdiff = VEH.fGetr * VEH.Pnenn * 0.0025 * (-0.47 + 8.34 * (anrad / VEH.nNenn) + 9.53 * (Math.Abs(PvD) / VEH.Pnenn)) - If (Pdiff <= 0) Then Pdiff = 0 - - Return Pdiff - - Case Else 'tTransLossModel.Detailed - - '***Differential - ' Power before Differential - Return Math.Max(VEH.IntpolPeLoss(0, (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0), PvD, TrLossApprox), 0) - - End Select + '***Differential + ' Power before Differential + Return Math.Max(VEH.IntpolPeLoss(0, (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0), PvD, TrLossApprox), 0) End Function @@ -2595,39 +2351,18 @@ lb10: If Gear = 0 Then Return 0 - Select Case GEN.TransmModel - - Case tTransLossModel.Basic - - Return 0 - - Case Else ' tTransLossModel.Detailed - - nU = (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0) * VEH.Igetr(Gear) - - Return Math.Max(VEH.IntpolPeLossFwd(Gear, nU, PeICE, TrLossApprox), 0) + nU = (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0) * VEH.Igetr(Gear) - End Select + Return Math.Max(VEH.IntpolPeLossFwd(Gear, nU, PeICE, TrLossApprox), 0) End Function Private Function fPlossDiffFwd(ByVal PeIn As Single, ByVal V As Single, ByVal TrLossApprox As Boolean) As Single Dim nU As Single - Select Case GEN.TransmModel - - Case tTransLossModel.Basic - - Return 0 - - Case Else ' tTransLossModel.Detailed - - nU = (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0) - - Return Math.Max(VEH.IntpolPeLossFwd(0, nU, PeIn, TrLossApprox), 0) - - End Select + nU = (60 * V) / (VEH.Dreifen * Math.PI) * VEH.Igetr(0) + Return Math.Max(VEH.IntpolPeLossFwd(0, nU, PeIn, TrLossApprox), 0) End Function diff --git a/VECTO/M_FCCor.vb b/VECTO/M_FCCor.vb deleted file mode 100644 index 1b217a3b00..0000000000 --- a/VECTO/M_FCCor.vb +++ /dev/null @@ -1,75 +0,0 @@ -Module M_FCCor - - 'C - 'C - 'C Subroutine to correct the Consumption-values from Engine-size (HBEFA-calculations because - 'C all HDV(LKW)-sizes are calculated from the same *. mep - 'C - 'C - Sub FcCorr() - 'C - ' include "com.inc"<<<<<<<<<<<<<<<<<<<<<<<<<< - 'c - Dim corr As Single, fc_pnen As Single, fc_ave As Single - Dim t As Int32 - Dim t1 As Integer - Dim Pnenn As Single - Dim L As System.Collections.Generic.List(Of Single) - Dim MsgSrc As String - - MsgSrc = "EmCalc/FcCorr" - - If Not MAP.EmDefRef.ContainsKey(tMapComp.FC) Then - WorkerMsg(tMsgID.Err, "FC component not found! Aborting FC Correction!", MsgSrc) - Exit Sub - End If - - Pnenn = VEH.Pnenn - t1 = MODdata.tDim - L = MODdata.Em.EmDefComp(tMapComp.FC).FinalVals - - 'C - 'c Correction of the Fuel-consumption - 'c only for manual calculations and HDV(LKW) - If (GEN.eklasse = 0) Then - 'c for Euro0 and earlier, 3 different KF used depending on the size - 'c therefore no Size-correction here - corr = 1 - ElseIf (GEN.eklasse = 1) Then - 'c Correction-function for EUR1 and EUR 2 adopted 1:1 from ARTEMIS standard - fc_pnen = 230.55 - 0.0798 * Pnenn - fc_pnen = Math.Max(fc_pnen, 206.2) - fc_ave = 213.9 - corr = (fc_pnen / fc_ave) - ElseIf (GEN.eklasse = 2) Then - fc_pnen = 222.56 - 0.0575 * Pnenn - fc_pnen = Math.Max(fc_pnen, 202.15) - fc_ave = 206.8 - corr = (fc_pnen / fc_ave) - ElseIf (GEN.eklasse = 3) Then - 'c Korrekturfunktion Euro 3 gg. ARTEMIS geringfügig adaptiert (siehe FcCorr_Eu3ff.xls) |@@| Correction-function for Euro 3 like ARTEMIS slightly adapted (see FcCorr_Eu3ff.xls) - fc_pnen = 239.4 - (0.08465 * (Math.Min(Pnenn, 345))) - fc_ave = 239.4 - (0.08465 * 273.5) - corr = (fc_pnen / fc_ave) - ElseIf ((GEN.eklasse = 4) Or (GEN.eklasse = 5)) Then - 'c Correction function for Euro 4 similar to Euro3 - 'c but lightly adapted: Average Nominal-Power of the engines into mep verwursteten - fc_pnen = 239.4 - (0.08465 * (Math.Min(Pnenn, 345))) - fc_ave = 239.4 - (0.08465 * 287.1) - corr = (fc_pnen / fc_ave) - Else - 'c Euro6ff - fc_pnen = 239.4 - (0.08465 * (Math.Min(Pnenn, 345))) - fc_ave = 239.4 - (0.08465 * 279.1) - corr = (fc_pnen / fc_ave) - End If - 'c - For t = 0 To t1 - L(t) = L(t) * corr - Next - 'C - Exit Sub ' return<<<<<<<<<<<<<<<<<<<<<<<<<< - End Sub - - -End Module diff --git a/VECTO/M_Lese.vb b/VECTO/M_Lese.vb index 9d78803b29..4a62f840d1 100644 --- a/VECTO/M_Lese.vb +++ b/VECTO/M_Lese.vb @@ -47,9 +47,6 @@ Module M_Lese CycleFiles.Add(sb.FullPath) Next - SOCnJa = GEN.SOCnJa And GEN.VehMode = tVehMode.HEV - SOCstart = GEN.SOCstart - 'Error message in init() If Not GEN.Init Then Return False @@ -67,10 +64,6 @@ Module M_Lese Return False End Try - VEH.hinauf = (VEH.nLeerl / VEH.nNenn) + VEH.hinauf * (1 - (VEH.nLeerl / VEH.nNenn)) - VEH.hinunter = (VEH.nLeerl / VEH.nNenn) + VEH.hinunter * (1 - (VEH.nLeerl / VEH.nNenn)) - VEH.lhinauf = (VEH.nLeerl / VEH.nNenn) + VEH.lhinauf * (1 - (VEH.nLeerl / VEH.nNenn)) - VEH.lhinunter = (VEH.nLeerl / VEH.nNenn) + VEH.lhinunter * (1 - (VEH.nLeerl / VEH.nNenn)) End If If VEH.NoJSON Then WorkerMsg(tMsgID.Warn, "Vehicle file format is outdated! CLICK HERE to convert to current format!", MsgSrc, "<GUI>" & GEN.PathVEH) @@ -116,16 +109,8 @@ Module M_Lese VEH.AuxPaths.Add(UCase(Trim(AuxKV.Key)), AuxEntry) Next End If - VEH.hinauf = GEN.hinauf - VEH.hinunter = GEN.hinunter - VEH.lhinauf = GEN.lhinauf - VEH.lhinunter = GEN.lhinunter - VEH.pspar = GEN.pspar - VEH.pmodell = GEN.pmodell 'ENG => VEH - VEH.Pnenn = ENG.Pnenn - VEH.nNenn = ENG.nnenn VEH.nLeerl = ENG.nleerl VEH.I_mot = ENG.I_mot @@ -199,8 +184,6 @@ Module M_Lese End Try - - For i = 0 To VEH.ganganz If Not fldgear.ContainsKey(i) Then @@ -218,12 +201,10 @@ Module M_Lese Return False End Try - 'Normalize - FLD(i).Norm() - - Next + VEH.nRatedInit() + '----------------------------- ~MAP~ ----------------------------- @@ -231,55 +212,20 @@ Module M_Lese ' the rest are Measurement-values ' Emissions and Consumption in (g/(h*kW_NominalPower) at HDV(SNF) ' Emissions (g/h) and consumption in (g/(h*kW_NominalPower) in cars(PKW) and LCV(LNF) - If Not GEN.CreateMap Then - - 'Kennfeld read - MAP = New cMAP(GEN.PKWja) - MAP.FilePath = ENG.PathMAP - - 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, ENG.PathMAP) - Return False - End Try - - 'Normalize - MAP.Norm() - - End If - - - '----------------------------- ~DRI~ ----------------------------- - ' Reading the Vehicle Driving-cycle (Not in ADVANCE). - ' LUZ: 04.02.2011: From now outside of READING because of new BATCH structure - - '----------------------------- ~TRS~ ----------------------------- - ' Dynamik-Korrekturparameter, falls dynamokkorrektur ausgewählt: |@@| Dynamic correction parameter, if exclusively Dynamic-correction(dynamokkorrektur): - ' Parameter aus multipler Regressionsanalyse, Differenz zu stationär in |@@| Parameters of multiple regression analysis, Difference with stationary - ' HDV(SNF): (g/h) / kW_Nominal-power for individual parameters - ' Cars(PKW) (g/h) for emissions (g/h)/kW for consumption - If GEN.dynkorja Then - TRS = New cTRS - TRS.FilePath = GEN.dynspez - - Try - If Not TRS.ReadFile Then Return False - Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN.dynspez & ")", MsgSrc, GEN.dynspez) - Return False - End Try - - End If - - '----------------------------------------------------------------------- - 'Reading data for hybrid simulation: - If (GEN.ModeHorEV) Then + + 'Kennfeld read + MAP = New cMAP + MAP.FilePath = ENG.PathMAP - 'TODO: Init EV/HEV here! + 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, ENG.PathMAP) + Return False + End Try - End If - '----------------------------------------------------------------------- + 'Normalize + MAP.Norm() Return True diff --git a/VECTO/M_MAIN.vb b/VECTO/M_MAIN.vb index 7b21edeb4d..2e5be584b0 100644 --- a/VECTO/M_MAIN.vb +++ b/VECTO/M_MAIN.vb @@ -125,9 +125,6 @@ lbSkip0: 'Warning on invalid/unrealistic settings If Cfg.AirDensity > 2 Then WorkerMsg(tMsgID.Err, "Air Density = " & Cfg.AirDensity & " ?!", MsgSrc) - 'Notify - If Cfg.FCcorrection Then WorkerMsg(tMsgID.Normal, "HDV FC Correction ON", MsgSrc) - 'Progbar-Init WorkerProgInit() @@ -165,9 +162,6 @@ lbSkip0: GoTo lbNextJob End If - 'If optimizer is active, then read parameters here - If bOptOn Then OptInput() - 'BATCH: Create Output-sub-folder If (PHEMmode = tPHEMmode.ModeBATCH) And Cfg.ModOut And Cfg.BATCHoutSubD Then Select Case UCase(Cfg.BATCHoutpath) @@ -270,9 +264,6 @@ lbSkip0: '***************************** VECTO-loading-loop ********************************* '************************************************************************************** - 'Entry point for SOC-start iteration - If GEN.ModeHorEV And SOCnJa Then SOCfirst = True - 'Clean up MODdata.Init() @@ -330,7 +321,7 @@ lbSkip0: 'Initialize Cycle-specs (Speed, Accel, ...) MODdata.CycleInit() - If GEN.VehMode = tVehMode.EngineOnly Then + If GEN.EngOnly Then If MsgOut Then WorkerMsg(tMsgID.Normal, "Engine Only Calc", MsgSrc) @@ -363,37 +354,28 @@ lbSkip0: End If End If - If GEN.ModeHorEV Then - - WorkerMsg(tMsgID.Err, "(H)EV mode is not available!", MsgSrc) - JobAbortedByErr = True - GoTo lbNextJob - - 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 - - If PHEMworker.CancellationPending Then GoTo lbAbort + 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 - If MsgOut Then WorkerMsg(tMsgID.Normal, "Vehicle Calc", MsgSrc) + If PHEMworker.CancellationPending Then GoTo lbAbort - MODdata.Vh.DistCorrInit() + End If - If Not MODdata.Px.Calc() Then - CyclAbrtedByErr = True - GoTo lbAusg - End If + If MsgOut Then WorkerMsg(tMsgID.Normal, "Vehicle Calc", MsgSrc) + MODdata.Vh.DistCorrInit() + + If Not MODdata.Px.Calc() Then + CyclAbrtedByErr = True + GoTo lbAusg End If + If PHEMworker.CancellationPending Then GoTo lbAbort 'Calculate CycleKin (for erg/sum, etc.) @@ -404,80 +386,23 @@ lbSkip0: '---------------------------------------------------------------------------- - 'Emissionen und Nachbehandlung - wird bei EV-Modus nicht ausgeführt |@@| Emissions and After-treatment - it will not run in EV mode - If Not GEN.VehMode = tVehMode.EV Then - - 'If MsgOut Then WorkerMsg(tMsgID.Normal, "Calculating Transient Correction Factors", MsgSrc) - - ''Determine TC parameters per second - 'MODdata.TC.Calc() + If MsgOut Then WorkerMsg(tMsgID.Normal, "FC Interpolation", MsgSrc) - 'Map creation - If GEN.CreateMap Then + 'Calculate Raw emissions + If Not MODdata.Em.Raw_Calc() Then + 'If Not DEV.IgnoreFCextrapol Then + ' CyclAbrtedByErr = True + ' WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc) + ' GoTo lbAusg + 'End If - If MsgOut Then WorkerMsg(tMsgID.Normal, "Creating Emission Map", MsgSrc) + FCerror = True - MAP = New cMAP(GEN.PKWja) 'PKWja ist hier nicht relevant - MAP.FilePath = fFileWoExt(JobFile) & ".v_map" - If Not MAP.CreateMAP() Then - CyclAbrtedByErr = True - GoTo lbAusg - End If - MAP.Norm() - End If - - If MsgOut Then WorkerMsg(tMsgID.Normal, "FC Interpolation", MsgSrc) - - 'Calculate Raw emissions - If Not MODdata.Em.Raw_Calc() Then - 'If Not DEV.IgnoreFCextrapol Then - ' CyclAbrtedByErr = True - ' WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc) - ' GoTo lbAusg - 'End If - - FCerror = True - - End If - - 'TC Parameter umrechnen in Differenz zu Kennfeld-TC-Parameter |@@| Convert TC parameters to differences with Map-TC-parameters - If MAP.TransMap Then MODdata.TC.CalcDiff() - - 'Dynamic correction - If GEN.dynkorja Then - If MsgOut Then WorkerMsg(tMsgID.Normal, "Em Calc: Transient Correction", MsgSrc) - MODdata.Em.TC_Calc() - End If - - 'Korrektur der Verbrauchswerte kleiner LKW-Motoren bei HBEFA |@@| Correction of consumption values smaller HDV(LKW) engines by HBEFA - If (Not GEN.PKWja) And Cfg.FCcorrection Then - If MsgOut Then WorkerMsg(tMsgID.Normal, "Em Calc: FC-Correction", MsgSrc) - FcCorr() - End If - - 'Exhaust system simulation - If GEN.EXSja Then - If MsgOut Then WorkerMsg(tMsgID.Normal, "Em Calc: EXS", MsgSrc) - EXS = New cEXS - If Not EXS.Exs_Main() Then - CyclAbrtedByErr = True - GoTo lbAusg - End If - End If - - 'Totals / Averages form - MODdata.Em.SumCalc() + End If - 'Engine Analysis - If GEN.EngAnalysis Then - If MsgOut Then WorkerMsg(tMsgID.Normal, "Engine Analysis", MsgSrc) - If Not MODdata.Em.EngAnalysis() Then - CyclAbrtedByErr = True - GoTo lbAusg - End If - End If + 'Totals / Averages form + MODdata.Em.SumCalc() - End If If PHEMworker.CancellationPending Then GoTo lbAbort @@ -506,7 +431,7 @@ lbSkip0: lbAusg: If PHEMworker.CancellationPending Then GoTo lbAbort - + 'Output in Erg (first Calculation - Initialization & Header) If Not ERG.AusgERG(NrOfRunStr, fFILE(GenFile, True), fFILE(CurrentCycleFile, True), CyclAbrtedByErr) Then GoTo lbErrInJobLoop @@ -664,7 +589,6 @@ lbExit: VEH = Nothing FLD = Nothing MAP = Nothing - TRS = Nothing DRI = Nothing MODdata = Nothing ERG = Nothing diff --git a/VECTO/M_OptInterface.vb b/VECTO/M_OptInterface.vb deleted file mode 100644 index e6851f0a48..0000000000 --- a/VECTO/M_OptInterface.vb +++ /dev/null @@ -1,232 +0,0 @@ -Imports System.Runtime.Remoting -Imports System.Runtime.Remoting.Channels -Imports System.Runtime.Remoting.Channels.Ipc - -Module M_OptInterface - - Public bOptOn As Boolean = False - Public OptMsgTxt As String - Public OptERstat As Boolean = False - Public bOptKillLauncher As Boolean = True - Public bOptStartPHEM As Boolean = True - - Private OptZaehl As Int16 - Private OptDir As String - Private ipcCh As IpcChannel - Private bRecInit As Boolean = False - - Public SlB_nU_opt As Single - Public SlB_Pe_opt As Single - - 'Corrected Emissions (determined by SOC-iteration-module) - Public OptEMkor() As Single - - '*** Opt_Interface On/Off - Public Sub OptOnOff() - If bOptOn Then - bOptOn = False - OptClose() - OptStatus("OFF") - Else - Try - 'Initialization - OptInit() - Catch ex As Exception - GUImsg(tMsgID.Err, ex.Message.ToString) - End Try - End If - End Sub - - '*** Initialization - Private Sub OptInit() - - - 'Count to Zero - OptZaehl = 0 - - 'Delete Corr. Em. - ReDim OptEMkor(10) - - OptERstat = False - - 'TODO: I/O-Verzeichnis festlegen |@@| TODO: Specify I/O-directory - OptDir = "TODO" ' Früher: F_DEV.TbOptInOut.Text - If Right(OptDir, 1) <> "\" Then OptDir &= "\" - - 'Communication - Input - Try - ipcCh = New IpcChannel("IPC_Server") - ChannelServices.RegisterChannel(ipcCh, False) - RemotingConfiguration.RegisterWellKnownServiceType(GetType(CommunicationService), "ServerReceiveObj", WellKnownObjectMode.Singleton) - Catch ex As Exception - Exit Sub - End Try - - OptMsgTxt = "" - bOptOn = True - - GUImsg(tMsgID.Normal, "OptInterface aktiviert") - OptStatus("ON") - - - 'Dim file As New cFile - 'ReDim xA(Adim) - 'ReDim yA(Adim) - 'ReDim zA(Adim) - 'file.OpenRead(OptDir & "XYZ_Punkte.csv") - 'For x = 1 To Adim - ' file.Read(xA(x)) - ' file.ReadTab(yA(x)) - ' file.ReadTab(zA(x)) - 'Next - 'file.Close() - 'file = Nothing - - 'Timer Initialization/Start - F_MAINForm.ComMsgTimer.Start() - GUImsg(tMsgID.Normal, "Warte auf START-Signal...") - - - End Sub - - '*** Read Parameters - Public Sub OptInput() - Dim file As New cFile_V3 - - GUImsg(tMsgID.Normal, "Lese Opt_In.txt") - - '**** Reading the Input-file with Opt-parameter - file.OpenRead(OptDir & "Opt_In.txt") - - '... - - file.Close() - file = Nothing - - End Sub - - '*** Dump parameters - Private Sub OptOutput() - - Dim StreamF As System.IO.StreamWriter - Dim Zielf As Single - - '**** Ausgabe der Output-Datei mit Zielfunktion |@@| Dump the output file along with the Objective-function(Zielfunktion) - GUImsg(tMsgID.Normal, "Schreibe Opt_Out.txt") - - Try - StreamF = My.Computer.FileSystem.OpenTextFileWriter(OptDir & "Opt_Out.txt", False, System.Text.Encoding.ASCII) - Catch ex As Exception - GUImsg(tMsgID.Err, "Kann nicht zugreifen auf " & OptDir & "Opt_Out.txt") - Exit Sub - End Try - - 'Dump the StatusString - If OptERstat Then - StreamF.WriteLine("ER") - OptERstat = False - 'F_DEV.ButOptAbbr.Enabled = True - Else - StreamF.WriteLine("OK") - End If - - 'Berechnung der Zielfunktion |@@| Calculation of the Objective-function(Zielfunktion) - Zielf = OptEMkor(1) / 40 + (OptEMkor(2) / 0.2) ^ 4 - - 'Ausgabe der Zielfunktion |@@| Dump the Objective-function(Zielfunktion) - StreamF.WriteLine(Zielf) - - StreamF.Close() - StreamF.Dispose() - - End Sub - - '*** Opt Deactivation - Private Sub OptClose() - F_MAINForm.ComMsgTimer.Stop() - ChannelServices.UnregisterChannel(ipcCh) - OptERstat = False - 'F_DEV.ButOptAbbr.Enabled = True - GUImsg(tMsgID.Normal, "OptInterface deaktiviert") - End Sub - - '*** Status-notification (must not be called by BGWorker) - Private Sub OptStatus(ByVal txt As String) - 'F_DEV.LbOptStatus.Text = txt - End Sub - - '*** Start PHEM - Called from F_MAINForm.ComMsgTimer when the Start-signal is received - Public Sub OptSTART() - GUImsg(tMsgID.Normal, "START-Signal erhalten.") - 'PHEM start - If bOptStartPHEM Then OptStartRun() - End Sub - Public Sub OptStartRun() - 'Stop the timer - F_MAINForm.ComMsgTimer.Stop() - 'Count + 1 - OptZaehl += 1 - 'PHEM start - GUImsg(tMsgID.Normal, "Starte PHEM. Durchgang " & OptZaehl) - F_MAINForm.PHEM_Launcher() - End Sub - - '*** PHEM ready - called by BackgroundWorker1_RunWorkerCompleted when PHEM finished - Public Sub OptEND() - - 'Ausgabe der Zielfunktion |@@| Dump of the Objective-function(Zielfunktion) - OptOutput() - - 'Finish PHEM_Launcher - If bOptKillLauncher Then KillLauncher() - - 'Start the Timer again - F_MAINForm.ComMsgTimer.Start() - - GUImsg(tMsgID.Normal, "Warte auf START-Signal...") - - End Sub - - '*** Finished PHEM_Launcher - Public Sub KillLauncher() - Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("PHEM_Launcher") - If UBound(pProcess) > -1 Then - pProcess(0).Kill() - GUImsg(tMsgID.Normal, "PHEM_Launcher beendet.") - Else - GUImsg(tMsgID.Err, "Prozess PHEM_Launcher nicht gefunden!") - End If - End Sub - - '*** CommunicationService - Public Class CommunicationService - 'Inherits MarshalByRefObject - 'Implements SharedInterfaces.ICommunicationService - 'Public Sub MsgReceive(ByVal txt As String) Implements SharedInterfaces.ICommunicationService.SendMsg - ' OptMsgTxt = txt - 'End Sub - End Class - - - ' ''*** Message Output - '' ''Public Sub OptSendMsg(ByVal txt As String) - '' '' Try - '' '' ' Dim ipcChS As New IpcChannel("ClientSender") - '' '' ' ChannelServices.RegisterChannel(ipcChS, False) - '' '' Dim ClientRemoteObj As SharedInterfaces.ICommunicationService = DirectCast(Activator.GetObject(GetType(SharedInterfaces.ICommunicationService), "ipc://IPC_Client/ClientReceiveObj"), SharedInterfaces.ICommunicationService) - '' '' ClientRemoteObj.SendMsg(txt) - '' '' ' ChannelServices.UnregisterChannel(ipcChS) - '' '' Catch ex As Exception - '' '' WorkerMSG(tMsgID.Err, "ClientRemoteObj.SendMsg failed!!") - '' '' End Try - '' ''End Sub - - - - - -End Module - - - - diff --git a/VECTO/M_SOC_Iter.vb b/VECTO/M_SOC_Iter.vb deleted file mode 100644 index 12c54354cf..0000000000 --- a/VECTO/M_SOC_Iter.vb +++ /dev/null @@ -1,476 +0,0 @@ -Imports System.Collections.Generic - -Module M_SOC_Iter - - '-----------SOC Neutral Iteration------------ - Public SOCnJa As Boolean - Public SOCfirst As Boolean - Private SOCnAbbr As Boolean - Private SOCnDdelta As Single = 0.001 '<= in Optionen...? - Private SOChistory As List(Of Double) - Private SOCdeltaHis As List(Of Double) - Private SOCnLog As System.IO.StreamWriter - Private SOCcount As Integer - Private EmHist As cEmHist - Private SOCok As Boolean - '-------------------------------------------- - - Private Const MsgSrcSOC As String = "Main/SOCIteration" - - 'TODO: Dummies - Private Vquer As Single - Private gesVerbr As Single - Private gesNOx As Single - Private gesHC As Single - Private gesCO As Single - Private gesPM As Single - Private gesrawNOx As Single - Private gesEk(5) As Single - - '-------------------------------------------------------------------------------------------- - '-------------------------------- ~SOC - Neutral Iteration~ --------------------------------- - '-------------------------------------------------------------------------------------------- - Private Sub SOCnLogLine() - SOCnLog.WriteLine(SOCstart & "," & SOC(MODdata.tDim) & "," & SOC(MODdata.tDim) - SOCstart) - End Sub - - Public Function SOCnStatus() As Boolean - - ''Dim SOCnMiCheck As Boolean - ''Dim SOCnMaCheck As Boolean - Dim x As Int16 - Dim smin As Single - Dim SOCvzX As Short - - - If SOCfirst Then - If Not SOCnInit() Then Return True - End If - - If Math.Abs(SOCstart - SOC(MODdata.tDim)) < SOCnDdelta Then - SOCok = True - If SOCfirst Then - WorkerMsg(tMsgID.Normal, "No SOC-Start Iteration needed. Delta = " & SOC(MODdata.tDim) - SOCstart, MsgSrcSOC) - Else - HistAdd() - SOChistory.Add(SOCstart) - SOCdeltaHis.Add(SOC(MODdata.tDim) - SOCstart) - SOCcount += 1 - WorkerMsg(tMsgID.Normal, "SOC-Start Iteration complete. Delta = " & SOC(MODdata.tDim) - SOCstart & ", SOC-Start = " & SOCstart, MsgSrcSOC) - End If - SOCnLogLine() - If SOCfirst Then - SOCnLog.WriteLine("No Iteration needed.") - Else - SOCnLog.WriteLine("Iteration completed successfully.") - End If - HistRegLog() - SOCnFinalize() - Return True - End If - - SOCcount += 1 - - If SOCfirst Then - SOCfirst = False - SOChistory.Add(SOCstart) - SOCdeltaHis.Add(SOC(MODdata.tDim) - SOCstart) - SOCnLogLine() - WorkerMsg(tMsgID.Normal, "Starting SOC-Start Iteration. Delta = " & SOC(MODdata.tDim) - SOCstart & ", SOC-End = " & SOC(MODdata.tDim), MsgSrcSOC) - SOCstart = SOC(MODdata.tDim) - HistAdd() - 'Return - Return False - End If - - SOCnLogLine() - - If SOCnAbbr Then - SOCnAbort() - Return True - End If - - HistAdd() - SOChistory.Add(SOCstart) - SOCdeltaHis.Add(SOC(MODdata.tDim) - SOCstart) - - 'Check whether the Sign of Delta-SOC changes - SOCvzX = 0 - - For x = SOCcount - 1 To 1 Step -1 - If SOCdeltaHis(x) * SOCdeltaHis(x - 1) < 0 Then - 'Sign changes ... - SOCvzX += 1 - If SOCvzX = 4 Then - '...Limit reached => Abort - SOCnAbbr = True - Exit For - End If - End If - Next - - If SOCnAbbr Then - SOCnLog.WriteLine("Iteration failed.") - HistRegLog() - SOCnLog.WriteLine(" ") - smin = Math.Abs(SOCdeltaHis(SOCcount - 1)) - SOCstart = SOChistory(SOCcount - 1) - For x = SOCcount - 2 To 0 Step -1 - If Math.Abs(SOCdeltaHis(x)) < smin Then - SOCstart = SOChistory(x) - smin = Math.Abs(SOCdeltaHis(x)) - SOCnAbbr = False - End If - Next - If SOCnAbbr Then - 'If the last iteration was the best (SOCnAbbr = True): Exit - WorkerMsg(2, "SOC-Start Iteration failed. Last Iteration produced best result: SOC-Start = " & SOCstart, MsgSrcSOC) - SOCnAbort() - Return True - Else - 'If another iteration was better (SOCnAbbr = False): Repeat - SOCnAbbr = True - SOCnLog.WriteLine("Repeating Iteration with best result.") - SOCnLog.WriteLine("SOC-Start,SOC-End,dSOC") - WorkerMsg(2, "SOC-Start Iteration failed. Repeating Iteration with best result: SOC-Start = " & SOCstart, MsgSrcSOC) - Return False - End If - End If - - WorkerMsg(tMsgID.Normal, "Continuing SOC-Start Iteration. Delta = " & SOC(MODdata.tDim) - SOCstart & ", SOC-End = " & SOC(MODdata.tDim), MsgSrcSOC) - - SOCstart = SOC(MODdata.tDim) - - Return False - - End Function - - Private Sub HistAdd() - EmHist.FC.Add(gesVerbr / Vquer) - EmHist.NOx.Add(gesNOx / Vquer) - EmHist.HC.Add(gesHC / Vquer) - EmHist.CO.Add(gesCO / Vquer) - EmHist.PM.Add(gesPM / Vquer) - EmHist.E1_PN.Add(gesEk(1) / Vquer) - EmHist.E2_NO.Add(gesEk(2) / Vquer) - EmHist.E3.Add(gesEk(3) / Vquer) - EmHist.E4.Add(gesEk(4) / Vquer) - EmHist.E5.Add(gesEk(5) / Vquer) - End Sub - - Private Sub HistRegLog() - Dim str As System.Text.StringBuilder - Dim i As Integer - Dim Check As Boolean - Dim VorzPlus As Boolean - Dim UseEmOgl As Boolean - - 'Check whether LinReg possible: Mind. 2 calculations; Mind. dSOC-1 sign-changes - Check = SOCcount > 1 - If Check Then - VorzPlus = (SOCdeltaHis(0) > 0) - For i = 1 To SOCcount - 1 - If (Not VorzPlus) = (SOCdeltaHis(i) > 0) Then GoTo lb10 - Next - Check = False -lb10: - End If - - If Check Then - - EmHist.RegrAll() - - str = New System.Text.StringBuilder - - SOCnLog.WriteLine(" ") - SOCnLog.WriteLine("*************** Linear Regression ***************") - SOCnLog.WriteLine(" Em = Em0 + dSOC * b") - SOCnLog.WriteLine(" R2 = Coefficient of Determination (Pearson's)") - SOCnLog.WriteLine(" SE = Standard Error") - SOCnLog.WriteLine(" ") - SOCnLog.WriteLine("Property,FC,NOx,HC,CO,PM,E1/PN,E2/NO,E3,E4,E5") - - str.Append("Em0,") - str.Append(EmHist.FC.a & ",") - str.Append(EmHist.NOx.a & ",") - str.Append(EmHist.HC.a & ",") - str.Append(EmHist.CO.a & ",") - str.Append(EmHist.PM.a & ",") - str.Append(EmHist.E1_PN.a & ",") - str.Append(EmHist.E2_NO.a & ",") - str.Append(EmHist.E3.a & ",") - str.Append(EmHist.E4.a & ",") - str.Append(EmHist.E5.a) - SOCnLog.WriteLine(str.ToString) - - str.Length = 0 - str.Append("b,") - str.Append(EmHist.FC.b & ",") - str.Append(EmHist.NOx.b & ",") - str.Append(EmHist.HC.b & ",") - str.Append(EmHist.CO.b & ",") - str.Append(EmHist.PM.b & ",") - str.Append(EmHist.E1_PN.b & ",") - str.Append(EmHist.E2_NO.b & ",") - str.Append(EmHist.E3.b & ",") - str.Append(EmHist.E4.b & ",") - str.Append(EmHist.E5.b) - SOCnLog.WriteLine(str.ToString) - - str.Length = 0 - str.Append("R2,") - str.Append(EmHist.FC.R2 & ",") - str.Append(EmHist.NOx.R2 & ",") - str.Append(EmHist.HC.R2 & ",") - str.Append(EmHist.CO.R2 & ",") - str.Append(EmHist.PM.R2 & ",") - str.Append(EmHist.E1_PN.R2 & ",") - str.Append(EmHist.E2_NO.R2 & ",") - str.Append(EmHist.E3.R2 & ",") - str.Append(EmHist.E4.R2 & ",") - str.Append(EmHist.E5.R2) - SOCnLog.WriteLine(str.ToString) - - str.Length = 0 - str.Append("SE,") - str.Append(EmHist.FC.SE & ",") - str.Append(EmHist.NOx.SE & ",") - str.Append(EmHist.HC.SE & ",") - str.Append(EmHist.CO.SE & ",") - str.Append(EmHist.PM.SE & ",") - str.Append(EmHist.E1_PN.SE & ",") - str.Append(EmHist.E2_NO.SE & ",") - str.Append(EmHist.E3.SE & ",") - str.Append(EmHist.E4.SE & ",") - str.Append(EmHist.E5.SE) - SOCnLog.WriteLine(str.ToString) - - SOCnLog.WriteLine(" ") - SOCnLog.WriteLine("Regression Source") - SOCnLog.WriteLine("dSOC,FC,NOx,HC,CO,PM,E1/PN,E2/NO,E3,E4,E5") - For i = 0 To SOCcount - 1 - str.Length = 0 - str.Append(SOCdeltaHis(i) & ",") - str.Append(EmHist.FC.EmHist(i) & ",") - str.Append(EmHist.NOx.EmHist(i) & ",") - str.Append(EmHist.HC.EmHist(i) & ",") - str.Append(EmHist.CO.EmHist(i) & ",") - str.Append(EmHist.PM.EmHist(i) & ",") - str.Append(EmHist.E1_PN.EmHist(i) & ",") - str.Append(EmHist.E2_NO.EmHist(i) & ",") - str.Append(EmHist.E3.EmHist(i) & ",") - str.Append(EmHist.E4.EmHist(i) & ",") - str.Append(EmHist.E5.EmHist(i)) - SOCnLog.WriteLine(str.ToString) - Next - - SOCnLog.WriteLine("*************************************************") - - str = Nothing - - 'Uncorrected Em use if SOC-iteration OK - UseEmOgl = SOCok - - Else - - 'Uncorrected Em used - UseEmOgl = True - - SOCnLog.WriteLine(" ") - SOCnLog.WriteLine("Linear Regression not possible.") - - End If - - 'Corrected Emissions for Optimizer - If bOptOn Then - 'If SOC-iteration was successful (or Lin.Reg not possible) then use Emissions from the last (uncorrected) calculation - If UseEmOgl Then - OptEMkor(1) = gesVerbr / Vquer - OptEMkor(2) = gesNOx / Vquer - OptEMkor(3) = gesHC / Vquer - OptEMkor(4) = gesCO / Vquer - OptEMkor(5) = gesPM / Vquer - OptEMkor(6) = gesEk(1) / Vquer - OptEMkor(7) = gesEk(2) / Vquer - OptEMkor(8) = gesEk(3) / Vquer - OptEMkor(9) = gesEk(4) / Vquer - OptEMkor(10) = gesEk(5) / Vquer - - Else - - OptEMkor(1) = EmHist.FC.a - OptEMkor(2) = EmHist.NOx.a - OptEMkor(3) = EmHist.HC.a - OptEMkor(4) = EmHist.CO.a - OptEMkor(5) = EmHist.PM.a - OptEMkor(6) = EmHist.E1_PN.a - OptEMkor(7) = EmHist.E2_NO.a - OptEMkor(8) = EmHist.E3.a - OptEMkor(9) = EmHist.E4.a - OptEMkor(10) = EmHist.E5.a - - End If - - End If - - - End Sub - - Private Sub SOCnAbort() - SOCnFinalize() - WorkerMsg(tMsgID.Err, "SOC-Start Iteration failed.", MsgSrcSOC) ' Delta = " & SOC(Tzykl - 1) - SOCstart) - End Sub - - Private Function SOCnInit() As Boolean - Dim f As String - EmHist = New cEmHist - SOCcount = 0 - SOCok = False - SOChistory = New List(Of Double)() - SOCdeltaHis = New List(Of Double)() - SOCnAbbr = False - f = MODdata.ModOutpName & "_SOCnLog.txt" - If SOCnLog IsNot Nothing Then SOCnLog.Close() - Try - SOCnLog = My.Computer.FileSystem.OpenTextFileWriter(f, False, FileFormat) - SOCnLog.AutoFlush = True - Catch ex As Exception - WorkerMsg(tMsgID.Err, "Can't write to " & f, MsgSrcSOC) - Return False - End Try - SOCnLog.WriteLine("VECTO " & VECTOvers & " " & Now.ToString) - SOCnLog.WriteLine("Logfile for SOC-Start Iteration") - SOCnLog.WriteLine("Jobfile: " & JobFile) - SOCnLog.WriteLine("Driving Cycle: " & CurrentCycleFile) - SOCnLog.WriteLine(" ") - SOCnLog.WriteLine("SOC-Start,SOC-End,dSOC") - - Return True - - End Function - - Private Sub SOCnFinalize() - SOCnLog.Close() - SOCnLog = Nothing - EmHist = Nothing - SOChistory = Nothing - SOCdeltaHis = Nothing - End Sub - - Private Class cEmHist - - Public FC As EmComp - Public NOx As EmComp - Public HC As EmComp - Public CO As EmComp - Public PM As EmComp - Public E1_PN As EmComp - Public E2_NO As EmComp - Public E3 As EmComp - Public E4 As EmComp - Public E5 As EmComp - - - Public Sub New() - FC = New EmComp - NOx = New EmComp - HC = New EmComp - CO = New EmComp - PM = New EmComp - E1_PN = New EmComp - E2_NO = New EmComp - E3 = New EmComp - E4 = New EmComp - E5 = New EmComp - End Sub - - Protected Overrides Sub Finalize() - MyBase.Finalize() - FC = Nothing - NOx = Nothing - HC = Nothing - CO = Nothing - PM = Nothing - E1_PN = Nothing - E2_NO = Nothing - E3 = Nothing - E4 = Nothing - E5 = Nothing - End Sub - - Public Sub RegrAll() - FC.Regress() - NOx.Regress() - HC.Regress() - CO.Regress() - PM.Regress() - E1_PN.Regress() - E2_NO.Regress() - E3.Regress() - E4.Regress() - E5.Regress() - End Sub - - Public Class EmComp - Private Hist As System.Collections.Generic.List(Of Single) - Private Hdim As Integer - - Public R2 As Single - Public a As Double - Public b As Double - Public SE As Double - - Public Sub New() - Hdim = -1 - a = 0 - b = 0 - R2 = 0 - Hist = New System.Collections.Generic.List(Of Single) - End Sub - - Protected Overrides Sub Finalize() - MyBase.Finalize() - Hist = Nothing - End Sub - - Public Sub Add(ByVal Val As Single) - Hist.Add(Val) - Hdim += 1 - End Sub - - Public Sub Regress() - Dim y(SOCcount - 1) As Double - Dim info As cRegression.RegressionProcessInfo - Dim reg As cRegression - Dim i As Integer - - For i = 0 To SOCcount - 1 - y(i) = CDbl(Hist(i)) - Next - - reg = New cRegression - - info = reg.Regress(SOCdeltaHis.ToArray, y) - R2 = info.PearsonsR ^ 2 - a = info.a - b = info.b - SE = info.StandardError - - End Sub - - Public ReadOnly Property EmHist(ByVal i As Integer) As Single - Get - Return Hist(i) - End Get - End Property - - End Class - - - - - End Class - - - -End Module diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index dc8ac8e2b0..912f7887ed 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -163,14 +163,10 @@ <Compile Include="Input Files\cAux.vb" /> <Compile Include="Input Files\cENG.vb" /> <Compile Include="Input Files\cGBX.vb" /> - <Compile Include="MODcalc\cBatModel.vb" /> <Compile Include="cConfig.vb" /> - <Compile Include="cCustomMap.vb" /> <Compile Include="cDelaunayMap.vb" /> <Compile Include="cDEV.vb" /> <Compile Include="cEmComp.vb" /> - <Compile Include="Input Files\cEMO.vb" /> - <Compile Include="cHEVctrl.vb" /> <Compile Include="File Browser\cFileBrowser.vb" /> <Compile Include="MODcalc\cVh.vb" /> <Compile Include="MODcalc\Em Calc.vb" /> @@ -188,7 +184,6 @@ </Compile> <Compile Include="MODcalc\cPower.vb" /> <Compile Include="MODcalc\cMOD.vb" /> - <Compile Include="Input Files\cTRS.vb" /> <Compile Include="Input Files\cFLD.vb" /> <Compile Include="Input Files\cMAP.vb" /> <Compile Include="Input Files\cDRI.vb" /> @@ -216,7 +211,6 @@ <Compile Include="cFile V3.vb" /> <Compile Include="VECTO_Global.vb" /> <Compile Include="VECTO_Types.vb" /> - <Compile Include="M_SOC_Iter.vb" /> <Compile Include="cRegression.vb" /> <Compile Include="GUI\GUI_Subs.vb" /> <Compile Include="GUI\F_VEH.Designer.vb"> @@ -248,8 +242,6 @@ <SubType>Form</SubType> </Compile> <Compile Include="File Browser\FB_Global.vb" /> - <Compile Include="M_FCCor.vb" /> - <Compile Include="M_OptInterface.vb" /> <Compile Include="cCycleKin.vb" /> <Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\Application.Designer.vb"> diff --git a/VECTO/VECTO_Global.vb b/VECTO/VECTO_Global.vb index 57dc372a59..9494f0733a 100644 --- a/VECTO/VECTO_Global.vb +++ b/VECTO/VECTO_Global.vb @@ -2,7 +2,7 @@ Module VECTO_Global - Public Const VECTOvers As String = "1.4.RC8" + Public Const VECTOvers As String = "1.4.RC8+" Public Const LicSigAppCode As String = "VECTO-Release-0093C61E0A2E4BFA9A7ED7E729C56AE4" Public MyAppPath As String Public MyConfPath As String @@ -18,9 +18,6 @@ Module VECTO_Global 'Config------------------------------------------------------- Public Cfg As cConfig - 'TODO: Get rid of it! SOC-iteration belongs either in the Power-loop or Em-calculation for LinReg - Public SOCstart As Single - Public SOC(izykt) As Single Public Const izykt As Integer = 40000 Public sKey As csKey @@ -36,8 +33,6 @@ Module VECTO_Global Public DRI As cDRI Public FLD As List(Of cFLD) Public MODdata As cMOD - Public TRS As cTRS - Public EXS As cEXS Public Lic As vectolic.cLicense Public ERG As cERG Public DEV As cDEV @@ -56,16 +51,6 @@ Module VECTO_Global Return ((nU * 2 * Math.PI / 60) * M / 1000) End Function - Public Function nnormTonU(ByVal nnorm As Single) As Single - Return nnorm * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl - End Function - - Public Function PnormToM(ByVal nnorm As Single, ByVal Pnorm As Double) As Single - Dim nU As Single - nU = nnorm * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl - Return Pnorm * VEH.Pnenn * 1000 / (nU * 2 * Math.PI / 60) - End Function - Public Function nPeToM(ByVal nU As Single, ByVal Pe As Double) As Single Return Pe * 1000 / (nU * 2 * Math.PI / 60) End Function @@ -82,8 +67,8 @@ Module VECTO_Global Return tDriComp.V Case sKey.DRI.Grad Return tDriComp.Grad - Case sKey.DRI.n - Return tDriComp.nn + Case sKey.DRI.nU + Return tDriComp.nU Case sKey.DRI.Gears Return tDriComp.Gears Case sKey.DRI.Padd @@ -420,7 +405,7 @@ Public Class csKey Public Grad As String = "<GRAD>" Public Alt As String = "<ALT>" Public Gears As String = "<GEAR>" - Public n As String = "<N>" + Public nU As String = "<N>" Public Pe As String = "<PE>" Public Padd As String = "<PADD>" Public VairVres As String = "<VAIR_RES>" diff --git a/VECTO/VECTO_Types.vb b/VECTO/VECTO_Types.vb index 2ffc6c67a8..7a42b6e7d1 100644 --- a/VECTO/VECTO_Types.vb +++ b/VECTO/VECTO_Types.vb @@ -14,13 +14,6 @@ Public Enum tCalcMode As Short cmEV = 7 '7 Elektrofahrzeug End Enum -Public Enum tVehMode - StandardMode - EngineOnly - HEV - EV -End Enum - Public Enum tWorkMsgType StatusBar StatusListBox @@ -55,10 +48,7 @@ Public Enum tJobStatus Undef End Enum -Public Enum tTransLossModel As Short - Basic = 0 - Detailed = 1 -End Enum + Public Enum tEmNorm x_h @@ -102,7 +92,7 @@ Public Enum tDriComp V Grad Alt - nn + nU Gears Padd Pe diff --git a/VECTO/cConfig.vb b/VECTO/cConfig.vb index c74743d3bf..84b2f152e0 100644 --- a/VECTO/cConfig.vb +++ b/VECTO/cConfig.vb @@ -7,10 +7,6 @@ Private sWorkDPath As String Private WorkDirHome As Boolean 'Nicht direkt in Configdatei Public LastMode As Int16 - Public TEMpath As String - Public LastTEM As String - Public TEMexl As Boolean - Public EAAvInt As Short Public ModOut As Boolean Public BATCHoutpath As String 'Ausgabepfad für BATCH-Modus: <WORKDIR>, <GENPATH> oder Pfad Public BATCHoutSubD As Boolean @@ -19,9 +15,6 @@ Public FZPsort As Boolean Public FZPsortExp As Boolean Public AirDensity As Single - Public FinalEmOnly As Boolean - Public FCcorrection As Boolean - Public nnormEngStop As Single Public OpenCmd As String Public OpenCmdName As String @@ -80,15 +73,15 @@ LastMode = CShort(c.ReadLine(0)) - nnormEngStop = CSng(c.ReadLine(0)) + c.ReadLine() - TEMpath = c.ReadLine(0) + c.ReadLine() - LastTEM = c.ReadLine(0) + c.ReadLine() - TEMexl = CBool(c.ReadLine(0)) + c.ReadLine() - EAAvInt = CShort(c.ReadLine(0)) + c.ReadLine() ModOut = CBool(c.ReadLine(0)) @@ -108,9 +101,9 @@ AirDensity = CSng(c.ReadLine(0)) - FinalEmOnly = CBool(c.ReadLine(0)) + c.ReadLine() - FCcorrection = CBool(c.ReadLine(0)) + c.ReadLine() line = c.ReadLine OpenCmd = line(0) @@ -146,10 +139,6 @@ lbEr: GnVorgab = True sWorkDPath = "c:\" LastMode = 0 - TEMpath = "<default>" - LastTEM = "New File.tem" - TEMexl = False - EAAvInt = 20 ModOut = True BATCHoutpath = sKey.GenPath BATCHoutSubD = False @@ -158,9 +147,6 @@ lbEr: FZPsort = True FZPsortExp = False AirDensity = 1.2 - FinalEmOnly = True - FCcorrection = False - nnormEngStop = -0.05 OpenCmd = "notepad" OpenCmdName = "Notepad" @@ -191,16 +177,16 @@ lbEr: End If c.WriteLine("c LastMode 0/1/2") c.WriteLine(F_MAINForm.CBoxMODE.SelectedIndex) - c.WriteLine("c nnorm engine stop [-]") - c.WriteLine(nnormEngStop) - c.WriteLine("c TEM_Data Path for *.tem file creation") - c.WriteLine(TEMpath) - c.WriteLine("c Last TEM File") - c.WriteLine(LastTEM) - c.WriteLine("c Open TEM 1/0") - c.WriteLine(Math.Abs(CInt(TEMexl))) - c.WriteLine("c Engine Analysis: Analyse intervals of seconds") - c.WriteLine(EAAvInt) + c.WriteLine("c NOT USED") + c.WriteLine("0") + c.WriteLine("c NOT USED") + c.WriteLine("0") + c.WriteLine("c NOT USED") + c.WriteLine("0") + c.WriteLine("c NOT USED") + c.WriteLine("0") + c.WriteLine("c NOT USED") + c.WriteLine("0") c.WriteLine("c Modal output 1/0") c.WriteLine(Math.Abs(CInt(ModOut))) c.WriteLine("c Cycle Distance Correction 1/0") @@ -219,10 +205,10 @@ lbEr: c.WriteLine(Math.Abs(CInt(BATCHoutSubD))) c.WriteLine("c Air Density [kg/m3]") c.WriteLine(CStr(AirDensity)) - c.WriteLine("c Emissions Output: Tailpipe Only 1/0") - c.WriteLine(Math.Abs(CInt(FinalEmOnly))) - c.WriteLine("c HDV FC Correction 1/0") - c.WriteLine(Math.Abs(CInt(FCcorrection))) + c.WriteLine("c NOT USED") + c.WriteLine("0") + c.WriteLine("c NOT USED") + c.WriteLine("0") c.WriteLine("c File Open CMD") c.WriteLine(OpenCmd, OpenCmdName) diff --git a/VECTO/cCustomMap.vb b/VECTO/cCustomMap.vb deleted file mode 100644 index 6fdfd937b7..0000000000 --- a/VECTO/cCustomMap.vb +++ /dev/null @@ -1,148 +0,0 @@ -Imports System.Collections.Generic - -Public Class cCustomMap - - Private lX As List(Of Single) - Private lY As List(Of Single) - Private lZ As List(Of List(Of Single)) - Private lDim As Integer - Private zDim As Integer - Private Xmin As Single - Private Xmax As Single - Private Ymin As Single - Private Ymax As Single - - Private Sub Reset() - lX = New List(Of Single) - lY = New List(Of Single) - lZ = New List(Of List(Of Single)) - lDim = -1 - zDim = -1 - Xmin = 0 - Xmax = 0 - Ymin = 0 - Ymax = 0 - End Sub - - Public Sub Init(Optional ByVal zAnz As Integer = 1) - Dim i As Integer - - Reset() - - zDim = zAnz - 1 - - For i = 0 To zDim - lZ.Add(New List(Of Single)) - Next - - End Sub - - Public Sub Add(ByVal x As Single, ByVal y As Single, ByVal z As Single) - lX.Add(x) - lY.Add(y) - lZ(0).Add(z) - lDim += 1 - End Sub - - Public Sub Add(ByVal Ar() As Single) - Dim i As Integer - - lX.Add(Ar(0)) - lY.Add(Ar(1)) - - For i = 0 To zDim - lZ(i).Add(Ar(i + 2)) - Next - - lDim += 1 - - End Sub - - Public Sub Add(ByVal StrAr() As String) - Dim i As Integer - - lX.Add(CSng(StrAr(0))) - lY.Add(CSng(StrAr(1))) - - For i = 0 To zDim - lZ(i).Add(CSng(StrAr(i + 2))) - Next - - lDim += 1 - - End Sub - - Public Sub Norm() - Dim i As Integer - Dim x As Single - Dim y As Single - - Xmin = lX(0) - Xmax = lX(0) - Ymin = lY(0) - Ymax = lY(0) - - 'Search Min/Max - For i = 1 To lDim - - x = lX(i) - y = lY(i) - - If x < Xmin Then - Xmin = x - ElseIf x > Xmax Then - Xmax = x - End If - - If y < Ymin Then - Ymin = y - ElseIf y > Ymax Then - Ymax = y - End If - - Next - - 'Normalize - For i = 1 To lDim - lX(i) = (lX(i) - Xmin) / (Xmax - Xmin) - lY(i) = (lY(i) - Ymin) / (Ymax - Ymin) - Next - - End Sub - - Public Function Intp(ByVal x As Single, ByVal y As Single, Optional ByVal zi As Integer = 0) As Single - - Dim wisum As Double = 0 - Dim sumo As Double = 0 - Dim ab As Double = 0 - Dim i As Int32 - - x = (x - Xmin) / (Xmax - Xmin) - y = (y - Ymin) / (Ymax - Ymin) - - For i = 0 To lDim - - 'When sign of x and y is not equal to the sign of xA(i) and yA(i) respectively, then skip Row i - If x * lX(i) < 0 Or y * lY(i) < 0 Then Continue For - - ab = (x - lX(i)) ^ 2 + (y - lY(i)) ^ 2 - - If ab = 0 Then - Return lZ(zi)(i) - Else - sumo = sumo + (lZ(zi)(i)) / ab - wisum = wisum + 1 / ab - End If - - Next - - If wisum = 0 Then - Return 0 - Else - Return sumo / wisum - End If - - End Function - - -End Class diff --git a/VECTO/cDEV.vb b/VECTO/cDEV.vb index 48bc7e403c..ac9d8fabde 100644 --- a/VECTO/cDEV.vb +++ b/VECTO/cDEV.vb @@ -15,7 +15,6 @@ Public Class cDEV Public SpeedPeEps As Single Public PreRun As Boolean - Public negFCerr As Single Public AllowAprxTrLoss As Boolean @@ -115,15 +114,6 @@ Public Class cDEV 'Conf0.ModeIndex = 3 'MyOptions.Add("Menu_Test", Conf0) - Conf0 = New cDEVoption(tDEVconfType.tAction, "Show hidden options in main form") - Conf0.ActionDelegate = New cDEVoption.dActionDelegate(AddressOf Me.ShowAddOptions) - MyOptions.Add("OptTest", Conf0) - - Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Show hidden options in VECTO Editor and Settings", False) - Conf0.BoolVal = False - MyOptions.Add("TestOptions", Conf0) - - Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Gear Correcion (gear shift polygons model only!)", False) Conf0.BoolVal = False @@ -152,10 +142,6 @@ Public Class cDEV Conf0.BoolVal = True MyOptions.Add("PreRun", Conf0) - Conf0 = New cDEVoption(tDEVconfType.tSingleVal, "FC values below negFCerr cause errors and abort calculation. Values between zero and negFCerr are set to zero.") - Conf0.SingleVal = -0.000001 - MyOptions.Add("negFCerr", Conf0) - Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Allow approximate transmission loss calculation in Cycle Preprocessing and Gear Shift Model", False) Conf0.BoolVal = True MyOptions.Add("AllowAprxTrLoss", Conf0) @@ -180,8 +166,6 @@ Public Class cDEV PreRun = MyOptions("PreRun").BoolVal - negFCerr = MyOptions("negFCerr").SingleVal - AllowAprxTrLoss = MyOptions("AllowAprxTrLoss").BoolVal End Sub @@ -191,12 +175,6 @@ Public Class cDEV Return "OK...?" End Function - Public Function ShowAddOptions() As String - F_MAINForm.GrbxTest.Visible = True - - Return ("done") - End Function - Public Function DEVinfo() As String Dim s As New System.Text.StringBuilder Dim Conf0 As KeyValuePair(Of String, cDEVoption) diff --git a/VECTO/cDelaunayMap.vb b/VECTO/cDelaunayMap.vb index 78af3a3f19..628a08cffa 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 @@ -247,7 +247,7 @@ Public Class cDelaunayMap If Exact Then Return (u >= 0) And (v >= 0) And (u + v <= 1) Else - Return (u >= -0.000001) And (v >= -0.000001) And (u + v <= 1.000001) + Return (u >= -0.001) And (v >= -0.001) And (u + v <= 1.001) End If End Function diff --git a/VECTO/cERG.vb b/VECTO/cERG.vb index f17d408679..0960ab63ea 100644 --- a/VECTO/cERG.vb +++ b/VECTO/cERG.vb @@ -59,9 +59,6 @@ Class cERG Dim Vquer As Single Dim sum As Double Dim t As Integer - Dim c As Integer - Dim EBatPlus As Single - Dim EBatMinus As Single Dim Em0 As cEmComp Dim key As String Dim First As Boolean @@ -74,10 +71,9 @@ Class cERG 'Vehicle type-independent ErgEntries("\\T").ValueString = (t1 + 1) - ErgEntries("\\Prated").ValueString = VEH.Pnenn 'Length, Speed, Slope - If Not GEN.VehMode = tVehMode.EngineOnly Then + If Not GEN.EngOnly Then 'Average-Speed. calculation sum = 0 @@ -106,190 +102,66 @@ Class cERG End If + 'Emissions + For Each Em0 In MODdata.Em.EmComp.Values - 'EV / Hybrid - If GEN.VehMode = tVehMode.EV Or GEN.VehMode = tVehMode.HEV Then + 'Dump x/h if ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible + If Em0.WriteOutput Then - 'Positive effective EM-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeEMot(t) > 0 Then - sum += MODdata.Px.PeEMot(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PeEM+").ValueString = (sum / c) - - 'Positive effective Battery-Power = internal EM-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeBat(t) > 0 Then - sum += MODdata.Px.PeBat(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PeBat+").ValueString = (sum / c) - - 'Positive internal Battery-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PiBat(t) > 0 Then - sum += MODdata.Px.PiBat(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PiBat+").ValueString = (sum / c) - - 'Calculate Energy consumed - EBatPlus = sum / 3600 - - 'Negative effective EM-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeEMot(t) < 0 Then - sum += MODdata.Px.PeEMot(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PeEM-").ValueString = (sum / c) - - 'Negative effective Battery-Power = internal EM-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeBat(t) < 0 Then - sum += MODdata.Px.PeBat(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PeBat-").ValueString = (sum / c) - - 'Negative internal Battery-Power - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PiBat(t) < 0 Then - sum += MODdata.Px.PiBat(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\PiBat-").ValueString = (sum / c) - - 'Charged-energy calculation - EBatMinus = sum / 3600 - - 'Battery in/out Energy - ErgEntries("\\EiBat+").ValueString = EBatPlus - ErgEntries("\\EiBat-").ValueString = EBatMinus - - 'EtaEM - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeEMot(t) > 0 Then - sum += (MODdata.Px.PeEMot(t)) / MODdata.Px.PiEMot(t) - c += 1 - ElseIf MODdata.Px.PeEMot(t) < 0 Then - sum += MODdata.Px.PiEMot(t) / (MODdata.Px.PeEMot(t)) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\EtaEM").ValueString = (sum / c) - - 'EtaBat - sum = 0 - c = 0 - For t = 0 To t1 - If MODdata.Px.PeBat(t) > 0 Then - sum += MODdata.Px.PeBat(t) / MODdata.Px.PiBat(t) - c += 1 - ElseIf MODdata.Px.PeBat(t) < 0 Then - sum += MODdata.Px.PiBat(t) / MODdata.Px.PeBat(t) - c += 1 - End If - Next - If c > 0 Then ErgEntries("\\EtaBat").ValueString = (sum / c) - - 'Delta SOC - ErgEntries("\\∆SOC").ValueString = (MODdata.Px.SOC(t1) - MODdata.Px.SOC(0)) - - 'Only EV: - If GEN.VehMode = tVehMode.EV Then - - 'Energy-consumption - ErgEntries("\\EC").ValueString = ((EBatPlus + EBatMinus) / (Vquer * (t1 + 1) / 3600)) - - End If - - End If - - 'Conventional means everything with ICE (not EV) - If GEN.VehMode <> tVehMode.EV Then - - 'Emissions - For Each Em0 In MODdata.Em.EmComp.Values - - 'Dump x/h if ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible - If Em0.WriteOutput Then - - If FCerror Then - If Em0.NormID = tEmNorm.x Or GEN.VehMode = tVehMode.EngineOnly Then - ErgEntries(Em0.IDstring).ValueString = "ERROR" - Else - ErgEntries(Em0.IDstring & "_km").ValueString = "ERROR" - End If + If FCerror Then + If Em0.NormID = tEmNorm.x Or GEN.EngOnly Then + ErgEntries(Em0.IDstring).ValueString = "ERROR" Else - If Em0.NormID = tEmNorm.x Or GEN.VehMode = tVehMode.EngineOnly Then - ErgEntries(Em0.IDstring).ValueString = Em0.FinalAvg - Else - ErgEntries(Em0.IDstring & "_km").ValueString = (Em0.FinalAvg / Vquer) - End If + ErgEntries(Em0.IDstring & "_km").ValueString = "ERROR" + End If + Else + If Em0.NormID = tEmNorm.x Or GEN.EngOnly Then + ErgEntries(Em0.IDstring).ValueString = Em0.FinalAvg + Else + ErgEntries(Em0.IDstring & "_km").ValueString = (Em0.FinalAvg / Vquer) End If - End If - Next + End If - 'Power, Revolutions - 'sum = 0 - 'For t = 0 To t1 - ' sum += MODdata.Pe(t) - 'Next - 'ErgEntries("\\Pe_norm").ValueString = (sum / (t1 + 1)) + Next - 'sum = 0 - 'For t = 0 To t1 - ' sum += MODdata.nn(t) - 'Next - 'ErgEntries("\\n_norm").ValueString = (sum / (t1 + 1)) + 'Power, Revolutions + 'sum = 0 + 'For t = 0 To t1 + ' sum += MODdata.Pe(t) + 'Next + 'ErgEntries("\\Pe_norm").ValueString = (sum / (t1 + 1)) + + 'sum = 0 + 'For t = 0 To t1 + ' sum += MODdata.nn(t) + 'Next + 'ErgEntries("\\n_norm").ValueString = (sum / (t1 + 1)) + + 'Ppos + sum = 0 + For t = 0 To t1 + sum += Math.Max(0, MODdata.Pe(t)) + Next + ErgEntries("\\Ppos").ValueString = (sum / (t1 + 1)) - 'Ppos - sum = 0 - For t = 0 To t1 - sum += Math.Max(0, MODdata.Pe(t)) - Next - ErgEntries("\\Ppos").ValueString = (sum / (t1 + 1)) + 'Pneg + sum = 0 + For t = 0 To t1 + sum += Math.Min(0, MODdata.Pe(t)) + Next + ErgEntries("\\Pneg").ValueString = (sum / (t1 + 1)) - 'Pneg - sum = 0 - For t = 0 To t1 - sum += Math.Min(0, MODdata.Pe(t)) - Next - ErgEntries("\\Pneg").ValueString = (sum / (t1 + 1)) - End If - 'Nur Gesamtfahrzeug (nicht EngOnly) |@@| Only Entire-vehicle (not EngOnly) - If Not GEN.VehMode = tVehMode.EngineOnly Then + 'Only Entire-vehicle (not EngOnly) + If Not GEN.EngOnly Then 'Pbrake-norm sum = 0 For t = 0 To t1 - sum += MODdata.Pbrake(t) / VEH.Pnenn + sum += MODdata.Pbrake(t) Next ErgEntries("\\Pbrake").ValueString = (sum / (t1 + 1)) @@ -351,21 +223,19 @@ Class cERG ErgEntries("\\" & ErgEntry.Head).ValueString = MODdata.CylceKin.GetValueString(ErgEntry.Head) Next - If GEN.VehMode <> tVehMode.EV Then - 'EposICE - sum = 0 - For t = 0 To t1 - sum += Math.Max(0, MODdata.Pe(t)) - Next - ErgEntries("\\EposICE").ValueString = (VEH.Pnenn * sum / 3600) + 'EposICE + sum = 0 + For t = 0 To t1 + sum += Math.Max(0, MODdata.Pe(t)) + Next + ErgEntries("\\EposICE").ValueString = (sum / 3600) - 'EnegICE - sum = 0 - For t = 0 To t1 - sum += Math.Min(0, MODdata.Pe(t)) - Next - ErgEntries("\\EnegICE").ValueString = (VEH.Pnenn * sum / 3600) - End If + 'EnegICE + sum = 0 + For t = 0 To t1 + sum += Math.Min(0, MODdata.Pe(t)) + Next + ErgEntries("\\EnegICE").ValueString = (sum / 3600) End If @@ -521,7 +391,6 @@ Class cERG Dim i1 As Integer Dim i2 As Integer Dim iDim As Integer - Dim DRI0 As cDRI Dim dic As Dictionary(Of String, Object) @@ -614,7 +483,6 @@ Class cERG 'Vehicle type-independent AddToErg("\\T", "time", "[s]") - AddToErg("\\Prated", "Prated", "[kW]") 'For each GEN-file check Mode and Map For Each str In GENs @@ -633,7 +501,7 @@ Class cERG Return False End Try - If GEN0.VehMode = tVehMode.EngineOnly Then + If GEN0.EngOnly Then If Not EngOnly Then @@ -664,125 +532,53 @@ Class cERG End If + 'Conventional vehicles ... + 'AddToErg("\\n_norm", "n_norm", "[-]") + 'AddToErg("\\Pe_norm", "Pe_norm", "[-]") + AddToErg("\\Ppos", "Ppos", "[kW]") + AddToErg("\\Pneg", "Pneg", "[kW]") - 'Electric-Vehicle / Hybrid - If GEN0.VehMode = tVehMode.EV Or GEN0.VehMode = tVehMode.HEV Then - - 'EV & HEV - If Not HEVorEVdone Then - - AddToErg("\\PeEM+", "PeEM+", "[kW]") - AddToErg("\\PeBat+", "PeBat+", "[kW]") - AddToErg("\\PiBat+", "PiBat+", "[kW]") - AddToErg("\\PeEM-", "PeEM-", "[kW]") - AddToErg("\\PeBat-", "PeBat-", "[kW]") - AddToErg("\\PiBat-", "PiBat-", "[kW]") - AddToErg("\\EiBat+", "EiBat+", "[kWh]") - AddToErg("\\EiBat-", "EiBat-", "[kWh]") - AddToErg("\\EtaEM", "EtaEM", "[%]") - AddToErg("\\EtaBat", "EtaBat", "[%]") - AddToErg("\\∆SOC", "∆SOC", "[%]") - - HEVorEVdone = True - - End If - - 'Only EV: - If GEN0.VehMode = tVehMode.EV And Not EVdone Then - - AddToErg("\\EC", "EC", "[kWh/km]") - - EVdone = True - - End If - - - End If - - - 'Conventional / Hybrid (Everything except EV) - If GEN0.VehMode <> tVehMode.EV Then - - 'Conventional vehicles ... - 'AddToErg("\\n_norm", "n_norm", "[-]") - 'AddToErg("\\Pe_norm", "Pe_norm", "[-]") - AddToErg("\\Ppos", "Ppos", "[-]") - AddToErg("\\Pneg", "Pneg", "[-]") - - If GEN0.CreateMap Then - - 'From the measured data - DRI0 = New cDRI - DRI0.FilePath = GEN0.CycleFiles(0).FullPath - - Try - If Not DRI0.ReadFile Then Return False - Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN0.CycleFiles(0).FullPath & ")", MsgSrc) - Return False - End Try - - For Each Em0 In DRI0.EmComponents.Values - - If Em0.WriteOutput Then - - 'Dump x/h if in ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible - If Em0.NormID = tEmNorm.x Or GEN0.VehMode = tVehMode.EngineOnly Then - AddToErg(Em0.IDstring, Em0.Name, Em0.Unit, False) - Else - AddToErg(Em0.IDstring, Em0.Name, "[" & Em0.RawUnit & "/km]", True) - End If - - End If - - Next - - AddToErg(sKey.MAP.Extrapol, fMapCompName(tMapComp.Extrapol), "[-]") - - Else + 'From the Engine-Map + ENG0 = New cENG + ENG0.FilePath = GEN0.PathENG - 'From the Engine-Map - ENG0 = New cENG - ENG0.FilePath = GEN0.PathENG + Try + If Not ENG0.ReadFile Then Return False + Catch ex As Exception + WorkerMsg(tMsgID.Err, "File read error! (" & GEN0.PathENG & ")", MsgSrc) + Return False + End Try - Try - If Not ENG0.ReadFile Then Return False - Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & GEN0.PathENG & ")", MsgSrc) - Return False - End Try + MAP0 = New cMAP + MAP0.FilePath = ENG0.PathMAP - MAP0 = New cMAP(GEN0.PKWja) - MAP0.FilePath = ENG0.PathMAP + Try + If Not MAP0.ReadFile(False) Then Return False 'Fehlermeldungen werden auch bei "MsgOutput = False" ausgegeben + Catch ex As Exception + WorkerMsg(tMsgID.Err, "File read error! (" & ENG0.PathMAP & ")", MsgSrc) + Return False + End Try - Try - If Not MAP0.ReadFile(False) Then Return False 'Fehlermeldungen werden auch bei "MsgOutput = False" ausgegeben - Catch ex As Exception - WorkerMsg(tMsgID.Err, "File read error! (" & ENG0.PathMAP & ")", MsgSrc) - Return False - End Try + For Each str1 In MAP0.EmList - For Each str1 In MAP0.EmList + Em0 = MAP0.EmComponents(str1) - Em0 = MAP0.EmComponents(str1) + If Em0.WriteOutput Then - If Em0.WriteOutput Then + 'Dump x/h if ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible + If Em0.NormID = tEmNorm.x Or GEN0.EngOnly Then + AddToErg(Em0.IDstring, Em0.Name, Em0.Unit, False) + Else + AddToErg(Em0.IDstring, Em0.Name, "[" & Em0.RawUnit & "/km]", True) + End If - 'Dump x/h if ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible - If Em0.NormID = tEmNorm.x Or GEN0.VehMode = tVehMode.EngineOnly Then - AddToErg(Em0.IDstring, Em0.Name, Em0.Unit, False) - Else - AddToErg(Em0.IDstring, Em0.Name, "[" & Em0.RawUnit & "/km]", True) - End If + End If - End If + Next - Next - End If - End If Next @@ -796,7 +592,7 @@ Class cERG If NonEngOnly Then 'Vehicle-related fields - AddToErg("\\Pbrake", "Pbrake", "[-]") + AddToErg("\\Pbrake", "Pbrake", "[kW]") AddToErg("\\EposICE", "EposICE", "[kWh]") AddToErg("\\EnegICE", "EnegICE", "[kWh]") AddToErg("\\Eair", "Eair", "[kWh]") diff --git a/VECTO/cEmComp.vb b/VECTO/cEmComp.vb index bade90146b..1c1b13c250 100644 --- a/VECTO/cEmComp.vb +++ b/VECTO/cEmComp.vb @@ -8,26 +8,14 @@ Public IDstring As String Public Unit As String - Public IntpolV2 As Boolean - Public PeCorMode As tIntpPeCorMode Public NormID As tEmNorm Public MapCompID As tMapComp = tMapComp.Undefined Public Col As Integer - Public RawVals As System.Collections.Generic.List(Of Single) 'RawVals darf man extern verändern aber nicht mit "New" neu definieren weil sonst stimmt FinalVals-Referenz nicht mehr - Public TCVals As System.Collections.Generic.List(Of Single) 'Werte nach Dyn-Kor - Public ATVals As System.Collections.Generic.List(Of Single) 'Werte nach EXS - Public FinalVals As System.Collections.Generic.List(Of Single) 'Verweist immer auf das letzte Feld (Tailpipe) + Public RawVals As System.Collections.Generic.List(Of Single) + Public FinalVals As System.Collections.Generic.List(Of Single) - 'Transient Correction - Private bTCdef As Boolean - Public TCfactors As System.Collections.Generic.Dictionary(Of tMapComp, Double) - - 'Component is dumped every one second Public WriteOutput As Boolean - 'Define ATVals (EXS) - Private bATdef As Boolean - 'Totals/Average Values Public FinalAvg As Single 'Durchschnittswert [g/h] Private FinalSum As Single 'Summe [g] @@ -37,34 +25,10 @@ Public Sub New() RawVals = New System.Collections.Generic.List(Of Single) FinalVals = RawVals - bTCdef = False - bATdef = False - IntpolV2 = False 'WICHTIG: Beim Einlesen von Map ist das hier der Standard für Nicht-Default-Komponenten! - PeCorMode = tIntpPeCorMode.PeCorOff 'WICHTIG: Beim Einlesen von Map ist das hier der Standard für Nicht-Default-Komponenten! NormID = tEmNorm.x WriteOutput = True End Sub - Public Sub InitTC() - bTCdef = True - TCfactors = New System.Collections.Generic.Dictionary(Of tMapComp, Double) - TCfactors.Add(tMapComp.TCdP2s, 0) - TCfactors.Add(tMapComp.TCPneg3s, 0) - TCfactors.Add(tMapComp.TCPpos3s, 0) - TCfactors.Add(tMapComp.TCAmpl3s, 0) - TCfactors.Add(tMapComp.TCLW3p3s, 0) - TCfactors.Add(tMapComp.TCP40sABS, 0) - TCfactors.Add(tMapComp.TCabsdn2s, 0) - TCfactors.Add(tMapComp.TCP10sn10s3, 0) - TCfactors.Add(tMapComp.TCdynV, 0) - TCfactors.Add(tMapComp.TCdynAV, 0) - TCfactors.Add(tMapComp.TCdynDAV, 0) - End Sub - - Public Sub InitAT() - bATdef = True - End Sub - Public ReadOnly Property RawUnit As String Get Dim txt As String @@ -82,18 +46,6 @@ End Get End Property - Public ReadOnly Property TCdef() As Boolean - Get - Return bTCdef - End Get - End Property - - Public ReadOnly Property ATdef() As Boolean - Get - Return bATdef - End Get - End Property - Public Sub SumCalc() Dim x As Single Dim sum As Double diff --git a/VECTO/cHEVctrl.vb b/VECTO/cHEVctrl.vb deleted file mode 100644 index 8fa7928f16..0000000000 --- a/VECTO/cHEVctrl.vb +++ /dev/null @@ -1,87 +0,0 @@ -Imports System.Collections.Generic - -Public Class cHEVctrl - - Public STEfile As String - - Private lSOC As List(Of Single) - Private lSTE As List(Of Single) - Private strDim As Integer - - Public vEVu As Single '[m/s] - Public vEVo As Single '[m/s] - Public SOC_OW As Single - Public SOC_UW As Single - - Public Sub New() - lSOC = New List(Of Single) - lSTE = New List(Of Single) - End Sub - - Public Sub CleanUp() - lSOC = Nothing - lSTE = Nothing - End Sub - - Public Function readSTE() As Boolean - Dim file As cFile_V3 - Dim line As String() - - file = New cFile_V3 - - If Not file.OpenRead(STEfile) Then - Return False - End If - - lSOC.Clear() - lSTE.Clear() - strDim = -1 - - vEVu = file.ReadLine(0) / 3.6 - vEVo = file.ReadLine(0) / 3.6 - SOC_UW = file.ReadLine(0) - SOC_OW = file.ReadLine(0) - - Do While Not file.EndOfFile - strDim += 1 - line = file.ReadLine - lSOC.Add(CSng(line(0))) - lSTE.Add(CSng(line(1))) - Loop - - file.Close() - - Return True - - End Function - - Public Function STEintp(ByVal SOC As Single) As Single - Dim i As Int32 - - 'Extrapolation für x < x(1) - If lSOC(0) >= SOC Then - ' ....Int1D_ERROR = True - i = 1 - GoTo lbInt - End If - - i = 0 - Do While lSOC(i) < SOC And i < strDim - i += 1 - Loop - - 'Extrapolation für x > x(imax) - If lSOC(i) < SOC Then - ' ....Int1D_ERROR = True - End If - -lbInt: - 'Interpolation - Return ((SOC - lSOC(i - 1)) * (lSTE(i) - lSTE(i - 1)) / (lSOC(i) - lSOC(i - 1)) + lSTE(i - 1)) - - End Function - - - - -End Class -- GitLab