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