| | |
| | | using DevExpress.Utils.Extensions; |
| | | using DevExpress.Utils.Svg; |
| | | using DevExpress.XtraCharts; |
| | | using System.Collections.Concurrent; |
| | | using Yw.DAL.Basic; |
| | | using Yw.Vmo; |
| | | |
| | |
| | | private Dictionary<HydroWorkingVmo, bool> _allWorkingCheckedListDict = null;//所有工况选择列表字典 |
| | | private Dictionary<XhsSchemeVmo, Yw.Model.HydroModelInfo> _allSchemeHydroInfoDict = null;//所有方案水力信息列表 |
| | | private Dictionary<XhsSchemeVmo, Dictionary<HydroWorkingVmo, bool>> _allSchemeWorkingCheckedListDict = null;//所有方案工况选择列表字典 |
| | | private readonly object _locker = new();//锁定对象 |
| | | private ConcurrentDictionary<string, bool> _gettingHydroInfoDict = new ConcurrentDictionary<string, bool>();//获取水力信息字典 |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | |
| | | if (_hydroInfo == null) |
| | | { |
| | | hydroInfo = await GetHydroInfo(null); |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_hydroInfo == null) |
| | | { |
| | | _hydroInfo = hydroInfo; |
| | |
| | | if (!_allSchemeHydroInfoDict.ContainsKey(scheme)) |
| | | { |
| | | hydroInfo = await GetHydroInfo(scheme); |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (!_allSchemeHydroInfoDict.ContainsKey(scheme)) |
| | | { |
| | | _allSchemeHydroInfoDict.Add(scheme, hydroInfo); |
| | |
| | | { |
| | | return default; |
| | | } |
| | | string key = $"{_project.ID}-{_projectSite.ID}-{scheme?.ID}"; |
| | | if (_gettingHydroInfoDict.TryGetValue(key, out bool getting)) |
| | | { |
| | | if (getting) |
| | | { |
| | | return default; |
| | | } |
| | | } |
| | | if (!_gettingHydroInfoDict.TryAdd(key, true)) |
| | | { |
| | | _gettingHydroInfoDict[key] = true; |
| | | } |
| | | |
| | | HydroModelRelationVmo relation = null; |
| | | if (scheme == null) |
| | |
| | | return default; |
| | | } |
| | | var hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(relation.ModelID); |
| | | _gettingHydroInfoDict[key] = false; |
| | | return hydroInfo; |
| | | } |
| | | |
| | |
| | | elementWorking.Click += async (sender, e) => |
| | | { |
| | | var hydroInfo = await GetHydroInfo(null, true); |
| | | if (hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | this.ShowProjectSiteWorkingEvent?.Invoke(_project, _projectSite, null, hydroInfo, working, this.svgImg32[4]); |
| | | }; |
| | | this.elementProjectSiteSimulation.Elements.Add(elementWorking); |
| | |
| | | elementWorking.Click += async (sender, e) => |
| | | { |
| | | var hydroInfo = await GetHydroInfo(scheme, true); |
| | | if (hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | this.ShowProjectSiteWorkingEvent?.Invoke(_project, _projectSite, scheme, hydroInfo, working, this.svgImg32[4]); |
| | | }; |
| | | elementScheme.Elements.Add(elementWorking); |