Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit a2a0ad6f authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adding testcase for reading primary bus, splitting segment table class

parent bf468c9d
Branches
Tags
No related merge requests found
using System;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.Models;
namespace TUGraz.VectoCore.Models.Declaration {
public sealed class BusSegments
{
public Segment Lookup(VehicleCategory vehicleCategory, AxleConfiguration axleConfiguration, bool articulated, FloorType entrance, bool doubleDecker)
{
throw new NotImplementedException();
}
}
}
\ No newline at end of file
...@@ -42,7 +42,7 @@ using TUGraz.VectoCore.Utils; ...@@ -42,7 +42,7 @@ using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration namespace TUGraz.VectoCore.Models.Declaration
{ {
public sealed class Segments : LookupData<VehicleCategory, AxleConfiguration, Kilogram, Kilogram, bool, Segment> public sealed class TruckSegments : LookupData<VehicleCategory, AxleConfiguration, Kilogram, Kilogram, bool, Segment>
{ {
private DataTable _segmentTable; private DataTable _segmentTable;
......
...@@ -33,6 +33,7 @@ using Newtonsoft.Json; ...@@ -33,6 +33,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NUnit.Framework; using NUnit.Framework;
using System.IO; using System.IO;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
...@@ -280,7 +281,7 @@ namespace TUGraz.VectoCore.Tests.FileIO ...@@ -280,7 +281,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(inputProvider, var gbxData = new EngineeringDataAdapter().CreateGearboxData(inputProvider,
MockSimulationDataFactory.CreateEngineDataFromFile(@"TestData\Components\AT_GBX\Engine.veng", 0), MockSimulationDataFactory.CreateEngineDataFromFile(@"TestData\Components\AT_GBX\Engine.veng", 0),
(IGearshiftEngineeringInputData)inputProvider, 2.1, (IGearshiftEngineeringInputData)inputProvider, 2.1,
0.5.SI<Meter>(), VehicleCategory.InterurbanBus, (ITorqueConverterEngineeringInputData)inputProvider); 0.5.SI<Meter>(), VehicleCategory.HeavyBusPrimaryVehicle, (ITorqueConverterEngineeringInputData)inputProvider);
Assert.AreEqual(ratios.Length, gbxData.Gears.Count); Assert.AreEqual(ratios.Length, gbxData.Gears.Count);
Assert.IsTrue(gbxData.Gears[1].HasLockedGear); Assert.IsTrue(gbxData.Gears[1].HasLockedGear);
...@@ -308,7 +309,7 @@ namespace TUGraz.VectoCore.Tests.FileIO ...@@ -308,7 +309,7 @@ namespace TUGraz.VectoCore.Tests.FileIO
var gbxData = new EngineeringDataAdapter().CreateGearboxData(inputProvider, var gbxData = new EngineeringDataAdapter().CreateGearboxData(inputProvider,
MockSimulationDataFactory.CreateEngineDataFromFile(@"TestData\Components\AT_GBX\Engine.veng", 0), MockSimulationDataFactory.CreateEngineDataFromFile(@"TestData\Components\AT_GBX\Engine.veng", 0),
(IGearshiftEngineeringInputData)inputProvider, 2.1, (IGearshiftEngineeringInputData)inputProvider, 2.1,
0.5.SI<Meter>(), VehicleCategory.InterurbanBus, (ITorqueConverterEngineeringInputData)inputProvider); 0.5.SI<Meter>(), VehicleCategory.HeavyBusPrimaryVehicle, (ITorqueConverterEngineeringInputData)inputProvider);
Assert.AreEqual(ratios.Length, gbxData.Gears.Count); Assert.AreEqual(ratios.Length, gbxData.Gears.Count);
Assert.IsFalse(gbxData.Gears[1].HasLockedGear); Assert.IsFalse(gbxData.Gears[1].HasLockedGear);
...@@ -349,6 +350,42 @@ namespace TUGraz.VectoCore.Tests.FileIO ...@@ -349,6 +350,42 @@ namespace TUGraz.VectoCore.Tests.FileIO
Assert.AreEqual(3.5, angleGear["Ratio"].Value<double>()); Assert.AreEqual(3.5, angleGear["Ratio"].Value<double>());
Assert.AreEqual("AngleGear.vtlm", angleGear["LossMap"].Value<string>()); Assert.AreEqual("AngleGear.vtlm", angleGear["LossMap"].Value<string>());
} }
[TestCase]
public void JSON_Read_HeavyBus()
{
var inputProvider = (IDeclarationInputDataProvider)JSONInputDataFactory.ReadJsonJob(@"TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\HeavyBusPrimary_DECL.vecto");
var busAux = inputProvider.JobInputData.Vehicle.Components.BusAuxiliaries;
Assert.AreEqual("Electrically driven - Electronically controlled", busAux.FanTechnology);
Assert.AreEqual(1, busAux.SteeringPumpTechnology.Count);
Assert.AreEqual("Dual displacement with mech. control", busAux.SteeringPumpTechnology[0]);
Assert.AreEqual(1, busAux.ElectricSupply.Alternators.Count);
Assert.AreEqual("standard alternator", busAux.ElectricSupply.Alternators[0].Technology);
Assert.AreEqual(1, busAux.ElectricSupply.Alternators[0].Ratio);
Assert.AreEqual(false, busAux.ElectricSupply.SmartElectrics);
Assert.AreEqual(3, busAux.ElectricSupply.ResultCards.Idle.Count);
Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].Current.Value());
Assert.AreEqual(20, busAux.ElectricSupply.ResultCards.Idle[1].Current.Value());
Assert.AreEqual(50, busAux.ElectricSupply.ResultCards.Idle[2].Current.Value());
Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].SmartCurrent.Value());
Assert.AreEqual(25, busAux.ElectricSupply.ResultCards.Idle[1].SmartCurrent.Value());
Assert.AreEqual(60, busAux.ElectricSupply.ResultCards.Idle[2].SmartCurrent.Value());
Assert.AreEqual("", busAux.PneumaticSupply.CompressorSize);
Assert.AreEqual(1.0, busAux.PneumaticSupply.Ratio);
Assert.AreEqual(ConsumerTechnology.Mechanically, busAux.PneumaticConsumers.AirsuspensionControl);
Assert.AreEqual(ConsumerTechnology.Pneumatically, busAux.PneumaticConsumers.AdBlueDosing);
Assert.AreEqual(true, busAux.HVACAux.AdjustableCoolantThermostat);
Assert.AreEqual(true, busAux.HVACAux.EngineWasteGasHeatExchanger);
}
} }
// [TestFixture] // [TestFixture]
......
...@@ -624,6 +624,66 @@ ...@@ -624,6 +624,66 @@
<None Include="TestData\Generic Vehicles\Engineering Mode\24t Coach\ShiftPolygons.vgbs"> <None Include="TestData\Generic Vehicles\Engineering Mode\24t Coach\ShiftPolygons.vgbs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\325kW.vfld">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\325kW.vmap">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\AMT_12.vgbx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Axle_4x2_Tractor.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Default.vrlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Engine_325kW_12.7l.veng">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_1.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_10.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_11.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_12.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_2.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_3.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_4.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_5.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_6.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_7.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_8.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\Gear_9.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\HeavyBusPrimaryVehicle.vveh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Generic Vehicles\Engineering Mode\HeavyBusPrimary\HeavyBusPrimary_DECL.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\APT-S Generic TqMax1200.vgbx"> <None Include="TestData\Integration\ADAS\Group9_RigidTruck_AT\APT-S Generic TqMax1200.vgbx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment