using System.ComponentModel.DataAnnotations;
namespace IStation
{
///
///
///
public class AvgStatisticsS2ViewModel : AvgStatisticsViewModel
{
public AvgStatisticsS2ViewModel() { }
public AvgStatisticsS2ViewModel(AvgStatisticsViewModel rhs):base(rhs) { }
#region Different
[Display(Name = "21#DN2400")]
public double? Pump21PdDN2400 { get; set; }
[Display(Name = "21#DN2700")]
public double? Pump21PdDN2700 { get; set; }
[Display(Name = "22#DN2400")]
public double? Pump22PdDN2400 { get; set; }
[Display(Name = "22#DN2700")]
public double? Pump22PdDN2700 { get; set; }
[Display(Name = "23#DN2400")]
public double? Pump23PdDN2400 { get; set; }
[Display(Name = "23#DN2700")]
public double? Pump23PdDN2700 { get; set; }
[Display(Name = "24#DN2400")]
public double? Pump24PdDN2400 { get; set; }
[Display(Name = "24#DN2700")]
public double? Pump24PdDN2700 { get; set; }
[Display(Name = "25#DN2400")]
public double? Pump25PdDN2400 { get; set; }
[Display(Name = "25#DN2700")]
public double? Pump25PdDN2700 { get; set; }
[Display(Name = "26#DN2400")]
public double? Pump26PdDN2400 { get; set; }
[Display(Name = "26#DN2700")]
public double? Pump26PdDN2700 { get; set; }
[Display(Name = "27#DN2400")]
public double? Pump27PdDN2400 { get; set; }
[Display(Name = "27#DN2700")]
public double? Pump27PdDN2700 { get; set; }
#endregion
#region Different
[Display(Name = "21#Max")]
public double? Pump21PdMax { get; set; }
[Display(Name = "22#Max")]
public double? Pump22PdMax { get; set; }
[Display(Name = "23#Max")]
public double? Pump23PdMax { get; set; }
[Display(Name = "24#Max")]
public double? Pump24PdMax { get; set; }
[Display(Name = "25#Max")]
public double? Pump25PdMax { get; set; }
[Display(Name = "26#Max")]
public double? Pump26PdMax { get; set; }
[Display(Name = "27#Max")]
public double? Pump27PdMax { get; set; }
#endregion
public void Round()
{
this.Pump21PdDN2400 = Round(this.Pump21PdDN2400, 2);
this.Pump22PdDN2400 = Round(this.Pump22PdDN2400, 2);
this.Pump23PdDN2400 = Round(this.Pump23PdDN2400, 2);
this.Pump24PdDN2400 = Round(this.Pump24PdDN2400, 2);
this.Pump25PdDN2400 = Round(this.Pump25PdDN2400, 2);
this.Pump26PdDN2400 = Round(this.Pump26PdDN2400, 2);
this.Pump27PdDN2400 = Round(this.Pump27PdDN2400, 2);
this.Pump21PdDN2700 = Round(this.Pump21PdDN2700, 2);
this.Pump22PdDN2700 = Round(this.Pump22PdDN2700, 2);
this.Pump23PdDN2700 = Round(this.Pump23PdDN2700, 2);
this.Pump24PdDN2700 = Round(this.Pump24PdDN2700, 2);
this.Pump25PdDN2700 = Round(this.Pump25PdDN2700, 2);
this.Pump26PdDN2700 = Round(this.Pump26PdDN2700, 2);
this.Pump27PdDN2700 = Round(this.Pump27PdDN2700, 2);
this.Pump21PdMax = Max(this.Pump21PdDN2400, this.Pump21PdDN2700);
this.Pump22PdMax = Max(this.Pump22PdDN2400, this.Pump22PdDN2700);
this.Pump23PdMax = Max(this.Pump23PdDN2400, this.Pump23PdDN2700);
this.Pump24PdMax = Max(this.Pump24PdDN2400, this.Pump24PdDN2700);
this.Pump25PdMax = Max(this.Pump25PdDN2400, this.Pump25PdDN2700);
this.Pump26PdMax = Max(this.Pump26PdDN2400, this.Pump26PdDN2700);
this.Pump27PdMax = Max(this.Pump27PdDN2400, this.Pump27PdDN2700);
}
///
/// 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? dn2400, double? dn2700)
{
if (dn2400 > dn2700)
return dn2400;
else
return dn2700;
}
}
}