using System.ComponentModel.DataAnnotations;
namespace IStation
{
///
/// 模型验证
///
public class ScadaModelValidViewModel
{
public ScadaModelValidViewModel() { }
public ScadaModelValidViewModel(ScadaModelValidViewModel rhs)
{
this.Time = rhs.Time;
this.R1 = rhs.R1;
this.R2 = rhs.R2;
this.R3 = rhs.R3;
this.RPump21 = rhs.RPump21;
this.RPump22 = rhs.RPump22;
this.RPump23 = rhs.RPump23;
this.RPump24 = rhs.RPump24;
this.RPump25 = rhs.RPump25;
this.RPump26 = rhs.RPump26;
this.RPump27 = rhs.RPump27;
this.DN2700P = rhs.DN2700P;
this.DN2400P = rhs.DN2400P;
this.JD1P = rhs.JD1P;
this.JD2P = rhs.JD2P;
this.JD3P = rhs.JD3P;
this.Pump11P = rhs.Pump11P;
this.Pump12P = rhs.Pump12P;
this.Pump13P = rhs.Pump13P;
this.Pump14P = rhs.Pump14P;
this.Pump15P = rhs.Pump15P;
this.Pump16P = rhs.Pump16P;
this.Pump17P = rhs.Pump17P;
this.Pump18P = rhs.Pump18P;
this.Pump21P = rhs.Pump21P;
this.Pump22P = rhs.Pump22P;
this.Pump23P = rhs.Pump23P;
this.Pump24P = rhs.Pump24P;
this.Pump25P = rhs.Pump25P;
this.Pump26P = rhs.Pump26P;
this.Pump27P = rhs.Pump27P;
this.DN2700F = rhs.DN2700F;
this.DN2400F = rhs.DN2400F;
this.JD1F = rhs.JD1F;
this.JD2F = rhs.JD2F;
this.JD3F = rhs.JD3F;
this.Pump21F = rhs.Pump21F;
this.Pump22F = rhs.Pump22F;
this.Pump23F = rhs.Pump23F;
this.Pump24F = rhs.Pump24F;
this.Pump25F = rhs.Pump25F;
this.Pump26F = rhs.Pump26F;
this.Pump27F = rhs.Pump27F;
this.Pump11 = rhs.Pump11;
this.Pump12 = rhs.Pump12;
this.Pump13 = rhs.Pump13;
this.Pump14 = rhs.Pump14;
this.Pump15 = rhs.Pump15;
this.Pump16 = rhs.Pump16;
this.Pump17 = rhs.Pump17;
this.Pump18 = rhs.Pump18;
this.Pump21 = rhs.Pump21;
this.Pump22 = rhs.Pump22;
this.Pump23 = rhs.Pump23;
this.Pump24 = rhs.Pump24;
this.Pump25 = rhs.Pump25;
this.Pump26 = rhs.Pump26;
this.Pump27 = rhs.Pump27;
this.Pump11PdJD1 = rhs.Pump11PdJD1;
this.Pump12PdJD1 = rhs.Pump12PdJD1;
this.Pump13PdJD1 = rhs.Pump13PdJD1;
this.Pump14PdJD1 = rhs.Pump14PdJD1;
this.Pump15PdJD1 = rhs.Pump15PdJD1;
this.Pump16PdJD1 = rhs.Pump16PdJD1;
this.Pump17PdJD1 = rhs.Pump17PdJD1;
this.Pump18PdJD1 = rhs.Pump18PdJD1;
this.Pump11PdJD2 = rhs.Pump11PdJD2;
this.Pump12PdJD2 = rhs.Pump12PdJD2;
this.Pump13PdJD2 = rhs.Pump13PdJD2;
this.Pump14PdJD2 = rhs.Pump14PdJD2;
this.Pump15PdJD2 = rhs.Pump15PdJD2;
this.Pump16PdJD2 = rhs.Pump16PdJD2;
this.Pump17PdJD2 = rhs.Pump17PdJD2;
this.Pump18PdJD2 = rhs.Pump18PdJD2;
this.Pump11PdJD3 = rhs.Pump11PdJD3;
this.Pump12PdJD3 = rhs.Pump12PdJD3;
this.Pump13PdJD3 = rhs.Pump13PdJD3;
this.Pump14PdJD3 = rhs.Pump14PdJD3;
this.Pump15PdJD3 = rhs.Pump15PdJD3;
this.Pump16PdJD3 = rhs.Pump16PdJD3;
this.Pump17PdJD3 = rhs.Pump17PdJD3;
this.Pump18PdJD3 = rhs.Pump18PdJD3;
this.Pump21PdDN2400 = rhs.Pump21PdDN2400;
this.Pump22PdDN2400 = rhs.Pump22PdDN2400;
this.Pump23PdDN2400 = rhs.Pump23PdDN2400;
this.Pump24PdDN2400 = rhs.Pump24PdDN2400;
this.Pump25PdDN2400 = rhs.Pump25PdDN2400;
this.Pump26PdDN2400 = rhs.Pump26PdDN2400;
this.Pump27PdDN2400 = rhs.Pump27PdDN2400;
this.Pump21PdDN2700 = rhs.Pump21PdDN2700;
this.Pump22PdDN2700 = rhs.Pump22PdDN2700;
this.Pump23PdDN2700 = rhs.Pump23PdDN2700;
this.Pump24PdDN2700 = rhs.Pump24PdDN2700;
this.Pump25PdDN2700 = rhs.Pump25PdDN2700;
this.Pump26PdDN2700 = rhs.Pump26PdDN2700;
this.Pump27PdDN2700 = rhs.Pump27PdDN2700;
}
public void Diff()
{
this.Pump11PdJD1 = DiffCheck(this.Pump11P, this.JD1P, this.Pump11, 3);
this.Pump12PdJD1 = DiffCheck(this.Pump12P, this.JD1P, this.Pump12, 3);
this.Pump13PdJD1 = DiffCheck(this.Pump13P, this.JD1P, this.Pump13, 3);
this.Pump14PdJD1 = DiffCheck(this.Pump14P, this.JD1P, this.Pump14, 3);
this.Pump15PdJD1 = DiffCheck(this.Pump15P, this.JD1P, this.Pump15, 3);
this.Pump16PdJD1 = DiffCheck(this.Pump16P, this.JD1P, this.Pump16, 3);
this.Pump17PdJD1 = DiffCheck(this.Pump17P, this.JD1P, this.Pump17, 3);
this.Pump18PdJD1 = DiffCheck(this.Pump18P, this.JD1P, this.Pump18, 3);
this.Pump11PdJD2 = DiffCheck(this.Pump11P, this.JD2P, this.Pump11, 3);
this.Pump12PdJD2 = DiffCheck(this.Pump12P, this.JD2P, this.Pump12, 3);
this.Pump13PdJD2 = DiffCheck(this.Pump13P, this.JD2P, this.Pump13, 3);
this.Pump14PdJD2 = DiffCheck(this.Pump14P, this.JD2P, this.Pump14, 3);
this.Pump15PdJD2 = DiffCheck(this.Pump15P, this.JD2P, this.Pump15, 3);
this.Pump16PdJD2 = DiffCheck(this.Pump16P, this.JD2P, this.Pump16, 3);
this.Pump17PdJD2 = DiffCheck(this.Pump17P, this.JD2P, this.Pump17, 3);
this.Pump18PdJD2 = DiffCheck(this.Pump18P, this.JD2P, this.Pump18, 3);
this.Pump11PdJD3 = DiffCheck(this.Pump11P, this.JD3P, this.Pump11, 3);
this.Pump12PdJD3 = DiffCheck(this.Pump12P, this.JD3P, this.Pump12, 3);
this.Pump13PdJD3 = DiffCheck(this.Pump13P, this.JD3P, this.Pump13, 3);
this.Pump14PdJD3 = DiffCheck(this.Pump14P, this.JD3P, this.Pump14, 3);
this.Pump15PdJD3 = DiffCheck(this.Pump15P, this.JD3P, this.Pump15, 3);
this.Pump16PdJD3 = DiffCheck(this.Pump16P, this.JD3P, this.Pump16, 3);
this.Pump17PdJD3 = DiffCheck(this.Pump17P, this.JD3P, this.Pump17, 3);
this.Pump18PdJD3 = DiffCheck(this.Pump18P, this.JD3P, this.Pump18, 3);
this.Pump21PdDN2400 = DiffCheck(this.Pump21P, this.DN2400P, this.Pump21, 3);
this.Pump22PdDN2400 = DiffCheck(this.Pump22P, this.DN2400P, this.Pump22, 3);
this.Pump23PdDN2400 = DiffCheck(this.Pump23P, this.DN2400P, this.Pump23, 3);
this.Pump24PdDN2400 = DiffCheck(this.Pump24P, this.DN2400P, this.Pump24, 3);
this.Pump25PdDN2400 = DiffCheck(this.Pump25P, this.DN2400P, this.Pump25, 3);
this.Pump26PdDN2400 = DiffCheck(this.Pump26P, this.DN2400P, this.Pump26, 3);
this.Pump27PdDN2400 = DiffCheck(this.Pump27P, this.DN2400P, this.Pump27, 3);
this.Pump21PdDN2700 = DiffCheck(this.Pump21P, this.DN2700P, this.Pump21, 3);
this.Pump22PdDN2700 = DiffCheck(this.Pump22P, this.DN2700P, this.Pump22, 3);
this.Pump23PdDN2700 = DiffCheck(this.Pump23P, this.DN2700P, this.Pump23, 3);
this.Pump24PdDN2700 = DiffCheck(this.Pump24P, this.DN2700P, this.Pump24, 3);
this.Pump25PdDN2700 = DiffCheck(this.Pump25P, this.DN2700P, this.Pump25, 3);
this.Pump26PdDN2700 = DiffCheck(this.Pump26P, this.DN2700P, this.Pump26, 3);
this.Pump27PdDN2700 = DiffCheck(this.Pump27P, this.DN2700P, this.Pump27, 3);
//this.Pump21Fd = DiffCheck(this.Pump21F, this.Pump21F, this.Pump21, 1);
//this.Pump22Fd = DiffCheck(this.Pump22F, this.Pump22F, this.Pump22, 1);
//this.Pump23Fd = DiffCheck(this.Pump23F, this.Pump23F, this.Pump23, 1);
//this.Pump24Fd = DiffCheck(this.Pump24F, this.Pump24F, this.Pump24, 1);
//this.Pump25Fd = DiffCheck(this.Pump25F, this.Pump25F, this.Pump25, 1);
//this.Pump26Fd = DiffCheck(this.Pump26F, this.Pump26F, this.Pump26, 1);
//this.Pump27Fd = DiffCheck(this.Pump27F, this.Pump27F, this.Pump27, 1);
}
public void Round()
{
this.R1 = Round(this.R1, 1);
this.R2 = Round(this.R2, 1);
this.R3 = Round(this.R3, 1);
this.RPump21 = Round(this.RPump21, 1);
this.RPump22 = Round(this.RPump22, 1);
this.RPump23 = Round(this.RPump23, 1);
this.RPump24 = Round(this.RPump24, 1);
this.RPump25 = Round(this.RPump25, 1);
this.RPump26 = Round(this.RPump26, 1);
this.RPump27 = Round(this.RPump27, 1);
this.DN2700P = Round(this.DN2700P, 1);
this.DN2400P = Round(this.DN2400P, 1);
this.JD1P = Round(this.JD1P, 1);
this.JD2P = Round(this.JD2P, 1);
this.JD3P = Round(this.JD3P, 1);
this.Pump11P = Round(this.Pump11P, 1);
this.Pump12P = Round(this.Pump12P, 1);
this.Pump13P = Round(this.Pump13P, 1);
this.Pump14P = Round(this.Pump14P, 1);
this.Pump15P = Round(this.Pump15P, 1);
this.Pump16P = Round(this.Pump16P, 1);
this.Pump17P = Round(this.Pump17P, 1);
this.Pump18P = Round(this.Pump18P, 1);
this.Pump21P = Round(this.Pump21P, 1);
this.Pump22P = Round(this.Pump22P, 1);
this.Pump23P = Round(this.Pump23P, 1);
this.Pump24P = Round(this.Pump24P, 1);
this.Pump25P = Round(this.Pump25P, 1);
this.Pump26P = Round(this.Pump26P, 1);
this.Pump27P = Round(this.Pump27P, 1);
this.DN2700F = Round(this.DN2700F, 1);
this.DN2400F = Round(this.DN2400F, 1);
this.JD1F = Round(this.JD1F, 1);
this.JD2F = Round(this.JD2F, 1);
this.JD3F = Round(this.JD3F, 1);
this.Pump21F = Round(this.Pump21F, 1);
this.Pump22F = Round(this.Pump22F, 1);
this.Pump23F = Round(this.Pump23F, 1);
this.Pump24F = Round(this.Pump24F, 1);
this.Pump25F = Round(this.Pump25F, 1);
this.Pump26F = Round(this.Pump26F, 1);
this.Pump27F = Round(this.Pump27F, 1);
this.Pump11 = Round(this.Pump11, 2, true);
this.Pump12 = Round(this.Pump12, 2, true);
this.Pump13 = Round(this.Pump13, 2, true);
this.Pump14 = Round(this.Pump14, 2, true);
this.Pump15 = Round(this.Pump15, 2, true);
this.Pump16 = Round(this.Pump16, 2, true);
this.Pump17 = Round(this.Pump17, 2, true);
this.Pump18 = Round(this.Pump18, 2, true);
this.Pump21 = Round(this.Pump21, 2, true);
this.Pump22 = Round(this.Pump22, 2, true);
this.Pump23 = Round(this.Pump23, 2, true);
this.Pump24 = Round(this.Pump24, 2, true);
this.Pump25 = Round(this.Pump25, 2, true);
this.Pump26 = Round(this.Pump26, 2, true);
this.Pump27 = Round(this.Pump27, 2, true);
}
///
/// 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;
}
///
/// Diff
///
///
///
///
private double? Diff(double? subtraction, double? minuend, int digits)
{
var t = subtraction - minuend;
return Round(t, digits);
}
///
/// DiffCheck
///
///
///
///
private double? DiffCheck(double? subtraction, double? minuend, double? check, int digits)
{
double? t = null;
if (check.HasValue && check.Value != 0)
{
t = subtraction - minuend;
}
if (subtraction<-1000|| minuend <-1000)
{
return null;
}
return Round(t, digits);
}
[Display(Name = "时间")]
public DateTime Time { get; set; }
#region 水位
[Display(Name = "新前池液位1")]
public double? R1 { get; set; }
[Display(Name = "老前池北侧液位2")]
public double? R2 { get; set; }
[Display(Name = "老前池南侧液位3")]
public double? R3 { get; set; }
[Display(Name = "泵井液位21")]
public double? RPump21 { get; set; }
[Display(Name = "泵井液位22")]
public double? RPump22 { get; set; }
[Display(Name = "泵井液位23")]
public double? RPump23 { get; set; }
[Display(Name = "泵井液位24")]
public double? RPump24 { get; set; }
[Display(Name = "泵井液位25")]
public double? RPump25 { get; set; }
[Display(Name = "泵井液位26")]
public double? RPump26 { get; set; }
[Display(Name = "泵井液位27")]
public double? RPump27 { get; set; }
#endregion
#region 压力
[Display(Name = "总管压力DN2700")]
public double? DN2700P { get; set; }
[Display(Name = "总管压力2400")]
public double? DN2400P { get; set; }
[Display(Name = "总管压力嘉定1")]
public double? JD1P { get; set; }
[Display(Name = "总管压力嘉定2")]
public double? JD2P { get; set; }
[Display(Name = "总管压力嘉定3")]
public double? JD3P { get; set; }
[Display(Name = "压力11")]
public double? Pump11P { get; set; }
[Display(Name = "压力12")]
public double? Pump12P { get; set; }
[Display(Name = "压力13")]
public double? Pump13P { get; set; }
[Display(Name = "压力14")]
public double? Pump14P { get; set; }
[Display(Name = "压力15")]
public double? Pump15P { get; set; }
[Display(Name = "压力16")]
public double? Pump16P { get; set; }
[Display(Name = "压力17")]
public double? Pump17P { get; set; }
[Display(Name = "压力18")]
public double? Pump18P { get; set; }
[Display(Name = "压力21")]
public double? Pump21P { get; set; }
[Display(Name = "压力22")]
public double? Pump22P { get; set; }
[Display(Name = "压力23")]
public double? Pump23P { get; set; }
[Display(Name = "压力24")]
public double? Pump24P { get; set; }
[Display(Name = "压力25")]
public double? Pump25P { get; set; }
[Display(Name = "压力26")]
public double? Pump26P { get; set; }
[Display(Name = "压力27")]
public double? Pump27P { get; set; }
#endregion
#region 压力 Different
[Display(Name = "压力11嘉定1")]
public double? Pump11PdJD1 { get; set; }
[Display(Name = "压力11嘉定2")]
public double? Pump11PdJD2 { get; set; }
[Display(Name = "压力11嘉定3")]
public double? Pump11PdJD3 { get; set; }
[Display(Name = "压力12嘉定1")]
public double? Pump12PdJD1 { get; set; }
[Display(Name = "压力12嘉定2")]
public double? Pump12PdJD2 { get; set; }
[Display(Name = "压力12嘉定3")]
public double? Pump12PdJD3 { get; set; }
[Display(Name = "压力13嘉定1")]
public double? Pump13PdJD1 { get; set; }
[Display(Name = "压力13嘉定2")]
public double? Pump13PdJD2 { get; set; }
[Display(Name = "压力13嘉定3")]
public double? Pump13PdJD3 { get; set; }
[Display(Name = "压力14嘉定1")]
public double? Pump14PdJD1 { get; set; }
[Display(Name = "压力14嘉定2")]
public double? Pump14PdJD2 { get; set; }
[Display(Name = "压力14嘉定3")]
public double? Pump14PdJD3 { get; set; }
[Display(Name = "压力15嘉定1")]
public double? Pump15PdJD1 { get; set; }
[Display(Name = "压力15嘉定2")]
public double? Pump15PdJD2 { get; set; }
[Display(Name = "压力15嘉定3")]
public double? Pump15PdJD3 { get; set; }
[Display(Name = "压力16嘉定1")]
public double? Pump16PdJD1 { get; set; }
[Display(Name = "压力16嘉定2")]
public double? Pump16PdJD2 { get; set; }
[Display(Name = "压力16嘉定3")]
public double? Pump16PdJD3 { get; set; }
[Display(Name = "压力17嘉定1")]
public double? Pump17PdJD1 { get; set; }
[Display(Name = "压力17嘉定2")]
public double? Pump17PdJD2 { get; set; }
[Display(Name = "压力17嘉定3")]
public double? Pump17PdJD3 { get; set; }
[Display(Name = "压力18嘉定1")]
public double? Pump18PdJD1 { get; set; }
[Display(Name = "压力18嘉定2")]
public double? Pump18PdJD2 { get; set; }
[Display(Name = "压力18嘉定3")]
public double? Pump18PdJD3 { get; set; }
[Display(Name = "压力21DN2400")]
public double? Pump21PdDN2400 { get; set; }
[Display(Name = "压力21DN2700")]
public double? Pump21PdDN2700 { get; set; }
[Display(Name = "压力22DN2400")]
public double? Pump22PdDN2400 { get; set; }
[Display(Name = "压力22DN2700")]
public double? Pump22PdDN2700 { get; set; }
[Display(Name = "压力23DN2400")]
public double? Pump23PdDN2400 { get; set; }
[Display(Name = "压力23DN2700")]
public double? Pump23PdDN2700 { get; set; }
[Display(Name = "压力24DN2400")]
public double? Pump24PdDN2400 { get; set; }
[Display(Name = "压力24DN2700")]
public double? Pump24PdDN2700 { get; set; }
[Display(Name = "压力25DN2400")]
public double? Pump25PdDN2400 { get; set; }
[Display(Name = "压力25DN2700")]
public double? Pump25PdDN2700 { get; set; }
[Display(Name = "压力26DN2400")]
public double? Pump26PdDN2400 { get; set; }
[Display(Name = "压力26DN2700")]
public double? Pump26PdDN2700 { get; set; }
[Display(Name = "压力27DN2400")]
public double? Pump27PdDN2400 { get; set; }
[Display(Name = "压力27DN2700")]
public double? Pump27PdDN2700 { get; set; }
#endregion
#region 流量
[Display(Name = "总管流量DN2700")]
public double? DN2700F { get; set; }
[Display(Name = "总管流量DN2400")]
public double? DN2400F { get; set; }
[Display(Name = "总管流量嘉定1")]
public double? JD1F { get; set; }
[Display(Name = "总管流量嘉定2")]
public double? JD2F { get; set; }
[Display(Name = "总管流量嘉定3")]
public double? JD3F { get; set; }
[Display(Name = "流量21")]
public double? Pump21F { get; set; }
[Display(Name = "流量22")]
public double? Pump22F { get; set; }
[Display(Name = "流量23")]
public double? Pump23F { get; set; }
[Display(Name = "流量24")]
public double? Pump24F { get; set; }
[Display(Name = "流量25")]
public double? Pump25F { get; set; }
[Display(Name = "流量26")]
public double? Pump26F { get; set; }
[Display(Name = "流量27")]
public double? Pump27F { get; set; }
#endregion
#region 流量 Different
//[Display(Name = "流量21")]
//public double? Pump21Fd { get; set; }
//[Display(Name = "流量22")]
//public double? Pump22Fd { get; set; }
//[Display(Name = "流量23")]
//public double? Pump23Fd { get; set; }
//[Display(Name = "流量24")]
//public double? Pump24Fd { get; set; }
//[Display(Name = "流量25")]
//public double? Pump25Fd { get; set; }
//[Display(Name = "流量26")]
//public double? Pump26Fd { get; set; }
//[Display(Name = "流量27")]
//public double? Pump27Fd { get; set; }
#endregion
#region 频率
[Display(Name = "频率11")]
public double? Pump11 { get; set; }
[Display(Name = "频率12")]
public double? Pump12 { get; set; }
[Display(Name = "频率13")]
public double? Pump13 { get; set; }
[Display(Name = "频率14")]
public double? Pump14 { get; set; }
[Display(Name = "频率15")]
public double? Pump15 { get; set; }
[Display(Name = "频率16")]
public double? Pump16 { get; set; }
[Display(Name = "频率17")]
public double? Pump17 { get; set; }
[Display(Name = "频率18")]
public double? Pump18 { get; set; }
[Display(Name = "频率21")]
public double? Pump21 { get; set; }
[Display(Name = "频率22")]
public double? Pump22 { get; set; }
[Display(Name = "频率23")]
public double? Pump23 { get; set; }
[Display(Name = "频率24")]
public double? Pump24 { get; set; }
[Display(Name = "频率25")]
public double? Pump25 { get; set; }
[Display(Name = "频率26")]
public double? Pump26 { get; set; }
[Display(Name = "频率27")]
public double? Pump27 { get; set; }
#endregion
}
}