diff --git a/VECTO/File Browser/FileBrowserModule.vb b/VECTO/File Browser/FileBrowserModule.vb index 6bfed9363c20d27fc5e5ef066eac9e7d54e6b841..ca63789858564b70c3b98e14df7a2c9cbf0c7614 100644 --- a/VECTO/File Browser/FileBrowserModule.vb +++ b/VECTO/File Browser/FileBrowserModule.vb @@ -34,6 +34,9 @@ Public Module FileBrowserModule Public ElectricMachineDragTorqueFileBrowser As FileBrowser Public ElectricMachineEfficiencyMapFileBrowser As FileBrowser + Public BatteryInternalResistanceCurveFileBrowser As FileBrowser + Public BatterySoCCurveFileBrowser As FileBrowser + Public EngineFileBrowser As FileBrowser Public GearboxFileBrowser As FileBrowser Public TCUFileBrowser As FileBrowser diff --git a/VECTO/GUI/BatteryForm.Designer.vb b/VECTO/GUI/BatteryForm.Designer.vb new file mode 100644 index 0000000000000000000000000000000000000000..b11b606d40b004fdcc6d174944d5d44cdec2669f --- /dev/null +++ b/VECTO/GUI/BatteryForm.Designer.vb @@ -0,0 +1,588 @@ +' Copyright 2017 European Union. +' Licensed under the EUPL (the 'Licence'); +' +' * You may not use this work except in compliance with the Licence. +' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl +' * Unless required by applicable law or agreed to in writing, +' software distributed under the Licence is distributed on an "AS IS" basis, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' +' See the LICENSE.txt for the specific language governing permissions and limitations. +Imports System.ComponentModel +Imports Microsoft.VisualBasic.CompilerServices + +<DesignerGenerated()> +Partial Class BatteryForm + Inherits Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + <DebuggerNonUserCode()> + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + <DebuggerStepThrough()> + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(BatteryForm)) + Me.tbCapacity = New System.Windows.Forms.TextBox() + Me.lblCapacityUnit = New System.Windows.Forms.Label() + Me.lblCapacity = 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() + Me.ToolStripBtNew = New System.Windows.Forms.ToolStripButton() + Me.ToolStripBtOpen = New System.Windows.Forms.ToolStripButton() + Me.ToolStripBtSave = New System.Windows.Forms.ToolStripButton() + Me.ToolStripBtSaveAs = New System.Windows.Forms.ToolStripButton() + Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() + Me.ToolStripBtSendTo = New System.Windows.Forms.ToolStripButton() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.LbStatus = New System.Windows.Forms.ToolStripStatusLabel() + Me.tbMakeModel = New System.Windows.Forms.TextBox() + Me.lblMakeModel = New System.Windows.Forms.Label() + Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.CmOpenFile = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.OpenWithToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.pnInertia = New System.Windows.Forms.Panel() + Me.tbSoCCurve = New System.Windows.Forms.TextBox() + Me.lblSoCCurve = New System.Windows.Forms.Label() + Me.btnBrowseSoCCurve = New System.Windows.Forms.Button() + Me.btnSoCCurveOpen = New System.Windows.Forms.Button() + Me.btnRiMapOpen = New System.Windows.Forms.Button() + Me.btnBrowseRiMap = New System.Windows.Forms.Button() + Me.lblRiMap = New System.Windows.Forms.Label() + Me.tbRiCurve = New System.Windows.Forms.TextBox() + Me.lblTitle = New System.Windows.Forms.Label() + Me.PicBox = New System.Windows.Forms.PictureBox() + Me.Panel1 = New System.Windows.Forms.Panel() + Me.lblMinSoc = New System.Windows.Forms.Label() + Me.lblSoCMinUnit = New System.Windows.Forms.Label() + Me.tbSoCMin = New System.Windows.Forms.TextBox() + Me.Panel2 = New System.Windows.Forms.Panel() + Me.lblSoCMax = New System.Windows.Forms.Label() + Me.lblSoCMaxUnit = New System.Windows.Forms.Label() + Me.tbSoCMax = New System.Windows.Forms.TextBox() + Me.Panel3 = New System.Windows.Forms.Panel() + Me.lblCFactor = New System.Windows.Forms.Label() + Me.lblCFactorUnit = New System.Windows.Forms.Label() + Me.tbCFactor = New System.Windows.Forms.TextBox() + Me.ToolStrip1.SuspendLayout() + Me.StatusStrip1.SuspendLayout() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.CmOpenFile.SuspendLayout() + Me.pnInertia.SuspendLayout() + CType(Me.PicBox, System.ComponentModel.ISupportInitialize).BeginInit() + Me.Panel1.SuspendLayout() + Me.Panel2.SuspendLayout() + Me.Panel3.SuspendLayout() + Me.SuspendLayout() + ' + 'tbCapacity + ' + Me.tbCapacity.Location = New System.Drawing.Point(90, 4) + Me.tbCapacity.Name = "tbCapacity" + Me.tbCapacity.Size = New System.Drawing.Size(57, 20) + Me.tbCapacity.TabIndex = 3 + ' + 'lblCapacityUnit + ' + Me.lblCapacityUnit.AutoSize = True + Me.lblCapacityUnit.Location = New System.Drawing.Point(153, 7) + Me.lblCapacityUnit.Name = "lblCapacityUnit" + Me.lblCapacityUnit.Size = New System.Drawing.Size(25, 13) + Me.lblCapacityUnit.TabIndex = 24 + Me.lblCapacityUnit.Text = "[As]" + ' + 'lblCapacity + ' + Me.lblCapacity.AutoSize = True + Me.lblCapacity.Location = New System.Drawing.Point(3, 7) + Me.lblCapacity.Name = "lblCapacity" + Me.lblCapacity.Size = New System.Drawing.Size(48, 13) + Me.lblCapacity.TabIndex = 0 + Me.lblCapacity.Text = "Capacity" + ' + '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(811, 303) + Me.ButCancel.Name = "ButCancel" + Me.ButCancel.Size = New System.Drawing.Size(75, 23) + Me.ButCancel.TabIndex = 13 + Me.ButCancel.Text = "Cancel" + Me.ButCancel.UseVisualStyleBackColor = True + ' + '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(730, 303) + Me.ButOK.Name = "ButOK" + Me.ButOK.Size = New System.Drawing.Size(75, 23) + Me.ButOK.TabIndex = 12 + Me.ButOK.Text = "Save" + Me.ButOK.UseVisualStyleBackColor = True + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripBtNew, Me.ToolStripBtOpen, Me.ToolStripBtSave, Me.ToolStripBtSaveAs, Me.ToolStripSeparator3, Me.ToolStripBtSendTo, Me.ToolStripSeparator1, Me.ToolStripButton1}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(898, 25) + Me.ToolStrip1.TabIndex = 30 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripBtNew + ' + Me.ToolStripBtNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripBtNew.Image = Global.TUGraz.VECTO.My.Resources.Resources.blue_document_icon + Me.ToolStripBtNew.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripBtNew.Name = "ToolStripBtNew" + Me.ToolStripBtNew.Size = New System.Drawing.Size(23, 22) + Me.ToolStripBtNew.Text = "ToolStripButton1" + Me.ToolStripBtNew.ToolTipText = "New" + ' + 'ToolStripBtOpen + ' + Me.ToolStripBtOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripBtOpen.Image = Global.TUGraz.VECTO.My.Resources.Resources.Open_icon + Me.ToolStripBtOpen.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripBtOpen.Name = "ToolStripBtOpen" + Me.ToolStripBtOpen.Size = New System.Drawing.Size(23, 22) + Me.ToolStripBtOpen.Text = "ToolStripButton1" + Me.ToolStripBtOpen.ToolTipText = "Open..." + ' + 'ToolStripBtSave + ' + Me.ToolStripBtSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripBtSave.Image = Global.TUGraz.VECTO.My.Resources.Resources.Actions_document_save_icon + Me.ToolStripBtSave.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripBtSave.Name = "ToolStripBtSave" + Me.ToolStripBtSave.Size = New System.Drawing.Size(23, 22) + Me.ToolStripBtSave.Text = "ToolStripButton1" + Me.ToolStripBtSave.ToolTipText = "Save" + ' + 'ToolStripBtSaveAs + ' + Me.ToolStripBtSaveAs.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripBtSaveAs.Image = Global.TUGraz.VECTO.My.Resources.Resources.Actions_document_save_as_icon + Me.ToolStripBtSaveAs.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripBtSaveAs.Name = "ToolStripBtSaveAs" + Me.ToolStripBtSaveAs.Size = New System.Drawing.Size(23, 22) + Me.ToolStripBtSaveAs.Text = "ToolStripButton1" + Me.ToolStripBtSaveAs.ToolTipText = "Save As..." + ' + 'ToolStripSeparator3 + ' + Me.ToolStripSeparator3.Name = "ToolStripSeparator3" + Me.ToolStripSeparator3.Size = New System.Drawing.Size(6, 25) + ' + 'ToolStripBtSendTo + ' + Me.ToolStripBtSendTo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripBtSendTo.Image = Global.TUGraz.VECTO.My.Resources.Resources.export_icon + Me.ToolStripBtSendTo.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripBtSendTo.Name = "ToolStripBtSendTo" + Me.ToolStripBtSendTo.Size = New System.Drawing.Size(23, 22) + Me.ToolStripBtSendTo.Text = "Send to Job Editor" + Me.ToolStripBtSendTo.ToolTipText = "Send to Job Editor" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = Global.TUGraz.VECTO.My.Resources.Resources.Help_icon + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Help" + ' + 'StatusStrip1 + ' + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.LbStatus}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 329) + Me.StatusStrip1.Name = "StatusStrip1" + Me.StatusStrip1.Size = New System.Drawing.Size(898, 22) + Me.StatusStrip1.SizingGrip = False + Me.StatusStrip1.TabIndex = 37 + Me.StatusStrip1.Text = "StatusStrip1" + ' + 'LbStatus + ' + Me.LbStatus.Name = "LbStatus" + Me.LbStatus.Size = New System.Drawing.Size(39, 17) + Me.LbStatus.Text = "Status" + ' + 'tbMakeModel + ' + Me.tbMakeModel.Location = New System.Drawing.Point(109, 82) + Me.tbMakeModel.Name = "tbMakeModel" + Me.tbMakeModel.Size = New System.Drawing.Size(370, 20) + Me.tbMakeModel.TabIndex = 0 + ' + 'lblMakeModel + ' + Me.lblMakeModel.AutoSize = True + Me.lblMakeModel.Location = New System.Drawing.Point(16, 85) + Me.lblMakeModel.Name = "lblMakeModel" + Me.lblMakeModel.Size = New System.Drawing.Size(87, 13) + Me.lblMakeModel.TabIndex = 11 + Me.lblMakeModel.Text = "Make and Model" + ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.Color.White + Me.PictureBox1.Image = Global.TUGraz.VECTO.My.Resources.Resources.VECTO_ENG + Me.PictureBox1.Location = New System.Drawing.Point(0, 28) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(502, 40) + Me.PictureBox1.TabIndex = 39 + Me.PictureBox1.TabStop = False + ' + 'CmOpenFile + ' + Me.CmOpenFile.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.OpenWithToolStripMenuItem, Me.ShowInFolderToolStripMenuItem}) + Me.CmOpenFile.Name = "CmOpenFile" + Me.CmOpenFile.Size = New System.Drawing.Size(153, 48) + ' + 'OpenWithToolStripMenuItem + ' + Me.OpenWithToolStripMenuItem.Name = "OpenWithToolStripMenuItem" + Me.OpenWithToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.OpenWithToolStripMenuItem.Text = "Open with ..." + ' + 'ShowInFolderToolStripMenuItem + ' + Me.ShowInFolderToolStripMenuItem.Name = "ShowInFolderToolStripMenuItem" + Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder" + ' + 'pnInertia + ' + Me.pnInertia.Controls.Add(Me.lblCapacity) + Me.pnInertia.Controls.Add(Me.lblCapacityUnit) + Me.pnInertia.Controls.Add(Me.tbCapacity) + Me.pnInertia.Location = New System.Drawing.Point(12, 108) + Me.pnInertia.Name = "pnInertia" + Me.pnInertia.Size = New System.Drawing.Size(212, 30) + Me.pnInertia.TabIndex = 3 + ' + 'tbSoCCurve + ' + Me.tbSoCCurve.Location = New System.Drawing.Point(12, 219) + Me.tbSoCCurve.Name = "tbSoCCurve" + Me.tbSoCCurve.Size = New System.Drawing.Size(434, 20) + Me.tbSoCCurve.TabIndex = 5 + ' + 'lblSoCCurve + ' + Me.lblSoCCurve.AutoSize = True + Me.lblSoCCurve.Location = New System.Drawing.Point(12, 203) + Me.lblSoCCurve.Name = "lblSoCCurve" + Me.lblSoCCurve.Size = New System.Drawing.Size(58, 13) + Me.lblSoCCurve.TabIndex = 38 + Me.lblSoCCurve.Text = "SoC Curve" + ' + 'btnBrowseSoCCurve + ' + Me.btnBrowseSoCCurve.Image = Global.TUGraz.VECTO.My.Resources.Resources.Open_icon + Me.btnBrowseSoCCurve.Location = New System.Drawing.Point(446, 217) + Me.btnBrowseSoCCurve.Name = "btnBrowseSoCCurve" + Me.btnBrowseSoCCurve.Size = New System.Drawing.Size(24, 24) + Me.btnBrowseSoCCurve.TabIndex = 6 + Me.btnBrowseSoCCurve.TabStop = False + Me.btnBrowseSoCCurve.UseVisualStyleBackColor = True + ' + 'btnSoCCurveOpen + ' + Me.btnSoCCurveOpen.Image = Global.TUGraz.VECTO.My.Resources.Resources.application_export_icon_small + Me.btnSoCCurveOpen.Location = New System.Drawing.Point(469, 217) + Me.btnSoCCurveOpen.Name = "btnSoCCurveOpen" + Me.btnSoCCurveOpen.Size = New System.Drawing.Size(24, 24) + Me.btnSoCCurveOpen.TabIndex = 7 + Me.btnSoCCurveOpen.TabStop = False + Me.btnSoCCurveOpen.UseVisualStyleBackColor = True + ' + 'btnRiMapOpen + ' + Me.btnRiMapOpen.Image = Global.TUGraz.VECTO.My.Resources.Resources.application_export_icon_small + Me.btnRiMapOpen.Location = New System.Drawing.Point(469, 263) + Me.btnRiMapOpen.Name = "btnRiMapOpen" + Me.btnRiMapOpen.Size = New System.Drawing.Size(24, 24) + Me.btnRiMapOpen.TabIndex = 42 + Me.btnRiMapOpen.TabStop = False + Me.btnRiMapOpen.UseVisualStyleBackColor = True + ' + 'btnBrowseRiMap + ' + Me.btnBrowseRiMap.Image = Global.TUGraz.VECTO.My.Resources.Resources.Open_icon + Me.btnBrowseRiMap.Location = New System.Drawing.Point(446, 263) + Me.btnBrowseRiMap.Name = "btnBrowseRiMap" + Me.btnBrowseRiMap.Size = New System.Drawing.Size(24, 24) + Me.btnBrowseRiMap.TabIndex = 41 + Me.btnBrowseRiMap.TabStop = False + Me.btnBrowseRiMap.UseVisualStyleBackColor = True + ' + 'lblRiMap + ' + Me.lblRiMap.AutoSize = True + Me.lblRiMap.Location = New System.Drawing.Point(12, 249) + Me.lblRiMap.Name = "lblRiMap" + Me.lblRiMap.Size = New System.Drawing.Size(129, 13) + Me.lblRiMap.TabIndex = 43 + Me.lblRiMap.Text = "Internal Resistance Curve" + ' + 'tbRiCurve + ' + Me.tbRiCurve.Location = New System.Drawing.Point(12, 265) + Me.tbRiCurve.Name = "tbRiCurve" + Me.tbRiCurve.Size = New System.Drawing.Size(434, 20) + Me.tbRiCurve.TabIndex = 40 + ' + 'lblTitle + ' + Me.lblTitle.AutoSize = True + Me.lblTitle.BackColor = System.Drawing.Color.White + Me.lblTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblTitle.Location = New System.Drawing.Point(119, 35) + Me.lblTitle.Name = "lblTitle" + Me.lblTitle.Size = New System.Drawing.Size(266, 29) + Me.lblTitle.TabIndex = 48 + Me.lblTitle.Text = "Electric Energy Storage" + ' + 'PicBox + ' + Me.PicBox.BackColor = System.Drawing.Color.LightGray + Me.PicBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.PicBox.Location = New System.Drawing.Point(508, 28) + Me.PicBox.Name = "PicBox" + Me.PicBox.Size = New System.Drawing.Size(382, 266) + Me.PicBox.TabIndex = 49 + Me.PicBox.TabStop = False + ' + 'Panel1 + ' + Me.Panel1.Controls.Add(Me.lblMinSoc) + Me.Panel1.Controls.Add(Me.lblSoCMinUnit) + Me.Panel1.Controls.Add(Me.tbSoCMin) + Me.Panel1.Location = New System.Drawing.Point(12, 144) + Me.Panel1.Name = "Panel1" + Me.Panel1.Size = New System.Drawing.Size(212, 30) + Me.Panel1.TabIndex = 25 + ' + 'lblMinSoc + ' + Me.lblMinSoc.AutoSize = True + Me.lblMinSoc.Location = New System.Drawing.Point(3, 7) + Me.lblMinSoc.Name = "lblMinSoc" + Me.lblMinSoc.Size = New System.Drawing.Size(46, 13) + Me.lblMinSoc.TabIndex = 0 + Me.lblMinSoc.Text = "SoC min" + ' + 'lblSoCMinUnit + ' + Me.lblSoCMinUnit.AutoSize = True + Me.lblSoCMinUnit.Location = New System.Drawing.Point(153, 7) + Me.lblSoCMinUnit.Name = "lblSoCMinUnit" + Me.lblSoCMinUnit.Size = New System.Drawing.Size(21, 13) + Me.lblSoCMinUnit.TabIndex = 24 + Me.lblSoCMinUnit.Text = "[%]" + ' + 'tbSoCMin + ' + Me.tbSoCMin.Location = New System.Drawing.Point(90, 4) + Me.tbSoCMin.Name = "tbSoCMin" + Me.tbSoCMin.Size = New System.Drawing.Size(57, 20) + Me.tbSoCMin.TabIndex = 3 + ' + 'Panel2 + ' + Me.Panel2.Controls.Add(Me.lblSoCMax) + Me.Panel2.Controls.Add(Me.lblSoCMaxUnit) + Me.Panel2.Controls.Add(Me.tbSoCMax) + Me.Panel2.Location = New System.Drawing.Point(234, 144) + Me.Panel2.Name = "Panel2" + Me.Panel2.Size = New System.Drawing.Size(212, 30) + Me.Panel2.TabIndex = 25 + ' + 'lblSoCMax + ' + Me.lblSoCMax.AutoSize = True + Me.lblSoCMax.Location = New System.Drawing.Point(3, 7) + Me.lblSoCMax.Name = "lblSoCMax" + Me.lblSoCMax.Size = New System.Drawing.Size(49, 13) + Me.lblSoCMax.TabIndex = 0 + Me.lblSoCMax.Text = "SoC max" + ' + 'lblSoCMaxUnit + ' + Me.lblSoCMaxUnit.AutoSize = True + Me.lblSoCMaxUnit.Location = New System.Drawing.Point(153, 7) + Me.lblSoCMaxUnit.Name = "lblSoCMaxUnit" + Me.lblSoCMaxUnit.Size = New System.Drawing.Size(21, 13) + Me.lblSoCMaxUnit.TabIndex = 24 + Me.lblSoCMaxUnit.Text = "[%]" + ' + 'tbSoCMax + ' + Me.tbSoCMax.Location = New System.Drawing.Point(90, 4) + Me.tbSoCMax.Name = "tbSoCMax" + Me.tbSoCMax.Size = New System.Drawing.Size(57, 20) + Me.tbSoCMax.TabIndex = 3 + ' + 'Panel3 + ' + Me.Panel3.Controls.Add(Me.lblCFactor) + Me.Panel3.Controls.Add(Me.lblCFactorUnit) + Me.Panel3.Controls.Add(Me.tbCFactor) + Me.Panel3.Location = New System.Drawing.Point(234, 108) + Me.Panel3.Name = "Panel3" + Me.Panel3.Size = New System.Drawing.Size(212, 30) + Me.Panel3.TabIndex = 25 + ' + 'lblCFactor + ' + Me.lblCFactor.AutoSize = True + Me.lblCFactor.Location = New System.Drawing.Point(3, 7) + Me.lblCFactor.Name = "lblCFactor" + Me.lblCFactor.Size = New System.Drawing.Size(47, 13) + Me.lblCFactor.TabIndex = 0 + Me.lblCFactor.Text = "C-Factor" + ' + 'lblCFactorUnit + ' + Me.lblCFactorUnit.AutoSize = True + Me.lblCFactorUnit.Location = New System.Drawing.Point(153, 7) + Me.lblCFactorUnit.Name = "lblCFactorUnit" + Me.lblCFactorUnit.Size = New System.Drawing.Size(16, 13) + Me.lblCFactorUnit.TabIndex = 24 + Me.lblCFactorUnit.Text = "[-]" + ' + 'tbCFactor + ' + Me.tbCFactor.Location = New System.Drawing.Point(90, 4) + Me.tbCFactor.Name = "tbCFactor" + Me.tbCFactor.Size = New System.Drawing.Size(57, 20) + Me.tbCFactor.TabIndex = 3 + ' + 'BatteryForm + ' + Me.AcceptButton = Me.ButOK + 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(898, 351) + Me.Controls.Add(Me.Panel3) + Me.Controls.Add(Me.Panel2) + Me.Controls.Add(Me.Panel1) + Me.Controls.Add(Me.PicBox) + Me.Controls.Add(Me.lblTitle) + Me.Controls.Add(Me.btnRiMapOpen) + Me.Controls.Add(Me.btnBrowseRiMap) + Me.Controls.Add(Me.lblRiMap) + Me.Controls.Add(Me.tbRiCurve) + Me.Controls.Add(Me.pnInertia) + Me.Controls.Add(Me.btnSoCCurveOpen) + Me.Controls.Add(Me.PictureBox1) + Me.Controls.Add(Me.btnBrowseSoCCurve) + Me.Controls.Add(Me.lblSoCCurve) + Me.Controls.Add(Me.StatusStrip1) + Me.Controls.Add(Me.ToolStrip1) + Me.Controls.Add(Me.ButCancel) + Me.Controls.Add(Me.tbSoCCurve) + Me.Controls.Add(Me.ButOK) + Me.Controls.Add(Me.lblMakeModel) + Me.Controls.Add(Me.tbMakeModel) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.Name = "BatteryForm" + Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Electric Energy Storage" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.StatusStrip1.ResumeLayout(False) + Me.StatusStrip1.PerformLayout() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.CmOpenFile.ResumeLayout(False) + Me.pnInertia.ResumeLayout(False) + Me.pnInertia.PerformLayout() + CType(Me.PicBox, System.ComponentModel.ISupportInitialize).EndInit() + Me.Panel1.ResumeLayout(False) + Me.Panel1.PerformLayout() + Me.Panel2.ResumeLayout(False) + Me.Panel2.PerformLayout() + Me.Panel3.ResumeLayout(False) + Me.Panel3.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents tbCapacity As TextBox + Friend WithEvents lblCapacityUnit As Label + Friend WithEvents lblCapacity As Label + Friend WithEvents ButCancel As Button + Friend WithEvents ButOK As Button + Friend WithEvents ToolStrip1 As ToolStrip + Friend WithEvents ToolStripBtNew As ToolStripButton + Friend WithEvents ToolStripBtOpen As ToolStripButton + Friend WithEvents ToolStripBtSave As ToolStripButton + Friend WithEvents ToolStripBtSaveAs As ToolStripButton + Friend WithEvents ToolStripSeparator3 As ToolStripSeparator + Friend WithEvents ToolStripBtSendTo As ToolStripButton + Friend WithEvents StatusStrip1 As StatusStrip + Friend WithEvents LbStatus As ToolStripStatusLabel + Friend WithEvents tbMakeModel As TextBox + Friend WithEvents lblMakeModel As Label + Friend WithEvents PictureBox1 As PictureBox + Friend WithEvents ToolStripSeparator1 As ToolStripSeparator + Friend WithEvents ToolStripButton1 As ToolStripButton + Friend WithEvents CmOpenFile As ContextMenuStrip + Friend WithEvents OpenWithToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ShowInFolderToolStripMenuItem As ToolStripMenuItem + Friend WithEvents pnInertia As Panel + Friend WithEvents tbSoCCurve As TextBox + Friend WithEvents lblSoCCurve As Label + Friend WithEvents btnBrowseSoCCurve As Button + Friend WithEvents btnSoCCurveOpen As Button + Friend WithEvents btnRiMapOpen As Button + Friend WithEvents btnBrowseRiMap As Button + Friend WithEvents lblRiMap As Label + Friend WithEvents tbRiCurve As TextBox + Friend WithEvents lblTitle As Label + Friend WithEvents PicBox As PictureBox + Friend WithEvents Panel1 As Panel + Friend WithEvents lblMinSoc As Label + Friend WithEvents lblSoCMinUnit As Label + Friend WithEvents tbSoCMin As TextBox + Friend WithEvents Panel2 As Panel + Friend WithEvents lblSoCMax As Label + Friend WithEvents lblSoCMaxUnit As Label + Friend WithEvents tbSoCMax As TextBox + Friend WithEvents Panel3 As Panel + Friend WithEvents lblCFactor As Label + Friend WithEvents lblCFactorUnit As Label + Friend WithEvents tbCFactor As TextBox +End Class diff --git a/VECTO/GUI/BatteryForm.resx b/VECTO/GUI/BatteryForm.resx new file mode 100644 index 0000000000000000000000000000000000000000..81623a24e36cbaf6c70822eb47f982f654db0f27 --- /dev/null +++ b/VECTO/GUI/BatteryForm.resx @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>114, 20</value> + </metadata> + <metadata name="CmOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>226, 18</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP39/QLg6NsG/v7+AgAA + AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////////////////// + /////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v4B1uDQEIil + di319/MQ////AQAAAAAAAAAAAAAAAAAAAAD/////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP7+ + /gudtI5FRHEmhMbUvS7+/v4CAAAAAAAAAAAAAAAAAAAAAP////8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8B7PDpJmOJS5s4aBnEjal8Wf39/A8AAAAAAAAAAAAAAAAAAAAA/////wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAP7+/ga3ya0+PGsexzdnGO9Vfjut4OfcLP///wIAAAAAAAAAAAAAAAD/////AAAA/wAA + AP8AAAD/AAAA////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAD///8B+vv6Fn+ea3E2ZhfeN2cY/DhnGc+nvJpJ/v7+CQAAAAAAAAAAAAAAAP// + //8AAAD/AAAA/wAAAP8AAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/+/gLU3s0vSHQstTZmF/Y2Zhf+NmYX6G2QV4zy9fAg////AQAA + AAAAAAAA/////wAAAP8AAAD/AAAA/wAAAP//////////////////////////////////////AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+DJqyilI1ZhbTNmYW/TZmF/82Zhf5P20hwMDP + tzj+/v4EAAAAAAAAAAD/////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA//// + //8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wLr7+cpX4ZFpTVmFfA2ZhX/NmYW/zZm + Fv42ZhfZh6N0ZPz9/BL+/v4BAAAAAP////8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+B7TGqEI6ahnMNmcV/DZn + Ff82ZhX/NmYV/zVlF/RPeTOw2+TWLf7+/gIAAAAA/////wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wH4+vgZeppleTVm + FOE2ZxX+NmcV/zZnFf82ZhX/NmYV/TZmFtGhuJNO/v7+CgAAAAD/////AAAA/wAAAP8AAAD/AAAA//// + //////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+As/b + yDBGcyi3NWYU9zVmFP82ZxX/NmcV/zZnFf82ZxX+NWYV7GeMT5fv8+0k////Af////8AAAD/AAAA/wAA + AP8AAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD+/v4Mlq+FVDRlE9Q1ZhT9NWYU/zVmFP82ZxX/NmcV/zZnFf82ZxX7PWwdxbzMsTz+/v4F/////wAA + AP8AAAD/AAAA/wAAAP///////////////////////////////////////////wAAAAAAAAAAAAAAAAAA + AAAAAAAA////Auju5Stbg0GqNWUU8jVmFP81ZhT/NWYU/zVmFP82ZxX/NmcV/zZnFf41ZhTdgqBubfv8 + +hX/////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP//////AAAAAAAA + AAAAAAAAAAAAAAAAAAD+/v4HscOlRThoGM41ZhT9NWYU/zVmFP81ZhT/NWYU/zVmFP82ZxX/NmcV/zVm + FPVLdy6z1+DQL/7+/v8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA//// + //8AAAAAAAAAAAAAAAAAAAAA////Afj59xt2l2F+NGUT4zVmFP41ZhT/NWYU/zVmFP81ZhT/NWYU/zVm + FP82ZxX/NmcV/TVmFdOctI1R/v7+/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD//////wAAAAAAAAAAAAAAAAAAAAD+/v4CzdnFMURxJbo1ZhT4NWYU/zVmFP81ZhT/NWYU/zVm + FP81ZhT/NWYU/zVmFP82ZxX/NWYU7mKISZ/8/Pv///////////////////////////////////////// + ////////////////////////AAAAAAAAAAAAAAAAAAAAAP7+/gyUroNUNGUT1DVmFP01ZhT/NWYU/zVm + FP81ZhT/NWYU/zVmFP81ZhT/NWYU/zVmFP82ZxX8O2obybfIq0L+/v4I/v7+Av39/QL9/v0C/f79Av3+ + /QL9/v0C/f79Av3+/QL9/v0C/f79Av3+/QL9/v0C/f79AgAAAAD///8C5uziK1mBPqs0ZRPzNWYU/zVm + FP81ZhT/NWYU/zVmFP81ZhT/NWYU/zVmFP81ZhT/NWYU/zZnFf41ZhThepplhNTezUPZ4tM12eLTNdni + 0zXZ4tM12eLTNdni1DXZ4tQ12eLUNdrj1DXa49U12eLUNdrj1DXa49U1AAAAAP7+/givwqJGN2cWzjVm + FP01ZhT/NWYU/zVmFP81ZhT/NGYT/zVmFP41ZhT/NWYU/zVmFP81ZhT/NWYU/zZnFfg1ZhThRHImz0Rx + JspEcSfKRXEoykVyKMpFcinKRnMqykd0K8pIdCvKSXUsykt3LspIdCvKSXUsykt3Lsr//v8B9vj1HXSW + XoM0ZRPlNWYU/jVmFP81ZhT/NWYU/zVmFP82ZhX0U3w34DRlE/Q1ZhT/NWYU/zVmFP81ZhT/NWYU/zZn + Ff42ZxX9NmYV/TZmFv02Zhf9NmYX/TdnGP03Zxj9OWgZ/TppGv06ahv9PGwd/TppGv06ahv9PGwd/f7/ + /gLK1sIyQnAkuzRlE/g1ZhT/NWYU/zVmFP81ZhT/NWYU+0dzKc2gt5GGP24g0zVmFP01ZhT/NWYU/zVm + FP81ZhT/NmcV/zZnFf82ZxX/NmYW/zZmF/82Zhf/N2cY/zdnGP84aBn/Omka/zpqG/87axz/Omka/zpq + G/87axz//f79DY+qflc0ZRPVNWYU/TVmFP81ZhT/NWYU/zVmFP41ZRTraY1RluLp3k1fhkWnNGUT8TVm + FP81ZhT/NWYU/zVmFP81ZhT/NmcV/zZnFf82ZhX/NmYW/zZmF/83Zxf/N2cY/zhoGf85aRr/Omob/ztr + HP85aRr/Omob/ztrHP/j6t8rVn88rDRlFPM1ZhT/NWYU/zVmFP81ZhT/NWYU/jRlE9KWr4VN/f39F5Cq + flU0ZRPVNWYU/jVmFP81ZhT/NWYU/zVmFP82ZxX/NmcV/zZmFf82Zhb/NmYX/zZmF/83Zxj/N2cY/zlp + Gv86ahv/O2sc/zlpGv86ahv/O2sc/6zAn0c3ZxbPNWYU/TVmFP81ZhT/NWYU/zVmFP81ZhT9PWwdycPS + ujb+/v4EwtC4Nz1sHco1ZhT9NWYU/zVmFP81ZhT/NWYU/zZnFf82ZxX/NmYV/zZmFv82Zhf/NmYX/zdn + GP83Zxj/OWka/zpqG/86ahv/OWka/zpqG/86ahv/cpRchjRlE+Y1ZhT+NWYU/zVmFP81ZhT/NWYU/zVm + FPZXgDyz6e7mLv///wPp7uYsWYE+rzVmFPQ1ZhT/NWYU/zVmFP81ZhT/NmcV/zZnFf82ZhT/NmYV/zZm + F/82Zhf/N2cX/zdnGP85aRr/Omob/zpqG/85aRr/Omob/zpqG/9BbyK6NGUU9jVmFP01ZhT9NWYU/TVm + FP01ZhT8NGUT3IGgbW78/PwW////Af39/RGJpXZiNGUT2DVmFPw1ZhT9NGUT/TVmFP02ZxX9NmcV/TZm + Ff02ZhX9NmYX/TZmF/03Zxf9N2cY/ThoGf06aRr9Omob/ThoGf06aRr9Omob/TZnFaE2ZxXINmcVyjZn + Fco2ZxXKNmcVyjZnFck4aBijr8KiNP7+/gUAAAAA/v7+A7rKrzA7ahuiNmcVyTZnFco2ZxXKN2cWyjdo + Fso3aBbKN2gWyjdnF8o3ZxjKOGcZyjhoGco5aBrKOmobyjtrHMo8ax3KOmobyjtrHMo8ax3KscSkKrHE + pDWxxKQ1scSkNbHEpDWxxKQ1scSkNbTGqCru8uwM///+AQAAAAAAAAAA8/bxC7bHqiqxxKQ1scSkNbHE + pDWxxKQ1scSlNbHEpTWxxKU1scSlNbHEpTWxxKU1scSmNbLEpjWyxaY1s8WnNbPFpzWyxaY1s8WnNbPF + pzX///8C////Av///wL///8C////Av///wL///8C////AgAAAAAAAAAAAAAAAAAAAAAAAAAA////Av// + /wL///8C////Av///wL///8C////Av///wL///8C////Av///wL///8C////Av///wL///8C////AgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA////////gAP//4AD/9+AA/+fgAP/j4AD/4+B//8HgAf/B4AH/geAB/4D + gAf+A4AH/AGB//wBgAP4AYAD+ACAA/gAgAPwAAAD8AB//+AAP//gAAAAwAAAAMAAAADAIAAAgHAAAIBw + AAAAcAAAAPgAAAD4AAD///////////////8= +</value> + </data> +</root> \ No newline at end of file diff --git a/VECTO/GUI/BatteryForm.vb b/VECTO/GUI/BatteryForm.vb new file mode 100644 index 0000000000000000000000000000000000000000..cd5fdc4262a82e3f7ace7b7e086942ebe0ce5061 --- /dev/null +++ b/VECTO/GUI/BatteryForm.vb @@ -0,0 +1,511 @@ + +Imports System.Drawing.Imaging +Imports System.IO +Imports System.Linq +Imports System.Windows.Forms.DataVisualization.Charting +Imports TUGraz.VectoCommon.InputData +Imports TUGraz.VectoCommon.Models +Imports TUGraz.VectoCommon.Utils +Imports TUGraz.VectoCore.InputData.FileIO.JSON +Imports TUGraz.VectoCore.InputData.Reader.ComponentData +Imports TUGraz.VectoCore.Models.Declaration +Imports TUGraz.VectoCore.Models.SimulationComponent.Data +Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Battery +Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Engine +Imports TUGraz.VectoCore.Utils +' Copyright 2017 European Union. +' Licensed under the EUPL (the 'Licence'); +' +' * You may not use this work except in compliance with the Licence. +' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl +' * Unless required by applicable law or agreed to in writing, +' software distributed under the Licence is distributed on an "AS IS" basis, +' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +' +' See the LICENSE.txt for the specific language governing permissions and limitations. + +''' <summary> +''' Engine Editor. Open and save .VENG files. +''' </summary> +''' <remarks></remarks> +Public Class BatteryForm + Private _batteryFile As String = "" + Public AutoSendTo As Boolean = False + Public JobDir As String = "" + Private _changed As Boolean = False + + Private _contextMenuFiles As String() + + + + + 'Before closing Editor: Check if file was changed and ask to save. + Private Sub F_ENG_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + If e.CloseReason <> CloseReason.ApplicationExitCall And e.CloseReason <> CloseReason.WindowsShutDown Then + e.Cancel = ChangeCheckCancel() + End If + End Sub + + 'Initialise. + Private Sub EngineFormLoad(sender As Object, e As EventArgs) Handles Me.Load + + ' initialize form on load - nothng to do right now + + 'pnInertia.Enabled = Not Cfg.DeclMode + + + _changed = False + + + NewEngine() + End Sub + + 'Set generic values for Declaration mode. + Private Sub DeclInit() + + If Not Cfg.DeclMode Then Exit Sub + + + + End Sub + + +#Region "Toolbar" + + Private Sub ToolStripBtNew_Click(sender As Object, e As EventArgs) Handles ToolStripBtNew.Click + NewEngine() + End Sub + + Private Sub ToolStripBtOpen_Click(sender As Object, e As EventArgs) Handles ToolStripBtOpen.Click + If EngineFileBrowser.OpenDialog(_batteryFile) Then + Try + OpenBatteryFile(EngineFileBrowser.Files(0)) + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Error loading Engine File") + End Try + End If + End Sub + + Private Sub ToolStripBtSave_Click(sender As Object, e As EventArgs) Handles ToolStripBtSave.Click + SaveOrSaveAs(False) + End Sub + + Private Sub ToolStripBtSaveAs_Click(sender As Object, e As EventArgs) Handles ToolStripBtSaveAs.Click + SaveOrSaveAs(True) + End Sub + + Private Sub ToolStripBtSendTo_Click(sender As Object, e As EventArgs) Handles ToolStripBtSendTo.Click + + If ChangeCheckCancel() Then Exit Sub + + If _batteryFile = "" Then + If MsgBox("Save file now?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + If Not SaveOrSaveAs(True) Then Exit Sub + Else + Exit Sub + End If + End If + + If Not VectoJobForm.Visible Then + JobDir = "" + VectoJobForm.Show() + VectoJobForm.VectoNew() + Else + VectoJobForm.WindowState = FormWindowState.Normal + End If + + VectoJobForm.TbENG.Text = GetFilenameWithoutDirectory(_batteryFile, JobDir) + End Sub + + Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click + If File.Exists(Path.Combine(MyAppPath, "User Manual\help.html")) Then + Dim defaultBrowserPath As String = BrowserUtils.GetDefaultBrowserPath() + Process.Start(defaultBrowserPath, + String.Format("""file://{0}""", Path.Combine(MyAppPath, "User Manual\help.html#engine-editor"))) + Else + MsgBox("User Manual not found!", MsgBoxStyle.Critical) + End If + End Sub + +#End Region + + 'Create new empty Engine file. + Private Sub NewEngine() + + If ChangeCheckCancel() Then Exit Sub + + tbMakeModel.Text = "" + tbCapacity.Text = "" + tbRiCurve.Text = "" + tbSoCCurve.Text = "" + + DeclInit() + + _batteryFile = "" + Text = "Electric Energy Storage Editor" + LbStatus.Text = "" + + _changed = False + + UpdatePic() + End Sub + + 'Open VENG file + Public Sub OpenBatteryFile(file As String) + Dim battery As IBatteryPackEngineeringInputData + + If ChangeCheckCancel() Then Exit Sub + + Dim inputData As IEngineeringInputDataProvider = TryCast(JSONInputDataFactory.ReadComponentData(file), + IEngineeringInputDataProvider) + + battery = inputData.JobInputData.Vehicle.Components.ElectricStorage.BatteryPack + + If Cfg.DeclMode <> battery.SavedInDeclarationMode Then + Select Case WrongMode() + Case 1 + Close() + MainForm.RbDecl.Checked = Not MainForm.RbDecl.Checked + MainForm.OpenVectoFile(file) + Case -1 + Exit Sub + End Select + End If + + Dim basePath As String = Path.GetDirectoryName(file) + tbMakeModel.Text = battery.Model + tbCapacity.Text = battery.Capacity.ToGUIFormat() + + tbCFactor.Text = battery.MaxCurrentFactor.ToGUIFormat() + tbSoCMin.Text = (battery.MinSOC * 100).ToGUIFormat() + tbSoCMax.Text = (battery.MaxSOC * 100).ToGUIFormat() + + tbSoCCurve.Text = GetRelativePath(battery.VoltageCurve.Source, basePath) + tbRiCurve.Text = GetRelativePath(battery.InternalResistanceCurve.Source, basePath) + DeclInit() + + BatteryFileBrowser.UpdateHistory(file) + Text = GetFilenameWithoutPath(file, True) + LbStatus.Text = "" + _batteryFile = file + Activate() + + _changed = False + UpdatePic() + End Sub + + 'Save or Save As function = true if file is saved + Private Function SaveOrSaveAs(ByVal saveAs As Boolean) As Boolean + If _batteryFile = "" Or saveAs Then + If BatteryFileBrowser.SaveDialog(_batteryFile) Then + _batteryFile = BatteryFileBrowser.Files(0) + Else + Return False + End If + End If + Return SaveEngineToFile(_batteryFile) + End Function + + 'Save VENG file to given filepath. Called by SaveOrSaveAs. + Private Function SaveEngineToFile(ByVal file As String) As Boolean + + Dim battery As Battery = New Battery + battery.FilePath = file + + battery.ModelName = tbMakeModel.Text + If Trim(battery.ModelName) = "" Then battery.ModelName = "Undefined" + battery.BatCapacity = tbCapacity.Text.ToDouble(0) + + battery.PathSoCCurve = tbSoCCurve.Text + battery.PathRiCurve = tbRiCurve.Text + + battery.BatMinSoc = tbSoCMin.Text.ToDouble(0) + battery.BatMaxSoc = tbSoCMax.Text.ToDouble(0) + + battery.BatCFactor = tbCFactor.Text.ToDouble(0) + + If Not battery.SaveFile Then + MsgBox("Cannot save to " & file, MsgBoxStyle.Critical) + Return False + End If + + 'If AutoSendTo Then + ' If VectoJobForm.Visible Then + ' If UCase(FileRepl(VectoJobForm.TbENG.Text, JobDir)) <> UCase(file) Then _ + ' VectoJobForm.TbENG.Text = GetFilenameWithoutDirectory(file, JobDir) + ' VectoJobForm.UpdatePic() + ' End If + 'End If + + BatteryFileBrowser.UpdateHistory(file) + Text = GetFilenameWithoutPath(file, True) + LbStatus.Text = "" + + _changed = False + + Return True + End Function + + +#Region "Track changes" + + 'Flags current file as modified. + Private Sub Change() + If Not _changed Then + LbStatus.Text = "Unsaved changes in current file" + _changed = True + End If + End Sub + + ' "Save changes ?" .... Returns True if User aborts + Private Function ChangeCheckCancel() As Boolean + + If _changed Then + Select Case MsgBox("Save changes ?", MsgBoxStyle.YesNoCancel) + Case MsgBoxResult.Yes + Return Not SaveOrSaveAs(False) + Case MsgBoxResult.Cancel + Return True + Case Else 'MsgBoxResult.No + _changed = False + Return False + End Select + + Else + + Return False + + End If + End Function + + + Private Sub TbName_TextChanged(sender As Object, e As EventArgs) Handles tbMakeModel.TextChanged + Change() + End Sub + + Private Sub TbDispl_TextChanged(sender As Object, e As EventArgs) + Change() + DeclInit() + End Sub + + Private Sub TbInertia_TextChanged(sender As Object, e As EventArgs) Handles tbCapacity.TextChanged + Change() + End Sub + + Private Sub TbNleerl_TextChanged(sender As Object, e As EventArgs) + UpdatePic() + Change() + End Sub + + Private Sub TbMAP_TextChanged(sender As Object, e As EventArgs) _ + Handles tbSoCCurve.TextChanged + UpdatePic() + Change() + End Sub + + Private Sub TbWHTCurban_TextChanged(sender As Object, e As EventArgs) + Change() + End Sub + + Private Sub TbWHTCrural_TextChanged(sender As Object, e As EventArgs) + Change() + End Sub + + Private Sub TbWHTCmw_TextChanged(sender As Object, e As EventArgs) + Change() + End Sub + + +#End Region + + + 'Open VMAP file + Private Sub BtMAPopen_Click(sender As Object, e As EventArgs) + Dim fldfile As String + + fldfile = FileRepl(tbSoCCurve.Text, GetPath(_batteryFile)) + + If fldfile <> NoFile AndAlso File.Exists(fldfile) Then + OpenFiles(FileRepl(tbRiCurve.Text, GetPath(_batteryFile)), fldfile) + Else + OpenFiles(FileRepl(tbRiCurve.Text, GetPath(_batteryFile))) + End If + End Sub + + + 'Save and close + Private Sub ButOK_Click(sender As Object, e As EventArgs) Handles ButOK.Click + If SaveOrSaveAs(False) Then Close() + End Sub + + 'Close without saving (see FormClosing Event) + Private Sub ButCancel_Click(sender As Object, e As EventArgs) Handles ButCancel.Click + Close() + End Sub + + Private Sub UpdatePic() + Dim socCurve As SOCMap = Nothing + Dim riCurve As InternalResistanceMap = Nothing + + 'Dim engineCharacteristics As String = "" + + PicBox.Image = Nothing + + 'If Not File.Exists(_engFile) Then Exit Sub + + Try + Dim socFile As String = + If(Not String.IsNullOrWhiteSpace(_batteryFile), Path.Combine(Path.GetDirectoryName(_batteryFile), tbSoCCurve.Text), tbSoCCurve.Text) + If File.Exists(socFile) Then _ + socCurve = BatterySOCReader.Create(VectoCSVFile.Read(socFile)) + Catch ex As Exception + End Try + + Try + Dim riFile As String = + If(Not String.IsNullOrWhiteSpace(_batteryFile), Path.Combine(Path.GetDirectoryName(_batteryFile), tbRiCurve.Text), tbRiCurve.Text) + If File.Exists(riFile) Then riCurve = BatteryInternalResistanceReader.Create(VectoCSVFile.Read(riFile), 1) + Catch ex As Exception + End Try + + If socCurve Is Nothing AndAlso riCurve Is Nothing Then Exit Sub + + 'Create plot + Dim chart As Chart = New Chart + chart.Width = PicBox.Width + chart.Height = PicBox.Height + + Dim chartArea As ChartArea = New ChartArea + + If Not socCurve Is Nothing Then + Dim series As Series = New Series + series.Points.DataBindXY(socCurve.Entries.Select(Function(x) x.SOC * 100).ToArray(), + socCurve.Entries.Select(Function(x) x.BatteryVolts.Value()).ToArray()) + series.ChartType = SeriesChartType.FastLine + series.BorderWidth = 2 + series.Color = Color.DarkBlue + series.Name = "Battery Voltage (" & tbSoCCurve.Text & ")" + chart.Series.Add(series) + End If + + If Not riCurve Is Nothing Then + Dim series As Series = New Series + series.Points.DataBindXY(riCurve.Entries.Select(Function(x) x.SoC * 100).ToArray(), + riCurve.Entries.Select(Function(x) x.Resistance.Value()).ToArray()) + series.ChartType = SeriesChartType.FastLine + series.MarkerSize = 3 + series.Color = Color.Red + series.Name = "Internal Resistance" + series.YAxisType = AxisType.Secondary + chart.Series.Add(series) + End If + + + chartArea.Name = "main" + + chartArea.AxisX.Title = "SoC [%]" + chartArea.AxisX.TitleFont = New Font("Helvetica", 10) + chartArea.AxisX.LabelStyle.Font = New Font("Helvetica", 8) + chartArea.AxisX.LabelAutoFitStyle = LabelAutoFitStyles.None + chartArea.AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dot + + chartArea.AxisY.Title = "Voltage [V]" + chartArea.AxisY.TitleFont = New Font("Helvetica", 10) + chartArea.AxisY.LabelStyle.Font = New Font("Helvetica", 8) + chartArea.AxisY.LabelAutoFitStyle = LabelAutoFitStyles.None + chartArea.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot + + chartArea.AxisY2.Title = "Internal Resistance [Ω]" + chartArea.AxisY2.TitleFont = New Font("Helvetica", 10) + chartArea.AxisY2.LabelStyle.Font = New Font("Helvetica", 8) + chartArea.AxisY2.LabelAutoFitStyle = LabelAutoFitStyles.None + chartArea.AxisY2.MajorGrid.LineDashStyle = ChartDashStyle.Dot + + chartArea.AxisX.Minimum = 0 + chartArea.BorderDashStyle = ChartDashStyle.Solid + chartArea.BorderWidth = 1 + + chartArea.BackColor = Color.GhostWhite + + chart.ChartAreas.Add(chartArea) + + chart.Update() + + Dim img As Bitmap = New Bitmap(chart.Width, chart.Height, PixelFormat.Format32bppArgb) + chart.DrawToBitmap(img, New Rectangle(0, 0, PicBox.Width, PicBox.Height)) + + + PicBox.Image = img + 'lblEngineCharacteristics.Text = engineCharacteristics + End Sub + + +#Region "Open File Context Menu" + + + Private Sub OpenFiles(ParamArray files() As String) + + If files.Length = 0 Then Exit Sub + + _contextMenuFiles = files + + OpenWithToolStripMenuItem.Text = "Open with " & Cfg.OpenCmdName + + CmOpenFile.Show(Windows.Forms.Cursor.Position) + End Sub + + Private Sub OpenWithToolStripMenuItem_Click(sender As Object, e As EventArgs) _ + Handles OpenWithToolStripMenuItem.Click + If Not FileOpenAlt(_contextMenuFiles(0)) Then MsgBox("Failed to open file!") + End Sub + + Private Sub ShowInFolderToolStripMenuItem_Click(sender As Object, e As EventArgs) _ + Handles ShowInFolderToolStripMenuItem.Click + If File.Exists(_contextMenuFiles(0)) Then + Try + Process.Start("explorer", "/select,""" & _contextMenuFiles(0) & "") + Catch ex As Exception + MsgBox("Failed to open file!") + End Try + Else + MsgBox("File not found!") + End If + End Sub + +#End Region + + + Private Sub btnBrowseSoCCurve_Click(sender As Object, e As EventArgs) Handles btnBrowseSoCCurve.Click + If BatterySoCCurveFileBrowser.OpenDialog(FileRepl(tbSoCCurve.Text, GetPath(_batteryFile))) Then _ + tbSoCCurve.Text = GetFilenameWithoutDirectory(BatterySoCCurveFileBrowser.Files(0), GetPath(_batteryFile)) + End Sub + + Private Sub btnBrowseRiMap_Click(sender As Object, e As EventArgs) Handles btnBrowseRiMap.Click + If BatteryInternalResistanceCurveFileBrowser.OpenDialog(FileRepl(tbRiCurve.Text, GetPath(_batteryFile))) Then _ + tbRiCurve.Text = GetFilenameWithoutDirectory(BatteryInternalResistanceCurveFileBrowser.Files(0), GetPath(_batteryFile)) + End Sub + + Private Sub btnSoCCurveOpen_Click(sender As Object, e As EventArgs) Handles btnSoCCurveOpen.Click + Dim theFile As String + + theFile = FileRepl(tbSoCCurve.Text, GetPath(_batteryFile)) + + If theFile <> NoFile AndAlso File.Exists(theFile) Then + OpenFiles(FileRepl(tbSoCCurve.Text, GetPath(_batteryFile)), theFile) + Else + OpenFiles(FileRepl(tbSoCCurve.Text, GetPath(_batteryFile))) + End If + End Sub + + Private Sub btnRiMapOpen_Click(sender As Object, e As EventArgs) Handles btnRiMapOpen.Click + Dim theFile As String + + theFile = FileRepl(tbRiCurve.Text, GetPath(_batteryFile)) + + If theFile <> NoFile AndAlso File.Exists(theFile) Then + OpenFiles(FileRepl(tbRiCurve.Text, GetPath(_batteryFile)), theFile) + Else + OpenFiles(FileRepl(tbRiCurve.Text, GetPath(_batteryFile))) + End If + End Sub +End Class diff --git a/VECTO/GUI/ElectricMotorForm.Designer.vb b/VECTO/GUI/ElectricMotorForm.Designer.vb index abc61d0f5cc899b56f45cce31968649c9df1f551..55c25f6b0e8fb33e4a84fbaeb389ae48417dfe93 100644 --- a/VECTO/GUI/ElectricMotorForm.Designer.vb +++ b/VECTO/GUI/ElectricMotorForm.Designer.vb @@ -441,7 +441,7 @@ Partial Class ElectricMotorForm Me.Name = "ElectricMotorForm" Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "F_ENG" + Me.Text = "Electric Machine" Me.ToolStrip1.ResumeLayout(False) Me.ToolStrip1.PerformLayout() Me.StatusStrip1.ResumeLayout(False) diff --git a/VECTO/GUI/ElectricMotorForm.vb b/VECTO/GUI/ElectricMotorForm.vb index 68388395dc837dba295010d128b35e9a00851e8f..28c22b116f49643fdc75b0f18342e9c585b11859 100644 --- a/VECTO/GUI/ElectricMotorForm.vb +++ b/VECTO/GUI/ElectricMotorForm.vb @@ -182,7 +182,7 @@ Public Class ElectricMotorForm tbMap.Text = GetRelativePath(engine.EfficiencyMap.Source, basePath) DeclInit() - EngineFileBrowser.UpdateHistory(file) + ElectricMotorFileBrowser.UpdateHistory(file) Text = GetFilenameWithoutPath(file, True) LbStatus.Text = "" _emFile = file @@ -195,43 +195,43 @@ Public Class ElectricMotorForm 'Save or Save As function = true if file is saved Private Function SaveOrSaveAs(ByVal saveAs As Boolean) As Boolean If _emFile = "" Or saveAs Then - If EngineFileBrowser.SaveDialog(_emFile) Then - _emFile = EngineFileBrowser.Files(0) + If ElectricMotorFileBrowser.SaveDialog(_emFile) Then + _emFile = ElectricMotorFileBrowser.Files(0) Else Return False End If End If - Return SaveEngineToFile(_emFile) + Return SaveElectricMotorToFile(_emFile) End Function 'Save VENG file to given filepath. Called by SaveOrSaveAs. - Private Function SaveEngineToFile(ByVal file As String) As Boolean + Private Function SaveElectricMotorToFile(ByVal file As String) As Boolean - Dim engine As ElectricMachine = New ElectricMachine - engine.FilePath = file + Dim em As ElectricMachine = New ElectricMachine + em.FilePath = file - engine.ModelName = tbMakeModel.Text - If Trim(engine.ModelName) = "" Then engine.ModelName = "Undefined" - engine.MotorInertia = tbInertia.Text.ToDouble(0) + em.ModelName = tbMakeModel.Text + If Trim(em.ModelName) = "" Then em.ModelName = "Undefined" + em.MotorInertia = tbInertia.Text.ToDouble(0) - engine.PathMaxTorque = tbMaxTorque.Text - engine.PathDrag = tbDragTorque.Text - engine.PathMap = tbMap.Text + em.PathMaxTorque = tbMaxTorque.Text + em.PathDrag = tbDragTorque.Text + em.PathMap = tbMap.Text - If Not engine.SaveFile Then + If Not em.SaveFile Then MsgBox("Cannot save to " & file, MsgBoxStyle.Critical) Return False End If - If AutoSendTo Then - If VectoJobForm.Visible Then - If UCase(FileRepl(VectoJobForm.TbENG.Text, JobDir)) <> UCase(file) Then _ - VectoJobForm.TbENG.Text = GetFilenameWithoutDirectory(file, JobDir) - VectoJobForm.UpdatePic() - End If - End If + 'If AutoSendTo Then + ' If VectoJobForm.Visible Then + ' If UCase(FileRepl(VectoJobForm.TbENG.Text, JobDir)) <> UCase(file) Then _ + ' VectoJobForm.TbENG.Text = GetFilenameWithoutDirectory(file, JobDir) + ' VectoJobForm.UpdatePic() + ' End If + 'End If - EngineFileBrowser.UpdateHistory(file) + ElectricMotorFileBrowser.UpdateHistory(file) Text = GetFilenameWithoutPath(file, True) LbStatus.Text = "" @@ -312,12 +312,6 @@ Public Class ElectricMotorForm #End Region - 'Browse for VMAP file - Private Sub BtMAP_Click(sender As Object, e As EventArgs) - If FuelConsumptionMapFileBrowser.OpenDialog(FileRepl(tbMap.Text, GetPath(_emFile))) Then _ - tbMap.Text = GetFilenameWithoutDirectory(FuelConsumptionMapFileBrowser.Files(0), GetPath(_emFile)) - End Sub - 'Open VMAP file Private Sub BtMAPopen_Click(sender As Object, e As EventArgs) @@ -446,7 +440,7 @@ Public Class ElectricMotorForm chartArea.AxisY.LabelAutoFitStyle = LabelAutoFitStyles.None chartArea.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dot - chartArea.AxisX.Minimum = 300 + chartArea.AxisX.Minimum = 0 chartArea.BorderDashStyle = ChartDashStyle.Solid chartArea.BorderWidth = 1 diff --git a/VECTO/GUI/MainForm.vb b/VECTO/GUI/MainForm.vb index 8caf6f106a594338188717045bee129529ca99b4..7253a319501210e95b96940ca42ef8d1578702bd 100644 --- a/VECTO/GUI/MainForm.vb +++ b/VECTO/GUI/MainForm.vb @@ -150,6 +150,9 @@ Imports TUGraz.VectoCore.Utils ElectricMachineMaxTorqueFileBrowser = New FileBrowser("vemp") ElectricMachineEfficiencyMapFileBrowser = New FileBrowser("vemo") + BatteryInternalResistanceCurveFileBrowser = New FileBrowser("vbatv") + BatterySoCCurveFileBrowser = New FileBrowser("vbatr") + ModalResultsFileBrowser = New FileBrowser("vmod") @@ -182,6 +185,9 @@ Imports TUGraz.VectoCore.Utils ElectricMachineMaxTorqueFileBrowser.Extensions = New String() {"vemp"} ElectricMachineEfficiencyMapFileBrowser.Extensions = New String() {"vemo"} + BatteryInternalResistanceCurveFileBrowser.Extensions = New String() {"vbatv"} + BatterySoCCurveFileBrowser.Extensions = New String() {"vbatr"} + ModalResultsFileBrowser.Extensions = New String() {"vmod"} End Sub diff --git a/VECTO/GUI/VehicleForm.vb b/VECTO/GUI/VehicleForm.vb index f39add66e69f160dc103cff95e15bf6dbf109025..3bb0e6c847a41eff00d18427a6c564fbf528b642 100644 --- a/VECTO/GUI/VehicleForm.vb +++ b/VECTO/GUI/VehicleForm.vb @@ -1053,5 +1053,36 @@ Public Class VehicleForm End Try End If End Sub + + Private Sub btnOpenBattery_Click(sender As Object, e As EventArgs) Handles btnOpenBattery.Click + Dim f As String + f = FileRepl(tbBattery.Text, GetPath(_vehFile)) + + 'Thus Veh-file is returned + BatteryForm.JobDir = GetPath(_vehFile) + BatteryForm.AutoSendTo = True + + If Not Trim(f) = "" Then + If Not File.Exists(f) Then + MsgBox("File not found!") + Exit Sub + End If + End If + + If Not BatteryForm.Visible Then + BatteryForm.Show() + Else + If BatteryForm.WindowState = FormWindowState.Minimized Then BatteryForm.WindowState = FormWindowState.Normal + BatteryForm.BringToFront() + End If + + If Not Trim(f) = "" Then + Try + BatteryForm.OpenBatteryFile(f) + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Error loading Vehicle File") + End Try + End If + End Sub End Class diff --git a/VECTO/Input Files/Battery.vb b/VECTO/Input Files/Battery.vb new file mode 100644 index 0000000000000000000000000000000000000000..4a09e95b1d831b05c3315986dba984d58f1cf855 --- /dev/null +++ b/VECTO/Input Files/Battery.vb @@ -0,0 +1,243 @@ + +Imports System.Collections.Generic +Imports System.ComponentModel.DataAnnotations +Imports System.IO +Imports System.Linq +Imports TUGraz.VECTO.Input_Files +Imports TUGraz.VectoCommon.Exceptions +Imports TUGraz.VectoCommon.InputData +Imports TUGraz.VectoCommon.Models +Imports TUGraz.VectoCommon.Utils +Imports TUGraz.VectoCore.Models.SimulationComponent.Data +Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Battery +Imports TUGraz.VectoCore.Utils + +<CustomValidation(GetType(Battery), "ValidateBattery")> +Public Class Battery + Implements IBatteryPackEngineeringInputData + + Private _filePath As String + Private _myPath As String + Public ModelName As String + Public BatCapacity As Double + Private _socCurvePath As SubPath + Private _riCurvePath As SubPath + Public BatMinSoc As Double + Public BatMaxSoc As Double + Public BatCFactor As Double + + Public Sub New() + _myPath = "" + _filePath = "" + + _socCurvePath = New SubPath + _riCurvePath = New SubPath() + + + SetDefault() + End Sub + + Private Sub SetDefault() + ModelName = "Undefined" + BatCapacity = 0 + BatMinSoc = 0 + BatMaxSoc = 0 + BatCFactor = 0 + + _riCurvePath.Clear() + _socCurvePath.Clear() + End Sub + + Public Function SaveFile() As Boolean + + Dim validationResults As IList(Of ValidationResult) = + Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), Nothing, False) + + If validationResults.Count > 0 Then + Dim messages As IEnumerable(Of String) = + validationResults.Select(Function(r) r.ErrorMessage + String.Join(", ", r.MemberNames.Distinct())) + MsgBox("Invalid input." + Environment.NewLine + String.Join(Environment.NewLine, messages), MsgBoxStyle.OkOnly, + "Failed to save engine") + Return False + End If + + Try + Dim writer As JSONFileWriter = New JSONFileWriter() + writer.SaveBattery(Me, _filePath, Cfg.DeclMode) + + Catch ex As Exception + MsgBox("Faled to write Engine file: " + ex.Message) + Return False + End Try + Return True + End Function + + Public Shared Function ValidateBattery(battery As Battery, validationContext As ValidationContext) As ValidationResult + Dim batterData As BatteryData + + Dim modeService As VectoValidationModeServiceContainer = + TryCast(validationContext.GetService(GetType(VectoValidationModeServiceContainer)), + VectoValidationModeServiceContainer) + Try + 'If mode = ExecutionMode.Declaration Then + ' Dim doa As DeclarationDataAdapterHeavyLorry = New DeclarationDataAdapterHeavyLorry() + + ' 'engineData = doa.create(DummyVehicle, engine.EngineModes.First(), New Mission() With {.MissionType = MissionType.LongHaul}) + 'Else + ' Dim doa As EngineeringDataAdapter = New EngineeringDataAdapter() + ' Dim dummyVehicle As IVehicleEngineeringInputData = New DummyVehicle() With { + ' .IVehicleComponentsEngineering_EngineInputData = engine + ' } + ' engineData = doa.CreateElectricMachines(engine) + 'End If + + 'Dim result As IList(Of ValidationResult) = + ' engineData.Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), gbxType, emsCycle) + + 'If Not result.Any() Then Return ValidationResult.Success + + 'Return New ValidationResult("Engine Configuration is invalid. ", + ' result.Select(Function(r) r.ErrorMessage + String.Join(Environment.NewLine, r.MemberNames)).ToList()) + Return ValidationResult.Success + Catch ex As Exception + Return New ValidationResult(ex.Message) + End Try + End Function + + Public Property FilePath() As String + Get + Return _filePath + End Get + Set(ByVal value As String) + _filePath = value + If _filePath = "" Then + _myPath = "" + Else + _myPath = Path.GetDirectoryName(_filePath) & "\" + End If + End Set + End Property + + Public Property PathSoCCurve(Optional ByVal original As Boolean = False) As String + Get + If original Then + Return _socCurvePath.OriginalPath + Else + Return _socCurvePath.FullPath + End If + End Get + Set(ByVal value As String) + _socCurvePath.Init(_myPath, value) + End Set + End Property + + Public Property PathRiCurve(Optional ByVal original As Boolean = False) As String + Get + If original Then + Return _riCurvePath.OriginalPath + Else + Return _riCurvePath.FullPath + End If + End Get + Set(ByVal value As String) + _riCurvePath.Init(_myPath, value) + End Set + End Property + + Public ReadOnly Property DataSource As DataSource Implements IComponentInputData.DataSource + Get + Dim retVal As DataSource = New DataSource() + retVal.SourceType = DataSourceType.JSONFile + retVal.SourceFile = FilePath + Return retVal + End Get + End Property + + Public ReadOnly Property SavedInDeclarationMode As Boolean Implements IComponentInputData.SavedInDeclarationMode + Get + Return Cfg.DeclMode + End Get + End Property + + Public ReadOnly Property Manufacturer As String Implements IComponentInputData.Manufacturer + Get + + End Get + End Property + + Public ReadOnly Property Model As String Implements IComponentInputData.Model + Get + Return ModelName + End Get + End Property + + Public ReadOnly Property [Date] As Date Implements IComponentInputData.[Date] + Get + Return Now.ToUniversalTime() + End Get + End Property + + Public ReadOnly Property AppVersion As String Implements IComponentInputData.AppVersion + Get + Return "VECTO-GUI" + End Get + End Property + + Public ReadOnly Property CertificationMethod As CertificationMethod Implements IComponentInputData.CertificationMethod + Get + Return CertificationMethod.NotCertified + End Get + End Property + Public ReadOnly Property CertificationNumber As String Implements IComponentInputData.CertificationNumber + Get + Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE + End Get + End Property + Public ReadOnly Property DigestValue As DigestData Implements IComponentInputData.DigestValue + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property MinSOC As Double Implements IBatteryPackDeclarationInputData.MinSOC + Get + Return BatMinSoc / 100.0 + End Get + End Property + + Public ReadOnly Property MaxSOC As Double Implements IBatteryPackDeclarationInputData.MaxSOC + Get + Return BatMaxSoc / 100.0 + End Get + End Property + + Public ReadOnly Property Capacity As AmpereSecond Implements IBatteryPackDeclarationInputData.Capacity + Get + Return BatCapacity.SI(Of AmpereSecond) + End Get + End Property + + Public ReadOnly Property InternalResistanceCurve As TableData Implements IBatteryPackDeclarationInputData.InternalResistanceCurve + Get + If Not File.Exists(_riCurvePath.FullPath) Then _ + Throw New VectoException("Ri Curve is missing or invalid") + Return VectoCSVFile.Read(_riCurvePath.FullPath) + End Get + End Property + + Public ReadOnly Property VoltageCurve As TableData Implements IBatteryPackDeclarationInputData.VoltageCurve + Get + If Not File.Exists(_socCurvePath.FullPath) Then _ + Throw New VectoException("SoC Curve is missing or invalid") + Return VectoCSVFile.Read(_socCurvePath.FullPath) + End Get + End Property + + Public ReadOnly Property MaxCurrentFactor As Double Implements IBatteryPackDeclarationInputData.MaxCurrentFactor + Get + Return BatCFactor + End Get + End Property + + +End Class \ No newline at end of file diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 3c0cb671ff0e1bc169e5f8bfac95e388664e32d8..2141c4cb881dfff3f8a3d0b0e20d0f964798a847 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -223,6 +223,12 @@ <Compile Include="BusAuxiliaries\Util\DeleteCell.vb" /> <Compile Include="BusAuxiliaries\Util\DeleteColumn.vb" /> <Compile Include="BusAuxiliaries\Util\SIConvert.vb" /> + <Compile Include="GUI\BatteryForm.Designer.vb"> + <DependentUpon>BatteryForm.vb</DependentUpon> + </Compile> + <Compile Include="GUI\BatteryForm.vb"> + <SubType>Form</SubType> + </Compile> <Compile Include="GUI\ElectricMotorForm.Designer.vb"> <DependentUpon>ElectricMotorForm.vb</DependentUpon> </Compile> @@ -235,6 +241,7 @@ <Compile Include="GUI\VectoVTPJobForm.vb"> <SubType>Form</SubType> </Compile> + <Compile Include="Input Files\Battery.vb" /> <Compile Include="Input Files\BrowserUtils.vb" /> <Compile Include="GUI\VehicleTorqueLimitsDialog.Designer.vb"> <DependentUpon>VehicleTorqueLimitsDialog.vb</DependentUpon> @@ -402,6 +409,9 @@ <EmbeddedResource Include="File Browser\FileBrowserFavoritesDialog.resx"> <DependentUpon>FileBrowserFavoritesDialog.vb</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="GUI\BatteryForm.resx"> + <DependentUpon>BatteryForm.vb</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="GUI\ElectricMotorForm.resx"> <DependentUpon>ElectricMotorForm.vb</DependentUpon> </EmbeddedResource> diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index c175cab3cf6ca702f2bc818e8780e2babbd0765a..bb585430f9c538f1aa57f513333f360f48495cc6 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -731,9 +731,9 @@ namespace TUGraz.VectoCommon.InputData AmpereSecond Capacity { get; } - Ohm InternalResistance { get; } + TableData InternalResistanceCurve { get; } - TableData Voltage { get; } + TableData VoltageCurve { get; } double MaxCurrentFactor { get; } } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONBattery.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONBattery.cs index 2b23edb20d6254dc584a8825953ef41d83e6165f..caae949b18dc48c74ad271accd8b37f86f8f27d1 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONBattery.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONBattery.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Newtonsoft.Json.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -6,27 +7,38 @@ using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.Reader.ComponentData; -namespace TUGraz.VectoCore.InputData.FileIO.JSON { +namespace TUGraz.VectoCore.InputData.FileIO.JSON +{ public class JSONBatteryV1 : JSONFile, IBatteryPackEngineeringInputData { - public JSONBatteryV1(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { } + public JSONBatteryV1(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, + tolerateMissing) { } + public string Manufacturer { get { return Constants.NOT_AVailABLE; } } + public string Model { get { return Body.GetEx<string>("Model"); } } - public DateTime Date { get { return DateTime.MinValue; } } + + public DateTime Date + { + get { return DateTime.MinValue; } + } + public CertificationMethod CertificationMethod { get { return CertificationMethod.NotCertified; } } + public string CertificationNumber { get { return Constants.NOT_AVailABLE; } } + public DigestData DigestValue { get { return null; } @@ -41,30 +53,47 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON { { get { return Body.GetEx<double>("SOC_max") / 100.0; } } + public AmpereSecond Capacity { get { return Body.GetEx<double>("Capacity").SI(Unit.SI.Ampere.Hour).Cast<AmpereSecond>(); } } - public Ohm InternalResistance + public TableData InternalResistanceCurve { - get { return Body.GetEx<double>("InternalResistance").SI<Ohm>(); } + get + { + try { + return ReadTableData(Body.GetEx<string>("InternalResistanceCurve"), "InternalResistanceCurve"); + } catch (Exception) { + if (!TolerateMissing) { + throw; + } + + return + new TableData( + Path.Combine(BasePath, Body["InternalResistanceCurve"].ToString()) + MissingFileSuffix, + DataSourceType.Missing); + } + } } - public TableData Voltage + public TableData VoltageCurve { get { - var retVal = new TableData(_sourceFile); - retVal.Columns.Add(BatterySOCReader.Fields.StateOfCharge); - retVal.Columns.Add(BatterySOCReader.Fields.BatteryVoltage); - foreach (var entries in Body["SOC"]) { - var row = retVal.NewRow(); - row[BatterySOCReader.Fields.StateOfCharge] = entries[0]; - row[BatterySOCReader.Fields.BatteryVoltage] = entries[1]; - retVal.Rows.Add(row); + try { + return ReadTableData(Body.GetEx<string>("SoCCurve"), "SoC Curve"); + } catch (Exception) { + if (!TolerateMissing) { + throw; + } + + return + new TableData( + Path.Combine(BasePath, Body["SoCCurve"].ToString()) + MissingFileSuffix, + DataSourceType.Missing); } - return retVal; } } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs index 5d3868d37995efc3a475e03c4a17207f3a9eb779..be8e87c8f403b17eb1ecc98f8519068ca7602bef 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs @@ -245,7 +245,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return _axleWheelsDecl; } } - public IElectricStorageEngineeringInputData ElectricStorage { get { return VehicleData?.Components?.ElectricStorage; } } + public IElectricStorageEngineeringInputData ElectricStorage + { + get + { + return new JSONElectricStorageEngineeringInputData { + BatteryPack = Battery, + Count = 1 + }; + } + } + public IElectricMachinesEngineeringInputData ElectricMachines { get { return new JSONElectricMotors(new List<ElectricMachineEntry<IElectricMotorEngineeringInputData>>() { diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs new file mode 100644 index 0000000000000000000000000000000000000000..d6ac03ab898001eeccf45445e5e5b50e3350ec03 --- /dev/null +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs @@ -0,0 +1,43 @@ +using System.Data; +using System.Linq; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Battery; +using TUGraz.VectoCore.Utils; + +namespace TUGraz.VectoCore.InputData.Reader.ComponentData +{ + public static class BatteryInternalResistanceReader + { + public static InternalResistanceMap Create(DataTable data, int packCount) + { + if (data.Columns.Count != 2) { + throw new VectoException("Internal Resistance Map data must contain exactly two columns: {0}, {1}",Fields.StateOfCharge, Fields.InternalResistance); + } + + if (data.Rows.Count < 2) { + throw new VectoException("Internal Resistance Map data must contain at least 2 entries!"); + } + + if (!data.Columns.Contains(Fields.StateOfCharge) || !data.Columns.Contains(Fields.InternalResistance)) { + data.Columns[0].ColumnName = Fields.StateOfCharge; + data.Columns[1].ColumnName = Fields.InternalResistance; + LoggingObject.Logger<InternalResistanceMap>().Warn("Internal Resistance Map Header is invalid. Expected: '{0}, {1}', Got: '{2}'. Falling back to column index.", + Fields.StateOfCharge, Fields.InternalResistance, string.Join(", ", data.Columns.Cast<DataColumn>().Select(c => c.ColumnName))); + } + return new InternalResistanceMap(data.Rows.Cast<DataRow>().Select(row => new InternalResistanceMap.InternalResistanceMapEntry() { + SoC = row.ParseDouble(Fields.StateOfCharge) / 100, + Resistance = row.ParseDouble(Fields.InternalResistance).SI<Ohm>() / packCount + }).OrderBy(e => e.SoC).ToArray()); + + } + + public static class Fields + { + public const string StateOfCharge = "SoC"; + + public const string InternalResistance = "Ri"; + } + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index bf6b3c3c09e2c47861b61169e9d442fd6cce862f..04a92474103088fdd392626aaec0b09c8eaa302b 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -629,8 +629,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter MaxSOC = batteryInputData.BatteryPack.MaxSOC, MaxCurrent = (batteryInputData.BatteryPack.Capacity.AsAmpHour * batteryInputData.BatteryPack.MaxCurrentFactor * batteryInputData.Count).SI<Ampere>(), Capacity = batteryInputData.Count * batteryInputData.BatteryPack.Capacity, - InternalResistance = batteryInputData.BatteryPack.InternalResistance / batteryInputData.Count, - SOCMap = BatterySOCReader.Create(batteryInputData.BatteryPack.Voltage), + InternalResistance = BatteryInternalResistanceReader.Create(batteryInputData.BatteryPack.InternalResistanceCurve, batteryInputData.Count), + SOCMap = BatterySOCReader.Create(batteryInputData.BatteryPack.VoltageCurve), InitialSoC = initialSOC }; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Battery/BatteryData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Battery/BatteryData.cs index 25d59a7b75c28bba07f3e8cd5ada5b7c0c1193da..638096c5ee0a74948bd7ff73a690b4e35bace155 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Battery/BatteryData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Battery/BatteryData.cs @@ -17,7 +17,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Battery { public double MaxSOC { get; internal set; } [SIRange(0, 1e9)] - public Ohm InternalResistance { get; internal set; } + public InternalResistanceMap InternalResistance { get; internal set; } public AmpereSecond Capacity { get; internal set; } @@ -30,7 +30,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Battery { public class SOCMap { - protected SOCMapEntry[] Entries; + protected internal SOCMapEntry[] Entries; public SOCMap(SOCMapEntry[] entries) { @@ -65,10 +65,56 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Battery { throw new VectoException("soc {0} exceeds battery model data. min: {1} max: {2}", soc, Entries.First().SOC, Entries.Last().SOC); } + public class SOCMapEntry { [Required, Range(0, 1)] public double SOC; [Required, SIRange(0, double.MaxValue)] public Volt BatteryVolts; } } + + public class InternalResistanceMap + { + protected internal InternalResistanceMapEntry[] Entries; + + public InternalResistanceMap(InternalResistanceMapEntry[] entries) + { + Entries = entries; + } + + public Ohm Lookup(double SoC) + { + var idx = FindIndex(SoC); + return VectoMath.Interpolate(Entries[idx - 1].SoC, Entries[idx].SoC, Entries[idx - 1].Resistance, + Entries[idx].Resistance, SoC); + } + + protected int FindIndex(double soc) + { + if (soc < Entries.First().SoC) + { + return 1; + } + if (soc > Entries.Last().SoC) + { + return Entries.Length - 1; + + } + for (var index = 1; index < Entries.Length; index++) + { + if (soc >= Entries[index - 1].SoC && soc <= Entries[index].SoC) + { + return index; + } + } + throw new VectoException("soc {0} exceeds battery model data. min: {1} max: {2}", soc, Entries.First().SoC, Entries.Last().SoC); + } + + public class InternalResistanceMapEntry + { + [Required, Range(0, 1)] public double SoC; + [Required, SIRange(0, 1e6)] public Ohm Resistance; + } + + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Battery.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Battery.cs index c9da2507057c436bcd14fb18f6f942e60f09fe14..e2070b2aef98f364a734b0ec45a1583c7b6e832e 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Battery.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Battery.cs @@ -53,14 +53,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return PowerDemandExceeded(absTime, dt, powerDemand, maxDischargePower, maxChargePower, dryRun); } + var internalResistance = ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge); var current = 0.SI<Ampere>(); if (!powerDemand.IsEqual(0)) { - var solutions = VectoMath.QuadraticEquationSolver(ModelData.InternalResistance.Value(), InternalCellVoltage.Value(), + var solutions = VectoMath.QuadraticEquationSolver(internalResistance.Value(), InternalCellVoltage.Value(), -powerDemand.Value()); current = SelectSolution(solutions, powerDemand.Value()); } - var batteryLoss = current * ModelData.InternalResistance * current; + var batteryLoss = current * internalResistance * current; var currentCharge = ModelData.Capacity * PreviousState.StateOfCharge; if (dryRun) @@ -114,7 +115,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl -ModelData.MaxCurrent); var current = powerDemand < 0 ? maxDischargeCurrent : maxChargeCurrent; - var batteryLoss = current * ModelData.InternalResistance * current; + var batteryLoss = current * ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge) * current; AbstractBatteryResponse response; if (dryRun) @@ -154,7 +155,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl container[ModalResultField.U_bat_terminal] = cellVoltage + CurrentState.TotalCurrent * - ModelData.InternalResistance; // adding both terms because pos. current charges the battery! + ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge); // adding both terms because pos. current charges the battery! container[ModalResultField.I_bat] = CurrentState.TotalCurrent; container[ModalResultField.BatteryStateOfCharge] = CurrentState.StateOfCharge.SI(); container[ModalResultField.P_battery_terminal] = CurrentState.PowerDemand; @@ -193,7 +194,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var maxChargeCurrent = VectoMath.Min((ModelData.MaxSOC - PreviousState.StateOfCharge) * ModelData.Capacity / dt, ModelData.MaxCurrent); return InternalCellVoltage * maxChargeCurrent + - maxChargeCurrent * ModelData.InternalResistance * maxChargeCurrent; + maxChargeCurrent * ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge) * maxChargeCurrent; } public Watt MaxDischargePower(Second dt) @@ -203,8 +204,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl 0.SI<Ampere>()), -ModelData.MaxCurrent); var cellVoltage = InternalCellVoltage; var maxDischargePower = InternalCellVoltage * maxDischargeCurrent + - maxDischargeCurrent * ModelData.InternalResistance * maxDischargeCurrent; - var maxPower = -cellVoltage / (4 * ModelData.InternalResistance) * cellVoltage; + maxDischargeCurrent * ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge) * maxDischargeCurrent; + var maxPower = -cellVoltage / (4 * ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge)) * cellVoltage; return VectoMath.Max(maxDischargePower, maxPower); } @@ -213,7 +214,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { var cellVoltage = ModelData.SOCMap.Lookup(PreviousState.StateOfCharge); - return VectoMath.Max(-ModelData.MaxCurrent, -cellVoltage / (4 * ModelData.InternalResistance)); + return VectoMath.Max(-ModelData.MaxCurrent, -cellVoltage / (4 * ModelData.InternalResistance.Lookup(PreviousState.StateOfCharge))); } } diff --git a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs index b53d102b48da0ea6e570b87a9ecce928ee3fd8a9..a41cd46f718748c26faad0194d720d176a3de839 100644 --- a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs +++ b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs @@ -72,6 +72,26 @@ public class JSONFileWriter : IOutputFileWriter WriteFile(header, body, filename); } + public void SaveBattery(IBatteryPackEngineeringInputData battery, string filename, bool declMode) + { + var header = GetHeader(ElectricMotorFormatVersion); + + var body = new Dictionary<string, object>(); + + body.Add("SavedInDeclMode", declMode); + + body.Add("Model", battery.Model); + body.Add("Capacity", battery.Capacity.Value()); + body.Add("SOC_min", battery.MinSOC * 100.0); + body.Add("SOC_max",battery.MaxSOC * 100.0); + body.Add("MaxCurrentFactor", battery.MaxCurrentFactor); + + body.Add("InternalResistanceCurve", GetRelativePath(battery.InternalResistanceCurve.Source, Path.GetDirectoryName(filename))); + body.Add("SoCCurve", GetRelativePath(battery.VoltageCurve.Source, Path.GetDirectoryName(filename))); + + WriteFile(header, body, filename); + } + public void SaveEngine(IEngineEngineeringInputData eng, string filename, bool DeclMode) { // Header diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 9c078aa3d9294b3090f8ad662ee084d1ffec295e..ca8ad1fb51784fbd8dcfb5cd796c1ad4550c4140 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -280,6 +280,7 @@ <Compile Include="InputData\FileIO\XML\Declaration\IXMLDeclarationInputDataReader.cs" /> <Compile Include="InputData\FileIO\XML\IXMLInputDataReader.cs" /> <Compile Include="InputData\FileIO\XML\XMLInputDataNinjectModule.cs" /> + <Compile Include="InputData\Reader\ComponentData\BatteryInternalResistanceReader.cs" /> <Compile Include="InputData\Reader\ComponentData\ElectricMotorMapReader.cs" /> <Compile Include="InputData\Reader\DataObjectAdapter\DeclarationDataAdapterPrimaryBus.cs" /> <Compile Include="InputData\Reader\ComponentData\ElectricFullLoadCurveReader.cs" /> diff --git a/VectoCore/VectoCoreTest/FileIO/JsonReadHybridTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonReadHybridTest.cs index 3700cb2e761da6a127ee836e614857caf6e33de2..330796592c2562b0028283d5d567c9fd7ad647ec 100644 --- a/VectoCore/VectoCoreTest/FileIO/JsonReadHybridTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/JsonReadHybridTest.cs @@ -31,7 +31,7 @@ namespace TUGraz.VectoCore.Tests.FileIO Assert.AreEqual(7.5.SI(Unit.SI.Ampere.Hour), inputProvider.Capacity); - var soc = inputProvider.Voltage; + var soc = inputProvider.VoltageCurve; Assert.AreEqual("0", soc.Rows[0][BatterySOCReader.Fields.StateOfCharge]); Assert.AreEqual("590", soc.Rows[0][BatterySOCReader.Fields.BatteryVoltage]); @@ -121,10 +121,11 @@ namespace TUGraz.VectoCore.Tests.FileIO var bat = engineering.JobInputData.Vehicle.Components.ElectricStorage; + var ri = BatteryInternalResistanceReader.Create(bat.BatteryPack.InternalResistanceCurve, 1); Assert.NotNull(bat); Assert.AreEqual(2, bat.Count); Assert.AreEqual(50, bat.BatteryPack.MaxCurrentFactor); - Assert.AreEqual(0.4986666, bat.BatteryPack.InternalResistance.Value()); + Assert.AreEqual(0.4986666, ri.Lookup(0.5).Value()); var em = engineering.JobInputData.Vehicle.Components.ElectricMachines; diff --git a/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatr b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatr new file mode 100644 index 0000000000000000000000000000000000000000..953f417ac43d9bc1432971034d22d3ab15d5e1a2 --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatr @@ -0,0 +1,3 @@ +SoC, Ri +0, 0.04 +100, 0.04 \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatv b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatv new file mode 100644 index 0000000000000000000000000000000000000000..28376e3632a1a24d0631665c19822b66f0310257 --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh.vbatv @@ -0,0 +1,12 @@ +SOC, V +0, 673.5 +10, 700.2 +20, 715.4 +30, 723.6 +40, 727.7 +50, 730.0 +60, 731.6 +70, 733.8 +80, 737.1 +90, 742.2 +100, 750.2 \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh_750V.vbat b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh_750V.vbat index fd92ed38b9995cd744e3576622e07a7f545b2c3f..07af1cf7ff95d938b552f59be7d26983390f5d63 100644 --- a/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh_750V.vbat +++ b/VectoCore/VectoCoreTest/TestData/BatteryElectric/GenericVehicleB4/GenericBattery_243kWh_750V.vbat @@ -8,23 +8,11 @@ "Body": { "SavedInDeclMode": false, "Model": "Generic Battery", - "InternalResistance": 0.04, + "InternalResistanceCurve": "GenericBattery_243kWh.vbatr", "SOC_min": 10, "SOC_max": 90, "MaxCurrentFactor": 5, "Capacity": 324, - "SOC": [ - [ 0, 673.5 ], - [ 10, 700.2 ], - [ 20, 715.4 ], - [ 30, 723.6 ], - [ 40, 727.7 ], - [ 50, 730.0 ], - [ 60, 731.6 ], - [ 70, 733.8 ], - [ 80, 737.1 ], - [ 90, 742.2 ], - [ 100, 750.2 ] - ] + "SoCCurve": "GenericBattery_243kWh.vbatv" } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index c4ea207de8f8be109410160b7cb5aa8aa5d314c8..de48dbce137edb8df8f432244ea5855266cbd41a 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -245,6 +245,12 @@ <None Include="TestData\BatteryElectric\GenericVehicleB4\BEV_ENG.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\BatteryElectric\GenericVehicleB4\GenericBattery_243kWh.vbatr"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\BatteryElectric\GenericVehicleB4\GenericBattery_243kWh.vbatv"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\BatteryElectric\GenericVehicleB4\GenericBattery_243kWh_750V.vbat"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None>