From fbcde58ed60ecfa50a05f9010cec0b28f2cd5a39 Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Wed, 10 Mar 2021 09:12:58 +0100 Subject: [PATCH] co2 standards group only for groups 4,5,9,10 --- .../Models/Declaration/WeightingGroups.cs | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs b/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs index 36b35e89e4..16d76551bd 100644 --- a/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs +++ b/VectoCore/VectoCore/Models/Declaration/WeightingGroups.cs @@ -74,10 +74,28 @@ namespace TUGraz.VectoCore.Models.Declaration public static string ToXMLFormat(this WeightingGroup group) { - if (group == WeightingGroup.Unknown) { - return Constants.NOT_AVAILABLE; + switch (group) { + case WeightingGroup.Group1: + case WeightingGroup.Group2: + case WeightingGroup.Group3: + case WeightingGroup.Group11: + case WeightingGroup.Group12: + case WeightingGroup.Group16: + case WeightingGroup.Unknown: + return Constants.NOT_AVAILABLE; + case WeightingGroup.Group4UD: + case WeightingGroup.Group4RD: + case WeightingGroup.Group4LH: + case WeightingGroup.Group5RD: + case WeightingGroup.Group5LH: + case WeightingGroup.Group9RD: + case WeightingGroup.Group9LH: + case WeightingGroup.Group10RD: + case WeightingGroup.Group10LH: + return string.Join("-", Regex.Split(group.ToString().Replace(Prefix, ""), @"(\d+|\w+)").Where(x => !string.IsNullOrWhiteSpace(x))); + default: + return Constants.NOT_AVAILABLE; } - return string.Join("-", Regex.Split(group.ToString().Replace(Prefix, ""), @"(\d+|\w+)").Where(x => !string.IsNullOrWhiteSpace(x))); } } -- GitLab