using System.ComponentModel.DataAnnotations;
namespace IStation
{
///
///
///
public class AvgStatisticsS1ViewModel : AvgStatisticsViewModel
{
public AvgStatisticsS1ViewModel() { }
public AvgStatisticsS1ViewModel(AvgStatisticsViewModel rhs):base(rhs) { }
#region 压力 Different
[Display(Name = "11#JD1")]
public double? Pump11PdJD1 { get; set; }
[Display(Name = "11#JD2")]
public double? Pump11PdJD2 { get; set; }
[Display(Name = "11#JD3")]
public double? Pump11PdJD3 { get; set; }
[Display(Name = "12#JD1")]
public double? Pump12PdJD1 { get; set; }
[Display(Name = "12#JD2")]
public double? Pump12PdJD2 { get; set; }
[Display(Name = "12#JD3")]
public double? Pump12PdJD3 { get; set; }
[Display(Name = "13#JD1")]
public double? Pump13PdJD1 { get; set; }
[Display(Name = "13#JD2")]
public double? Pump13PdJD2 { get; set; }
[Display(Name = "13#JD3")]
public double? Pump13PdJD3 { get; set; }
[Display(Name = "14#JD1")]
public double? Pump14PdJD1 { get; set; }
[Display(Name = "14#JD2")]
public double? Pump14PdJD2 { get; set; }
[Display(Name = "14#JD3")]
public double? Pump14PdJD3 { get; set; }
[Display(Name = "15#JD1")]
public double? Pump15PdJD1 { get; set; }
[Display(Name = "15#JD2")]
public double? Pump15PdJD2 { get; set; }
[Display(Name = "15#JD3")]
public double? Pump15PdJD3 { get; set; }
[Display(Name = "16#JD1")]
public double? Pump16PdJD1 { get; set; }
[Display(Name = "16#JD2")]
public double? Pump16PdJD2 { get; set; }
[Display(Name = "16#JD3")]
public double? Pump16PdJD3 { get; set; }
[Display(Name = "17#JD1")]
public double? Pump17PdJD1 { get; set; }
[Display(Name = "17#JD2")]
public double? Pump17PdJD2 { get; set; }
[Display(Name = "17#JD3")]
public double? Pump17PdJD3 { get; set; }
[Display(Name = "18#JD1")]
public double? Pump18PdJD1 { get; set; }
[Display(Name = "18#JD2")]
public double? Pump18PdJD2 { get; set; }
[Display(Name = "18#JD3")]
public double? Pump18PdJD3 { get; set; }
#endregion
#region 压力 Different
[Display(Name = "11#Max")]
public double? Pump11PdMax { get; set; }
[Display(Name = "12#Max")]
public double? Pump12PdMax { get; set; }
[Display(Name = "13#Max")]
public double? Pump13PdMax { get; set; }
[Display(Name = "14#Max")]
public double? Pump14PdMax { get; set; }
[Display(Name = "15#Max")]
public double? Pump15PdMax { get; set; }
[Display(Name = "16#Max")]
public double? Pump16PdMax { get; set; }
[Display(Name = "17#Max")]
public double? Pump17PdMax { get; set; }
[Display(Name = "18#Max")]
public double? Pump18PdMax { get; set; }
#endregion
public void Round()
{
this.Pump11PdJD1 = Round(this.Pump11PdJD1, 2);
this.Pump12PdJD1 = Round(this.Pump12PdJD1, 2);
this.Pump13PdJD1 = Round(this.Pump13PdJD1, 2);
this.Pump14PdJD1 = Round(this.Pump14PdJD1, 2);
this.Pump15PdJD1 = Round(this.Pump15PdJD1, 2);
this.Pump16PdJD1 = Round(this.Pump16PdJD1, 2);
this.Pump17PdJD1 = Round(this.Pump17PdJD1, 2);
this.Pump18PdJD1 = Round(this.Pump18PdJD1, 2);
this.Pump11PdJD2 = Round(this.Pump11PdJD2, 2);
this.Pump12PdJD2 = Round(this.Pump12PdJD2, 2);
this.Pump13PdJD2 = Round(this.Pump13PdJD2, 2);
this.Pump14PdJD2 = Round(this.Pump14PdJD2, 2);
this.Pump15PdJD2 = Round(this.Pump15PdJD2, 2);
this.Pump16PdJD2 = Round(this.Pump16PdJD2, 2);
this.Pump17PdJD2 = Round(this.Pump17PdJD2, 2);
this.Pump18PdJD2 = Round(this.Pump18PdJD2, 2);
this.Pump11PdJD3 = Round(this.Pump11PdJD3, 2);
this.Pump12PdJD3 = Round(this.Pump12PdJD3, 2);
this.Pump13PdJD3 = Round(this.Pump13PdJD3, 2);
this.Pump14PdJD3 = Round(this.Pump14PdJD3, 2);
this.Pump15PdJD3 = Round(this.Pump15PdJD3, 2);
this.Pump16PdJD3 = Round(this.Pump16PdJD3, 2);
this.Pump17PdJD3 = Round(this.Pump17PdJD3, 2);
this.Pump18PdJD3 = Round(this.Pump18PdJD3, 2);
this.Pump11PdMax = Max(this.Pump11PdJD1, this.Pump11PdJD2, this.Pump11PdJD3);
this.Pump12PdMax = Max(this.Pump12PdJD1, this.Pump12PdJD2, this.Pump12PdJD3);
this.Pump13PdMax = Max(this.Pump13PdJD1, this.Pump13PdJD2, this.Pump13PdJD3);
this.Pump14PdMax = Max(this.Pump14PdJD1, this.Pump14PdJD2, this.Pump14PdJD3);
this.Pump15PdMax = Max(this.Pump15PdJD1, this.Pump15PdJD2, this.Pump15PdJD3);
this.Pump16PdMax = Max(this.Pump16PdJD1, this.Pump16PdJD2, this.Pump16PdJD3);
this.Pump17PdMax = Max(this.Pump17PdJD1, this.Pump17PdJD2, this.Pump17PdJD3);
this.Pump18PdMax = Max(this.Pump18PdJD1, this.Pump18PdJD2, this.Pump18PdJD3);
}
///
/// Round
///
///
///
private double? Round(double? t, int digits, bool filter_zero = false)
{
if (t.HasValue && t.Value != 0)
{
t = Math.Round(t.Value, digits);
}
if (filter_zero && t == 0)
{
return null;
}
return t;
}
///
/// Max
///
///
///
///
///
private double? Max(double? jd1, double? jd2, double? jd3)
{
var list = new List() { jd1, jd2, jd3 };
return list.Max();
}
}
}