From 36a3e65dd286e52b6904380499af6d5d5c270445 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Tue, 5 May 2020 12:10:38 +0200
Subject: [PATCH] comboboxes: limit number of allowed values to useful set, xml
 writing: generate ID

---
 VECTO3GUI/Model/AlternatorTechnologyModel.cs  | 60 +++++++++----------
 .../AuxiliariesBusComponentData.cs            | 30 ++++++----
 .../TempDataObject/VehicleBusComponentData.cs | 12 ++--
 VECTO3GUI/Util/XML/XMLCompletedBus.cs         | 12 ++--
 VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs  | 22 +++----
 .../ViewModel/Impl/AuxiliariesViewModel.cs    | 29 +++++----
 .../Impl/CompleteVehicleBusViewModel.cs       | 22 +++----
 .../ViewModel/Interfaces/IAuxiliariesBus.cs   |  4 +-
 .../Interfaces/IAuxiliariesViewModel.cs       |  2 +-
 .../ICompleteVehicleBusViewModel.cs           |  2 +-
 .../Declaration/AirdragDeclarationView.xaml   |  4 +-
 .../AuxiliariesDeclarationView.xaml           |  2 +-
 .../Declaration/CompleteVehicleBusView.xaml   |  2 +-
 .../Views/CustomControls/ComboParameter.xaml  |  5 +-
 14 files changed, 102 insertions(+), 106 deletions(-)

diff --git a/VECTO3GUI/Model/AlternatorTechnologyModel.cs b/VECTO3GUI/Model/AlternatorTechnologyModel.cs
index 010d6be42c..76c80e7b2a 100644
--- a/VECTO3GUI/Model/AlternatorTechnologyModel.cs
+++ b/VECTO3GUI/Model/AlternatorTechnologyModel.cs
@@ -8,40 +8,40 @@ using VECTO3GUI.ViewModel.Impl;
 
 namespace VECTO3GUI.Model
 {
-	public enum AlternatorTechnology
-	{
-		Empty,
-		Default
-	}
-	
-	public static class AlternatorTechnologyHelper 
-	{
-		public static string GetLabel(this AlternatorTechnology technology)
-		{
-			switch (technology) {
-				case AlternatorTechnology.Default:
-					return nameof(AlternatorTechnology.Default).ToLower();
-				default:
-					return string.Empty;
-			}
-		}
+	//public enum AlternatorTechnology
+	//{
+	//	Empty,
+	//	Default
+	//}
+
+	//public static class AlternatorTechnologyHelper 
+	//{
+	//	public static string GetLabel(this AlternatorTechnology technology)
+	//	{
+	//		switch (technology) {
+	//			case AlternatorTechnology.Default:
+	//				return nameof(AlternatorTechnology.Default).ToLower();
+	//			default:
+	//				return string.Empty;
+	//		}
+	//	}
+
+	//	public static AlternatorTechnology Parse(string technologyName)
+	//	{
+	//		switch (technologyName.ToLower()) {
+	//			case "default":
+	//				return AlternatorTechnology.Default;
+	//			default:
+	//				return AlternatorTechnology.Empty;
+	//		}
+	//	}
+	//}
 
-		public static AlternatorTechnology Parse(string technologyName)
-		{
-			switch (technologyName.ToLower()) {
-				case "default":
-					return AlternatorTechnology.Default;
-				default:
-					return AlternatorTechnology.Empty;
-			}
-		}
-	}
-	
 	public class AlternatorTechnologyModel : ObservableObject
 	{
-		public AlternatorTechnology _alternatorTechnology;
+		public string _alternatorTechnology;
 
-		public AlternatorTechnology AlternatorTechnology
+		public string AlternatorTechnology
 		{
 			get { return _alternatorTechnology; }
 			set { SetProperty(ref _alternatorTechnology, value); }
diff --git a/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs b/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs
index e855a78dac..72382e5a17 100644
--- a/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs
+++ b/VECTO3GUI/Model/TempDataObject/AuxiliariesBusComponentData.cs
@@ -12,9 +12,12 @@ namespace VECTO3GUI.Model.TempDataObject
 {
 	public class AuxiliariesBusComponentData: IAuxiliariesBus, ITempDataObject<IAuxiliariesViewModel>
 	{
+		protected const int NotSelected = -1;
+
+
 		#region IAuxiliariesBus Interface
 
-		public ObservableCollectionEx<AlternatorTechnologyModel> AlternatorTechnologies { get; set; }
+		public ObservableCollectionEx<AlternatorTechnologyModel> AlternatorTechnologies { get; }
 		public List<AlternatorTechnologyModel> OriginAlternatorTechnologies { get; private set; }
 		public bool DayrunninglightsLED { get; set; }
 		public bool HeadlightsLED { get; set; }
@@ -35,6 +38,7 @@ namespace VECTO3GUI.Model.TempDataObject
 
 		public AuxiliariesBusComponentData(IAuxiliariesViewModel viewModel, bool defaultValues)
 		{
+			AlternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>();
 			if (defaultValues)
 				ClearValues(viewModel);
 		}
@@ -51,7 +55,7 @@ namespace VECTO3GUI.Model.TempDataObject
 
 		public void ResetToComponentValues(IAuxiliariesViewModel viewModel)
 		{
-			viewModel.AlternatorTechnologies = GetAlternatorTechnology();
+			SetAlternatorTechnology(viewModel.AlternatorTechnologies);
 			viewModel.DayrunninglightsLED = DayrunninglightsLED;
 			viewModel.HeadlightsLED = HeadlightsLED;
 			viewModel.PositionlightsLED = PositionlightsLED;
@@ -65,42 +69,42 @@ namespace VECTO3GUI.Model.TempDataObject
 			viewModel.HeatPump = HeatPump;
 			viewModel.AdjustableAuxiliaryHeater = AdjustableAuxiliaryHeater;
 			viewModel.SeparateAirDistributionDucts = SeparateAirDistributionDucts;
-			viewModel.DoorDriveTechnology = viewModel.DoorDriveTechnology;
+	
 		}
 
-		private ObservableCollectionEx<AlternatorTechnologyModel> GetAlternatorTechnology()
+		private void SetAlternatorTechnology(ObservableCollectionEx<AlternatorTechnologyModel> res)
 		{
-			var res = new ObservableCollectionEx<AlternatorTechnologyModel>();
+			//var res = new ObservableCollectionEx<AlternatorTechnologyModel>();
+			res.Clear();
 			for (int i = 0; i < OriginAlternatorTechnologies.Count; i++) {
 				res.Add(new AlternatorTechnologyModel{AlternatorTechnology = OriginAlternatorTechnologies[i].AlternatorTechnology});
 			}
 
-			return res;
+			//return res;
 		}
 		
 		public void ClearValues(IAuxiliariesViewModel viewModel)
 		{
-			viewModel.AlternatorTechnologies = default(ObservableCollectionEx<AlternatorTechnologyModel>);
+			viewModel.AlternatorTechnologies.Clear(); // = default(ObservableCollectionEx<AlternatorTechnologyModel>);
 			viewModel.DayrunninglightsLED = default(bool);
 			viewModel.HeadlightsLED = default(bool);
 			viewModel.PositionlightsLED = default(bool);
 			viewModel.BrakelightsLED = default(bool);
 			viewModel.InteriorLightsLED = default(bool);
-			viewModel.SystemConfiguration = default(BusHVACSystemConfiguration);
-			viewModel.CompressorTypeDriver = default(ACCompressorType);
-			viewModel.CompressorTypePassenger = default(ACCompressorType);
+			viewModel.SystemConfiguration = (BusHVACSystemConfiguration)NotSelected;
+			viewModel.CompressorTypeDriver = (ACCompressorType)NotSelected;
+			viewModel.CompressorTypePassenger = (ACCompressorType)NotSelected;
 			viewModel.AuxHeaterPower = default(Watt);
 			viewModel.DoubleGlasing = default(bool);
 			viewModel.HeatPump = default(bool);
 			viewModel.AdjustableAuxiliaryHeater = default(bool);
 			viewModel.SeparateAirDistributionDucts = default(bool);
-			viewModel.DoorDriveTechnology = ConsumerTechnology.Pneumatically;
 		}
 		
 		private void SetValues(IAuxiliariesViewModel auxiliaries)
 		{
 			OriginAlternatorTechnologies = GetOriginAlternatorTechnologies(auxiliaries);
-			AlternatorTechnologies = GetAlternatorTechnology();
+			SetAlternatorTechnology(AlternatorTechnologies);
 			DayrunninglightsLED = auxiliaries.DayrunninglightsLED;
 			HeadlightsLED = auxiliaries.HeadlightsLED;
 			PositionlightsLED = auxiliaries.PositionlightsLED;
@@ -114,7 +118,7 @@ namespace VECTO3GUI.Model.TempDataObject
 			HeatPump = auxiliaries.HeatPump;
 			AdjustableAuxiliaryHeater = auxiliaries.AdjustableAuxiliaryHeater;
 			SeparateAirDistributionDucts = auxiliaries.SeparateAirDistributionDucts;
-			DoorDriveTechnology = auxiliaries.DoorDriveTechnology;
+			
 		}
 
 		private List<AlternatorTechnologyModel> GetOriginAlternatorTechnologies(IAuxiliariesViewModel auxiliaries)
diff --git a/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs b/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs
index 32f254bd85..6746a570b2 100644
--- a/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs
+++ b/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs
@@ -15,6 +15,8 @@ namespace VECTO3GUI.Model.TempDataObject
 {
 	public class VehicleBusComponentData : ICompleteVehicleBus, ITempDataObject<ICompleteVehicleBusViewModel>
 	{
+		protected const int NotSelected = -1;
+
 		#region ICompleteVehicleBus Interface
 
 		public string Manufacturer { get; set; }
@@ -85,12 +87,12 @@ namespace VECTO3GUI.Model.TempDataObject
 			viewModel.Model = default(string);
 			viewModel.VIN = default(string);
 			viewModel.Date = default(DateTime);
-			viewModel.LegislativeClass = default(LegislativeClass);
-			viewModel.RegisteredClass = default(RegistrationClass);
-			viewModel.VehicleCode = default(VehicleCode);
+			viewModel.LegislativeClass = (LegislativeClass)NotSelected;
+			viewModel.RegisteredClass = (RegistrationClass)NotSelected;
+			viewModel.VehicleCode = (VehicleCode)NotSelected;
 			viewModel.CurbMassChassis = default(Kilogram);
 			viewModel.TechnicalPermissibleMaximumLadenMass = default(Kilogram);
-			viewModel.NgTankSystem = default(TankSystem);
+			viewModel.NgTankSystem = (TankSystem)NotSelected;
 			viewModel.NumberOfPassengersLowerDeck = default(int);
 			viewModel.NumberOfPassengersUpperDeck = default(int);
 			viewModel.LowEntry = LowEntry;
@@ -98,7 +100,7 @@ namespace VECTO3GUI.Model.TempDataObject
 			viewModel.VehicleLength = default(Meter);
 			viewModel.VehicleWidth = default(Meter);
 			viewModel.EntranceHeight = default(Meter);
-			viewModel.DoorDriveTechnology = default(ConsumerTechnology);
+			viewModel.DoorDriveTechnology = (ConsumerTechnology)NotSelected;
 		}
 
 		
diff --git a/VECTO3GUI/Util/XML/XMLCompletedBus.cs b/VECTO3GUI/Util/XML/XMLCompletedBus.cs
index 6654662a1d..fe7fbb1e3b 100644
--- a/VECTO3GUI/Util/XML/XMLCompletedBus.cs
+++ b/VECTO3GUI/Util/XML/XMLCompletedBus.cs
@@ -76,9 +76,9 @@ namespace VECTO3GUI.Util.XML
 			var vehicleData = (ICompleteVehicleBus)inputData[Component.CompleteBusVehicle];
 
 
-
+			var id = "CB-" + Guid.NewGuid().ToString("n").Substring(0, 20);
 			return new XElement(_v20 + XMLNames.Component_Vehicle,
-					new XAttribute(XMLNames.Component_ID_Attr, vehicleData.VIN),
+					new XAttribute(XMLNames.Component_ID_Attr, id),
 					new XAttribute(_xsi + "type", XMLDeclarationCompletedBusDataProviderV26.XSD_TYPE),// "CompletedVehicleDeclarationType"
 					new XAttribute("xmlns", _v26),
 
@@ -176,10 +176,6 @@ namespace VECTO3GUI.Util.XML
 								new XElement(_v26 + XMLNames.Bus_Positionlights, auxBus?.PositionlightsLED),
 								new XElement(_v26 + XMLNames.Bus_Brakelights, auxBus?.BrakelightsLED),
 								new XElement(_v26 + XMLNames.Bus_Interiorlights, auxBus?.InteriorLightsLED))),
-						//----> ToDo remove if xsd gets changed <---
-							new XElement(_v26 + XMLNames.BusAux_PneumaticSystem,
-								new XElement(_v26 + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, auxBus?.DoorDriveTechnology.GetLabel().ToLower())),
-						//------------------------------------------
 							new XElement(_v26 + "HVAC",
 								new XElement(_v26 + XMLNames.Bus_SystemConfiguration, auxBus?.SystemConfiguration.GetXmlFormat()),
 								new XElement(_v26 + XMLNames.Bus_CompressorType,
@@ -204,11 +200,11 @@ namespace VECTO3GUI.Util.XML
 
 			for (int i = 0; i < alternatorTechnologies.Count; i++) {
 
-				if(alternatorTechnologies[i].AlternatorTechnology == AlternatorTechnology.Empty)
+				if(string.IsNullOrWhiteSpace(alternatorTechnologies[i].AlternatorTechnology))
 					continue;
 				
 				result.Add(new XElement(_v26 + XMLNames.BusAux_ElectricSystem_AlternatorTechnology, 
-					alternatorTechnologies[i].AlternatorTechnology.GetLabel()));	
+					alternatorTechnologies[i].AlternatorTechnology));	
 			}
 
 			return result.Count > 0 ? result.ToArray() : null;
diff --git a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
index 51bde59179..614dccd1f5 100644
--- a/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/AirdragViewModel.cs
@@ -18,7 +18,7 @@ namespace VECTO3GUI.ViewModel.Impl
 {
 	public enum AirdragConfig
 	{
-		WithoutAirdrag,
+		UseDefaultAirdragData,
 		UseMeasurementData,
 		Unknown
 	}
@@ -29,10 +29,10 @@ namespace VECTO3GUI.ViewModel.Impl
 		{
 			switch (airdrag)
 			{
-				case AirdragConfig.WithoutAirdrag:
-					return "Without Airdrag";
+				case AirdragConfig.UseDefaultAirdragData:
+					return "Use default airdrag data";
 				case AirdragConfig.UseMeasurementData:
-					return "Use Measurement Data";
+					return "Use airdrag component data";
 			}
 			return string.Empty;
 		}
@@ -41,9 +41,9 @@ namespace VECTO3GUI.ViewModel.Impl
 		{
 			switch (name)
 			{
-				case "Without Airdrag":
-					return AirdragConfig.WithoutAirdrag;
-				case "Use Measurement Data":
+				case "Use default airdrag data":
+					return AirdragConfig.UseDefaultAirdragData;
+				case "Use airdrag component data":
 					return AirdragConfig.UseMeasurementData;
 			}
 			return AirdragConfig.Unknown;
@@ -191,15 +191,15 @@ namespace VECTO3GUI.ViewModel.Impl
 			_xmlFilePath = XmlHelper.GetXmlAbsoluteFilePath(xmlUri);
 
 			SetAirdragValues(_airdragData);
-			UseMeasurementData = _airdragData.AirDragArea != null;
+			UseMeasurementData = _airdragData?.AirDragArea != null;
 			NoAirdragData = !UseMeasurementData;
 			IsEditable = false;
 		}
 
 		private void SetAirdragValues(IAirdragDeclarationInputData airdrag)
 		{
-			UseMeasuredValues = airdrag.AirDragArea != null;
-			if (airdrag.AirDragArea == null)
+			UseMeasuredValues = airdrag?.AirDragArea != null;
+			if (airdrag?.AirDragArea == null)
 			{
 				_componentData = new AirdragComponentData(this, true);
 				return;
@@ -240,7 +240,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		private void DoAirdragConfig(AirdragConfig config)
 		{
 			switch (config) {
-				case AirdragConfig.WithoutAirdrag:
+				case AirdragConfig.UseDefaultAirdragData:
 					NoAirdragData = true;
 					break;
 				case AirdragConfig.UseMeasurementData:
diff --git a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs
index f977b6e463..9cc5a9fff6 100644
--- a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs
@@ -35,7 +35,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		private IBusAuxiliariesDeclarationData _busAuxiliaries;
 
 	
-		private ObservableCollectionEx<AlternatorTechnologyModel> _alternatorTechnologies;
+		private ObservableCollectionEx<AlternatorTechnologyModel> _alternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>();
 		private bool _dayRunningLightsLED;
 		private bool _headlightyLED;
 		private bool _positionlightsLED;
@@ -139,7 +139,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		public ObservableCollectionEx<AlternatorTechnologyModel> AlternatorTechnologies
 		{
 			get { return _alternatorTechnologies; }
-			set { SetProperty(ref _alternatorTechnologies, value); }
+			//set { SetProperty(ref _alternatorTechnologies, value); }
 		}
 
 		public bool DayrunninglightsLED
@@ -292,7 +292,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		public AllowedEntry<BusHVACSystemConfiguration>[] AllowedSystemConfigurations { get; private set; }
 		public AllowedEntry<ACCompressorType>[] AllowedDriverACCompressorTypes { get; private set; }
 		public AllowedEntry<ACCompressorType>[] AllowedPassengerACCompressorTypes { get; private set; }
-		public AllowedEntry<AlternatorTechnology>[] AllowedAlternatorTechnology { get; private set; }
+		public AllowedEntry<string>[] AllowedAlternatorTechnology { get; private set; }
 		#endregion
 
 
@@ -325,17 +325,14 @@ namespace VECTO3GUI.ViewModel.Impl
 
 			if (!busAux.ElectricSupply.Alternators.IsNullOrEmpty())
 			{
-				AlternatorTechnologies = new ObservableCollectionEx<AlternatorTechnologyModel>();
+				AlternatorTechnologies.Clear(); // = new ObservableCollectionEx<AlternatorTechnologyModel>();
 
 				AlternatorTechnologies.CollectionChanged += AlternatorTechnologiesOnCollectionChanged;
 				AlternatorTechnologies.CollectionItemChanged += AlternatorTechnologiesOnCollectionItemChanged;
 
 				for (int i = 0; i < busAux.ElectricSupply.Alternators.Count; i++)
 				{
-					AlternatorTechnologies.Add(new AlternatorTechnologyModel
-					{
-						AlternatorTechnology = AlternatorTechnologyHelper.Parse(busAux.ElectricSupply.Alternators[i].Technology)
-					});
+					AlternatorTechnologies.Add(new AlternatorTechnologyModel(){ AlternatorTechnology = busAux.ElectricSupply.Alternators[i].Technology });
 				}
 			}
 
@@ -393,16 +390,18 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		private void SetAllowedValues()
 		{
-			AllowedSystemConfigurations = Enum.GetValues(typeof(BusHVACSystemConfiguration)).Cast<BusHVACSystemConfiguration>()
+			AllowedSystemConfigurations = EnumHelper.GetValues<BusHVACSystemConfiguration>()
+				.Where(x => x != BusHVACSystemConfiguration.Unknown)
 				.Select(sc => AllowedEntry.Create(sc, sc.GetLabel())).ToArray();
 
-			AllowedDriverACCompressorTypes = Enum.GetValues(typeof(ACCompressorType)).Cast<ACCompressorType>()
+			AllowedDriverACCompressorTypes = EnumHelper.GetValues<ACCompressorType>()
+				.Where(x => x != ACCompressorType.Unknown)
 				.Select(acc => AllowedEntry.Create(acc, acc.GetLabel())).ToArray();
 
 			AllowedPassengerACCompressorTypes = AllowedDriverACCompressorTypes;
 
-			AllowedAlternatorTechnology = Enum.GetValues(typeof(AlternatorTechnology)).Cast<AlternatorTechnology>()
-				.Select(sc => AllowedEntry.Create(sc, sc.GetLabel())).ToArray();
+			AllowedAlternatorTechnology = DeclarationData.BusAuxiliaries.AlternatorTechnologies.Entries.Keys
+														.Select(x => AllowedEntry.Create(x, x)).ToArray();
 		}
 
 		public override void ResetComponentData()
@@ -434,7 +433,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		}
 		private void DoRemoveAlternator(int index)
 		{
-			AlternatorTechnologies?.RemoveAt(index);
+			AlternatorTechnologies.RemoveAt(index);
 		}
 
 
@@ -449,7 +448,7 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		private void DoRemoveAllAlternators()
 		{
-			AlternatorTechnologies?.Clear();
+			AlternatorTechnologies.Clear();
 			OnPropertyChanged(nameof(AlternatorTechnologies));
 		}
 
@@ -466,7 +465,7 @@ namespace VECTO3GUI.ViewModel.Impl
 		{
 			AlternatorTechnologies.Add(new AlternatorTechnologyModel
 			{
-				AlternatorTechnology = AlternatorTechnology.Empty
+				AlternatorTechnology = string.Empty
 			});
 		}
 
diff --git a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs
index 2f2262e6ef..486296cb01 100644
--- a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs
+++ b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs
@@ -245,7 +245,7 @@ namespace VECTO3GUI.ViewModel.Impl
 
 		public AllowedEntry<LegislativeClass>[] AllowedLegislativeClasses { get; private set; }
 		public AllowedEntry<VehicleCode>[] AllowedVehicleCodes { get; private set; }
-		public AllowedEntry<ConsumerTechnology>[] AllowedConsumerTechnologies { get; private set; }
+		public AllowedEntry<ConsumerTechnology>[] AllowedDoorDriveTechnologies { get; private set; }
 		public AllowedEntry<RegistrationClass>[] AllowedRegisteredClasses { get; private set; }
 		public AllowedEntry<TankSystem?>[] AllowedTankSystems { get; private set; }
 
@@ -297,28 +297,20 @@ namespace VECTO3GUI.ViewModel.Impl
 		private void SetAllowedEntries()
 		{
 
-			AllowedLegislativeClasses = Enum.GetValues(typeof(LegislativeClass)).Cast<LegislativeClass>()
+			AllowedLegislativeClasses = new [] {LegislativeClass.M3} 
 				.Select(lc => AllowedEntry.Create(lc, lc.GetLabel())).ToArray();
 
-			AllowedVehicleCodes = Enum.GetValues(typeof(VehicleCode)).Cast<VehicleCode>()
+			AllowedVehicleCodes = EnumHelper.GetValues<VehicleCode>().Where(x => x != VehicleCode.NOT_APPLICABLE)
 				.Select(vc => AllowedEntry.Create(vc, vc.GetLabel())).ToArray();
 
-			AllowedConsumerTechnologies = Enum.GetValues(typeof(ConsumerTechnology)).Cast<ConsumerTechnology>()
+			AllowedDoorDriveTechnologies = new [] {ConsumerTechnology.Pneumatically, ConsumerTechnology.Electrically}
 				.Select(sc => AllowedEntry.Create(sc, sc.GetLabel())).ToArray();
 
-			AllowedRegisteredClasses = Enum.GetValues(typeof(RegistrationClass)).Cast<RegistrationClass>()
+			AllowedRegisteredClasses = EnumHelper.GetValues<RegistrationClass>().Where(x => x != RegistrationClass.unknown)
 				.Select(vc => AllowedEntry.Create(vc, vc.GetLabel())).ToArray();
 			
-			var tankSystems = Enum.GetValues(typeof(TankSystem)).Cast<TankSystem>().ToArray();
-			var tank = new AllowedEntry<TankSystem?> [tankSystems.Length+1];
-
-			tank[0] = AllowedEntry.Create((TankSystem?)null, null);
-			for (int i = 1; i < tankSystems.Length + 1; i++) {
-
-				tank[i] = AllowedEntry.Create<TankSystem?>(tankSystems[i-1], tankSystems[i-1].ToString());
-			}
-
-			AllowedTankSystems = tank;
+			AllowedTankSystems = new[] { AllowedEntry.Create((TankSystem?)null, "Not applicable") }
+				.Concat(EnumHelper.GetValues<TankSystem>().Select(x => AllowedEntry.Create((TankSystem?)x, x.ToString()))).ToArray();
 		}
 
 		#endregion
diff --git a/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesBus.cs b/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesBus.cs
index 360c983d94..1846bd45e1 100644
--- a/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesBus.cs
+++ b/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesBus.cs
@@ -15,7 +15,7 @@ namespace VECTO3GUI.ViewModel.Interfaces
 	{
 		#region Electric System
 
-		ObservableCollectionEx<AlternatorTechnologyModel> AlternatorTechnologies { get; set; }
+		ObservableCollectionEx<AlternatorTechnologyModel> AlternatorTechnologies { get; /*set; */ }
 		bool DayrunninglightsLED { get; set; }
 		bool HeadlightsLED { get; set; }
 		bool PositionlightsLED { get; set; }
@@ -36,7 +36,7 @@ namespace VECTO3GUI.ViewModel.Interfaces
 		bool SeparateAirDistributionDucts { get; set; }
 
 		#endregion
-		ConsumerTechnology DoorDriveTechnology { get; set; }
+
 
 	}
 }
diff --git a/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesViewModel.cs
index 04e2f00b54..0d1f997940 100644
--- a/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesViewModel.cs
+++ b/VECTO3GUI/ViewModel/Interfaces/IAuxiliariesViewModel.cs
@@ -42,7 +42,7 @@ namespace VECTO3GUI.ViewModel.Interfaces {
 		AllowedEntry<BusHVACSystemConfiguration>[] AllowedSystemConfigurations { get; }
 		AllowedEntry<ACCompressorType>[] AllowedDriverACCompressorTypes { get; }
 		AllowedEntry<ACCompressorType>[] AllowedPassengerACCompressorTypes { get; }
-		AllowedEntry<AlternatorTechnology>[] AllowedAlternatorTechnology { get;  }
+		AllowedEntry<string>[] AllowedAlternatorTechnology { get;  }
 
 		#endregion
 	}
diff --git a/VECTO3GUI/ViewModel/Interfaces/ICompleteVehicleBusViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/ICompleteVehicleBusViewModel.cs
index ac3472e25b..c2d7b4d0f3 100644
--- a/VECTO3GUI/ViewModel/Interfaces/ICompleteVehicleBusViewModel.cs
+++ b/VECTO3GUI/ViewModel/Interfaces/ICompleteVehicleBusViewModel.cs
@@ -11,7 +11,7 @@ namespace VECTO3GUI.ViewModel.Interfaces
 	{
 		AllowedEntry<LegislativeClass>[] AllowedLegislativeClasses { get; }
 		AllowedEntry<VehicleCode>[] AllowedVehicleCodes { get; }
-		AllowedEntry<ConsumerTechnology>[] AllowedConsumerTechnologies { get; }
+		AllowedEntry<ConsumerTechnology>[] AllowedDoorDriveTechnologies { get; }
 		AllowedEntry<RegistrationClass>[] AllowedRegisteredClasses { get; }
 		AllowedEntry<TankSystem?>[] AllowedTankSystems { get; }
 	}
diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
index 9998c574ad..364fc1e7c1 100644
--- a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
+++ b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml
@@ -31,8 +31,8 @@
 
             <StackPanel Orientation="Vertical">
                 <RadioButton GroupName="AirdragConfig" Margin="5"
-                             Content="{Binding Source={x:Static impl:AirdragConfig.WithoutAirdrag}, Converter={converter:EnumConverter}}"
-                             Command="{Binding AirdragConfigCommand}" CommandParameter="{Binding Source={x:Static impl:AirdragConfig.WithoutAirdrag}}"
+                             Content="{Binding Source={x:Static impl:AirdragConfig.UseDefaultAirdragData}, Converter={converter:EnumConverter}}"
+                             Command="{Binding AirdragConfigCommand}" CommandParameter="{Binding Source={x:Static impl:AirdragConfig.UseDefaultAirdragData}}"
                              IsChecked="{Binding NoAirdragData}"/>
                 
                 <RadioButton GroupName="AirdragConfig" Margin="5"
diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml
index e918f7beea..fe20e10698 100644
--- a/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml
+++ b/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml
@@ -139,7 +139,7 @@
                             AllowedValues="{Binding AllowedPassengerACCompressorTypes}" />
 
                     <customControls:VectoParameterControl
-                            Caption="Height Integrated Body" Unit="{helper:SIUnit AuxHeaterPower}" CaptionWidthGroup="lblWidth" UnitWidthGroup="unitWidth"
+                            Caption="Aux Heater Power" Unit="{helper:SIUnit AuxHeaterPower}" CaptionWidthGroup="lblWidth" UnitWidthGroup="unitWidth"
                             Value="{Binding AuxHeaterPower, Converter={converter:SIValueConverter}, ConverterParameter=double}" />
 
                     <customControls:CheckboxParameter
diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
index 259c546431..8a4f39dd81 100644
--- a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
+++ b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml
@@ -120,7 +120,7 @@
                             Caption="Door Drive Technology"
                             CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth"
                             Value="{Binding DoorDriveTechnology}"
-                            AllowedValues="{Binding AllowedConsumerTechnologies}" />
+                            AllowedValues="{Binding AllowedDoorDriveTechnologies}" />
 
                 </StackPanel>
             </StackPanel>
diff --git a/VECTO3GUI/Views/CustomControls/ComboParameter.xaml b/VECTO3GUI/Views/CustomControls/ComboParameter.xaml
index 6109102cd0..680257dd99 100644
--- a/VECTO3GUI/Views/CustomControls/ComboParameter.xaml
+++ b/VECTO3GUI/Views/CustomControls/ComboParameter.xaml
@@ -24,7 +24,10 @@
                   ItemsSource="{Binding AllowedValues}"
                   SelectedValue="{Binding Value}"
                   SelectedValuePath="Value"
-                  DisplayMemberPath="Label"/>
+                  DisplayMemberPath="Label"
+                  IsEditable="True"
+                  IsReadOnly="True"
+                  Text="Select..."/>
         <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding Unit}" Margin="5,0,5,0"/>
     </Grid>
 </UserControl>
-- 
GitLab