From 2b3a58f40d7c456795896ca03c83a41a89d8cc1e Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Wed, 3 Aug 2016 16:08:20 +0200 Subject: [PATCH] Aux Fan: updated values and technology strings --- Declaration/VAUX/Fan-Tech.csv | 24 +++--- VECTO/Input Files/cVECTO.vb | 11 +++ VECTO/cDeclaration.vb | 74 +++++++++---------- .../InputData/FileIO/JSON/JSONInputData.cs | 19 +++-- VectoCore/VectoCore/Models/Declaration/Fan.cs | 5 +- .../Resources/Declaration/VAUX/Fan-Tech.csv | 24 +++--- .../Models/Declaration/DeclarationDataTest.cs | 65 +++++++++------- 7 files changed, 126 insertions(+), 96 deletions(-) diff --git a/Declaration/VAUX/Fan-Tech.csv b/Declaration/VAUX/Fan-Tech.csv index 81865eb450..3dd384fc44 100644 --- a/Declaration/VAUX/Fan-Tech.csv +++ b/Declaration/VAUX/Fan-Tech.csv @@ -1,12 +1,12 @@ -Technology,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach -Crankshaft mounted - Electronically controlled visco clutch (Default),618,671,516,566,1037,0,0,0,0,0 -Crankshaft mounted - Bimetallic controlled visco clutch,818,871,676,766,1277,0,0,0,0,0 -Crankshaft mounted - Discrete step clutch,668,721,616,616,1157,0,0,0,0,0 -Crankshaft mounted - On/Off clutch,718,771,666,666,1237,0,0,0,0,0 -Belt driven or driven via transm. - Electronically controlled visco clutch,889,944,733,833,1378,0,0,0,0,0 -Belt driven or driven via transm. - Bimetallic controlled visco clutch,1089,1144,893,1033,1618,0,0,0,0,0 -Belt driven or driven via transm. - Discrete step clutch,939,994,883,883,1498,0,0,0,0,0 -Belt driven or driven via transm. - On/Off clutch,989,1044,933,933,1578,0,0,0,0,0 -Hydraulic driven - Variable displacement pump,738,955,632,717,1672,0,0,0,0,0 -Hydraulic driven - Constant displacement pump,1000,1200,800,900,2100,0,0,0,0,0 -Hydraulic driven - Electronically controlled,700,800,600,600,1400,0,0,0,0,0 +Technology,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction +Crankshaft mounted - Electronically controlled visco clutch,618,671,516,566,1037 +Crankshaft mounted - Bimetallic controlled visco clutch,818,871,676,766,1277 +Crankshaft mounted - Discrete step clutch,668,721,616,616,1157 +Crankshaft mounted - On/off clutch,718,771,666,666,1237 +Belt driven or driven via transm. - Electronically controlled visco clutch,989,1044,833,933,1478 +Belt driven or driven via transm. - Bimetallic controlled visco clutch,1189,1244,993,1133,1718 +Belt driven or driven via transm. - Discrete step clutch,1039,1094,983,983,1598 +Belt driven or driven via transm. - On/off clutch,1089,1144,1033,1033,1678 +Hydraulic driven - Variable displacement pump,938,1155,832,917,1872 +Hydraulic driven - Constant displacement pump,1200,1400,1000,1100,2300 +Hydraulic driven - Electronically controlled,700,800,600,600,1400 diff --git a/VECTO/Input Files/cVECTO.vb b/VECTO/Input Files/cVECTO.vb index 46b1df9638..157c46ddc4 100644 --- a/VECTO/Input Files/cVECTO.vb +++ b/VECTO/Input Files/cVECTO.vb @@ -351,6 +351,17 @@ Public Class cVECTO msgSrc) End Select End If + + If auxId = sKey.AUX.Fan Then + Select auxEntry.TechStr + Case "Crankshaft mounted - Electronically controlled visco clutch (Default)" + auxEntry.TechStr = "Crankshaft mounted - Electronically controlled visco clutch" + Case "Crankshaft mounted - On/Off clutch" + auxEntry.TechStr = "Crankshaft mounted - On/off clutch" + Case "Belt driven or driven via transm. - On/Off clutch" + auxEntry.TechStr = "Belt driven or driven via transm. - On/off clutch" + End Select + End If Next End If diff --git a/VECTO/cDeclaration.vb b/VECTO/cDeclaration.vb index 4a0320ce2a..50e229f94e 100644 --- a/VECTO/cDeclaration.vb +++ b/VECTO/cDeclaration.vb @@ -25,7 +25,7 @@ Public Class cDeclaration Public Const SSspeed As Single = 5 Public Const SStime As Single = 5 Public Const SSdelay As Single = 5 - Public Const LACa As Single = -0.5 + Public Const LACa As Single = - 0.5 Public Const LACvmin As Single = 50 Public Const Overspeed As Single = 5 Public Const Underspeed As Single = 5 @@ -247,11 +247,11 @@ Public Class cDeclaration Select Case i Case 0 mc0.WHTCWF = New Dictionary(Of tWHTCpart, Single) - mc0.WHTCWF.Add(tWHTCpart.Urban, line(a) / 100) + mc0.WHTCWF.Add(tWHTCpart.Urban, line(a)/100) Case 1 - mc0.WHTCWF.Add(tWHTCpart.Rural, line(a) / 100) + mc0.WHTCWF.Add(tWHTCpart.Rural, line(a)/100) Case Else '2 - mc0.WHTCWF.Add(tWHTCpart.Motorway, line(a) / 100) + mc0.WHTCWF.Add(tWHTCpart.Motorway, line(a)/100) End Select Next Next @@ -368,7 +368,7 @@ Public Class cDeclaration For a = 1 To TrA - l0.Add(TrS / TrA) + l0.Add(TrS/TrA) Next ste0.AxleSharesTr.Add(SegmentTable.MissionList(i), l0) @@ -410,7 +410,7 @@ Public Class cDeclaration at0.Add(line(0)) AuxPower0 = New Dictionary(Of tMission, Single) i = 0 - For Each mt0 In SegmentTable.MissionList + For Each mt0 In SegmentTable.MissionList.Take(5) i += 1 AuxPower0.Add(mt0, line(i)) Next @@ -564,7 +564,7 @@ Public Class cDeclaration 'Default PT1 values lPT1nU = New List(Of Single) lPT1 = New List(Of Single) - PT1dim = -1 + PT1dim = - 1 If Not file.OpenRead(MyDeclPath & "PT1.csv") Then GUImsg(tMsgID.Err, "Failed to load Declaration Config (PT1 table)!") @@ -665,7 +665,7 @@ Public Class cDeclaration End Function Public Function EngInertia(Displ As Single) As Single - Return 1.3 + 0.41 + 0.27 * (Displ / 1000) + Return 1.3 + 0.41 + 0.27*(Displ/1000) End Function Public Function TracInt(Gearbox As tGearbox) As Single @@ -717,7 +717,7 @@ Public Class cDeclaration If Wheels.ContainsKey(Wheel) Then Return Wheels(Wheel).Inertia Else - Return -1 + Return - 1 End If End Function @@ -726,12 +726,12 @@ Public Class cDeclaration Dim w As cWheel If Not Wheels.ContainsKey(Wheel) Then - Return -1 + Return - 1 End If If Not Rims.ContainsKey(Rim) Then - Return -1 + Return - 1 End If w = Wheels(Wheel) @@ -742,7 +742,7 @@ Public Class cDeclaration F = Rims(Rim).Fb End If - Return (F * w.Diam) / (2 * Math.PI) + Return (F*w.Diam)/(2*Math.PI) End Function Public ReadOnly Property WheelsList As Dictionary(Of String, cWheel).KeyCollection @@ -811,9 +811,9 @@ Public Class cDeclaration CurrentMission = Missions(SegRef.Missions(CycleIndex)) - WHTCcorrFactor = CurrentMission.WHTCWF(tWHTCpart.Urban) * ENG.WHTCurban _ - + CurrentMission.WHTCWF(tWHTCpart.Rural) * ENG.WHTCrural _ - + CurrentMission.WHTCWF(tWHTCpart.Motorway) * ENG.WHTCmw + WHTCcorrFactor = CurrentMission.WHTCWF(tWHTCpart.Urban)*ENG.WHTCurban _ + + CurrentMission.WHTCWF(tWHTCpart.Rural)*ENG.WHTCrural _ + + CurrentMission.WHTCWF(tWHTCpart.Motorway)*ENG.WHTCmw If Not VEH.DeclInitCycle Then Return False @@ -853,7 +853,7 @@ Public Class cDeclaration 'Fan Try - AuxPower.Add(sKey.AUX.Fan, AuxFanPower(VEC.AuxPaths(sKey.AUX.Fan).TechStr)(CurrentMission.MissionID) / 1000) + AuxPower.Add(sKey.AUX.Fan, AuxFanPower(VEC.AuxPaths(sKey.AUX.Fan).TechStr)(CurrentMission.MissionID)/1000) Catch ex As Exception WorkerMsg(tMsgID.Err, "Failed to initialise fan! " & ex.Message, MsgSrc) Result = False @@ -871,7 +871,7 @@ Public Class cDeclaration fF = sl(1) fB = sl(2) fS = sl(3) - AuxPower.Add(sKey.AUX.SteerPump, (U * fU + F * fF + B * fB + S * fS) / 1000) + AuxPower.Add(sKey.AUX.SteerPump, (U*fU + F*fF + B*fB + S*fS)/1000) Catch ex As Exception WorkerMsg(tMsgID.Err, "Failed to initialise steering pump! " & ex.Message, MsgSrc) Result = False @@ -879,7 +879,7 @@ Public Class cDeclaration 'HVAC Try - AuxPower.Add(sKey.AUX.HVAC, AuxHVACPower(SegRef.HDVclass)(CurrentMission.MissionID) / 1000) + AuxPower.Add(sKey.AUX.HVAC, AuxHVACPower(SegRef.HDVclass)(CurrentMission.MissionID)/1000) Catch ex As Exception WorkerMsg(tMsgID.Err, "Failed to initialise HVAC! " & ex.Message, MsgSrc) Result = False @@ -888,7 +888,7 @@ Public Class cDeclaration 'Electric System Try AuxPower.Add(sKey.AUX.ElecSys, - AuxESpower(VEC.AuxPaths(sKey.AUX.ElecSys).TechStr)(CurrentMission.MissionID) / (1000 * AuxESeff)) + AuxESpower(VEC.AuxPaths(sKey.AUX.ElecSys).TechStr)(CurrentMission.MissionID)/(1000*AuxESeff)) Catch ex As Exception WorkerMsg(tMsgID.Err, "Failed to initialise electric system! " & ex.Message, MsgSrc) Result = False @@ -921,9 +921,9 @@ Public Class cDeclaration i += 1 Loop -lbInt: + lbInt: 'Interpolation - Return (nU - lPT1nU(i - 1)) * (lPT1(i) - lPT1(i - 1)) / (lPT1nU(i) - lPT1nU(i - 1)) + lPT1(i - 1) + Return (nU - lPT1nU(i - 1))*(lPT1(i) - lPT1(i - 1))/(lPT1nU(i) - lPT1nU(i - 1)) + lPT1(i - 1) End Function Public Sub ReportInit() @@ -939,7 +939,7 @@ lbInt: .JobFile = fFILE(JobFile, True) .DateStr = Now.ToString .Creator = Lic.LicString - .EngStr = (ENG.Displ / 1000).ToString("0.0") & " l " & Math.Round(ENG.Pmax, 0).ToString("#") & " kW" + .EngStr = (ENG.Displ/1000).ToString("0.0") & " l " & Math.Round(ENG.Pmax, 0).ToString("#") & " kW" .EngModelStr = ENG.ModelName .GbxStr = GBX.GearCount & "-Speed " & GearboxConv(GBX.gs_Type) .GbxModelStr = GBX.ModelName @@ -970,27 +970,27 @@ lbInt: For t = 0 To t1 sum += MODdata.Vh.V(t) Next - Vquer = 3.6 * sum / (t1 + 1) + Vquer = 3.6*sum/(t1 + 1) With lr - .Loading = VEH.Loading / 1000 + .Loading = VEH.Loading/1000 .Speed = Vquer - .FCkm = (100 * MODdata.FCavgFinal / Vquer) / (Cfg.FuelDens * 1000) - .CO2km = Cfg.CO2perFC * (MODdata.FCavgFinal / Vquer) + .FCkm = (100*MODdata.FCavgFinal/Vquer)/(Cfg.FuelDens*1000) + .CO2km = Cfg.CO2perFC*(MODdata.FCavgFinal/Vquer) If VEH.Loading > 0 Then - .FCtkm = .FCkm / .Loading - .CO2tkm = .CO2km / .Loading + .FCtkm = .FCkm/.Loading + .CO2tkm = .CO2km/.Loading End If .FCerror = MODdata.FCerror d = 0 MODdata.Vh.AltIntp(d, True) For t = 0 To t1 - .ActualSpeed.Add(MODdata.Vh.V(t) * 3.6) - .TargetSpeed.Add(MODdata.Vh.Vsoll(t) * 3.6) + .ActualSpeed.Add(MODdata.Vh.V(t)*3.6) + .TargetSpeed.Add(MODdata.Vh.Vsoll(t)*3.6) d += MODdata.Vh.V(t) - .Distance.Add(CSng(d / 1000)) + .Distance.Add(CSng(d/1000)) .Alt.Add(MODdata.Vh.AltIntp(d, False)) .nU.Add(MODdata.nU(t)) .Tq.Add(nPeToM(MODdata.nU(t), MODdata.Pe(t))) @@ -1075,7 +1075,7 @@ Public Class cSegmentTableEntry If BodyTrWeight.ContainsKey(Mission) AndAlso IsNumeric(BodyTrWeight(Mission)) Then Return CSng(BodyTrWeight(Mission)) Else - Return -1 + Return - 1 End If End Function @@ -1084,18 +1084,18 @@ Public Class cSegmentTableEntry 'Check if Config is valid If Loading.ContainsKey(Mission) Then If Not (Loading(Mission) = "f" OrElse IsNumeric(Loading(Mission))) Then - Return -1 + Return - 1 End If Else - Return -1 + Return - 1 End If 'Return Loading If HDVclass < 4 Then If Mission = tMission.LongHaul Then - Return 588.2 * MassMax - 2511.8 + Return 588.2*MassMax - 2511.8 Else - Return 394.1 * MassMax - 1705.9 + Return 394.1*MassMax - 1705.9 End If Else Return CSng(Loading(Mission)) @@ -1373,7 +1373,7 @@ Public Class cReport s.MarkerSize = 15 s.MarkerStyle = DataVisualization.Charting.MarkerStyle.Circle s.ChartType = DataVisualization.Charting.SeriesChartType.Point - i = -1 + i = - 1 For Each lr In mr.Results i += 1 s.Points.AddXY(lr.Value.Speed, lr.Value.CO2km) diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 8f5072f196..353f61bf77 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -520,12 +520,19 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } if (auxData.Type == AuxiliaryType.Fan) { - if (tech == "") { - auxData.Technology.Add(""); - } else if (tech == "") { - Log.Warn( - "Aux: Upgraded Fan Technology from '' to ''"); - auxData.Technology.Add(""); + switch (tech) { + case "Crankshaft mounted - Electronically controlled visco clutch (Default)": + auxData.Technology.Add("Crankshaft mounted - Electronically controlled visco clutch"); + break; + case "Crankshaft mounted - On/Off clutch": + auxData.Technology.Add("Crankshaft mounted - On/off clutch"); + break; + case "Belt driven or driven via transm. - On/Off clutch": + auxData.Technology.Add("Belt driven or driven via transm. - On/off clutch"); + break; + default: + auxData.Technology.Add(tech); + break; } } diff --git a/VectoCore/VectoCore/Models/Declaration/Fan.cs b/VectoCore/VectoCore/Models/Declaration/Fan.cs index 3103fda578..cf9ce2fc2b 100644 --- a/VectoCore/VectoCore/Models/Declaration/Fan.cs +++ b/VectoCore/VectoCore/Models/Declaration/Fan.cs @@ -63,9 +63,10 @@ namespace TUGraz.VectoCore.Models.Declaration } } - public override Watt Lookup(MissionType mission, - string technology = "Crankshaft mounted - Electronically controlled visco clutch") + public override Watt Lookup(MissionType mission, string technology) { + if (string.IsNullOrWhiteSpace(technology)) + technology = "Crankshaft mounted - Electronically controlled visco clutch"; return base.Lookup(mission, technology); } } diff --git a/VectoCore/VectoCore/Resources/Declaration/VAUX/Fan-Tech.csv b/VectoCore/VectoCore/Resources/Declaration/VAUX/Fan-Tech.csv index 6f2a7ad9b3..2b84f3480c 100644 --- a/VectoCore/VectoCore/Resources/Declaration/VAUX/Fan-Tech.csv +++ b/VectoCore/VectoCore/Resources/Declaration/VAUX/Fan-Tech.csv @@ -1,12 +1,12 @@ -Technology,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction,Heavy Urban,Urban,Suburban,Interurban,Coach -Crankshaft mounted - Electronically controlled visco clutch (Default),618,671,516,566,1037,0,0,0,0,0 -Crankshaft mounted - Bimetallic controlled visco clutch,818,871,676,766,1277,0,0,0,0,0 -Crankshaft mounted - Discrete step clutch,668,721,616,616,1157,0,0,0,0,0 -Crankshaft mounted - On/Off clutch,718,771,666,666,1237,0,0,0,0,0 -Belt driven or driven via transm. - Electronically controlled visco clutch,889,944,733,833,1378,0,0,0,0,0 -Belt driven or driven via transm. - Bimetallic controlled visco clutch,1089,1144,893,1033,1618,0,0,0,0,0 -Belt driven or driven via transm. - Discrete step clutch,939,994,883,883,1498,0,0,0,0,0 -Belt driven or driven via transm. - On/Off clutch,989,1044,933,933,1578,0,0,0,0,0 -Hydraulic driven - Variable displacement pump,738,955,632,717,1672,0,0,0,0,0 -Hydraulic driven - Constant displacement pump,1000,1200,800,900,2100,0,0,0,0,0 -Hydraulic driven - Electronically controlled,700,800,600,600,1400,0,0,0,0,0 +Technology,Long haul,Regional delivery,Urban delivery,Municipal utility,Construction +Crankshaft mounted - Electronically controlled visco clutch,618,671,516,566,1037 +Crankshaft mounted - Bimetallic controlled visco clutch,818,871,676,766,1277 +Crankshaft mounted - Discrete step clutch,668,721,616,616,1157 +Crankshaft mounted - On/off clutch,718,771,666,666,1237 +Belt driven or driven via transm. - Electronically controlled visco clutch,989,1044,833,933,1478 +Belt driven or driven via transm. - Bimetallic controlled visco clutch,1189,1244,993,1133,1718 +Belt driven or driven via transm. - Discrete step clutch,1039,1094,983,983,1598 +Belt driven or driven via transm. - On/off clutch,1089,1144,1033,1033,1678 +Hydraulic driven - Variable displacement pump,938,1155,832,917,1872 +Hydraulic driven - Constant displacement pump,1200,1400,1000,1100,2300 +Hydraulic driven - Electronically controlled,700,800,600,600,1400 diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 2356e5cf41..c199b54169 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -50,8 +50,15 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration [TestFixture] public class DeclarationDataTest { - public const double Tolerance = 0.0001; - public readonly MissionType[] Missions = EnumHelper.GetValues<MissionType>().ToArray(); + private const double Tolerance = 0.0001; + + private readonly MissionType[] _missions = { + MissionType.LongHaul, + MissionType.RegionalDelivery, + MissionType.UrbanDelivery, + MissionType.MunicipalUtility, + MissionType.Construction, + }; [TestCase("285/70 R19.5", 7.9, 0.8943, "b")] public void WheelDataTest(string wheels, double intertia, double dynamicRadius, string sizeClass) @@ -121,11 +128,11 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration }; var r = new Random(); - for (var i = 0; i < Missions.Length; i++) { + for (var i = 0; i < _missions.Length; i++) { var urban = r.NextDouble() * 2; var rural = r.NextDouble() * 2; var motorway = r.NextDouble() * 2; - var whtcValue = whtc.Lookup(Missions[i], rural: rural, urban: urban, motorway: motorway); + var whtcValue = whtc.Lookup(_missions[i], rural: rural, urban: urban, motorway: motorway); Assert.AreEqual(urban * factors.urban[i] + rural * factors.rural[i] + motorway * factors.motorway[i], whtcValue); } @@ -292,34 +299,38 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration } [ - TestCase("", - new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - Electronically controlled visco clutch (Default)", - new[] { 618, 671, 516, 566, 1037, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - Bimetallic controlled visco clutch", new[] { 818, 871, 676, 766, 1277, 0, 0, 0, 0, 0 } - ), - TestCase("Crankshaft mounted - Discrete step clutch", new[] { 668, 721, 616, 616, 1157, 0, 0, 0, 0, 0 }), - TestCase("Crankshaft mounted - On/Off clutch", new[] { 718, 771, 666, 666, 1237, 0, 0, 0, 0, 0 }), + TestCase("", new[] { 618, 671, 516, 566, 1037 }), + TestCase("Crankshaft mounted - Electronically controlled visco clutch", new[] { 618, 671, 516, 566, 1037 }), + TestCase("Crankshaft mounted - Bimetallic controlled visco clutch", new[] { 818, 871, 676, 766, 1277 }), + TestCase("Crankshaft mounted - Discrete step clutch", new[] { 668, 721, 616, 616, 1157 }), + TestCase("Crankshaft mounted - On/off clutch", new[] { 718, 771, 666, 666, 1237 }), TestCase("Belt driven or driven via transm. - Electronically controlled visco clutch", - new[] { 889, 944, 733, 833, 1378, 0, 0, 0, 0, 0 }), + new[] { 989, 1044, 833, 933, 1478 }), TestCase("Belt driven or driven via transm. - Bimetallic controlled visco clutch", - new[] { 1089, 1144, 893, 1033, 1618, 0, 0, 0, 0, 0 }), - TestCase("Belt driven or driven via transm. - Discrete step clutch", - new[] { 939, 994, 883, 883, 1498, 0, 0, 0, 0, 0 } - ), - TestCase("Belt driven or driven via transm. - On/Off clutch", new[] { 989, 1044, 933, 933, 1578, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Variable displacement pump", new[] { 738, 955, 632, 717, 1672, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Constant displacement pump", new[] { 1000, 1200, 800, 900, 2100, 0, 0, 0, 0, 0 }), - TestCase("Hydraulic driven - Electronically controlled", new[] { 700, 800, 600, 600, 1400, 0, 0, 0, 0, 0 }), + new[] { 1189, 1244, 993, 1133, 1718 }), + TestCase("Belt driven or driven via transm. - Discrete step clutch", new[] { 1039, 1094, 983, 983, 1598 }), + TestCase("Belt driven or driven via transm. - On/off clutch", new[] { 1089, 1144, 1033, 1033, 1678 }), + TestCase("Hydraulic driven - Variable displacement pump", new[] { 938, 1155, 832, 917, 1872 }), + TestCase("Hydraulic driven - Constant displacement pump", new[] { 1200, 1400, 1000, 1100, 2300 }), + TestCase("Hydraulic driven - Electronically controlled", new[] { 700, 800, 600, 600, 1400 }), ] public void AuxFanTechTest(string technology, int[] expected) { - for (var i = 0; i < Missions.Length; i++) { - var value = DeclarationData.Fan.Lookup(Missions[i], technology); + for (var i = 0; i < _missions.Length; i++) { + var value = DeclarationData.Fan.Lookup(_missions[i], technology); Assert.AreEqual(expected[i], value.Value(), Tolerance); } } + [TestCase("Superfluid Hydraulic", MissionType.LongHaul, TestName = "AuxFanTechError( wrong tech )"), + TestCase("Hydraulic driven - Electronically controlled", MissionType.Coach, + TestName = "AuxFanTechError( wrong mission )") + ] + public void AuxFanTechError(string technology, MissionType missionType) + { + AssertHelper.Exception<VectoException>(() => DeclarationData.Fan.Lookup(missionType, technology)); + } + [Test] public void AuxHeatingVentilationAirConditionTest() { @@ -340,9 +351,9 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration { VehicleClass.Class12, new[] { 0, 0, 0, 0, 200, 0, 0, 0, 0, 0 } } }; - for (var i = 0; i < Missions.Length; i++) { + for (var i = 0; i < _missions.Length; i++) { foreach (var expect in expected) { - var value = hvac.Lookup(Missions[i], expect.Key); + var value = hvac.Lookup(_missions[i], expect.Key); Assert.AreEqual(expect.Value[i], value.Value(), Tolerance); } } @@ -366,8 +377,8 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration { var ps = DeclarationData.PneumaticSystem; - for (var i = 0; i < Missions.Length; i++) { - var value = ps.Lookup(Missions[i], vehicleClass); + for (var i = 0; i < _missions.Length; i++) { + var value = ps.Lookup(_missions[i], vehicleClass); Assert.AreEqual(expected[i], value.Value(), Tolerance); } } -- GitLab