using System;
|
using System.Collections.Generic;
|
using System.ComponentModel.DataAnnotations;
|
using System.Linq;
|
|
namespace IStation.Vm
|
{
|
public class StationScheduleVm
|
{
|
public StationScheduleVm() { }
|
public StationScheduleVm(StationScheduleVm rhs)
|
{
|
this.Name= rhs.Name;
|
this.Flag= rhs.Flag;
|
this.Time= rhs.Time;
|
this.TargetFlow= rhs.TargetFlow;
|
this.CalcFlow= rhs.CalcFlow;
|
this.FlowDeviation= rhs.FlowDeviation;
|
this.TargetPressure= rhs.TargetPressure;
|
this.CalcPressure= rhs.CalcPressure;
|
this.PressureDeviation= rhs.PressureDeviation;
|
this.PumpSchedules= rhs.PumpSchedules?.ToList();
|
}
|
|
[Display(Name = "名称")]
|
public string Name { get; set; }
|
|
[Display(Name = "标志")]
|
public int Flag { get; set; }
|
|
|
[Display(Name = "时间")]
|
public DateTime Time { get; set; }
|
|
|
[Display(Name = "目标流量")]
|
public double TargetFlow { get; set; }
|
|
[Display(Name = "计算流量")]
|
public double CalcFlow { get; set; }
|
|
[Display(Name = "流量偏差")]
|
public double FlowDeviation { get; set; }
|
|
|
[Display(Name = "目标压力")]
|
public double TargetPressure { get; set; }
|
|
[Display(Name = "计算压力")]
|
public double CalcPressure { get; set; }
|
|
[Display(Name = "压力偏差")]
|
public double PressureDeviation { get; set; }
|
|
|
[Display(Name = "泵调度列表")]
|
public List<PumpScheduleVm> PumpSchedules { get; set; }
|
|
|
public void Round()
|
{
|
this.TargetFlow = Round(this.TargetFlow, 1);
|
this.CalcFlow = Round(this.CalcFlow, 1);
|
this.FlowDeviation = Round(this.FlowDeviation, 1);
|
|
this.TargetPressure = Round(this.TargetPressure, 3);
|
this.CalcPressure = Round(this.CalcPressure, 3);
|
this.PressureDeviation = Round(this.PressureDeviation, 3);
|
}
|
|
private double Round( double value, int digits = 0)
|
{
|
return Math.Round(value, digits);
|
}
|
|
|
|
|
}
|
}
|