From 4d2792f8a1d08d284028ec060e314bd04450874f Mon Sep 17 00:00:00 2001
From: "VKMTHD\\franzjosefkober" <franz.josef.kober@ivt.tugraz.at>
Date: Thu, 7 Jul 2022 15:03:06 +0200
Subject: [PATCH] added different auxiliary types

---
 .../Resources/XMLNames.Designer.cs            |   9 ++
 .../VectoCommon/Resources/XMLNames.resx       |   3 +
 .../Components/VIFAuxiliaryType.cs            | 122 ++++++++++++++++++
 .../IVIFReportFactory.cs                      |  11 +-
 .../VIFNinjectModule.cs                       |   9 ++
 5 files changed, 148 insertions(+), 6 deletions(-)

diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs
index ea9374f01b..2605505c11 100644
--- a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs
+++ b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs
@@ -1068,6 +1068,15 @@ namespace TUGraz.VectoCommon.Resources {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Clutch.
+        /// </summary>
+        public static string BusAux_Clutch {
+            get {
+                return ResourceManager.GetString("BusAux_Clutch", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to ElectricSystem.
         /// </summary>
diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.resx b/VectoCommon/VectoCommon/Resources/XMLNames.resx
index 6f82bca30b..da821037cf 100644
--- a/VectoCommon/VectoCommon/Resources/XMLNames.resx
+++ b/VectoCommon/VectoCommon/Resources/XMLNames.resx
@@ -1980,6 +1980,9 @@
   <data name="CIF_OutputDataType_Exempted_CompletedBusOutputType" xml:space="preserve">
     <value>Exempted_CompletedBusOutputType</value>
   </data>
+  <data name="BusAux_Clutch" xml:space="preserve">
+    <value>Clutch</value>
+  </data>
   <data name="ElectricMachine_P2_5GearRatios_Gear_Attr" xml:space="preserve">
     <value>gear</value>
   </data>
diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/Components/VIFAuxiliaryType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/Components/VIFAuxiliaryType.cs
index 788f992159..df2f7c169d 100644
--- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/Components/VIFAuxiliaryType.cs
+++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/Components/VIFAuxiliaryType.cs
@@ -196,4 +196,126 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF
 
 		#endregion
 	}
+
+	public class VIFAuxiliaryHevPType : VIFAuxiliaryType
+	{
+		public VIFAuxiliaryHevPType(IVIFReportFactory vifFactory) : base(vifFactory) { }
+
+
+		#region Overrides of VIFAuxiliaryHevSType
+
+		public override XElement GetElement(IDeclarationInputDataProvider inputData)
+		{
+
+			var aux = inputData.JobInputData.Vehicle.Components.BusAuxiliaries;
+			if (aux != null)
+				return null;
+
+			return new XElement(_vif + XMLNames.Component_Auxiliaries,
+				new XElement(_vif + XMLNames.ComponentDataWrapper,
+					new XAttribute(_xsi + "type", "vif:AUX_HEV-P_PrimaryBusType"),
+					new XElement(_vif + XMLNames.BusAux_Fan,
+						new XElement(_vif + XMLNames.Auxiliaries_Auxiliary_Technology, aux.FanTechnology)),
+					GetSteeringPumpElement(aux.SteeringPumpTechnology),
+					GetElectricSystem(aux.ElectricSupply),
+					GetPneumaticSystem(aux.PneumaticSupply, aux.PneumaticConsumers),
+					GetHvac(aux.HVACAux)
+				));
+
+		}
+
+		#endregion
+		
+		#region Overrides of VIFAuxiliaryHevSType
+
+		protected override XElement GetPneumaticSystem(IPneumaticSupplyDeclarationData pSupply, IPneumaticConsumersDeclarationData pConsumer)
+		{
+			return new XElement(_vif + XMLNames.BusAux_PneumaticSystem,
+				new XElement(_vif + XMLNames.Bus_SizeOfAirSupply, pSupply.CompressorSize),
+				new XElement(_vif + XMLNames.CompressorDrive, pSupply.CompressorDrive.GetLabel()),
+				new XElement(_vif + XMLNames.BusAux_Clutch, pSupply.Clutch),
+				new XElement(_vif + XMLNames.Bus_CompressorRatio, pSupply.Ratio.ToXMLFormat(3)),
+				new XElement(_vif + XMLNames.BusAux_PneumaticSystem_SmartcompressionSystem, pSupply.SmartAirCompression),
+				new XElement(_vif + XMLNames.BusAux_PneumaticSystem_SmartRegenerationSystem, pSupply.SmartRegeneration),
+				new XElement(_vif + XMLNames.Bus_AirsuspensionControl, GetXMLAirsuspensionControl(pConsumer.AirsuspensionControl)),
+				new XElement(_vif + XMLNames.BusAux_PneumaticSystem_SCRReagentDosing, pConsumer.AdBlueDosing == ConsumerTechnology.Pneumatically)
+			);
+		}
+		
+		#endregion
+	}
+
+	public class VIFAuxiliaryIEPCType : VIFAuxiliaryType
+	{
+		public VIFAuxiliaryIEPCType(IVIFReportFactory vifFactory) : base(vifFactory) { }
+
+		#region Implementation of IXmlTypeWriter
+
+		public override XElement GetElement(IDeclarationInputDataProvider inputData)
+		{
+			var aux = inputData.JobInputData.Vehicle.Components.BusAuxiliaries;
+			if (aux != null)
+				return null;
+
+			return new XElement(_vif + XMLNames.Component_Auxiliaries,
+				new XElement(_vif + XMLNames.ComponentDataWrapper,
+					new XAttribute(_xsi + "type", "vif:AUX_IEPC_PrimaryBusType"),
+					GetSteeringPumpElement(aux.SteeringPumpTechnology),
+					GetPneumaticSystem(aux.PneumaticSupply, aux.PneumaticConsumers),
+					GetHvac(aux.HVACAux)
+				));
+		}
+
+		#endregion
+		
+
+		#region Overrides of VIFAuxiliaryType
+
+		protected override XElement GetPneumaticSystem(IPneumaticSupplyDeclarationData pSupply, IPneumaticConsumersDeclarationData pConsumer)
+		{
+			return new XElement(_vif + XMLNames.BusAux_PneumaticSystem,
+				new XElement(_vif + XMLNames.CompressorDrive, pSupply.CompressorDrive.GetLabel()),
+				new XElement(_vif + XMLNames.Bus_SmartRegenerationSystem, pSupply.SmartRegeneration),
+				new XElement(_vif + XMLNames.Bus_AirsuspensionControl, GetXMLAirsuspensionControl(pConsumer.AirsuspensionControl)),
+				new XElement(_vif + XMLNames.BusAux_PneumaticSystem_SCRReagentDosing, pConsumer.AdBlueDosing == ConsumerTechnology.Pneumatically)
+			);
+		}
+
+		protected override XElement GetHvac(IHVACBusAuxiliariesDeclarationData hvac)
+		{
+			return new XElement(new XElement(_vif + XMLNames.BusAux_HVAC,
+				new XElement(_vif + XMLNames.Bus_AdjustableCoolantThermostat, hvac.AdjustableCoolantThermostat)));
+		}
+		
+		#endregion
+	}
+	
+	public class VIFAuxiliaryPEVType : VIFAuxiliaryIEPCType
+	{
+		public VIFAuxiliaryPEVType(IVIFReportFactory vifFactory) : base(vifFactory) { }
+
+
+		#region Overrides of VIFAuxiliaryType
+
+		public override XElement GetElement(IDeclarationInputDataProvider inputData)
+		{
+
+			var aux = inputData.JobInputData.Vehicle.Components.BusAuxiliaries;
+			if (aux != null)
+				return null;
+
+			return new XElement(_vif + XMLNames.Component_Auxiliaries,
+				new XElement(_vif + XMLNames.ComponentDataWrapper,
+					new XAttribute(_xsi + "type", "vif:AUX_PEV_PrimaryBusType"),
+					GetSteeringPumpElement(aux.SteeringPumpTechnology),
+					GetPneumaticSystem(aux.PneumaticSupply, aux.PneumaticConsumers),
+					GetHvac(aux.HVACAux)
+				));
+		}
+
+		#endregion
+
+
+	}
+
 }
\ No newline at end of file
diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs
index 6285119965..d7ccd5081f 100644
--- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs
+++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/IVIFReportFactory.cs
@@ -28,22 +28,22 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF
 
 		#endregion
 
-
-
+		
 		#region Components
 
 		IXmlTypeWriter GetAdasType();
 		IXmlTypeWriter GetAngelDriveType();
 		IXmlTypeWriter GetAuxiliaryType();
 		IXmlTypeWriter GetAuxiliaryHevSType();
+		IXmlTypeWriter GetAuxiliaryHevPType();
+		IXmlTypeWriter GetAuxiliaryIEPCType();
+		IXmlTypeWriter GetAuxiliaryPEVType();
 		IXmlTypeWriter GetAxlegearType();
 		IXmlTypeWriter GetAxleWheelsType();
 		IXmlTypeWriter GetBoostingLimitationsType();
 		IXmlTypeWriter GetElectricEnergyStorageType();
 		IXmlTypeWriter GetElectricMachineGENType();
-		IXmlElectricMachineSystemType GetElectricMachineSystemMeasuredType();
-		IXmlElectricMachineSystemType GetElectricMachineSystemIHPCMeasuredType();
-		IXmlElectricMachineSystemType GetElectricMachineSystemStandardValueType();
+		IXmlElectricMachineSystemType GetElectricMachineSystemType();
 		IXmlTypeWriter GetElectricMachineType();
 		IXmlTypeWriter GetElectricMotorTorqueLimitsType();
 		IXmlTypeWriter GetEngineType();
@@ -67,7 +67,6 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF
 		IReportOutputGroup GetIepcVehicleGroup();
 		IReportOutputGroup GetPEVVehicleGroup();
 
-
 		#endregion
 
 	}
diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs
index 5544628832..9a2d699776 100644
--- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs
+++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VIFNinjectModule.cs
@@ -88,6 +88,15 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF
 			Bind<IXmlTypeWriter>().To<VIFAuxiliaryHevSType>().When(AccessedViaVIFFactory)
 				.NamedLikeFactoryMethod((IVIFReportFactory f) => f.GetAuxiliaryHevSType());
 
+			Bind<IXmlTypeWriter>().To<VIFAuxiliaryHevPType>().When(AccessedViaVIFFactory)
+				.NamedLikeFactoryMethod((IVIFReportFactory f) => f.GetAuxiliaryHevPType());
+
+			Bind<IXmlTypeWriter>().To<VIFAuxiliaryIEPCType>().When(AccessedViaVIFFactory)
+				.NamedLikeFactoryMethod((IVIFReportFactory f) => f.GetAuxiliaryIEPCType());
+
+			Bind<IXmlTypeWriter>().To<VIFAuxiliaryPEVType>().When(AccessedViaVIFFactory)
+				.NamedLikeFactoryMethod((IVIFReportFactory f) => f.GetAuxiliaryPEVType());
+
 			Bind<IXmlTypeWriter>().To<VIFAxlegearType>().When(AccessedViaVIFFactory)
 				.NamedLikeFactoryMethod((IVIFReportFactory f) => f.GetAxlegearType());
 
-- 
GitLab