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

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

implemented overrides in APTN for easier debugging

parent bd1017c6
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,10 @@ using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Connector.Ports;
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
......@@ -19,6 +21,21 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
ModelData.TractionInterruption = 0.SI<Second>();
}
public override void CommitSimulationStep(Second time, Second simulationInterval, IModalDataContainer container)
{
base.CommitSimulationStep(time, simulationInterval, container);
}
public override void Connect(ITnOutPort other)
{
base.Connect(other);
}
public override bool GearEngaged(Second absTime)
{
return base.GearEngaged(absTime);
}
public override IResponse Initialize(NewtonMeter outTorque, PerSecond outAngularVelocity)
{
var absTime = 0.SI<Second>();
......@@ -47,6 +64,29 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response;
}
public override IResponse Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, bool dryRun = false)
{
var response = base.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
if (response is ResponseGearShift) {
response = base.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
}
return response;
}
public override void TriggerGearshift(Second absTime, Second dt)
{
base.TriggerGearshift(absTime, dt);
}
protected override void DoCommitSimulationStep(Second time, Second simulationInterval)
{
base.DoCommitSimulationStep(time, simulationInterval);
}
protected override void DoWriteModalResults(Second time, Second simulationInterval, IModalDataContainer container)
{
base.DoWriteModalResults(time, simulationInterval, container);
}
protected internal override ResponseDryRun Initialize(Second absTime, GearshiftPosition gear,
NewtonMeter outTorque, PerSecond outAngularVelocity)
......@@ -65,7 +105,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
var response = NextComponent.Request(absTime, Constants.SimulationSettings.TargetTimeInterval, inTorque, inAngularVelocity, true);
var eMotor = DataBus.ElectricMotorInfo(DataBus.PowertrainInfo.ElectricMotorPositions[0]);
var fullLoad = -eMotor.MaxPowerDrive(DataBus.BatteryInfo.InternalVoltage, inAngularVelocity);
......
using TUGraz.VectoCore.Models.Simulation;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Simulation;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
......@@ -7,5 +9,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public APTNShiftStrategy(IVehicleContainer dataBus) : base(dataBus) { }
public new static string Name => "APT-N";
protected override GearshiftPosition CheckEarlyDownshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, GearshiftPosition currentGear, IResponse resp)
{
return base.CheckEarlyDownshift(absTime, dt, outTorque, outAngularVelocity, currentGear, resp);
}
protected override GearshiftPosition CheckEarlyUpshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, GearshiftPosition currentGear, IResponse resp)
{
return base.CheckEarlyUpshift(absTime, dt, outTorque, outAngularVelocity, currentGear, resp);
}
protected override GearshiftPosition DoCheckUpshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, NewtonMeter inTorque, PerSecond inAngularVelocity, GearshiftPosition currentGear, IResponse r)
{
return base.DoCheckUpshift(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, currentGear, r);
}
}
}
\ No newline at end of file
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