Fix handling extreme values.

- VERBESSERT: Extreme Werte (mit "<" oder ">") wurden nicht sehr schön formatiert.
This commit is contained in:
Daniel Kraus
2015-09-18 17:22:04 +02:00
parent 7a5041e04c
commit 7997e307fa
3 changed files with 36 additions and 1 deletions

View File

@ -203,7 +203,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
#region Fields
static readonly Regex _numericalRegex = new Regex(
@"(?<name>[^:]+):\s*(?<value>[\d,.]+)\s*(?<limits>\[[^\]]+])?\s*(?<unit>[^;]+)?");
@"(?<name>[^:]+):\s*(?<value>([\<\>]\s)?[\d,.]+)\s*(?<limits>\[[^\]]+])?\s*(?<unit>[^;]+)?");
static readonly Regex _categoricalRegex = new Regex(
@"(?<name>[^:]+):\s*(?<value>[^[;]+)\s*(\[(?<normal>[^\]]+)])?");
static readonly Regex _limitRegex = new Regex(@"\[(?<limit1>[-\d,.]+)?\s*(?<operator>\S+)\s*(?<limit2>[-\d,.]+)?]");

View File

@ -74,6 +74,19 @@ namespace zaaReloaded2.LabModel
}
}
/// <summary>
/// Returns whether or not the value is an 'extreme' value,
/// i.e. marked with "&gt;" or "&lt;". These values are not
/// strictly numeric, and IsNumerical returns false for them.
/// </summary>
public bool IsExtreme
{
get
{
return "<>".Contains(Value.Substring(0, 1));
}
}
/// <summary>
/// Gets the normal value of the item. Need not be set. This is
/// used for items with nominal values (as opposed to numbers).
@ -130,6 +143,8 @@ namespace zaaReloaded2.LabModel
{
get
{
if (IsExtreme) return false;
if (HasLimits)
{
if (HasLowerLimit && HasUpperLimit)