ningshuxia
2023-04-13 13aeccc4305083d2d61274709a0066511fae42a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.Model.Monitor 
{
    /// <summary>
    /// 差值统计公式参数
    /// </summary>
    public class DiffValueStatisticsFormulaParas : JsonModel<DiffValueStatisticsFormulaParas>
    {
        /// <summary>
        /// 测点标识
        /// </summary>
        public long ObjectID { get; set; }
 
        /// <summary>
        /// 统计
        /// </summary>
        public double Statistic(IEnumerable<double> list)
        {
            if (list == null || list.Count() < 1)
                return default;
            var min = list.Min();
            var max = list.Max();
            return max - min;
        }
 
    }
}