using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IStation.Formula;
namespace IStation.Model.Monitor
{
///
/// 单位能耗计算公式参数
///
public class UWPCalculationFormulaParas : JsonModel
{
///
/// 瞬时流量测点标识
///
public long Q { get; set; }
///
/// 有功功率测点标识
///
public long P { get; set; }
///
/// 扬程测点标识
///
public long H { get; set; }
///
/// 计算
///
public bool Calculate(double p, double q, double h, out double uwp)
{
uwp = 0;
if (q < 0.1)
return false;
if (h < 0.1)
return false;
uwp = CalcuHelper.CalculateUWP(p, q, h);
return true;
}
///
/// 计算
///
public bool Calculate(string p, string q, string h, out double uwp)
{
uwp = 0;
if (!double.TryParse(p, out double tp))
{
return false;
}
if (!double.TryParse(q, out double tq))
{
return false;
}
if (tq < 0.1)
{
return false;
}
if (!double.TryParse(h, out double th))
{
return false;
}
if (th < 0.1)
{
return false;
}
uwp = CalcuHelper.CalculateUWP(tp, tq, th);
return true;
}
}
}