using IStation.WinFrmUI.Monitor;
|
using System;
|
using System.ComponentModel.DataAnnotations;
|
|
namespace IStation
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class AvgStatisticsS2Dto : AvgStatisticsDto
|
{
|
public AvgStatisticsS2Dto() { }
|
public AvgStatisticsS2Dto(AvgStatisticsDto rhs) : base(rhs) { }
|
public AvgStatisticsS2Dto(AvgStatisticsS2ViewModel rhs)
|
{
|
MinTotalFlow = rhs.MinTotalFlow;
|
MaxTotalFlow = rhs.MaxTotalFlow;
|
RunCount = rhs.RunCount;
|
RunFlags = rhs.RunFlags;
|
TimeCount = rhs.Count;
|
Pump21Pd = rhs.Pump21PdMax;
|
Pump22Pd = rhs.Pump22PdMax;
|
Pump23Pd = rhs.Pump23PdMax;
|
Pump24Pd = rhs.Pump24PdMax;
|
Pump25Pd = rhs.Pump25PdMax;
|
Pump26Pd = rhs.Pump26PdMax;
|
Pump27Pd = rhs.Pump27PdMax;
|
}
|
|
#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()
|
{
|
Pump21Pd = Round(Pump21Pd, 4);
|
Pump22Pd = Round(Pump22Pd, 4);
|
Pump23Pd = Round(Pump23Pd, 4);
|
Pump24Pd = Round(Pump24Pd, 4);
|
Pump25Pd = Round(Pump25Pd, 4);
|
Pump26Pd = Round(Pump26Pd, 4);
|
Pump27Pd = Round(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;
|
}
|
|
|
|
|
}
|
}
|