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

Skip to content
Snippets Groups Projects
Commit 63dca4b8 authored by Raphael LUZ's avatar Raphael LUZ
Browse files

First empty clutch implementation

parent 819c2dc9
No related branches found
No related tags found
No related merge requests found
using TUGraz.VectoCore.Models.Connector.Ports;
namespace TUGraz.VectoCore.Models.SimulationComponent
{
public interface IClutch : IInShaft, IOutShaft {}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
public class Clutch:VectoSimulationComponent, IClutch,ITnOutPort,ITnInPort
{
public Clutch(IVehicleContainer cockpit, CombustionEngineData engineData) : base(cockpit)
{
//engineData.IdleSpeed;
//engineData.GetFullLoadCurve(0).RatedSpeed();
}
public override void CommitSimulationStep(IModalDataWriter writer)
{
throw new NotImplementedException();
}
public ITnInPort InShaft()
{
throw new NotImplementedException();
}
public ITnOutPort OutShaft()
{
throw new NotImplementedException();
}
public IResponse Request(TimeSpan absTime, TimeSpan dt, NewtonMeter torque, RadianPerSecond angularVelocity)
{
throw new NotImplementedException();
}
public void Connect(ITnOutPort other)
{
throw new NotImplementedException();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
......@@ -127,6 +127,8 @@
<Compile Include="Models\SimulationComponent\Data\DrivingCycleData.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\FuelConsumptionMap.cs" />
<Compile Include="Models\SimulationComponent\Data\Engine\FullLoadCurve.cs" />
<Compile Include="Models\SimulationComponent\IClutch.cs" />
<Compile Include="Models\SimulationComponent\Impl\Clutch.cs" />
<Compile Include="Utils\Formulas.cs" />
<Compile Include="Utils\IntExtensionMethods.cs" />
<Compile Include="Utils\SI.cs" />
......
......@@ -2,6 +2,7 @@ using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
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.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.Tests.Utils;
......@@ -32,8 +33,8 @@ namespace TUGraz.VectoCore.Tests.Integration.EngineOnlyCycle
var engine = new CombustionEngine(vehicle, engineData);
aux.Connect(engine);
gearbox.Connect(aux);
aux.InShaft().Connect(engine.OutShaft());
gearbox.Connect(aux.OutShaft());
var port = aux.OutShaft();
// IVectoJob job = SimulationFactory.CreateTimeBasedEngineOnlyJob(TestContext.DataRow["EngineFile"].ToString(),
......
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
{
[TestClass]
public class ClutchTest
{
private const string CoachEngine = @"TestData\Components\24t Coach.veng";
[TestMethod]
public void TestClutch()
{
var vehicle = new VehicleContainer();
var engineData = CombustionEngineData.ReadFromFile(CoachEngine);
var clutch = new Clutch(vehicle, engineData);
ITnInPort inPort = clutch.InShaft();
var outPort = new MockTnOutPort();
inPort.Connect(outPort);
ITnOutPort clutchOutPort = clutch.OutShaft();
clutchOutPort.Request(new TimeSpan(), new TimeSpan(), 100.SI<NewtonMeter>(), 100.0.RPMtoRad());
Assert.AreEqual(0, (double)outPort.Torque,0.001);
Assert.AreEqual(0, (double)outPort.AngularFrequency, 0.001);
}
}
}
......@@ -72,6 +72,7 @@
<Compile Include="Integration\EngineOnlyCycle\EngineOnlyCycleTest.cs" />
<Compile Include="Models\SimulationComponentData\FuelConsumptionMapTest.cs" />
<Compile Include="Models\SimulationComponentData\FullLoadCurveTest.cs" />
<Compile Include="Models\SimulationComponent\ClutchTest.cs" />
<Compile Include="Models\SimulationComponent\CombustionEngineTest.cs" />
<Compile Include="Models\Simulation\DrivingCycleTests.cs" />
<Compile Include="Models\SimulationComponent\MockPorts.cs" />
......
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