From 401b270b0c34e1298f09b161cf8ecfd6f3433a67 Mon Sep 17 00:00:00 2001 From: "VKMTHD\\haraldmartini" <harald.martini@student.tugraz.at> Date: Wed, 11 Jan 2023 09:15:28 +0100 Subject: [PATCH] added brackets --- ...ectricMotorDeclarationInputDataProvider.cs | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs index 0deb9873f5..d5ee832559 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs @@ -321,38 +321,48 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider foreach (var voltageLevel in VoltageLevels) { foreach (var powerMap in voltageLevel.PowerMap) { - if(powerMap.Gear <= 0) + if (powerMap.Gear <= 0) { continue; + } - if (currentGears.ContainsKey(powerMap.Gear)) + if (currentGears.ContainsKey(powerMap.Gear)) { currentGears[powerMap.Gear] = true; - else - throw new ArgumentException("The PowerMaps contains a gear which was not specified under gears"); + } else { + throw new ArgumentException( + "The PowerMaps contains a gear which was not specified under gears"); + } } - if(AnyMissingGear(currentGears)) + + if (AnyMissingGear(currentGears)) { throw new ArgumentException("The PowerMaps contains a gear which was not specified under gears"); + } } foreach (var dragCurve in DragCurves) { - if(dragCurve.Gear == null) + if (dragCurve.Gear == null) { continue; + } - if (currentGears.ContainsKey((int)dragCurve.Gear)) + if (currentGears.ContainsKey((int)dragCurve.Gear)) { currentGears[(int)dragCurve.Gear] = true; - else + } else { throw new ArgumentException("The DragCurve contains a gear which was not specified under gears"); + } } - if (AnyMissingGear(currentGears)) + if (AnyMissingGear(currentGears)) { throw new ArgumentException("The DragCurve contains a gear which was not specified under gears"); + } } private bool AnyMissingGear(Dictionary<int, bool> foundedGears) { var keys = foundedGears.Keys.ToList(); foreach (var key in keys) { - if(!foundedGears[key]) + if (!foundedGears[key]) { return true; + } + foundedGears[key] = false; } -- GitLab