diff --git a/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs b/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs index 771e98437feba87b02147df69b2b181a45dbd458..911df16a567262016d7318f8c47b5166da2b3a95 100644 --- a/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs +++ b/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs @@ -1,4 +1,5 @@ -using System.Text.RegularExpressions; +using System; +using System.Text.RegularExpressions; using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCommon.BusAuxiliaries { @@ -14,6 +15,7 @@ namespace TUGraz.VectoCommon.BusAuxiliaries { Configuration7, Configuration8, Configuration9, + Configuration10, } public static class BusHVACSystemConfigurationHelper @@ -52,5 +54,28 @@ namespace TUGraz.VectoCommon.BusAuxiliaries { return GetName(hvacConfiguration); } + public static bool RequiresDriverAC(this BusHVACSystemConfiguration hvacConfig) + { + switch (hvacConfig) { + case BusHVACSystemConfiguration.Configuration2: + case BusHVACSystemConfiguration.Configuration4: + case BusHVACSystemConfiguration.Configuration7: + case BusHVACSystemConfiguration.Configuration9: + return true; + } + + return false; + } + + public static bool RequiresPassengerAC(this BusHVACSystemConfiguration hvacConfig) + { + switch (hvacConfig) { + case BusHVACSystemConfiguration.Configuration1: + case BusHVACSystemConfiguration.Configuration2: + return false; + } + + return true; + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs index 0b37fb87beeb0c03e1e0d0651271b59d5979701c..f2562ff750a83fac2a93942ea6fa2f588cfaf87b 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs @@ -181,6 +181,15 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter { var isDoubleDecker = completedVehicle.VehicleCode.IsDoubleDeckerBus(); var hvacConfiguration = completedVehicle.Components.BusAuxiliaries.HVACAux.SystemConfiguration; + var busAux = completedVehicle.Components.BusAuxiliaries.HVACAux; + + if (hvacConfiguration.RequiresDriverAC() && (busAux.CompressorTypeDriver == ACCompressorType.None || busAux.CompressorTypeDriver == ACCompressorType.Unknown)) { + throw new VectoException("HVAC System Configuration {0} requires DriverAC Technology", hvacConfiguration); + } + + if (hvacConfiguration.RequiresPassengerAC() && (busAux.CompressorTypePassenger == ACCompressorType.None || busAux.CompressorTypePassenger == ACCompressorType.Unknown)) { + throw new VectoException("HVAC System Configuration {0} requires PassengerAC Technology", hvacConfiguration); + } var internalLength = hvacConfiguration == BusHVACSystemConfiguration.Configuration2 ? 2 * Constants.BusParameters.DriverCompartmentLength // OK @@ -196,7 +205,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var coolingPower = CalculateMaxCoolingPower(completedVehicle, primaryVehicle, mission); - var busAux = completedVehicle.Components.BusAuxiliaries.HVACAux; + var floorType = completedVehicle.VehicleCode.GetFloorType(); var ssmInputs =GetDefaulSSMInputs(FuelData.Diesel); diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index a62da84fe0569c75078e1f68473e744624d12df7..15ea2fb2188b961a089fb70a1cc0d893972b1e02 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -256,6 +256,7 @@ namespace TUGraz.VectoCore.Models.Declaration case BusHVACSystemConfiguration.Configuration7: case BusHVACSystemConfiguration.Configuration8: case BusHVACSystemConfiguration.Configuration9: + case BusHVACSystemConfiguration.Configuration10: return heating ? Constants.BusAuxiliaries.SteadyStateModel.HighVentilationHeating : Constants.BusAuxiliaries.SteadyStateModel.HighVentilation;