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

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

updated conditioning

parent 4fc0733a
No related branches found
No related tags found
No related merge requests found
......@@ -82,8 +82,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl.Auxiliaries
public Watt GetPEV_SHEV_PowerDemand(IDataBus dataBus)
{
var elInfo = GetElectricMotorInfo(dataBus);
if (!elInfo.EmOff || EPTOOn(dataBus)) {
var oneEmOn = dataBus.GetElectricMotors().Any(elInfo => !elInfo.EmOff);
if (oneEmOn || EPTOOn(dataBus)) {
return _electricPowerDemand;
} else {
return 0.SI<Watt>();
......@@ -94,7 +94,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl.Auxiliaries
{
double xFactor = 0;
var elInfo = GetElectricMotorInfo(dataBus);
var elInfo = dataBus.GetElectricMotors().Single();
if (!elInfo.EmOff)
{
var iceInfo = dataBus.EngineInfo;
......@@ -106,19 +106,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl.Auxiliaries
return _electricPowerDemand * xFactor;
}
private IElectricMotorInfo GetElectricMotorInfo(IDataBus dataBus)
{
try
{
return dataBus.ElectricMotorInfo(dataBus.PowertrainInfo.ElectricMotorPositions.Single());
}
catch (Exception ex)
{
throw new VectoException("Only one electric motor position supported");
}
}
}
......
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