Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

pwheel cycle with cyclegearbox

parent 9f187b61
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Linq;
using TUGraz.VectoCore.Exceptions;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Simulation.Data;
......@@ -79,10 +80,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
{
var container = new VehicleContainer(_modData, _sumWriter, ExecutionMode.Engineering);
data.GearboxData.Type = GearboxType.DrivingCycle;
var gearbox = GetGearbox(container, data.GearboxData);
var gearbox = new CycleGearbox(container, data.GearboxData);
var cycle = new PWheelCycle(container, data.Cycle, data.AxleGearData.AxleGear.Ratio, (Gearbox)gearbox);
var cycle = new PWheelCycle(container, data.Cycle, data.AxleGearData.AxleGear.Ratio,
gearbox.ModelData.Gears.ToDictionary(g => g.Key, g => g.Value.Ratio));
var tmp = AddComponent(cycle, new AxleGear(container, data.AxleGearData));
......@@ -185,7 +186,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
new Wheels(container, data.VehicleData.DynamicTyreRadius, data.VehicleData.WheelsInertia));
var brakes = AddComponent(wheels, new Brakes(container));
var tmp = AddComponent(brakes, new AxleGear(container, data.AxleGearData));
var gearbox = new CycleGearbox(container, data.GearboxData);
switch (data.Retarder.Type) {
......@@ -325,9 +326,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
case GearboxType.Custom:
strategy = new CustomShiftStrategy(data, container);
break;
case GearboxType.DrivingCycle:
strategy = new PWheelShiftStrategy(data, container);
break;
default:
throw new VectoSimulationException("Unknown Gearbox Type: {0}", data.Type);
}
......
......@@ -189,23 +189,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
/// </summary>
public class PWheelCycle : PowertrainDrivingCycle, IDriverInfo, IClutchInfo
{
public Gearbox Gearbox { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="PWheelCycle"/> class.
/// </summary>
/// <param name="container">The container.</param>
/// <param name="cycle">The cycle.</param>
/// <param name="axleRatio">The axle ratio.</param>
/// <param name="gearbox"></param>
public PWheelCycle(IVehicleContainer container, DrivingCycleData cycle, double axleRatio, Gearbox gearbox)
public PWheelCycle(IVehicleContainer container, DrivingCycleData cycle, double axleRatio,
Dictionary<uint, double> ratios)
: base(container, cycle)
{
Gearbox = gearbox;
foreach (var entry in Data.Entries) {
entry.AngularVelocity = entry.AngularVelocity /
(axleRatio * (entry.Gear == 0 ? 1 : Gearbox.ModelData.Gears[entry.Gear].Ratio));
(axleRatio * (entry.Gear == 0 ? 1 : ratios[entry.Gear]));
entry.Torque = entry.PWheel / entry.AngularVelocity;
}
}
......@@ -216,8 +212,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return new ResponseCycleFinished { Source = this };
}
Gearbox.Gear = LeftSample.Current.Gear;
Gearbox.Disengaged = LeftSample.Current.Gear == 0;
return base.Request(absTime, dt);
}
......
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