diff --git a/HashingCmd/Program.cs b/HashingCmd/Program.cs index 0f9c33b648d2e5de2365dae3d118b4d93bcd66b5..eb75536b8d1c1a0b3278512386d9fb8ebb785f98 100644 --- a/HashingCmd/Program.cs +++ b/HashingCmd/Program.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.IO; using System.Linq; @@ -39,7 +70,7 @@ hashingcmd.exe static Dictionary<string, HashingAction> actions = new Dictionary<string, HashingAction>(); - static bool _validateXML = false; + static bool _validateXML; private static bool xmlValid = true; static int Main(string[] args) diff --git a/HashingCmd/Properties/AssemblyInfo.cs b/HashingCmd/Properties/AssemblyInfo.cs index 30e4883fd8013b0a1991200c23b923b4180612ca..8c0968988b997940e7bf4808a9afa17b7f5ffa2b 100644 --- a/HashingCmd/Properties/AssemblyInfo.cs +++ b/HashingCmd/Properties/AssemblyInfo.cs @@ -1,4 +1,35 @@ -using System.Reflection; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/HashingCmd/Properties/Version.cs b/HashingCmd/Properties/Version.cs index 109c12aa52a7a912a12fe6927b14b9eaa5bcb4f7..256603680a52f95c88ed2cb7a462d385ed6889c3 100644 --- a/HashingCmd/Properties/Version.cs +++ b/HashingCmd/Properties/Version.cs @@ -11,7 +11,7 @@ * 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 diff --git a/HashingTool/App.xaml.cs b/HashingTool/App.xaml.cs index 9db3a7ee5da6bdfdc680a3af21199e40e964c417..810fa2a70f71ebc9bb1d1065fd1a0db3f8c63b49 100644 --- a/HashingTool/App.xaml.cs +++ b/HashingTool/App.xaml.cs @@ -1,17 +1,40 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 +*/ namespace HashingTool { /// <summary> /// Interaction logic for App.xaml /// </summary> - public partial class App : Application + public partial class App { } } diff --git a/HashingTool/MainWindow.xaml.cs b/HashingTool/MainWindow.xaml.cs index 9980c965da5124a3c936bb2efd7bcca32a310b6e..ebdebd827e35326cb6052b51a116e60eb1b255bb 100644 --- a/HashingTool/MainWindow.xaml.cs +++ b/HashingTool/MainWindow.xaml.cs @@ -1,28 +1,44 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 +*/ namespace HashingTool { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> - public partial class MainWindow : Window + public partial class MainWindow { public MainWindow() { InitializeComponent(); } } -} +} \ No newline at end of file diff --git a/HashingTool/Properties/AssemblyInfo.cs b/HashingTool/Properties/AssemblyInfo.cs index 18bfbccbb9c037890e0206d5c1c6a3ab82d06ee8..be03aa00edada0191def470609435986d71217cc 100644 --- a/HashingTool/Properties/AssemblyInfo.cs +++ b/HashingTool/Properties/AssemblyInfo.cs @@ -1,4 +1,35 @@ -using System.Reflection; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/HashingTool/Properties/Resources.Designer.cs b/HashingTool/Properties/Resources.Designer.cs index 139d956a168e7e1843f006f6944d121061d3e45f..3a7ee2b38acc8cb4eaa7fe10488ab0a3bd12b1cf 100644 --- a/HashingTool/Properties/Resources.Designer.cs +++ b/HashingTool/Properties/Resources.Designer.cs @@ -1,12 +1,33 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 +*/ namespace HashingTool.Properties { diff --git a/HashingTool/Properties/Settings.Designer.cs b/HashingTool/Properties/Settings.Designer.cs index a323ae3235315680ef3f2e04edcb1079436c61a8..2278b7c4f7e702b360f598ac73ed649e8e00e868 100644 --- a/HashingTool/Properties/Settings.Designer.cs +++ b/HashingTool/Properties/Settings.Designer.cs @@ -1,12 +1,33 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 +*/ namespace HashingTool.Properties { diff --git a/HashingTool/Properties/Version.cs b/HashingTool/Properties/Version.cs index 109c12aa52a7a912a12fe6927b14b9eaa5bcb4f7..256603680a52f95c88ed2cb7a462d385ed6889c3 100644 --- a/HashingTool/Properties/Version.cs +++ b/HashingTool/Properties/Version.cs @@ -11,7 +11,7 @@ * 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 diff --git a/VECTO.sln.DotSettings b/VECTO.sln.DotSettings index 5e2e17e67b6bab61d1229d5068df245ad4c1db32..63179ca8314c9ff7e13fb4d58810a6d369ee0ba9 100644 --- a/VECTO.sln.DotSettings +++ b/VECTO.sln.DotSettings @@ -24,6 +24,7 @@ <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AT/@EntryIndexedValue">AT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CSV/@EntryIndexedValue">CSV</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HVAC/@EntryIndexedValue">HVAC</s:String> + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JSON/@EntryIndexedValue">JSON</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MT/@EntryIndexedValue">MT</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PT/@EntryIndexedValue">PT</s:String> @@ -32,6 +33,7 @@ <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SI/@EntryIndexedValue">SI</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WHTC/@EntryIndexedValue">WHTC</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XML/@EntryIndexedValue">XML</s:String> + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XSD/@EntryIndexedValue">XSD</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String> diff --git a/VECTO/ApplicationEvents.vb b/VECTO/ApplicationEvents.vb index c9665b0d7d4e2edae1dc459bbe7d3c98b23bc097..0b6971c6923812106ae58d46a4e7d84d24d2ac66 100644 --- a/VECTO/ApplicationEvents.vb +++ b/VECTO/ApplicationEvents.vb @@ -112,12 +112,6 @@ Namespace My 'Restart log if log file too large LogFile.SizeCheck() - - - 'License initialization - Lic = New vectolic.cLicense - Lic.AppVersion = "2.2" 'VECTOvers - Lic.FilePath = MyAppPath & "license.dat" End Sub Private Sub MyApplication_UnhandledException(ByVal sender As Object, diff --git a/VECTO/Configuration.vb b/VECTO/Configuration.vb index 315694210f274230eddce3bce6230cd0acb550f0..ddbff60825b231f8aa1da3673fbba5b8a1e7729d 100644 --- a/VECTO/Configuration.vb +++ b/VECTO/Configuration.vb @@ -91,7 +91,6 @@ Public Class Configuration Public Sub Save() Dim header As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - header.Add("CreatedBy", Lic.LicString & " (" & Lic.GUID & ")") header.Add("Date", Now.ToUniversalTime().ToString("o")) header.Add("AppVersion", VECTOvers) header.Add("FileVersion", FormatVersion) diff --git a/VECTO/GUI/AboutBox.Designer.vb b/VECTO/GUI/AboutBox.Designer.vb index bde22d1a8880d8e60b1b860f69a76931513a47d6..0fad78eab49d8941ae7b3ecff8bc02b74e9b74f7 100644 --- a/VECTO/GUI/AboutBox.Designer.vb +++ b/VECTO/GUI/AboutBox.Designer.vb @@ -36,59 +36,23 @@ Partial Class AboutBox 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. <DebuggerStepThrough()> _ Private Sub InitializeComponent() - Me.Label10 = New System.Windows.Forms.Label() - Me.LabelLic = New System.Windows.Forms.Label() - Me.LabelLicDate = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label() - Me.Panel1 = New System.Windows.Forms.Panel() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.Label1 = New System.Windows.Forms.Label() Me.LinkLabel1 = New System.Windows.Forms.LinkLabel() Me.LinkLabel2 = New System.Windows.Forms.LinkLabel() Me.Label3 = New System.Windows.Forms.Label() Me.PictureBoxJRC = New System.Windows.Forms.PictureBox() - Me.Panel1.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBoxJRC, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label10.Location = New System.Drawing.Point(9, 250) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(75, 13) - Me.Label10.TabIndex = 11 - Me.Label10.Text = "License file:" - ' - 'LabelLic - ' - Me.LabelLic.AutoSize = True - Me.LabelLic.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.LabelLic.Location = New System.Drawing.Point(3, 0) - Me.LabelLic.Name = "LabelLic" - Me.LabelLic.Size = New System.Drawing.Size(22, 13) - Me.LabelLic.TabIndex = 12 - Me.LabelLic.Text = "Lic" - ' - 'LabelLicDate - ' - Me.LabelLicDate.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.LabelLicDate.AutoSize = True - Me.LabelLicDate.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.LabelLicDate.Location = New System.Drawing.Point(3, 26) - Me.LabelLicDate.Name = "LabelLicDate" - Me.LabelLicDate.Size = New System.Drawing.Size(12, 13) - Me.LabelLicDate.TabIndex = 13 - Me.LabelLicDate.Text = "-" - ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label2.Location = New System.Drawing.Point(9, 346) + Me.Label2.Location = New System.Drawing.Point(12, 241) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(162, 13) Me.Label2.TabIndex = 7 @@ -98,22 +62,12 @@ Partial Class AboutBox ' Me.Label8.AutoSize = True Me.Label8.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label8.Location = New System.Drawing.Point(24, 368) + Me.Label8.Location = New System.Drawing.Point(27, 263) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(158, 39) Me.Label8.TabIndex = 3 Me.Label8.Text = "Joint Research Centre" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Sustainable Transport Unit" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "European Commission" ' - 'Panel1 - ' - Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - Me.Panel1.Controls.Add(Me.LabelLic) - Me.Panel1.Controls.Add(Me.LabelLicDate) - Me.Panel1.Location = New System.Drawing.Point(12, 266) - Me.Panel1.Name = "Panel1" - Me.Panel1.Size = New System.Drawing.Size(464, 52) - Me.Panel1.TabIndex = 16 - ' 'PictureBox1 ' Me.PictureBox1.Image = Global.TUGraz.VECTO.My.Resources.Resources.VECTO_About @@ -127,7 +81,7 @@ Partial Class AboutBox ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label1.Location = New System.Drawing.Point(9, 436) + Me.Label1.Location = New System.Drawing.Point(12, 331) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(105, 13) Me.Label1.TabIndex = 7 @@ -136,7 +90,7 @@ Partial Class AboutBox 'LinkLabel1 ' Me.LinkLabel1.AutoSize = True - Me.LinkLabel1.Location = New System.Drawing.Point(120, 436) + Me.LinkLabel1.Location = New System.Drawing.Point(123, 331) Me.LinkLabel1.Name = "LinkLabel1" Me.LinkLabel1.Size = New System.Drawing.Size(122, 13) Me.LinkLabel1.TabIndex = 17 @@ -168,7 +122,7 @@ Partial Class AboutBox ' Me.PictureBoxJRC.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBoxJRC.Image = Global.TUGraz.VECTO.My.Resources.Resources.JRC_About - Me.PictureBoxJRC.Location = New System.Drawing.Point(216, 353) + Me.PictureBoxJRC.Location = New System.Drawing.Point(219, 248) Me.PictureBoxJRC.Name = "PictureBoxJRC" Me.PictureBoxJRC.Size = New System.Drawing.Size(260, 54) Me.PictureBoxJRC.TabIndex = 15 @@ -177,14 +131,12 @@ Partial Class AboutBox 'AboutBox ' Me.BackColor = System.Drawing.Color.White - Me.ClientSize = New System.Drawing.Size(491, 474) + Me.ClientSize = New System.Drawing.Size(491, 356) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.LinkLabel2) Me.Controls.Add(Me.LinkLabel1) - Me.Controls.Add(Me.Panel1) Me.Controls.Add(Me.PictureBoxJRC) Me.Controls.Add(Me.PictureBox1) - Me.Controls.Add(Me.Label10) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label8) @@ -192,21 +144,15 @@ Partial Class AboutBox Me.Name = "AboutBox" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "About VECTO" - Me.Panel1.ResumeLayout(False) - Me.Panel1.PerformLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBoxJRC, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub - Friend WithEvents Label10 As Label - Friend WithEvents LabelLic As Label - Friend WithEvents LabelLicDate As Label Friend WithEvents PictureBox1 As PictureBox Friend WithEvents Label2 As Label Friend WithEvents Label8 As Label - Friend WithEvents Panel1 As Panel Friend WithEvents Label1 As Label Friend WithEvents LinkLabel1 As LinkLabel Friend WithEvents LinkLabel2 As LinkLabel diff --git a/VECTO/GUI/AboutBox.vb b/VECTO/GUI/AboutBox.vb index a6aeb1e60f4d046cf06c0b866e9e0cdcc5d00d09..bf00e39bc42b93679b12c6e1b02cef03a6981dec 100644 --- a/VECTO/GUI/AboutBox.vb +++ b/VECTO/GUI/AboutBox.vb @@ -18,8 +18,6 @@ Public Class AboutBox 'Initialize Private Sub F10_AboutBox_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Text = "VECTO " & VECTOvers & " / VectoCore " & COREvers - LabelLic.Text = Lic.LicString - LabelLicDate.Text = "Expiring date (y/m/d): " & Lic.ExpTime End Sub 'e-mail links---------------------------------------------------------------- diff --git a/VECTO/GUI/EngineForm.Designer.vb b/VECTO/GUI/EngineForm.Designer.vb index 3452dbda44e28d23d7a23a6704f3b538dea516c2..4fbc991ddcede0ddfba0a74a5acdfc18312aea73 100644 --- a/VECTO/GUI/EngineForm.Designer.vb +++ b/VECTO/GUI/EngineForm.Designer.vb @@ -72,6 +72,10 @@ Partial Class EngineForm Me.PnInertia = New System.Windows.Forms.Panel() Me.GrWHTC = New System.Windows.Forms.GroupBox() Me.PnWhtcDeclaration = New System.Windows.Forms.Panel() + Me.Label20 = New System.Windows.Forms.Label() + Me.tbRegPerCorrFactor = New System.Windows.Forms.TextBox() + Me.Label19 = New System.Windows.Forms.Label() + Me.tbNCVCorrFactor = New System.Windows.Forms.TextBox() Me.lblColdHotFactor = New System.Windows.Forms.Label() Me.TbColdHotFactor = New System.Windows.Forms.TextBox() Me.BtWHTCimport = New System.Windows.Forms.Button() @@ -101,10 +105,6 @@ Partial Class EngineForm Me.Label17 = New System.Windows.Forms.Label() Me.Label18 = New System.Windows.Forms.Label() Me.cbFuelType = New System.Windows.Forms.ComboBox() - Me.Label19 = New System.Windows.Forms.Label() - Me.tbNCVCorrFactor = New System.Windows.Forms.TextBox() - Me.Label20 = New System.Windows.Forms.Label() - Me.tbRegPerCorrFactor = New System.Windows.Forms.TextBox() Me.ToolStrip1.SuspendLayout() Me.StatusStrip1.SuspendLayout() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -429,6 +429,38 @@ Partial Class EngineForm Me.PnWhtcDeclaration.Size = New System.Drawing.Size(472, 95) Me.PnWhtcDeclaration.TabIndex = 8 ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.Location = New System.Drawing.Point(99, 76) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(89, 13) + Me.Label20.TabIndex = 9 + Me.Label20.Text = "Reg. Per. Corr. F." + ' + 'tbRegPerCorrFactor + ' + Me.tbRegPerCorrFactor.Location = New System.Drawing.Point(194, 73) + Me.tbRegPerCorrFactor.Name = "tbRegPerCorrFactor" + Me.tbRegPerCorrFactor.Size = New System.Drawing.Size(57, 20) + Me.tbRegPerCorrFactor.TabIndex = 10 + ' + 'Label19 + ' + Me.Label19.AutoSize = True + Me.Label19.Location = New System.Drawing.Point(274, 53) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(66, 13) + Me.Label19.TabIndex = 7 + Me.Label19.Text = "NCV Corr. F." + ' + 'tbNCVCorrFactor + ' + Me.tbNCVCorrFactor.Location = New System.Drawing.Point(343, 50) + Me.tbNCVCorrFactor.Name = "tbNCVCorrFactor" + Me.tbNCVCorrFactor.Size = New System.Drawing.Size(57, 20) + Me.tbNCVCorrFactor.TabIndex = 8 + ' 'lblColdHotFactor ' Me.lblColdHotFactor.AutoSize = True @@ -675,38 +707,6 @@ Partial Class EngineForm Me.cbFuelType.Size = New System.Drawing.Size(143, 21) Me.cbFuelType.TabIndex = 51 ' - 'Label19 - ' - Me.Label19.AutoSize = True - Me.Label19.Location = New System.Drawing.Point(274, 53) - Me.Label19.Name = "Label19" - Me.Label19.Size = New System.Drawing.Size(66, 13) - Me.Label19.TabIndex = 7 - Me.Label19.Text = "NCV Corr. F." - ' - 'tbNCVCorrFactor - ' - Me.tbNCVCorrFactor.Location = New System.Drawing.Point(343, 50) - Me.tbNCVCorrFactor.Name = "tbNCVCorrFactor" - Me.tbNCVCorrFactor.Size = New System.Drawing.Size(57, 20) - Me.tbNCVCorrFactor.TabIndex = 8 - ' - 'Label20 - ' - Me.Label20.AutoSize = True - Me.Label20.Location = New System.Drawing.Point(99, 76) - Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(89, 13) - Me.Label20.TabIndex = 9 - Me.Label20.Text = "Reg. Per. Corr. F." - ' - 'tbRegPerCorrFactor - ' - Me.tbRegPerCorrFactor.Location = New System.Drawing.Point(194, 73) - Me.tbRegPerCorrFactor.Name = "tbRegPerCorrFactor" - Me.tbRegPerCorrFactor.Size = New System.Drawing.Size(57, 20) - Me.tbRegPerCorrFactor.TabIndex = 10 - ' 'EngineForm ' Me.AcceptButton = Me.ButOK diff --git a/VECTO/GUI/EngineForm.vb b/VECTO/GUI/EngineForm.vb index 84c1ff1abc7a18b8eba041078327f717e80e259c..938b1e7276700a8b8dd9cc7427ddcf13e1841a83 100644 --- a/VECTO/GUI/EngineForm.vb +++ b/VECTO/GUI/EngineForm.vb @@ -385,7 +385,7 @@ Public Class EngineForm End Sub Private Sub UpdatePic() - Dim fullLoadCurve As FullLoadCurve = Nothing + Dim fullLoadCurve As EngineFullLoadCurve = Nothing Dim fcMap As FuelConsumptionMap = Nothing @@ -397,7 +397,7 @@ Public Class EngineForm Dim fldFile As String = If(Not String.IsNullOrWhiteSpace(_engFile), Path.Combine(Path.GetDirectoryName(_engFile), TbFLD.Text), TbFLD.Text) If File.Exists(fldFile) Then _ - fullLoadCurve = FullLoadCurveReader.Create(VectoCSVFile.Read(fldFile), engineFld:=True) + fullLoadCurve = FullLoadCurveReader.Create(VectoCSVFile.Read(fldFile)) Catch ex As Exception End Try diff --git a/VECTO/GUI/FileSignDialog.Designer.vb b/VECTO/GUI/FileSignDialog.Designer.vb deleted file mode 100644 index 2200de7a98365159ce9d84d7334b88c922807a50..0000000000000000000000000000000000000000 --- a/VECTO/GUI/FileSignDialog.Designer.vb +++ /dev/null @@ -1,361 +0,0 @@ -' Copyright 2014 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. -Imports System.ComponentModel -Imports Microsoft.VisualBasic.CompilerServices - -<DesignerGenerated()> _ -Partial Class FileSignDialog - Inherits Form - - 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - <DebuggerNonUserCode()> _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Wird vom Windows Form-Designer benötigt. - Private components As IContainer - - 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. - 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. - 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - <DebuggerStepThrough()> _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FileSignDialog)) - Me.TbSigFile = New System.Windows.Forms.TextBox() - Me.Label1 = New System.Windows.Forms.Label() - Me.BtBrowse = New System.Windows.Forms.Button() - Me.lvFiles = New System.Windows.Forms.ListView() - Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) - Me.ColumnHeader2 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) - Me.BtSign = New System.Windows.Forms.Button() - Me.BtClose = New System.Windows.Forms.Button() - Me.BtRemFLD = New System.Windows.Forms.Button() - Me.BtAddFLD = New System.Windows.Forms.Button() - Me.GroupBox1 = New System.Windows.Forms.GroupBox() - Me.BtClearList = New System.Windows.Forms.Button() - Me.BtReload = New System.Windows.Forms.Button() - Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.LbStatus = New System.Windows.Forms.Label() - Me.LbMode = New System.Windows.Forms.Label() - Me.LbDateStr = New System.Windows.Forms.Label() - Me.TbPubKey = New System.Windows.Forms.TextBox() - Me.TbLicStr = New System.Windows.Forms.TextBox() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label6 = New System.Windows.Forms.Label() - Me.Label3 = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() - Me.GroupBox1.SuspendLayout() - Me.GroupBox2.SuspendLayout() - Me.SuspendLayout() - ' - 'TbSigFile - ' - Me.TbSigFile.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TbSigFile.Location = New System.Drawing.Point(12, 29) - Me.TbSigFile.Name = "TbSigFile" - Me.TbSigFile.Size = New System.Drawing.Size(528, 20) - Me.TbSigFile.TabIndex = 0 - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 13) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(99, 13) - Me.Label1.TabIndex = 4 - Me.Label1.Text = "Signature file (.vsig)" - ' - 'BtBrowse - ' - Me.BtBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.BtBrowse.Image = Global.TUGraz.VECTO.My.Resources.Resources.Open_icon - Me.BtBrowse.Location = New System.Drawing.Point(541, 27) - Me.BtBrowse.Name = "BtBrowse" - Me.BtBrowse.Size = New System.Drawing.Size(24, 24) - Me.BtBrowse.TabIndex = 1 - Me.BtBrowse.UseVisualStyleBackColor = True - ' - 'lvFiles - ' - Me.lvFiles.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lvFiles.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2}) - Me.lvFiles.FullRowSelect = True - Me.lvFiles.GridLines = True - Me.lvFiles.LabelEdit = True - Me.lvFiles.Location = New System.Drawing.Point(6, 19) - Me.lvFiles.MultiSelect = False - Me.lvFiles.Name = "lvFiles" - Me.lvFiles.Size = New System.Drawing.Size(565, 217) - Me.lvFiles.TabIndex = 0 - Me.lvFiles.UseCompatibleStateImageBehavior = False - Me.lvFiles.View = System.Windows.Forms.View.Details - ' - 'ColumnHeader1 - ' - Me.ColumnHeader1.Text = "File" - Me.ColumnHeader1.Width = 408 - ' - 'ColumnHeader2 - ' - Me.ColumnHeader2.Text = "Status" - Me.ColumnHeader2.Width = 141 - ' - 'BtSign - ' - Me.BtSign.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.BtSign.Location = New System.Drawing.Point(12, 487) - Me.BtSign.Name = "BtSign" - Me.BtSign.Size = New System.Drawing.Size(126, 23) - Me.BtSign.TabIndex = 5 - Me.BtSign.Text = "Create Signature File" - Me.BtSign.UseVisualStyleBackColor = True - ' - 'BtClose - ' - Me.BtClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.BtClose.Location = New System.Drawing.Point(522, 487) - Me.BtClose.Name = "BtClose" - Me.BtClose.Size = New System.Drawing.Size(67, 23) - Me.BtClose.TabIndex = 6 - Me.BtClose.Text = "Close" - Me.BtClose.UseVisualStyleBackColor = True - ' - 'BtRemFLD - ' - Me.BtRemFLD.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.BtRemFLD.Image = Global.TUGraz.VECTO.My.Resources.Resources.minus_circle_icon - Me.BtRemFLD.Location = New System.Drawing.Point(29, 236) - Me.BtRemFLD.Name = "BtRemFLD" - Me.BtRemFLD.Size = New System.Drawing.Size(24, 24) - Me.BtRemFLD.TabIndex = 2 - Me.BtRemFLD.UseVisualStyleBackColor = True - ' - 'BtAddFLD - ' - Me.BtAddFLD.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.BtAddFLD.Image = Global.TUGraz.VECTO.My.Resources.Resources.plus_circle_icon - Me.BtAddFLD.Location = New System.Drawing.Point(5, 236) - Me.BtAddFLD.Name = "BtAddFLD" - Me.BtAddFLD.Size = New System.Drawing.Size(24, 24) - Me.BtAddFLD.TabIndex = 1 - Me.BtAddFLD.UseVisualStyleBackColor = True - ' - 'GroupBox1 - ' - Me.GroupBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.GroupBox1.Controls.Add(Me.lvFiles) - Me.GroupBox1.Controls.Add(Me.BtClearList) - Me.GroupBox1.Controls.Add(Me.BtRemFLD) - Me.GroupBox1.Controls.Add(Me.BtAddFLD) - Me.GroupBox1.Location = New System.Drawing.Point(12, 210) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(577, 271) - Me.GroupBox1.TabIndex = 4 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Files" - ' - 'BtClearList - ' - Me.BtClearList.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.BtClearList.Location = New System.Drawing.Point(508, 236) - Me.BtClearList.Name = "BtClearList" - Me.BtClearList.Size = New System.Drawing.Size(63, 24) - Me.BtClearList.TabIndex = 3 - Me.BtClearList.Text = "Clear List" - Me.BtClearList.UseVisualStyleBackColor = True - ' - 'BtReload - ' - Me.BtReload.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.BtReload.Image = Global.TUGraz.VECTO.My.Resources.Resources.Refresh_icon - Me.BtReload.Location = New System.Drawing.Point(565, 27) - Me.BtReload.Name = "BtReload" - Me.BtReload.Size = New System.Drawing.Size(24, 24) - Me.BtReload.TabIndex = 2 - Me.BtReload.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.GroupBox2.Controls.Add(Me.LbStatus) - Me.GroupBox2.Controls.Add(Me.LbMode) - Me.GroupBox2.Controls.Add(Me.LbDateStr) - Me.GroupBox2.Controls.Add(Me.TbPubKey) - Me.GroupBox2.Controls.Add(Me.TbLicStr) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Controls.Add(Me.Label3) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label2) - Me.GroupBox2.Location = New System.Drawing.Point(12, 55) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(577, 149) - Me.GroupBox2.TabIndex = 3 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "File Information" - ' - 'LbStatus - ' - Me.LbStatus.AutoSize = True - Me.LbStatus.Location = New System.Drawing.Point(99, 116) - Me.LbStatus.Name = "LbStatus" - Me.LbStatus.Size = New System.Drawing.Size(0, 13) - Me.LbStatus.TabIndex = 4 - ' - 'LbMode - ' - Me.LbMode.AutoSize = True - Me.LbMode.Location = New System.Drawing.Point(99, 87) - Me.LbMode.Name = "LbMode" - Me.LbMode.Size = New System.Drawing.Size(0, 13) - Me.LbMode.TabIndex = 3 - ' - 'LbDateStr - ' - Me.LbDateStr.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.LbDateStr.AutoSize = True - Me.LbDateStr.Location = New System.Drawing.Point(421, 87) - Me.LbDateStr.Name = "LbDateStr" - Me.LbDateStr.Size = New System.Drawing.Size(0, 13) - Me.LbDateStr.TabIndex = 2 - ' - 'TbPubKey - ' - Me.TbPubKey.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TbPubKey.Location = New System.Drawing.Point(99, 48) - Me.TbPubKey.Name = "TbPubKey" - Me.TbPubKey.ReadOnly = True - Me.TbPubKey.Size = New System.Drawing.Size(472, 20) - Me.TbPubKey.TabIndex = 1 - ' - 'TbLicStr - ' - Me.TbLicStr.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TbLicStr.Location = New System.Drawing.Point(99, 22) - Me.TbLicStr.Name = "TbLicStr" - Me.TbLicStr.ReadOnly = True - Me.TbLicStr.Size = New System.Drawing.Size(472, 20) - Me.TbLicStr.TabIndex = 0 - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(33, 51) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(60, 13) - Me.Label5.TabIndex = 0 - Me.Label5.Text = "Public Key:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(53, 116) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(40, 13) - Me.Label6.TabIndex = 0 - Me.Label6.Text = "Status:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(56, 87) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(37, 13) - Me.Label3.TabIndex = 0 - Me.Label3.Text = "Mode:" - ' - 'Label4 - ' - Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(340, 87) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(75, 13) - Me.Label4.TabIndex = 0 - Me.Label4.Text = "Creation Time:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 25) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(81, 13) - Me.Label2.TabIndex = 0 - Me.Label2.Text = "License Owner:" - ' - 'FileSignDialog - ' - Me.ClientSize = New System.Drawing.Size(601, 522) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.BtReload) - Me.Controls.Add(Me.GroupBox1) - Me.Controls.Add(Me.BtClose) - Me.Controls.Add(Me.BtSign) - Me.Controls.Add(Me.BtBrowse) - Me.Controls.Add(Me.Label1) - Me.Controls.Add(Me.TbSigFile) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.MinimumSize = New System.Drawing.Size(480, 400) - Me.Name = "FileSignDialog" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Sign & Verify Files" - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - Friend WithEvents TbSigFile As TextBox - Friend WithEvents Label1 As Label - Friend WithEvents BtBrowse As Button - Friend WithEvents lvFiles As ListView - Friend WithEvents ColumnHeader1 As ColumnHeader - Friend WithEvents ColumnHeader2 As ColumnHeader - Friend WithEvents BtSign As Button - Friend WithEvents BtClose As Button - Friend WithEvents BtRemFLD As Button - Friend WithEvents BtAddFLD As Button - Friend WithEvents GroupBox1 As GroupBox - Friend WithEvents BtClearList As Button - Friend WithEvents BtReload As Button - Friend WithEvents GroupBox2 As GroupBox - Friend WithEvents Label3 As Label - Friend WithEvents Label4 As Label - Friend WithEvents Label2 As Label - Friend WithEvents LbMode As Label - Friend WithEvents LbDateStr As Label - Friend WithEvents TbPubKey As TextBox - Friend WithEvents TbLicStr As TextBox - Friend WithEvents Label5 As Label - Friend WithEvents LbStatus As Label - Friend WithEvents Label6 As Label - -End Class diff --git a/VECTO/GUI/FileSignDialog.resx b/VECTO/GUI/FileSignDialog.resx deleted file mode 100644 index 67506e4ae66e49508c6860afb6374f19ef548823..0000000000000000000000000000000000000000 --- a/VECTO/GUI/FileSignDialog.resx +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value> - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAQAAAAZBAQEMwYGBjIAAAAVAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAA4zMzNxpaWl3dPT0/7R0dH+nZ2d4DExMXIAAAAJAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAdDQ0N/2dnZ/dzc3P/i4uL/5+fn/+vr6//Y2Nj+PT09ggAAAAMAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAEBAQsv7+/8NfX1//c3Nz/3t7e/+fn5//r6+v/7Ozs/8TExPcJCQknAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAMTExaMvLy//Z2dn/3Nzc/9zc3P/h4eH/6enp/+zs7P/r6+v/ODg4awAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtLS327u7vrampqLWhoaFvb29v+39/f/+Li4v/r6+v/6urq/0pK - SnMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLS0tmra2t9BQUFFsmJiZz1dXV/OTk5P/g4OD/5OTk/+jo - 6P9sbGzHAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAIiIiHs7Ozvetra3/xMTE/97e3v/k5OT/5ubm/+fn - 5//g4OD/4uLi/2pqasMAAAAfAAAAAAAAAAAAAAAAAAAAAAAAAACSkpJ22NjY/uHh4f/j4+P/5OTk/+Xl - 5f/h4eH/xsbG/+bm5v/o6Oj/bm5uvwAAAB4AAAAAAAAAAAAAAAAAAAAAAAAAAL+/v1/Z2dnd3t7e/t7e - 3vzJycn2uru6/9fY1//Y2dj/6enp/+rq6v9wcHC8AAAAHgAAAAAAAAAAAAAAAAAAAAAAAAAAc3NzAZGR - kRaNjY0Sf4B/Mn5+fnXDxMPq29vb/9zc3P/r6+v/7Ozs/3FxcbkAAAAdAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAQEBADoKCgsN3d3fze3t7/4OHg/+7u7v/u7u7/cnJytgAAABoAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAADc3NwK/v7+DxcXF1+Li4v/l5eX/8PDw//Hx8f9WVlaFAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0tLTrn5+f/5+fn/+np6f/z8/P/gYGBogAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmJiYKt7e3suTk5PXs7Oz/7e7t/39/ - f50AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACoqKhc2tras9vb - 27xeXl48//8AAOH/AADAfwAAgH8AAIB/AACwfwAAsD8AAIAfAADADwAA4AcAAP8DAAD/AQAA/4AAAP/g - AAD/4AAA//kAAA== -</value> - </data> -</root> \ No newline at end of file diff --git a/VECTO/GUI/FileSignDialog.vb b/VECTO/GUI/FileSignDialog.vb deleted file mode 100644 index 0e96fa5cc1220fce90cfdbc98f12a53718108a3b..0000000000000000000000000000000000000000 --- a/VECTO/GUI/FileSignDialog.vb +++ /dev/null @@ -1,225 +0,0 @@ -' Copyright 2014 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. -Imports System.IO -Imports System.Windows.Forms -Imports vectolic - -''' <summary> -''' Create/Verify signature files (.vsig). -''' </summary> -''' <remarks></remarks> -Public Class FileSignDialog - 'Create signature file - Private Sub BtSign_Click(sender As Object, e As EventArgs) Handles BtSign.Click - Dim listViewItem As ListViewItem - Dim mainDirectory As String - - If lvFiles.Items.Count = 0 Then - MsgBox("No files selected!", MsgBoxStyle.Critical) - Exit Sub - End If - - If Trim(TbSigFile.Text) = "" Then - MsgBox("No signature file path defined!", MsgBoxStyle.Critical) - Exit Sub - End If - - If File.Exists(TbSigFile.Text) Then - If MsgBox("Overwrite existing signature file?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then Exit Sub - End If - - ClearForm(False) - - - mainDirectory = GetPath(TbSigFile.Text) - - - Lic.FileSigning.NewFile() - Lic.FileSigning.Mode = cFileSigning.tMode.Manual - - - For Each listViewItem In lvFiles.Items - Lic.FileSigning.AddFile(FileRepl(listViewItem.SubItems(0).Text, mainDirectory)) - listViewItem.SubItems(1).Text = "" - listViewItem.ForeColor = Color.Black - Next - - If Lic.FileSigning.WriteSigFile(TbSigFile.Text, LicSigAppCode) Then - LbStatus.Text = "Signature file created successfully" - LbStatus.ForeColor = Color.DarkGreen - Else - LbStatus.Text = "Fail to create signature file! " & Lic.FileSigning.ErrorMsg - LbStatus.ForeColor = Color.Red - End If - - TbLicStr.Text = Lic.FileSigning.CreatorLicStr - TbPubKey.Text = Lic.FileSigning.PubKey - LbMode.Text = Lic.FileSigning.ModeConv(Lic.FileSigning.Mode) - LbDateStr.Text = Lic.FileSigning.DateStr - - If Lic.FileSigning.FilesOK.Count > 0 Then - For Each listViewItem In lvFiles.Items - listViewItem.SubItems(1).Text = Lic.FileSigning.FilesMsg(listViewItem.Index) - If Lic.FileSigning.FilesOK(listViewItem.Index) Then - listViewItem.ForeColor = Color.DarkGreen - Else - listViewItem.ForeColor = Color.Red - Exit For - End If - Next - End If - End Sub - - 'Verify existing signature file - Public Sub VerifySigFile() - Dim lv0 As ListViewItem - Dim i As Integer - - If Not File.Exists(TbSigFile.Text) Then - MsgBox("Signature file not found!", MsgBoxStyle.Critical) - Exit Sub - End If - - ClearForm(True) - - If Lic.FileSigning.ReadSigFile(TbSigFile.Text, LicSigAppCode) Then - LbStatus.Text = "File signature verified" - LbStatus.ForeColor = Color.DarkGreen - Else - LbStatus.Text = "ERROR! " & Lic.FileSigning.ErrorMsg - LbStatus.ForeColor = Color.Red - End If - - TbLicStr.Text = Lic.FileSigning.CreatorLicStr - TbPubKey.Text = Lic.FileSigning.PubKey - LbMode.Text = Lic.FileSigning.ModeConv(Lic.FileSigning.Mode) - If Lic.FileSigning.Mode = cFileSigning.tMode.Auto Then - LbMode.ForeColor = Color.DarkGreen - Else - LbMode.ForeColor = Color.Red - End If - LbDateStr.Text = Lic.FileSigning.DateStr - - For i = 0 To Lic.FileSigning.FilesOK.Count - 1 - lv0 = New ListViewItem(Lic.FileSigning.Files(i)) - lv0.SubItems.Add(Lic.FileSigning.FilesMsg(i)) - If Lic.FileSigning.FilesOK(i) Then - lv0.ForeColor = Color.DarkGreen - Else - lv0.ForeColor = Color.Red - End If - lvFiles.Items.Add(lv0) - Next - End Sub - - 'Clear form - Private Sub ClearForm(clearFileList As Boolean) - If ClearFileList Then lvFiles.Items.Clear() - TbLicStr.Text = "" - TbPubKey.Text = "" - LbMode.Text = "" - LbDateStr.Text = "" - LbStatus.Text = "" - LbMode.ForeColor = DefaultForeColor - LbMode.BackColor = DefaultBackColor - LbStatus.ForeColor = DefaultForeColor - LbStatus.BackColor = DefaultBackColor - End Sub - - -#Region "GUI Controls" - - Private Sub BtBrowse_Click(sender As Object, e As EventArgs) Handles BtBrowse.Click - Dim fb As New FileBrowser("sig", False, True) - fb.Extensions = New String() {"vsig"} - - If fb.CustomDialog(TbSigFile.Text, False, False, FileBrowserFileExtensionMode.ForceExt, False, "vsig") Then - TbSigFile.Text = fb.Files(0) - End If - - If File.Exists(TbSigFile.Text) Then - VerifySigFile() - End If - End Sub - - Private Sub BtAddFLD_Click(sender As Object, e As EventArgs) Handles BtAddFLD.Click - AddFile() - End Sub - - Private Sub BtRemFLD_Click(sender As Object, e As EventArgs) Handles BtRemFLD.Click - RemoveFile() - End Sub - - Private Sub BtClose_Click(sender As Object, e As EventArgs) Handles BtClose.Click - Close() - End Sub - - Private Sub BtClearList_Click(sender As Object, e As EventArgs) Handles BtClearList.Click - lvFiles.Items.Clear() - End Sub - - Private Sub BtReload_Click(sender As Object, e As EventArgs) Handles BtReload.Click - VerifySigFile() - End Sub - - Private Sub lvFiles_KeyDown(sender As Object, e As KeyEventArgs) Handles lvFiles.KeyDown - Select Case e.KeyCode - Case Keys.Delete, Keys.Back - RemoveFile() - End Select - End Sub - -#End Region - - 'Add File - Private Sub AddFile() - Dim lvi As ListViewItem - Dim fb As New FileBrowser("xxx", False, True) - Dim str As String - - If fb.OpenDialog("", True) Then - - For Each str In fb.Files - - lvi = New ListViewItem(str) - lvi.SubItems.Add("") - lvi.ForeColor = Color.Black - - lvFiles.Items.Add(lvi) - lvi.EnsureVisible() - - lvFiles.Focus() - - Next - - End If - End Sub - - 'Remove File - Private Sub RemoveFile() - Dim i0 As Integer - - If lvFiles.Items.Count = 0 Then Exit Sub - - If lvFiles.SelectedItems.Count = 0 Then lvFiles.Items(lvFiles.Items.Count - 1).Selected = True - - i0 = lvFiles.SelectedItems(0).Index - - lvFiles.SelectedItems(0).Remove() - - If i0 < lvFiles.Items.Count Then - lvFiles.Items(i0).Selected = True - lvFiles.Items(i0).EnsureVisible() - End If - - lvFiles.Focus() - End Sub -End Class diff --git a/VECTO/GUI/GearboxForm.vb b/VECTO/GUI/GearboxForm.vb index d2e992bdec8dd65118bf8bfd028db0993fcf1885..e3f15ef78e66dafce6c44f3f08a90e28c285642b 100644 --- a/VECTO/GUI/GearboxForm.vb +++ b/VECTO/GUI/GearboxForm.vb @@ -808,7 +808,7 @@ Public Class GearboxForm Dim vehicle As IVehicleEngineeringInputData = inputData.VehicleInputData 'inputData = TryCast(JSONInputDataFactory.ReadComponentData(vectoJob.PathEng(False)), IEngineeringInputDataProvider) Dim engine As IEngineEngineeringInputData = inputData.EngineInputData - Dim engineFld As EngineFullLoadCurve = EngineFullLoadCurve.Create(engine.FullLoadCurve) + Dim engineFld As EngineFullLoadCurve = FullLoadCurveReader.Create(engine.FullLoadCurve) s = New Series diff --git a/VECTO/GUI/MainForm.Designer.vb b/VECTO/GUI/MainForm.Designer.vb index 084944fddc92935d6d4c85dcae8c5b38d1d4b434..3493d8c43bb013e8cb856f1e65b29e69b17a6701 100644 --- a/VECTO/GUI/MainForm.Designer.vb +++ b/VECTO/GUI/MainForm.Designer.vb @@ -99,8 +99,6 @@ Partial Class MainForm Me.GearboxEditorToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GraphToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator6 = New System.Windows.Forms.ToolStripSeparator() - Me.SignOrVerifyFilesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() Me.OpenLogToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.SettingsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripDrDnBtInfo = New System.Windows.Forms.ToolStripDropDownButton() @@ -108,7 +106,6 @@ Partial Class MainForm Me.UpdateNotesToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ReportBugViaCITnetToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() - Me.CreateActivationFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.AboutVECTOToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.CmDEV = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.TmProgSec = New System.Windows.Forms.Timer(Me.components) @@ -672,7 +669,7 @@ Partial Class MainForm ' 'ToolStripDrDnBtTools ' - Me.ToolStripDrDnBtTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GENEditorToolStripMenuItem1, Me.VEHEditorToolStripMenuItem, Me.EngineEditorToolStripMenuItem, Me.GearboxEditorToolStripMenuItem, Me.GraphToolStripMenuItem, Me.ToolStripSeparator6, Me.SignOrVerifyFilesToolStripMenuItem, Me.ToolStripSeparator4, Me.OpenLogToolStripMenuItem, Me.SettingsToolStripMenuItem}) + Me.ToolStripDrDnBtTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GENEditorToolStripMenuItem1, Me.VEHEditorToolStripMenuItem, Me.EngineEditorToolStripMenuItem, Me.GearboxEditorToolStripMenuItem, Me.GraphToolStripMenuItem, Me.ToolStripSeparator6, Me.OpenLogToolStripMenuItem, Me.SettingsToolStripMenuItem}) Me.ToolStripDrDnBtTools.Image = Global.TUGraz.VECTO.My.Resources.Resources.Misc_Tools_icon Me.ToolStripDrDnBtTools.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripDrDnBtTools.Name = "ToolStripDrDnBtTools" @@ -719,19 +716,6 @@ Partial Class MainForm Me.ToolStripSeparator6.Name = "ToolStripSeparator6" Me.ToolStripSeparator6.Size = New System.Drawing.Size(167, 6) ' - 'SignOrVerifyFilesToolStripMenuItem - ' - Me.SignOrVerifyFilesToolStripMenuItem.Image = Global.TUGraz.VECTO.My.Resources.Resources.Status_dialog_password_icon - Me.SignOrVerifyFilesToolStripMenuItem.Name = "SignOrVerifyFilesToolStripMenuItem" - Me.SignOrVerifyFilesToolStripMenuItem.Size = New System.Drawing.Size(170, 22) - Me.SignOrVerifyFilesToolStripMenuItem.Text = "Sign or Verify Files" - ' - 'ToolStripSeparator4 - ' - Me.ToolStripSeparator4.Name = "ToolStripSeparator4" - Me.ToolStripSeparator4.Size = New System.Drawing.Size(167, 6) - Me.ToolStripSeparator4.Visible = False - ' 'OpenLogToolStripMenuItem ' Me.OpenLogToolStripMenuItem.Name = "OpenLogToolStripMenuItem" @@ -746,7 +730,7 @@ Partial Class MainForm ' 'ToolStripDrDnBtInfo ' - Me.ToolStripDrDnBtInfo.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UserManualToolStripMenuItem, Me.UpdateNotesToolStripMenuItem, Me.ReportBugViaCITnetToolStripMenuItem, Me.ToolStripSeparator3, Me.CreateActivationFileToolStripMenuItem, Me.AboutVECTOToolStripMenuItem1}) + Me.ToolStripDrDnBtInfo.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UserManualToolStripMenuItem, Me.UpdateNotesToolStripMenuItem, Me.ReportBugViaCITnetToolStripMenuItem, Me.ToolStripSeparator3, Me.AboutVECTOToolStripMenuItem1}) Me.ToolStripDrDnBtInfo.Image = Global.TUGraz.VECTO.My.Resources.Resources.Help_icon Me.ToolStripDrDnBtInfo.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripDrDnBtInfo.Name = "ToolStripDrDnBtInfo" @@ -776,12 +760,6 @@ Partial Class MainForm Me.ToolStripSeparator3.Name = "ToolStripSeparator3" Me.ToolStripSeparator3.Size = New System.Drawing.Size(219, 6) ' - 'CreateActivationFileToolStripMenuItem - ' - Me.CreateActivationFileToolStripMenuItem.Name = "CreateActivationFileToolStripMenuItem" - Me.CreateActivationFileToolStripMenuItem.Size = New System.Drawing.Size(222, 22) - Me.CreateActivationFileToolStripMenuItem.Text = "Create Activation File" - ' 'AboutVECTOToolStripMenuItem1 ' Me.AboutVECTOToolStripMenuItem1.Name = "AboutVECTOToolStripMenuItem1" @@ -905,11 +883,9 @@ Partial Class MainForm Friend WithEvents ToolStripDrDnBtTools As ToolStripDropDownButton Friend WithEvents GENEditorToolStripMenuItem1 As ToolStripMenuItem Friend WithEvents VEHEditorToolStripMenuItem As ToolStripMenuItem - Friend WithEvents ToolStripSeparator4 As ToolStripSeparator Friend WithEvents OpenLogToolStripMenuItem As ToolStripMenuItem Friend WithEvents SettingsToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripDrDnBtInfo As ToolStripDropDownButton - Friend WithEvents CreateActivationFileToolStripMenuItem As ToolStripMenuItem Friend WithEvents AboutVECTOToolStripMenuItem1 As ToolStripMenuItem Friend WithEvents ToolStripSeparator2 As ToolStripSeparator Friend WithEvents ToolStripProgBarJob As ToolStripProgressBar @@ -925,7 +901,6 @@ Partial Class MainForm Friend WithEvents ColumnHeader8 As ColumnHeader Friend WithEvents ColumnHeader9 As ColumnHeader Friend WithEvents UpdateNotesToolStripMenuItem As ToolStripMenuItem - Friend WithEvents SignOrVerifyFilesToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolStripSeparator6 As ToolStripSeparator Friend WithEvents LbDecl As Label Friend WithEvents GraphToolStripMenuItem As ToolStripMenuItem diff --git a/VECTO/GUI/MainForm.resx b/VECTO/GUI/MainForm.resx index 1ab95c20be0eb1a9777f7aae6720fb67961848f1..7a10cc6bc771ee05159f0a0d4132dbe37d358569 100644 --- a/VECTO/GUI/MainForm.resx +++ b/VECTO/GUI/MainForm.resx @@ -223,6 +223,9 @@ <metadata name="CmOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>732, 12</value> </metadata> + <metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>850, 12</value> + </metadata> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>49</value> </metadata> diff --git a/VECTO/GUI/MainForm.vb b/VECTO/GUI/MainForm.vb index 6ea4e1b2ee87e50d96e3c5368124383e164bf2da..46640a46b889d89a166ccbb70554072a5034ff79 100644 --- a/VECTO/GUI/MainForm.vb +++ b/VECTO/GUI/MainForm.vb @@ -253,31 +253,9 @@ Public Class MainForm VectoWorkerV3.WorkerReportsProgress = True VectoWorkerV3.WorkerSupportsCancellation = True - 'Set mode (Batch/Standard) ModeUpdate() - -#If DEBUG Then - Const LicCheck As Boolean = False -#Else - Const LicCheck As Boolean = True -#End If - - 'License check - If LicCheck And Not Lic.LICcheck() Then - MsgBox("License File invalid!" & vbCrLf & vbCrLf & Lic.FailMsg) - If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then - MsgBox("Activation File created.") - Else - MsgBox("Failed to create Activation File! Is Directory Read-Only?") - End If - Close() - Else - GUIMsg(MessageType.Normal, "License File validated.") - If Lic.TimeWarn Then GUIMsg(MessageType.Warn, "License expiring date (y/m/d): " & Lic.ExpTime) - End If - DeclOnOff() End Sub @@ -399,8 +377,6 @@ Public Class MainForm End Try Case ".VECTO" OpenVECTOeditor(file) - Case ".VSIG" - OpenSigFile(file) Case Else MsgBox("Type '" & GetExtension(file) & "' unknown!", MsgBoxStyle.Critical) End Select @@ -694,7 +670,7 @@ lbFound: 'Open input file Private Sub ToolStripBtOpen_Click(sender As Object, e As EventArgs) Handles ToolStripBtOpen.Click - If JobfileFileBrowser.OpenDialog("", False, "vecto,vveh,vgbx,veng,vsig") Then + If JobfileFileBrowser.OpenDialog("", False, "vecto,vveh,vgbx,veng") Then OpenVectoFile(JobfileFileBrowser.Files(0)) End If End Sub @@ -740,16 +716,6 @@ lbFound: graphForm.Show() End Sub - Private Sub SignOrVerifyFilesToolStripMenuItem_Click(sender As Object, e As EventArgs) _ - Handles SignOrVerifyFilesToolStripMenuItem.Click - If Not FileSignDialog.Visible Then - FileSignDialog.Show() - Else - If FileSignDialog.WindowState = FormWindowState.Minimized Then FileSignDialog.WindowState = FormWindowState.Normal - FileSignDialog.BringToFront() - End If - End Sub - Private Sub OpenLogToolStripMenuItem_Click(sender As Object, e As EventArgs) _ Handles OpenLogToolStripMenuItem.Click Process.Start(MyAppPath & "log.txt") @@ -787,18 +753,6 @@ lbFound: JiraDialog.ShowDialog() End Sub - Private Sub CreateActivationFileToolStripMenuItem_Click(sender As Object, e As EventArgs) _ - Handles CreateActivationFileToolStripMenuItem.Click - If MsgBox("Create Activation File ?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then - If Lic.CreateActFile(MyAppPath & "ActivationCode.dat") Then - GUIMsg(MessageType.Normal, "Activation File created.") - Else - GUIMsg(MessageType.Err, "Failed to create Activation File!") - MsgBox("ERROR! Failed to create Activation File!", MsgBoxStyle.Critical) - End If - End If - End Sub - Private Sub AboutVECTOToolStripMenuItem1_Click(sender As Object, e As EventArgs) _ Handles AboutVECTOToolStripMenuItem1.Click AboutBox.ShowDialog() @@ -1335,18 +1289,6 @@ lbFound: VectoJobForm.Activate() End Sub - 'Open signature file (.vsig) - Friend Sub OpenSigFile(file As String) - If Not FileSignDialog.Visible Then - FileSignDialog.Show() - - End If - FileSignDialog.WindowState = FormWindowState.Normal - FileSignDialog.TbSigFile.Text = file - FileSignDialog.VerifySigFile() - FileSignDialog.Activate() - End Sub - 'Save job and cycle file lists Private Sub SaveFileLists() _jobListView.SaveList() diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb index e2809573dc515e88bd8cb3ae6076ac1d4b8cc75b..ce2b03abbdff27287b6d501d5b4ca3e3e34dea92 100644 --- a/VECTO/GUI/VectoJobForm.vb +++ b/VECTO/GUI/VectoJobForm.vb @@ -1238,7 +1238,7 @@ lbDlog: engine.IdleSpeed.Value() - Dim fullLoadCurve As FullLoadCurve = EngineFullLoadCurve.Create(engine.FullLoadCurve) + Dim fullLoadCurve As EngineFullLoadCurve = FullLoadCurveReader.Create(engine.FullLoadCurve) s = New Series s.Points.DataBindXY(fullLoadCurve.FullLoadEntries.Select(Function(x) x.EngineSpeed.AsRPM).ToArray(), diff --git a/VECTO/Input Files/Engine.vb b/VECTO/Input Files/Engine.vb index 80eef36a757434b16c5f1f9c288a66ea2e7864b1..73e9e94c92796843087dff9ccd8d1e2f73ed8d0d 100644 --- a/VECTO/Input Files/Engine.vb +++ b/VECTO/Input Files/Engine.vb @@ -148,7 +148,6 @@ Public Class Engine End Sub ''' <summary> - ''' Save file. <see cref="P:VECTO.cENG.FilePath" /> must be set before calling. ''' </summary> ''' <returns>True if successful.</returns> ''' <remarks></remarks> @@ -178,7 +177,6 @@ Public Class Engine ''' <summary> - ''' Get or set Filepath before calling <see cref="M:VECTO.cENG.ReadFile" /> or <see cref="M:VECTO.cENG.SaveFile" /> ''' </summary> ''' <value></value> ''' <returns>Full filepath</returns> diff --git a/VECTO/Input Files/Gearbox.vb b/VECTO/Input Files/Gearbox.vb index c25999ffe0b93fd107e43a7574b56f535e8ec515..985ffd31b46ca79e163783d1f8921344a0ec04d4 100644 --- a/VECTO/Input Files/Gearbox.vb +++ b/VECTO/Input Files/Gearbox.vb @@ -20,6 +20,7 @@ Imports TUGraz.VectoCommon.Models Imports TUGraz.VectoCommon.Utils Imports TUGraz.VectoCore.InputData.FileIO.JSON Imports TUGraz.VectoCore.InputData.Impl +Imports TUGraz.VectoCore.InputData.Reader Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter Imports TUGraz.VectoCore.Models.SimulationComponent.Data Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Engine @@ -263,10 +264,10 @@ Public Class Gearbox .IdleSpeed = 600.RPMtoRad() } - Dim fldCurve As EngineFullLoadCurve = EngineFullLoadCurve.Create(VectoCSVFile.ReadStream(fldData)) + Dim fldCurve As EngineFullLoadCurve = FullLoadCurveReader.Create(VectoCSVFile.ReadStream(fldData)) Dim fullLoadCurves As Dictionary(Of UInteger, EngineFullLoadCurve) = New Dictionary(Of UInteger, EngineFullLoadCurve)() - fullLoadCurves(0) = EngineFullLoadCurve.Create(VectoCSVFile.ReadStream(fldData)) + fullLoadCurves(0) = FullLoadCurveReader.Create(VectoCSVFile.ReadStream(fldData)) fullLoadCurves(0).EngineData = retVal For i As Integer = 0 To gears.Count - 1 fullLoadCurves(CType(i + 1, UInteger)) = AbstractSimulationDataAdapter.IntersectFullLoadCurves(fullLoadCurves(0), diff --git a/VECTO/Libraries/vectolic.dll b/VECTO/Libraries/vectolic.dll deleted file mode 100644 index a9fa8b3aec990bda37244108eff13227cc70a9cd..0000000000000000000000000000000000000000 Binary files a/VECTO/Libraries/vectolic.dll and /dev/null differ diff --git a/VECTO/OutputData/JSONFileWriter.vb b/VECTO/OutputData/JSONFileWriter.vb index 078ef5a1a41b316861038cff841d3a0aa71e3b16..cd75ddf76eb4090ae86cb979ee68c3ce24f173c6 100644 --- a/VECTO/OutputData/JSONFileWriter.vb +++ b/VECTO/OutputData/JSONFileWriter.vb @@ -67,7 +67,7 @@ Public Class JSONFileWriter Protected Function GetHeader(fileVersion As Integer) As Dictionary(Of String, Object) Dim header As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - header.Add("CreatedBy", Lic.LicString & " (" & Lic.GUID & ")") + header.Add("CreatedBy", "") header.Add("Date", Now.ToUniversalTime().ToString("o")) header.Add("AppVersion", VECTOvers) header.Add("FileVersion", fileVersion) diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 8e8ee3c8bcb0a0ba19f3a824ab3f6f20f6872609..ae5fc514ab3eefb96066e653dc8e7ce19d7fd4bb 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -161,9 +161,6 @@ <Reference Include="System.Windows.Forms.DataVisualization" /> <Reference Include="System.Xml" /> <Reference Include="System.Xml.Linq" /> - <Reference Include="vectolic"> - <HintPath>.\vectolic.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> @@ -195,12 +192,6 @@ <SubType>Form</SubType> </Compile> <Compile Include="Input Files\AdvancedAuxiliary.vb" /> - <Compile Include="GUI\FileSignDialog.Designer.vb"> - <DependentUpon>FileSignDialog.vb</DependentUpon> - </Compile> - <Compile Include="GUI\FileSignDialog.vb"> - <SubType>Form</SubType> - </Compile> <Compile Include="GUI\GraphForm.Designer.vb"> <DependentUpon>GraphForm.vb</DependentUpon> </Compile> @@ -336,9 +327,6 @@ <EmbeddedResource Include="File Browser\FileBrowserFavoritesDialog.resx"> <DependentUpon>FileBrowserFavoritesDialog.vb</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="GUI\FileSignDialog.resx"> - <DependentUpon>FileSignDialog.vb</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="GUI\GraphForm.resx"> <DependentUpon>GraphForm.vb</DependentUpon> </EmbeddedResource> diff --git a/VECTO/VECTO_Global.vb b/VECTO/VECTO_Global.vb index c6c48b3deda86246944c20bddeb1b6b12578e40f..ed057a0acfa47ed474d3083d4291461fa5119a2c 100644 --- a/VECTO/VECTO_Global.vb +++ b/VECTO/VECTO_Global.vb @@ -11,7 +11,6 @@ Imports System.ComponentModel Imports System.IO Imports System.Text -Imports vectolic Public Module VECTO_Global Public Const VECTOvers As String = "3" @@ -25,19 +24,12 @@ Public Module VECTO_Global Public LogFile As FileLogger 'to ensure correct format for backgroundworker thread - Public VectoWorkerV3 As BackgroundWorker Public Cfg As Configuration - 'Public sKey As csKey - Public ReadOnly FileFormat As Encoding = Encoding.UTF8 - Public Lic As cLicense - 'Public VSUM As cVSUM - 'Public DEV As cDEV - Public ProgBarCtrl As ProgressbarControl @@ -256,28 +248,6 @@ Module Constants ' ReSharper disable once ClassNeverInstantiated.Global - End Module - - - - - - - - - - - - - - - - - - - - - diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 862f5604db5742afa7dfad1d028f9578b3b76eca..e0b3dda19ce31af5313ff7bbcfca876ec0de135f 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -169,7 +169,7 @@ namespace TUGraz.VectoCommon.InputData double Efficiency { get; } } - public interface IAxleDeclarationInputData : IComponentInputData + public interface IAxleDeclarationInputData { /// <summary> /// P108 diff --git a/VectoCommon/VectoCommon/Models/AuxiliaryModel.cs b/VectoCommon/VectoCommon/Models/AuxiliaryModel.cs index 3e4615fe40891a0dd13cf9390fbbc8f4e215cd83..0c5b84981b6ce378bfa47de00e35ca513c4ecec0 100644 --- a/VectoCommon/VectoCommon/Models/AuxiliaryModel.cs +++ b/VectoCommon/VectoCommon/Models/AuxiliaryModel.cs @@ -29,8 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; - namespace TUGraz.VectoCommon.Models { public enum AuxiliaryModel diff --git a/VectoCommon/VectoCommon/Models/AxleConfiguration.cs b/VectoCommon/VectoCommon/Models/AxleConfiguration.cs index 8bfd04e0688af022ff3ecd483f43ba883b623e98..a759c05c79740a94050d151aab10a1567ad0d5f8 100644 --- a/VectoCommon/VectoCommon/Models/AxleConfiguration.cs +++ b/VectoCommon/VectoCommon/Models/AxleConfiguration.cs @@ -30,7 +30,6 @@ */ using System; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using TUGraz.VectoCommon.Utils; diff --git a/VectoCommon/VectoCommon/Models/AxleLineType.cs b/VectoCommon/VectoCommon/Models/AxleLineType.cs index 4361d0ef3246112e54f9aac803ec7e5ceca58f0b..fabee912fd425fb7734f920ffddda109554d12fa 100644 --- a/VectoCommon/VectoCommon/Models/AxleLineType.cs +++ b/VectoCommon/VectoCommon/Models/AxleLineType.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; namespace TUGraz.VectoCommon.Models { diff --git a/VectoCommon/VectoCommon/Models/CertificationMethod.cs b/VectoCommon/VectoCommon/Models/CertificationMethod.cs index 04d17398eb4f90600e7f413e6ac52726c5f3489a..4ef47215e250cf04ade11465b5380ca47bccee4f 100644 --- a/VectoCommon/VectoCommon/Models/CertificationMethod.cs +++ b/VectoCommon/VectoCommon/Models/CertificationMethod.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; namespace TUGraz.VectoCommon.Models { diff --git a/VectoCommon/VectoCommon/Models/FuelType.cs b/VectoCommon/VectoCommon/Models/FuelType.cs index 36cd69a93f76dee2d6d3746a25ba4b6f2d9747a7..ea1b85a4db38ddf1c1a17e9b01cfa7ff518f9ff0 100644 --- a/VectoCommon/VectoCommon/Models/FuelType.cs +++ b/VectoCommon/VectoCommon/Models/FuelType.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; namespace TUGraz.VectoCommon.Models { diff --git a/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs b/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs index 839d77030359ce989ae7793560e58871dd6979e9..d1c98b742163d6c9f9d039dfe748cf6fc2fe41ee 100644 --- a/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs +++ b/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using TUGraz.VectoCommon.InputData; namespace TUGraz.VectoCommon.OutputData diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs index fba78bfc780fe4f0a69b271934e7b34836cb9dd6..6ef299fc708db5ea9c0cde5256b5a32b4246a38d 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs +++ b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs @@ -1,12 +1,33 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 +*/ namespace TUGraz.VectoCommon.Resources { using System; diff --git a/VectoCommon/VectoHashing/IVectoHash.cs b/VectoCommon/VectoHashing/IVectoHash.cs index 7371d981353abc9e95231d19111fbac4cb613711..b7ad1b42c20ac29e46525ceb168c6b9e224d5c79 100644 --- a/VectoCommon/VectoHashing/IVectoHash.cs +++ b/VectoCommon/VectoHashing/IVectoHash.cs @@ -1,4 +1,35 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.Linq; namespace TUGraz.VectoHashing diff --git a/VectoCommon/VectoHashing/Impl/XmlDsigVectoTransform.cs b/VectoCommon/VectoHashing/Impl/XmlDsigVectoTransform.cs index 504c791c8ee9a7096ae4dac9e1aa1b08137b6574..a9c9d48bec1946416e007a216e258b24bd24d662 100644 --- a/VectoCommon/VectoHashing/Impl/XmlDsigVectoTransform.cs +++ b/VectoCommon/VectoHashing/Impl/XmlDsigVectoTransform.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.IO; using System.Reflection; diff --git a/VectoCommon/VectoHashing/Impl/XmlHashProvider.cs b/VectoCommon/VectoHashing/Impl/XmlHashProvider.cs index 4a643d6177a601776315036d3de4d3609a8e4808..0385308d5b80b4349bcd0e0560cbe107ec73fd5f 100644 --- a/VectoCommon/VectoHashing/Impl/XmlHashProvider.cs +++ b/VectoCommon/VectoHashing/Impl/XmlHashProvider.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Security.Cryptography; using System.Security.Cryptography.Xml; using System.Xml; diff --git a/VectoCommon/VectoHashing/Properties/AssemblyInfo.cs b/VectoCommon/VectoHashing/Properties/AssemblyInfo.cs index 1940d56f15d90360e84f023a97b223b3355a60ef..bfcbbac2f0821e83d12dda09a46b1d40f1fd12c4 100644 --- a/VectoCommon/VectoHashing/Properties/AssemblyInfo.cs +++ b/VectoCommon/VectoHashing/Properties/AssemblyInfo.cs @@ -1,4 +1,35 @@ -using System.Reflection; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/VectoCommon/VectoHashing/Properties/Version.cs b/VectoCommon/VectoHashing/Properties/Version.cs index 109c12aa52a7a912a12fe6927b14b9eaa5bcb4f7..256603680a52f95c88ed2cb7a462d385ed6889c3 100644 --- a/VectoCommon/VectoHashing/Properties/Version.cs +++ b/VectoCommon/VectoHashing/Properties/Version.cs @@ -11,7 +11,7 @@ * 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 diff --git a/VectoCommon/VectoHashing/Util/XmlDocumentExtensions.cs b/VectoCommon/VectoHashing/Util/XmlDocumentExtensions.cs index a7b118e6d00a909dabbadb72b6ce25677df8a097..8b6fde08b230ca3b61b58361922562cdebef095c 100644 --- a/VectoCommon/VectoHashing/Util/XmlDocumentExtensions.cs +++ b/VectoCommon/VectoHashing/Util/XmlDocumentExtensions.cs @@ -1,4 +1,35 @@ -using System.Xml; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml; using System.Xml.Linq; namespace TUGraz.VectoHashing.Util diff --git a/VectoCommon/VectoHashing/VectoComponents.cs b/VectoCommon/VectoHashing/VectoComponents.cs index 30fa44297dbac03ae14e1c9194292eb4d9e5ae07..6eac2d2bea1c25de62fd5fd8f63e1ea530885b13 100644 --- a/VectoCommon/VectoHashing/VectoComponents.cs +++ b/VectoCommon/VectoHashing/VectoComponents.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using TUGraz.VectoCommon.Resources; namespace TUGraz.VectoHashing diff --git a/VectoCommon/VectoHashing/VectoHash.cs b/VectoCommon/VectoHashing/VectoHash.cs index f7ef4c6305ce0d2ac146a6ed1bfee6bf19012299..e8c68861f31203834e0406db0624635360bf70e9 100644 --- a/VectoCommon/VectoHashing/VectoHash.cs +++ b/VectoCommon/VectoHashing/VectoHash.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections; using System.Collections.Generic; using System.IO; diff --git a/VectoCommon/VectoHashingTest/BasicHasingTests.cs b/VectoCommon/VectoHashingTest/BasicHasingTests.cs index be994e4a9ed797c43ededea301f038ee659bbc64..85759f1701cd3dfc811d2f04e3a7c332cb9aefa8 100644 --- a/VectoCommon/VectoHashingTest/BasicHasingTests.cs +++ b/VectoCommon/VectoHashingTest/BasicHasingTests.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Text; using System.Xml; using System.Xml.XPath; diff --git a/VectoCommon/VectoHashingTest/Properties/AssemblyInfo.cs b/VectoCommon/VectoHashingTest/Properties/AssemblyInfo.cs index 455800ff08541e37d1036a0602fd316cbeff8a99..697edd6fd11f60c3a76bde927dc0db3c3dde3454 100644 --- a/VectoCommon/VectoHashingTest/Properties/AssemblyInfo.cs +++ b/VectoCommon/VectoHashingTest/Properties/AssemblyInfo.cs @@ -1,4 +1,35 @@ -using System.Reflection; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/VectoCommon/VectoHashingTest/Utils/AssertHelper.cs b/VectoCommon/VectoHashingTest/Utils/AssertHelper.cs index 72ef0f1256c8d41f6eae2651d344f931c17eb08f..122d5f5755f2b68ea00a37c3f9c4dd55c7400f29 100644 --- a/VectoCommon/VectoHashingTest/Utils/AssertHelper.cs +++ b/VectoCommon/VectoHashingTest/Utils/AssertHelper.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Diagnostics; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/VectoCommon/VectoHashingTest/VectoHashTest.cs b/VectoCommon/VectoHashingTest/VectoHashTest.cs index ddad6df508ea148a8e908afae8738b48e486c244..530e7ec536e88686d82ba8962565675c22c07a4c 100644 --- a/VectoCommon/VectoHashingTest/VectoHashTest.cs +++ b/VectoCommon/VectoHashingTest/VectoHashTest.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.IO; using System.Linq; using System.Security.Cryptography; diff --git a/VectoCommon/VectoHashingTest/VectoHashingTest.csproj b/VectoCommon/VectoHashingTest/VectoHashingTest.csproj index 59549b68fb3f1b6bccfd92236ff65ba2882d6662..44a0b41d1f178cfc2d334bbf41b5a51adf634de6 100644 --- a/VectoCommon/VectoHashingTest/VectoHashingTest.csproj +++ b/VectoCommon/VectoHashingTest/VectoHashingTest.csproj @@ -1,205 +1,209 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{760C1C5B-A767-463E-BA85-F0BCFC23A550}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>VectoHashingTest</RootNamespace> - <AssemblyName>VectoHashingTest</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileAlignment>512</FileAlignment> - <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> - <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> - <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> - <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> - <IsCodedUITest>False</IsCodedUITest> - <TestProjectType>UnitTest</TestProjectType> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="nunit.framework"> - <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Security" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Xml.Linq" /> - </ItemGroup> - <Choose> - <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> - <ItemGroup> - <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> - </ItemGroup> - </When> - <Otherwise> - <ItemGroup> - <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> - </ItemGroup> - </Otherwise> - </Choose> - <ItemGroup> - <Compile Include="BasicHasingTests.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Utils\AssertHelper.cs" /> - <Compile Include="VectoHashTest.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="packages.config" /> - </ItemGroup> - <ItemGroup> - <Content Include="Testdata\XML\Invalid\duplicate-sig.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Invalid\invalid-comp.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Reference\vecto_engine-sample.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Reference\vecto_vehicle-sample_FULL.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\simple_document.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\multiple_components.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_engine-input.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_engine_withhash-input.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_engine_withid-input.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_gearbox-input.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_gearbox-input_nodata.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle2.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_engine_invalid.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_engine_valid.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_gearbox_invalid.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_gearbox_valid.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_vehicle_components_invalid.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Validation\vecto_vehicle_components_valid-engine_gbx.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding ISO 8859-15.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-16 BE BOM.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-16 LE.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-8 BOM.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-8.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding windows-1292.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_engine-sample_Whitespaces.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-namespace_prefix.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Comments.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Entry_Order.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Linux_LF.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Mac_CR.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Windows_CRLF.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\VectoCore\VectoCore\VectoCore.csproj"> - <Project>{CD36938A-ADD9-4C65-96DA-B397CDEEA90A}</Project> - <Name>VectoCore</Name> - </ProjectReference> - <ProjectReference Include="..\VectoHashing\VectoHashing.csproj"> - <Project>{B673E12F-D323-4C4C-8805-9915B2C72D3D}</Project> - <Name>VectoHashing</Name> - </ProjectReference> - </ItemGroup> - <Choose> - <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> - <ItemGroup> - <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <Private>False</Private> - </Reference> - </ItemGroup> - </When> - </Choose> - <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{760C1C5B-A767-463E-BA85-F0BCFC23A550}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>VectoHashingTest</RootNamespace> + <AssemblyName>VectoHashingTest</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> + <IsCodedUITest>False</IsCodedUITest> + <TestProjectType>UnitTest</TestProjectType> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="nunit.framework"> + <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Security" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Xml.Linq" /> + </ItemGroup> + <Choose> + <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> + </ItemGroup> + </When> + <Otherwise> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> + </ItemGroup> + </Otherwise> + </Choose> + <ItemGroup> + <Compile Include="BasicHasingTests.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Utils\AssertHelper.cs" /> + <Compile Include="VectoHashTest.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <Content Include="Testdata\XML\Invalid\duplicate-sig.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Invalid\invalid-comp.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Reference\vecto_engine-sample.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Reference\vecto_vehicle-sample_FULL.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\simple_document.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\multiple_components.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_engine-input.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_engine_withhash-input.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_engine_withid-input.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_gearbox-input.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_gearbox-input_nodata.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle1.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample_3axle2.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\ToHash\vecto_vehicle-sample.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_engine_invalid.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_engine_valid.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_gearbox_invalid.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_gearbox_valid.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_vehicle_components_invalid.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Validation\vecto_vehicle_components_valid-engine_gbx.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding ISO 8859-15.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-16 BE BOM.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-16 LE.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-8 BOM.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding UTF-8.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample Encoding windows-1292.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_engine-sample_Whitespaces.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-namespace_prefix.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Comments.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Entry_Order.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Linux_LF.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Mac_CR.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Testdata\XML\Variations\vecto_vehicle-sample_FULL_Newlines_Windows_CRLF.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\VectoCore\VectoCore\VectoCore.csproj"> + <Project>{cd36938a-add9-4c65-96da-b397cdeea90a}</Project> + <Name>VectoCore</Name> + </ProjectReference> + <ProjectReference Include="..\VectoCommon\VectoCommon.csproj"> + <Project>{79a066ad-69a9-4223-90f6-6ed5d2d084f4}</Project> + <Name>VectoCommon</Name> + </ProjectReference> + <ProjectReference Include="..\VectoHashing\VectoHashing.csproj"> + <Project>{B673E12F-D323-4C4C-8805-9915B2C72D3D}</Project> + <Name>VectoHashing</Name> + </ProjectReference> + </ItemGroup> + <Choose> + <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + </ItemGroup> + </When> + </Choose> + <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> - --> + --> </Project> \ No newline at end of file diff --git a/VectoConsole/Properties/Version.cs b/VectoConsole/Properties/Version.cs index 67602aa5f34921410d84cf74df940b09d5048128..ff03ab9d2bd6db691aeac948bf2b3c4776155443 100644 --- a/VectoConsole/Properties/Version.cs +++ b/VectoConsole/Properties/Version.cs @@ -11,7 +11,7 @@ * 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 @@ -29,8 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ - - using System.Reflection; [assembly: AssemblyVersion("3.1.1.810")] [assembly: AssemblyFileVersion("3.1.1.810")] diff --git a/VectoCore/VectoCore/Configuration/Constants.cs b/VectoCore/VectoCore/Configuration/Constants.cs index 806864cf64dcff63eb588516417b3235d95f9c6e..3641ab2a9f69758c1fcc0bb78daa80927c9722c0 100644 --- a/VectoCore/VectoCore/Configuration/Constants.cs +++ b/VectoCore/VectoCore/Configuration/Constants.cs @@ -40,9 +40,6 @@ namespace TUGraz.VectoCore.Configuration public const double Kilo = 1000; public const double MeterPerSecondToKMH = 3.6; - // mk-2016-10-11: const never used. Delete? - [Obsolete] public const double SecondsPerHour = 3600; - public static class Auxiliaries { public const string Cycle = "cycle"; @@ -124,10 +121,6 @@ namespace TUGraz.VectoCore.Configuration /// </summary> public static readonly Radian DrivingCycleRoadGradientTolerance = 1E-12.SI<Radian>(); - //VectoMath.InclinationToAngle(0.25 / 100.0).Value(); - - public const int DriverSearchLoopThreshold = 200; - /// <summary> /// Tolerance for searching operating point with line search. /// </summary> @@ -144,11 +137,9 @@ namespace TUGraz.VectoCore.Configuration public static readonly MeterPerSecond ATGearboxDisengageWhenHaltingSpeed = 5.KMPHtoMeterPerSecond(); - public static readonly MeterPerSquareSecond MinimumAcceleration = 0.1.SI<MeterPerSquareSecond>(); - - public static Meter DriverActionDistanceTolerance = 0.25.SI<Meter>(); + public static readonly Meter DriverActionDistanceTolerance = 0.25.SI<Meter>(); - public static MeterPerSecond VehicleSpeedHaltTolerance = 1e-3.SI<MeterPerSecond>(); + public static readonly MeterPerSecond VehicleSpeedHaltTolerance = 1e-3.SI<MeterPerSecond>(); /// <summary> /// The initial search interval for the operating point search in the driver. @@ -158,19 +149,12 @@ namespace TUGraz.VectoCore.Configuration public static readonly PerSecond EngineIdlingSearchInterval = 10.SI<PerSecond>(); - public const int EngineSearchLoopThreshold = 100; - public const int MaximumIterationCountForSimulationStep = 30; - public static readonly MeterPerSecond VehicleStopClutchDisengageSpeed = 10.KMPHtoMeterPerSecond(); - public static readonly Meter GearboxLookaheadForAccelerationEstimation = 100.SI<Meter>(); - public static Kilogram MaximumGrossVehicleWeight = 40000.SI<Kilogram>(); - public static Kilogram MaximumGrossVehicleWeightEMS = 60000.SI<Kilogram>(); - - // the torque converter characteristics curve has to be defined up to this speed ratio - public const double RequiredTorqueConverterSpeedRatio = 2.2; + public static readonly Kilogram MaximumGrossVehicleWeight = 40000.SI<Kilogram>(); + public static readonly Kilogram MaximumGrossVehicleWeightEMS = 60000.SI<Kilogram>(); } public static class XML diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs index 1518f394d189391c3c6cb7322a3058bfbb453dff..09458a755462727b2034e92c4760930df0d1f491 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs @@ -172,7 +172,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public IDriverEngineeringInputData DriverInputData { - get { return DriverInputData; } + get { throw new NotImplementedException(); } } public IPTOTransmissionInputData PTOTransmissionInputData @@ -180,6 +180,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return PTOTransmission; } } - public XElement XMLHash { get { return null; } } + public XElement XMLHash + { + get { return null; } + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs index eced7e2b039587dfd85b12f3ce8001175f25241c..40c51b99237df7b314571c3891e69e39f783980a 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs @@ -241,11 +241,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return "N/A"; } } - public string TechnicalReportId - { - get { return "N/A"; } - } - public CertificationMethod CertificationMethod { get { return CertificationMethod.NotCertified; } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs index cefd8c1086532aba7b75c9a672fc5a92e90d0b24..53f8f9d710f044357290eb380309baf20e6b95de 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs @@ -484,21 +484,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Body.GetEx<string>(JsonKeys.Gearbox_ModelName); } } - public string Creator - { - get { return "N/A"; } - } - public string Date { get { return "N/A"; } } - public string TechnicalReportId - { - get { return "N/A"; } - } - public CertificationMethod CertificationMethod { get { return CertificationMethod.NotCertified; } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 3bc2b7ce19b77b193425a9f2843ce70013765dbd..90a1b7ae8e3c65dbe313b11051d1d3957b767244 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -53,12 +53,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON private readonly string _sourceFile; - protected readonly JObject Header; protected readonly JObject Body; protected JSONFile(JObject data, string filename, bool tolerateMissing = false) { - Header = (JObject)data.GetEx(JsonKeys.JsonHeader); + //var header = (JObject)data.GetEx(JsonKeys.JsonHeader); Body = (JObject)data.GetEx(JsonKeys.JsonBody); _sourceFile = Path.GetFullPath(filename); TolerateMissing = tolerateMissing; @@ -129,11 +128,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON protected readonly IGearboxEngineeringInputData Gearbox; protected readonly IAxleGearInputData AxleGear; protected readonly ITorqueConverterEngineeringInputData TorqueConverter; - protected IAngledriveInputData Angledrive; + protected readonly IAngledriveInputData Angledrive; protected readonly IEngineEngineeringInputData Engine; - protected IVehicleEngineeringInputData VehicleData; - protected IRetarderInputData Retarder; - protected IPTOTransmissionInputData PTOTransmission; + protected readonly IVehicleEngineeringInputData VehicleData; + protected readonly IRetarderInputData Retarder; + protected readonly IPTOTransmissionInputData PTOTransmission; private readonly string _jobname; protected internal IAirdragEngineeringInputData AirdragData; diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index b0f30c2c3c616d735c46ca9146a13070f426a45c..1c94164cb9175244aa8207c95e59bed08f75cae5 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -358,21 +358,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return "N.A."; } } - public string Creator - { - get { return "N/A"; } - } - public string Date { get { return "N/A"; } } - public string TechnicalReportId - { - get { return "N.A."; } - } - public CertificationMethod CertificationMethod { get { return CertificationMethod.NotCertified; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/AbstractDeclarationXMLComponentDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/AbstractDeclarationXMLComponentDataProvider.cs index d1ae9de14aa37daa74c6c5a566de762918a838ab..479a93f1ab839308aa5141e4ba1a3784d25505ee 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/AbstractDeclarationXMLComponentDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/AbstractDeclarationXMLComponentDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using System.Xml; @@ -31,7 +62,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration { InputData = xmlInputDataProvider; Navigator = xmlInputDataProvider.Document.CreateNavigator(); - Manager = new XmlNamespaceManager(Navigator.NameTable); + Manager = new XmlNamespaceManager(Navigator.NameTable ?? new NameTable()); Helper = new XPathHelper(ExecutionMode.Declaration); Helper.AddNamespaces(Manager); @@ -101,7 +132,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration { var path = Helper.Query(XBasePath, relativePath.Any() ? relativePath : null); - var node = Navigator.SelectSingleNode(path.ToString(), Manager); + var node = Navigator.SelectSingleNode(path, Manager); if (node == null) { throw new VectoException("Node {0} not found in input data", path); } @@ -129,6 +160,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration XPathNavigator origin = null) { var startNode = origin ?? Navigator.SelectSingleNode(XBasePath, Manager); + if (startNode == null) { + throw new VectoException("start node for base-path {0} not found!", XBasePath); + } var table = new TableData(); foreach (var entry in attributeMapping) { if (startNode.Select(Helper.Query(relativePath, "@" + entry.Value), Manager).Count == 0) { diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAirdragDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAirdragDataProvider.cs index 628364e6f407dd4701ebaec231e764af75b6b94b..f921a8d1e2af6810696526f7a344c6fd1532ee4f 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAirdragDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAirdragDataProvider.cs @@ -1,4 +1,34 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAngledriveDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAngledriveDataProvider.cs index ecdcc756b014d97e76988b65bc8d6bc76d6a7b21..c3ec4ce802a0f56004a6be8d9ac2a57af9c296b3 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAngledriveDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAngledriveDataProvider.cs @@ -1,4 +1,35 @@ -using TUGraz.IVT.VectoXML; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAuxiliaryDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAuxiliaryDataProvider.cs index 51f26834febb598485454744222124a243579fd5..5ab4647ef05aec0906f3c22900b2aba2d7d44e97 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAuxiliaryDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAuxiliaryDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAxlegearDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAxlegearDataProvider.cs index 3136d639513e0348059f77a9b948aec5d98ee803..6fc74dfd724de6ccb284eded5c5390abf7d2087e 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAxlegearDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationAxlegearDataProvider.cs @@ -1,4 +1,34 @@ -using System.ComponentModel.DataAnnotations; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationDriverDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationDriverDataProvider.cs index eb6fbcc25f830441b24511451a9e15d10199a665..7802aaed52e94ea61d8b5530dbd3ba65031c9628 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationDriverDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationDriverDataProvider.cs @@ -1,8 +1,37 @@ -using System.Xml; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.InputData.Impl; -using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration { diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs index c034d2cdd19541a2fb23fbd0ab5c3e85ade5168d..35f1d686164c6834947c2d4be69098eb9f67a7d1 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs @@ -1,4 +1,35 @@ -using TUGraz.IVT.VectoXML; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationGearboxDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationGearboxDataProvider.cs index a620842e1e2f73b09a44cc6f1cc83fa41ca57703..3c026c86b60c00c0b0ec7b8488076c29da396993 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationGearboxDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationGearboxDataProvider.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.Xml; using TUGraz.IVT.VectoXML; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationInputDataProvider.cs index f2b10b5cee41d5b7627c64811aac2c43a045130d..f0efac2e7f92d84b7fa686bf1a4bdd8f84bef534 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationInputDataProvider.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; @@ -12,7 +43,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration { public class XMLDeclarationInputDataProvider : IDeclarationInputDataProvider { - internal XPathDocument Document; + internal readonly XPathDocument Document; private readonly IAuxiliariesDeclarationInputData XMLAuxiliaryData; private readonly IDriverDeclarationInputData XMLDriverData; @@ -28,7 +59,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration //XmlSchemaValidationFlags.ProcessSchemaLocation | XmlSchemaValidationFlags.ReportValidationWarnings }; - settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack); + settings.ValidationEventHandler += ValidationCallBack; settings.Schemas.Add(GetXMLSchema("")); inputData = XmlReader.Create(inputData, settings); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationJobInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationJobInputDataProvider.cs index eda7fb2898a0c5cec6f7dcc157b3b9d028dad39d..b14c82c3c0434a03b1912267b18e5d5926ec4cea 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationJobInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationJobInputDataProvider.cs @@ -1,4 +1,35 @@ -using TUGraz.VectoCommon.InputData; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationRetarderDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationRetarderDataProvider.cs index c2c1190d9a2dbb3fd4c5162677f6ff550b356c62..a62dc6e0bb44d8a3a39d3495ea05b9524480b03b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationRetarderDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationRetarderDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationTorqueConverterDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationTorqueConverterDataProvider.cs index b4b72b8980940bbdba0114bdebb999064ca193e6..9e69cf1e07e16739a170197f4876eef336c0d7d8 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationTorqueConverterDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationTorqueConverterDataProvider.cs @@ -1,4 +1,35 @@ -using TUGraz.IVT.VectoXML; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs index 9d36b013a300d748c1c8c9a9244f77bd34e39c4d..8ccdc2d5b4149977de835720726e3e907fc0de3d 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.Linq; @@ -65,13 +96,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration } } - - public SquareMeter AirDragArea - { - get { return GetDoubleElementValue(XMLNames.Vehicle_AirDragArea).SI<SquareMeter>(); } - } - - public AxleConfiguration AxleConfiguration { get { return AxleConfigurationHelper.Parse(GetElementValue(XMLNames.Vehicle_AxleConfiguration)); } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/AbstractEngineeringXMLComponentDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/AbstractEngineeringXMLComponentDataProvider.cs index 4397439ce2e65d4650f662624fa36ed2d25a4c28..e6095be978448cdb88ae04a31493b0de3fd3ebe0 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/AbstractEngineeringXMLComponentDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/AbstractEngineeringXMLComponentDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Xml; using System.Xml.XPath; @@ -19,9 +50,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering protected readonly XPathDocument XMLDocument; - //protected const string VehiclePath = "/VectoInputEngineering/Vehicle"; - - public AbstractEngineeringXMLComponentDataProvider(XMLEngineeringInputDataProvider xmlEngineeringJobInputDataProvider, + protected AbstractEngineeringXMLComponentDataProvider( + XMLEngineeringInputDataProvider xmlEngineeringJobInputDataProvider, XPathDocument document, string xmlBasePath, string fsBasePath) { XMLDocument = document; @@ -29,7 +59,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering FSBasePath = fsBasePath; InputData = xmlEngineeringJobInputDataProvider; Navigator = document.CreateNavigator(); - Manager = new XmlNamespaceManager(Navigator.NameTable); + Manager = new XmlNamespaceManager(Navigator.NameTable ?? new NameTable()); Helper = new XPathHelper(ExecutionMode.Engineering); Helper.AddNamespaces(Manager); @@ -53,7 +83,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering get { return GetElementValue(XMLNames.Component_Model); } } - + public override string Date { get { return GetElementValue(XMLNames.Component_Date); } @@ -71,10 +101,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering public override CertificationMethod CertificationMethod { - get { return CertificationMethod.NotCertified;} + get { return CertificationMethod.NotCertified; } } - + protected TableData ReadCSVResourceFile(string relPath) { if (!ElementExists(Helper.Query(relPath, ExtCsvResourceTag))) { diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAirdragDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAirdragDataProvider.cs index e97f216e482ba4e3275161a12135875e97c2b24e..534f23669ecddd7819b1a2903b8428c4fa2ae36b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAirdragDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAirdragDataProvider.cs @@ -1,4 +1,34 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAngledriveDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAngledriveDataProvider.cs index c13802ae7672bb2398da669aa893245b9db494fe..d0780b1a3d4c3ef5f5aaf6468a43fbaf14aafa5f 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAngledriveDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAngledriveDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; @@ -13,7 +44,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering public AngledriveType Type { - get { return InputData._vehicleInputData.AngledriveType; } + get { return InputData.VehicleData.AngledriveType; } } public double Ratio diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAuxiliaryDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAuxiliaryDataProvider.cs index 13f5364ebf4e8754bf23f78ffd43a0a45e349e9d..00a4bdb234d5684d5854383a9c6d768be5385a98 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAuxiliaryDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAuxiliaryDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Linq; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAxlegearDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAxlegearDataProvider.cs index f5837fcbcd69e451c5ebfa1eb80f7237c30ee5fb..6a7316a1e9dc75ec6f3d0affbda64f98d1debb50 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAxlegearDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringAxlegearDataProvider.cs @@ -1,4 +1,35 @@ -using System.Xml.XPath; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringDriverDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringDriverDataProvider.cs index 03c9fbc543cac3fc99b7fd5a7f45e0c36d42ba84..94de59bd8e5ca698fb5c80aa563ff576afc11f50 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringDriverDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringDriverDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.IO; using System.Xml; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringEngineDataProvider.cs index e3b159ae5d4377eeef1727473d54c09cb52978b4..433866eab031864040c15ff80d297724cb7c64ad 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringEngineDataProvider.cs @@ -1,4 +1,34 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.Exceptions; @@ -6,7 +36,6 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader; namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering { diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringGearboxDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringGearboxDataProvider.cs index f756df129aa2ea700aac69fb50a135e83fdbc391..bce5f00c55661b80963c361d1f92f75b01e4fa93 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringGearboxDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringGearboxDataProvider.cs @@ -1,4 +1,35 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml; using System.Xml.XPath; using TUGraz.IVT.VectoXML; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringInputDataProvider.cs index adad476b88d37dfe7de98605779d002a4b5f693b..c18a55d51f1b02d2a622d33bd5854e118de0bc2e 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringInputDataProvider.cs @@ -1,4 +1,35 @@ -using System.IO; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Xml; using System.Xml.Schema; using System.Xml.XPath; @@ -20,8 +51,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering protected internal XMLEngineeringAuxiliaryDataProvider XMLEngineeringAuxiliaryData; protected internal XMLEngineeringDriverDataProvider XMLEngineeringDriverData; protected internal XMLEngineeringJobInputDataProvider XMLEngineeringJobData; - protected internal XMLEngineeringVehicleDataProvider _vehicleInputData; - protected internal XMLEngineeringAxlegearDataProvider _axleGearInputData; + protected internal XMLEngineeringVehicleDataProvider VehicleData; + protected internal XMLEngineeringAxlegearDataProvider AxlegearData; public XMLEngineeringInputDataProvider(string filename, bool verifyXml) { @@ -64,7 +95,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering //XmlSchemaValidationFlags.ProcessSchemaLocation | XmlSchemaValidationFlags.ReportValidationWarnings }; - settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack); + settings.ValidationEventHandler += ValidationCallBack; settings.Schemas.Add(GetXMLSchema("")); } try { @@ -100,16 +131,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering } ReadVehicle(settings); - XMLEngineeringDriverData = XMLEngineeringJobData.GetDriverData(settings); - _axleGearInputData = _vehicleInputData.GetAxleGearInputData(settings); - AngledriveInputData = _vehicleInputData.GetAngularGearInputData(settings); - EngineInputData = _vehicleInputData.GetEngineInputData(settings); - RetarderInputData = _vehicleInputData.GetRetarderInputData(settings); - XMLEngineeringAuxiliaryData = _vehicleInputData.GetAuxiliaryData(settings); - GearboxInputData = _vehicleInputData.GetGearboxData(settings); + XMLEngineeringDriverData = XMLEngineeringJobData.GetDriverData(); + AxlegearData = VehicleData.GetAxleGearInputData(settings); + AngledriveInputData = VehicleData.GetAngularGearInputData(); + EngineInputData = VehicleData.GetEngineInputData(settings); + RetarderInputData = VehicleData.GetRetarderInputData(settings); + XMLEngineeringAuxiliaryData = VehicleData.GetAuxiliaryData(settings); + GearboxInputData = VehicleData.GetGearboxData(settings); TorqueConverterInputData = GearboxInputData.TorqueConverter; - PTOTransmissionInputData = _vehicleInputData.GetPTOData(settings); - AirdragInputData = _vehicleInputData.GetAirdragInputData(settings); + PTOTransmissionInputData = VehicleData.GetPTOData(); + AirdragInputData = VehicleData.GetAirdragInputData(settings); } private static void ValidationCallBack(object sender, ValidationEventArgs args) @@ -131,7 +162,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering helper.AddNamespaces(manager); var vehicle = nav.SelectSingleNode(vehiclePath, manager); if (vehicle != null) { - _vehicleInputData = new XMLEngineeringVehicleDataProvider(this, Document, vehiclePath, + VehicleData = new XMLEngineeringVehicleDataProvider(this, Document, vehiclePath, Path.GetDirectoryName(Path.GetFullPath(FileName))); return; } @@ -150,7 +181,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering helper.QueryAbs( helper.NSPrefix("VectoComponentEngineering", Constants.XML.RootNSPrefix), XMLNames.Component_Vehicle); - _vehicleInputData = new XMLEngineeringVehicleDataProvider(this, vehicleDocument, vehicleCompPath, + VehicleData = new XMLEngineeringVehicleDataProvider(this, vehicleDocument, vehicleCompPath, Path.GetDirectoryName(Path.GetFullPath(Path.Combine(Path.GetDirectoryName(FileName) ?? "./", vehicleFile)))); return; } catch (XmlSchemaValidationException validationException) { @@ -178,7 +209,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering public IVehicleEngineeringInputData VehicleInputData { - get { return _vehicleInputData; } + get { return VehicleData; } } public IAirdragEngineeringInputData AirdragInputData { get; private set; } @@ -190,7 +221,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering public IAxleGearInputData AxleGearInputData { - get { return _axleGearInputData; } + get { return AxlegearData; } } public IAngledriveInputData AngledriveInputData { get; private set; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringJobInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringJobInputDataProvider.cs index 05e1a399c791f57b45032a430c3f5e162ab5945a..546ae85752aee4d55523d594607ec0ee8a8ddbae 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringJobInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringJobInputDataProvider.cs @@ -1,4 +1,35 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Xml; using System.Xml.XPath; @@ -120,7 +151,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering get { return InputData.JobInputData().EngineOnlyMode ? InputData.EngineInputData.Model - : InputData._vehicleInputData.GetVehicleID; + : InputData.VehicleData.GetVehicleID; } } @@ -221,7 +252,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering } } - public XMLEngineeringDriverDataProvider GetDriverData(XmlReaderSettings settings) + public XMLEngineeringDriverDataProvider GetDriverData() { return new XMLEngineeringDriverDataProvider(InputData, XMLDocument, XBasePath, FSBasePath); } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringRetarderDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringRetarderDataProvider.cs index 5bab7e6f5043236885b4bf13d6279cb467313c54..c4a62ea94b51ecbcbb3d740a9302dc4960a5f516 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringRetarderDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringRetarderDataProvider.cs @@ -1,10 +1,39 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.InputData.Reader.ComponentData; namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering { @@ -16,12 +45,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering public RetarderType Type { - get { return InputData._vehicleInputData.RetarderType; } + get { return InputData.VehicleData.RetarderType; } } public double Ratio { - get { return InputData._vehicleInputData.RetarderRatio; } + get { return InputData.VehicleData.RetarderRatio; } } public TableData LossMap @@ -29,10 +58,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering get { if (ElementExists(Helper.Query(XMLNames.Retarder_RetarderLossMap, XMLNames.Retarder_RetarderLossMap_Entry))) { - var mapping = new Dictionary<string, string> { - { XMLNames.Retarder_RetarderLossmap_RetarderSpeed_Attr, RetarderLossMapReader.Fields.RetarderSpeed }, - { XMLNames.Retarder_RetarderLossmap_TorqueLoss_Attr, RetarderLossMapReader.Fields.TorqueLoss } - }; return ReadTableData(AttributeMappings.RetarderLossmapMapping, Helper.Query(XMLNames.Retarder_RetarderLossMap, XMLNames.Retarder_RetarderLossMap_Entry)); } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringTorqueConverterDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringTorqueConverterDataProvider.cs index 42bb53b9855bcf396119a2c2c256d22b078d180b..d4499ab450cab43286c5706f8d159a220fe30828 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringTorqueConverterDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringTorqueConverterDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Xml.XPath; using TUGraz.IVT.VectoXML; using TUGraz.VectoCommon.InputData; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringVehicleDataProvider.cs index 506781fcfa97aabdc5b8e2b4fe61105b42e290f9..51c7aa0cac35f8c51cb6e7fe3b57be4a26f7f114 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/XMLEngineeringVehicleDataProvider.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.IO; @@ -13,7 +44,6 @@ using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.Impl; -using TUGraz.VectoCore.Models.Declaration; namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering { @@ -257,7 +287,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering throw new VectoException("Component {0} not found!", componentName); } - public XMLEngineeringAngledriveDataProvider GetAngularGearInputData(XmlReaderSettings settings) + public XMLEngineeringAngledriveDataProvider GetAngularGearInputData() { return new XMLEngineeringAngledriveDataProvider(InputData, XMLDocument, Helper.Query(XBasePath, XMLNames.Vehicle_Components, XMLNames.Component_Angledrive, XMLNames.ComponentDataWrapper) @@ -266,7 +296,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering #region "PTO" - public IPTOTransmissionInputData GetPTOData(XmlReaderSettings settings) + public IPTOTransmissionInputData GetPTOData() { return this; } diff --git a/VectoCore/VectoCore/InputData/Impl/InputData.cs b/VectoCore/VectoCore/InputData/Impl/InputData.cs index 7817248f8b13dc7680d3c63667c56d9900f72431..2cf2e38474fb9c16315d837e51ac4af51003be1d 100644 --- a/VectoCore/VectoCore/InputData/Impl/InputData.cs +++ b/VectoCore/VectoCore/InputData/Impl/InputData.cs @@ -30,7 +30,6 @@ */ using System.Collections.Generic; -using System.Data; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -100,20 +99,6 @@ namespace TUGraz.VectoCore.InputData.Impl public string Source { get; internal set; } - public string Manufacturer { get; internal set; } - - public string Model { get; internal set; } - - public string Date { get; internal set; } - - public string TechnicalReportId { get; internal set; } - - public CertificationMethod CertificationMethod { get; internal set; } - - public string CertificationNumber { get; internal set; } - - public string DigestValue { get; internal set; } - public string Wheels { get; internal set; } public bool TwinTyres { get; internal set; } diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs index ea04f91475282503c24bf66b416d5d54f791e627..b91df9cffcd4bf39c1c1d2fdbe8625aeb423ac97 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs @@ -42,7 +42,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.Reader.ComponentData { - public class AccelerationCurveReader + public static class AccelerationCurveReader { public static AccelerationCurveData ReadFromStream(Stream stream) { diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs index c3cfb24d4d8ecae196c68ae29068696f01aaf5c0..a12bcf233bf31659457ac9be1d377d5d9e2611c5 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/AuxiliaryDataReader.cs @@ -30,9 +30,6 @@ */ using System.Data; -using System.IO; -using System.Text; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.SimulationComponent.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs index be941535acd2cf16098e93d6c5d1feb8746fe80e..d1017ec3c3817f47e928ad749fcea0c241b9456c 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs @@ -29,9 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Data; using System.Diagnostics; using System.IO; @@ -59,15 +57,6 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData }.ToList(); } - // TODO mk2017-04-24: remove this method? static code analysis says it is not used. - [Obsolete("Is this still used? Static Code Analysis says No.", true)] - public static List<CrossWindCorrectionEntry> ReadSpeedDependentCorrectionFromFile(string fileName, - SquareMeter aerodynamicDragArea) - { - var data = VectoCSVFile.Read(fileName); - return ParseSpeedDependent(data, aerodynamicDragArea); - } - public static List<CrossWindCorrectionEntry> ReadSpeedDependentCorrectionCurveFromStream(Stream inputData, SquareMeter aerodynamicDragArea) { diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/PTOIdleLossMapReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/PTOIdleLossMapReader.cs index e03cbb248e78366b9312d48370ca1de1db879d08..2fb38d0b9648298f7764c2c9984fe481b63f818f 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/PTOIdleLossMapReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/PTOIdleLossMapReader.cs @@ -36,7 +36,6 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Utils; @@ -44,19 +43,6 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public static class PTOIdleLossMapReader { - /// <summary> - /// Read the retarder loss map from a file. - /// </summary> - /// <param name="fileName"></param> - /// <returns></returns> - public static PTOLossMap ReadFromFile(string fileName) - { - try { - return Create(VectoCSVFile.Read(fileName)); - } catch (Exception ex) { - throw new VectoException("ERROR while loading PTO Idle LossMap: " + ex.Message); - } - } public static PTOLossMap ReadFromStream(Stream stream) { diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs index 2f697de424a86d57d8155816358311852f54b57c..5562408687062c31720e6ffab784c42d7308e249 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs @@ -42,7 +42,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.Reader.ComponentData { - public class TorqueConverterDataReader + public static class TorqueConverterDataReader { public static TorqueConverterData ReadFromFile(string filename, PerSecond referenceRpm, PerSecond maxRpm, ExecutionMode mode, double ratio, MeterPerSquareSecond lcMinAcceleration, MeterPerSquareSecond ccMinAcceleration) diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs index 0d95a4d4cf1e3b23540314a6970791b209748149..4ab5e65d5704f55d2ab793fbd8054709b255095c 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs @@ -41,7 +41,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.Reader.ComponentData { - public sealed class TransmissionLossMapReader + public static class TransmissionLossMapReader { public static TransmissionLossMap ReadFromFile(string fileName, double gearRatio, string gearName) { diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs index 4bd060470e0c18a4d2bb33434fca5171c0b6e0d9..5244265f0a0b6eb5a8f370a7cadfab1eb7cb2b1e 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs @@ -37,7 +37,6 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader.ComponentData; -using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; @@ -153,7 +152,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter }; } - protected TransmissionLossMap CreateGearLossMap(ITransmissionInputData gear, uint i, bool useEfficiencyFallback, bool extendLossMap) + protected TransmissionLossMap CreateGearLossMap(ITransmissionInputData gear, uint i, bool useEfficiencyFallback, + bool extendLossMap) { if (gear.LossMap != null) { return TransmissionLossMapReader.Create(gear.LossMap, gear.Ratio, string.Format("Gear {0}", i + 1), extendLossMap); @@ -164,7 +164,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter throw new InvalidFileFormatException("Gear {0} LossMap missing.", i + 1); } - protected static void CreateTCSecondGearATSerial(IGearboxDeclarationInputData gearbox, GearData gearData, + protected static void CreateTCSecondGearATSerial(GearData gearData, ShiftPolygon shiftPolygon) { gearData.TorqueConverterRatio = gearData.Ratio; @@ -172,7 +172,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter gearData.TorqueConverterShiftPolygon = shiftPolygon; } - protected static void CreateTCFirstGearATSerial(IGearboxDeclarationInputData gearbox, GearData gearData, + protected static void CreateTCFirstGearATSerial(GearData gearData, ShiftPolygon shiftPolygon) { gearData.TorqueConverterRatio = gearData.Ratio; @@ -180,8 +180,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter gearData.TorqueConverterShiftPolygon = shiftPolygon; } - protected static void CretateTCFirstGearATPowerSplit(IGearboxDeclarationInputData gearbox, GearData gearData, uint i, - ShiftPolygon shiftPolygon) + protected static void CretateTCFirstGearATPowerSplit(GearData gearData, uint i, ShiftPolygon shiftPolygon) { gearData.TorqueConverterRatio = 1; gearData.TorqueConverterGearLossMap = TransmissionLossMapReader.Create(1, 1, string.Format("TCGear {0}", i + 1)); @@ -288,12 +287,12 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter return engineCurve; } - var entries = new List<FullLoadCurve.FullLoadCurveEntry>(); + var entries = new List<EngineFullLoadCurve.FullLoadCurveEntry>(); var firstEntry = engineCurve.FullLoadEntries.First(); if (firstEntry.TorqueFullLoad < maxTorque) { entries.Add(engineCurve.FullLoadEntries.First()); } else { - entries.Add(new FullLoadCurve.FullLoadCurveEntry { + entries.Add(new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = firstEntry.EngineSpeed, TorqueFullLoad = maxTorque, TorqueDrag = firstEntry.TorqueDrag @@ -305,7 +304,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter entries.Add(entry.Item2); } else if (entry.Item1.TorqueFullLoad > maxTorque && entry.Item2.TorqueFullLoad > maxTorque) { // segment is above maxTorque line -> add limited entry - entries.Add(new FullLoadCurve.FullLoadCurveEntry { + entries.Add(new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = entry.Item2.EngineSpeed, TorqueFullLoad = maxTorque, TorqueDrag = entry.Item2.TorqueDrag @@ -317,12 +316,12 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var edgeDrag = Edge.Create(new Point(entry.Item1.EngineSpeed.Value(), entry.Item1.TorqueDrag.Value()), new Point(entry.Item2.EngineSpeed.Value(), entry.Item2.TorqueDrag.Value())); var intersectionX = (maxTorque.Value() - edgeFull.OffsetXY) / edgeFull.SlopeXY; - entries.Add(new FullLoadCurve.FullLoadCurveEntry { + entries.Add(new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = intersectionX.SI<PerSecond>(), TorqueFullLoad = maxTorque, TorqueDrag = VectoMath.Interpolate(edgeDrag.P1, edgeDrag.P2, intersectionX).SI<NewtonMeter>() }); - entries.Add(new FullLoadCurve.FullLoadCurveEntry { + entries.Add(new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = entry.Item2.EngineSpeed, TorqueFullLoad = entry.Item2.TorqueFullLoad > maxTorque ? maxTorque : entry.Item2.TorqueFullLoad, TorqueDrag = entry.Item2.TorqueDrag @@ -330,10 +329,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter } } - var flc = new EngineFullLoadCurve { - FullLoadEntries = entries.ToList(), + var flc = new EngineFullLoadCurve(entries.ToList(), engineCurve.PT1Data) { EngineData = engineCurve.EngineData, - PT1Data = engineCurve.PT1Data }; return flc; } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index a9f500f1a6079bed5dfbcb79af177a32d2e12ba7..bb171f162efe4b97dfff0a91dd79020303431b83 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -167,7 +167,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var limits = torqueLimits.ToDictionary(e => e.Gear); var numGears = gearbox.Gears.Count; var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(numGears + 1); - fullLoadCurves[0] = EngineFullLoadCurve.Create(engine.FullLoadCurve, true); + fullLoadCurves[0] = FullLoadCurveReader.Create(engine.FullLoadCurve, true); fullLoadCurves[0].EngineData = retVal; foreach (var gear in gearbox.Gears) { var maxTorque = VectoMath.Min( @@ -256,17 +256,17 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter if (gearbox.Type == GearboxType.ATPowerSplit && i == 0) { // powersplit transmission: torque converter already contains ratio and losses - CretateTCFirstGearATPowerSplit(gearbox, gearData, i, tcShiftPolygon); + CretateTCFirstGearATPowerSplit(gearData, i, tcShiftPolygon); } if (gearbox.Type == GearboxType.ATSerial) { if (i == 0) { // torqueconverter is active in first gear - duplicate ratio and lossmap for torque converter mode - CreateTCFirstGearATSerial(gearbox, gearData, tcShiftPolygon); + CreateTCFirstGearATSerial(gearData, tcShiftPolygon); } if (i == 1 && gearDifferenceRatio >= DeclarationData.Gearbox.TorqueConverterSecondGearThreshold) { // ratio between first and second gear is above threshold, torqueconverter is active in second gear as well // -> duplicate ratio and lossmap for torque converter mode, remove locked transmission for previous gear - CreateTCSecondGearATSerial(gearbox, gearData, tcShiftPolygon); + CreateTCSecondGearATSerial(gearData, tcShiftPolygon); // NOTE: the lower gear in 'gears' dictionary has index i !! gears[i].Ratio = double.NaN; gears[i].LossMap = null; @@ -398,7 +398,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var cdASum = 0.SI<SquareMeter>(); for (var heightPercent = startHeightPercent; heightPercent < maxHeightPercent; heightPercent += heightPercentStep) { - var height = (heightPercent / 100.0) * vehicleHeight; + var height = heightPercent / 100.0 * vehicleHeight; var vWind = Physics.BaseWindSpeed * Math.Pow(height / Physics.BaseWindHeight, Physics.HellmannExponent); for (var alpha = 0; alpha <= maxAlpha; alpha += alphaStep) { diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 8a0aceacc4728a9d68a0b15079a5e1093ef21cdf..d89d71235c50cabb507a5816cfd59f3ba6ae498d 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -145,7 +145,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var limits = torqueLimits.ToDictionary(e => e.Gear); var numGears = gbx == null ? 0 : gbx.Gears.Count; var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(numGears + 1); - fullLoadCurves[0] = EngineFullLoadCurve.Create(engine.FullLoadCurve); + fullLoadCurves[0] = FullLoadCurveReader.Create(engine.FullLoadCurve); fullLoadCurves[0].EngineData = retVal; if (gbx != null) { foreach (var gear in gbx.Gears) { @@ -203,17 +203,17 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter if (gearbox.Type == GearboxType.ATPowerSplit && i == 0) { // powersplit transmission: torque converter already contains ratio and losses - CretateTCFirstGearATPowerSplit(gearbox, gearData, i, tcShiftPolygon); + CretateTCFirstGearATPowerSplit(gearData, i, tcShiftPolygon); } if (gearbox.Type == GearboxType.ATSerial) { if (i == 0) { // torqueconverter is active in first gear - duplicate ratio and lossmap for torque converter mode - CreateTCFirstGearATSerial(gearbox, gearData, tcShiftPolygon); + CreateTCFirstGearATSerial(gearData, tcShiftPolygon); } if (i == 1 && gearDifferenceRatio >= DeclarationData.Gearbox.TorqueConverterSecondGearThreshold) { // ratio between first and second gear is above threshold, torqueconverter is active in second gear as well // -> duplicate ratio and lossmap for torque converter mode, remove locked transmission for previous gear - CreateTCSecondGearATSerial(gearbox, gearData, tcShiftPolygon); + CreateTCSecondGearATSerial(gearData, tcShiftPolygon); // NOTE: the lower gear in 'gears' dictionary has index i !! gears[i].Ratio = double.NaN; gears[i].LossMap = null; diff --git a/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs index ee415044494be15d9f2bb2df4a809e693f4a2db0..dca2a2c2b7d73f5648178f329a8e313f94cef61d 100644 --- a/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs @@ -37,34 +37,27 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Declaration; -using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.Reader { - public class FullLoadCurveReader : LoggingObject + public static class FullLoadCurveReader { - public static FullLoadCurve ReadFromFile(string fileName, bool declarationMode = false, bool engineFld = false) + public static EngineFullLoadCurve ReadFromFile(string fileName, bool declarationMode = false) { try { var data = VectoCSVFile.Read(fileName); - return Create(data, declarationMode, engineFld); + return Create(data, declarationMode); } catch (Exception ex) { throw new VectoException("ERROR while reading FullLoadCurve File: " + ex.Message, ex); } } - public static FullLoadCurve Create(DataTable data, bool declarationMode = false, bool engineFld = false) + public static EngineFullLoadCurve Create(DataTable data, bool declarationMode = false) { - if (engineFld) { - if (data.Columns.Count < 3) { - throw new VectoException("Engine FullLoadCurve Data File must consist of at least 3 columns."); - } - } else { - if (data.Columns.Count < 2) { - throw new VectoException("Gearbox FullLoadCurve Data File must consist of at least 2 columns."); - } + if (data.Columns.Count < 3) { + throw new VectoException("Engine FullLoadCurve Data File must consist of at least 3 columns."); } if (data.Rows.Count < 2) { @@ -72,56 +65,52 @@ namespace TUGraz.VectoCore.InputData.Reader "FullLoadCurve must consist of at least two lines with numeric values (below file header)"); } - List<FullLoadCurve.FullLoadCurveEntry> entriesFld; - if (HeaderIsValid(data.Columns, engineFld)) { - entriesFld = CreateFromColumnNames(data, engineFld); + List<EngineFullLoadCurve.FullLoadCurveEntry> entriesFld; + if (HeaderIsValid(data.Columns)) { + entriesFld = CreateFromColumnNames(data); } else { - Logger<FullLoadCurve>().Warn( + LoggingObject.Logger<EngineFullLoadCurve>().Warn( "FullLoadCurve: Header Line is not valid. Expected: '{0}, {1}, {2}', Got: '{3}'. Falling back to column index.", Fields.EngineSpeed, Fields.TorqueFullLoad, Fields.TorqueDrag, string.Join(", ", data.Columns.Cast<DataColumn>().Select(c => c.ColumnName))); - entriesFld = CreateFromColumnIndizes(data, engineFld); + entriesFld = CreateFromColumnIndizes(data); } LookupData<PerSecond, PT1.PT1Result> tmp; if (declarationMode) { tmp = new PT1(); } else { - if (data.Columns.Count > 3) { - tmp = new PT1(data); - } else { - tmp = new PT1(); - } + tmp = data.Columns.Count > 3 ? new PT1(data) : new PT1(); } entriesFld.Sort((entry1, entry2) => entry1.EngineSpeed.Value().CompareTo(entry2.EngineSpeed.Value())); - return new FullLoadCurve { FullLoadEntries = entriesFld, PT1Data = tmp }; + return new EngineFullLoadCurve(entriesFld, tmp); } - private static bool HeaderIsValid(DataColumnCollection columns, bool engineFld) + private static bool HeaderIsValid(DataColumnCollection columns) { return columns.Contains(Fields.EngineSpeed) && columns.Contains(Fields.TorqueFullLoad) - && (!engineFld || columns.Contains(Fields.TorqueDrag)); + && columns.Contains(Fields.TorqueDrag); } - private static List<FullLoadCurve.FullLoadCurveEntry> CreateFromColumnNames(DataTable data, bool engineFld) + private static List<EngineFullLoadCurve.FullLoadCurveEntry> CreateFromColumnNames(DataTable data) { return (from DataRow row in data.Rows - select new FullLoadCurve.FullLoadCurveEntry { + select new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = row.ParseDouble(Fields.EngineSpeed).RPMtoRad(), TorqueFullLoad = row.ParseDouble(Fields.TorqueFullLoad).SI<NewtonMeter>(), - TorqueDrag = engineFld ? row.ParseDouble(Fields.TorqueDrag).SI<NewtonMeter>() : null + TorqueDrag = row.ParseDouble(Fields.TorqueDrag).SI<NewtonMeter>() }).ToList(); } - private static List<FullLoadCurve.FullLoadCurveEntry> CreateFromColumnIndizes(DataTable data, bool engineFld) + private static List<EngineFullLoadCurve.FullLoadCurveEntry> CreateFromColumnIndizes(DataTable data) { return (from DataRow row in data.Rows - select new FullLoadCurve.FullLoadCurveEntry { + select new EngineFullLoadCurve.FullLoadCurveEntry { EngineSpeed = row.ParseDouble(0).RPMtoRad(), TorqueFullLoad = row.ParseDouble(1).SI<NewtonMeter>(), - TorqueDrag = engineFld ? row.ParseDouble(2).SI<NewtonMeter>() : null + TorqueDrag = row.ParseDouble(2).SI<NewtonMeter>() }).ToList(); } diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/AbstractVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/AbstractVectoRunDataFactory.cs deleted file mode 100644 index ac348d3c4682e61697ffab4f1aa04c5d3b15be50..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/InputData/Reader/Impl/AbstractVectoRunDataFactory.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 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 TUGraz.VectoCore.Models.Simulation.Data; - -namespace TUGraz.VectoCore.InputData.Reader.Impl -{ - public abstract class AbstractVectoRunDataFactory : IVectoRunDataFactory - { - public abstract IEnumerable<VectoRunData> NextRun(); - } -} \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index 551faa4fe7efbd5f526783283063a1299f5bcf63..19ce6d7b24031f9b9c244b8a5658a639fe92bd41 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -29,6 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System; using System.Collections.Generic; using System.Linq; using TUGraz.VectoCommon.InputData; @@ -52,59 +53,90 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl private static readonly Dictionary<MissionType, DrivingCycleData> CyclesCache = new Dictionary<MissionType, DrivingCycleData>(); - protected IDeclarationInputDataProvider InputDataProvider; + protected readonly IDeclarationInputDataProvider InputDataProvider; protected IDeclarationReport Report; + private DeclarationDataAdapter _dao; + private Segment _segment; + private DriverData _driverdata; + private AirdragData _airdragData; + private CombustionEngineData _engineData; + private AxleGearData _axlegearData; + private AngledriveData _angledriveData; + private GearboxData _gearboxData; + private RetarderData _retarderData; + private PTOData _ptoTransmissionData; + private PTOData _municipalPtoTransmissionData; + private Exception InitException; internal DeclarationModeVectoRunDataFactory(IDeclarationInputDataProvider dataProvider, IDeclarationReport report) { InputDataProvider = dataProvider; Report = report; + + try { + Initialize(); + if (Report != null) { + InitializeReport(); + } + } catch (Exception e) { + InitException = e; + } } - public IEnumerable<VectoRunData> NextRun() + private void Initialize() { - var dao = new DeclarationDataAdapter(); - var segment = GetVehicleClassification(InputDataProvider.VehicleInputData.VehicleCategory, + _dao = new DeclarationDataAdapter(); + _segment = GetVehicleClassification(InputDataProvider.VehicleInputData.VehicleCategory, InputDataProvider.VehicleInputData.AxleConfiguration, InputDataProvider.VehicleInputData.GrossVehicleMassRating, InputDataProvider.VehicleInputData.CurbMassChassis); - var driverdata = dao.CreateDriverData(InputDataProvider.DriverInputData); - driverdata.AccelerationCurve = AccelerationCurveReader.ReadFromStream(segment.AccelerationFile); + _driverdata = _dao.CreateDriverData(InputDataProvider.DriverInputData); + _driverdata.AccelerationCurve = AccelerationCurveReader.ReadFromStream(_segment.AccelerationFile); - var tempVehicle = dao.CreateVehicleData(InputDataProvider.VehicleInputData, segment.Missions.First(), - segment.Missions.First().Loadings.First().Value, segment.MunicipalBodyWeight); - var airdragData = dao.CreateAirdragData(InputDataProvider.AirdragInputData, segment.Missions.First(),segment); - var engineData = dao.CreateEngineData(InputDataProvider.EngineInputData, InputDataProvider.VehicleInputData.EngineIdleSpeed, + var tempVehicle = _dao.CreateVehicleData(InputDataProvider.VehicleInputData, _segment.Missions.First(), + _segment.Missions.First().Loadings.First().Value, _segment.MunicipalBodyWeight); + _airdragData = _dao.CreateAirdragData(InputDataProvider.AirdragInputData, _segment.Missions.First(), _segment); + _engineData = _dao.CreateEngineData(InputDataProvider.EngineInputData, + InputDataProvider.VehicleInputData.EngineIdleSpeed, InputDataProvider.GearboxInputData, InputDataProvider.VehicleInputData.TorqueLimits); - var axlegearData = dao.CreateAxleGearData(InputDataProvider.AxleGearInputData, false); - var angledriveData = dao.CreateAngledriveData(InputDataProvider.AngledriveInputData, false); - var gearboxData = dao.CreateGearboxData(InputDataProvider.GearboxInputData, engineData, axlegearData.AxleGear.Ratio, + _axlegearData = _dao.CreateAxleGearData(InputDataProvider.AxleGearInputData, false); + _angledriveData = _dao.CreateAngledriveData(InputDataProvider.AngledriveInputData, false); + _gearboxData = _dao.CreateGearboxData(InputDataProvider.GearboxInputData, _engineData, _axlegearData.AxleGear.Ratio, tempVehicle.DynamicTyreRadius, false); - var retarderData = dao.CreateRetarderData(InputDataProvider.RetarderInputData); - - var ptoTransmissionData = dao.CreatePTOTransmissionData(InputDataProvider.PTOTransmissionInputData); - - var municipalPtoTransmissionData = CreateDefaultPTOData(); - if (Report != null) { - var powertrainConfig = new VectoRunData() { - VehicleData = - dao.CreateVehicleData(InputDataProvider.VehicleInputData, segment.Missions.First(), - segment.Missions.First().Loadings.First().Value, segment.MunicipalBodyWeight), - AirdragData = airdragData, - EngineData = engineData, - GearboxData = gearboxData, - AxleGearData = axlegearData, - Retarder = retarderData, - Aux = dao.CreateAuxiliaryData(InputDataProvider.AuxiliaryInputData(), segment.Missions.First().MissionType, - segment.VehicleClass), - InputDataHash = InputDataProvider.XMLHash - }; - Report.InitializeReport(powertrainConfig, segment); + _retarderData = _dao.CreateRetarderData(InputDataProvider.RetarderInputData); + + _ptoTransmissionData = _dao.CreatePTOTransmissionData(InputDataProvider.PTOTransmissionInputData); + + _municipalPtoTransmissionData = CreateDefaultPTOData(); + } + + private void InitializeReport() + { + var powertrainConfig = new VectoRunData() { + VehicleData = + _dao.CreateVehicleData(InputDataProvider.VehicleInputData, _segment.Missions.First(), + _segment.Missions.First().Loadings.First().Value, _segment.MunicipalBodyWeight), + AirdragData = _airdragData, + EngineData = _engineData, + GearboxData = _gearboxData, + AxleGearData = _axlegearData, + Retarder = _retarderData, + Aux = _dao.CreateAuxiliaryData(InputDataProvider.AuxiliaryInputData(), _segment.Missions.First().MissionType, + _segment.VehicleClass), + InputDataHash = InputDataProvider.XMLHash + }; + Report.InitializeReport(powertrainConfig, _segment); + } + + public IEnumerable<VectoRunData> NextRun() + { + if (InitException != null) { + throw InitException; } - foreach (var mission in segment.Missions) { + foreach (var mission in _segment.Missions) { if (mission.MissionType.IsEMS() && - engineData.RatedPowerDeclared.IsSmaller(DeclarationData.MinEnginePowerForEMS)) { + _engineData.RatedPowerDeclared.IsSmaller(DeclarationData.MinEnginePowerForEMS)) { continue; } DrivingCycleData cycle; @@ -120,32 +152,31 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl var simulationRunData = new VectoRunData { Loading = loading.Key, VehicleData = - dao.CreateVehicleData(InputDataProvider.VehicleInputData, mission, loading.Value, segment.MunicipalBodyWeight), - AirdragData = dao.CreateAirdragData(InputDataProvider.AirdragInputData, mission, segment), - EngineData = engineData.Copy(), - GearboxData = gearboxData, - AxleGearData = axlegearData, - AngledriveData = angledriveData, - Aux = dao.CreateAuxiliaryData(InputDataProvider.AuxiliaryInputData(), mission.MissionType, - segment.VehicleClass), + _dao.CreateVehicleData(InputDataProvider.VehicleInputData, mission, loading.Value, _segment.MunicipalBodyWeight), + AirdragData = _dao.CreateAirdragData(InputDataProvider.AirdragInputData, mission, _segment), + EngineData = _engineData.Copy(), + GearboxData = _gearboxData, + AxleGearData = _axlegearData, + AngledriveData = _angledriveData, + Aux = _dao.CreateAuxiliaryData(InputDataProvider.AuxiliaryInputData(), mission.MissionType, + _segment.VehicleClass), Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()), - Retarder = retarderData, - DriverData = driverdata, + Retarder = _retarderData, + DriverData = _driverdata, ExecutionMode = ExecutionMode.Declaration, JobName = InputDataProvider.JobInputData().JobName, ModFileSuffix = loading.Key.ToString(), Report = Report, Mission = mission, PTO = mission.MissionType == MissionType.MunicipalUtility - ? municipalPtoTransmissionData - : ptoTransmissionData, + ? _municipalPtoTransmissionData + : _ptoTransmissionData, InputDataHash = InputDataProvider.XMLHash }; simulationRunData.EngineData.FuelConsumptionCorrectionFactor = DeclarationData.WHTCCorrection.Lookup( - mission.MissionType.GetNonEMSMissionType(), engineData.WHTCRural, engineData.WHTCUrban, engineData.WHTCMotorway) * - engineData.ColdHotCorrectionFactor; - //simulationRunData.Cycle.Name = mission.MissionType.ToString(); - simulationRunData.VehicleData.VehicleClass = segment.VehicleClass; + mission.MissionType.GetNonEMSMissionType(), _engineData.WHTCRural, _engineData.WHTCUrban, _engineData.WHTCMotorway) * + _engineData.ColdHotCorrectionFactor; + simulationRunData.VehicleData.VehicleClass = _segment.VehicleClass; yield return simulationRunData; } } diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs index 47f3607160369483f2750bd6cdd4b6cd1af83bb3..f16c058a67a08083728de558d540c4457639851b 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs @@ -75,13 +75,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl var ptoTransmissionData = dao.CreatePTOTransmissionData(InputDataProvider.PTOTransmissionInputData); return InputDataProvider.JobInputData().Cycles.Select(cycle => { - DrivingCycleData drivingCycle; - if (CyclesCache.ContainsKey(cycle.CycleData.Source)) { - drivingCycle = CyclesCache[cycle.CycleData.Source]; - } else { - drivingCycle = DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, crossWindRequired); - //CyclesCache.Add(cycle.CycleData.Source, drivingCycle); - } + var drivingCycle = CyclesCache.ContainsKey(cycle.CycleData.Source) + ? CyclesCache[cycle.CycleData.Source] + : DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, crossWindRequired); return new VectoRunData { JobName = InputDataProvider.JobInputData().JobName, EngineData = engineData, diff --git a/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs b/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs index 25ddd4a0a33cca66b73122a6ae91f9b5640c36cd..72ded465a88707b7aa3c65f27b39386b9212c8c2 100644 --- a/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs @@ -41,7 +41,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.Reader { - public class ShiftPolygonReader : LoggingObject + public static class ShiftPolygonReader { public static ShiftPolygon ReadFromFile(string fileName) { @@ -68,7 +68,7 @@ namespace TUGraz.VectoCore.InputData.Reader entriesDown = CreateFromColumnNames(data, Fields.AngularSpeedDown); entriesUp = CreateFromColumnNames(data, Fields.AngularSpeedUp); } else { - Logger<ShiftPolygon>() + LoggingObject.Logger<ShiftPolygon>() .Warn( "ShiftPolygon: Header Line is not valid. Expected: '{0}, {1}, {2}', Got: '{3}'. Falling back to column index", Fields.Torque, Fields.AngularSpeedUp, Fields.AngularSpeedDown, diff --git a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs index a86221ca2d5d55dcedd6677890cec86f6bc3fb16..8b46f81891aeaebfda5070c47525b859cdbde03d 100644 --- a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs +++ b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs @@ -85,9 +85,7 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl /// </summary> public class ResponseOverload : AbstractResponse { - public ResponseOverload() {} public Watt Delta { get; set; } - public double Gradient { get; set; } } /// <summary> @@ -95,10 +93,7 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl /// </summary> public class ResponseUnderload : AbstractResponse { - public ResponseUnderload() {} - public Watt Delta { get; set; } - public double Gradient { get; set; } } /// <summary> @@ -127,11 +122,11 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl } internal class ResponseGearShift : AbstractResponse - { - public ResponseGearShift() {} - } + {} +/* internal class ResponseEngineSpeedTooLow : ResponseDryRun {} +*/ internal class ResponseEngineSpeedTooHigh : AbstractResponse { diff --git a/VectoCore/VectoCore/Models/Declaration/Axle.cs b/VectoCore/VectoCore/Models/Declaration/Axle.cs index 15b27a6fe1dae4af8c5fe25e6efdea1e8c515f81..6e638a2722980feef418a5c94964f615b85ceda3 100644 --- a/VectoCore/VectoCore/Models/Declaration/Axle.cs +++ b/VectoCore/VectoCore/Models/Declaration/Axle.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using System.ComponentModel.DataAnnotations; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index 6944fad5cf8b921816506a2f5e670bf9f0150fe4..633b2fc76fe3e3a398f9719b29c982ac89ba918e 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -291,7 +291,7 @@ namespace TUGraz.VectoCore.Models.Declaration /// <param name="fullLoadCurve"></param> /// <param name="rpmLimit"></param> /// <returns></returns> - internal static IEnumerable<Point> ShiftPolygonFldMargin(List<FullLoadCurve.FullLoadCurveEntry> fullLoadCurve, + internal static IEnumerable<Point> ShiftPolygonFldMargin(List<EngineFullLoadCurve.FullLoadCurveEntry> fullLoadCurve, PerSecond rpmLimit) { return fullLoadCurve.TakeWhile(fldEntry => fldEntry.EngineSpeed < rpmLimit) @@ -382,11 +382,12 @@ namespace TUGraz.VectoCore.Models.Declaration public static readonly MeterPerSquareSecond CLUpshiftMinAcceleration = 0.1.SI<MeterPerSquareSecond>(); public static readonly MeterPerSquareSecond CCUpshiftMinAcceleration = 0.1.SI<MeterPerSquareSecond>(); - private static PerSecond DownshiftPRM = 700.RPMtoRad(); - private static PerSecond UpshiftLowRPM = 900.RPMtoRad(); - private static PerSecond UpshiftHighRPM = 1150.RPMtoRad(); + private static readonly PerSecond DownshiftPRM = 700.RPMtoRad(); + private static readonly PerSecond UpshiftLowRPM = 900.RPMtoRad(); + private static readonly PerSecond UpshiftHighRPM = 1150.RPMtoRad(); - public static ShiftPolygon ComputeShiftPolygon(EngineFullLoadCurve fullLoadCurve, bool first = false, bool last = false) + public static ShiftPolygon ComputeShiftPolygon(EngineFullLoadCurve fullLoadCurve, bool first = false, + bool last = false) { var maxDragTorque = fullLoadCurve.MaxDragTorque * 1.1; var maxTorque = fullLoadCurve.MaxTorque * 1.1; @@ -410,7 +411,7 @@ namespace TUGraz.VectoCore.Models.Declaration public static IEnumerable<TorqueConverterEntry> GetTorqueConverterDragCurve(double ratio) { - var resourceId = DeclarationData.DeclarationDataResourcePrefix + ".TorqueConverter.csv"; + var resourceId = DeclarationDataResourcePrefix + ".TorqueConverter.csv"; var data = VectoCSVFile.ReadStream(RessourceHelper.ReadStream(resourceId), source: resourceId); var characteristicTorque = (from DataRow row in data.Rows select diff --git a/VectoCore/VectoCore/Models/Declaration/FuelData.cs b/VectoCore/VectoCore/Models/Declaration/FuelData.cs index d15b108d7b2269ea8eecc8733d441f0b1aad42e1..6a90f2a395fce849dd11a55bf60935153fadff5a 100644 --- a/VectoCore/VectoCore/Models/Declaration/FuelData.cs +++ b/VectoCore/VectoCore/Models/Declaration/FuelData.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Data; using System.Linq; @@ -16,7 +47,7 @@ namespace TUGraz.VectoCore.Models.Declaration return _instance ?? (_instance = new FuelData()); } - private FuelData() : base() {} + private FuelData() {} protected override string ResourceId { @@ -48,11 +79,6 @@ namespace TUGraz.VectoCore.Models.Declaration .ToDictionary(e => e.FuelType); } - public FuelType[] GetFuelTypes() - { - return Data.Keys.ToArray(); - } - public class Entry { public Entry(FuelType type, KilogramPerCubicMeter density, double weight, JoulePerKilogramm heatingValue) diff --git a/VectoCore/VectoCore/Models/Declaration/Mission.cs b/VectoCore/VectoCore/Models/Declaration/Mission.cs index 06b7a485dd12bcf9c4edc7d4b79ca229a79187e0..d8bee12f5012ffe31e68e02bf6f90a04acb7fb52 100644 --- a/VectoCore/VectoCore/Models/Declaration/Mission.cs +++ b/VectoCore/VectoCore/Models/Declaration/Mission.cs @@ -44,25 +44,6 @@ namespace TUGraz.VectoCore.Models.Declaration EmptyLoading, } - public static class LoadingTypeHelper - { - public static string GetShortName(this LoadingType loadingType) - { - switch (loadingType) { - case LoadingType.FullLoading: - return "F"; - case LoadingType.ReferenceLoad: - return "R"; - case LoadingType.LowLoading: - return "L"; - case LoadingType.EmptyLoading: - return "E"; - default: - throw new ArgumentOutOfRangeException("loadingType", loadingType, null); - } - } - } - public class Mission { public MissionType MissionType; diff --git a/VectoCore/VectoCore/Models/Declaration/PT1.cs b/VectoCore/VectoCore/Models/Declaration/PT1.cs index 58ca28845c98f30a65e23e3a66f99ed18663f864..09bbb9244f46b00ab7c635380df56d658fb11557 100644 --- a/VectoCore/VectoCore/Models/Declaration/PT1.cs +++ b/VectoCore/VectoCore/Models/Declaration/PT1.cs @@ -34,9 +34,7 @@ using System.Collections.Generic; using System.Data; using System.Linq; using TUGraz.VectoCommon.Exceptions; -using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.Declaration @@ -87,8 +85,8 @@ namespace TUGraz.VectoCore.Models.Declaration if (data.Columns.Contains(Fields.EngineSpeed) && data.Columns.Contains(Fields.PT1)) { _entries = data.Rows.Cast<DataRow>() .Select( - r => new KeyValuePair<PerSecond, Second>(DataTableExtensionMethods.ParseDouble(r, Fields.EngineSpeed).RPMtoRad(), - DataTableExtensionMethods.ParseDouble(r, Fields.PT1).SI<Second>())) + r => new KeyValuePair<PerSecond, Second>(r.ParseDouble(Fields.EngineSpeed).RPMtoRad(), + r.ParseDouble(Fields.PT1).SI<Second>())) .OrderBy(x => x.Key).ToList(); } else { _entries = data.Rows.Cast<DataRow>() @@ -99,10 +97,9 @@ namespace TUGraz.VectoCore.Models.Declaration public override PT1Result Lookup(PerSecond key) { - var index = 1; - bool extrapolated = key.IsSmaller(_entries[0].Key) || key.IsGreater(_entries.Last().Key); + var extrapolated = key.IsSmaller(_entries[0].Key) || key.IsGreater(_entries.Last().Key); - index = _entries.FindIndex(x => x.Key.IsGreater(key)); + var index = _entries.FindIndex(x => x.Key.IsGreater(key)); if (index <= 0) { index = key.IsGreater(_entries[0].Key) ? _entries.Count - 1 : 1; } diff --git a/VectoCore/VectoCore/Models/Declaration/Payloads.cs b/VectoCore/VectoCore/Models/Declaration/Payloads.cs index d2debbf27d6d14020faa531fcd562594afb67f03..da05124dc1501aa1d6ad572d937d97fd52c2f8ec 100644 --- a/VectoCore/VectoCore/Models/Declaration/Payloads.cs +++ b/VectoCore/VectoCore/Models/Declaration/Payloads.cs @@ -49,15 +49,6 @@ namespace TUGraz.VectoCore.Models.Declaration get { throw new InvalidOperationException("ErrorMessage not applicable."); } } - /// <summary> - /// Obsolete. Call Lookup50Percent, Lookup75Percent or LookupTrailer instead! - /// </summary> - [Obsolete("Call Lookup10Percent, Lookup50Percent, Lookup75Percent or LookupTrailer!", true)] - private new PayloadEntry Lookup(Kilogram grossVehicleWeight) - { - throw new InvalidOperationException("Call Lookup50Percent, Lookup75Percent or LookupTrailer!"); - } - public Kilogram Lookup10Percent(Kilogram grossVehicleWeight) { var section = Data.GetSection(d => d.Key > grossVehicleWeight); diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index ca1951e2f6f380a444c90bca91311aef216c544f..3fe152361c100e093fa640a77e38eeef2f59db1f 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -200,7 +200,7 @@ namespace TUGraz.VectoCore.Models.Declaration trailers.Sum(t => t.TrailerCurbWeight).DefaultIfNull(0); var payloads = row.Field<string>(missionType.ToString()).Split('/'); - Kilogram refLoad = null, lowLoad = 0.SI<Kilogram>(); + Kilogram refLoad, lowLoad = 0.SI<Kilogram>(); if (payloads.Length == 2) { lowLoad = GetLoading(payloads[0], grossVehicleWeight, trailers, true); refLoad = GetLoading(payloads[1], grossVehicleWeight, trailers, false); diff --git a/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs b/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs index 8c66898676d76c4c737461ba8a5b37b9014e08d2..17d45656832cf8d89a9abed2ec4b8befa260d126 100644 --- a/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs +++ b/VectoCore/VectoCore/Models/Declaration/StandardBodies.cs @@ -40,12 +40,12 @@ namespace TUGraz.VectoCore.Models.Declaration { public sealed class StandardBody { - public Kilogram CurbWeight; - public Kilogram GrossVehicleWeight; - public SquareMeter[] DeltaCrossWindArea; - public string Name; - public List<Wheels.Entry> Wheels; - public CubicMeter CargoVolume; + public readonly Kilogram CurbWeight; + public readonly Kilogram GrossVehicleWeight; + public readonly SquareMeter[] DeltaCrossWindArea; + public readonly string Name; + public readonly List<Wheels.Entry> Wheels; + public readonly CubicMeter CargoVolume; public Kilogram MaxPayLoad { diff --git a/VectoCore/VectoCore/Models/Declaration/Wheels.cs b/VectoCore/VectoCore/Models/Declaration/Wheels.cs index 582e221ae5e1eecd9c26defb356e0a79561748b1..06914b3490d3260febeb3b35e8080a91ab3b0537 100644 --- a/VectoCore/VectoCore/Models/Declaration/Wheels.cs +++ b/VectoCore/VectoCore/Models/Declaration/Wheels.cs @@ -30,7 +30,6 @@ */ using System; -using System.Collections.Generic; using System.Data; using System.Linq; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs index 46e257f645121f1cb617036a0e980ac81718172c..4e2d69db51240f3f03e71c4a6e2479cc9b69bbdf 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs @@ -32,12 +32,8 @@ using System; using System.ComponentModel; using System.Data; -using System.Reflection; using System.Runtime.Serialization; -using System.Text.RegularExpressions; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; // ReSharper disable InconsistentNaming @@ -66,45 +62,5 @@ namespace TUGraz.VectoCore.Models.Simulation.Data Columns.Add(col); } } - - public static ModalResults ReadFromFile(string fileName) - { - var modalResults = new ModalResults(); - var data = VectoCSVFile.Read(fileName); - - foreach (DataRow row in data.Rows) { - try { - var newRow = modalResults.NewRow(); - foreach (DataColumn col in row.Table.Columns) { - // In cols FC-AUXc and FC-WHTCc can be a "-" - if (row.Field<string>(col) == "-" - && (col.ColumnName == ModalResultField.FCAUXc.GetName() || col.ColumnName == ModalResultField.FCWHTCc.GetName())) { - continue; - } - - // In col FC can sometimes be a "ERROR" - if (row.Field<string>(col) == "ERROR" && col.ColumnName == ModalResultField.FCMap.GetName()) { - continue; - } - - if (col.ColumnName.StartsWith(ModalResultField.P_aux_.ToString()) && - !modalResults.Columns.Contains(col.ColumnName)) { - modalResults.Columns.Add(col.ColumnName, typeof(SI)); - } - - if (typeof(SI).IsAssignableFrom(modalResults.Columns[col.ColumnName].DataType)) { - newRow.SetField(col.ColumnName, row.ParseDoubleOrGetDefault(col.ColumnName).SI()); - } else { - newRow.SetField(col.ColumnName, row.ParseDoubleOrGetDefault(col.ColumnName)); - } - } - modalResults.Rows.Add(newRow); - } catch (VectoException ex) { - throw new VectoException(string.Format("Row {0}: {1}", data.Rows.IndexOf(row), ex.Message), ex); - } - } - - return modalResults; - } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs index 6c0870d42d307b9afa02c1c15a82f0a7ec59a461..94cf6d06a3edf198fd708388fc83a0b3cd7f0506 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IDataBus.cs @@ -31,7 +31,6 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent; namespace TUGraz.VectoCore.Models.Simulation.DataBus diff --git a/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs index 46e518f1ae3b3372be8f89787d54b1c1af050619..5ea36cc1c43e70ca7afeb9e09aabec174ccd9efa 100644 --- a/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs @@ -31,7 +31,6 @@ using System; using System.ComponentModel.DataAnnotations; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs index 377dc8bc8e47ab1412dd0021d94d3fc95391e4fb..c77ea5e0687a545e42922e45b451ef2146d2de32 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs @@ -76,7 +76,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl { return Runs.Select( - r => new CycleTypeDescription { Name = r.Run.CycleName, CycleType = r.Run.GetContainer().RunData.Cycle.CycleType }) + r => new CycleTypeDescription { Name = r.Run.CycleName, CycleType = r.Run.GetContainer().RunData.Cycle.CycleType }) .Distinct(); } @@ -190,19 +190,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl { public IVectoRun Run; public JobContainer JobContainer; - public double Progress; public bool Done; - public bool Started; public bool Success; public bool Canceled; public double ExecTime; public Exception ExecException; - public Task RunTask; + public readonly Task RunTask; public RunEntry() { RunTask = new Task(() => { - Started = true; var stopWatch = Stopwatch.StartNew(); try { Run.Run(); diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index b0477968cf035ce631accd57c3eac4269bd9c0ae..61e1769e3b13c3b10c9bcb2f3d5bcd2edbc420e2 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -33,7 +33,6 @@ using System; using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs index 17882eb5865a76758b9f626e7846b7f19efc92e6..a70fc63fd8a592a130e56e669186d8590b8ad005 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs @@ -33,7 +33,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Security.Principal; using System.Threading; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; @@ -125,7 +124,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl : null; if (ActualModalData) { - modDataFilter = new[] { new ActualModalDataFilter(), }; + modDataFilter = new IModalDataFilter[] { new ActualModalDataFilter(), }; } @@ -154,9 +153,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl WriteModalResults = _mode != ExecutionMode.Declaration || WriteModalResults }; var current = i++; - var builder = new PowertrainBuilder(modContainer, (modData) => { + var builder = new PowertrainBuilder(modContainer, modData => { if (SumData != null) { - SumData.Write(modData, string.Format("{0}-{1}", JobNumber, current), d); + SumData.Write(modData, JobNumber, current, d); //SumData.Write(modContainer, d.JobName, string.Format("{0}-{1}", JobNumber, current), // d.Cycle.Name + Constants.FileExtensions.CycleFile, mass, loading, volume ?? 0.SI<CubicMeter>(), gearCount); } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs index 4468139f3727de1200a61fc8a2448de02a35ff93..0bd336c0cee33fb29798e69a5768a676075ededa 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs @@ -142,6 +142,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } catch (Exception ve2) { ve = new VectoException("Multiple Exceptions occured.", new AggregateException(ve, new VectoException("Exception during finishing Simulation.", ve2))); + throw ve; } throw ex; } catch (Exception e) { diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs index a4dfbd5cabef074cecfb6d42f77e15e528e1c350..c6022e6d61b21733efdb38f073269d15c7dada32 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VehicleContainer.cs @@ -37,7 +37,6 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Connector.Ports; -using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs index 7c16736a3bebee4b70286465224d38f80fc2e6c3..d775142198097a738bd32fd62cab239242987819 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs @@ -80,27 +80,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data } else { index = _entries.FindIndex(x => x.Key > key); if (index <= 0) { - index = (key > _entries[0].Key) ? _entries.Count - 1 : 1; + index = key > _entries[0].Key ? _entries.Count - 1 : 1; } } return index; } - public MeterPerSquareSecond MinDeceleration() - { - return _entries.Max(x => x.Value.Deceleration); - } - public MeterPerSquareSecond MaxDeceleration() { return _entries.Min(x => x.Value.Deceleration); } - public MeterPerSquareSecond MinAcceleration() - { - return _entries.Min(x => x.Value.Acceleration); - } - public MeterPerSquareSecond MaxAcceleration() { return _entries.Max(x => x.Value.Acceleration); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs index a499a5465325ab8f9a775da771610c1a5af4544f..1ab6911924dfff1b599bdd4bb13b576a35309976 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/AuxiliaryData.cs @@ -31,7 +31,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader.ComponentData; @@ -62,11 +61,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data return value.Value.SI<Watt>(); } value = _map.Extrapolate(nAuxiliary.Value(), powerAuxOut.Value()); - if (value.HasValue) { - return value.Value.SI<Watt>(); - } - throw new VectoException("AuxiliaryData {2}: Interpolation failed. nAux: {0}, powerOut:{1}", nAuxiliary.AsRPM, - powerAuxOut, auxId); + return value.Value.SI<Watt>(); } internal AuxiliaryData(string id, double transmissionRatio, double efficiencyToEngine, double efficiencyToSupply, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/AxleGearData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/AxleGearData.cs index 9e753dcb2624574639b371d5b17b625d5dcb31b8..3118eec25d6bf887af0b98a75ba673d12ce7989f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/AxleGearData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/AxleGearData.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs index f9a305a769d63e9b290f5e0280f80499c970381a..bcb9fd79bf2554ed1dff5dc017a77a76ef3cefcb 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs @@ -29,13 +29,11 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; -using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; namespace TUGraz.VectoCore.Models.SimulationComponent.Data diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs index 074097fdddfe827f92036747c4daf9705cefae3b..60bd9b1f464a20efd6ac0d385466936127616ecf 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs @@ -41,7 +41,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { public class CrosswindCorrectionCdxALookup : LoggingObject, ICrossWindCorrection { - protected List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> Entries; + protected readonly List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> Entries; public CrosswindCorrectionCdxALookup(SquareMeter airDragArea, List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> entries, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs index 73a1e6ffd73add75f82a26dea3b4f90dcda5e2b3..dd44953fce634f726e7273da339c5952dd13784a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs @@ -34,7 +34,6 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Declaration; -using TUGraz.VectoCore.Models.Simulation.Data; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/DrivingCycleData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/DrivingCycleData.cs index be235259e15e25899382ee675bd7ade159208603..cb135b8e3be607b2a8db28e9c6a02f10eae026cc 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/DrivingCycleData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/DrivingCycleData.cs @@ -36,7 +36,6 @@ using System.Diagnostics; using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.Simulation.Data; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs index fa6b684bf5f16f5e5b02309e467162c705952bbe..f5550f9978c5c08ebd27ecade94b495056f880e2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs @@ -29,12 +29,14 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System; using System.Collections.Generic; -using System.Data; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics; using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Utils; @@ -43,24 +45,29 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine /// <summary> /// Represents the Full load curve. /// </summary> - public class EngineFullLoadCurve : FullLoadCurve + public class EngineFullLoadCurve : SimulationComponentData { + private Watt _maxPower; + private PerSecond _ratedSpeed; + private NewtonMeter _maxTorque; + private NewtonMeter _maxDragTorque; + private PerSecond _preferredSpeed; private PerSecond _engineSpeedLo; // 55% of Pmax private PerSecond _engineSpeedHi; // 70% of Pmax private PerSecond _n95hSpeed; // 95% of Pmax private PerSecond _n80hSpeed; // 80% of Pmax - public static EngineFullLoadCurve ReadFromFile(string fileName, bool declarationMode = false) - { - var curve = FullLoadCurveReader.ReadFromFile(fileName, declarationMode, true); - return new EngineFullLoadCurve { FullLoadEntries = curve.FullLoadEntries, PT1Data = curve.PT1Data }; - } + [Required, ValidateObject] internal readonly List<FullLoadCurveEntry> FullLoadEntries; - public static EngineFullLoadCurve Create(DataTable data, bool declarationMode = false, NewtonMeter maxTorque = null) + private SortedList<PerSecond, int> _quickLookup; + + [Required] internal readonly LookupData<PerSecond, PT1.PT1Result> PT1Data; + + internal EngineFullLoadCurve(List<FullLoadCurveEntry> entries, LookupData<PerSecond, PT1.PT1Result> pt1Data) { - var curve = FullLoadCurveReader.Create(data, declarationMode, true); - return new EngineFullLoadCurve() { FullLoadEntries = curve.FullLoadEntries, PT1Data = curve.PT1Data }; + FullLoadEntries = entries; + PT1Data = pt1Data; } public Watt FullLoadStationaryPower(PerSecond angularVelocity) @@ -80,6 +87,147 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine return PT1Data.Lookup(angularVelocity); } + /// <summary> + /// Get the rated speed from the given full-load curve (i.e. speed with max. power) + /// </summary> + [Required, SIRange(0, 5000 * Constants.RPMToRad)] + public PerSecond RatedSpeed + { + get { return _ratedSpeed ?? ComputeRatedSpeed().Item1; } + } + + /// <summary> + /// Gets the maximum power. + /// </summary> + [Required, SIRange(0, 10000 * 5000 * Constants.RPMToRad)] + public Watt MaxPower + { + get { return _maxPower ?? ComputeRatedSpeed().Item2; } + } + + public NewtonMeter MaxTorque + { + get { return _maxTorque ?? FindMaxTorque(); } + } + + public NewtonMeter MaxDragTorque + { + get { return _maxDragTorque ?? FindMaxDragTorque(); } + } + + public NewtonMeter FullLoadStationaryTorque(PerSecond angularVelocity) + { + var idx = FindIndex(angularVelocity); + return VectoMath.Interpolate(FullLoadEntries[idx - 1].EngineSpeed, FullLoadEntries[idx].EngineSpeed, + FullLoadEntries[idx - 1].TorqueFullLoad, FullLoadEntries[idx].TorqueFullLoad, + angularVelocity); + } + + public NewtonMeter DragLoadStationaryTorque(PerSecond angularVelocity) + { + var idx = FindIndex(angularVelocity); + return VectoMath.Interpolate(FullLoadEntries[idx - 1].EngineSpeed, FullLoadEntries[idx].EngineSpeed, + FullLoadEntries[idx - 1].TorqueDrag, FullLoadEntries[idx].TorqueDrag, + angularVelocity); + } + + private NewtonMeter FindMaxTorque() + { + _maxTorque = FullLoadEntries.Max(x => x.TorqueFullLoad); + return _maxTorque; + } + + private NewtonMeter FindMaxDragTorque() + { + _maxDragTorque = FullLoadEntries.Min(x => x.TorqueDrag); + return _maxDragTorque; + } + + /// <summary> + /// Compute the engine's rated speed from the given full-load curve (i.e. engine speed with max. power) + /// </summary> + protected Tuple<PerSecond, Watt> ComputeRatedSpeed() + { + var max = new Tuple<PerSecond, Watt>(0.SI<PerSecond>(), 0.SI<Watt>()); + for (var idx = 1; idx < FullLoadEntries.Count; idx++) { + var currentMax = FindMaxPower(FullLoadEntries[idx - 1], FullLoadEntries[idx]); + if (currentMax.Item2 > max.Item2) { + max = currentMax; + } + } + + _ratedSpeed = max.Item1; + _maxPower = max.Item2; + + return max; + } + + private Tuple<PerSecond, Watt> FindMaxPower(FullLoadCurveEntry p1, FullLoadCurveEntry p2) + { + if (p1.EngineSpeed.IsEqual(p2.EngineSpeed)) { + return Tuple.Create(p1.EngineSpeed, p1.TorqueFullLoad * p1.EngineSpeed); + } + + if (p2.EngineSpeed < p1.EngineSpeed) { + var tmp = p1; + p1 = p2; + p2 = tmp; + } + + // y = kx + d + var k = (p2.TorqueFullLoad - p1.TorqueFullLoad) / (p2.EngineSpeed - p1.EngineSpeed); + var d = p2.TorqueFullLoad - k * p2.EngineSpeed; + if (k.IsEqual(0)) { + return Tuple.Create(p2.EngineSpeed, p2.TorqueFullLoad * p2.EngineSpeed); + } + var engineSpeedMaxPower = -d / (2 * k); + if (engineSpeedMaxPower.IsSmaller(p1.EngineSpeed) || engineSpeedMaxPower.IsGreater(p2.EngineSpeed)) { + if (p2.TorqueFullLoad * p2.EngineSpeed > p1.TorqueFullLoad * p1.EngineSpeed) { + return Tuple.Create(p2.EngineSpeed, p2.TorqueFullLoad * p2.EngineSpeed); + } + return Tuple.Create(p1.EngineSpeed, p1.TorqueFullLoad * p1.EngineSpeed); + } + var engineTorqueMaxPower = FullLoadStationaryTorque(engineSpeedMaxPower); + return Tuple.Create(engineSpeedMaxPower, engineTorqueMaxPower * engineSpeedMaxPower); + } + + + /// <summary> + /// Get item index for the segment of the full-load curve where the angularVelocity lies within. + /// </summary> + protected int FindIndex(PerSecond angularVelocity) + { + if (angularVelocity < FullLoadEntries.First().EngineSpeed) { + return 1; + } + if (angularVelocity > FullLoadEntries.Last().EngineSpeed) { + return FullLoadEntries.Count - 1; + } + + if (_quickLookup == null) { + _quickLookup = new SortedList<PerSecond, int>(); + var i = 10; + for (; i < FullLoadEntries.Count; i += 10) { + _quickLookup.Add(FullLoadEntries[i].EngineSpeed, Math.Max(1, i - 10)); + } + _quickLookup.Add(FullLoadEntries.Last().EngineSpeed + 0.1.SI<PerSecond>(), Math.Max(1, i - 10)); + } + var start = 1; + foreach (var lookup in _quickLookup.Where(lookup => angularVelocity < lookup.Key)) { + start = lookup.Value; + break; + } + + for (var index = start; index < FullLoadEntries.Count; index++) { + if (angularVelocity >= FullLoadEntries[index - 1].EngineSpeed && + angularVelocity <= FullLoadEntries[index].EngineSpeed) { + return index; + } + } + throw new VectoException("angular velocity {0} exceeds full load curve: min: {1} max: {2}", angularVelocity, + FullLoadEntries.First().EngineSpeed, FullLoadEntries.Last().EngineSpeed); + } + /// <summary> /// Get the engine's preferred speed from the given full-load curve (i.e. Speed at 51% torque/speed-integral between idling and N95h.) /// </summary> @@ -271,5 +419,52 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine } #endregion + + [DebuggerDisplay("n: {EngineSpeed}, fullTorque: {TorqueFullLoad}, dragTorque: {TorqueDrag}")] + internal class FullLoadCurveEntry + { + [Required, SIRange(0, 5000 * Constants.RPMToRad)] + public PerSecond EngineSpeed { get; set; } + + [Required, SIRange(0, 10000)] + public NewtonMeter TorqueFullLoad { get; set; } + + [Required, SIRange(-10000, 0)] + public NewtonMeter TorqueDrag { get; set; } + + #region Equality members + + protected bool Equals(FullLoadCurveEntry other) + { + return Equals(EngineSpeed, other.EngineSpeed) && Equals(TorqueFullLoad, other.TorqueFullLoad) && + Equals(TorqueDrag, other.TorqueDrag); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) { + return false; + } + if (ReferenceEquals(this, obj)) { + return true; + } + if (obj.GetType() != GetType()) { + return false; + } + return Equals((FullLoadCurveEntry)obj); + } + + public override int GetHashCode() + { + unchecked { + var hashCode = EngineSpeed != null ? EngineSpeed.GetHashCode() : 0; + hashCode = (hashCode * 397) ^ (TorqueFullLoad != null ? TorqueFullLoad.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (TorqueDrag != null ? TorqueDrag.GetHashCode() : 0); + return hashCode; + } + } + + #endregion + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs deleted file mode 100644 index b7bf245479af05eedde94ad0a815be27b23b0b4b..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs +++ /dev/null @@ -1,245 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 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; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics; -using System.Linq; -using TUGraz.VectoCommon.Exceptions; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; -using TUGraz.VectoCore.Models.Declaration; - -namespace TUGraz.VectoCore.Models.SimulationComponent.Data -{ - public class FullLoadCurve : SimulationComponentData - { - private Watt _maxPower; - private PerSecond _ratedSpeed; - private NewtonMeter _maxTorque; - private NewtonMeter _maxDragTorque; - - [Required, ValidateObject] internal List<FullLoadCurveEntry> FullLoadEntries; - - private SortedList<PerSecond, int> _quickLookup; - - [Required] internal LookupData<PerSecond, PT1.PT1Result> PT1Data; - - /// <summary> - /// Get the rated speed from the given full-load curve (i.e. speed with max. power) - /// </summary> - [Required, SIRange(0, 5000 * Constants.RPMToRad)] - public PerSecond RatedSpeed - { - get { return _ratedSpeed ?? ComputeRatedSpeed().Item1; } - } - - /// <summary> - /// Gets the maximum power. - /// </summary> - [Required, SIRange(0, 10000 * 5000 * Constants.RPMToRad)] - public Watt MaxPower - { - get { return _maxPower ?? ComputeRatedSpeed().Item2; } - } - - public NewtonMeter MaxTorque - { - get { return _maxTorque ?? FindMaxTorque(); } - } - - public NewtonMeter MaxDragTorque - { - get { return _maxDragTorque ?? FindMaxDragTorque(); } - } - - public virtual NewtonMeter FullLoadStationaryTorque(PerSecond angularVelocity) - { - var idx = FindIndex(angularVelocity); - return VectoMath.Interpolate(FullLoadEntries[idx - 1].EngineSpeed, FullLoadEntries[idx].EngineSpeed, - FullLoadEntries[idx - 1].TorqueFullLoad, FullLoadEntries[idx].TorqueFullLoad, - angularVelocity); - } - - public virtual NewtonMeter DragLoadStationaryTorque(PerSecond angularVelocity) - { - var idx = FindIndex(angularVelocity); - return VectoMath.Interpolate(FullLoadEntries[idx - 1].EngineSpeed, FullLoadEntries[idx].EngineSpeed, - FullLoadEntries[idx - 1].TorqueDrag, FullLoadEntries[idx].TorqueDrag, - angularVelocity); - } - - private NewtonMeter FindMaxTorque() - { - _maxTorque = FullLoadEntries.Max(x => x.TorqueFullLoad); - return _maxTorque; - } - - private NewtonMeter FindMaxDragTorque() - { - _maxDragTorque = FullLoadEntries.Min(x => x.TorqueDrag); - return _maxDragTorque; - } - - /// <summary> - /// Compute the engine's rated speed from the given full-load curve (i.e. engine speed with max. power) - /// </summary> - protected Tuple<PerSecond, Watt> ComputeRatedSpeed() - { - var max = new Tuple<PerSecond, Watt>(0.SI<PerSecond>(), 0.SI<Watt>()); - for (var idx = 1; idx < FullLoadEntries.Count; idx++) { - var currentMax = FindMaxPower(FullLoadEntries[idx - 1], FullLoadEntries[idx]); - if (currentMax.Item2 > max.Item2) { - max = currentMax; - } - } - - _ratedSpeed = max.Item1; - _maxPower = max.Item2; - - return max; - } - - private Tuple<PerSecond, Watt> FindMaxPower(FullLoadCurveEntry p1, FullLoadCurveEntry p2) - { - if (p1.EngineSpeed.IsEqual(p2.EngineSpeed)) { - return Tuple.Create(p1.EngineSpeed, p1.TorqueFullLoad * p1.EngineSpeed); - } - - if (p2.EngineSpeed < p1.EngineSpeed) { - var tmp = p1; - p1 = p2; - p2 = tmp; - } - - // y = kx + d - var k = (p2.TorqueFullLoad - p1.TorqueFullLoad) / (p2.EngineSpeed - p1.EngineSpeed); - var d = p2.TorqueFullLoad - k * p2.EngineSpeed; - if (k.IsEqual(0)) { - return Tuple.Create(p2.EngineSpeed, p2.TorqueFullLoad * p2.EngineSpeed); - } - var engineSpeedMaxPower = -d / (2 * k); - if (engineSpeedMaxPower.IsSmaller(p1.EngineSpeed) || engineSpeedMaxPower.IsGreater(p2.EngineSpeed)) { - if (p2.TorqueFullLoad * p2.EngineSpeed > p1.TorqueFullLoad * p1.EngineSpeed) { - return Tuple.Create(p2.EngineSpeed, p2.TorqueFullLoad * p2.EngineSpeed); - } - return Tuple.Create(p1.EngineSpeed, p1.TorqueFullLoad * p1.EngineSpeed); - } - var engineTorqueMaxPower = FullLoadStationaryTorque(engineSpeedMaxPower); - return Tuple.Create(engineSpeedMaxPower, engineTorqueMaxPower * engineSpeedMaxPower); - } - - - /// <summary> - /// Get item index for the segment of the full-load curve where the angularVelocity lies within. - /// </summary> - protected int FindIndex(PerSecond angularVelocity) - { - if (angularVelocity < FullLoadEntries.First().EngineSpeed) { - return 1; - } - if (angularVelocity > FullLoadEntries.Last().EngineSpeed) { - return FullLoadEntries.Count - 1; - } - - if (_quickLookup == null) { - _quickLookup = new SortedList<PerSecond, int>(); - var i = 10; - for (; i < FullLoadEntries.Count; i += 10) { - _quickLookup.Add(FullLoadEntries[i].EngineSpeed, Math.Max(1, i - 10)); - } - _quickLookup.Add(FullLoadEntries.Last().EngineSpeed + 0.1.SI<PerSecond>(), Math.Max(1, i - 10)); - } - var start = 1; - foreach (var lookup in _quickLookup.Where(lookup => angularVelocity < lookup.Key)) { - start = lookup.Value; - break; - } - - for (var index = start; index < FullLoadEntries.Count; index++) { - if (angularVelocity >= FullLoadEntries[index - 1].EngineSpeed && - angularVelocity <= FullLoadEntries[index].EngineSpeed) { - return index; - } - } - throw new VectoException("angular velocity {0} exceeds full load curve: min: {1} max: {2}", angularVelocity, - FullLoadEntries.First().EngineSpeed, FullLoadEntries.Last().EngineSpeed); - } - - [DebuggerDisplay("n: {EngineSpeed}, fullTorque: {TorqueFullLoad}, dragTorque: {TorqueDrag}")] - internal class FullLoadCurveEntry - { - [Required, SIRange(0, 5000 * Constants.RPMToRad)] - public PerSecond EngineSpeed { get; set; } - - [Required, SIRange(0, 10000)] - public NewtonMeter TorqueFullLoad { get; set; } - - [Required, SIRange(-10000, 0)] - public NewtonMeter TorqueDrag { get; set; } - - #region Equality members - - protected bool Equals(FullLoadCurveEntry other) - { - return Equals(EngineSpeed, other.EngineSpeed) && Equals(TorqueFullLoad, other.TorqueFullLoad) && - Equals(TorqueDrag, other.TorqueDrag); - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) { - return false; - } - if (ReferenceEquals(this, obj)) { - return true; - } - if (obj.GetType() != GetType()) { - return false; - } - return Equals((FullLoadCurveEntry)obj); - } - - public override int GetHashCode() - { - unchecked { - var hashCode = EngineSpeed != null ? EngineSpeed.GetHashCode() : 0; - hashCode = (hashCode * 397) ^ (TorqueFullLoad != null ? TorqueFullLoad.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (TorqueDrag != null ? TorqueDrag.GetHashCode() : 0); - return hashCode; - } - } - - #endregion - } - } -} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs index 2dfc3f7668a3bb5eecb00acf033abf8014bf064b..306828b54ba48bbccdb59340c6f141ddffcc1281 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/GearData.cs @@ -89,7 +89,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox } var result = gearData.TorqueConverterShiftPolygon.Validate(mode, gbxType, emsMission); if (result.Any()) { - return new ValidationResult(string.Format("Validation of GearData failed"), result.Select(x => x.ErrorMessage)); + return new ValidationResult("Validation of GearData failed", result.Select(x => x.ErrorMessage)); } } return ValidationResult.Success; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs index 07e62381ee442de0471acdced853c8ea2d1471e9..591212a1e45f7c0c1c5f93f309073e59fafa7398 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs @@ -34,7 +34,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using TUGraz.VectoCommon.Exceptions; -using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs index 01f4af9bfb086930d1e85443323debd3e156dadd..6438cf798c45e14398c6a7b5768e5df34e3fe05c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs @@ -133,10 +133,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox get { return _entries[i]; } } +#if DEBUG public void DrawGraph() { _lossMap.DrawGraph(); } +#endif [DebuggerDisplay("GearLossMapEntry({InputSpeed}, {InputTorque}, {TorqueLoss})")] public class GearLossMapEntry diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs index 1d33219f7beee704a921d036f88849c3556ee61e..31d10fc0203ad520e6172958b2f9a472c211d6dd 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs @@ -37,9 +37,7 @@ using System.Linq; using System.Runtime.Serialization; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs index 2eed9ad6e2c9c73582017e403fa7955f36a86ddd..41740fad5fce5efa6a5a6e111af5af055725876b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs @@ -30,12 +30,8 @@ */ using System.ComponentModel.DataAnnotations; -using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.Simulation.Data; -using TUGraz.VectoCore.OutputData.XML; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/IAuxiliary.cs deleted file mode 100644 index 4adffdb5b711aa8d9652d432ed95ec502a892258..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/Models/SimulationComponent/IAuxiliary.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 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 -*/ - -namespace TUGraz.VectoCore.Models.SimulationComponent -{ - /// <summary> - /// Defines interfaces for auxiliary components. - /// </summary> - public interface IAuxiliary : IPowerTrainComponent {} -} \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs index 92c7dc90e56f68092123ec72d3fdd87c7b187758..69c07e5fb1fd2d67e057d34d07960537ab38a29c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs @@ -31,13 +31,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent { - public enum ClutchState - { - ClutchClosed, - ClutchOpened, - ClutchSlipping - } - public interface IClutch : IPowerTrainComponent { //ITnOutPort IdleControlPort { get; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs b/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs index b2ae9d8dfb8d6971702dff80c32f2124eb34c454..aa2af093b01c72d48f4895058d22be8957b0a5a5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IIdleController.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Connector.Ports; namespace TUGraz.VectoCore.Models.SimulationComponent diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index 83fc6641c1ff0f8a4dff28d02e3fe228cfde41c3..eab0e66a3e956350ffda779bfce63e4063890d54 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -35,7 +35,6 @@ using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; -using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { @@ -44,8 +43,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// </summary> public class AMTShiftStrategy : ShiftStrategy { - protected uint MaxStartGear; - protected uint _nextGear { get; set; } + protected readonly uint MaxStartGear; + protected uint _nextGear; public AMTShiftStrategy(VectoRunData runData, IDataBus dataBus) : base(runData.GearboxData, dataBus) { @@ -111,13 +110,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var fullLoadPower = response.DynamicFullLoadPower; //EnginePowerRequest - response.DeltaFullLoad; var reserve = 1 - response.EnginePowerRequest / fullLoadPower; - var inTorque = response.ClutchPowerRequest / inAngularSpeed; - - + if (response.EngineSpeed > DataBus.EngineIdleSpeed && reserve >= ModelData.StartTorqueReserve) { _nextGear = gear; - //_gearbox.LastUpshift = absTime; - //_gearbox.LastDownshift = absTime; return gear; } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs index ff8fc30a4160e679ca79e5fe155fc2b4ffb75388..c7ca8e5ec71df0e7ff4005468f130b06b2854bdb 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs @@ -49,7 +49,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private readonly IShiftStrategy _strategy; protected internal readonly TorqueConverter TorqueConverter; private IIdleController _idleController; - protected bool _requestAfterGearshift; + protected bool RequestAfterGearshift; public bool TorqueConverterLocked { @@ -201,7 +201,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl IResponse retVal; var count = 0; var loop = false; - if (_requestAfterGearshift) { + if (RequestAfterGearshift) { LastShift = absTime; Gear = _strategy.Engage(absTime, dt, outTorque, outAngularVelocity); CurrentState.PowershiftLossEnergy = ComputeShiftLosses(outTorque, outAngularVelocity); @@ -227,7 +227,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl GearboxPowerRequest = outTorque * (PreviousState.OutAngularVelocity + outAngularVelocity) / 2.0 }; - _requestAfterGearshift = true; + RequestAfterGearshift = true; LastShift = absTime; } else { loop = true; @@ -391,7 +391,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ModelData.Gears[Gear].Ratio); } } - _requestAfterGearshift = false; + RequestAfterGearshift = false; if (DataBus.VehicleStopped) { CurrentState.Disengaged = true; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs index c1194b4181101058e91c296872cf2830d80f5dd7..27701f2cca2d930ad01372e559140aae0a45879d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AbstractGearbox.cs @@ -52,14 +52,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// </summary> [Required, ValidateObject] internal readonly GearboxData ModelData; - protected KilogramSquareMeter EngineInertia; - protected AbstractGearbox(IVehicleContainer container, VectoRunData runData) : base(container) { ModelData = runData.GearboxData; - EngineInertia = runData.EngineData != null - ? runData.EngineData.Inertia - : 0.SI<KilogramSquareMeter>(); } #region ITnOutPort @@ -148,7 +143,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected internal WattSecond ComputeShiftLosses(NewtonMeter outTorque, PerSecond outAngularVelocity) { var torqueGbxIn = outTorque / ModelData.Gears[Gear].Ratio; - var deltaEngineSpeed = DataBus.EngineSpeed - outAngularVelocity * ModelData.Gears[Gear].Ratio; var deltaClutchSpeed = (DataBus.EngineSpeed - PreviousState.OutAngularVelocity * ModelData.Gears[Gear].Ratio) / 2; var shiftLossEnergy = torqueGbxIn * deltaClutchSpeed * ModelData.PowershiftShiftTime; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AxleGear.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AxleGear.cs index a169a68106f9bd7522e07b6a618c46fcaa53773e..2044fa57df3ace8be88d5fc9276363db12f2c0d9 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AxleGear.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AxleGear.cs @@ -60,7 +60,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public Watt AxlegearLoss() { - return PreviousState.TorqueLoss * PreviousState.InAngularVelocity; + return PreviousState.TorqueLossResult.Value * PreviousState.InAngularVelocity; } } } \ 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 9901d0c982528a9007ab69f06b5052abe5afcdbd..b8336024bb8591483a8ff6b90c9d72793c791aee 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs @@ -38,7 +38,6 @@ using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.OutputData; -using TUGraz.VectoCore.Utils; using VectoAuxiliaries; using VectoAuxiliaries.Pneumatics; @@ -46,11 +45,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public class BusAuxiliariesAdapter : LoggingObject, IAuxInProvider, IAuxPort { - protected IDataBus DataBus; + protected readonly IDataBus DataBus; protected internal BusAuxState CurrentState; protected internal BusAuxState PreviousState; - protected internal IAuxPort AdditionalAux; + protected internal readonly IAuxPort AdditionalAux; protected IAdvancedAuxiliaries Auxiliaries; private readonly FuelConsumptionAdapter _fcMapAdapter; @@ -61,22 +60,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // mAAUX_Global.advancedAuxModel.Signals.DeclarationMode = Cfg.DeclMode // mAAUX_Global.advancedAuxModel.Signals.WHTC = Declaration.WHTCcorrFactor CurrentState = new BusAuxState(); - PreviousState = new BusAuxState(); - PreviousState.AngularSpeed = engineIdleSpeed; + PreviousState = new BusAuxState { AngularSpeed = engineIdleSpeed }; AdditionalAux = additionalAux; DataBus = container; - var tmpAux = new AdvancedAuxiliaries(); - - //var actuationsMap = new PneumaticActuationsMAP(); - - - // 'Set Statics - tmpAux.VectoInputs.Cycle = DetermineCycle(cycleName); - tmpAux.VectoInputs.VehicleWeightKG = vehicleWeight; - // tmpAux.Signals.TotalCycleTimeSeconds = - // tmpAux.actuationsMap.GetNumActuations(new ActuationsKey("CycleTime", tmpAux.VectoInputs.Cycle)); + var tmpAux = new AdvancedAuxiliaries { + VectoInputs = { + Cycle = DetermineCycle(cycleName), + VehicleWeightKG = vehicleWeight + } + }; _fcMapAdapter = new FuelConsumptionAdapter() { FcMap = fcMap }; tmpAux.VectoInputs.FuelMap = _fcMapAdapter; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs index 92f2cc3addee9502a27439b6c66c396517be0d2d..8a5301b7f74888cf28cbccaa2d46e1a0e6e256db 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs @@ -47,7 +47,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { private readonly PerSecond _idleSpeed; private readonly PerSecond _ratedSpeed; - private const double ClutchEff = 1; public IIdleController IdleController { get { return _idleController; } @@ -145,13 +144,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // Reason: if angularVelocity = 0 also the power (torque * angularVelocity) is 0 and then // the torque demand for the engine is 0. no drag torque although vehicle has to decelerate // "the clutch" eats up the whole torque - var effectiveAngularVelocity = angularVelocity.IsEqual(0.SI<PerSecond>()) - ? (PreviousState.OutAngularVelocity + angularVelocity) / 2 - : angularVelocity; var engineSpeed = VectoMath.Max(_idleSpeed, angularVelocity); angularVelocityIn = _clutchSpeedSlippingFactor * engineSpeed + _idleSpeed; - //torqueIn = torque * effectiveAngularVelocity / ClutchEff / angularVelocityIn; + } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 09c8096309d4317782ccfa6cb0fe438fa977f51f..61febfe04e2865a4c4543040cb9e297f94f07a91 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -301,12 +301,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ModelData.FullLoadCurves[0].N95hSpeed); } - private NewtonMeter ComputeDelta(NewtonMeter torqueOut, NewtonMeter totalTorqueDemand, NewtonMeter maxEngineTorque) - { - var deltaEngine = totalTorqueDemand - maxEngineTorque; - return deltaEngine; - } - public IResponse Initialize(NewtonMeter outTorque, PerSecond outAngularVelocity) { if (outAngularVelocity == null) { @@ -419,25 +413,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl #endregion - /// <summary> - /// Updates the engine state dependend on the requested power [W]. - /// </summary> - protected virtual void UpdateEngineState(Watt requestedEnginePower, PerSecond avgEngineSpeed) - { - if (requestedEnginePower < -ZeroThreshold) { - CurrentState.OperationMode = IsFullLoad(requestedEnginePower, CurrentState.DynamicFullLoadTorque * avgEngineSpeed) - ? EngineOperationMode.FullLoad - : EngineOperationMode.Load; - } else if (requestedEnginePower > ZeroThreshold) { - CurrentState.OperationMode = IsFullLoad(requestedEnginePower, CurrentState.FullDragTorque * avgEngineSpeed) - ? EngineOperationMode.FullDrag - : EngineOperationMode.Drag; - } else { - // -ZeroThreshold <= requestedEnginePower <= ZeroThreshold - CurrentState.OperationMode = EngineOperationMode.Idle; - } - } - /// <summary> /// computes full load power from gear [-], angularVelocity [rad/s] and dt [s]. /// </summary> @@ -450,7 +425,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.StationaryFullLoadTorque = ModelData.FullLoadCurves[DataBus.Gear].FullLoadStationaryTorque(angularVelocity); var stationaryFullLoadPower = CurrentState.StationaryFullLoadTorque * angularVelocity; - Watt dynFullPowerCalculated = 0.SI<Watt>(); + Watt dynFullPowerCalculated; // disable pt1 behaviour if PT1Disabled is true, or if the previous enginepower is greater than the current stationary fullload power (in this case the pt1 calculation fails) if (PT1Disabled || PreviousState.EnginePower.IsGreaterOrEqual(stationaryFullLoadPower)) { @@ -461,7 +436,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var powerRatio = (PreviousState.EnginePower / stationaryFullLoadPower).Value(); var tStarPrev = pt1 * Math.Log(1.0 / (1 - powerRatio), Math.E).SI<Second>(); var tStar = tStarPrev + PreviousState.dt; - dynFullPowerCalculated = stationaryFullLoadPower * (pt1.IsEqual(0) ? 1 : (1 - Math.Exp((-tStar / pt1).Value()))); + dynFullPowerCalculated = stationaryFullLoadPower * (pt1.IsEqual(0) ? 1 : 1 - Math.Exp((-tStar / pt1).Value())); } catch (VectoException e) { Log.Warn("PT1 calculation failed (dryRun: {0}): {1}", dryRun, e.Message); if (dryRun) { @@ -517,8 +492,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected class CombustionEngineIdleController : LoggingObject, IIdleController { - private readonly double PeDropSlope = -5; - private readonly double PeDropOffset = 1.0; + private const double PeDropSlope = -5; + private const double PeDropOffset = 1.0; private readonly CombustionEngine _engine; private readonly IDataBus _dataBus; @@ -550,14 +525,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { if (!_dataBus.VehicleStopped && _dataBus.Gear != _dataBus.NextGear.Gear && _dataBus.Gear != 0 && _dataBus.NextGear.Gear != 0) { - return RequestDoubleClutch(absTime, dt, outTorque, outAngularVelocity, dryRun); - } else { - return RequestIdling(absTime, dt, outTorque, outAngularVelocity, dryRun); + return RequestDoubleClutch(absTime, dt, outTorque, outAngularVelocity); } + return RequestIdling(absTime, dt, outTorque, outAngularVelocity); } - private IResponse RequestDoubleClutch(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, - bool dryRun = false) + private IResponse RequestDoubleClutch(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity) { if (outAngularVelocity != null) { throw new VectoException("IdleController can only handle idle requests, i.e. angularVelocity == null!"); @@ -577,13 +550,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl : (_engineTargetSpeed - _engine.PreviousState.EngineSpeed) / (_dataBus.TractionInterruption - (absTime - _idleStart)); - var nextAngularSpeed = (velocitySlope * dt + _engine.PreviousState.EngineSpeed); + var nextAngularSpeed = velocitySlope * dt + _engine.PreviousState.EngineSpeed; var engineMaxSpeed = VectoMath.Min(_dataBus.GetGearData(_dataBus.NextGear.Gear).MaxSpeed, _engine.ModelData.FullLoadCurves[0].N95hSpeed); nextAngularSpeed = velocitySlope < 0 - ? VectoMath.LimitTo(VectoMath.Max(_engineTargetSpeed, nextAngularSpeed), _engine.EngineIdleSpeed, engineMaxSpeed) - : VectoMath.LimitTo(VectoMath.Min(_engineTargetSpeed, nextAngularSpeed), _engine.EngineIdleSpeed, engineMaxSpeed); + ? VectoMath.Max(_engineTargetSpeed, nextAngularSpeed).LimitTo(_engine.EngineIdleSpeed, engineMaxSpeed) + : VectoMath.Min(_engineTargetSpeed, nextAngularSpeed).LimitTo(_engine.EngineIdleSpeed, engineMaxSpeed); var retVal = RequestPort.Request(absTime, dt, 0.SI<NewtonMeter>(), nextAngularSpeed); @@ -619,8 +592,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return retVal; } - private IResponse RequestIdling(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, - bool dryRun = false) + private IResponse RequestIdling(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity) { if (outAngularVelocity != null) { throw new VectoException("IdleController can only handle idle requests, i.e. angularVelocity == null!"); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index da05cbaf73afd19285ea9b89b1b5a2e3faba0bf8..4be4328c236fe9d573c70511f031368323d4287b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -49,7 +49,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <summary> /// True if gearbox is disengaged (no gear is set). /// </summary> - protected internal Second Disengaged = null; + protected internal Second Disengaged; protected bool? TorqueConverterActive; @@ -104,7 +104,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl inTorque += torqueLossInertia; - response = (TorqueConverterActive != null && TorqueConverterActive.Value) + response = TorqueConverterActive != null && TorqueConverterActive.Value && TorqueConverter != null ? TorqueConverter.Initialize(inTorque, inAngularVelocity) : NextComponent.Initialize(inTorque, inAngularVelocity); } else { @@ -248,7 +248,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return dryRunResponse; } - CurrentState.TransmissionTorqueLoss = inTorque * effectiveRatio - (outTorque); + CurrentState.TransmissionTorqueLoss = inTorque * effectiveRatio - outTorque; CurrentState.SetState(inTorque, inAngularVelocity, outTorque, outAngularVelocity); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index e02d2635379cec11eccbed66612a9d4904ad356e..8585880d0192206d1b9f28dbb5727d20e37d32ad 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -57,7 +57,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected internal DrivingMode CurrentDrivingMode; - protected Dictionary<DrivingMode, IDriverMode> DrivingModes = new Dictionary<DrivingMode, IDriverMode>(); + protected readonly Dictionary<DrivingMode, IDriverMode> DrivingModes = new Dictionary<DrivingMode, IDriverMode>(); public DefaultDriverStrategy() { @@ -122,7 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private void UpdateDrivingAction(Meter currentDistance, Meter ds) { - var nextAction = GetNextDrivingAction(currentDistance, ds); + var nextAction = GetNextDrivingAction(ds); if (NextDrivingAction == null) { if (nextAction != null) { // take the new action @@ -168,7 +168,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("Next Driving Action: {0}", NextDrivingAction); } - protected internal DrivingBehaviorEntry GetNextDrivingAction(Meter minDistance, Meter ds) + protected internal DrivingBehaviorEntry GetNextDrivingAction(Meter ds) { var currentSpeed = Driver.DataBus.VehicleSpeed; @@ -582,7 +582,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl DefaultDriverStrategy.BrakingSafetyMargin; DriverStrategy.BrakeTrigger.BrakingStartDistance = DriverStrategy.BrakeTrigger.TriggerDistance - brakingDistance; if (Phase == BrakingPhase.Coast) { - var nextBrakeAction = DriverStrategy.GetNextDrivingAction(DataBus.Distance, ds); + var nextBrakeAction = DriverStrategy.GetNextDrivingAction(ds); if (nextBrakeAction != null && !DriverStrategy.BrakeTrigger.TriggerDistance.IsEqual(nextBrakeAction.TriggerDistance) && nextBrakeAction.BrakingStartDistance.IsSmaller(DriverStrategy.BrakeTrigger.BrakingStartDistance)) { DriverStrategy.BrakeTrigger = nextBrakeAction; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs index 44fef3bf3e1619b44afcf0f633ae32c402a5d5c8..65cfa1d1204a21d85b7f4568d438c9a29c0f99ca 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs @@ -54,7 +54,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl IDrivingCycle, ISimulationOutPort, IDrivingCycleInPort, IDisposable { private const double LookaheadTimeSafetyMargin = 1.5; - internal readonly IDrivingCycleData _data; + internal readonly IDrivingCycleData Data; internal readonly DrivingCycleEnumerator CycleIntervalIterator; private bool _intervalProlonged; internal IdleControllerSwitcher IdleController; @@ -71,11 +71,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public DistanceBasedDrivingCycle(IVehicleContainer container, IDrivingCycleData cycle) : base(container) { - _data = cycle; - CycleIntervalIterator = new DrivingCycleEnumerator(_data); - CycleStartDistance = _data.Entries.Count > 0 ? _data.Entries.First().Distance : 0.SI<Meter>(); + Data = cycle; + CycleIntervalIterator = new DrivingCycleEnumerator(Data); + CycleStartDistance = Data.Entries.Count > 0 ? Data.Entries.First().Distance : 0.SI<Meter>(); - var first = _data.Entries.First(); + var first = Data.Entries.First(); PreviousState = new DrivingCycleState { AbsTime = 0.SI<Second>(), WaitTime = 0.SI<Second>(), @@ -130,7 +130,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return CurrentState.Response; } } - if (CycleIntervalIterator.LastEntry && PreviousState.Distance.IsEqual(CycleIntervalIterator.RightSample.Distance)) { + if (CycleIntervalIterator.LastEntry && PreviousState.Distance.IsEqual(Right.Distance)) { CurrentState.Response = new ResponseCycleFinished(); return CurrentState.Response; } @@ -159,7 +159,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } // only drive until next sample point in cycle with speed change Log.Debug("Limiting distance to next sample point {0}", - CycleIntervalIterator.RightSample.Distance - PreviousState.Distance); + Right.Distance - PreviousState.Distance); CurrentState.Response = new ResponseDrivingCycleDistanceExceeded { Source = this, MaxDistance = nextSpeedChange - PreviousState.Distance @@ -325,7 +325,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // separately test for equality and greater than to have tolerance for equality comparison if (stopTime.IsEqual(0)) { - while (stopTime.IsEqual(0) && CurrentState.Distance.IsGreaterOrEqual(CycleIntervalIterator.RightSample.Distance) && + while (stopTime.IsEqual(0) && CurrentState.Distance.IsGreaterOrEqual(Right.Distance) && !CycleIntervalIterator.LastEntry) { // we have reached the end of the current interval in the cycle, move on... CycleIntervalIterator.MoveNext(); @@ -347,8 +347,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private Radian ComputeGradient(Meter ds) { - //var leftSamplePoint = Left; - var cycleIterator = CycleIntervalIterator.Clone(); while (cycleIterator.RightSample.Distance < PreviousState.Distance + ds && !cycleIterator.LastEntry) { cycleIterator.MoveNext(); @@ -393,9 +391,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public double Progress { get { - return _data.Entries.Count > 0 - ? (CurrentState.Distance.Value() - _data.Entries.First().Distance.Value()) / - (_data.Entries.Last().Distance.Value() - _data.Entries.First().Distance.Value()) + return Data.Entries.Count > 0 + ? (CurrentState.Distance.Value() - Data.Entries.First().Distance.Value()) / + (Data.Entries.Last().Distance.Value() - Data.Entries.First().Distance.Value()) : 0; } } @@ -444,7 +442,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public void FinishSimulation() { - _data.Finish(); + Data.Finish(); } public CycleData CycleData @@ -466,8 +464,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var absDistance = CurrentState.Distance + distance; var myIterator = CycleIntervalIterator.Clone(); - if (absDistance > _data.Entries.Last().Distance) { - return ExtrapolateCycleEntry(absDistance, _data.Entries.Last()); + if (absDistance > Data.Entries.Last().Distance) { + return ExtrapolateCycleEntry(absDistance, Data.Entries.Last()); } while (myIterator.RightSample.Distance < absDistance) { myIterator.MoveNext(); @@ -510,13 +508,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return PreviousState.Altitude; } } - internal void SetDriveOffDistance(Meter startDistance) - { - while (CycleIntervalIterator.MoveNext() && CycleIntervalIterator.RightSample.Distance < startDistance) {} - PreviousState.Distance = startDistance; - CycleStartDistance = startDistance; - } - public sealed class DrivingCycleState { public DrivingCycleState Clone() diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 6264f2e361376100f5e2c0dd75c737ebdeca5cd3..a26fd8719e955d0535bf5b8e98277f0f854f2c34 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -51,7 +51,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { public DriverData DriverData { get; protected set; } - protected IDriverStrategy DriverStrategy; + protected readonly IDriverStrategy DriverStrategy; public string CurrentAction = ""; public Driver(IVehicleContainer container, DriverData driverData, IDriverStrategy strategy) : base(container) @@ -187,7 +187,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal = NextComponent.Request(absTime, limitedOperatingPoint.SimulationInterval, limitedOperatingPoint.Acceleration, gradient); - retVal.Acceleration = limitedOperatingPoint.Acceleration; + if (retVal != null) { + retVal.Acceleration = limitedOperatingPoint.Acceleration; + } retVal.Switch(). Case<ResponseUnderload>(() => operatingPoint = limitedOperatingPoint) . // acceleration is limited by driver model, operating point moves below drag curve diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DrivingCycleEnumerator.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DrivingCycleEnumerator.cs index 03ba010b74bad50031d612d17c0e9e12919e38bc..23fe76fe9670ec7b08e80252827604cafa48df43 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DrivingCycleEnumerator.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DrivingCycleEnumerator.cs @@ -59,11 +59,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl get { return LeftSample; } } - public DrivingCycleData.DrivingCycleEntry Next - { - get { return RightSample; } - } - public DrivingCycleData.DrivingCycleEntry LeftSample { get { return _data.Entries[_currentCycleIndex]; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs index 87046f9ace667c8b34d9946bbd19761fa329a4ef..a3368effb0d3756d230a1eb7d67bac13d4b79668 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/EngineAuxiliary.cs @@ -132,7 +132,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, PerSecond angularSpeed, bool dryRun = false) { - var avgAngularSpeed = (PreviousState.AngularSpeed != null) + var avgAngularSpeed = PreviousState.AngularSpeed != null ? (angularSpeed + PreviousState.AngularSpeed) / 2.0 : angularSpeed; if (!dryRun) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 91078169572f0ebe1700a9a147765ef9f69c4917..2cd520163f3576e13b747a9768eceec1385f70ec 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -185,15 +185,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); } - IResponse retVal; - // TODO MQ 2016/03/10: investigate further the effects of having the condition angularvelocity != 0 - if (ClutchClosed(absTime) /* && !angularVelocity.IsEqual(0) */) { - retVal = RequestGearEngaged(absTime, dt, outTorque, outAngularVelocity, dryRun); - } else { - retVal = RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); - } - - return retVal; + return ClutchClosed(absTime) + ? RequestGearEngaged(absTime, dt, outTorque, outAngularVelocity, dryRun) + : RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); } /// <summary> @@ -244,7 +238,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var shiftTimeExceeded = absTime.IsSmaller(_engageTime) && _engageTime.IsSmaller(absTime + dt, Constants.SimulationSettings.LowerBoundTimeInterval); // allow 5% tolerance of shift time - if (shiftTimeExceeded && (_engageTime - absTime) > Constants.SimulationSettings.LowerBoundTimeInterval / 2) { + if (shiftTimeExceeded && _engageTime - absTime > Constants.SimulationSettings.LowerBoundTimeInterval / 2) { return new ResponseFailTimeInterval { Source = this, DeltaT = _engageTime - absTime, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/IdleControllerSwitcher.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IdleControllerSwitcher.cs index 6682c6287a8cfa4f09ad3e45485abab7cff8df99..e541ca5304c9c34daae4182f3bfb54e9cda8403a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/IdleControllerSwitcher.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IdleControllerSwitcher.cs @@ -32,7 +32,6 @@ using System; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.OutputData; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs index e3f9d3f5a44c6025422a436e176d7e61c0b83d5e..ff1a63301f24694d6683c2326bf1b7883f4e266f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs @@ -31,7 +31,6 @@ using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; -using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MeasuredSpeedDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MeasuredSpeedDrivingCycle.cs index d10714a91db57a2f0b5dba905a63cfd83620cfea..ff169975d52b90ac088289cef4a8633480103702 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MeasuredSpeedDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MeasuredSpeedDrivingCycle.cs @@ -71,7 +71,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } protected readonly IDrivingCycleData Data; - private bool _isInitializing; + protected internal readonly DrivingCycleEnumerator CycleIterator; protected Second AbsTime { get; set; } @@ -99,15 +99,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl AbsTime = first.Time; - _isInitializing = true; - var response = NextComponent.Initialize(first.VehicleTargetSpeed, first.RoadGradient); if (!(response is ResponseSuccess)) { throw new UnexpectedResponseException("MeasuredSpeedDrivingCycle: Couldn't find start gear.", response); } - _isInitializing = false; - response.AbsTime = AbsTime; return response; } @@ -127,8 +123,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return new ResponseCycleFinished { AbsTime = absTime, Source = this }; } + if (CycleIterator.RightSample == null) { + throw new VectoException("Exceeding cycle!"); + } // interval exceeded - if (CycleIterator.RightSample != null && (absTime + dt).IsGreater(CycleIterator.RightSample.Time)) { + if ((absTime + dt).IsGreater(CycleIterator.RightSample.Time)) { return new ResponseFailTimeInterval { AbsTime = absTime, Source = this, @@ -137,9 +136,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } // calc acceleration from speed diff vehicle to cycle - var targetSpeed = CycleIterator.RightSample == null - ? 0.KMPHtoMeterPerSecond() - : CycleIterator.RightSample.VehicleTargetSpeed; + var targetSpeed = CycleIterator.RightSample.VehicleTargetSpeed; if (targetSpeed.IsEqual(0.KMPHtoMeterPerSecond(), 0.5.KMPHtoMeterPerSecond())) { targetSpeed = 0.KMPHtoMeterPerSecond(); } @@ -172,13 +169,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl response.Switch() .Case<ResponseGearShift>(() => response = NextComponent.Request(absTime, dt, acceleration, gradient)) .Case<ResponseUnderload>(r => { + var acceleration1 = acceleration; DataBus.BrakePower = SearchAlgorithm.Search(DataBus.BrakePower, r.Delta, -r.Delta, getYValue: result => DataBus.ClutchClosed(absTime) ? ((ResponseDryRun)result).DeltaDragLoad : ((ResponseDryRun)result).GearboxPowerRequest, evaluateFunction: x => { DataBus.BrakePower = x; - return NextComponent.Request(absTime, dt, acceleration, gradient, true); + return NextComponent.Request(absTime, dt, acceleration1, gradient, true); }, criterion: y => DataBus.ClutchClosed(absTime) ? ((ResponseDryRun)y).DeltaDragLoad.Value() @@ -295,11 +293,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl AdvanceState(); } - public string CycleName - { - get { return Data.Name; } - } - public double Progress { get { return AbsTime == null ? 0 : AbsTime.Value() / Data.Entries.Last().Time.Value(); } @@ -360,11 +353,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Data.Finish(); } - public bool VehicleStopped - { - get { return !_isInitializing && CycleIterator.LeftSample.VehicleTargetSpeed.IsEqual(0); } - } - public DrivingBehavior DriverBehavior { get; internal set; } public MeterPerSquareSecond DriverAcceleration { get; protected set; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PWheelCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PWheelCycle.cs index a00c01d0700f5fdd1b97fa86880f6a7f8f425eb2..a4c05cbf38165b325f6bd28e9a269e4c030dc03f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PWheelCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PWheelCycle.cs @@ -46,7 +46,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// </summary> public class PWheelCycle : PowertrainDrivingCycle, IDriverInfo, IVehicleInfo { - private VehicleData _vehicleData; + private readonly VehicleData _vehicleData; /// <summary> /// Initializes a new instance of the <see cref="PWheelCycle"/> class. diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs index 65ce76834398b6ba575563cedabd0c337d5ae69e..4b2364963ed7c3fb384949a40b16216894cba2fc 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs @@ -35,7 +35,6 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; @@ -155,11 +154,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return response; } - public string CycleName - { - get { return Data.Name; } - } - public double Progress { get { return AbsTime.Value() / Data.Entries.Last().Time.Value(); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index cbdd2f497450c9ee7bc41cc849c95fa973e5faa2..74e54b75309afa23927a763b6a83fd3d05dd8ce3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -107,20 +107,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var engineResponse = (ResponseDryRun) NextComponent.Request(absTime, dt, inTorque, operatingPoint.InAngularVelocity, true); - //TorqueConverterOperatingPoint dryOperatingPoint; - //if (false && DataBus.VehicleStopped && DataBus.DriverBehavior == DrivingBehavior.Driving && outTorque.IsGreater(0)) { - // dryOperatingPoint = ModelData.FindOperatingPoint(DataBus.EngineIdleSpeed, outAngularVelocity); - //} else { - //dryOperatingPoint = (DataBus.DriverBehavior != DrivingBehavior.Braking && DataBus.BrakePower.IsEqual(0)) || - // (outTorque.IsGreater(0) && DataBus.BrakePower.IsEqual(0)) - // ? GetMaxPowerOperatingPoint(dt, outAngularVelocity, engineResponse, - // PreviousState.InTorque * PreviousState.InAngularVelocity) - // : GetDragPowerOperatingPoint(dt, outAngularVelocity, engineResponse, - // PreviousState.InTorque * PreviousState.InAngularVelocity); - //} - var condition1 = (DataBus.DriverBehavior != DrivingBehavior.Braking && DataBus.BrakePower.IsEqual(0)); - var condition2 = (outTorque.IsGreater(0) && DataBus.BrakePower.IsEqual(0)); - var engineOK = engineResponse.DeltaDragLoad.IsGreaterOrEqual(0) && engineResponse.DeltaFullLoad.IsSmallerOrEqual(0); if (DataBus.DriverBehavior != DrivingBehavior.Braking && engineOK && operatingPoint.Creeping) { var delta = (outTorque - operatingPoint.OutTorque) * @@ -188,7 +174,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var operatingPoint = ModelData.FindOperatingPointForPowerDemand( engineResponse.DragPower - engineResponse.AuxiliariesPowerDemand, DataBus.EngineSpeed, outAngularVelocity, _engineInertia, dt, previousPower); - var maxInputSpeed = VectoMath.Min<PerSecond>(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); + var maxInputSpeed = VectoMath.Min(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); if (operatingPoint.InAngularVelocity.IsGreater(maxInputSpeed)) { operatingPoint = ModelData.FindOperatingPoint(maxInputSpeed, outAngularVelocity); } @@ -211,7 +197,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var operatingPoint = ModelData.FindOperatingPointForPowerDemand( engineResponse.DynamicFullLoadPower - engineResponse.AuxiliariesPowerDemand, DataBus.EngineSpeed, outAngularVelocity, _engineInertia, dt, previousPower); - var maxInputSpeed = VectoMath.Min<PerSecond>(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); + var maxInputSpeed = VectoMath.Min(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); if (operatingPoint.InAngularVelocity.IsGreater(maxInputSpeed)) { operatingPoint = ModelData.FindOperatingPoint(maxInputSpeed, outAngularVelocity); } @@ -242,7 +228,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl "TorqueConverter: Invalid operating point, inAngularVelocity would be below engine's idle speed: {0}", operatingPoint.InAngularVelocity); } - var maxInputSpeed = VectoMath.Min<PerSecond>(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); + var maxInputSpeed = VectoMath.Min(ModelData.TorqueConverterSpeedLimit, DataBus.EngineRatedSpeed); if (operatingPoint.InAngularVelocity.IsGreater(maxInputSpeed)) { operatingPoint = ModelData.FindOperatingPoint(maxInputSpeed, outAngularVelocity); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TransmissionComponent.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TransmissionComponent.cs index 4053d8c0ee5958fc90606c7c7cfc843dfb6d87a1..8c435e0c39559b6ba730a64c23b4a3790386a76c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TransmissionComponent.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TransmissionComponent.cs @@ -48,7 +48,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public class TransmissionState : SimpleComponentState { public TransmissionLossMap.LossMapResult TorqueLossResult; - public NewtonMeter TorqueLoss = 0.SI<NewtonMeter>(); + //public NewtonMeter TorqueLoss = 0.SI<NewtonMeter>(); } protected TransmissionComponent(IVehicleContainer container, TransmissionData modelData) : base(container) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs index d6ab6d75a9206b6de0b0b962527a341380c2c70f..94d7d85c572eb0fe970ff8164c908b4cf2169350 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs @@ -50,7 +50,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { internal readonly VehicleData ModelData; - public AirdragData AirdragData; + public readonly AirdragData AirdragData; public Vehicle(IVehicleContainer container, VehicleData modelData, AirdragData airdrag) : base(container) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs b/VectoCore/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs index a6f038af1abda1881925d29ae3dd06e4c4eee561..78f76fbbf23356a330a42805f0437e84e7300cd1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/VectoSimulationComponent.cs @@ -59,7 +59,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent dataBus.AddComponent(this); } - public virtual void CommitSimulationStep(IModalDataContainer container) + public void CommitSimulationStep(IModalDataContainer container) { if (container != null) { DoWriteModalResults(container); diff --git a/VectoCore/VectoCore/OutputData/DeclarationReport.cs b/VectoCore/VectoCore/OutputData/DeclarationReport.cs index ccb7e0918dfb9686244358b6ca531afe0d3afc8f..06e0eb19d3fd776278ce0676b96f432b30247bd1 100644 --- a/VectoCore/VectoCore/OutputData/DeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/DeclarationReport.cs @@ -30,10 +30,8 @@ */ using System.Collections.Generic; -using System.Linq; using System.Runtime.CompilerServices; using TUGraz.VectoCommon.Exceptions; -using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; @@ -91,10 +89,6 @@ namespace TUGraz.VectoCore.OutputData /// </summary> internal Segment Segment { get; set; } - /// <summary> - /// The creator name for the report. - /// </summary> - public string Creator { get; set; } /// <summary> /// The result count determines how many results must be given before the report gets written. diff --git a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs index b746e576059d8c6090e39da57e944c2adb4c2636..341fecb2cf7fa0f9ca99dd071dddb97fdc29b051 100644 --- a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs @@ -32,15 +32,12 @@ using System; using System.Collections.Generic; using System.Data; -using System.Diagnostics; using System.Linq; -using System.Runtime.Remoting.Metadata.W3cXsd2001; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.Simulation.Impl; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData { @@ -66,7 +63,7 @@ namespace TUGraz.VectoCore.OutputData /// <returns></returns> object this[string auxId] { get; set; } - bool HasTorqueConverter { get; set; } + bool HasTorqueConverter { set; } /// <summary> /// Commits the data of the current simulation step. @@ -92,8 +89,8 @@ namespace TUGraz.VectoCore.OutputData IEnumerable<T> GetValues<T>(Func<DataRow, T> selectorFunc); - Dictionary<string, DataColumn> Auxiliaries { get; set; } - + Dictionary<string, DataColumn> Auxiliaries { get; } + T TimeIntegral<T>(ModalResultField field, Func<SI, bool> filter = null) where T : SIBase<T>; void SetDataValue(string fieldName, object value); @@ -120,12 +117,6 @@ namespace TUGraz.VectoCore.OutputData return data.GetValues<T>(field).Min(); } - public static SI Average(this IEnumerable<SI> self, Func<SI, bool> filter) - { - var values = self.Where(filter ?? (x => x != null && !double.IsNaN(x.Value()))).ToList(); - return values.Any() ? values.Sum() / values.Count : null; - } - /// <summary> /// Returns a default value if the SI object is null. /// </summary> @@ -205,11 +196,6 @@ namespace TUGraz.VectoCore.OutputData return data.TimeIntegral<MeterPerSecond>(ModalResultField.acc) / data.Duration(); } - public static Second[] SimulationIntervals(this IModalDataContainer data) - { - return data.GetValues<Second>(ModalResultField.simulationInterval).ToArray(); - } - public static Meter AltitudeDelta(this IModalDataContainer data) { var altitudes = data.GetValues<Meter>(ModalResultField.altitude).ToList(); @@ -274,7 +260,7 @@ namespace TUGraz.VectoCore.OutputData { var max = data.Max<Meter>(ModalResultField.dist); var min = data.Min<Meter>(ModalResultField.dist); - return max == null || min == null ? null : (max - min); + return max == null || min == null ? null : max - min; } public static WattSecond WorkTotalMechanicalBrake(this IModalDataContainer data) diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index a6a5ec86d9048b2ce3a067e5e493585093d0ede0..df2e9f577d4b338de31d49c6c45523ce9f914b8d 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -32,7 +32,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.Diagnostics; using System.Globalization; using System.Linq; using System.Runtime.CompilerServices; diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs index 2c992aa64d7138355775dedd41947e0405c52a9e..46c1d5b677ca1224925c046682e2e4212d371ee3 100644 --- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs @@ -52,6 +52,8 @@ namespace TUGraz.VectoCore.OutputData public class SummaryDataContainer : LoggingObject, IDisposable { // ReSharper disable InconsistentNaming + public const string INTERNAL_PREFIX = "INTERNAL"; + public const string SORT = INTERNAL_PREFIX + " Sorting"; public const string JOB = "Job [-]"; public const string INPUTFILE = "Input File [-]"; public const string CYCLE = "Cycle [-]"; @@ -180,7 +182,7 @@ namespace TUGraz.VectoCore.OutputData // ReSharper restore InconsistentNaming - internal readonly DataTable _table; + internal readonly DataTable Table; private readonly ISummaryWriter _sumWriter; @@ -194,9 +196,10 @@ namespace TUGraz.VectoCore.OutputData { _sumWriter = writer; - _table = new DataTable(); + Table = new DataTable(); - _table.Columns.AddRange(new[] { + Table.Columns.AddRange(new[] { + Tuple.Create(SORT, typeof(int)), Tuple.Create(JOB, typeof(string)), Tuple.Create(INPUTFILE, typeof(string)), Tuple.Create(CYCLE, typeof(string)), @@ -249,7 +252,7 @@ namespace TUGraz.VectoCore.OutputData Tuple.Create(string.Format(AUX_TECH_FORMAT, Constants.Auxiliaries.IDs.ElectricSystem), typeof(string)), }.Select(x => new DataColumn(x.Item1, x.Item2)).ToArray()); - _table.Columns.AddRange(new[] { + Table.Columns.AddRange(new[] { CARGO_VOLUME, TIME, DISTANCE, SPEED, ALTITUDE_DELTA, @@ -276,7 +279,13 @@ namespace TUGraz.VectoCore.OutputData public virtual void Finish() { if (_sumWriter != null) { - _sumWriter.WriteSumData(new DataView(_table, "", JOB, DataViewRowState.CurrentRows).ToTable()); + var view = new DataView(Table, "", SORT, DataViewRowState.CurrentRows).ToTable(); + var toRemove = + view.Columns.Cast<DataColumn>().Where(column => column.ColumnName.StartsWith(INTERNAL_PREFIX)).ToList(); + foreach (var dataColumn in toRemove) { + view.Columns.Remove(dataColumn); + } + _sumWriter.WriteSumData(view); } } @@ -286,12 +295,13 @@ namespace TUGraz.VectoCore.OutputData [MethodImpl(MethodImplOptions.Synchronized)] //public virtual void Write(IModalDataContainer modData, string jobFileName, string jobName, string cycleFileName, // Kilogram vehicleMass, Kilogram vehicleLoading, CubicMeter cargoVolume, uint gearCount) - public virtual void Write(IModalDataContainer modData, string current, VectoRunData runData) + public virtual void Write(IModalDataContainer modData, int jobNr, int runNr, VectoRunData runData) { - var row = _table.NewRow(); - _table.Rows.Add(row); + var row = Table.NewRow(); + Table.Rows.Add(row); - row[JOB] = ReplaceNotAllowedCharacters(current); + row[SORT] = jobNr * 1000 + runNr; + row[JOB] = string.Format("{0}-{1}", jobNr, runNr); //ReplaceNotAllowedCharacters(current); row[INPUTFILE] = ReplaceNotAllowedCharacters(runData.JobName); row[CYCLE] = ReplaceNotAllowedCharacters(runData.Cycle.Name + Constants.FileExtensions.CycleFile); @@ -307,7 +317,7 @@ namespace TUGraz.VectoCore.OutputData row[HDV_CO2_VEHICLE_CLASS] = runData.VehicleData.VehicleClass.GetClassNumber(); row[CURB_MASS] = runData.VehicleData.CurbWeight; - // - (runData.VehicleData.BodyAndTrailerWeight ?? 0.SI<Kilogram>()); + // - (runData.VehicleData.BodyAndTrailerWeight ?? 0.SI<Kilogram>()); row[LOADING] = runData.VehicleData.Loading; row[CARGO_VOLUME] = runData.VehicleData.CargoVolume; @@ -388,16 +398,15 @@ namespace TUGraz.VectoCore.OutputData row[AXLE_RATIO] = runData.AxleGearData.AxleGear.Ratio.SI<Scalar>(); foreach (var aux in runData.Aux) { - string colName; if (aux.ID == Constants.Auxiliaries.IDs.PTOConsumer || aux.ID == Constants.Auxiliaries.IDs.PTOTransmission) { continue; } - colName = string.Format(AUX_TECH_FORMAT, aux.ID); + var colName = string.Format(AUX_TECH_FORMAT, aux.ID); - if (!_table.Columns.Contains(colName)) { - var col = _table.Columns.Add(colName, typeof(string)); + if (!Table.Columns.Contains(colName)) { + var col = Table.Columns.Add(colName, typeof(string)); // move the new column to correct position - col.SetOrdinal(_table.Columns[CARGO_VOLUME].Ordinal); + col.SetOrdinal(Table.Columns[CARGO_VOLUME].Ordinal); } row[colName] = aux.Technology == null ? "" : string.Join("; ", aux.Technology); @@ -485,10 +494,10 @@ namespace TUGraz.VectoCore.OutputData colName = string.Format(E_AUX_FORMAT, aux.Key); } - if (!_table.Columns.Contains(colName)) { - var col = _table.Columns.Add(colName, typeof(SI)); + if (!Table.Columns.Contains(colName)) { + var col = Table.Columns.Add(colName, typeof(SI)); // move the new column to correct position - col.SetOrdinal(_table.Columns[E_AUX].Ordinal); + col.SetOrdinal(Table.Columns[E_AUX].Ordinal); } row[colName] = modData.AuxiliaryWork(aux.Value).ConvertTo().Kilo.Watt.Hour; @@ -545,8 +554,8 @@ namespace TUGraz.VectoCore.OutputData for (uint i = 0; i <= gearCount; i++) { var colName = string.Format(TIME_SHARE_PER_GEAR_FORMAT, i); - if (!_table.Columns.Contains(colName)) { - _table.Columns.Add(colName, typeof(SI)); + if (!Table.Columns.Contains(colName)) { + Table.Columns.Add(colName, typeof(SI)); } row[colName] = timeSharePerGear[i]; } @@ -576,7 +585,7 @@ namespace TUGraz.VectoCore.OutputData protected void Dispose(bool disposing) { if (disposing) { - _table.Dispose(); + Table.Dispose(); } } } diff --git a/VectoCore/VectoCore/OutputData/XML/AbstractXMLWriter.cs b/VectoCore/VectoCore/OutputData/XML/AbstractXMLWriter.cs index 712290d29e47a9e2ef9500f8a15cee86103d5501..d3f9e47c777be109ea39e95b377dfdf1c0f46295 100644 --- a/VectoCore/VectoCore/OutputData/XML/AbstractXMLWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/AbstractXMLWriter.cs @@ -1,11 +1,39 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Data; using System.Linq; -using System.Xml; using System.Xml.Linq; using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; @@ -19,7 +47,7 @@ namespace TUGraz.IVT.VectoXML.Writer protected XNamespace tns; protected XNamespace rootNamespace; - protected XNamespace di; + protected readonly XNamespace di; protected const string Creator = "TU Graz, IVT-EM XML Exporter"; protected readonly string Vendor; diff --git a/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs b/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs index 40b15debe4e1af95d8c4e7b1b87f4c555739fa9b..6228900cc45804344e55c1721a3a232eb1eb08ba 100644 --- a/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs +++ b/VectoCore/VectoCore/OutputData/XML/AttributeMappings.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.InputData.Reader; @@ -7,7 +38,7 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; namespace TUGraz.IVT.VectoXML { - static internal class AttributeMappings + internal static class AttributeMappings { public static readonly Dictionary<string, string> FuelConsumptionMapMapping = new Dictionary<string, string> { { FuelConsumptionMapReader.Fields.EngineSpeed, XMLNames.Engine_FuelConsumptionMap_EngineSpeed_Attr }, diff --git a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs index 9b6f72e9a5b18e571b48819fa3b4366169988be6..55eba7eecef958f9e78e599d7a7dbbf1299e0b3d 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLCustomerReport.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.IO; @@ -18,14 +49,14 @@ namespace TUGraz.VectoCore.OutputData.XML { public class XMLCustomerReport { - protected XElement VehiclePart; + protected readonly XElement VehiclePart; protected XElement InputDataIntegrity; - protected XElement Results; + protected readonly XElement Results; - protected XNamespace tns; - protected XNamespace di; + protected readonly XNamespace tns; + protected readonly XNamespace di; private bool allSuccess = true; public XMLCustomerReport() @@ -103,8 +134,6 @@ namespace TUGraz.VectoCore.OutputData.XML private object[] GetSuccessResultEntry(XMLDeclarationReport.ResultEntry result) { - var fuel = FuelData.Instance().Lookup(result.FuelType); - return new object[] { new XElement(tns + "Payload", new XAttribute("unit", "kg"), result.Payload.ToXMLFormat(0)), new XElement(tns + "FuelType", result.FuelType.ToXMLFormat()), diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index 2c3f417a6220e42bcc2f4c20277904e3cab5662a..1ddd0d5df61b949d7356a2732a157792fcd6e6e7 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -1,4 +1,35 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using System.Text; using System.Xml; @@ -14,10 +45,10 @@ namespace TUGraz.VectoCore.OutputData.XML { public class XMLDeclarationReport : DeclarationReport<XMLDeclarationReport.ResultEntry> { - private XMLFullReport _fullReport; - private XMLCustomerReport _customerReport; + private readonly XMLFullReport _fullReport; + private readonly XMLCustomerReport _customerReport; - private IOutputDataWriter Writer; + private readonly IOutputDataWriter _writer; public class ResultEntry { @@ -89,7 +120,7 @@ namespace TUGraz.VectoCore.OutputData.XML _customerReport = new XMLCustomerReport(); //CustomerReport = new XDocument(new XDeclaration("1.0", "utf-8", "yes")); - Writer = writer; + _writer = writer; } public XDocument FullReport @@ -119,15 +150,15 @@ namespace TUGraz.VectoCore.OutputData.XML var fullReportHash = GetSignature(_fullReport.Report); _customerReport.GenerateReport(fullReportHash); - if (Writer != null) { - using (var xmlWriter = new XmlTextWriter(Writer.WriteStream(ReportType.DeclarationReportXMLFulll), Encoding.UTF8)) { + if (_writer != null) { + using (var xmlWriter = new XmlTextWriter(_writer.WriteStream(ReportType.DeclarationReportXMLFulll), Encoding.UTF8)) { xmlWriter.Formatting = Formatting.Indented; _fullReport.Report.WriteTo(xmlWriter); xmlWriter.Flush(); xmlWriter.Close(); } - using (var xmlWriter = new XmlTextWriter(Writer.WriteStream(ReportType.DeclarationReportXMLCOC), Encoding.UTF8)) { + using (var xmlWriter = new XmlTextWriter(_writer.WriteStream(ReportType.DeclarationReportXMLCOC), Encoding.UTF8)) { xmlWriter.Formatting = Formatting.Indented; _customerReport.Report.WriteTo(xmlWriter); xmlWriter.Flush(); @@ -149,20 +180,21 @@ namespace TUGraz.VectoCore.OutputData.XML } - public static List<XElement> GetResults(XMLDeclarationReport.ResultEntry result, XNamespace tns, bool fullOutput) + public static IEnumerable<XElement> GetResults(ResultEntry result, XNamespace tns, bool fullOutput) { var fuel = FuelData.Instance().Lookup(result.FuelType); - var retVal = new List<XElement>(); + var retVal = new List<XElement> { + new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/km"), + (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter).Value() + .ToMinSignificantDigits(3, 1)), + new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/t-km"), + (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter / + result.Payload.ConvertTo().Ton).Value().ToMinSignificantDigits(3, 1)), + new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/m³-km"), + (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter / result.CargoVolume).Value + ().ToMinSignificantDigits(3, 1)) + }; //FC - retVal.Add(new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/km"), - (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter).Value() - .ToMinSignificantDigits(3, 1))); - retVal.Add(new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/t-km"), - (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter / - result.Payload.ConvertTo().Ton).Value().ToMinSignificantDigits(3, 1))); - retVal.Add(new XElement(tns + "FuelConsumption", new XAttribute("unit", "g/m³-km"), - (result.FuelConsumptionTotal.ConvertTo().Gramm / result.Distance.ConvertTo().Kilo.Meter / result.CargoVolume).Value() - .ToMinSignificantDigits(3, 1))); if (fullOutput) { retVal.Add(new XElement(tns + "FuelConsumption", new XAttribute("unit", "MJ/km"), (result.EnergyConsumptionTotal / result.Distance.ConvertTo().Kilo.Meter / 1e6).Value().ToMinSignificantDigits(3, 1))); diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs index 4895577de9d79bfb989aeeeee630a63ef00f6108..ff0de725730524b7b94b9ebfa6e8ff8d23a1776e 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs @@ -1,9 +1,39 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.Linq; using System.Xml; using System.Xml.Linq; -using DocumentFormat.OpenXml.Drawing.Diagrams; using TUGraz.IVT.VectoXML; using TUGraz.IVT.VectoXML.Writer; using TUGraz.VectoCommon.InputData; @@ -12,7 +42,6 @@ using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.ComponentData; -using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; namespace TUGraz.VectoCore.OutputData.XML { @@ -54,12 +83,12 @@ namespace TUGraz.VectoCore.OutputData.XML public XDocument GenerateVectoComponent(IGearboxDeclarationInputData data, ITorqueConverterDeclarationInputData torqueConverter) { - return GenerateComponentDocument(CreateGearbox(data, torqueConverter)); + return GenerateComponentDocument(CreateGearbox(data, torqueConverter, componentNamespace)); } public XDocument GenerateVectoComponent(IAxleGearInputData data) { - return GenerateComponentDocument(CreateAxlegear(data)); + return GenerateComponentDocument(CreateAxlegear(data, componentNamespace)); } protected XDocument GenerateComponentDocument(XElement content) @@ -92,10 +121,6 @@ namespace TUGraz.VectoCore.OutputData.XML var vehicle = data.VehicleInputData; var angledrive = data.AngledriveInputData; - var aux = data.AuxiliaryInputData(); - var numSteeredaxles = aux.Auxiliaries.First(x => x.Type == AuxiliaryType.SteeringPump).Technology.Count; - //var pto = data.PTOTransmissionInputData; - return new XElement(tns + XMLNames.Component_Vehicle, new XAttribute(XMLNames.Component_ID_Attr, "VEH-" + vehicle.Model), GetDefaultComponentElements(vehicle.CertificationNumber, vehicle.Model, "N.A."), @@ -128,11 +153,11 @@ namespace TUGraz.VectoCore.OutputData.XML } - protected XElement CreateEngine(IEngineDeclarationInputData data) + protected XElement CreateEngine(IEngineDeclarationInputData data, XNamespace ns = null) { var id = string.Format("ENG-{0}", data.Model.RemoveWhitespace()); - var fld = EngineFullLoadCurve.Create(data.FullLoadCurve, true); - return new XElement(tns + XMLNames.Component_Engine, + var fld = FullLoadCurveReader.Create(data.FullLoadCurve, true); + return new XElement((ns ?? tns) + XMLNames.Component_Engine, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, string.Format("ENG-{0}", data.Model)), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), @@ -161,7 +186,7 @@ namespace TUGraz.VectoCore.OutputData.XML protected XElement CreateGearbox(IGearboxDeclarationInputData gbxData, - ITorqueConverterDeclarationInputData torqueConverter) + ITorqueConverterDeclarationInputData torqueConverter, XNamespace ns = null) { var gears = new XElement(tns + XMLNames.Gearbox_Gears); var i = 1; @@ -181,7 +206,7 @@ namespace TUGraz.VectoCore.OutputData.XML gears.Add(gear); } var id = string.Format("GBX-{0}", gbxData.Model.RemoveWhitespace()); - return new XElement(tns + XMLNames.Component_Gearbox, + return new XElement((ns ?? tns) + XMLNames.Component_Gearbox, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, string.Format("GBX-{0}", gbxData.Model)), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), @@ -218,10 +243,10 @@ namespace TUGraz.VectoCore.OutputData.XML AddSignatureDummy(id)); } - private XElement CreateAngleDrive(IAngledriveInputData data) + private XElement CreateAngleDrive(IAngledriveInputData data, XNamespace ns = null) { var id = string.Format("ANGL-{0}", data.Model.RemoveWhitespace()); - return new XElement(tns + XMLNames.Component_Angledrive, + return new XElement((ns ??tns) + XMLNames.Component_Angledrive, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, "ANGL-" + data.Model), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), @@ -233,10 +258,10 @@ namespace TUGraz.VectoCore.OutputData.XML AddSignatureDummy(id)); } - public XElement CreateRetarder(IRetarderInputData data) + public XElement CreateRetarder(IRetarderInputData data, XNamespace ns = null) { var id = string.Format("RET-{0}", data.Model.RemoveWhitespace()); - return new XElement(tns + XMLNames.Component_Retarder, + return new XElement((ns ?? tns) + XMLNames.Component_Retarder, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, "RET-none"), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), @@ -250,10 +275,10 @@ namespace TUGraz.VectoCore.OutputData.XML ); } - public XElement CreateAxlegear(IAxleGearInputData data) + public XElement CreateAxlegear(IAxleGearInputData data, XNamespace ns = null) { var typeId = string.Format("AXLGEAR-{0:0.000}", data.Ratio); - return new XElement(tns + XMLNames.Component_Axlegear, + return new XElement((ns ?? tns) + XMLNames.Component_Axlegear, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, string.Format("AXL-{0}", data.Model)), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, typeId), @@ -267,7 +292,7 @@ namespace TUGraz.VectoCore.OutputData.XML ); } - public XElement CreateAxleWheels(IVehicleDeclarationInputData data) + public XElement CreateAxleWheels(IVehicleDeclarationInputData data, XNamespace ns = null) { var axleData = data.Axles; var numAxles = axleData.Count; @@ -284,7 +309,7 @@ namespace TUGraz.VectoCore.OutputData.XML )); } - return new XElement(tns + XMLNames.Component_AxleWheels, + return new XElement((ns ??tns) + XMLNames.Component_AxleWheels, new XElement(tns + XMLNames.ComponentDataWrapper, //new XAttribute(XMLNames.Component_ID_Attr, // string.Format("AXLWHL-{0}", data.AxleConfiguration.GetName())), @@ -327,10 +352,10 @@ namespace TUGraz.VectoCore.OutputData.XML return new XElement(tns + XMLNames.Component_Auxiliaries, aux); } - private XElement CreateAirdrag(IAirdragDeclarationInputData data) + private XElement CreateAirdrag(IAirdragDeclarationInputData data, XNamespace ns = null) { var id = string.Format("Airdrag-{0}", data.Model); - return new XElement(tns + XMLNames.Component_AirDrag, + return new XElement((ns ?? tns) + XMLNames.Component_AirDrag, //new XAttribute(XMLNames.Component_CertificationNumber_Attr, string.Format("AD-{0}", data.Model)), new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), diff --git a/VectoCore/VectoCore/OutputData/XML/XMLEngineeringWriter.cs b/VectoCore/VectoCore/OutputData/XML/XMLEngineeringWriter.cs index 350eb38573f682fec83b527a37be614772237e58..c1cdce193139ab2da84f6623e9ba4febc77ff4af 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLEngineeringWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLEngineeringWriter.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.Data; @@ -190,7 +221,7 @@ namespace TUGraz.VectoCore.OutputData.XML return new XElement(tns + XMLNames.Component_Vehicle, new XAttribute(XMLNames.Component_ID_Attr, "VEH-" + vehicle.Model), - GetDefaultComponentElements(vehicle.CertificationNumber, vehicle.Model), + GetDefaultComponentElements(vehicle.Model), new XElement(tns + XMLNames.Vehicle_VehicleCategory, vehicle.VehicleCategory.ToXMLFormat()), new XElement(tns + XMLNames.Vehicle_AxleConfiguration, vehicle.AxleConfiguration.GetName()), new XElement(tns + XMLNames.Vehicle_CurbMassChassis, vehicle.CurbMassChassis.Value().ToXMLFormat(0)), @@ -229,17 +260,13 @@ namespace TUGraz.VectoCore.OutputData.XML return null; } var ptoLossMap = new XElement(tns + XMLNames.Vehicle_PTOIdleLossMap); - if (_singleFile) { - ptoLossMap.Add(EmbedDataTable(pto.PTOLossMap, AttributeMappings.PTOLossMap)); - } else { - ptoLossMap.Add(ExtCSVResource(pto.PTOLossMap, "PTO_LossMap.vptol")); - } + ptoLossMap.Add(_singleFile + ? EmbedDataTable(pto.PTOLossMap, AttributeMappings.PTOLossMap) + : ExtCSVResource(pto.PTOLossMap, "PTO_LossMap.vptol")); var ptoCycle = new XElement(tns + XMLNames.Vehicle_PTOCycle); - if (_singleFile) { - ptoCycle.Add(EmbedDataTable(pto.PTOCycle, AttributeMappings.PTOCycleMap)); - } else { - ptoCycle.Add(ExtCSVResource(pto.PTOCycle, "PTO_cycle.vptoc")); - } + ptoCycle.Add(_singleFile + ? EmbedDataTable(pto.PTOCycle, AttributeMappings.PTOCycleMap) + : ExtCSVResource(pto.PTOCycle, "PTO_cycle.vptoc")); return new object[] { ptoLossMap, ptoCycle }; } @@ -270,7 +297,7 @@ namespace TUGraz.VectoCore.OutputData.XML var angledrive = new XElement(tns + XMLNames.Component_Angledrive, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, "ANGL-" + data.Model), - GetDefaultComponentElements(data.CertificationNumber, data.Model), + GetDefaultComponentElements(data.Model), new XElement(tns + XMLNames.AngleDrive_Ratio, data.Ratio.ToXMLFormat(3)), data.LossMap == null ? new XElement(tns + XMLNames.AngleDrive_TorqueLossMap, @@ -331,7 +358,7 @@ namespace TUGraz.VectoCore.OutputData.XML var axle = axleData[i]; axles.Add(new XElement(tns + XMLNames.AxleWheels_Axles_Axle, new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, i + 1), - GetDefaultComponentElements(string.Format("WHEEL-{0}_{1}", i, axle.Wheels), axle.Wheels), + GetDefaultComponentElements(axle.Wheels), new XElement(tns + XMLNames.AxleWheels_Axles_Axle_AxleType, i == 1 ? AxleType.VehicleDriven.ToString() : AxleType.VehicleNonDriven.ToString()), new XElement(tns + XMLNames.AxleWheels_Axles_Axle_TwinTyres_Attr, axle.TwinTyres), @@ -380,7 +407,7 @@ namespace TUGraz.VectoCore.OutputData.XML var typeId = string.Format("AXLGEAR-{0:0.000}", data.Ratio); var axl = new XElement(tns + XMLNames.Component_Axlegear, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, typeId), - GetDefaultComponentElements(typeId, "N.A."), + GetDefaultComponentElements("N.A."), new XElement(tns + XMLNames.Axlegear_Ratio, data.Ratio.ToXMLFormat(3)), data.LossMap == null ? new XElement(tns + XMLNames.Axlegear_TorqueLossMap, @@ -397,7 +424,7 @@ namespace TUGraz.VectoCore.OutputData.XML { var retarder = new XElement(tns + XMLNames.Component_Retarder, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, "RET-none"), - GetDefaultComponentElements(data.CertificationNumber, data.Model), + GetDefaultComponentElements(data.Model), new XElement(tns + XMLNames.Retarder_RetarderLossMap, _singleFile ? EmbedDataTable(data.LossMap, AttributeMappings.RetarderLossmapMapping) @@ -439,7 +466,7 @@ namespace TUGraz.VectoCore.OutputData.XML var gbx = new XElement(tns + XMLNames.Component_Gearbox, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, string.Format("GBX-{0}", data.Model)), - GetDefaultComponentElements(string.Format("GBX-{0}", data.Model), data.Model), + GetDefaultComponentElements(data.Model), new XElement(tns + XMLNames.Gearbox_TransmissionType, data.Type.ToXMLFormat()), new XElement(tns + XMLNames.Gearbox_Inertia, data.Inertia.Value()), new XElement(tns + XMLNames.Gearbox_TractionInterruption, data.TractionInterruption.Value()), gears), @@ -456,7 +483,7 @@ namespace TUGraz.VectoCore.OutputData.XML var tc = new XElement(tns + XMLNames.Component_TorqueConverter, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, string.Format("TC-{0}", torqueConverterData.Model)), - GetDefaultComponentElements(string.Format("TC-{0}", torqueConverterData.Model), torqueConverterData.Model), + GetDefaultComponentElements(torqueConverterData.Model), new XElement(tns + XMLNames.TorqueConverter_ReferenceRPM, torqueConverterData.ReferenceRPM.AsRPM.ToXMLFormat()), new XElement(tns + XMLNames.TorqueConverter_Characteristics, _singleFile @@ -494,7 +521,7 @@ namespace TUGraz.VectoCore.OutputData.XML var engine = new XElement(tns + XMLNames.Component_Engine, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, string.Format("ENG-{0}", data.Model)), - GetDefaultComponentElements(string.Format("ENG-{0}", data.Model), data.Model), + GetDefaultComponentElements(data.Model), new XElement(tns + XMLNames.Engine_Displacement, (data.Displacement.Value() * 1000 * 1000).ToXMLFormat(0)), new XElement(tns + XMLNames.Engine_IdlingSpeed, data.IdleSpeed.AsRPM.ToXMLFormat(0)), new XElement(tns + XMLNames.Engine_Inertia, data.Inertia.Value()), @@ -513,7 +540,7 @@ namespace TUGraz.VectoCore.OutputData.XML return new XElement(tns + XMLNames.Component_AirDrag, new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), - GetDefaultComponentElements(data.Model, "N.A."), + GetDefaultComponentElements("N.A."), new XElement(tns + XMLNames.Vehicle_CrossWindCorrectionMode, data.CrossWindCorrectionMode.ToXMLFormat()), new XElement(tns + XMLNames.Vehicle_AirDragArea, data.AirDragArea.Value().ToXMLFormat(2))), GetCrossWindCorrectionData(data) @@ -561,7 +588,7 @@ namespace TUGraz.VectoCore.OutputData.XML }; } - protected XElement[] GetDefaultComponentElements(string componentId, string makeAndModel) + protected XElement[] GetDefaultComponentElements(string makeAndModel) { return new[] { new XElement(tns + XMLNames.Component_Manufacturer, Vendor), diff --git a/VectoCore/VectoCore/OutputData/XML/XMLFullReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLFullReport.cs index 564470d59ea5af7b1000c4198f0db97084a030b8..b2e3b464639df9bd86f96b11523d549313d9c8be 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLFullReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLFullReport.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/VectoCore/VectoCore/Utils/DelaunayMap.cs b/VectoCore/VectoCore/Utils/DelaunayMap.cs index f7c751035d3bf68c16d6c6f884b60ddf4347da01..45f763af4c6e8c0ce7fd328ef1ac467ee4a1872b 100644 --- a/VectoCore/VectoCore/Utils/DelaunayMap.cs +++ b/VectoCore/VectoCore/Utils/DelaunayMap.cs @@ -46,7 +46,7 @@ namespace TUGraz.VectoCore.Utils { public sealed class DelaunayMap : LoggingObject { - private ICollection<Point> Points = new HashSet<Point>(); + private ICollection<Point> _points = new HashSet<Point>(); private Triangle[] _triangles; private Edge[] _convexHull; @@ -63,16 +63,15 @@ namespace TUGraz.VectoCore.Utils public void AddPoint(double x, double y, double z) { - Points.Add(new Point(x, y, z)); + _points.Add(new Point(x, y, z)); } public IReadOnlyCollection<Point> Entries { - get - { - var retVal = new Point[Points.Count]; + get { + var retVal = new Point[_points.Count]; var i = 0; - foreach (var pt in Points) { + foreach (var pt in _points) { retVal[i++] = new Point(pt.X * (_maxX - _minX) + _minX, pt.Y * (_maxY - _minY) + _minY, pt.Z); } return retVal; @@ -88,27 +87,27 @@ namespace TUGraz.VectoCore.Utils /// </remarks> public void Triangulate() { - if (Points.Count < 3) { + if (_points.Count < 3) { throw new ArgumentException(string.Format("{0}: Triangulation needs at least 3 Points. Got {1} Points.", _mapName, - Points.Count)); + _points.Count)); } SanitycheckInputPoints(); // The "supertriangle" encompasses all triangulation points. // This is just a helper triangle which initializes the algorithm and will be removed in the end of the algorithm. - _maxX = Points.Max(p => p.X); - _maxY = Points.Max(p => p.Y); - _minX = Points.Min(p => p.X); - _minY = Points.Min(p => p.Y); - Points = - Points.Select(p => new Point((p.X - _minX) / (_maxX - _minX), (p.Y - _minY) / (_maxY - _minY), p.Z)).ToList(); + _maxX = _points.Max(p => p.X); + _maxY = _points.Max(p => p.Y); + _minX = _points.Min(p => p.X); + _minY = _points.Min(p => p.Y); + _points = + _points.Select(p => new Point((p.X - _minX) / (_maxX - _minX), (p.Y - _minY) / (_maxY - _minY), p.Z)).ToList(); var superTriangle = new Triangle(new Point(-1, -1), new Point(4, -1), new Point(-1, 4)); var triangles = new List<Triangle> { superTriangle }; var pointCount = 0; - var points = Points.ToArray(); + var points = _points.ToArray(); // iteratively add each point into the correct triangle and split up the triangle foreach (var point in points) { @@ -155,7 +154,7 @@ namespace TUGraz.VectoCore.Utils private void SanitycheckInputPoints() { - var duplicates = Points.GroupBy(pt => new { pt.X, pt.Y }, x => x).Where(g => g.Count() > 1).ToList(); + var duplicates = _points.GroupBy(pt => new { pt.X, pt.Y }, x => x).Where(g => g.Count() > 1).ToList(); foreach (var duplicate in duplicates) { Log.Error("{0}: Input Point appears twice: x: {1}, y: {2}", duplicate.Key.X, duplicate.Key.Y); @@ -169,7 +168,7 @@ namespace TUGraz.VectoCore.Utils public void DrawGraph() { var superTriangle = new Triangle(new Point(-1, -1), new Point(4, -1), new Point(-1, 4)); - DrawGraph(0, _triangles, superTriangle, Points.ToArray()); + DrawGraph(0, _triangles, superTriangle, _points.ToArray()); } /// <summary> diff --git a/VectoCore/VectoCore/Utils/Formulas.cs b/VectoCore/VectoCore/Utils/Formulas.cs index 7bfe279f31669951bef7cf27d5919fc3463c9bc2..c8085d74a3c714804bbc2d72e8cf0b3c5b2c9f5b 100644 --- a/VectoCore/VectoCore/Utils/Formulas.cs +++ b/VectoCore/VectoCore/Utils/Formulas.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.Utils diff --git a/VectoCore/VectoCore/Utils/Physics.cs b/VectoCore/VectoCore/Utils/Physics.cs index ac63dd4bb2a355c97e0d8eb15277624e040a226a..2bb5897943dfca6ff612d00630a04814ffa8296e 100644 --- a/VectoCore/VectoCore/Utils/Physics.cs +++ b/VectoCore/VectoCore/Utils/Physics.cs @@ -33,7 +33,7 @@ using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.Utils { - public class Physics + public static class Physics { /// <summary> /// The standard acceleration for gravity on earth. @@ -44,7 +44,7 @@ namespace TUGraz.VectoCore.Utils /// <summary> /// Density of air. /// </summary> - public static KilogramPerCubicMeter AirDensity = 1.188.SI<KilogramPerCubicMeter>(); + public static readonly KilogramPerCubicMeter AirDensity = 1.188.SI<KilogramPerCubicMeter>(); public const double RollResistanceExponent = 0.9; diff --git a/VectoCore/VectoCore/Utils/RessourceHelper.cs b/VectoCore/VectoCore/Utils/RessourceHelper.cs index 205c8489ce2464aa88e84c9e1db01a06ddbf0479..757bcdc36f180d74765be70fba6f7f39745d5b0e 100644 --- a/VectoCore/VectoCore/Utils/RessourceHelper.cs +++ b/VectoCore/VectoCore/Utils/RessourceHelper.cs @@ -55,7 +55,7 @@ namespace TUGraz.VectoCore.Utils public static Stream LoadResourceAsStream(ResourceType type, string resourceName) { - var resourceBase = ""; + string resourceBase; switch (type) { case ResourceType.XMLSchema: resourceBase = "TUGraz.VectoCore.Resources.XSD."; diff --git a/VectoCore/VectoCore/Utils/StreamExtensions.cs b/VectoCore/VectoCore/Utils/StreamExtensions.cs deleted file mode 100644 index cbdd33e8b54fbf55fad999e655701e9c4c410e9f..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/Utils/StreamExtensions.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* -* This file is part of VECTO. -* -* Copyright © 2012-2016 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.IO; -using System.Text; - -namespace TUGraz.VectoCore.Utils -{ - internal static class StreamExtensions - { - public static IEnumerable<string> ReadLines(this Stream stream) - { - using (var reader = new StreamReader(stream, Encoding.UTF8)) { - while (!reader.EndOfStream) { - yield return reader.ReadLine(); - } - } - } - } -} \ No newline at end of file diff --git a/VectoCore/VectoCore/Utils/SwitchExtension.cs b/VectoCore/VectoCore/Utils/SwitchExtension.cs index be4d29ad289f4fa7260a1db02cedbe3cfc2dead8..9d8be316dd109043e185ff0bf7de825b9484580b 100644 --- a/VectoCore/VectoCore/Utils/SwitchExtension.cs +++ b/VectoCore/VectoCore/Utils/SwitchExtension.cs @@ -31,7 +31,6 @@ using System; using System.Diagnostics; -using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.Utils { @@ -79,7 +78,7 @@ namespace TUGraz.VectoCore.Utils [DebuggerHidden] public Switch<T> Case<TFilter>() where TFilter : T { - return Case<TFilter>(() => {}); + return Case<TFilter>(() => { }); } @@ -121,10 +120,5 @@ namespace TUGraz.VectoCore.Utils action(_value); } } - - public Switch<T> Case(Func<object, bool> action, Func<object, SI> func) - { - throw new NotImplementedException(); - } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Utils/VectoCSVFile.cs b/VectoCore/VectoCore/Utils/VectoCSVFile.cs index 4074edab9e64f52dbb61e98fc1865fb3a0c1730c..9cd44bfe9fb2bb25ada0d64ce6107f5d7900674e 100644 --- a/VectoCore/VectoCore/Utils/VectoCSVFile.cs +++ b/VectoCore/VectoCore/Utils/VectoCSVFile.cs @@ -111,11 +111,15 @@ namespace TUGraz.VectoCore.Utils TrimWhiteSpace = true }; - string[] colsWithoutComment; + string[] colsWithoutComment = { }; try { - colsWithoutComment = p.ReadFields() - .Select(l => l.Contains(Comment) ? l.Substring(0, l.IndexOf(Comment)) : l) + var fields = p.ReadFields(); + if (fields == null) { + throw new CSVReadException("CSV Read Error: File was empty."); + } + colsWithoutComment = fields + .Select(l => l.Contains(Comment) ? l.Substring(0, l.IndexOf(Comment, StringComparison.Ordinal)) : l) .ToArray(); } catch (ArgumentNullException) { throw new CSVReadException("CSV Read Error: File was empty."); @@ -149,12 +153,17 @@ namespace TUGraz.VectoCore.Utils var lineNumber = 1; do { - var cells = firstLineIsData - ? colsWithoutComment - : p.ReadFields() - .Select(l => l.Contains(Comment) ? l.Substring(0, l.IndexOf(Comment)) : l) - .Select(s => s.Trim()) - .ToArray(); + string[] cells = { }; + if (firstLineIsData) { + cells = colsWithoutComment; + } else { + var fields = p.ReadFields(); + if (fields != null) { + cells = fields.Select(l => l.Contains(Comment) ? l.Substring(0, l.IndexOf(Comment, StringComparison.Ordinal)) : l) + .Select(s => s.Trim()) + .ToArray(); + } + } firstLineIsData = false; if (table.Columns.Count != cells.Length && !ignoreEmptyColumns) { throw new CSVReadException( diff --git a/VectoCore/VectoCore/Utils/XPathHelper.cs b/VectoCore/VectoCore/Utils/XPathHelper.cs index 42c1485904bfa3add4b27a8a166941c80719e87c..1db87fd3a39f9db1321a8d18f95f621853393f83 100644 --- a/VectoCore/VectoCore/Utils/XPathHelper.cs +++ b/VectoCore/VectoCore/Utils/XPathHelper.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using System.Xml; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.Configuration; diff --git a/VectoCore/VectoCore/Utils/XmlResourceResolver.cs b/VectoCore/VectoCore/Utils/XmlResourceResolver.cs index bc7f8f599488fa5688a1398c967e6f10472d5cb7..f6dc90bc7060c70e80e93fac73963e172420dc9a 100644 --- a/VectoCore/VectoCore/Utils/XmlResourceResolver.cs +++ b/VectoCore/VectoCore/Utils/XmlResourceResolver.cs @@ -1,4 +1,35 @@ -using System; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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; using System.IO; using System.Xml; diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index d277b6f734c25a3b93e662c42b616051092ee2aa..fbd96c8c14ce1ae290b1965a68e50433b40d7a5f 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -150,7 +150,6 @@ <Compile Include="InputData\Reader\DataObjectAdapter\EngineeringDataAdapter.cs" /> <Compile Include="InputData\Reader\DrivingCycleDataReader.cs" /> <Compile Include="InputData\Reader\FullLoadCurveReader.cs" /> - <Compile Include="InputData\Reader\Impl\AbstractVectoRunDataFactory.cs" /> <Compile Include="InputData\Reader\Impl\DeclarationModeVectoRunDataFactory.cs" /> <Compile Include="InputData\Reader\Impl\DrivingCycleProxy.cs" /> <Compile Include="InputData\Reader\Impl\EngineeringModeVectoRunDataFactory.cs" /> @@ -224,7 +223,6 @@ <Compile Include="Models\SimulationComponent\Data\DriverData.cs" /> <Compile Include="Models\SimulationComponent\Data\ICrossWindCorrection.cs" /> <Compile Include="Models\SimulationComponent\Data\CrosswindCorrectionVAirBeta.cs" /> - <Compile Include="Models\SimulationComponent\IAuxiliary.cs" /> <Compile Include="Models\SimulationComponent\IAxlegear.cs" /> <Compile Include="Models\SimulationComponent\IBrakes.cs" /> <Compile Include="Models\SimulationComponent\IIdleController.cs" /> @@ -249,7 +247,6 @@ <Compile Include="Models\Simulation\DataBus\IClutchInfo.cs" /> <Compile Include="Models\Simulation\DataBus\IDriverInfo.cs" /> <Compile Include="Models\Simulation\DataBus\IWheelsInfo.cs" /> - <Compile Include="Models\SimulationComponent\Data\FullLoadCurve.cs" /> <Compile Include="Models\Simulation\DataBus\IMileageCounter.cs" /> <Compile Include="Utils\DebugData.cs" /> <Compile Include="Models\Simulation\Impl\DistanceRun.cs" /> @@ -329,7 +326,6 @@ <Compile Include="Models\Simulation\DataBus\IVehicleInfo.cs" /> <Compile Include="Models\Simulation\IVehicleContainer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Utils\StreamExtensions.cs" /> <Compile Include="Utils\SwitchExtension.cs" /> <Compile Include="Utils\VectoCSVFile.cs" /> <Compile Include="Utils\DelaunayMap.cs" /> diff --git a/VectoCore/VectoCoreTest/Dummy/EngineFLDTest.cs b/VectoCore/VectoCoreTest/Dummy/EngineFLDTest.cs index 6f3f6a355040f939f5362680d6c1852b65934b75..8d41f094b662da891c1ab8738950fc51a7dad529 100644 --- a/VectoCore/VectoCoreTest/Dummy/EngineFLDTest.cs +++ b/VectoCore/VectoCoreTest/Dummy/EngineFLDTest.cs @@ -34,6 +34,7 @@ using System.Diagnostics; using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; namespace TUGraz.VectoCore.Tests.Dummy @@ -47,11 +48,12 @@ namespace TUGraz.VectoCore.Tests.Dummy var engineFile1 = @"TestData\Components\40t_Long_Haul_Truck.vfld"; var engineFile2 = @"E:\QUAM\Downloads\EngineFLD\Map_375c_BB1390_modTUG_R49_375c_BB1386.vfld"; - if (!File.Exists(engineFile2)) + if (!File.Exists(engineFile2)) { Assert.Inconclusive("Confidential File not found. Test cannot run without file."); + } - var map1 = EngineFullLoadCurve.ReadFromFile(engineFile1, true); - var map2 = EngineFullLoadCurve.ReadFromFile(engineFile2, true); + var map1 = FullLoadCurveReader.ReadFromFile(engineFile1, true); + var map2 = FullLoadCurveReader.ReadFromFile(engineFile2, true); map1.FullLoadStationaryTorque(1000.RPMtoRad()); map2.FullLoadStationaryTorque(1000.RPMtoRad()); @@ -77,10 +79,11 @@ namespace TUGraz.VectoCore.Tests.Dummy { var engineFile2 = @"E:\QUAM\Downloads\EngineFLD\Map_375c_BB1390_modTUG_R49_375c_BB1386.vfld"; - if (!File.Exists(engineFile2)) + if (!File.Exists(engineFile2)) { Assert.Inconclusive("Confidential File not found. Test cannot run without file."); + } - var map = EngineFullLoadCurve.ReadFromFile(engineFile2, true); + var map = FullLoadCurveReader.ReadFromFile(engineFile2, true); Assert.AreEqual(1208, map.FullLoadStationaryTorque(500.RPMtoRad()).Value(), 1e-3); diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs index 9527cbd03c9500669c6811c4610387f1d26bd065..9c18eb85f09fb3b1e2dcaa55d6076af76ad654c9 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs @@ -33,6 +33,7 @@ using System.Collections.Generic; using NUnit.Framework; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.Simulation.Impl; @@ -125,7 +126,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var vehicle = new VehicleContainer(ExecutionMode.Engineering, new MockModalDataContainer()); var fcMap = FuelConsumptionMapReader.ReadFromFile(engineFCMapFilePath); - var fld = EngineFullLoadCurve.ReadFromFile(engineFLDFilePath); + var fld = FullLoadCurveReader.ReadFromFile(engineFLDFilePath); var modelData = new CombustionEngineData() { ConsumptionMap = fcMap, FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { { 0, fld }, { 1, fld } }, diff --git a/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs b/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs index 60d9f8088103ad538c8c7b78714868eb66536596..18927a50f620a93d99293aec388903db13b2fd35 100644 --- a/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs +++ b/VectoCore/VectoCoreTest/Integration/FuelTypesTest.cs @@ -1,4 +1,35 @@ -using NUnit.Framework; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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 NUnit.Framework; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.Models.Declaration; @@ -12,16 +43,16 @@ namespace TUGraz.VectoCore.Tests.Integration public class FuelTypesTest { [TestCase(FuelType.DieselCI, - @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, 0.0006944, 9383.8223, + @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, 0.0006944, 9394.4751, TestName = "Diesel LH Low"), TestCase(FuelType.EthanolCI, - @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, 0.0004197, 6417.04, + @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 0, 0.0004197, 6424.3249, TestName = "Ethanol LH Low"), TestCase(FuelType.DieselCI, - @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, 0.0008025, 10843.6305, + @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, 0.0008048, 10875.0171, TestName = "Diesel LH Ref"), TestCase(FuelType.EthanolCI, - @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, 0.0004850, 7415.3164, + @"TestData\Integration\DeclarationMode\Class2_RigidTruck_4x2\Class2_RigidTruck_DECL.vecto", 1, 0.0004864, 7436.7798, TestName = "Ethanol LH Ref"),] public void TestFuelTypesCO2(FuelType fuelType, string jobName, int runIdx, double expectedCo2, double expectedMJ) { diff --git a/VectoCore/VectoCoreTest/Integration/TestVehicleIdlingSpeed.cs b/VectoCore/VectoCoreTest/Integration/TestVehicleIdlingSpeed.cs index f0b326155bcbe95bf85c4a2cbeb772e8d7cffe44..a67f0adef45c6775ecdd75854a3dc915cbc7bd45 100644 --- a/VectoCore/VectoCoreTest/Integration/TestVehicleIdlingSpeed.cs +++ b/VectoCore/VectoCoreTest/Integration/TestVehicleIdlingSpeed.cs @@ -1,4 +1,35 @@ -using System.IO; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Xml; using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs index 07f3b7a7d95f2191591905ecfd492d22f3ebfbbc..e3322d7fcd00ac82276d21d6f2cf69edb6b1b2f0 100644 --- a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs +++ b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using NUnit.Framework; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/AirdragDefaultValuesTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/AirdragDefaultValuesTest.cs index c3169c9b5179bc482b17eb3318cb637fdfd40617..24e3fbf0ecb46c2c0556a3a1940d8ef9234baaab 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/AirdragDefaultValuesTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/AirdragDefaultValuesTest.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.JSON; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs index 8f168129548ab2a78692b8e8908ce09b90e22797..8eba8dc4e78b6ac767a624a2a8b11c2320f33e3b 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterTestHelper.cs @@ -1,3 +1,34 @@ +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.InputData; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs index 626557be4532de14fc4e3b05ed6ee07a1f4fa777..a2a5dbaf25d7fa7c558c3fc18c97cb08a62cba1b 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class2.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs index 619f3105977a2c8b20305b42276a49575313b49b..9a25dade0b779f87b7ab47770722c992f8bac1f2 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class5.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs index bc25ac128deaec24fb97fae61ea4f1d8692a372c..f27827de8a1102d07a91b04d55f484de8ac40ce9 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationDataAdapterTest_Class9.cs @@ -1,4 +1,35 @@ -using System.Linq; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.Linq; using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs index c2249114939f526752c2d284fa49f26c25363f3f..96344a77f16f41fe558d8abd6244295affd1c6f2 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs @@ -38,6 +38,7 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.SimulationComponent.Data; @@ -248,7 +249,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration DeclarationData.Gearbox.ShiftPolygonFldMargin( engineFld.Select( p => - new FullLoadCurve.FullLoadCurveEntry() { + new EngineFullLoadCurve.FullLoadCurveEntry() { EngineSpeed = p.X.SI<PerSecond>(), TorqueFullLoad = p.Y.SI<NewtonMeter>() }).ToList(), @@ -444,7 +445,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration }; var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(); - fullLoadCurves[0] = EngineFullLoadCurve.ReadFromFile(engineFldFile, true); + fullLoadCurves[0] = FullLoadCurveReader.ReadFromFile(engineFldFile, true); fullLoadCurves[0].EngineData = engineData; for (uint i = 1; i <= gearboxData.Gears.Count; i++) { fullLoadCurves[i] = AbstractSimulationDataAdapter.IntersectFullLoadCurves(fullLoadCurves[0], @@ -531,7 +532,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration }; var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(); - fullLoadCurves[0] = EngineFullLoadCurve.ReadFromFile(Path.Combine(BasePath, engineFldFile), true); + fullLoadCurves[0] = FullLoadCurveReader.ReadFromFile(Path.Combine(BasePath, engineFldFile), true); fullLoadCurves[0].EngineData = engineData; for (uint i = 1; i <= gearboxData.Gears.Count; i++) { fullLoadCurves[i] = AbstractSimulationDataAdapter.IntersectFullLoadCurves(fullLoadCurves[0], diff --git a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs index 38b0f20a85b61c697e9d0828869ecb0fd49f5062..74d2bd10cfb0ac784149156810fcdf4528cc3e66 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/AuxTests.cs @@ -73,7 +73,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation var sumWriter = new SummaryDataContainer(fileWriter); var container = new VehicleContainer(ExecutionMode.Declaration, modData, - (modalData) => sumWriter.Write(modalData, "AuxWriteSumFile", new MockRunData())); + (modalData) => sumWriter.Write(modalData, 0, 0, new MockRunData())); var data = DrivingCycleDataReader.ReadFromFile(@"TestData\Cycles\LongHaul_short.vdri", CycleType.DistanceBased, false); new MockDrivingCycle(container, data); @@ -90,7 +90,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation new[] { "Variable displacement mech. controlled" })); aux.AddConstant("ES", DeclarationData.ElectricSystem.Lookup(mission)); aux.AddConstant("AC", - DeclarationData.HeatingVentilationAirConditioning.Lookup(mission, "Default",hdvClass)); + DeclarationData.HeatingVentilationAirConditioning.Lookup(mission, "Default", hdvClass)); var speed = 1400.RPMtoRad(); var torque = 500.SI<NewtonMeter>(); diff --git a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs index 3e6abd469222220bc2e8a963282f1fafd771af2d..e0b70749528b1d5896d71a27f15bd9bd4d0ac2e9 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs @@ -224,7 +224,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation fullLoad.Rows.Add("0", "5000", "-5000", "0"); fullLoad.Rows.Add("3000", "5000", "-5000", "0"); - var fullLoadCurve = EngineFullLoadCurve.Create(fullLoad); + var fullLoadCurve = FullLoadCurveReader.Create(fullLoad); var data = new VectoRunData { Cycle = drivingCycle, VehicleData = @@ -291,7 +291,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation fullLoad.Rows.Add("0", "5000", "-5000", "0"); fullLoad.Rows.Add("3000", "5000", "-5000", "0"); - var fullLoadCurve = EngineFullLoadCurve.Create(fullLoad); + var fullLoadCurve = FullLoadCurveReader.Create(fullLoad); var data = new VectoRunData { Cycle = drivingCycle, VehicleData = diff --git a/VectoCore/VectoCoreTest/Models/Simulation/MockSumWriter.cs b/VectoCore/VectoCoreTest/Models/Simulation/MockSumWriter.cs index 2c9ee16f15d982c878796dfc70a87dab9b15a9ce..d871960e182cd5bc2286490be8959b348b2b2cc7 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/MockSumWriter.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/MockSumWriter.cs @@ -37,7 +37,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation { public class MockSumWriter : SummaryDataContainer { - public override void Write(IModalDataContainer modData, string jobFileName, VectoRunData runData) {} + public override void Write(IModalDataContainer modData, int jobNr, int runNr, VectoRunData runData) {} public override void Finish() {} } diff --git a/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs index fcb338353fe65a99c7901b4fb11cab963d117aae..49658a7215a0932f69479429ed12a8312c0ca307 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs @@ -128,7 +128,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation fullLoad.Rows.Add("0", "5000", "-5000", "0"); fullLoad.Rows.Add("3000", "5000", "-5000", "0"); - var fullLoadCurve = EngineFullLoadCurve.Create(fullLoad); + var fullLoadCurve = FullLoadCurveReader.Create(fullLoad); var data = new VectoRunData { Cycle = drivingCycle, AxleGearData = new AxleGearData { AxleGear = new GearData { Ratio = 2.3 } }, diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/ATGearboxTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/ATGearboxTest.cs index b5513a2eb95205a228edc666dc9dbaf0729d90d5..aaade21392b192c192eb1d38d48ed4722171d5d2 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/ATGearboxTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/ATGearboxTest.cs @@ -159,7 +159,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent new FileOutputWriter(string.Format("AT_Vehicle_Drive-TC_{0}-{1}", cycleName, gbxType == GearboxType.ATSerial ? "ser" : "ps"))); ((VehicleContainer)run.GetContainer()).WriteSumData = (modData) => - sumWriter.Write(run.GetContainer().ModalData, string.Format("{0}-{1}", 0, 0), run.GetContainer().RunData); + sumWriter.Write(run.GetContainer().ModalData, 0, 0, run.GetContainer().RunData); run.Run(); sumWriter.Finish(); Assert.IsTrue(run.FinishedWithoutErrors); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs index c3cf7d1fb3c9d6f91bed51e09642cfcd55df05ac..1998a142a4104387dc3f78e2564199f5c3727c0e 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxShiftLossesTest.cs @@ -108,6 +108,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent gbx.IdleController = new MockIdleController(); var init = gbx.Initialize(0.SI<NewtonMeter>(), preShiftRpm.RPMtoRad()); + axleGear.Initialize(0.SI<NewtonMeter>(), preShiftRpm.RPMtoRad()); gbx.Gear = gear; @@ -116,6 +117,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent var response = gbx.Request(absTime, dt, 0.SI<NewtonMeter>(), preShiftRpm.RPMtoRad()); axleGear.Request(absTime, dt, 0.SI<NewtonMeter>(), preShiftRpm.RPMtoRad()); + Assert.IsInstanceOf<ResponseSuccess>(response); container.CommitSimulationStep(absTime, dt); absTime += dt; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs index dc8277a9e0fc52db89b7bce5de6890f5015f7fc0..7343808a0915dfdff667ea7fd844ceefe5ebd461 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs @@ -250,7 +250,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent Inertia = 0.SI<KilogramSquareMeter>(), }; var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(); - fullLoadCurves[0] = EngineFullLoadCurve.Create( + fullLoadCurves[0] = FullLoadCurveReader.Create( VectoCSVFile.ReadStream( InputDataHelper.InputDataAsStream("engine speed [1/min],full load torque [Nm],motoring torque [Nm],PT1 [s]", fld))); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs index 8a03c5cb6eb9f0f05686c75e259eb4a4c6a33f7a..a07591196884eaaa99f425e8077fef9511e3bc2c 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs @@ -36,6 +36,7 @@ using NLog.Config; using NLog.Targets; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; @@ -57,7 +58,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestFullLoadStaticTorque() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(1180, fldCurve.FullLoadStationaryTorque(560.RPMtoRad()).Value(), Tolerance); Assert.AreEqual(1352, fldCurve.FullLoadStationaryTorque(2000.RPMtoRad()).Value(), Tolerance); @@ -67,14 +68,14 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestFullLoadEngineSpeedRated() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(181.8444, fldCurve.RatedSpeed.Value(), Tolerance); } [TestMethod] public void TestFullLoadStaticPower() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(69198.814183, fldCurve.FullLoadStationaryPower(560.RPMtoRad()).Value(), Tolerance); Assert.AreEqual(283162.218372, fldCurve.FullLoadStationaryPower(2000.RPMtoRad()).Value(), Tolerance); @@ -84,7 +85,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestDragLoadStaticTorque() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(-149, fldCurve.DragLoadStationaryTorque(560.RPMtoRad()).Value(), Tolerance); Assert.AreEqual(-301, fldCurve.DragLoadStationaryTorque(2000.RPMtoRad()).Value(), Tolerance); @@ -96,7 +97,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestDragLoadStaticPower() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(-8737.81636, fldCurve.DragLoadStationaryPower(560.RPMtoRad()).Value(), Tolerance); Assert.AreEqual(-63041.29254, fldCurve.DragLoadStationaryPower(2000.RPMtoRad()).Value(), Tolerance); @@ -106,7 +107,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestPT1() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); Assert.AreEqual(0.6, fldCurve.PT1(560.RPMtoRad()).Value.Value(), Tolerance); Assert.AreEqual(0.25, fldCurve.PT1(2000.RPMtoRad()).Value.Value(), Tolerance); @@ -116,7 +117,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void TestPreferredSpeed() { - var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); + var fldCurve = FullLoadCurveReader.ReadFromFile(CoachEngineFLD); fldCurve.EngineData = new CombustionEngineData { IdleSpeed = 560.RPMtoRad() }; AssertHelper.AreRelativeEqual(130.691151551712.SI<PerSecond>(), fldCurve.PreferredSpeed); var totalArea = fldCurve.ComputeArea(fldCurve.EngineData.IdleSpeed, fldCurve.N95hSpeed); @@ -145,7 +146,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData "2100,1100,-320,0.25", }; var fldEntries = InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm],Mdrag [Nm],<PT1> [s] ", fldData); - var fldCurve = EngineFullLoadCurve.Create(VectoCSVFile.ReadStream(fldEntries)); + var fldCurve = FullLoadCurveReader.Create(VectoCSVFile.ReadStream(fldEntries)); fldCurve.EngineData = new CombustionEngineData { IdleSpeed = 560.RPMtoRad() }; var totalArea = fldCurve.ComputeArea(fldCurve.EngineData.IdleSpeed, fldCurve.N95hSpeed); @@ -170,7 +171,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData "4000,811.7189964,-138.7132, 1.0", }; var fldEntries = InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm],Mdrag [Nm],<PT1> [s] ", fldData); - var fldCurve = EngineFullLoadCurve.Create(VectoCSVFile.ReadStream(fldEntries)); + var fldCurve = FullLoadCurveReader.Create(VectoCSVFile.ReadStream(fldEntries)); fldCurve.EngineData = new CombustionEngineData { IdleSpeed = 560.RPMtoRad() }; AssertHelper.Exception<VectoException>(() => { var tmp = fldCurve.N95hSpeed; }); @@ -187,7 +188,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData public void Test_FileRead_WrongFileFormat_InsufficientColumns() { AssertHelper.Exception<VectoException>( - () => EngineFullLoadCurve.ReadFromFile(@"TestData\Components\FullLoadCurve insufficient columns.vfld"), + () => FullLoadCurveReader.ReadFromFile(@"TestData\Components\FullLoadCurve insufficient columns.vfld"), "ERROR while reading FullLoadCurve File: Engine FullLoadCurve Data File must consist of at least 3 columns."); } @@ -205,7 +206,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData target.Parameters.Add(new MethodCallParameter("${level}")); target.Parameters.Add(new MethodCallParameter("${message}")); SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Warn); - EngineFullLoadCurve.ReadFromFile(@"TestData\Components\FullLoadCurve wrong header.vfld"); + FullLoadCurveReader.ReadFromFile(@"TestData\Components\FullLoadCurve wrong header.vfld"); Assert.IsTrue( LogList.Contains( "FullLoadCurve: Header Line is not valid. Expected: \'engine speed, full load torque, motoring torque\', Got: \'n, Mfull, Mdrag, PT1\'. Falling back to column index."), @@ -224,7 +225,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData [TestMethod] public void Test_FileRead_NoHeader() { - var curve = EngineFullLoadCurve.ReadFromFile(@"TestData\Components\FullLoadCurve no header.vfld"); + var curve = FullLoadCurveReader.ReadFromFile(@"TestData\Components\FullLoadCurve no header.vfld"); var result = curve.FullLoadStationaryTorque(1.SI<PerSecond>()); Assert.AreNotEqual(result.Value(), 0.0); } @@ -236,7 +237,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData public void Test_FileRead_InsufficientEntries() { AssertHelper.Exception<VectoException>( - () => EngineFullLoadCurve.ReadFromFile(@"TestData\Components\FullLoadCurve insufficient entries.vfld"), + () => FullLoadCurveReader.ReadFromFile(@"TestData\Components\FullLoadCurve insufficient entries.vfld"), "ERROR while reading FullLoadCurve File: FullLoadCurve must consist of at least two lines with numeric values (below file header)"); } @@ -246,8 +247,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData var engineData = new CombustionEngineData { FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { - { 0, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, - { 1, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") } + { 0, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, + { 1, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") } }, IdleSpeed = 560.RPMtoRad() }; @@ -289,7 +290,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData }; var fldCurve = - EngineFullLoadCurve.Create( + FullLoadCurveReader.Create( VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm],Mdrag [Nm],<PT1> [s]", fldEntries))); Assert.AreEqual(1180, fldCurve.FullLoadStationaryTorque(560.RPMtoRad()).Value(), Tolerance); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs index 57eaeb48bf8c29c409289159b4d03ab132a43e01..5968ff314ec4187d7532097ebf76d41a1a12e923 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs @@ -304,7 +304,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData }; var dataEng = VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm],Mdrag [Nm]", engineFldString)); - var engineFld = EngineFullLoadCurve.Create(dataEng, true); + var engineFld = FullLoadCurveReader.Create(dataEng, true); var fullLoadCurve = AbstractSimulationDataAdapter.IntersectFullLoadCurves(engineFld, 2500.SI<NewtonMeter>()); @@ -322,12 +322,13 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData public void TestFullLoadSorting() { var gbxFldString = new[] { - "600, 1000", - "2400, 2000", - "1000, 500" + "600, 1000, -100", + "2400, 2000, -120", + "1000, 500, -110" }; - var dataGbx = VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm]", gbxFldString)); + var dataGbx = + VectoCSVFile.ReadStream(InputDataHelper.InputDataAsStream("n [U/min],Mfull [Nm], Mdrag [Nm]", gbxFldString)); var gbxFld = FullLoadCurveReader.Create(dataGbx, true); var maxTorque = gbxFld.FullLoadStationaryTorque(800.RPMtoRad()); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs index b1f96980a878cacd8159fb39efdcb28c4d2d4236..f35363407c47374493f73c8df38b800eca3f8830 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs @@ -89,7 +89,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData WHTCUrban = 1, WHTCRural = 1, WHTCMotorway = 1, - FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { { 0, EngineFullLoadCurve.Create(fullLoad) } }, + FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { { 0, FullLoadCurveReader.Create(fullLoad) } }, ConsumptionMap = FuelConsumptionMapReader.Create(fuelConsumption) }; data.FullLoadCurves[0].EngineData = data; @@ -224,8 +224,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData var engineData = new CombustionEngineData { FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { - { 0, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, - { 1, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, + { 0, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, + { 1, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, }, IdleSpeed = 560.RPMtoRad() }; @@ -300,8 +300,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData var engineData = new CombustionEngineData { FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { - { 0, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, - { 1, EngineFullLoadCurve.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") } + { 0, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") }, + { 1, FullLoadCurveReader.ReadFromFile(@"TestData\Components\12t Delivery Truck.vfld") } }, IdleSpeed = 560.RPMtoRad() }; @@ -622,12 +622,22 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData public string Creator { get; set; } public string Date { get; set; } public string TechnicalReportId { get; set; } - public CertificationMethod CertificationMethod { get{return CertificationMethod.NotCertified;}} + + public CertificationMethod CertificationMethod + { + get { return CertificationMethod.NotCertified; } + } + public string CertificationNumber { get; set; } public string DigestValue { get; set; } public GearboxType Type { get; set; } public IList<ITransmissionInputData> Gears { get; set; } - ITorqueConverterDeclarationInputData IGearboxDeclarationInputData.TorqueConverter { get { return TorqueConverter; } } + + ITorqueConverterDeclarationInputData IGearboxDeclarationInputData.TorqueConverter + { + get { return TorqueConverter; } + } + public KilogramSquareMeter Inertia { get; set; } public Second TractionInterruption { get; set; } public Second MinTimeBetweenGearshift { get; set; } diff --git a/VectoCore/VectoCoreTest/Reports/ModDataTest.cs b/VectoCore/VectoCoreTest/Reports/ModDataTest.cs index fa8e8f835e50aec8a4ed611d86f6892ac685d816..5ec7258a03f662c6ecf3a7e5e8f97f0264942e8f 100644 --- a/VectoCore/VectoCoreTest/Reports/ModDataTest.cs +++ b/VectoCore/VectoCoreTest/Reports/ModDataTest.cs @@ -110,7 +110,7 @@ namespace TUGraz.VectoCore.Tests.Reports var modData = new List<Tuple<ModalResults, Meter>>(); foreach (var run in jobContainer.Runs) { modData.Add(Tuple.Create(((ModalDataContainer)run.Run.GetContainer().ModalData).Data, - ((DistanceBasedDrivingCycle)((VehicleContainer)run.Run.GetContainer()).DrivingCycle)._data.Entries.Last() + ((DistanceBasedDrivingCycle)((VehicleContainer)run.Run.GetContainer()).DrivingCycle).Data.Entries.Last() .Distance)); } var auxKeys = @@ -134,19 +134,19 @@ namespace TUGraz.VectoCore.Tests.Reports private static void AssertSumDataIntegrity(SummaryDataContainer sumData, ExecutionMode mode) { - Assert.IsTrue(sumData._table.Rows.Count > 0); + Assert.IsTrue(sumData.Table.Rows.Count > 0); var ptoTransmissionColumn = - sumData._table.Columns.Contains(string.Format(SummaryDataContainer.E_FORMAT, + sumData.Table.Columns.Contains(string.Format(SummaryDataContainer.E_FORMAT, Constants.Auxiliaries.IDs.PTOTransmission)) ? string.Format(SummaryDataContainer.E_FORMAT, Constants.Auxiliaries.IDs.PTOTransmission) : null; var ptoConsumerColumn = - sumData._table.Columns.Contains(string.Format(SummaryDataContainer.E_FORMAT, Constants.Auxiliaries.IDs.PTOConsumer)) + sumData.Table.Columns.Contains(string.Format(SummaryDataContainer.E_FORMAT, Constants.Auxiliaries.IDs.PTOConsumer)) ? string.Format(SummaryDataContainer.E_FORMAT, Constants.Auxiliaries.IDs.PTOConsumer) : null; - foreach (DataRow row in sumData._table.Rows) { + foreach (DataRow row in sumData.Table.Rows) { var inputFile = row[SummaryDataContainer.INPUTFILE].ToString(); var cycle = row[SummaryDataContainer.CYCLE].ToString(); var loading = row[SummaryDataContainer.LOADING].ToString(); @@ -370,7 +370,7 @@ namespace TUGraz.VectoCore.Tests.Reports var modData = new List<Tuple<ModalResults, Meter>>(); foreach (var run in jobContainer.Runs) { modData.Add(Tuple.Create(((ModalDataContainer)run.Run.GetContainer().ModalData).Data, - ((DistanceBasedDrivingCycle)((VehicleContainer)run.Run.GetContainer()).DrivingCycle)._data.Entries.Last() + ((DistanceBasedDrivingCycle)((VehicleContainer)run.Run.GetContainer()).DrivingCycle).Data.Entries.Last() .Distance)); } var auxKeys = diff --git a/VectoCore/VectoCoreTest/Reports/SumWriterTest.cs b/VectoCore/VectoCoreTest/Reports/SumWriterTest.cs index faaf23237f25e0a84a2f52ac30780c87781e387e..5a49f67a18eb6afe712b146d84461c077a66b89e 100644 --- a/VectoCore/VectoCoreTest/Reports/SumWriterTest.cs +++ b/VectoCore/VectoCoreTest/Reports/SumWriterTest.cs @@ -82,7 +82,7 @@ namespace TUGraz.VectoCore.Tests.Reports modData.CommitSimulationStep(); } - sumWriter.Write(modData, "testSumCalc", new MockRunData()); + sumWriter.Write(modData, 0, 0, new MockRunData()); modData.Finish(VectoRun.Status.Success); sumWriter.Finish(); @@ -140,7 +140,7 @@ namespace TUGraz.VectoCore.Tests.Reports modData.CommitSimulationStep(); } - sumWriter.Write(modData, "testSumCalc", new MockRunData()); + sumWriter.Write(modData, 0, 0, new MockRunData()); modData.Finish(VectoRun.Status.Success); sumWriter.Finish(); diff --git a/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor.vveh b/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor.vveh index 9853ba577c00dcdc3d168754d5111d8dcaa3b5af..6a98da4179bce4dd2b3059a6a70b9be9d20557dc 100644 --- a/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor.vveh +++ b/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor.vveh @@ -27,10 +27,11 @@ "LossMap": "" }, "PTO": { - "Type": "None", - "LossMap": "", - "Cycle": "" + "Type": "None", + "LossMap": "", + "Cycle": "" }, + "IdlingSpeed": 900.0, "AxleConfig": { "Type": "4x2", "Axles": [ diff --git a/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor_angledrive.vveh b/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor_angledrive.vveh index a18e1c74275f548247de6cd12088428ad81b6409..3b754c34af538bfd8e21c520b4bf115b4a6f9836 100644 --- a/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor_angledrive.vveh +++ b/VectoCore/VectoCoreTest/TestData/XML/XMLWriter/DeclarationJob/Class5_Tractor_4x2/Class5_Tractor_angledrive.vveh @@ -27,10 +27,11 @@ "LossMap": "Axle_4x2_Tractor.vtlm" }, "PTO": { - "Type": "None", - "LossMap": "", - "Cycle": "" + "Type": "None", + "LossMap": "", + "Cycle": "" }, + "IdlingSpeed": 900.0, "AxleConfig": { "Type": "4x2", "Axles": [ diff --git a/VectoCore/VectoCoreTest/Utils/MockRunData.cs b/VectoCore/VectoCoreTest/Utils/MockRunData.cs index 2da0eabb143cdb4a4c4bc9a641034888c9bd9b76..9a7066e28a8c007a024c2bf8ea10d823c184eb2e 100644 --- a/VectoCore/VectoCoreTest/Utils/MockRunData.cs +++ b/VectoCore/VectoCoreTest/Utils/MockRunData.cs @@ -53,7 +53,6 @@ namespace TUGraz.VectoCore.Tests.Utils Loading = 0.SI<Kilogram>(), TotalRollResistanceCoefficient = 0, DynamicTyreRadius = 1.SI<Meter>(), - }; AirdragData = new AirdragData() { CrossWindCorrectionCurve = @@ -68,25 +67,24 @@ namespace TUGraz.VectoCore.Tests.Utils Displacement = 0.SI<CubicMeter>(), FullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>() { { - 0, new EngineFullLoadCurve() { - FullLoadEntries = new List<FullLoadCurve.FullLoadCurveEntry>() { - new FullLoadCurve.FullLoadCurveEntry() { + 0, new EngineFullLoadCurve( + new List<EngineFullLoadCurve.FullLoadCurveEntry>() { + new EngineFullLoadCurve.FullLoadCurveEntry() { EngineSpeed = 600.RPMtoRad(), TorqueDrag = -100.SI<NewtonMeter>(), TorqueFullLoad = 500.SI<NewtonMeter>() }, - new FullLoadCurve.FullLoadCurveEntry() { + new EngineFullLoadCurve.FullLoadCurveEntry() { EngineSpeed = 1800.RPMtoRad(), TorqueDrag = -120.SI<NewtonMeter>(), TorqueFullLoad = 1200.SI<NewtonMeter>() }, - new FullLoadCurve.FullLoadCurveEntry() { + new EngineFullLoadCurve.FullLoadCurveEntry() { EngineSpeed = 2500.RPMtoRad(), TorqueDrag = -150.SI<NewtonMeter>(), TorqueFullLoad = 400.SI<NewtonMeter>() }, - } - } + }, null) } } }; diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs index 6e98703bbd103d2f0fa30910074484165f2085f0..68f6e3f6da4b45f63b434c786e1f15e807dbf734 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputTest.cs @@ -1,4 +1,35 @@ -using System.Collections.Generic; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Linq; using System.Windows.Forms; @@ -11,6 +42,7 @@ using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Impl; @@ -60,7 +92,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.AreEqual("engine speed", fldTable.Columns[0].Caption); Assert.AreEqual("full load torque", fldTable.Columns[1].Caption); Assert.AreEqual("motoring torque", fldTable.Columns[2].Caption); - var fldMap = EngineFullLoadCurve.Create(fldTable, true); + var fldMap = FullLoadCurveReader.Create(fldTable, true); } [TestMethod] diff --git a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs index 1621c2da2fcb5407b1d0faddf68ce74f03255247..f109dd7a551fa365ad20c514457f1ca0e5056b47 100644 --- a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputRefTest.cs @@ -1,4 +1,35 @@ -using System.IO; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Linq; using System.Xml; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -6,6 +37,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML.Engineering; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; @@ -63,7 +95,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.AreEqual("engine speed", fldTable.Columns[0].Caption); Assert.AreEqual("full load torque", fldTable.Columns[1].Caption); Assert.AreEqual("motoring torque", fldTable.Columns[2].Caption); - var fldMap = EngineFullLoadCurve.Create(fldTable, true); + var fldMap = FullLoadCurveReader.Create(fldTable, true); } [TestMethod] diff --git a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs index f26108d0b05c6adf61a7606c71f63644a85c77c0..230b5a3255e359b356d7b236b5c3ac7561676a54 100644 --- a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs @@ -1,4 +1,35 @@ -using System.IO; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Linq; using System.Xml; using System.Xml.Linq; @@ -10,6 +41,7 @@ using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.FileIO.XML.Engineering; +using TUGraz.VectoCore.InputData.Reader; using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Impl; @@ -64,7 +96,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.AreEqual("engine speed", fldTable.Columns[0].Caption); Assert.AreEqual("full load torque", fldTable.Columns[1].Caption); Assert.AreEqual("motoring torque", fldTable.Columns[2].Caption); - var fldMap = EngineFullLoadCurve.Create(fldTable, true); + var fldMap = FullLoadCurveReader.Create(fldTable, true); } [TestMethod] diff --git a/VectoCore/VectoCoreTest/XML/XMLWritingTest.cs b/VectoCore/VectoCoreTest/XML/XMLWritingTest.cs index e4f1700e34cca0ac4579826260717518eef2e8cb..ce9a110becfa29997f57c301bfc6ca77c0393a83 100644 --- a/VectoCore/VectoCoreTest/XML/XMLWritingTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLWritingTest.cs @@ -1,4 +1,35 @@ -using System.IO; +/* +* This file is part of VECTO. +* +* Copyright © 2012-2016 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.IO; using System.Xml; using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.IVT.VectoXML.Writer;