Beispiel #1
0
 /// <summary>
 /// gets the current info and places it in an info array the will be saved
 /// </summary>
 /// <returns>the info array</returns>
 public string[] GetInfo()
 {
     string[] info = new string[4];
     info[0] = LastValue.ToString();
     info[1] = HighestValue.ToString();
     info[2] = Key.ToString();
     info[3] = Name;
     return(info);
 }
Beispiel #2
0
 /// <summary>
 /// 字符串显示
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(Name + ", Value: " + this.Value.ToString("0.000")
            + ", WindowSize: " + CurrentWindowSize
            + ", LastValue: " + LastValue.ToString("0.000")
            + ", LastValueDiffer: " + LastValueDiffer.ToString("0.000")
            //  + ", MaxAllowedValueDiffer: " + MaxAllowedValueDiffer.ToString("0.000")
            );
 }
        /// <summary>
        /// ///////////////////////////////////////////////////////////////////////////////
        ///
        /// Created by: Andreas Rege
        /// V1.0
        /// Date: 2018-02-08
        ///
        /// Purpose: Function/Method to combine info to a text string
        ///
        /// ///////////////////////////////////////////////////////////////////////////////
        /// </summary>
        public string DisplayLine()
        {
            string strDispLine = "Sensor ";

            strDispLine += name;
            strDispLine += " value: ";
            strDispLine += LastValue.ToString();
            return(strDispLine);
        }
        /// <summary>
        /// ///////////////////////////////////////////////////////////////////////////////
        ///
        /// Created by: Andreas Rege
        /// V1.0
        /// Date: 2018-02-08
        ///
        /// Purpose: Function/Method to combine info to a text string
        ///
        /// ///////////////////////////////////////////////////////////////////////////////
        /// </summary>
        public string DisplayLine()
        {
            string strDispLine = "Sensor ";

            strDispLine += name;
            strDispLine += " value: ";
            strDispLine += LastValue.ToString("F3");
            strDispLine += " [" + measurand + "]";
            return(strDispLine);
        }
Beispiel #5
0
 void SetTextField()
 {
     if (InputFieldUi.contentType == InputField.ContentType.IntegerNumber)
     {
         InputFieldUi.text = LastValue.ToString();
     }
     else if (InputFieldUi.contentType == InputField.ContentType.DecimalNumber)
     {
         InputFieldUi.text = LastValue.ToString("F2").Replace(",", ".");
     }
 }
Beispiel #6
0
 public override string ToString()
 {
     if (TotalSamples > 0)
     {
         return(string.Format("{0} .. {1}, {2} ({3} smps)",
                              MinValue.ToString(FmtString, CultureInfo.InvariantCulture),
                              MaxValue.ToString(FmtString, CultureInfo.InvariantCulture),
                              LastValue.ToString(FmtString, CultureInfo.InvariantCulture),
                              TotalSamples));
     }
     else
     {
         return("- - -");
     }
 }
Beispiel #7
0
        public void SetQuery()
        {
            HandleField();

            switch (LastQueryBase)
            {
            case TermQuery termQuery:
                termQuery.Field = LastFiled;
                termQuery.Value = LastValue;
                break;

            case BoolQuery boolQuery:
                boolQuery.MustNot = new List <QueryContainer>
                {
                    new TermQuery
                    {
                        Field = LastFiled,
                        Value = LastValue
                    }
                };
                break;

            case TermRangeQuery termRangeQuery:
                termRangeQuery.Field                = LastFiled;
                termRangeQuery.GreaterThan          = !string.IsNullOrWhiteSpace(termRangeQuery.GreaterThan) ? LastValue.ToString() : null;
                termRangeQuery.GreaterThanOrEqualTo = !string.IsNullOrWhiteSpace(termRangeQuery.GreaterThanOrEqualTo) ? LastValue.ToString() : null;
                termRangeQuery.LessThan             = !string.IsNullOrWhiteSpace(termRangeQuery.LessThan) ? LastValue.ToString() : null;
                termRangeQuery.LessThanOrEqualTo    = !string.IsNullOrWhiteSpace(termRangeQuery.LessThanOrEqualTo) ? LastValue.ToString() : null;
                break;

            case MatchPhraseQuery matchPhraseQuery:
                matchPhraseQuery.Field = LastFiled;
                matchPhraseQuery.Query = LastValue.ToString();
                break;

            case QueryStringQuery queryStringQuery:
                queryStringQuery.Fields = new[] { LastFiled };
                queryStringQuery.Query  = "*" + LastValue + "*";
                break;
            }

            if (QueryContainer == null)
            {
                QueryContainer = LastQueryBase;
            }
            else
            {
                switch (LastOperator)
                {
                case ExpressionType.And:
                case ExpressionType.AndAlso:
                    QueryContainer &= LastQueryBase;
                    break;

                case ExpressionType.Or:
                case ExpressionType.OrElse:
                    QueryContainer |= LastQueryBase;
                    break;
                }
            }
        }