namespace IStation.Dto
|
{
|
/// <summary>
|
/// 泵站调度
|
/// </summary>
|
public class ScheduleCalcInput : IValidatableObject
|
{
|
/// <summary>
|
/// 目标流量(1输)
|
/// </summary>
|
public double TargetFlow1 { get; set; }
|
|
/// <summary>
|
/// 目标压力(1输)
|
/// </summary>
|
public double TargetPressure1 { get; set; }
|
|
/// <summary>
|
/// 目标流量(2输)
|
/// </summary>
|
public double TargetFlow2 { get; set; }
|
|
/// <summary>
|
/// 目标压力(2输)
|
/// </summary>
|
public double TargetPressure2 { get; set; }
|
|
|
/// <summary>
|
/// 验证
|
/// </summary>
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
{
|
if (this.TargetFlow1 < 1)
|
{
|
yield return
|
new ValidationResult($"一输水增水量过低! tag:TotalFlow1 Value:{this.TargetFlow1}", new[] { nameof(this.TargetFlow1) });
|
}
|
|
if (this.TargetPressure1 < 0.01)
|
{
|
yield return
|
new ValidationResult($"一输水增压过低! tag:TotalPressure1 Value:{this.TargetPressure1}", new[] { nameof(this.TargetPressure1) });
|
}
|
|
|
if (this.TargetFlow2 < 1)
|
{
|
yield return
|
new ValidationResult($"二输水增水量过低! tag:TotalFlow2 Value:{this.TargetFlow2}", new[] { nameof(this.TargetFlow2) });
|
}
|
|
if (this.TargetPressure2 < 0.01)
|
{
|
yield return
|
new ValidationResult($"二输水增压过低! tag:TotalPressure2 Value:{this.TargetPressure2}", new[] { nameof(this.TargetPressure2) });
|
}
|
|
}
|
|
}
|
|
|
|
}
|