From ed46ed6040e1548ae7f242e59e59cb7bc4d8a84b Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Tue, 2 Mar 2021 17:42:21 +0100 Subject: [PATCH] refactoring engineering input data: remove mapping auxiliaries (power deman from cycle & mapping) --- .../Group5_Tractor_4x2/325kW_WHR.vmap | 2 +- VECTO/GUI/VectoJobForm.Designer.vb | 213 +++++--- VECTO/GUI/VectoJobForm.vb | 158 ++---- .../GUI/VehicleAuxiliariesDialog.Designer.vb | 462 ++++++++---------- VECTO/GUI/VehicleAuxiliariesDialog.vb | 27 +- VECTO/Input Files/VectoJob.vb | 76 ++- .../AuxiliariesDeclarationAdapter.cs | 10 +- .../InputData/DeclarationInputData.cs | 1 + .../InputData/EngineeringInputData.cs | 46 +- .../VectoCommon/Models/AuxiliaryDemandType.cs | 1 - .../VectoCore/Configuration/Constants.cs | 4 + .../InputData/AuxiliaryFileHelper.cs | 74 --- .../FileIO/JSON/JSONComponentInputData.cs | 3 +- .../InputData/FileIO/JSON/JSONInputData.cs | 56 +-- .../XMLAuxiliaryDeclarationDataProvider.cs | 1 + .../XMLEngineeringAuxiliariesDataProvider.cs | 114 +---- .../VectoCore/InputData/Impl/InputData.cs | 28 +- .../ComponentData/AuxiliaryDataReader.cs | 104 ---- .../EngineeringDataAdapter.cs | 52 +- .../EngineeringModeVectoRunDataFactory.cs | 4 +- .../Models/Simulation/Data/VectoRunData.cs | 1 - .../Simulation/Impl/PowertrainBuilder.cs | 6 - .../SimulationComponent/Data/AuxiliaryData.cs | 111 ----- .../Impl/BusAuxiliariesAdapter.cs | 8 +- .../Impl/EngineAuxiliary.cs | 28 +- .../OutputData/FileIO/JSONFileWriter.cs | 118 +++-- .../OutputData/XML/AttributeMappings.cs | 6 - .../Writer/XMLEngineeringComponentsWriter.cs | 4 +- VectoCore/VectoCore/Utils/VectoVersionCore.cs | 2 +- VectoCore/VectoCore/VectoCore.csproj | 3 - .../VectoCoreTest/FileIO/JsonReadTest.cs | 5 +- .../Models/Simulation/AuxTests.cs | 58 +-- VectoCore/VectoCoreTest/VectoCoreTest.csproj | 123 +++++ .../XML/XMLEngineeringInputRefTest.cs | 18 +- .../XML/XMLEngineeringInputSingleTest.cs | 18 +- 35 files changed, 703 insertions(+), 1242 deletions(-) delete mode 100644 VectoCore/VectoCore/InputData/AuxiliaryFileHelper.cs delete mode 100644 VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs delete mode 100644 VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs diff --git a/Generic Vehicles/Engineering Mode/Group5_Tractor_4x2/325kW_WHR.vmap b/Generic Vehicles/Engineering Mode/Group5_Tractor_4x2/325kW_WHR.vmap index f7601d0116..50ca6107d7 100644 --- a/Generic Vehicles/Engineering Mode/Group5_Tractor_4x2/325kW_WHR.vmap +++ b/Generic Vehicles/Engineering Mode/Group5_Tractor_4x2/325kW_WHR.vmap @@ -1,4 +1,4 @@ -engine speed [rpm], torque [Nm], fuel consumption [g/h], whr power electrical [W] +engine speed [rpm], torque [Nm], fuel consumption [g/h], whr power electric [W] 500,-135.5,0, 200 500,0,1355, 200 500,213.4,3412.291, 200 diff --git a/VECTO/GUI/VectoJobForm.Designer.vb b/VECTO/GUI/VectoJobForm.Designer.vb index 68f74b8f8c..23543960c0 100644 --- a/VECTO/GUI/VectoJobForm.Designer.vb +++ b/VECTO/GUI/VectoJobForm.Designer.vb @@ -55,16 +55,21 @@ Partial Class VectoJobForm Me.BtDRIrem = New System.Windows.Forms.Button() Me.BtDRIadd = New System.Windows.Forms.Button() Me.GrAuxMech = New System.Windows.Forms.GroupBox() - Me.Label9 = New System.Windows.Forms.Label() - Me.TbAuxPAdd = New System.Windows.Forms.TextBox() - Me.Label8 = New System.Windows.Forms.Label() + Me.pnAuxEngineering = New System.Windows.Forms.Panel() + Me.tbPAuxStandstillICEOff = New System.Windows.Forms.TextBox() + Me.lblAuxStandstillICEOffUnit = New System.Windows.Forms.Label() + Me.lblAuxStandstillICEOff = New System.Windows.Forms.Label() + Me.tbPAuxDrivingICEOff = New System.Windows.Forms.TextBox() + Me.lblAuxDrivingICEOffUnit = New System.Windows.Forms.Label() + Me.lblAuxDrivingICEOff = New System.Windows.Forms.Label() + Me.TbAuxPAuxICEOn = New System.Windows.Forms.TextBox() + Me.lblAuxICEOnUnit = New System.Windows.Forms.Label() + Me.lblAuxICEOn = New System.Windows.Forms.Label() Me.Label32 = New System.Windows.Forms.Label() Me.LvAux = New System.Windows.Forms.ListView() Me.ColumnHeader4 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader) Me.ColumnHeader5 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader) Me.ColumnHeader6 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader) - Me.ButAuxRem = New System.Windows.Forms.Button() - Me.ButAuxAdd = New System.Windows.Forms.Button() Me.tcJob = New System.Windows.Forms.TabControl() Me.tpAuxiliaries = New System.Windows.Forms.TabPage() Me.gbBusAux = New System.Windows.Forms.GroupBox() @@ -189,6 +194,7 @@ Partial Class VectoJobForm Me.lblEngineCharacteristics = New System.Windows.Forms.Label() Me.lblTitle = New System.Windows.Forms.Label() Me.pnJobInfo = New System.Windows.Forms.Panel() + Me.pnAuxDeclarationMode = New System.Windows.Forms.Panel() Me.TabPgGen.SuspendLayout Me.pnHybridStrategy.SuspendLayout Me.pnVehicle.SuspendLayout @@ -197,6 +203,7 @@ Partial Class VectoJobForm Me.pnShiftParams.SuspendLayout Me.GrCycles.SuspendLayout Me.GrAuxMech.SuspendLayout + Me.pnAuxEngineering.SuspendLayout Me.tcJob.SuspendLayout Me.tpAuxiliaries.SuspendLayout Me.gbBusAux.SuspendLayout @@ -221,6 +228,7 @@ Partial Class VectoJobForm CType(Me.PicVehicle,System.ComponentModel.ISupportInitialize).BeginInit CType(Me.PicBox,System.ComponentModel.ISupportInitialize).BeginInit Me.pnJobInfo.SuspendLayout + Me.pnAuxDeclarationMode.SuspendLayout Me.SuspendLayout ' 'TabPgGen @@ -515,51 +523,112 @@ Partial Class VectoJobForm ' Me.GrAuxMech.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) - Me.GrAuxMech.Controls.Add(Me.Label9) - Me.GrAuxMech.Controls.Add(Me.TbAuxPAdd) - Me.GrAuxMech.Controls.Add(Me.Label8) - Me.GrAuxMech.Controls.Add(Me.Label32) - Me.GrAuxMech.Controls.Add(Me.LvAux) - Me.GrAuxMech.Controls.Add(Me.ButAuxRem) - Me.GrAuxMech.Controls.Add(Me.ButAuxAdd) + Me.GrAuxMech.Controls.Add(Me.pnAuxDeclarationMode) + Me.GrAuxMech.Controls.Add(Me.pnAuxEngineering) Me.GrAuxMech.Location = New System.Drawing.Point(6, 16) Me.GrAuxMech.Name = "GrAuxMech" - Me.GrAuxMech.Size = New System.Drawing.Size(515, 201) + Me.GrAuxMech.Size = New System.Drawing.Size(515, 280) Me.GrAuxMech.TabIndex = 9 Me.GrAuxMech.TabStop = false Me.GrAuxMech.Text = "Mechanical Auxiliaries" ' - 'Label9 - ' - Me.Label9.AutoSize = true - Me.Label9.Location = New System.Drawing.Point(191, 24) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(24, 13) - Me.Label9.TabIndex = 44 - Me.Label9.Text = "[W]" - ' - 'TbAuxPAdd - ' - Me.TbAuxPAdd.Location = New System.Drawing.Point(109, 21) - Me.TbAuxPAdd.Name = "TbAuxPAdd" - Me.TbAuxPAdd.Size = New System.Drawing.Size(76, 20) - Me.TbAuxPAdd.TabIndex = 43 - ' - 'Label8 - ' - Me.Label8.AutoSize = true - Me.Label8.Location = New System.Drawing.Point(7, 24) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(97, 13) - Me.Label8.TabIndex = 42 - Me.Label8.Text = "Constant Aux Load" + 'pnAuxEngineering + ' + Me.pnAuxEngineering.Controls.Add(Me.tbPAuxStandstillICEOff) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxStandstillICEOffUnit) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxStandstillICEOff) + Me.pnAuxEngineering.Controls.Add(Me.tbPAuxDrivingICEOff) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxDrivingICEOffUnit) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxDrivingICEOff) + Me.pnAuxEngineering.Controls.Add(Me.TbAuxPAuxICEOn) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxICEOnUnit) + Me.pnAuxEngineering.Controls.Add(Me.lblAuxICEOn) + Me.pnAuxEngineering.Location = New System.Drawing.Point(6, 19) + Me.pnAuxEngineering.Name = "pnAuxEngineering" + Me.pnAuxEngineering.Size = New System.Drawing.Size(500, 80) + Me.pnAuxEngineering.TabIndex = 45 + ' + 'tbPAuxStandstillICEOff + ' + Me.tbPAuxStandstillICEOff.Location = New System.Drawing.Point(170, 55) + Me.tbPAuxStandstillICEOff.Name = "tbPAuxStandstillICEOff" + Me.tbPAuxStandstillICEOff.Size = New System.Drawing.Size(76, 20) + Me.tbPAuxStandstillICEOff.TabIndex = 49 + ' + 'lblAuxStandstillICEOffUnit + ' + Me.lblAuxStandstillICEOffUnit.AutoSize = true + Me.lblAuxStandstillICEOffUnit.Location = New System.Drawing.Point(252, 58) + Me.lblAuxStandstillICEOffUnit.Name = "lblAuxStandstillICEOffUnit" + Me.lblAuxStandstillICEOffUnit.Size = New System.Drawing.Size(24, 13) + Me.lblAuxStandstillICEOffUnit.TabIndex = 50 + Me.lblAuxStandstillICEOffUnit.Text = "[W]" + ' + 'lblAuxStandstillICEOff + ' + Me.lblAuxStandstillICEOff.AutoSize = true + Me.lblAuxStandstillICEOff.Location = New System.Drawing.Point(3, 58) + Me.lblAuxStandstillICEOff.Name = "lblAuxStandstillICEOff" + Me.lblAuxStandstillICEOff.Size = New System.Drawing.Size(143, 13) + Me.lblAuxStandstillICEOff.TabIndex = 48 + Me.lblAuxStandstillICEOff.Text = "Aux Load (Standstill, ICE Off)" + ' + 'tbPAuxDrivingICEOff + ' + Me.tbPAuxDrivingICEOff.Location = New System.Drawing.Point(170, 29) + Me.tbPAuxDrivingICEOff.Name = "tbPAuxDrivingICEOff" + Me.tbPAuxDrivingICEOff.Size = New System.Drawing.Size(76, 20) + Me.tbPAuxDrivingICEOff.TabIndex = 46 + ' + 'lblAuxDrivingICEOffUnit + ' + Me.lblAuxDrivingICEOffUnit.AutoSize = true + Me.lblAuxDrivingICEOffUnit.Location = New System.Drawing.Point(252, 32) + Me.lblAuxDrivingICEOffUnit.Name = "lblAuxDrivingICEOffUnit" + Me.lblAuxDrivingICEOffUnit.Size = New System.Drawing.Size(24, 13) + Me.lblAuxDrivingICEOffUnit.TabIndex = 47 + Me.lblAuxDrivingICEOffUnit.Text = "[W]" + ' + 'lblAuxDrivingICEOff + ' + Me.lblAuxDrivingICEOff.AutoSize = true + Me.lblAuxDrivingICEOff.Location = New System.Drawing.Point(3, 32) + Me.lblAuxDrivingICEOff.Name = "lblAuxDrivingICEOff" + Me.lblAuxDrivingICEOff.Size = New System.Drawing.Size(134, 13) + Me.lblAuxDrivingICEOff.TabIndex = 45 + Me.lblAuxDrivingICEOff.Text = "Aux Load (Driving, ICE Off)" + ' + 'TbAuxPAuxICEOn + ' + Me.TbAuxPAuxICEOn.Location = New System.Drawing.Point(170, 3) + Me.TbAuxPAuxICEOn.Name = "TbAuxPAuxICEOn" + Me.TbAuxPAuxICEOn.Size = New System.Drawing.Size(76, 20) + Me.TbAuxPAuxICEOn.TabIndex = 43 + ' + 'lblAuxICEOnUnit + ' + Me.lblAuxICEOnUnit.AutoSize = true + Me.lblAuxICEOnUnit.Location = New System.Drawing.Point(252, 6) + Me.lblAuxICEOnUnit.Name = "lblAuxICEOnUnit" + Me.lblAuxICEOnUnit.Size = New System.Drawing.Size(24, 13) + Me.lblAuxICEOnUnit.TabIndex = 44 + Me.lblAuxICEOnUnit.Text = "[W]" + ' + 'lblAuxICEOn + ' + Me.lblAuxICEOn.AutoSize = true + Me.lblAuxICEOn.Location = New System.Drawing.Point(3, 6) + Me.lblAuxICEOn.Name = "lblAuxICEOn" + Me.lblAuxICEOn.Size = New System.Drawing.Size(95, 13) + Me.lblAuxICEOn.TabIndex = 42 + Me.lblAuxICEOn.Text = "Aux Load (ICE On)" ' 'Label32 ' Me.Label32.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) Me.Label32.AutoSize = true - Me.Label32.Location = New System.Drawing.Point(403, 171) + Me.Label32.Location = New System.Drawing.Point(9, 151) Me.Label32.Name = "Label32" Me.Label32.Size = New System.Drawing.Size(106, 13) Me.Label32.TabIndex = 3 @@ -574,10 +643,10 @@ Partial Class VectoJobForm Me.LvAux.FullRowSelect = true Me.LvAux.GridLines = true Me.LvAux.HideSelection = false - Me.LvAux.Location = New System.Drawing.Point(6, 50) + Me.LvAux.Location = New System.Drawing.Point(3, 3) Me.LvAux.MultiSelect = false Me.LvAux.Name = "LvAux" - Me.LvAux.Size = New System.Drawing.Size(503, 115) + Me.LvAux.Size = New System.Drawing.Size(504, 145) Me.LvAux.TabIndex = 0 Me.LvAux.TabStop = false Me.LvAux.UseCompatibleStateImageBehavior = false @@ -598,28 +667,6 @@ Partial Class VectoJobForm Me.ColumnHeader6.Text = "Input File" Me.ColumnHeader6.Width = 331 ' - 'ButAuxRem - ' - Me.ButAuxRem.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) - Me.ButAuxRem.Image = Global.TUGraz.VECTO.My.Resources.Resources.minus_circle_icon - Me.ButAuxRem.Location = New System.Drawing.Point(29, 171) - Me.ButAuxRem.Name = "ButAuxRem" - Me.ButAuxRem.Size = New System.Drawing.Size(24, 24) - Me.ButAuxRem.TabIndex = 2 - Me.ButAuxRem.UseVisualStyleBackColor = true - ' - 'ButAuxAdd - ' - Me.ButAuxAdd.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) - Me.ButAuxAdd.Image = Global.TUGraz.VECTO.My.Resources.Resources.plus_circle_icon - Me.ButAuxAdd.Location = New System.Drawing.Point(5, 171) - Me.ButAuxAdd.Name = "ButAuxAdd" - Me.ButAuxAdd.Size = New System.Drawing.Size(24, 24) - Me.ButAuxAdd.TabIndex = 1 - Me.ButAuxAdd.UseVisualStyleBackColor = true - ' 'tcJob ' Me.tcJob.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ @@ -653,7 +700,7 @@ Partial Class VectoJobForm ' Me.gbBusAux.Controls.Add(Me.cbEnableBusAux) Me.gbBusAux.Controls.Add(Me.pnBusAux) - Me.gbBusAux.Location = New System.Drawing.Point(6, 223) + Me.gbBusAux.Location = New System.Drawing.Point(6, 302) Me.gbBusAux.Name = "gbBusAux" Me.gbBusAux.Size = New System.Drawing.Size(515, 78) Me.gbBusAux.TabIndex = 11 @@ -716,7 +763,7 @@ Partial Class VectoJobForm Me.gbElectricAux.Controls.Add(Me.lblElAuxConstUnit) Me.gbElectricAux.Controls.Add(Me.tbElectricAuxConstant) Me.gbElectricAux.Controls.Add(Me.lblElAuxConst) - Me.gbElectricAux.Location = New System.Drawing.Point(6, 307) + Me.gbElectricAux.Location = New System.Drawing.Point(6, 386) Me.gbElectricAux.Name = "gbElectricAux" Me.gbElectricAux.Size = New System.Drawing.Size(515, 55) Me.gbElectricAux.TabIndex = 10 @@ -1562,7 +1609,7 @@ Partial Class VectoJobForm 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabelGEN}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 582) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 581) Me.StatusStrip1.Name = "StatusStrip1" Me.StatusStrip1.Size = New System.Drawing.Size(942, 22) Me.StatusStrip1.SizingGrip = false @@ -1578,7 +1625,7 @@ Partial Class VectoJobForm '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(776, 555) + Me.ButOK.Location = New System.Drawing.Point(776, 554) Me.ButOK.Name = "ButOK" Me.ButOK.Size = New System.Drawing.Size(75, 23) Me.ButOK.TabIndex = 0 @@ -1589,7 +1636,7 @@ Partial Class VectoJobForm ' 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(857, 555) + Me.ButCancel.Location = New System.Drawing.Point(857, 554) Me.ButCancel.Name = "ButCancel" Me.ButCancel.Size = New System.Drawing.Size(75, 23) Me.ButCancel.TabIndex = 1 @@ -1810,13 +1857,22 @@ Partial Class VectoJobForm Me.pnJobInfo.Size = New System.Drawing.Size(397, 471) Me.pnJobInfo.TabIndex = 39 ' + 'pnAuxDeclarationMode + ' + Me.pnAuxDeclarationMode.Controls.Add(Me.LvAux) + Me.pnAuxDeclarationMode.Controls.Add(Me.Label32) + Me.pnAuxDeclarationMode.Location = New System.Drawing.Point(6, 104) + Me.pnAuxDeclarationMode.Name = "pnAuxDeclarationMode" + Me.pnAuxDeclarationMode.Size = New System.Drawing.Size(503, 170) + Me.pnAuxDeclarationMode.TabIndex = 40 + ' 'VectoJobForm ' Me.AcceptButton = Me.ButOK Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButCancel - Me.ClientSize = New System.Drawing.Size(942, 604) + Me.ClientSize = New System.Drawing.Size(942, 603) Me.Controls.Add(Me.pnJobInfo) Me.Controls.Add(Me.lblTitle) Me.Controls.Add(Me.PictureBox1) @@ -1845,7 +1901,8 @@ Partial Class VectoJobForm Me.GrCycles.ResumeLayout(false) Me.GrCycles.PerformLayout Me.GrAuxMech.ResumeLayout(false) - Me.GrAuxMech.PerformLayout + Me.pnAuxEngineering.ResumeLayout(false) + Me.pnAuxEngineering.PerformLayout Me.tcJob.ResumeLayout(false) Me.tpAuxiliaries.ResumeLayout(false) Me.gbBusAux.ResumeLayout(false) @@ -1884,6 +1941,8 @@ Partial Class VectoJobForm CType(Me.PicBox,System.ComponentModel.ISupportInitialize).EndInit Me.pnJobInfo.ResumeLayout(false) Me.pnJobInfo.PerformLayout + Me.pnAuxDeclarationMode.ResumeLayout(false) + Me.pnAuxDeclarationMode.PerformLayout Me.ResumeLayout(false) Me.PerformLayout @@ -1915,8 +1974,6 @@ End Sub Friend WithEvents ColumnHeader4 As ColumnHeader Friend WithEvents ColumnHeader5 As ColumnHeader Friend WithEvents ColumnHeader6 As ColumnHeader - Friend WithEvents ButAuxRem As Button - Friend WithEvents ButAuxAdd As Button Friend WithEvents PictureBox1 As PictureBox Friend WithEvents TabPgDriver As TabPage Friend WithEvents BtDesMaxBr As Button @@ -1974,9 +2031,9 @@ End Sub Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents tbLacMinSpeed As System.Windows.Forms.TextBox Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents TbAuxPAdd As System.Windows.Forms.TextBox - Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents lblAuxICEOnUnit As System.Windows.Forms.Label + Friend WithEvents TbAuxPAuxICEOn As System.Windows.Forms.TextBox + Friend WithEvents lblAuxICEOn As System.Windows.Forms.Label Friend WithEvents Label15 As System.Windows.Forms.Label Friend WithEvents lblEngineCharacteristics As System.Windows.Forms.Label Friend WithEvents TabPgADAS As TabPage @@ -2051,4 +2108,12 @@ End Sub Friend WithEvents btnBusAuxP As Button Friend WithEvents tbBusAuxParams As TextBox Friend WithEvents btnBrowsBusAuxParams As Button + Friend WithEvents pnAuxEngineering As Panel + Friend WithEvents tbPAuxStandstillICEOff As TextBox + Friend WithEvents lblAuxStandstillICEOffUnit As Label + Friend WithEvents lblAuxStandstillICEOff As Label + Friend WithEvents tbPAuxDrivingICEOff As TextBox + Friend WithEvents lblAuxDrivingICEOffUnit As Label + Friend WithEvents lblAuxDrivingICEOff As Label + Friend WithEvents pnAuxDeclarationMode As Panel End Class diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb index 1edde8fd7e..000a044325 100644 --- a/VECTO/GUI/VectoJobForm.vb +++ b/VECTO/GUI/VectoJobForm.vb @@ -71,7 +71,8 @@ Public Class VectoJobForm Else LvAux.Columns(AuxViewColumns.AuxInputOrTech).Text = "Input File" End If - TbAuxPAdd.Enabled = Not Cfg.DeclMode + pnAuxEngineering.Enabled = Not Cfg.DeclMode + pnAuxDeclarationMode.Enabled = cfg.DeclMode gbBusAux.Enabled = Not cfg.DeclMode 'CbEngOnly.Enabled = Not Cfg.DeclMode @@ -79,8 +80,6 @@ Public Class VectoJobForm GrVACC.Enabled = Not Cfg.DeclMode RdOff.Enabled = Not Cfg.DeclMode GrLAC.Enabled = Not Cfg.DeclMode - ButAuxAdd.Enabled = Not Cfg.DeclMode - ButAuxRem.Enabled = Not Cfg.DeclMode PnEcoRoll.Enabled = Not Cfg.DeclMode gbEcoRoll.Enabled = not Cfg.DeclMode @@ -144,7 +143,7 @@ Public Class VectoJobForm TbOverspeed.Text = DeclarationData.Driver.OverSpeed.AllowedOverSpeed.AsKmph.ToGUIFormat() 'cDeclaration.Overspeed ' cDeclaration.Underspeed TbVmin.Text = DeclarationData.Driver.OverSpeed.MinSpeed.AsKmph.ToGUIFormat() 'cDeclaration.ECvmin - TbAuxPAdd.Text = "" + TbAuxPAuxICEOn.Text = "" If _ LvAux.Items.Count <> 5 OrElse (LvAux.Items(0).Text <> VectoCore.Configuration.Constants.Auxiliaries.IDs.Fan OrElse @@ -501,24 +500,18 @@ Public Class VectoJobForm End Try Next Else + LvAux.Items.Clear() + 'VACC TbDesMaxFile.Text = If(driver.AccelerationCurve Is Nothing, "", GetRelativePath(driver.AccelerationCurve.AccelerationCurve.Source, _basePath)) Dim auxInput As IAuxiliariesEngineeringInputData = inputData.JobInputData.Vehicle.Components.AuxiliaryInputData - tbElectricAuxConstant.Text = inputData.JobInputData.Vehicle.Components.AuxiliaryInputData.ElectricAuxPower.ToGUIFormat() - - LvAux.Items.Clear() - For Each entry As IAuxiliaryEngineeringInputData In auxInput.Auxiliaries - If entry.AuxiliaryType = AuxiliaryDemandType.Constant Then - TbAuxPAdd.Text = entry.ConstantPowerDemand.ToGUIFormat() - Continue For - End If - - LvAux.Items.Add(CreateAuxListEntry(entry.ID, AuxiliaryTypeHelper.ParseKey(entry.ID).Name, - If(entry.DemandMap Is Nothing, "", GetRelativePath(entry.DemandMap.Source, _basePath)))) - Next + tbElectricAuxConstant.Text = auxInput.Auxiliaries.ElectricPowerDemand.ToGUIFormat() + TbAuxPAuxICEOn.Text = auxInput.Auxiliaries.ConstantPowerDemand.ToGUIFormat() + tbPAuxDrivingICEOff.Text = auxInput.Auxiliaries.PowerDemandICEOffDriving.ToGUIFormat() + tbPAuxStandstillICEOff.Text = auxInput.Auxiliaries.PowerDemandICEOffStandstill.ToGUIFormat() End If BtnShiftStrategyParams.Enabled = Not Cfg.DeclMode @@ -657,19 +650,17 @@ Public Class VectoJobForm For Each lv0 As ListViewItem In LvAux.Items Dim auxEntry As VectoJob.AuxEntry = New VectoJob.AuxEntry - If Cfg.DeclMode Then - auxEntry.TechnologyList.Clear() - auxEntry.TechnologyList.AddRange( - lv0.SubItems(AuxViewColumns.AuxInputOrTech).Text.Split(";"c).Select( - Function(x) Trim(x))) - Else - auxEntry.Path.Init(GetPath(file), lv0.SubItems(AuxViewColumns.AuxInputOrTech).Text) - End If + auxEntry.TechnologyList.Clear() + auxEntry.TechnologyList.AddRange( + lv0.SubItems(AuxViewColumns.AuxInputOrTech).Text.Split(";"c).Select( + Function(x) Trim(x))) auxEntry.Type = AuxiliaryTypeHelper.ParseKey(lv0.SubItems(AuxViewColumns.AuxID).Text) - vectoJob.AuxPaths.Add(lv0.SubItems(AuxViewColumns.AuxID).Text, auxEntry) + Next - vectoJob.AuxPAdd = TbAuxPAdd.Text.ToDouble(0) + vectoJob.AuxPwrICEOn = TbAuxPAuxICEOn.Text.ToDouble(0) + vectoJob.AuxPwrDrivingICEOff = tbPAuxDrivingICEOff.Text.ToDouble(0) + vectoJob.AuxPwrStandstillICEOff = _tbPAuxStandstillICEOff.Text.ToDouble(0) vectoJob.AuxElPadd = tbElectricAuxConstant.Text.ToDouble(0) @@ -868,47 +859,12 @@ Public Class VectoJobForm #Region "Aux Listview" - Private Sub ButAuxAdd_Click(sender As Object, e As EventArgs) Handles ButAuxAdd.Click - Dim id As String - - _auxDialog.VehPath = GetPath(VectoFile) - _auxDialog.TbPath.Text = "" - '_auxDialog.CbType.SelectedIndex = -1 - '_auxDialog.CbType.Text = "" - _auxDialog.TbID.Text = "" '!!! Set Type before ID, because changing the type will overwrite the id !!! - -lbDlog: - If _auxDialog.ShowDialog = DialogResult.OK Then - - id = UCase(Trim(_auxDialog.TbID.Text)) - - Dim lv0 As ListViewItem - For Each lv0 In LvAux.Items - If lv0.SubItems(AuxViewColumns.AuxID).Text = id Then - MsgBox("ID '" & id & "' already defined!", MsgBoxStyle.Critical) - _auxDialog.TbID.SelectAll() - _auxDialog.TbID.Focus() - GoTo lbDlog - End If - Next - LvAux.Items.Add(CreateAuxListEntry(UCase(Trim(_auxDialog.TbID.Text)), Trim(_auxDialog.CbType.Text), - Trim(_auxDialog.TbPath.Text))) - Change() - End If - End Sub - - Private Sub ButAuxRem_Click(sender As Object, e As EventArgs) Handles ButAuxRem.Click - RemoveAuxItem() - End Sub - Private Sub LvAux_DoubleClick(sender As Object, e As EventArgs) Handles LvAux.DoubleClick EditAuxItem() End Sub Private Sub LvAux_KeyDown(sender As Object, e As KeyEventArgs) Handles LvAux.KeyDown Select Case e.KeyCode - Case Keys.Delete, Keys.Back - If Not Cfg.DeclMode Then RemoveAuxItem() Case Keys.Enter EditAuxItem() End Select @@ -932,26 +888,20 @@ lbDlog: End If _auxDialog.CbType.SelectedValue = selItem.SubItems(AuxViewColumns.AuxID).Text ' last call, updates GUI - If Cfg.DeclMode Then - If selItem.SubItems(AuxViewColumns.AuxID).Text = AuxiliaryTypeHelper.GetAuxKey(AuxiliaryType.SteeringPump) Then - Dim parts As String() = selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text.Split(";"c) - _auxDialog.CbTech2.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered - _auxDialog.CbTech3.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered - _auxDialog.CbTech4.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered - If parts.Length > 0 Then _auxDialog.CbTech.SelectedValue = Trim(parts(0)) - If parts.Length > 1 Then _auxDialog.CbTech2.SelectedValue = Trim(parts(1)) - If parts.Length > 2 Then _auxDialog.CbTech3.SelectedValue = Trim(parts(2)) - If parts.Length > 3 Then _auxDialog.CbTech4.SelectedValue = Trim(parts(3)) - Else - _auxDialog.CbTech.SelectedValue = selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text - _auxDialog.TbPath.Text = "" - - End If + + If selItem.SubItems(AuxViewColumns.AuxID).Text = AuxiliaryTypeHelper.GetAuxKey(AuxiliaryType.SteeringPump) Then + Dim parts As String() = selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text.Split(";"c) + _auxDialog.CbTech2.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered + _auxDialog.CbTech3.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered + _auxDialog.CbTech4.SelectedItem = VehicleAuxiliariesDialog.AxleNotSteered + If parts.Length > 0 Then _auxDialog.CbTech.SelectedValue = Trim(parts(0)) + If parts.Length > 1 Then _auxDialog.CbTech2.SelectedValue = Trim(parts(1)) + If parts.Length > 2 Then _auxDialog.CbTech3.SelectedValue = Trim(parts(2)) + If parts.Length > 3 Then _auxDialog.CbTech4.SelectedValue = Trim(parts(3)) Else - _auxDialog.CbTech.SelectedIndex = -1 - _auxDialog.TbPath.Text = selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text + _auxDialog.CbTech.SelectedValue = selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text End If - + '_auxDialog.TbID.Text = selItem.SubItems(AuxViewColumns.AuxID).Text If _auxDialog.ShowDialog = DialogResult.OK Then @@ -959,53 +909,21 @@ lbDlog: 'UCase(Trim(_auxDialog.TbID.Text)) selItem.SubItems(AuxViewColumns.AuxType).Text = _auxDialog.CbType.Text - If Cfg.DeclMode Then - If _auxDialog.TbID.Text = AuxiliaryTypeHelper.GetAuxKey(AuxiliaryType.SteeringPump) Then - Dim techlist As List(Of String) = New List(Of String) - techlist.Add(_auxDialog.CbTech.Text) - If _auxDialog.CbTech2.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech2.Text) - If _auxDialog.CbTech3.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech3.Text) - If _auxDialog.CbTech4.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech4.Text) - selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text = String.Join("; ", techlist) - Else - selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text = Trim(_auxDialog.CbTech.Text) - End If - + If _auxDialog.TbID.Text = AuxiliaryTypeHelper.GetAuxKey(AuxiliaryType.SteeringPump) Then + Dim techlist As List(Of String) = New List(Of String) + techlist.Add(_auxDialog.CbTech.Text) + If _auxDialog.CbTech2.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech2.Text) + If _auxDialog.CbTech3.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech3.Text) + If _auxDialog.CbTech4.Text <> VehicleAuxiliariesDialog.AxleNotSteered Then techlist.Add(_auxDialog.CbTech4.Text) + selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text = String.Join("; ", techlist) Else - selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text = Trim(_auxDialog.TbPath.Text) + selItem.SubItems(AuxViewColumns.AuxInputOrTech).Text = Trim(_auxDialog.CbTech.Text) End If Change() End If End Sub - Private Sub RemoveAuxItem() - Dim i As Integer - - If LvAux.SelectedItems.Count = 0 Then - If LvAux.Items.Count = 0 Then - Exit Sub - Else - LvAux.Items(LvAux.Items.Count - 1).Selected = True - End If - End If - - i = LvAux.SelectedItems(0).Index - - LvAux.SelectedItems(0).Remove() - - If LvAux.Items.Count > 0 Then - If i < LvAux.Items.Count Then - LvAux.Items(i).Selected = True - Else - LvAux.Items(LvAux.Items.Count - 1).Selected = True - End If - LvAux.Focus() - End If - - Change() - End Sub - #End Region 'OK (Save & Close) @@ -1487,8 +1405,6 @@ lbDlog: End If End Sub - Private Sub LvAux_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LvAux.SelectedIndexChanged - End Sub Private Sub BtnShiftStrategyParams_Click(sender As Object, e As EventArgs) Handles BtnShiftStrategyParams.Click If TCUFileBrowser.OpenDialog(FileRepl(TbShiftStrategyParams.Text, GetPath(VectoFile))) Then diff --git a/VECTO/GUI/VehicleAuxiliariesDialog.Designer.vb b/VECTO/GUI/VehicleAuxiliariesDialog.Designer.vb index 97cf4ee371..62070078e0 100644 --- a/VECTO/GUI/VehicleAuxiliariesDialog.Designer.vb +++ b/VECTO/GUI/VehicleAuxiliariesDialog.Designer.vb @@ -36,277 +36,219 @@ Partial Class VehicleAuxiliariesDialog 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. <DebuggerStepThrough()> _ Private Sub InitializeComponent() - Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() - Me.OK_Button = New System.Windows.Forms.Button() - Me.Cancel_Button = New System.Windows.Forms.Button() - Me.Label1 = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() - Me.Label3 = New System.Windows.Forms.Label() - Me.TbID = New System.Windows.Forms.TextBox() - Me.TbPath = New System.Windows.Forms.TextBox() - Me.BtBrowse = New System.Windows.Forms.Button() - Me.CbType = New System.Windows.Forms.ComboBox() - Me.LbIDhelp = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.CbTech = New System.Windows.Forms.ComboBox() - Me.PnTech = New System.Windows.Forms.Panel() - Me.LbAxl4 = New System.Windows.Forms.Label() - Me.LbAxl3 = New System.Windows.Forms.Label() - Me.lbAxl2 = New System.Windows.Forms.Label() - Me.CbTech4 = New System.Windows.Forms.ComboBox() - Me.CbTech3 = New System.Windows.Forms.ComboBox() - Me.CbTech2 = New System.Windows.Forms.ComboBox() - Me.PnFile = New System.Windows.Forms.Panel() - Me.TableLayoutPanel1.SuspendLayout() - Me.PnTech.SuspendLayout() - Me.PnFile.SuspendLayout() - Me.SuspendLayout() - ' - 'TableLayoutPanel1 - ' - Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TableLayoutPanel1.ColumnCount = 2 - Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) - Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) - Me.TableLayoutPanel1.Location = New System.Drawing.Point(301, 133) - Me.TableLayoutPanel1.Name = "TableLayoutPanel1" - Me.TableLayoutPanel1.RowCount = 1 - Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) - Me.TableLayoutPanel1.TabIndex = 25 - ' - 'OK_Button - ' - Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None - Me.OK_Button.DialogResult = System.Windows.Forms.DialogResult.OK - Me.OK_Button.Location = New System.Drawing.Point(3, 3) - Me.OK_Button.Name = "OK_Button" - Me.OK_Button.Size = New System.Drawing.Size(67, 23) - Me.OK_Button.TabIndex = 0 - Me.OK_Button.Text = "OK" - ' - 'Cancel_Button - ' - Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None - Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.Cancel_Button.Location = New System.Drawing.Point(76, 3) - Me.Cancel_Button.Name = "Cancel_Button" - Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) - Me.Cancel_Button.TabIndex = 1 - Me.Cancel_Button.Text = "Cancel" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(171, 10) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(18, 13) - Me.Label1.TabIndex = 1 - Me.Label1.Text = "ID" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(9, 10) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(31, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Type" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(7, 39) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(50, 13) - Me.Label3.TabIndex = 1 - Me.Label3.Text = "Input File" - ' - 'TbID - ' - Me.TbID.Location = New System.Drawing.Point(195, 7) - Me.TbID.Name = "TbID" - Me.TbID.ReadOnly = True - Me.TbID.Size = New System.Drawing.Size(39, 20) - Me.TbID.TabIndex = 5 - ' - 'TbPath - ' - Me.TbPath.Location = New System.Drawing.Point(7, 55) - Me.TbPath.Name = "TbPath" - Me.TbPath.Size = New System.Drawing.Size(401, 20) - Me.TbPath.TabIndex = 10 - ' - 'BtBrowse - ' - Me.BtBrowse.Image = Global.TUGraz.VECTO.My.Resources.Resources.Open_icon - Me.BtBrowse.Location = New System.Drawing.Point(408, 53) - Me.BtBrowse.Name = "BtBrowse" - Me.BtBrowse.Size = New System.Drawing.Size(24, 24) - Me.BtBrowse.TabIndex = 15 - Me.BtBrowse.UseVisualStyleBackColor = True - ' - 'CbType - ' - Me.CbType.FormattingEnabled = True - Me.CbType.Location = New System.Drawing.Point(46, 7) - Me.CbType.Name = "CbType" - Me.CbType.Size = New System.Drawing.Size(109, 21) - Me.CbType.TabIndex = 0 - ' - 'LbIDhelp - ' - Me.LbIDhelp.AutoSize = True - Me.LbIDhelp.Location = New System.Drawing.Point(240, 10) - Me.LbIDhelp.Name = "LbIDhelp" - Me.LbIDhelp.Size = New System.Drawing.Size(0, 13) - Me.LbIDhelp.TabIndex = 26 - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(6, 9) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(63, 13) - Me.Label4.TabIndex = 1 - Me.Label4.Text = "Technology" - ' - 'CbTech - ' - Me.CbTech.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbTech.FormattingEnabled = True - Me.CbTech.Location = New System.Drawing.Point(75, 6) - Me.CbTech.Name = "CbTech" - Me.CbTech.Size = New System.Drawing.Size(352, 21) - Me.CbTech.TabIndex = 27 - ' - 'PnTech - ' - Me.PnTech.Controls.Add(Me.LbAxl4) - Me.PnTech.Controls.Add(Me.LbAxl3) - Me.PnTech.Controls.Add(Me.lbAxl2) - Me.PnTech.Controls.Add(Me.CbTech4) - Me.PnTech.Controls.Add(Me.CbTech3) - Me.PnTech.Controls.Add(Me.CbTech2) - Me.PnTech.Controls.Add(Me.CbTech) - Me.PnTech.Controls.Add(Me.Label4) - Me.PnTech.Location = New System.Drawing.Point(12, 12) - Me.PnTech.Name = "PnTech" - Me.PnTech.Size = New System.Drawing.Size(435, 119) - Me.PnTech.TabIndex = 28 - ' - 'LbAxl4 - ' - Me.LbAxl4.AutoSize = True - Me.LbAxl4.Location = New System.Drawing.Point(30, 90) - Me.LbAxl4.Name = "LbAxl4" - Me.LbAxl4.Size = New System.Drawing.Size(39, 13) - Me.LbAxl4.TabIndex = 33 - Me.LbAxl4.Text = "4. Axle" - ' - 'LbAxl3 - ' - Me.LbAxl3.AutoSize = True - Me.LbAxl3.Location = New System.Drawing.Point(30, 63) - Me.LbAxl3.Name = "LbAxl3" - Me.LbAxl3.Size = New System.Drawing.Size(39, 13) - Me.LbAxl3.TabIndex = 32 - Me.LbAxl3.Text = "3. Axle" - ' - 'lbAxl2 - ' - Me.lbAxl2.AutoSize = True - Me.lbAxl2.Location = New System.Drawing.Point(30, 36) - Me.lbAxl2.Name = "lbAxl2" - Me.lbAxl2.Size = New System.Drawing.Size(39, 13) - Me.lbAxl2.TabIndex = 31 - Me.lbAxl2.Text = "2. Axle" - ' - 'CbTech4 - ' - Me.CbTech4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbTech4.FormattingEnabled = True - Me.CbTech4.Location = New System.Drawing.Point(75, 87) - Me.CbTech4.Name = "CbTech4" - Me.CbTech4.Size = New System.Drawing.Size(352, 21) - Me.CbTech4.TabIndex = 30 - ' - 'CbTech3 - ' - Me.CbTech3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbTech3.FormattingEnabled = True - Me.CbTech3.Location = New System.Drawing.Point(75, 60) - Me.CbTech3.Name = "CbTech3" - Me.CbTech3.Size = New System.Drawing.Size(352, 21) - Me.CbTech3.TabIndex = 29 - ' - 'CbTech2 - ' - Me.CbTech2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.CbTech2.FormattingEnabled = True - Me.CbTech2.Location = New System.Drawing.Point(75, 33) - Me.CbTech2.Name = "CbTech2" - Me.CbTech2.Size = New System.Drawing.Size(352, 21) - Me.CbTech2.TabIndex = 28 - ' - 'PnFile - ' - Me.PnFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.PnFile.Controls.Add(Me.LbIDhelp) - Me.PnFile.Controls.Add(Me.BtBrowse) - Me.PnFile.Controls.Add(Me.CbType) - Me.PnFile.Controls.Add(Me.TbID) - Me.PnFile.Controls.Add(Me.TbPath) - Me.PnFile.Controls.Add(Me.Label2) - Me.PnFile.Controls.Add(Me.Label3) - Me.PnFile.Controls.Add(Me.Label1) - Me.PnFile.Location = New System.Drawing.Point(12, 12) - Me.PnFile.Name = "PnFile" - Me.PnFile.Size = New System.Drawing.Size(435, 118) - Me.PnFile.TabIndex = 29 - ' - 'VehicleAuxiliariesDialog - ' - Me.AcceptButton = Me.OK_Button - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.Cancel_Button - Me.ClientSize = New System.Drawing.Size(459, 174) - Me.Controls.Add(Me.PnFile) - Me.Controls.Add(Me.PnTech) - Me.Controls.Add(Me.TableLayoutPanel1) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "VehicleAuxiliariesDialog" - Me.ShowInTaskbar = False - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Auxiliary" - Me.TableLayoutPanel1.ResumeLayout(False) - Me.PnTech.ResumeLayout(False) - Me.PnTech.PerformLayout() - Me.PnFile.ResumeLayout(False) - Me.PnFile.PerformLayout() - Me.ResumeLayout(False) + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.OK_Button = New System.Windows.Forms.Button() + Me.Cancel_Button = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.TbID = New System.Windows.Forms.TextBox() + Me.CbType = New System.Windows.Forms.ComboBox() + Me.Label4 = New System.Windows.Forms.Label() + Me.CbTech = New System.Windows.Forms.ComboBox() + Me.PnTech = New System.Windows.Forms.Panel() + Me.LbAxl4 = New System.Windows.Forms.Label() + Me.LbAxl3 = New System.Windows.Forms.Label() + Me.lbAxl2 = New System.Windows.Forms.Label() + Me.CbTech4 = New System.Windows.Forms.ComboBox() + Me.CbTech3 = New System.Windows.Forms.ComboBox() + Me.CbTech2 = New System.Windows.Forms.ComboBox() + Me.TableLayoutPanel1.SuspendLayout + Me.PnTech.SuspendLayout + Me.SuspendLayout + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) + Me.TableLayoutPanel1.ColumnCount = 2 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!)) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50!)) + Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(301, 173) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 1 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) + Me.TableLayoutPanel1.TabIndex = 25 + ' + 'OK_Button + ' + Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.OK_Button.DialogResult = System.Windows.Forms.DialogResult.OK + Me.OK_Button.Location = New System.Drawing.Point(3, 3) + Me.OK_Button.Name = "OK_Button" + Me.OK_Button.Size = New System.Drawing.Size(67, 23) + Me.OK_Button.TabIndex = 0 + Me.OK_Button.Text = "OK" + ' + 'Cancel_Button + ' + Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Cancel_Button.Location = New System.Drawing.Point(76, 3) + Me.Cancel_Button.Name = "Cancel_Button" + Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) + Me.Cancel_Button.TabIndex = 1 + Me.Cancel_Button.Text = "Cancel" + ' + 'Label1 + ' + Me.Label1.AutoSize = true + Me.Label1.Location = New System.Drawing.Point(174, 15) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(18, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "ID" + ' + 'Label2 + ' + Me.Label2.AutoSize = true + Me.Label2.Location = New System.Drawing.Point(12, 15) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(31, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Type" + ' + 'TbID + ' + Me.TbID.Location = New System.Drawing.Point(198, 12) + Me.TbID.Name = "TbID" + Me.TbID.ReadOnly = true + Me.TbID.Size = New System.Drawing.Size(39, 20) + Me.TbID.TabIndex = 5 + ' + 'CbType + ' + Me.CbType.FormattingEnabled = true + Me.CbType.Location = New System.Drawing.Point(49, 12) + Me.CbType.Name = "CbType" + Me.CbType.Size = New System.Drawing.Size(109, 21) + Me.CbType.TabIndex = 0 + ' + 'Label4 + ' + Me.Label4.AutoSize = true + Me.Label4.Location = New System.Drawing.Point(6, 9) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(63, 13) + Me.Label4.TabIndex = 1 + Me.Label4.Text = "Technology" + ' + 'CbTech + ' + Me.CbTech.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.CbTech.FormattingEnabled = true + Me.CbTech.Location = New System.Drawing.Point(75, 6) + Me.CbTech.Name = "CbTech" + Me.CbTech.Size = New System.Drawing.Size(352, 21) + Me.CbTech.TabIndex = 27 + ' + 'PnTech + ' + Me.PnTech.Controls.Add(Me.LbAxl4) + Me.PnTech.Controls.Add(Me.LbAxl3) + Me.PnTech.Controls.Add(Me.lbAxl2) + Me.PnTech.Controls.Add(Me.CbTech4) + Me.PnTech.Controls.Add(Me.CbTech3) + Me.PnTech.Controls.Add(Me.CbTech2) + Me.PnTech.Controls.Add(Me.CbTech) + Me.PnTech.Controls.Add(Me.Label4) + Me.PnTech.Location = New System.Drawing.Point(9, 44) + Me.PnTech.Name = "PnTech" + Me.PnTech.Size = New System.Drawing.Size(435, 119) + Me.PnTech.TabIndex = 28 + ' + 'LbAxl4 + ' + Me.LbAxl4.AutoSize = true + Me.LbAxl4.Location = New System.Drawing.Point(30, 90) + Me.LbAxl4.Name = "LbAxl4" + Me.LbAxl4.Size = New System.Drawing.Size(39, 13) + Me.LbAxl4.TabIndex = 33 + Me.LbAxl4.Text = "4. Axle" + ' + 'LbAxl3 + ' + Me.LbAxl3.AutoSize = true + Me.LbAxl3.Location = New System.Drawing.Point(30, 63) + Me.LbAxl3.Name = "LbAxl3" + Me.LbAxl3.Size = New System.Drawing.Size(39, 13) + Me.LbAxl3.TabIndex = 32 + Me.LbAxl3.Text = "3. Axle" + ' + 'lbAxl2 + ' + Me.lbAxl2.AutoSize = true + Me.lbAxl2.Location = New System.Drawing.Point(30, 36) + Me.lbAxl2.Name = "lbAxl2" + Me.lbAxl2.Size = New System.Drawing.Size(39, 13) + Me.lbAxl2.TabIndex = 31 + Me.lbAxl2.Text = "2. Axle" + ' + 'CbTech4 + ' + Me.CbTech4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.CbTech4.FormattingEnabled = true + Me.CbTech4.Location = New System.Drawing.Point(75, 87) + Me.CbTech4.Name = "CbTech4" + Me.CbTech4.Size = New System.Drawing.Size(352, 21) + Me.CbTech4.TabIndex = 30 + ' + 'CbTech3 + ' + Me.CbTech3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.CbTech3.FormattingEnabled = true + Me.CbTech3.Location = New System.Drawing.Point(75, 60) + Me.CbTech3.Name = "CbTech3" + Me.CbTech3.Size = New System.Drawing.Size(352, 21) + Me.CbTech3.TabIndex = 29 + ' + 'CbTech2 + ' + Me.CbTech2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.CbTech2.FormattingEnabled = true + Me.CbTech2.Location = New System.Drawing.Point(75, 33) + Me.CbTech2.Name = "CbTech2" + Me.CbTech2.Size = New System.Drawing.Size(352, 21) + Me.CbTech2.TabIndex = 28 + ' + 'VehicleAuxiliariesDialog + ' + Me.AcceptButton = Me.OK_Button + Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.Cancel_Button + Me.ClientSize = New System.Drawing.Size(459, 214) + Me.Controls.Add(Me.PnTech) + Me.Controls.Add(Me.CbType) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.Controls.Add(Me.TbID) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Label2) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = false + Me.MinimizeBox = false + Me.Name = "VehicleAuxiliariesDialog" + Me.ShowInTaskbar = false + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Auxiliary" + Me.TableLayoutPanel1.ResumeLayout(false) + Me.PnTech.ResumeLayout(false) + Me.PnTech.PerformLayout + Me.ResumeLayout(false) + Me.PerformLayout - End Sub +End Sub Friend WithEvents TableLayoutPanel1 As TableLayoutPanel Friend WithEvents OK_Button As Button Friend WithEvents Cancel_Button As Button Friend WithEvents Label1 As Label Friend WithEvents Label2 As Label - Friend WithEvents Label3 As Label Friend WithEvents TbID As TextBox - Friend WithEvents TbPath As TextBox - Friend WithEvents BtBrowse As Button Friend WithEvents CbType As ComboBox - Friend WithEvents LbIDhelp As Label Friend WithEvents Label4 As Label Friend WithEvents CbTech As ComboBox Friend WithEvents PnTech As Panel - Friend WithEvents PnFile As Panel Friend WithEvents CbTech4 As System.Windows.Forms.ComboBox Friend WithEvents CbTech3 As System.Windows.Forms.ComboBox Friend WithEvents CbTech2 As System.Windows.Forms.ComboBox diff --git a/VECTO/GUI/VehicleAuxiliariesDialog.vb b/VECTO/GUI/VehicleAuxiliariesDialog.vb index b4bda4ff61..c9bc543bf0 100644 --- a/VECTO/GUI/VehicleAuxiliariesDialog.vb +++ b/VECTO/GUI/VehicleAuxiliariesDialog.vb @@ -40,7 +40,6 @@ Public Class VehicleAuxiliariesDialog 'CbType.Items.Add("HVAC") 'CbType.Items.Add("Electric System") PnTech.Visible = Cfg.DeclMode - PnFile.Visible = Not Cfg.DeclMode CbTech.DisplayMember = "Caption" CbTech.ValueMember = "Value" @@ -60,6 +59,7 @@ Public Class VehicleAuxiliariesDialog 'Set generic values for Declaration mode Private Sub DeclInit() + CbType.Enabled = false CbTech2.Visible = NumAxles > 1 CbTech3.Visible = NumAxles > 2 CbTech4.Visible = NumAxles > 3 @@ -133,11 +133,6 @@ Public Class VehicleAuxiliariesDialog 'End If End Sub - 'Browse for .vaux files - Private Sub BtBrowse_Click(sender As Object, e As EventArgs) Handles BtBrowse.Click - If AuxFileBrowser.OpenDialog(FileRepl(TbPath.Text, VehPath)) Then _ - TbPath.Text = GetFilenameWithoutDirectory(AuxFileBrowser.Files(0), VehPath) - End Sub 'Update ID when Aux Type was changed Private Sub CbType_TextChanged(sender As Object, e As EventArgs) Handles CbType.TextChanged @@ -146,33 +141,13 @@ Public Class VehicleAuxiliariesDialog TbID.Text = "" Else TbID.Text = CbType.SelectedValue.ToString() - 'If Cfg.DeclMode Then - ' 'Select Case CbType.SelectedIndex - ' ' Case 0 - ' ' TbID.Text = VectoCore.Configuration.Constants.Auxiliaries.IDs.Fan - ' ' Case 1 - ' ' TbID.Text = VectoCore.Configuration.Constants.Auxiliaries.IDs.SteeringPump - - ' ' Case Else '2 - ' ' TbID.Text = VectoCore.Configuration.Constants.Auxiliaries.IDs.HeatingVentilationAirCondition - - ' 'End Select - 'Else - ' 'TbID.Text = Trim(UCase(CbType.Text.Substring(0, CInt(Math.Min(CbType.Text.Length, 3))))) - 'End If End If End Sub - 'Update help label if ID was changed Private Sub TbID_TextChanged(sender As Object, e As EventArgs) Handles TbID.TextChanged DeclInit() - If Trim(TbID.Text) = "" Or Cfg.DeclMode Then - LbIDhelp.Text = "" - Else - LbIDhelp.Text = String.Format("Header in Driving cycle: <AUX_{0}>", Trim(TbID.Text)) - End If End Sub Private Sub CbTech_SelectedIndexChanged(sender As Object, e As EventArgs) Handles CbTech.SelectedIndexChanged diff --git a/VECTO/Input Files/VectoJob.vb b/VECTO/Input Files/VectoJob.vb index 665ea02711..f9a3d5110f 100644 --- a/VECTO/Input Files/VectoJob.vb +++ b/VECTO/Input Files/VectoJob.vb @@ -32,7 +32,7 @@ Imports TUGraz.VectoCore.Utils <CustomValidation(GetType(VectoJob), "ValidateJob")> Public Class VectoJob Implements IEngineeringInputDataProvider, IDeclarationInputDataProvider, IEngineeringJobInputData, - IDeclarationJobInputData, IDriverEngineeringInputData, IDriverDeclarationInputData, IAuxiliariesEngineeringInputData, + IDeclarationJobInputData, IDriverEngineeringInputData, IDriverDeclarationInputData, IAuxiliariesEngineeringInputData, IAuxiliaryEngineeringInputData, IAuxiliariesDeclarationInputData, IJSONVehicleComponents, IEngineStopStartEngineeringInputData, IEcoRollEngineeringInputData, IPCCEngineeringInputData @@ -57,7 +57,6 @@ Public Class VectoJob Private ReadOnly _driverAccelerationFile As SubPath - Public ReadOnly AuxPaths As Dictionary(Of String, AuxEntry) 'Alle Nebenverbraucher die in der Veh-Datei UND im Zyklus definiert sind Public ReadOnly CycleFiles As List(Of SubPath) @@ -89,6 +88,8 @@ Public Class VectoJob Public PCCOverspeedUseCase3 As Double Private _accelerationUpperLimit As MeterPerSquareSecond Public AuxElPadd As Double + Public AuxPwrDrivingICEOff As Double + Public AuxPwrStandstillICEOff As Double 'Private _vehicleInputData As JSONComponentInputData 'Private _engineInputData As JSONComponentInputData @@ -121,8 +122,6 @@ Public Class VectoJob _driverAccelerationFile = New SubPath - AuxPaths = New Dictionary(Of String, AuxEntry) - CycleFiles = New List(Of SubPath) End Sub @@ -689,7 +688,7 @@ Public Class VectoJob End set End Property - Public Property AuxPAdd As Double + Public Property AuxPwrICEOn As Double Public ReadOnly Property IAuxiliariesDeclarationInputData_SavedInDeclarationMode As Boolean _ Implements IAuxiliariesDeclarationInputData.SavedInDeclarationMode @@ -698,10 +697,10 @@ Public Class VectoJob End Get End Property - Public ReadOnly Property Auxiliaries As IList(Of IAuxiliaryEngineeringInputData) _ + Public ReadOnly Property Auxiliaries As IAuxiliaryEngineeringInputData _ Implements IAuxiliariesEngineeringInputData.Auxiliaries Get - Return AuxData().Cast(Of IAuxiliaryEngineeringInputData).ToList() + Return me End Get End Property @@ -714,11 +713,6 @@ Public Class VectoJob End Get End Property - Public ReadOnly Property ElectricAuxPower As Watt Implements IAuxiliariesEngineeringInputData.ElectricAuxPower - Get - Return AuxElPadd.SI(Of Watt) - End Get - End Property Public ReadOnly Property IAuxiliariesDeclarationInputData_Auxiliaries As IList(Of IAuxiliaryDeclarationInputData) _ Implements IAuxiliariesDeclarationInputData.Auxiliaries @@ -727,43 +721,9 @@ Public Class VectoJob End Get End Property - Protected Function AuxData() As IList(Of AuxiliaryDataInputData) - Dim retVal As List(Of AuxiliaryDataInputData) = New List(Of AuxiliaryDataInputData) + Protected Function AuxData() As IList(Of DeclarationAuxiliaryDataInputData) - If AuxPAdd > 0 Then - retVal.Add(New AuxiliaryDataInputData() With { - .ID = "ConstantAux", - .AuxiliaryType = AuxiliaryDemandType.Constant, - .ConstantPowerDemand = AuxPAdd.SI(Of Watt)() - }) - End If - If (AuxElPadd > 0) Then - retVal.Add(New AuxiliaryDataInputData() With { - .ID = "ConstantAuxEL", - .AuxiliaryType = AuxiliaryDemandType.Constant, - .ConstantPowerDemand = AuxElPadd.SI(Of Watt) - }) - End If - - For Each auxEntry As KeyValuePair(Of String, AuxEntry) In AuxPaths - Dim theAuxData As AuxiliaryDataInputData = New AuxiliaryDataInputData() With { - .Type = auxEntry.Value.Type, - .Technology = auxEntry.Value.TechnologyList, - .ID = auxEntry.Key - } - retVal.Add(theAuxData) - If Not File.Exists(auxEntry.Value.Path.FullPath) Then Continue For - - Dim stream As StreamReader = New StreamReader(auxEntry.Value.Path.FullPath) - stream.ReadLine() ' skip header "Transmission ration to engine rpm [-]" - theAuxData.TransmissionRatio = stream.ReadLine().IndulgentParse() - stream.ReadLine() ' skip header "Efficiency to engine [-]" - theAuxData.EfficiencyToEngine = stream.ReadLine().IndulgentParse() - stream.ReadLine() ' skip header "Efficiency auxiliary to supply [-]" - theAuxData.EfficiencyToSupply = stream.ReadLine().IndulgentParse() - theAuxData.DemandMap = VectoCSVFile.ReadStream(New MemoryStream(Encoding.UTF8.GetBytes(stream.ReadToEnd())), - source:=auxEntry.Value.Path.FullPath) - Next + Dim retVal As List(Of DeclarationAuxiliaryDataInputData) = New List(Of DeclarationAuxiliaryDataInputData) Return retVal End Function @@ -817,6 +777,26 @@ Public Class VectoJob End Get End Property + Public ReadOnly Property ConstantPowerDemand As Watt Implements IAuxiliaryEngineeringInputData.ConstantPowerDemand + get + Return AuxPwrICEOn.SI(of Watt) + End Get + End Property + Public ReadOnly Property PowerDemandICEOffDriving As Watt Implements IAuxiliaryEngineeringInputData.PowerDemandICEOffDriving + get + Return AuxPwrDrivingICEOff.SI(of Watt) + End Get + End Property + Public ReadOnly Property PowerDemandICEOffStandstill As Watt Implements IAuxiliaryEngineeringInputData.PowerDemandICEOffStandstill + get + Return AuxPwrStandstillICEOff.SI(Of Watt) + End Get + End Property + Public ReadOnly Property ElectricPowerDemand As Watt Implements IAuxiliaryEngineeringInputData.ElectricPowerDemand + get + Return AuxElPadd.SI(of Watt) + End Get + End Property End Class diff --git a/VECTO3GUI/ViewModel/Adapter/Declaration/AuxiliariesDeclarationAdapter.cs b/VECTO3GUI/ViewModel/Adapter/Declaration/AuxiliariesDeclarationAdapter.cs index 2ba8254518..9d9d0572a5 100644 --- a/VECTO3GUI/ViewModel/Adapter/Declaration/AuxiliariesDeclarationAdapter.cs +++ b/VECTO3GUI/ViewModel/Adapter/Declaration/AuxiliariesDeclarationAdapter.cs @@ -26,23 +26,23 @@ namespace VECTO3GUI.ViewModel.Adapter.Declaration { var retVal = new List<IAuxiliaryDeclarationInputData>(); retVal.Add( - new AuxiliaryDataInputData { + new DeclarationAuxiliaryDataInputData() { Type = AuxiliaryType.Fan, Technology = new List<string> { ViewModel.FanTechnology } }); - retVal.Add(new AuxiliaryDataInputData { + retVal.Add(new DeclarationAuxiliaryDataInputData { Type = AuxiliaryType.ElectricSystem, Technology = new List<string> { ViewModel.ElectricSystemTechnology } }); - retVal.Add(new AuxiliaryDataInputData { + retVal.Add(new DeclarationAuxiliaryDataInputData { Type = AuxiliaryType.HVAC, Technology = new List<string> { ViewModel.HVACTechnology } }); - retVal.Add(new AuxiliaryDataInputData { + retVal.Add(new DeclarationAuxiliaryDataInputData { Type = AuxiliaryType.PneumaticSystem, Technology = new List<string> { ViewModel.PneumaticSystemTechnology } }); - retVal.Add(new AuxiliaryDataInputData { + retVal.Add(new DeclarationAuxiliaryDataInputData { Type = AuxiliaryType.SteeringPump, Technology = ViewModel.SteeringPumpTechnologies //.OrderBy(x => x.SteeredAxle) diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 7b96b49705..b8c74a50c1 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -677,6 +677,7 @@ namespace TUGraz.VectoCommon.InputData public interface IAuxiliaryDeclarationInputData { + /// <summary> /// P005 Aux-Type /// cf. VECTO Input Parameters.xlsx diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index 4218c519dc..5af6affc43 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -403,11 +403,10 @@ namespace TUGraz.VectoCommon.InputData public interface IAuxiliariesEngineeringInputData { - IList<IAuxiliaryEngineeringInputData> Auxiliaries { get; } + IAuxiliaryEngineeringInputData Auxiliaries { get; } IBusAuxiliariesEngineeringData BusAuxiliariesData { get; } - Watt ElectricAuxPower { get; } } public interface IBusAuxiliariesEngineeringData @@ -597,48 +596,19 @@ namespace TUGraz.VectoCommon.InputData public interface IAuxiliaryEngineeringInputData { - /// <summary> - /// P006 Aux-ID - /// cf. VECTO Input Parameters.xlsx - /// </summary> - string ID { get; } - - /// <summary> - /// either mapping or constant - /// </summary> - AuxiliaryDemandType AuxiliaryType { get; } - - /// <summary> - /// P022 Aux-InputFile: transmission ratio - /// cf. VECTO Input Parameters.xlsx - /// </summary> - double TransmissionRatio { get; } - - /// <summary> - /// P023 Aux-InputFile: efficiency to engine - /// cf. VECTO Input Parameters.xlsx - /// </summary> - double EfficiencyToEngine { get; } - - /// <summary> - /// P024 Aux-InputFile: efficiency to supply - /// cf. VECTO Input Parameters.xlsx - /// </summary> - double EfficiencyToSupply { get; } - - /// <summary> - /// P025, P026, P027 Aux-InputFile: map - /// cf. VECTO Input Parameters.xlsx - /// </summary> - TableData DemandMap { get; } - + /// <summary> /// P178 /// additional constant auxiliary load, similar to Padd; not specified in the cycle but as auxiliary /// </summary> Watt ConstantPowerDemand { get; } - DataSource DataSource { get; } + Watt PowerDemandICEOffDriving { get; } + + Watt PowerDemandICEOffStandstill { get; } + + + Watt ElectricPowerDemand { get; } } } diff --git a/VectoCommon/VectoCommon/Models/AuxiliaryDemandType.cs b/VectoCommon/VectoCommon/Models/AuxiliaryDemandType.cs index 990ba5fc0b..041793e823 100644 --- a/VectoCommon/VectoCommon/Models/AuxiliaryDemandType.cs +++ b/VectoCommon/VectoCommon/Models/AuxiliaryDemandType.cs @@ -34,7 +34,6 @@ namespace TUGraz.VectoCommon.Models public enum AuxiliaryDemandType { Direct, - Mapping, Constant } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Configuration/Constants.cs b/VectoCore/VectoCore/Configuration/Constants.cs index 74afa8c092..f3a35eb55c 100644 --- a/VectoCore/VectoCore/Configuration/Constants.cs +++ b/VectoCore/VectoCore/Configuration/Constants.cs @@ -58,6 +58,10 @@ namespace TUGraz.VectoCore.Configuration public const string HeatingVentilationAirCondition = "AC"; public const string PneumaticSystem = "PS"; public const string PTOConsumer = "PTO_CONSUM"; + + public const string ENG_AUX_MECH_BASE = "ENG_AUX_BASE"; + public const string ENG_AUX_MECH_FAN = "ENG_AUX_FAN"; + public const string ENG_AUX_MECH_STP = "ENG_AUX_STP"; } public static class Names diff --git a/VectoCore/VectoCore/InputData/AuxiliaryFileHelper.cs b/VectoCore/VectoCore/InputData/AuxiliaryFileHelper.cs deleted file mode 100644 index 6e698320f2..0000000000 --- a/VectoCore/VectoCore/InputData/AuxiliaryFileHelper.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2019 European Union -* -* Developed by Graz University of Technology, -* Institute of Internal Combustion Engines and Thermodynamics, -* Institute of Technical Informatics -* -* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved -* by the European Commission - subsequent versions of the EUPL (the "Licence"); -* You may not use VECTO except in compliance with the Licence. -* You may obtain a copy of the Licence at: -* -* https://joinup.ec.europa.eu/community/eupl/og_page/eupl -* -* Unless required by applicable law or agreed to in writing, VECTO -* distributed under the Licence is distributed on an "AS IS" basis, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the Licence for the specific language governing permissions and -* limitations under the Licence. -* -* Authors: -* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology -* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology -* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology -* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology -* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology -* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology -*/ - -using System.Data; -using System.IO; -using System.Text; -using TUGraz.VectoCommon.Exceptions; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Impl; -using TUGraz.VectoCore.InputData.Reader.ComponentData; -using TUGraz.VectoCore.Utils; - -namespace TUGraz.VectoCore.InputData -{ - public static class AuxiliaryFileHelper - { - public static void FillAuxiliaryDataInputData(AuxiliaryDataInputData auxData, string auxFile) - { - try { - var stream = new StreamReader(auxFile); - stream.ReadLine(); // skip header "Transmission ration to engine rpm [-]" - auxData.TransmissionRatio = stream.ReadLine().IndulgentParse(); - stream.ReadLine(); // skip header "Efficiency to engine [-]" - auxData.EfficiencyToEngine = stream.ReadLine().IndulgentParse(); - stream.ReadLine(); // skip header "Efficiency auxiliary to supply [-]" - auxData.EfficiencyToSupply = stream.ReadLine().IndulgentParse(); - - var table = VectoCSVFile.ReadStream(new MemoryStream(Encoding.UTF8.GetBytes(stream.ReadToEnd())), source: auxFile); - foreach (DataRow row in table.Rows) { - if (AuxiliaryDataReader.HeaderIsValid(table.Columns)) { - row[AuxiliaryDataReader.Fields.MechPower] = - row.ParseDouble(AuxiliaryDataReader.Fields.MechPower).SI(Unit.SI.Kilo.Watt).Value(); - row[AuxiliaryDataReader.Fields.SupplyPower] = - row.ParseDouble(AuxiliaryDataReader.Fields.SupplyPower).SI(Unit.SI.Kilo.Watt).Value(); - } else { - row[1] = row.ParseDouble(1).SI(Unit.SI.Kilo.Watt).Value(); - row[2] = row.ParseDouble(2).SI(Unit.SI.Kilo.Watt).Value(); - } - } - auxData.DemandMap = table; - } catch (FileNotFoundException e) { - throw new VectoException("Auxiliary file not found: " + auxFile, e); - } - } - } -} \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs index 8cb6d1704f..31277dfa41 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs @@ -40,6 +40,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; +using TUGraz.VectoCore.InputData.Impl; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Utils; @@ -608,7 +609,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #region Implementation of IAuxiliariesEngineeringInputData - public IList<IAuxiliaryEngineeringInputData> Auxiliaries { get { return new List<IAuxiliaryEngineeringInputData>();} } + public IAuxiliaryEngineeringInputData Auxiliaries { get { return new EngineeringAuxiliaryDataInputData();} } public IBusAuxiliariesEngineeringData BusAuxiliariesData { get { return BusAux; } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index bbc4a830c9..0eecbdde6c 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -541,9 +541,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #region IAuxiliariesEngineeringInputData - IList<IAuxiliaryEngineeringInputData> IAuxiliariesEngineeringInputData.Auxiliaries + IAuxiliaryEngineeringInputData IAuxiliariesEngineeringInputData.Auxiliaries { - get { return AuxData().Cast<IAuxiliaryEngineeringInputData>().ToList(); } + get { return new EngineeringAuxiliaryDataInputData() { + ElectricPowerDemand = Body["Padd_electric"] != null ? Body.GetEx<double>("Padd_electric").SI<Watt>() : 0.SI<Watt>(), + ConstantPowerDemand = Body["Padd"] != null ? Body.GetEx<double>("Padd").SI<Watt>() : 0.SI<Watt>(), + PowerDemandICEOffDriving = Body["P_aux_ICEOff_Driving"] != null ? Body.GetEx<double>("P_aux_ICEOff_Driving").SI<Watt>() : 0.SI<Watt>(), + PowerDemandICEOffStandstill = Body["P_aux_ICEOff_Standstill"] != null ? Body.GetEx<double>("P_aux_ICEOff_Standstill").SI<Watt>() : 0.SI<Watt>() + }; } } public IBusAuxiliariesEngineeringData BusAuxiliariesData @@ -563,13 +568,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return AuxData().Cast<IAuxiliaryDeclarationInputData>().ToList(); } } - protected virtual IList<AuxiliaryDataInputData> AuxData() + protected virtual IList<IAuxiliaryDeclarationInputData> AuxData() { - var retVal = new List<AuxiliaryDataInputData>(); + var retVal = new List<IAuxiliaryDeclarationInputData>(); foreach (var aux in Body["Aux"] ?? Enumerable.Empty<JToken>()) { var type = AuxiliaryTypeHelper.Parse(aux.GetEx<string>("Type")); - var auxData = new AuxiliaryDataInputData { + var auxData = new DeclarationAuxiliaryDataInputData() { ID = aux.GetEx<string>("ID"), Type = type, Technology = new List<string>(), @@ -592,16 +597,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON auxData.Technology.Add(MapLegacyFanTechnologies(tech)); } - var auxFile = aux["Path"]; retVal.Add(auxData); - - if (auxFile == null || EmptyOrInvalidFileName(auxFile.Value<string>())) { - continue; - } - - AuxiliaryFileHelper.FillAuxiliaryDataInputData( - auxData, - Path.Combine(BasePath, auxFile.Value<string>())); } return retVal; @@ -630,14 +626,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion - - public Watt ElectricAuxPower - { - get - { - return Body["Padd_electric"] != null ? Body.GetEx<double>("Padd_electric").SI<Watt>() : 0.SI<Watt>(); - } - } } public class JSONInputDataV2 : AbstractJSONInputData @@ -666,17 +654,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public JSONInputDataV3(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { } - protected override IList<AuxiliaryDataInputData> AuxData() + protected override IList<IAuxiliaryDeclarationInputData> AuxData() { - var retVal = new List<AuxiliaryDataInputData>(); - if (Body["Padd"] != null) { - retVal.Add( - new AuxiliaryDataInputData() { - ID = "ConstantAux", - AuxiliaryType = AuxiliaryDemandType.Constant, - ConstantPowerDemand = Body.GetEx<double>("Padd").SI<Watt>() - }); - } + var retVal = new List<IAuxiliaryDeclarationInputData>(); + foreach (var aux in Body["Aux"] ?? Enumerable.Empty<JToken>()) { try { aux.GetEx("Technology").ToObject<List<string>>(); @@ -688,22 +669,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON var type = AuxiliaryTypeHelper.Parse(aux.GetEx<string>("Type")); - var auxData = new AuxiliaryDataInputData { + var auxData = new DeclarationAuxiliaryDataInputData { ID = aux.GetEx<string>("ID"), Type = type, Technology = aux.GetEx("Technology").ToObject<List<string>>() }; - var auxFile = aux["Path"]; + retVal.Add(auxData); - if (auxFile == null || EmptyOrInvalidFileName(auxFile.Value<string>())) { - continue; - } - - AuxiliaryFileHelper.FillAuxiliaryDataInputData( - auxData, - Path.Combine(BasePath, auxFile.Value<string>())); } return retVal; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLAuxiliaryDeclarationDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLAuxiliaryDeclarationDataProvider.cs index 468a93f952..71cd81be7b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLAuxiliaryDeclarationDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLAuxiliaryDeclarationDataProvider.cs @@ -25,6 +25,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region Implementation of IAuxiliaryDeclarationInputData + public virtual AuxiliaryType Type { get { return _type ?? (_type = BaseNode.LocalName.ParseEnum<AuxiliaryType>()).Value; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringAuxiliariesDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringAuxiliariesDataProvider.cs index 7133d69739..5c9f857439 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringAuxiliariesDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringAuxiliariesDataProvider.cs @@ -32,21 +32,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider #region Implementation of IAuxiliariesEngineeringInputData - public virtual IList<IAuxiliaryEngineeringInputData> Auxiliaries + public virtual IAuxiliaryEngineeringInputData Auxiliaries { - get { - var auxNodes = GetNodes(XMLNames.Auxiliaries_Auxiliary); - if (auxNodes == null || auxNodes.Count == 0) { - return new List<IAuxiliaryEngineeringInputData>(); - } - - var retVal = new List<IAuxiliaryEngineeringInputData>(); - foreach (XmlNode auxNode in auxNodes) { - retVal.Add(Reader.CreateAuxiliary(auxNode)); - } - - return retVal; - } + get; } public IBusAuxiliariesEngineeringData BusAuxiliariesData @@ -89,114 +77,26 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider protected string BasePath; - protected AuxiliaryDataInputData AuxData; - public XMLAuxiliaryEngineeringDataV07(XmlNode node, string basePath) : base(node) { BasePath = basePath; - //ReadAuxData(); - } - - protected virtual AuxiliaryDataInputData ReadAuxData() - { - var id = BaseNode.Attributes?.GetNamedItem("id")?.InnerText ?? ""; - var childNode = BaseNode.SelectSingleNode("./*"); - if (childNode == null) { - throw new VectoException("No auxiliary data found! ID: {0}", id); - } - - if (childNode.LocalName == XMLNames.ExternalResource) { - var auxFile = childNode.Attributes?.GetNamedItem(XMLNames.ExtResource_File_Attr).InnerText; - if (string.IsNullOrWhiteSpace(auxFile) || !File.Exists(Path.Combine(BasePath, auxFile))) { - throw new VectoException("Auxiliary resource file {0} not found! Aux: {1}", auxFile, id); - } - - var retVal = new AuxiliaryDataInputData() { - AuxiliaryType = AuxiliaryDemandType.Mapping, - ID = id, - DataSource = - new DataSource() { SourceType = DataSourceType.CSVFile, SourceVersion = "0", SourceFile = auxFile } - }; - AuxiliaryFileHelper.FillAuxiliaryDataInputData(retVal, Path.Combine(BasePath, auxFile)); - return retVal; - } - - if (childNode.LocalName == XMLNames.Auxiliaries_Auxiliary_ConstantAuxLoad) { - return new AuxiliaryDataInputData { - ID = "ConstantAux", - AuxiliaryType = AuxiliaryDemandType.Constant, - ConstantPowerDemand = childNode.InnerText.ToDouble().SI<Watt>(), - DataSource = - new DataSource() { SourceType = DataSourceType.XMLEmbedded, SourceVersion = XMLHelper.GetVersionFromNamespaceUri(SchemaNamespace) } - }; - } - - return new AuxiliaryDataInputData() { - AuxiliaryType = AuxiliaryDemandType.Mapping, - ID = id, - TransmissionRatio = - BaseNode.SelectSingleNode(XMLHelper.QueryLocalName(XMLNames.Auxiliaries_Auxiliary_TransmissionRatioToEngine)) - ?.InnerText - .ToDouble() ?? 0, - EfficiencyToEngine = - BaseNode.SelectSingleNode(XMLHelper.QueryLocalName(XMLNames.Auxiliaries_Auxiliary_EfficiencyToEngine))?.InnerText - .ToDouble() ?? 0, - EfficiencyToSupply = - BaseNode.SelectSingleNode(XMLHelper.QueryLocalName(XMLNames.Auxiliaries_Auxiliary_EfficiencyAuxSupply))?.InnerText - .ToDouble() ?? 0, - DemandMap = XMLHelper.ReadTableData( - AttributeMappings.AuxMapMapping, - BaseNode.SelectNodes( - XMLHelper.QueryLocalName(XMLNames.Auxiliaries_Auxiliary_AuxMap, XMLNames.Auxiliaries_Auxiliary_AuxMap_Entry))), - DataSource = - new DataSource() { SourceType = DataSourceType.XMLEmbedded, SourceVersion = XMLHelper.GetVersionFromNamespaceUri(SchemaNamespace) } - }; } protected virtual XNamespace SchemaNamespace { get { return NAMESPACE_URI; } } #region Implementation of IAuxiliaryEngineeringInputData - public virtual string ID - { - get { return AuxData?.ID ?? (AuxData = ReadAuxData()).ID; } - } - - public virtual AuxiliaryDemandType AuxiliaryType - { - get { return AuxData?.AuxiliaryType ?? (AuxData = ReadAuxData()).AuxiliaryType; } - } - - public virtual double TransmissionRatio - { - get { return AuxData?.TransmissionRatio ?? (AuxData = ReadAuxData()).TransmissionRatio; } - } - - public virtual double EfficiencyToEngine - { - get { return AuxData?.EfficiencyToEngine ?? (AuxData = ReadAuxData()).EfficiencyToEngine; } - } - - public virtual double EfficiencyToSupply - { - get { return AuxData?.EfficiencyToSupply ?? (AuxData = ReadAuxData()).EfficiencyToSupply; } - } - - public virtual TableData DemandMap - { - get { return AuxData?.DemandMap ?? (AuxData = ReadAuxData()).DemandMap; } - } public virtual Watt ConstantPowerDemand { - get { return AuxData?.ConstantPowerDemand ?? (AuxData = ReadAuxData()).ConstantPowerDemand; } + get; } - public DataSource DataSource - { - get { return AuxData?.DataSource ?? (AuxData = ReadAuxData()).DataSource; } - } + public Watt PowerDemandICEOffDriving { get; } + public Watt PowerDemandICEOffStandstill { get; } + public Watt ElectricPowerDemand { get; } + #endregion } diff --git a/VectoCore/VectoCore/InputData/Impl/InputData.cs b/VectoCore/VectoCore/InputData/Impl/InputData.cs index 77dfdf95c1..3974a33de4 100644 --- a/VectoCore/VectoCore/InputData/Impl/InputData.cs +++ b/VectoCore/VectoCore/InputData/Impl/InputData.cs @@ -156,12 +156,11 @@ namespace TUGraz.VectoCore.InputData.Impl public Meter DynamicTyreRadius { get; internal set; } } - public class AuxiliaryDataInputData : IAuxiliaryEngineeringInputData, IAuxiliaryDeclarationInputData + public class DeclarationAuxiliaryDataInputData : IAuxiliaryDeclarationInputData { - public AuxiliaryDataInputData() + public DeclarationAuxiliaryDataInputData() { - AuxiliaryType = AuxiliaryDemandType.Mapping; - ConstantPowerDemand = 0.SI<Watt>(); + AuxiliaryType = AuxiliaryDemandType.Constant; } public AuxiliaryDemandType AuxiliaryType { get; internal set; } @@ -172,19 +171,28 @@ namespace TUGraz.VectoCore.InputData.Impl public IList<string> Technology { get; set; } - public double TransmissionRatio { get; internal set; } - public double EfficiencyToEngine { get; internal set; } + } + + public class EngineeringAuxiliaryDataInputData : IAuxiliaryEngineeringInputData + { + public EngineeringAuxiliaryDataInputData() + { + AuxiliaryType = AuxiliaryDemandType.Constant; + ConstantPowerDemand = 0.SI<Watt>(); + } - public double EfficiencyToSupply { get; internal set; } + public AuxiliaryDemandType AuxiliaryType { get; internal set; } - public TableData DemandMap { get; internal set; } + public string ID { get; internal set; } public Watt ConstantPowerDemand { get; internal set; } - - public DataSource DataSource { get; internal set; } + public Watt PowerDemandICEOffDriving { get; internal set; } + public Watt PowerDemandICEOffStandstill { get; internal set; } + public Watt ElectricPowerDemand { get; internal set; } } + public class TorqueLimitInputData : ITorqueLimitInputData { public int Gear { get; internal set; } diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs deleted file mode 100644 index 480bdbea93..0000000000 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2019 European Union -* -* Developed by Graz University of Technology, -* Institute of Internal Combustion Engines and Thermodynamics, -* Institute of Technical Informatics -* -* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved -* by the European Commission - subsequent versions of the EUPL (the "Licence"); -* You may not use VECTO except in compliance with the Licence. -* You may obtain a copy of the Licence at: -* -* https://joinup.ec.europa.eu/community/eupl/og_page/eupl -* -* Unless required by applicable law or agreed to in writing, VECTO -* distributed under the Licence is distributed on an "AS IS" basis, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the Licence for the specific language governing permissions and -* limitations under the Licence. -* -* Authors: -* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology -* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology -* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology -* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology -* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology -* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology -*/ - -using System.Data; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent.Data; -using TUGraz.VectoCore.Utils; - -namespace TUGraz.VectoCore.InputData.Reader.ComponentData -{ - /// <summary> - /// Reads the auxiliary demand map. - /// </summary> - public static class AuxiliaryDataReader - { - /// <summary> - /// Factory method. - /// </summary> - /// <param name="data"></param> - /// <returns></returns> - public static AuxiliaryData Create(IAuxiliaryEngineeringInputData data) - { - var map = ReadAuxMap(data.ID, data.DemandMap); - return new AuxiliaryData(data.ID, data.TransmissionRatio, data.EfficiencyToEngine, data.EfficiencyToSupply, map); - } - - private static DelaunayMap ReadAuxMap(string id, DataTable table) - { - var map = new DelaunayMap(id); - if (HeaderIsValid(table.Columns)) { - FillFromColumnNames(table, map); - } else { - FillFromColumnIndizes(table, map); - } - - map.Triangulate(); - return map; - } - - private static void FillFromColumnIndizes(DataTable table, DelaunayMap map) - { - for (var i = 0; i < table.Rows.Count; i++) { - var row = table.Rows[i]; - map.AddPoint(row.ParseDouble(0).RPMtoRad().Value(), row.ParseDouble(2), row.ParseDouble(1)); - } - } - - private static void FillFromColumnNames(DataTable table, DelaunayMap map) - { - for (var i = 0; i < table.Rows.Count; i++) { - var row = table.Rows[i]; - map.AddPoint(row.ParseDouble(Fields.AuxSpeed).RPMtoRad().Value(), row.ParseDouble(Fields.SupplyPower), - row.ParseDouble(Fields.MechPower)); - } - } - - public static bool HeaderIsValid(DataColumnCollection columns) - { - return columns.Contains(Fields.AuxSpeed) && columns.Contains(Fields.MechPower) && - columns.Contains(Fields.SupplyPower); - } - - internal static class Fields - { - /// <summary>[1/min]</summary> - public const string AuxSpeed = "Auxiliary speed"; - - /// <summary>[kW]</summary> - public const string MechPower = "Mechanical power"; - - /// <summary>[kW]</summary> - public const string SupplyPower = "Supply power"; - } - } -} \ 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 ec5c2ff54c..75cb67d62a 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -409,51 +409,23 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter public IList<VectoRunData.AuxData> CreateAuxiliaryData(IAuxiliariesEngineeringInputData auxInputData) { - var auxList = new List<VectoRunData.AuxData>(auxInputData.Auxiliaries.Count + 1) { - new VectoRunData.AuxData { ID = Constants.Auxiliaries.Cycle, DemandType = AuxiliaryDemandType.Direct } + var pwrICEOn = auxInputData.Auxiliaries.ConstantPowerDemand; + var pwrICEOffDriving = auxInputData.Auxiliaries.PowerDemandICEOffDriving; + var pwrICEOffStandstill = auxInputData.Auxiliaries.PowerDemandICEOffStandstill; + + var baseDemand = pwrICEOffStandstill; + var stpDemand = pwrICEOffDriving - baseDemand; + var fanDemand = pwrICEOn - stpDemand; + + var auxList = new List<VectoRunData.AuxData>() { + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_BASE, DemandType = AuxiliaryDemandType.Constant, PowerDemand = baseDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP, DemandType = AuxiliaryDemandType.Constant, PowerDemand = stpDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, DemandType = AuxiliaryDemandType.Constant, PowerDemand = fanDemand}, }; - foreach (var a in auxInputData.Auxiliaries) { - switch (a.AuxiliaryType) { - case AuxiliaryDemandType.Mapping: - auxList.Add(CreateMappingAuxiliary(a)); - break; - case AuxiliaryDemandType.Constant: - auxList.Add(CreateConstantAuxiliary(a)); - break; - default: throw new VectoException("Auxiliary type {0} not supported!", a.AuxiliaryType); - } - } - return auxList; } - private static VectoRunData.AuxData CreateMappingAuxiliary(IAuxiliaryEngineeringInputData a) - { - if (a.DemandMap == null) { - throw new VectoSimulationException("Demand Map for auxiliary {0} required", a.ID); - } - if (a.DemandMap.Columns.Count != 3 || a.DemandMap.Rows.Count < 4) { - throw new VectoSimulationException( - "Demand Map for auxiliary {0} has to contain exactly 3 columns and at least 4 rows", a.ID); - } - - return new VectoRunData.AuxData { - ID = a.ID, - DemandType = AuxiliaryDemandType.Mapping, - Data = AuxiliaryDataReader.Create(a) - }; - } - - private static VectoRunData.AuxData CreateConstantAuxiliary(IAuxiliaryEngineeringInputData a) - { - return new VectoRunData.AuxData { - ID = a.ID, - DemandType = AuxiliaryDemandType.Constant, - PowerDemand = a.ConstantPowerDemand - }; - } - internal DriverData CreateDriverData(IDriverEngineeringInputData driver) { if (driver.SavedInDeclarationMode) { diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs index de42510217..261d2b9ebc 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs @@ -158,7 +158,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl SimulationType = SimulationType.DistanceCycle | SimulationType.MeasuredSpeedCycle | SimulationType.PWheel, GearshiftParameters = gearshiftParams, ShiftStrategy = InputDataProvider.JobInputData.ShiftStrategy, - ElectricAuxDemand = InputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData.ElectricAuxPower, + ElectricAuxDemand = InputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries.ElectricPowerDemand, }; } } @@ -241,7 +241,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl gearboxData.Type, InputDataProvider.DriverInputData.GearshiftInputData, axlegearData.AxleGear.Ratio * (angledriveData?.Angledrive.Ratio ?? 1.0), engineData.IdleSpeed), ShiftStrategy = InputDataProvider.JobInputData.ShiftStrategy, - ElectricAuxDemand = InputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData.ElectricAuxPower, + ElectricAuxDemand = InputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries.ElectricPowerDemand, }; } } diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index 90f7ae3d01..a64079e7fd 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -162,7 +162,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [Required] public AuxiliaryDemandType DemandType; - [ValidateObject] public AuxiliaryData Data; public MissionType? MissionType; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index 3a50d6df12..22f2870826 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -225,9 +225,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl aux.AddCycle(id, auxData.PowerDemandFunc); } break; - case AuxiliaryDemandType.Mapping: - aux.AddMapping(id, auxData.Data); - break; default: throw new ArgumentOutOfRangeException("AuxiliaryDemandType", auxData.DemandType.ToString()); } @@ -841,9 +838,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl case AuxiliaryDemandType.Direct: aux.AddCycle(id); break; - case AuxiliaryDemandType.Mapping: - aux.AddMapping(id, auxData.Data); - break; default: throw new ArgumentOutOfRangeException("AuxiliaryDemandType", auxData.DemandType.ToString()); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs deleted file mode 100644 index 3cc5f1f74b..0000000000 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2019 European Union -* -* Developed by Graz University of Technology, -* Institute of Internal Combustion Engines and Thermodynamics, -* Institute of Technical Informatics -* -* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved -* by the European Commission - subsequent versions of the EUPL (the "Licence"); -* You may not use VECTO except in compliance with the Licence. -* You may obtain a copy of the Licence at: -* -* https://joinup.ec.europa.eu/community/eupl/og_page/eupl -* -* Unless required by applicable law or agreed to in writing, VECTO -* distributed under the Licence is distributed on an "AS IS" basis, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the Licence for the specific language governing permissions and -* limitations under the Licence. -* -* Authors: -* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology -* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology -* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology -* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology -* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology -* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology -*/ - -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader.ComponentData; -using TUGraz.VectoCore.Utils; - -namespace TUGraz.VectoCore.Models.SimulationComponent.Data -{ - [CustomValidation(typeof(AuxiliaryData), "ValidateAuxMap")] - public sealed class AuxiliaryData - { - [Required, Range(double.Epsilon, 1)] - public double EfficiencyToSupply { get; private set; } - - [Required, Range(double.Epsilon, double.MaxValue)] - public double TransmissionRatio { get; private set; } - - [Required, Range(double.Epsilon, 1)] - public double EfficiencyToEngine { get; private set; } - - [Required] private readonly DelaunayMap _map; - - private string auxId; - - public Watt GetPowerDemand(PerSecond nAuxiliary, Watt powerAuxOut) - { - var value = _map.Interpolate(nAuxiliary.Value(), powerAuxOut.Value()); - if (value.HasValue) { - return value.Value.SI<Watt>(); - } - value = _map.Extrapolate(nAuxiliary.Value(), powerAuxOut.Value()); - return value.Value.SI<Watt>(); - } - - internal AuxiliaryData(string id, double transmissionRatio, double efficiencyToEngine, double efficiencyToSupply, - DelaunayMap map) - { - auxId = id; - _map = map; - TransmissionRatio = transmissionRatio; - EfficiencyToEngine = efficiencyToEngine; - EfficiencyToSupply = efficiencyToSupply; - } - - /// <summary> - /// Validates the aux map. - /// </summary> - /// <param name="data">The data.</param> - /// <param name="context">The validation context.</param> - /// <returns></returns> - // ReSharper disable once UnusedMember.Global - public static ValidationResult ValidateAuxMap(AuxiliaryData data, ValidationContext context) - { - var xValidationRules = new[] { new RangeAttribute(0, double.MaxValue) }; - var yValidationRules = new[] { new RangeAttribute(0, 100.SI(Unit.SI.Kilo.Watt).Value()) }; - var zValidationRules = new[] { new RangeAttribute(0, 100.SI(Unit.SI.Kilo.Watt).Value()) }; - - var results = new List<ValidationResult>(); - foreach (var entry in data._map.Entries) { - context.DisplayName = AuxiliaryDataReader.Fields.AuxSpeed; - if (!Validator.TryValidateValue(entry.X, context, results, xValidationRules)) { - return new ValidationResult(string.Concat(results)); - } - - context.DisplayName = AuxiliaryDataReader.Fields.SupplyPower; - if (!Validator.TryValidateValue(entry.Y, context, results, yValidationRules)) { - return new ValidationResult(string.Concat(results)); - } - - context.DisplayName = AuxiliaryDataReader.Fields.MechPower; - if (!Validator.TryValidateValue(entry.Z, context, results, zValidationRules)) { - return new ValidationResult(string.Concat(results)); - } - } - return ValidationResult.Success; - } - } - - -} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs index 86a8fb2fd4..580f6bad25 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs @@ -142,8 +142,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public Watt PowerDemandEngineOff(Second absTime, Second dt) { - var conventionalAux = AdditionalAux; - AdditionalAux = null; + CurrentState.AngularSpeed = DataBus.EngineInfo.EngineIdleSpeed; CurrentState.dt = dt; @@ -153,6 +152,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl signals.EngineStopped = false; signals.VehicleStopped = false; + // get busaux PowerDemand without additional Auxiliaries first. + var conventionalAux = AdditionalAux; + AdditionalAux = null; var busAuxPowerDemand = GetBusAuxPowerDemand( absTime, dt, 0.SI<NewtonMeter>(), DataBus.EngineInfo.EngineIdleSpeed); AdditionalAux = conventionalAux; @@ -292,7 +294,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public Second dt; public PerSecond AngularSpeed; - public Watt PowerDemand; + public Watt PowerDemand { get; set; } public Watt ExcessiveDragPower = 0.SI<Watt>(); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs index 5e1c0b2c85..c5cb189dc8 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs @@ -87,29 +87,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Add(auxId, _ => powerLossFunc(DataBus.DrivingCycleInfo.CycleData.LeftSample)); } - /// <summary> - /// Adds an auxiliary which calculates the demand based on a aux-map and the engine speed. - /// </summary> - /// <param name="auxId"></param> - /// <param name="data"></param> - public void AddMapping(string auxId, AuxiliaryData data) - { - if (!DataBus.DrivingCycleInfo.CycleData.LeftSample.AuxiliarySupplyPower.ContainsKey(auxId)) { - var error = string.Format("driving cycle does not contain column for auxiliary: {0}", - Constants.Auxiliaries.Prefix + auxId); - Log.Error(error); - throw new VectoException(error); - } - - Add(auxId, speed => { - var powerSupply = DataBus.DrivingCycleInfo.CycleData.LeftSample.AuxiliarySupplyPower[auxId]; - var nAuxiliary = speed * data.TransmissionRatio; - var powerAuxOut = powerSupply / data.EfficiencyToSupply; - var powerAuxIn = data.GetPowerDemand(nAuxiliary, powerAuxOut); - return powerAuxIn / data.EfficiencyToEngine; - }); - } - + /// <summary> /// Adds an auxiliary with a function returning the power demand based on the engine speed. /// </summary> @@ -158,10 +136,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var auxiliarieIgnoredDuringVehicleStop = new[] { Constants.Auxiliaries.IDs.SteeringPump, Constants.Auxiliaries.IDs.Fan, - Constants.Auxiliaries.IDs.PTOConsumer, Constants.Auxiliaries.IDs.PTOTransmission + Constants.Auxiliaries.IDs.PTOConsumer, Constants.Auxiliaries.IDs.PTOTransmission, + Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP }; var auxiliarieIgnoredDuringDrive = new[] { Constants.Auxiliaries.IDs.Fan, + Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN }; var powerDemands = new Dictionary<string, Watt>(Auxiliaries.Count); var engineOffDemand = 0.SI<Watt>(); diff --git a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs index a12fbe17af..c841eef11a 100644 --- a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs +++ b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs @@ -628,49 +628,44 @@ public class JSONFileWriter : IOutputFileWriter } body.Add("ShiftStrategy", input.JobInputData.ShiftStrategy); body.Add("HybridStrategyParams", GetRelativePath(input.JobInputData.HybridStrategyParameters.Source, basePath)); - var aux = job.Vehicle.Components.AuxiliaryInputData; - - var pAdd = 0.0; - var pAddEl = 0.0; var auxList = new List<object>(); - foreach (var auxEntry in aux.Auxiliaries) - { - if (auxEntry.AuxiliaryType == AuxiliaryDemandType.Constant) - { - if (auxEntry.ID == "ConstantAuxEL") { - pAddEl += auxEntry.ConstantPowerDemand.Value(); + if (job.SavedInDeclarationMode && job.Vehicle is IVehicleDeclarationInputData declVehicle) { + var aux = declVehicle.Components.AuxiliaryInputData; + foreach (var auxEntry in aux.Auxiliaries) { + + var auxOut = new Dictionary<string, object>(); + var engineeringAuxEntry = auxEntry as IAuxiliaryDeclarationInputData; + if (!job.SavedInDeclarationMode) { + auxOut.Add("Type", auxEntry.Type.Name()); + auxOut.Add("Technology", new string[] { }); } else { - pAdd += auxEntry.ConstantPowerDemand.Value(); + auxOut.Add("Type", auxEntry.Type.Name()); + auxOut.Add("Technology", engineeringAuxEntry.Technology); } - continue; - } - var auxOut = new Dictionary<string, object>(); - var engineeringAuxEntry = auxEntry as IAuxiliaryDeclarationInputData; - if (!job.SavedInDeclarationMode) - { - auxOut.Add("ID", auxEntry.ID); - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()); - auxOut.Add("Path", GetRelativePath(auxEntry.DemandMap.Source, basePath)); - auxOut.Add("Technology", new string[] { }); + auxList.Add(auxOut); } - else - { - auxOut.Add("ID", auxEntry.ID); - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()); - auxOut.Add("Technology", engineeringAuxEntry.Technology); + if (declVehicle.Components.BusAuxiliaries != null) { + body.Add("BusAux", GetRelativePath(job.Vehicle.Components.AuxiliaryInputData.BusAuxiliariesData.DataSource.SourceFile, basePath)); } - auxList.Add(auxOut); + body.Add("Aux", auxList); } - if (aux.BusAuxiliariesData != null) { - body.Add("BusAux", GetRelativePath(job.Vehicle.Components.AuxiliaryInputData.BusAuxiliariesData.DataSource.SourceFile, basePath)); - } - body.Add("Aux", auxList); - if (!job.SavedInDeclarationMode) { - body.Add("Padd", pAdd); - body.Add("Padd_electric", pAddEl); + + + if (!job.SavedInDeclarationMode && job.Vehicle is IVehicleEngineeringInputData engVehicle) { + var aux = engVehicle.Components.AuxiliaryInputData; + if (aux.BusAuxiliariesData != null) { + body.Add("BusAux", + GetRelativePath(job.Vehicle.Components.AuxiliaryInputData.BusAuxiliariesData.DataSource.SourceFile, + basePath)); + } + + body.Add("Padd", aux.Auxiliaries.ConstantPowerDemand.Value()); + body.Add("Paux_ICEOff_Driving", aux.Auxiliaries.PowerDemandICEOffDriving.Value()); + body.Add("Paux_ICEOff_Standstill", aux.Auxiliaries.PowerDemandICEOffStandstill.Value()); + body.Add("Padd_electric", aux.Auxiliaries.ElectricPowerDemand); } var driver = input.DriverInputData; @@ -769,7 +764,7 @@ public class JSONFileWriter : IOutputFileWriter basePath)); body.Add("TCU", GetRelativePath(input.DriverInputData.GearshiftInputData.Source, basePath)); } - body.Add("Padd_electric", input.JobInputData.Vehicle.Components.AuxiliaryInputData.ElectricAuxPower.Value()); + body.Add("Padd_electric", input.JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries.ElectricPowerDemand.Value()); //if (!job.SavedInDeclarationMode) // { @@ -939,37 +934,40 @@ public class JSONFileWriter : IOutputFileWriter } body.Add("ShiftStrategy", input.JobInputData.ShiftStrategy); - var aux = job.Vehicle.Components.AuxiliaryInputData; - var pAdd = 0.0; - var auxList = new List<object>(); - foreach (var auxEntry in aux.Auxiliaries) { - if (auxEntry.AuxiliaryType == AuxiliaryDemandType.Constant) { - pAdd += auxEntry.ConstantPowerDemand.Value(); - continue; - } + if (job.SavedInDeclarationMode && job.Vehicle is IVehicleDeclarationInputData declVehicle) { + var aux = declVehicle.Components.AuxiliaryInputData; + var auxList = new List<object>(); + foreach (var auxEntry in aux.Auxiliaries) { + var auxOut = new Dictionary<string, object>(); + var engineeringAuxEntry = auxEntry; + if (!job.SavedInDeclarationMode) { + auxOut.Add("Type", auxEntry.Type.Name()); + auxOut.Add("Technology", new string[] { }); + } else { + auxOut.Add("Type", auxEntry.Type.Name()); + auxOut.Add("Technology", engineeringAuxEntry.Technology); + } - var auxOut = new Dictionary<string, object>(); - var engineeringAuxEntry = auxEntry as IAuxiliaryDeclarationInputData; - if (!job.SavedInDeclarationMode) { - auxOut.Add("ID", auxEntry.ID); - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()); - auxOut.Add("Path", GetRelativePath(auxEntry.DemandMap.Source, basePath)); - auxOut.Add("Technology", new string[] { }); - } else { - auxOut.Add("ID", auxEntry.ID); - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()); - auxOut.Add("Technology", engineeringAuxEntry.Technology); + auxList.Add(auxOut); + body.Add("Aux", auxList); } - auxList.Add(auxOut); + + } - if (aux.BusAuxiliariesData != null) { - body.Add("BusAux", GetRelativePath(job.Vehicle.Components.AuxiliaryInputData.BusAuxiliariesData.DataSource.SourceFile, basePath)); + if (!job.SavedInDeclarationMode && job.Vehicle is IVehicleEngineeringInputData engVehicle) { + var aux = engVehicle.Components.AuxiliaryInputData; + if (aux.BusAuxiliariesData != null) { + body.Add("BusAux", + GetRelativePath(job.Vehicle.Components.AuxiliaryInputData.BusAuxiliariesData.DataSource.SourceFile, + basePath)); + } + + body.Add("Padd", aux.Auxiliaries.ConstantPowerDemand.Value()); + body.Add("Paux_ICEOff_Driving", aux.Auxiliaries.PowerDemandICEOffDriving.Value()); + body.Add("Paux_ICEOff_Standstill", aux.Auxiliaries.PowerDemandICEOffStandstill.Value()); } - body.Add("Aux", auxList); - if (!job.SavedInDeclarationMode) - body.Add("Padd", pAdd); var driver = input.DriverInputData; diff --git a/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs b/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs index bc61e570ba..4576cdee15 100644 --- a/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs +++ b/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs @@ -64,12 +64,6 @@ namespace TUGraz.IVT.VectoXML { ShiftPolygonReader.Fields.AngularSpeedUp, XMLNames.Gear_ShiftPolygonMapping_UpshiftSpeed_Attr } }; - public static readonly Dictionary<string, string> AuxMapMapping = new Dictionary<string, string>() { - { AuxiliaryDataReader.Fields.AuxSpeed, XMLNames.Aux_AuxMap_AuxiliarySpeed_Attr }, - { AuxiliaryDataReader.Fields.MechPower, XMLNames.Aux_AuxMap_MechanicalPower_Attr }, - { AuxiliaryDataReader.Fields.SupplyPower, XMLNames.Auxr_AuxMapMapping_SupplyPower_Attr } - }; - public static readonly Dictionary<string, string> RetarderLossmapMapping = new Dictionary<string, string> { { RetarderLossMapReader.Fields.RetarderSpeed, XMLNames.Retarder_RetarderLossmap_RetarderSpeed_Attr }, { RetarderLossMapReader.Fields.TorqueLoss, XMLNames.Retarder_RetarderLossmap_TorqueLoss_Attr } diff --git a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringComponentsWriter.cs b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringComponentsWriter.cs index 271868d89b..bd50b6be3b 100644 --- a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringComponentsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringComponentsWriter.cs @@ -68,8 +68,8 @@ namespace TUGraz.VectoCore.OutputData.XML.Engineering.Writer v10 + XMLNames.Component_Auxiliaries, new XElement( v10 + XMLNames.ComponentDataWrapper, - componentWriter.GetXMLTypeAttribute(), - auxData.Auxiliaries.Select(a => Factory.GetWriter(a, Writer, a.DataSource).WriteXML(a)).ToArray() + componentWriter.GetXMLTypeAttribute() + //auxData.Auxiliaries.Select(a => Factory.GetWriter(a, Writer, a.DataSource).WriteXML(a)).ToArray() ) ); } diff --git a/VectoCore/VectoCore/Utils/VectoVersionCore.cs b/VectoCore/VectoCore/Utils/VectoVersionCore.cs index 27fb2477c8..c001707fe9 100644 --- a/VectoCore/VectoCore/Utils/VectoVersionCore.cs +++ b/VectoCore/VectoCore/Utils/VectoVersionCore.cs @@ -47,7 +47,7 @@ namespace TUGraz.VectoCore.Utils public static string VersionNumber { get { - return "0.7.3.2171" + SUFFIX; + return "0.7.3.2247" + SUFFIX; } } diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 92f63e4113..e5df7512d9 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -137,7 +137,6 @@ </ItemGroup> <ItemGroup> <Compile Include="Configuration\Constants.cs" /> - <Compile Include="InputData\AuxiliaryFileHelper.cs" /> <Compile Include="InputData\FileIO\JSON\BusAuxiliaryInputData.cs" /> <Compile Include="InputData\FileIO\JSON\IJSONVehicleComponents.cs" /> <Compile Include="InputData\FileIO\JSON\JSONBattery.cs" /> @@ -491,7 +490,6 @@ <Compile Include="InputData\Impl\InputData.cs" /> <Compile Include="InputData\IVectoRunDataFactory.cs" /> <Compile Include="InputData\Reader\ComponentData\AccelerationCurveReader.cs" /> - <Compile Include="InputData\Reader\ComponentData\AuxiliaryDataReader.cs" /> <Compile Include="InputData\Reader\ComponentData\CrossWindCorrectionCurveReader.cs" /> <Compile Include="InputData\Reader\ComponentData\PTOIdleLossMapReader.cs" /> <Compile Include="InputData\Reader\ComponentData\RetarderLossMapReader.cs" /> @@ -595,7 +593,6 @@ <Compile Include="Models\Declaration\Wheels.cs" /> <Compile Include="Models\Declaration\WHTCCorrection.cs" /> <Compile Include="Models\SimulationComponent\Data\CrosswindCorrectionCdxALookup.cs" /> - <Compile Include="Models\SimulationComponent\Data\AuxiliaryData.cs" /> <Compile Include="Models\SimulationComponent\Data\AuxSupplyPowerReader.cs" /> <Compile Include="Models\SimulationComponent\Data\AxleGearData.cs" /> <Compile Include="Models\SimulationComponent\Data\CycleData.cs" /> diff --git a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs index 97ef3817a0..5a2b62203f 100644 --- a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs @@ -117,8 +117,11 @@ namespace TUGraz.VectoCore.Tests.FileIO ((JObject)json["Body"]).Property("Aux").Remove(); // MK,2016-01-20: Changed for PWheel: aux entry may be missing, and that is ok. + // MQ,2021-03-02: refactoring aux: remove mapping and only have 3 fixed values var tmp = new JSONInputDataV2(json, TestJobFile).JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries; - Assert.IsTrue(tmp.Count == 0); + Assert.AreEqual(0, tmp.ConstantPowerDemand.Value()); + Assert.AreEqual(0, tmp.PowerDemandICEOffDriving.Value()); + Assert.AreEqual(0, tmp.PowerDemandICEOffStandstill.Value()); } [TestCase] diff --git a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs index d2d6ffeed8..783f9a7fa4 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs @@ -205,11 +205,10 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation } } - [TestCase] + [TestCase] // todo: update expected values as no mapping aux is used public void AuxAllCombined() { var dataWriter = new MockModalDataContainer(); - dataWriter.AddAuxiliary("ALT1"); dataWriter.AddAuxiliary("CONSTANT"); var container = new VehicleContainer(ExecutionMode.Engineering, dataWriter); @@ -223,19 +222,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var aux = new EngineAuxiliary(container); - var auxDataInputData = new AuxiliaryDataInputData { - ID = "ALT1", - Type = AuxiliaryType.ElectricSystem, - Technology = new List<string>(), - }; - AuxiliaryFileHelper.FillAuxiliaryDataInputData(auxDataInputData, @"TestData\Components\24t_Coach_ALT.vaux"); - var auxData = AuxiliaryDataReader.Create(auxDataInputData); - - // ratio = 4.078 - // efficiency_engine = 0.96 - // efficiency_supply = 0.98 - aux.AddMapping("ALT1", auxData); aux.AddCycle("CYCLE"); var constPower = 1200.SI<Watt>(); aux.AddConstant("CONSTANT", constPower); @@ -270,13 +257,12 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation } } - [TestCase] + [TestCase] // TODO: remove?! public void AuxMapping() { - var auxId = "ALT1"; + var dataWriter = new MockModalDataContainer(); - dataWriter.AddAuxiliary(auxId); - + var container = new VehicleContainer(ExecutionMode.Engineering, dataWriter); var data = DrivingCycleDataReader.ReadFromFile(@"TestData\Cycles\Coach time based short.vdri", CycleType.MeasuredSpeed, false); @@ -289,19 +275,6 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var aux = new EngineAuxiliary(container); - var auxDataInputData = new AuxiliaryDataInputData { - ID = "ALT1", - Type = AuxiliaryType.ElectricSystem, - Technology = new List<string>(), - }; - AuxiliaryFileHelper.FillAuxiliaryDataInputData(auxDataInputData, @"TestData\Components\24t_Coach_ALT.vaux"); - var auxData = AuxiliaryDataReader.Create(auxDataInputData); - - // ratio = 4.078 - // efficiency_engine = 0.96 - // efficiency_supply = 0.98 - - aux.AddMapping(auxId, auxData); var speed = 578.22461991.RPMtoRad(); // = 2358 (nAuxiliary) * ratio var torque = 500.SI<NewtonMeter>(); @@ -331,28 +304,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation } } - [TestCase] - public void AuxColumnMissing() - { - var container = new VehicleContainer(ExecutionMode.Engineering); - var data = DrivingCycleDataReader.ReadFromFile(@"TestData\Cycles\Coach time based short.vdri", - CycleType.MeasuredSpeed, false); - new MockDrivingCycle(container, data); - - var aux = new EngineAuxiliary(container); - AssertHelper.Exception<VectoException>(() => aux.AddMapping("NONEXISTING_AUX", null), - "driving cycle does not contain column for auxiliary: AUX_NONEXISTING_AUX"); - } - - [TestCase] - public void AuxFileMissing() - { - AssertHelper.Exception<VectoException>(() => { - var auxDataInputData = new AuxiliaryDataInputData(); - AuxiliaryFileHelper.FillAuxiliaryDataInputData(auxDataInputData, @"NOT_EXISTING_AUX_FILE.vaux"); - }, "Auxiliary file not found: NOT_EXISTING_AUX_FILE.vaux"); - } - + [Category("LongRunning")] [TestCase] public void AuxReadJobFileDeclarationMode() diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 8b6ed8abf3..7cb6d9edc5 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -504,6 +504,72 @@ <None Include="TestData\Hybrids\Battery\GenericBatteryLarge.vbat"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_C3b.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_C3a.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_C2b.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_C2a.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_C1.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericBattery.vreess"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericBat_3kWh.vbatr"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericBat_3kWh.vbatv"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericEM.vemd"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericEM_15KW_220Nm.vem"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericEM_15kW_220Nm.vemp"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\GenericEM_32kW_450Nm.vemo"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\HybridStrategyParams.vhctl"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_C3b.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_C3a.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_C2b.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_C2a.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_P1.vveh"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_C1.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_B.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\MaxCurrent.vimax"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\ShiftParameters.vtcu"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\Hybrids\Citybus_P1-APT-P-220kW-7.7l\Bus.vacc"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> @@ -579,6 +645,63 @@ <None Include="TestData\Hybrids\ElectricMotor\GenericMap240kW.vemo"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\250kW.vfld"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\250kW.vmap"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Axle_Coach.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_A.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\BusAuxData_B.vaux"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Default.vrlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\DEFAULT_3-Cylinder_2-Stage_598ccm.ACMP"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Driver.vacc"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Engine_250kW_7.7l.veng"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_1.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_2.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_3.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_4.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_5.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Gear_6.vtlm"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\Interurban.vdri"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus.vveh"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\InterurbanBus_ENG_BusAux_A.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="TestData\Hybrids\BusAuxEngineeringMode\MT_6_Bus.vgbx"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\Hybrids\GenericVehicle_Group2_P2\175kW.vfld"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> diff --git a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs index 8318424c4a..c300b93f18 100644 --- a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs @@ -238,19 +238,19 @@ namespace TUGraz.VectoCore.Tests.XML var inputDataProvider = xmlInputReader.CreateEngineering(EngineeringSampleFile); var auxDataProvider = inputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData; - var aux = auxDataProvider.Auxiliaries; - var aux1 = aux[0]; + //var aux = auxDataProvider.Auxiliaries; + //var aux1 = aux[0]; - Assert.AreEqual("ES", aux1.ID); + //Assert.AreEqual("ES", aux1.ID); - Assert.AreEqual(70, aux1.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); - Assert.AreEqual(640, aux1.DemandMap.Rows[2].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); + //Assert.AreEqual(70, aux1.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); + //Assert.AreEqual(640, aux1.DemandMap.Rows[2].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); - var aux2 = aux[1]; + //var aux2 = aux[1]; - Assert.AreEqual("FAN", aux2.ID); - Assert.AreEqual(70, aux2.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); - Assert.AreEqual(3190, aux2.DemandMap.Rows[113].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); + //Assert.AreEqual("FAN", aux2.ID); + //Assert.AreEqual(70, aux2.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); + //Assert.AreEqual(3190, aux2.DemandMap.Rows[113].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); } [TestCase] diff --git a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs index 6a670708fc..67e83fef56 100644 --- a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs @@ -351,16 +351,16 @@ namespace TUGraz.VectoCore.Tests.XML var auxDataProvider = inputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData; var aux = auxDataProvider.Auxiliaries; - var aux1 = aux[0]; + //var aux1 = aux[0]; - Assert.AreEqual("ES", aux1.ID); + //Assert.AreEqual("ES", aux1.ID); - Assert.AreEqual(70, aux1.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); - Assert.AreEqual(640, aux1.DemandMap.Rows[2].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); + //Assert.AreEqual(70, aux1.DemandMap.Rows[0].ParseDouble(AuxiliaryDataReader.Fields.MechPower)); + //Assert.AreEqual(640, aux1.DemandMap.Rows[2].ParseDouble(AuxiliaryDataReader.Fields.SupplyPower)); - var aux2 = aux[1]; + //var aux2 = aux[1]; - Assert.AreEqual("FAN", aux2.ID); + //Assert.AreEqual("FAN", aux2.ID); } [TestCase] @@ -704,9 +704,9 @@ namespace TUGraz.VectoCore.Tests.XML var auxInput = inputDataProvider.JobInputData.Vehicle.Components.AuxiliaryInputData.Auxiliaries; - Assert.AreEqual(1, auxInput.Count); - Assert.AreEqual(AuxiliaryDemandType.Constant, auxInput[0].AuxiliaryType); - Assert.AreEqual(5000, auxInput[0].ConstantPowerDemand.Value(), 1e-6); + //Assert.AreEqual(1, auxInput.Count); + //Assert.AreEqual(AuxiliaryDemandType.Constant, auxInput[0].AuxiliaryType); + //Assert.AreEqual(5000, auxInput[0].ConstantPowerDemand.Value(), 1e-6); } [TestCase] -- GitLab