示例#1
0
        /// <summary>
        /// Appends the points of the single trend to the string builder.
        /// </summary>
        private void AppendTrendPoints(StringBuilder stringBuilder, Trend trend, Cnl cnl)
        {
            stringBuilder.Append('[');

            if (trend != null)
            {
                int counter = 0;

                foreach (Data.Models.TrendPoint point in trend.Points)
                {
                    CnlData          cnlData          = new(point.Val, point.Stat);
                    CnlDataFormatted cnlDataFormatted = formatter.FormatCnlData(cnlData, cnl, false);
                    TrendPoint.Append(stringBuilder, cnlData, cnlDataFormatted.DispVal);

                    if (++counter == ItemsPerLine)
                    {
                        counter = 0;
                        stringBuilder.AppendLine();
                    }
                }
            }

            stringBuilder.Append(']');
        }
示例#2
0
        /// <summary>
        /// Appends the points of the trend bundle to the string builder.
        /// </summary>
        private void AppendTrendPoints(StringBuilder stringBuilder, TrendBundle trendBundle, int trendIndex)
        {
            stringBuilder.Append('[');

            if (trendBundle != null)
            {
                Cnl cnl     = cnls[trendIndex];
                int counter = 0;

                foreach (CnlData cnlData in trendBundle.Trends[trendIndex])
                {
                    CnlDataFormatted cnlDataFormatted = formatter.FormatCnlData(cnlData, cnl, false);
                    TrendPoint.Append(stringBuilder, cnlData, cnlDataFormatted.DispVal);

                    if (++counter == ItemsPerLine)
                    {
                        counter = 0;
                        stringBuilder.AppendLine();
                    }
                }
            }

            stringBuilder.Append(']');
        }