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

Skip to content
Snippets Groups Projects
Commit 8b0fc7b5 authored by Harald Martini's avatar Harald Martini
Browse files

made NextRun virtual

parent 1922d851
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl { ...@@ -65,7 +65,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl {
//} //}
} }
public IEnumerable<VectoRunData> NextRun() public virtual IEnumerable<VectoRunData> NextRun()
{ {
Initialize(); Initialize();
......
...@@ -135,7 +135,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -135,7 +135,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
#region Implementation of IVectoRunDataFactory #region Implementation of IVectoRunDataFactory
public IEnumerable<VectoRunData> NextRun() public override IEnumerable<VectoRunData> NextRun()
{ {
Initialize(); Initialize();
if (Report != null) if (Report != null)
...@@ -214,7 +214,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -214,7 +214,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
} }
} }
protected override void SetGearboxAndGearshiftData(IVehicleDeclarationInputData vehicle, AxleGearData axleGearData, AngledriveData angledriveData) protected override void SetGearboxAndGearshiftData(IVehicleDeclarationInputData vehicle,
AxleGearData axleGearData, AngledriveData angledriveData)
{ {
} }
......
...@@ -6,7 +6,10 @@ using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; ...@@ -6,7 +6,10 @@ using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter;
using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents;
using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data; 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.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Impl.Shiftstrategies;
using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData;
namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDataFactory namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDataFactory
...@@ -46,7 +49,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -46,7 +49,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
if (vehicle.OvcHev) { if (vehicle.OvcHev) {
yield return CreateVectoRunData(vehicle, mission, loading, modeIdx, VectoRunData.OvcHevMode.ChargeDepleting); yield return CreateVectoRunData(vehicle, mission, loading, modeIdx, VectoRunData.OvcHevMode.ChargeDepleting);
yield return CreateVectoRunData(vehicle, mission, loading, modeIdx, VectoRunData.OvcHevMode.ChargeSustaining); yield return CreateVectoRunData(vehicle, mission, loading, modeIdx, VectoRunData.OvcHevMode.ChargeSustaining);
} else { } else {
yield return CreateVectoRunData(vehicle, mission, loading, modeIdx); yield return CreateVectoRunData(vehicle, mission, loading, modeIdx);
} }
...@@ -54,23 +56,16 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -54,23 +56,16 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
} }
} }
} }
protected override VectoRunData CreateVectoRunData(IVehicleDeclarationInputData vehicle,
Mission mission,
KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading,
int? modeIdx,
VectoRunData.OvcHevMode ovcMode = VectoRunData.OvcHevMode.NotApplicable)
{
throw new NotImplementedException();
}
#endregion #endregion
} }
public class SerialHybrid : Hybrid public class SerialHybrid : Hybrid
{ {
public SerialHybrid(IDeclarationInputDataProvider dataProvider, IDeclarationReport report, ILorryDeclarationDataAdapter declarationDataAdapter) : base(dataProvider, report, declarationDataAdapter) { } public SerialHybrid(IDeclarationInputDataProvider dataProvider, IDeclarationReport report,
ILorryDeclarationDataAdapter declarationDataAdapter) : base(dataProvider, report,
declarationDataAdapter) { }
#region Overrides of Hybrid #region Overrides of Hybrid
...@@ -80,27 +75,61 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -80,27 +75,61 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
int? modeIdx, int? modeIdx,
VectoRunData.OvcHevMode ovcMode = VectoRunData.OvcHevMode.NotApplicable) VectoRunData.OvcHevMode ovcMode = VectoRunData.OvcHevMode.NotApplicable)
{ {
_segment = GetSegment(InputDataProvider.JobInputData.Vehicle, false);
var engine = InputDataProvider.JobInputData.Vehicle.Components.EngineInputData; var engine = InputDataProvider.JobInputData.Vehicle.Components.EngineInputData;
var engineModes = engine.EngineModes; var engineModes = engine.EngineModes;
var engineMode = engineModes[modeIdx.Value]; var engineMode = engineModes[modeIdx.Value];
var runData = CreateCommonRunData(vehicle, mission, loading, _segment, engineModes, modeIdx.Value); var runData = CreateCommonRunData(vehicle, mission, loading, _segment, engineModes, modeIdx.Value);
runData.DriverData = DataAdapter.CreateDriverData(_segment);
runData.AirdragData =
DataAdapter.CreateAirdragData(vehicle.Components.AirdragInputData, mission, _segment);
runData.VehicleData = DataAdapter.CreateVehicleData(vehicle, _segment, mission, loading, _allowVocational); runData.VehicleData = DataAdapter.CreateVehicleData(vehicle, _segment, mission, loading, _allowVocational);
runData.EngineData = DataAdapter.CreateEngineData(vehicle, engineMode, mission); runData.EngineData = DataAdapter.CreateEngineData(vehicle, engineMode, mission);
runData.BatteryData = DataAdapter.CreateBatteryData(vehicle.Components.ElectricStorage, vehicle.VehicleType, vehicle.OvcHev); DataAdapter.CreateREESSData(vehicle.Components.ElectricStorage, vehicle.VehicleType, vehicle.OvcHev,
runData.SuperCapData = DataAdapter.CreateSuperCapData(vehicle.Components.ElectricStorage); ((batteryData) => runData.BatteryData = batteryData),
runData.ElectricMachinesData = DataAdapter.CreateElectricMachines(vehicle.Components.ElectricMachines, vehicle.ElectricMotorTorqueLimits, runData.BatteryData.CalculateAverageVoltage()); ((sCdata => runData.SuperCapData = sCdata)));
runData.GearboxData = _gearboxData; runData.ElectricMachinesData = DataAdapter.CreateElectricMachines(
runData.AirdragData = _airdragData; vehicle.Components.ElectricMachines, vehicle.ElectricMotorTorqueLimits,
runData.AngledriveData = _angledriveData; runData.BatteryData.CalculateAverageVoltage());
runData.HybridStrategyParameters = DataAdapter.CreateHybridStrategy(runData.BatteryData, runData.SuperCapData); if (vehicle.Components.AxleGearInputData != null) {
runData.Aux = DataAdapter.CreateAuxiliaryData(vehicle.Components.AuxiliaryInputData, runData.AxleGearData = DataAdapter.CreateAxleGearData(vehicle.Components.AxleGearInputData);
vehicle.Components.BusAuxiliaries, }
mission.MissionType,
_segment.VehicleClass, runData.Retarder = DataAdapter.CreateRetarderData(vehicle.Components.RetarderInputData);
vehicle.Length, runData.Aux = DataAdapter.CreateAuxiliaryData(vehicle.Components.AuxiliaryInputData, null, mission.MissionType,
vehicle.Components.AxleWheels.NumSteeredAxles, _segment.VehicleClass, vehicle.Length, vehicle.Components.AxleWheels.NumSteeredAxles,
vehicle.VehicleType); VectoSimulationJobType.SerialHybridVehicle);
if (vehicle.ArchitectureID == ArchitectureID.S2) {
runData.GearshiftParameters =
DataAdapter.CreateGearshiftData(
runData.AxleGearData?.AxleGear.Ratio ?? 1.0,
null,
vehicle.Components.GearboxInputData.Type,
vehicle.Components.GearboxInputData.Gears.Count
);
var shiftStrategyName =
PowertrainBuilder.GetShiftStrategyName(vehicle.Components.GearboxInputData.Type,
vehicle.VehicleType);
runData.GearboxData = DataAdapter.CreateGearboxData(vehicle, runData,
ShiftPolygonCalculator.Create(shiftStrategyName, runData.GearshiftParameters));
} else {
runData.GearshiftParameters = new ShiftStrategyParameters()
{
StartSpeed = DeclarationData.GearboxTCU.StartSpeed,
StartAcceleration = DeclarationData.GearboxTCU.StartAcceleration
};
}
runData.HybridStrategyParameters =
DataAdapter.CreateHybridStrategy(runData.BatteryData, runData.SuperCapData, runData.VehicleData.TotalVehicleMass, ovcMode);
return runData; return runData;
} }
...@@ -114,13 +143,19 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -114,13 +143,19 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override void Initialize()
{
_segment = GetSegment(InputDataProvider.JobInputData.Vehicle, false);
}
#endregion #endregion
} }
public class ParallelHybrid : Hybrid public class ParallelHybrid : Hybrid
{ {
public ParallelHybrid(IDeclarationInputDataProvider dataProvider, IDeclarationReport report, ILorryDeclarationDataAdapter declarationDataAdapter) : base(dataProvider, report, declarationDataAdapter) { } public ParallelHybrid(IDeclarationInputDataProvider dataProvider, IDeclarationReport report,
ILorryDeclarationDataAdapter declarationDataAdapter) : base(dataProvider, report,
declarationDataAdapter) { }
#region Overrides of LorryBase #region Overrides of LorryBase
...@@ -131,6 +166,35 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa ...@@ -131,6 +166,35 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa
} }
#endregion #endregion
#region Overrides of AbstractDeclarationVectoRunDataFactory
protected override VectoRunData CreateVectoRunData(IVehicleDeclarationInputData vehicle, Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading,
int? modeIdx = null, VectoRunData.OvcHevMode ovcMode = VectoRunData.OvcHevMode.NotApplicable)
{
_segment = GetSegment(InputDataProvider.JobInputData.Vehicle, false);
var engine = InputDataProvider.JobInputData.Vehicle.Components.EngineInputData;
var engineModes = engine.EngineModes;
var engineMode = engineModes[modeIdx.Value];
var runData = CreateCommonRunData(vehicle, mission, loading, _segment, engineModes, modeIdx.Value);
return runData;
}
#region Overrides of LorryBase
protected override void Initialize()
{
}
#endregion
#endregion
} }
public class HEV_S2 : SerialHybrid public class HEV_S2 : SerialHybrid
......
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