Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 9d55977b authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added full power train tests

parent 6affa1ae
No related branches found
No related tags found
No related merge requests found
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Exceptions;
using TUGraz.VectoCore.Models.Connector.Ports;
......@@ -11,7 +8,6 @@ using TUGraz.VectoCore.Models.Connector.Ports.Impl;
using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils;
......@@ -413,7 +409,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
: ((ResponseDryRun)response).EngineDeltaFullLoad;
break;
default:
throw new VectoSimulationException("Unknown response type");
throw new VectoSimulationException(string.Format("Unknown response type. {0}", response));
}
exceeded.Add(delta);
......
using System;
using System.Diagnostics;
using TUGraz.VectoCore.Exceptions;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
using TUGraz.VectoCore.Models.Simulation;
......
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.FileIO.Reader;
......@@ -29,6 +31,10 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
public const string AccelerationFile = @"TestData\Components\Coach.vacc";
public const string AccelerationFile2 = @"TestData\Components\Truck.vacc";
public const string GearboxShiftPolygonFile = @"TestData\Components\ShiftPolygons.vgbs";
public const string GearboxFullLoadCurveFile = @"TestData\Components\Gearbox.vfld";
public const double Tolerance = 0.001;
[TestMethod]
......@@ -116,34 +122,19 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
private static GearboxData CreateGearboxData()
{
var gear = new GearData {
FullLoadCurve = null,
LossMap = TransmissionLossMap.ReadFromFile(GbxLossMap, 1),
Ratio = 6.38,
ShiftPolygon = null
};
var flc = FullLoadCurve.ReadFromFile(GearboxFullLoadCurveFile);
var lm = TransmissionLossMap.ReadFromFile(GbxLossMap, 1);
var sp = ShiftPolygon.ReadFromFile(GearboxShiftPolygonFile);
var ratios = new[] { 6.38, 4.63, 3.44, 2.59, 1.86, 1.35, 1, 0.76 };
return new GearboxData {
Gears =
new Dictionary<uint, GearData> {
{ 1, gear },
{ 2, gear },
{ 3, gear },
{ 4, gear },
{ 5, gear },
{ 6, gear },
{ 7, gear },
{ 8, gear }
},
ratios.Select(
(g, i) => Tuple.Create((uint)i, new GearData { FullLoadCurve = flc, LossMap = lm, Ratio = g, ShiftPolygon = sp }))
.ToDictionary(k => k.Item1, v => v.Item2),
ShiftTime = 2.SI<Second>()
};
//return new GearboxData {
// FullLoadCurve = null,
// LossMap = TransmissionLossMap.ReadFromFile(GbxLossMap, 3.0 * 3.5),
// Ratio = null,
// ShiftPolygon = null
//};
}
......
n [U/min],Mfull [Nm],Mdrag [Nm],<PT1> [s]
560,1180,-149,0.6
600,1282,-148,0.6
799.9999999,1791,-149,0.6
1000,2300,-160,0.6
1200,2300,-179,0.6
1400,2300,-203,0.6
1599.999999,2079,-235,0.49
1800,1857,-264,0.25
2000.000001,1352,-301,0.25
2100,1100,-320,0.25
......@@ -147,6 +147,9 @@
<None Include="TestData\Components\12t Delivery Truck.vveh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Components\Gearbox.vfld">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Components\24t Coach Engine.vfld">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......@@ -202,9 +205,7 @@
<None Include="TestData\Components\FullLoadCurve insufficient entries.vfld">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Components\Indirect Gear.vtlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Components\Indirect Gear.vtlm" />
<None Include="TestData\Components\Retarder.vrlm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment