From b2b6a83af39192f0988f80d291aad1f2e2c48be4 Mon Sep 17 00:00:00 2001 From: "VKMTHD\\haraldmartini" <harald.martini@student.tugraz.at> Date: Tue, 6 Dec 2022 14:47:28 +0100 Subject: [PATCH] updated conditioning --- .../Impl/Auxiliaries/Conditioning.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Auxiliaries/Conditioning.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Auxiliaries/Conditioning.cs index 2216f1013f..4d30ffaa41 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Auxiliaries/Conditioning.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Auxiliaries/Conditioning.cs @@ -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"); - } - - } } -- GitLab