using Yw.Vmo;
namespace HStation.WinFrmUI
{
///
///
///
public class SimulationWorkingHelper
{
///
///
///
public SimulationWorkingHelper() { }
///
/// 初始化事件
///
public event Action InitialEvent;
///
/// 是否初始化
///
public bool Initialized
{
get { return this.Working != null; }
}
///
/// 水力信息
///
public Yw.Model.HydroModelInfo HydroInfo
{
get { return _hydroInfo; }
private set { _hydroInfo = value; }
}
private Yw.Model.HydroModelInfo _hydroInfo = null;
///
/// 工况
///
public HydroWorkingVmo Working
{
get { return _working; }
private set { _working = value; }
}
private HydroWorkingVmo _working = null;
///
/// 检查结果
///
public HydroCheckResult CheckResult
{
get { return _checkResult; }
private set { _checkResult = value; }
}
private HydroCheckResult _checkResult = null;
///
/// 计算结果
///
public HydroCalcuResult CalcuResult
{
get { return _calcuResult; }
private set { _calcuResult = value; }
}
private HydroCalcuResult _calcuResult = null;
///
/// 是否是绝对压力
///
public bool IsHead
{
get { return _isHead; }
private set { _isHead = value; }
}
private bool _isHead = false;
///
/// 初始化数据
///
public void InitialData
(
Yw.Model.HydroModelInfo hydroInfo,
HydroWorkingVmo working,
HydroCheckResult checkResult,
HydroCalcuResult calcuResult,
bool isHead = false
)
{
this.HydroInfo = hydroInfo;
this.Working = working;
this.CheckResult = checkResult;
this.CalcuResult = calcuResult;
this.IsHead = isHead;
this.InitialEvent?.Invoke();
}
///
/// 重置工况
///
public void ResetWorking(HydroWorkingVmo working)
{
this.Working = working;
}
///
/// 重置结果
///
public void ResetResult(bool isHead = false)
{
if (!Initialized)
{
return;
}
if (this.IsHead == isHead)
{
return;
}
this.IsHead = isHead;
var calcuResult = this.HydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead);
this.CalcuResult = calcuResult;
this.InitialEvent?.Invoke();
}
}
}