using System.ComponentModel.DataAnnotations;
|
|
namespace IStation.Win
|
{
|
/// <summary>
|
/// 模型调度验证
|
/// </summary>
|
public class ModelScheduleValidViewModel
|
{
|
[Display(Name = "时间")]
|
public DateTime Time { get; set; }
|
|
[Display(Name = "值类型")]
|
public eValueType ValueType { get; set; }
|
|
[Display(Name = "模型标识")]
|
public string ModelId { get; set; }
|
|
[Display(Name = "Scada标识")]
|
public string ScadaId { get; set; }
|
|
[Display(Name = "模型值")]
|
public double? ModeValue { get; set; }
|
|
[Display(Name = "Scada值")]
|
public double? ScadaValue { get; set; }
|
|
[Display(Name = "差值")]
|
public double? DifferenceValue { get; set; }
|
|
|
public void Round()
|
{
|
if (this.ModeValue.HasValue)
|
if (this.ValueType == eValueType.Head)
|
{
|
|
this.ModeValue = Math.Round(this.ModeValue.Value, 5);
|
}
|
else
|
{
|
this.ModeValue = Math.Round(this.ModeValue.Value, 2);
|
}
|
|
if (this.ScadaValue.HasValue)
|
if (this.ValueType == eValueType.Head)
|
{
|
|
this.ScadaValue = Math.Round(this.ScadaValue.Value, 5);
|
}
|
else
|
{
|
this.ScadaValue = Math.Round(this.ScadaValue.Value, 2);
|
}
|
|
if (this.DifferenceValue.HasValue)
|
if (this.ValueType == eValueType.Head)
|
{
|
|
this.DifferenceValue = Math.Round(this.DifferenceValue.Value, 6);
|
}
|
else
|
{
|
this.DifferenceValue = Math.Round(this.DifferenceValue.Value, 1);
|
}
|
}
|
}
|
}
|