using Yw.Vmo;
namespace HStation.WinFrmUI
{
///
/// 监测点辅助类
///
public class SimulationMonitorHelper
{
///
///
///
public SimulationMonitorHelper(SimulationVisualListHelper visualListHelper)
{
_visualListHelper = visualListHelper;
}
private SimulationVisualListHelper _visualListHelper = null;//可见构件列表辅助类
private List _allMonitorList = null;//所有监测点列表
///
/// 获取
///
public async Task> Get()
{
if (_allMonitorList == null)
{
_allMonitorList = await BLLFactory.Instance.GetByModelID(_visualListHelper.HydroInfo.ID);
if (_allMonitorList == null)
{
_allMonitorList = new List();
}
}
return _allMonitorList;
}
///
/// 更新
///
public async Task> Update(string code)
{
var allMonitorList = await Get();
allMonitorList.RemoveAll(x => x.Relation == code);
var monitorList = await BLLFactory.Instance.GetByRelation(_visualListHelper.HydroInfo.ID, code);
if (monitorList != null && monitorList.Count > 0)
{
allMonitorList.AddRange(monitorList);
}
return monitorList;
}
}
}