Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 3449b78d authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

make it compile, fix some testcases after merge

parent 534b9261
No related branches found
No related tags found
No related merge requests found
Showing
with 68 additions and 13 deletions
...@@ -258,6 +258,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ...@@ -258,6 +258,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return _axleWheelsDecl; } get { return _axleWheelsDecl; }
} }
public IBusAuxiliariesDeclarationData BusAuxiliaries
{
get { return null; }
}
public IElectricStorageEngineeringInputData ElectricStorage public IElectricStorageEngineeringInputData ElectricStorage
{ {
get get
......
...@@ -634,7 +634,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ...@@ -634,7 +634,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public virtual ACCompressorType CompressorTypeDriver { get { return ACCompressorType.Unknown; } } public virtual ACCompressorType CompressorTypeDriver { get { return ACCompressorType.Unknown; } }
public virtual ACCompressorType CompressorTypePassenger { get { return ACCompressorType.Unknown; } } public virtual ACCompressorType CompressorTypePassenger { get { return ACCompressorType.Unknown; } }
public virtual Watt AuxHeaterPower { get { return null; } } public virtual Watt AuxHeaterPower { get { return null; } }
public virtual bool DoubleGlasing { get { return false; } } public virtual bool DoubleGlazing { get { return false; } }
public virtual bool HeatPump { get { return false; } } public virtual bool HeatPump { get { return false; } }
public virtual bool AdjustableCoolantThermostat { get { return Body["Aux"]?["HVAC"]?.GetEx<bool>("AdjustableCoolantThermostat") ?? false; } } public virtual bool AdjustableCoolantThermostat { get { return Body["Aux"]?["HVAC"]?.GetEx<bool>("AdjustableCoolantThermostat") ?? false; } }
public virtual bool AdjustableAuxiliaryHeater { get { return false; } } public virtual bool AdjustableAuxiliaryHeater { get { return false; } }
......
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.ComponentData;
using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter;
using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
namespace TUGraz.VectoCore.InputData.Reader.Impl namespace TUGraz.VectoCore.InputData.Reader.Impl
{ {
...@@ -58,7 +60,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl ...@@ -58,7 +60,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
Cycle = new DrivingCycleProxy( Cycle = new DrivingCycleProxy(
DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, false), cycle.Name), DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, false), cycle.Name),
ExecutionMode = ExecutionMode.Engineering, ExecutionMode = ExecutionMode.Engineering,
SimulationType = SimulationType.EngineOnly SimulationType = SimulationType.EngineOnly,
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
yield return simulationRunData; yield return simulationRunData;
} }
......
...@@ -39,6 +39,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies ...@@ -39,6 +39,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
public Second GearshiftTriggerTstmp { get; set; } public Second GearshiftTriggerTstmp { get; set; }
} }
public class DryRunSolutionState
{
public DryRunSolutionState(DrivingAction drivingAction, HybridResultEntry setting)
{
DrivingAction = drivingAction;
Solution = setting;
}
public DrivingAction DrivingAction { get; set; }
public HybridResultEntry Solution { get; set; }
}
private VectoRunData ModelData; private VectoRunData ModelData;
private IDataBus DataBus; private IDataBus DataBus;
...@@ -63,6 +76,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies ...@@ -63,6 +76,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
protected DebugData DebugData = new DebugData(); protected DebugData DebugData = new DebugData();
private WattSecond BatteryDischargeEnergyThreshold; private WattSecond BatteryDischargeEnergyThreshold;
protected DryRunSolutionState DryRunSolution;
public HybridStrategy(VectoRunData runData, IVehicleContainer vehicleContainer) public HybridStrategy(VectoRunData runData, IVehicleContainer vehicleContainer)
{ {
DataBus = vehicleContainer; DataBus = vehicleContainer;
...@@ -133,6 +148,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies ...@@ -133,6 +148,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
public virtual HybridStrategyResponse Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, bool dryRun) public virtual HybridStrategyResponse Request(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, bool dryRun)
{ {
var currentGear = PreviousState.GearboxEngaged ? DataBus.GearboxInfo.Gear : Controller.ShiftStrategy.NextGear.Gear; var currentGear = PreviousState.GearboxEngaged ? DataBus.GearboxInfo.Gear : Controller.ShiftStrategy.NextGear.Gear;
if (DryRunSolution != null && DryRunSolution.DrivingAction == DataBus.DriverInfo.DrivingAction) {
return CreateResponse(DryRunSolution.Solution, currentGear);
}
if (DryRunSolution != null && DryRunSolution.DrivingAction != DataBus.DriverInfo.DrivingAction) {
DryRunSolution = null;
}
var eval = new List<HybridResultEntry>(); var eval = new List<HybridResultEntry>();
switch (DataBus.DriverInfo.DrivingAction) { switch (DataBus.DriverInfo.DrivingAction) {
...@@ -179,9 +203,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies ...@@ -179,9 +203,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
if (!DataBus.EngineCtl.CombustionEngineOn && !best.ICEOff && !retVal.ShiftRequired) { if (!DataBus.EngineCtl.CombustionEngineOn && !best.ICEOff && !retVal.ShiftRequired) {
CurrentState.ICEStartTStmp = absTime; CurrentState.ICEStartTStmp = absTime;
} }
DryRunSolution = new DryRunSolutionState(DataBus.DriverInfo.DrivingAction, best);
} }
if (retVal.ShiftRequired) { if (retVal.ShiftRequired) {
DryRunSolution = null;
CurrentState.GearshiftTriggerTstmp = absTime; CurrentState.GearshiftTriggerTstmp = absTime;
} }
...@@ -1207,6 +1233,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies ...@@ -1207,6 +1233,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies
CurrentState.ICEStartTStmp = PreviousState.ICEStartTStmp; CurrentState.ICEStartTStmp = PreviousState.ICEStartTStmp;
CurrentState.GearshiftTriggerTstmp = PreviousState.GearshiftTriggerTstmp; CurrentState.GearshiftTriggerTstmp = PreviousState.GearshiftTriggerTstmp;
DebugData = new DebugData(); DebugData = new DebugData();
DryRunSolution = null;
} }
public void WriteModalResults(Second time, Second simulationInterval, IModalDataContainer container) public void WriteModalResults(Second time, Second simulationInterval, IModalDataContainer container)
......
...@@ -377,7 +377,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric ...@@ -377,7 +377,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
//GearboxData = gearboxData, //GearboxData = gearboxData,
VehicleData = vehicleData, VehicleData = vehicleData,
AirdragData = airdragData, AirdragData = airdragData,
JobName = modFileName, JobName = Path.GetFileNameWithoutExtension(modFileName),
Cycle = cycleData, Cycle = cycleData,
Retarder = new RetarderData() { Type = RetarderType.None }, Retarder = new RetarderData() { Type = RetarderType.None },
Aux = new List<VectoRunData.AuxData>(), Aux = new List<VectoRunData.AuxData>(),
...@@ -640,7 +640,8 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric ...@@ -640,7 +640,8 @@ namespace TUGraz.VectoCore.Tests.Integration.BatteryElectric
public PerSecond EngineSpeed public PerSecond EngineSpeed
{ {
get { return null; } get;
set;
} }
public NewtonMeter EngineTorque public NewtonMeter EngineTorque
{ {
......
...@@ -51,6 +51,7 @@ using TUGraz.VectoCore.Tests.Utils; ...@@ -51,6 +51,7 @@ using TUGraz.VectoCore.Tests.Utils;
using TUGraz.VectoCore.Utils; using TUGraz.VectoCore.Utils;
using Wheels = TUGraz.VectoCore.Models.SimulationComponent.Impl.Wheels; using Wheels = TUGraz.VectoCore.Models.SimulationComponent.Impl.Wheels;
using NUnit.Framework; using NUnit.Framework;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.InputData.Reader.Impl;
namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
...@@ -92,7 +93,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns ...@@ -92,7 +93,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
GearboxData = gearboxData, GearboxData = gearboxData,
VehicleData = vehicleData, VehicleData = vehicleData,
AirdragData = airDragData, AirdragData = airDragData,
SimulationType = SimulationType.DistanceCycle SimulationType = SimulationType.DistanceCycle,
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
var fileWriter = new FileOutputWriter("Coach_FullPowertrain_SimpleGearbox"); var fileWriter = new FileOutputWriter("Coach_FullPowertrain_SimpleGearbox");
var modData = new ModalDataContainer(runData, fileWriter, null); var modData = new ModalDataContainer(runData, fileWriter, null);
...@@ -161,7 +163,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns ...@@ -161,7 +163,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
AxleGearData = axleGearData, AxleGearData = axleGearData,
GearboxData = gearboxData, GearboxData = gearboxData,
AirdragData = airDragData, AirdragData = airDragData,
SimulationType = SimulationType.DistanceCycle SimulationType = SimulationType.DistanceCycle,
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
var fileWriter = new FileOutputWriter("Coach_FullPowertrain"); var fileWriter = new FileOutputWriter("Coach_FullPowertrain");
var modData = new ModalDataContainer(runData, fileWriter, null); var modData = new ModalDataContainer(runData, fileWriter, null);
...@@ -243,7 +246,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns ...@@ -243,7 +246,8 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns
VehicleData = vehicleData, VehicleData = vehicleData,
AxleGearData = axleGearData, AxleGearData = axleGearData,
GearboxData = gearboxData, GearboxData = gearboxData,
AirdragData = airDragData AirdragData = airDragData,
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
var fileWriter = new FileOutputWriter("Coach_FullPowertrain_LowSpeed"); var fileWriter = new FileOutputWriter("Coach_FullPowertrain_LowSpeed");
var modData = new ModalDataContainer(runData, fileWriter, null); var modData = new ModalDataContainer(runData, fileWriter, null);
......
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using System;
using NUnit.Framework; using NUnit.Framework;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.JSON;
...@@ -268,7 +270,8 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation ...@@ -268,7 +270,8 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineStopStart.ActivationDelay, EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineStopStart.ActivationDelay,
MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan
} }
} },
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
// call builder (actual test) // call builder (actual test)
...@@ -351,7 +354,8 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation ...@@ -351,7 +354,8 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor, UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor,
MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan, MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan,
} }
} },
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
}; };
// call builder (actual test) // call builder (actual test)
......
...@@ -41,6 +41,7 @@ using TUGraz.VectoCore.Models.Simulation.Impl; ...@@ -41,6 +41,7 @@ using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent; using TUGraz.VectoCore.Models.SimulationComponent;
using TUGraz.VectoCore.Models.SimulationComponent.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Impl;
using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.Tests.Integration.BatteryElectric;
using TUGraz.VectoCore.Tests.Utils; using TUGraz.VectoCore.Tests.Utils;
using TUGraz.VectoCore.Utils; using TUGraz.VectoCore.Utils;
...@@ -80,6 +81,9 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent ...@@ -80,6 +81,9 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
var clutch = new Clutch(container, engineData) { IdleController = new MockIdleController() }; var clutch = new Clutch(container, engineData) { IdleController = new MockIdleController() };
var brakes = new Brakes(container) { BrakePower = 0.SI<Watt>() }; var brakes = new Brakes(container) { BrakePower = 0.SI<Watt>() };
var vehicle = new MockVehicle(container) { MyVehicleSpeed = 50.KMPHtoMeterPerSecond() }; var vehicle = new MockVehicle(container) { MyVehicleSpeed = 50.KMPHtoMeterPerSecond() };
var engine = new MockEngineInfo(container) {
EngineSpeed = 800.RPMtoRad()
};
var inPort = clutch.InPort(); var inPort = clutch.InPort();
var outPort = new MockTnOutPort(); var outPort = new MockTnOutPort();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
...@@ -49,6 +50,7 @@ using TUGraz.VectoCore.OutputData.FileIO; ...@@ -49,6 +50,7 @@ using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Tests.Utils; using TUGraz.VectoCore.Tests.Utils;
using Wheels = TUGraz.VectoCore.Models.SimulationComponent.Impl.Wheels; using Wheels = TUGraz.VectoCore.Models.SimulationComponent.Impl.Wheels;
using NUnit.Framework; using NUnit.Framework;
using TUGraz.VectoCommon.InputData;
namespace TUGraz.VectoCore.Tests.Models.SimulationComponent namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
{ {
...@@ -226,6 +228,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent ...@@ -226,6 +228,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
RunData = new VectoRunData() { RunData = new VectoRunData() {
VehicleData = vehicleData, VehicleData = vehicleData,
EngineData = engineData, EngineData = engineData,
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
} }
}; };
......
...@@ -33,6 +33,7 @@ using System; ...@@ -33,6 +33,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.ComponentData;
...@@ -107,6 +108,9 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent ...@@ -107,6 +108,9 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
double expected) double expected)
{ {
var container = new VehicleContainer(ExecutionMode.Declaration); var container = new VehicleContainer(ExecutionMode.Declaration);
container.RunData = new VectoRunData() {
ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>()
};
var vehicleData = MockSimulationDataFactory.CreateVehicleDataFromFile(VehicleDataFileTruck); var vehicleData = MockSimulationDataFactory.CreateVehicleDataFromFile(VehicleDataFileTruck);
var airdragData = MockSimulationDataFactory.CreateAirdragDataFromFile(VehicleDataFileTruck); var airdragData = MockSimulationDataFactory.CreateAirdragDataFromFile(VehicleDataFileTruck);
......
SoC, Ri SoC, Ri
0, 0.04 0, 0.4986666
100, 0.04 100, 0.4986666
\ No newline at end of file \ No newline at end of file
...@@ -163,7 +163,7 @@ namespace TUGraz.VectoCore.Tests.Utils ...@@ -163,7 +163,7 @@ namespace TUGraz.VectoCore.Tests.Utils
{ {
var dao = new EngineeringDataAdapter(); var dao = new EngineeringDataAdapter();
var vehicleInput = JSONInputDataFactory.ReadJsonVehicle(vehicleDataFile, null); var vehicleInput = JSONInputDataFactory.ReadJsonVehicle(vehicleDataFile, null);
var airdragData = vehicleInput as IAirdragEngineeringInputData; var airdragData = vehicleInput.Components.AirdragInputData as IAirdragEngineeringInputData;
return dao.CreateAirdragData(airdragData, vehicleInput); return dao.CreateAirdragData(airdragData, vehicleInput);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment