using System.ComponentModel.DataAnnotations;
|
|
namespace IStation
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class AvgStatisticsS2 : AvgStatistics
|
{
|
public AvgStatisticsS2() { }
|
public AvgStatisticsS2(AvgStatistics rhs):base(rhs) { }
|
|
#region Different
|
|
[Display(Name = "21#")]
|
public double? Pump21Pd { get; set; }
|
|
[Display(Name = "22#")]
|
public double? Pump22Pd { get; set; }
|
|
[Display(Name = "23#")]
|
public double? Pump23Pd { get; set; }
|
|
[Display(Name = "24#")]
|
public double? Pump24Pd { get; set; }
|
|
[Display(Name = "25#")]
|
public double? Pump25Pd { get; set; }
|
|
[Display(Name = "26#")]
|
public double? Pump26Pd { get; set; }
|
|
[Display(Name = "27#")]
|
public double? Pump27Pd { get; set; }
|
|
#endregion
|
|
public void Round()
|
{
|
this.Pump21Pd = Round(this.Pump21Pd, 4);
|
this.Pump22Pd = Round(this.Pump22Pd, 4);
|
this.Pump23Pd = Round(this.Pump23Pd, 4);
|
this.Pump24Pd = Round(this.Pump24Pd, 4);
|
this.Pump25Pd = Round(this.Pump25Pd, 4);
|
this.Pump26Pd = Round(this.Pump26Pd, 4);
|
this.Pump27Pd = Round(this.Pump27Pd, 4);
|
}
|
|
|
/// <summary>
|
/// Round
|
/// </summary>
|
/// <param name="t"></param>
|
/// <param name="digits"></param>
|
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;
|
}
|
|
|
|
|
}
|
}
|