ATMLModelLibrary.model.ErrorLimit.IsErrorLimit C# (CSharp) Method

IsErrorLimit() public static method

public static IsErrorLimit ( string value ) : bool
value string
return bool
        public static bool IsErrorLimit(string value)
        {
            return value.ToLower().Trim().StartsWith("errlmt");
        }

Usage Example

Example #1
0
        private void CreateRange(string value, out string remainder, double magnitude)
        {
            Quantity qty1;
            Quantity qty2;

            string nextWord = remainder = value.Trim(); //Physical.NextWord(value, out remainder);

            _magnitude = magnitude;

            if (nextWord.ToLower().StartsWith("range"))
            {
                nextWord = Physical.NextWord(remainder, out remainder);
            }
            if (nextWord.ToLower().StartsWith("max"))
            {
                nextWord    = Physical.NextWord(remainder, out remainder);
                _toQuantity = new Quantity(remainder, out remainder);
            }
            else if (nextWord.ToLower().StartsWith("min"))
            {
                nextWord      = Physical.NextWord(remainder, out remainder);
                _fromQuantity = new Quantity(remainder, out remainder);
            }
            else
            {
                if (nextWord.StartsWith(Quantity.PLUSMINUS1))
                {
                    remainder = CalculateRange(magnitude, nextWord, Quantity.PLUSMINUS1.Length);
                }
                else if (nextWord.StartsWith(Quantity.PLUSMINUS2))
                {
                    remainder = CalculateRange(magnitude, nextWord, Quantity.PLUSMINUS2.Length);
                }
                else
                {
                    _fromQuantity = new UncertainQuantity(remainder, out remainder);
                    string to = Physical.NextWord(remainder, out remainder);
                    _toQuantity = new Quantity(remainder, out remainder);
                }
            }
            if (ErrorLimit.IsErrorLimit(remainder))
            {
                _errorLimit = new ErrorLimit(remainder, out remainder);
            }
        }