| | |
| | | /// </summary> |
| | | public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, Yw.Model.HydroModelInfo, Dictionary<HydroWorkingVmo, bool>, SvgImage> ShowProjectSiteSimulationEvent; |
| | | /// <summary> |
| | | /// 显示项目站工况事件 |
| | | /// </summary> |
| | | public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, Yw.Model.HydroModelInfo, HydroWorkingVmo, SvgImage> ShowProjectSiteWorkingEvent; |
| | | /// <summary> |
| | | /// 项目站工况选择改变事件 |
| | | /// </summary> |
| | | public event Action<XhsProjectVmo, XhsProjectSiteVmo, XhsSchemeVmo, HydroWorkingVmo, bool> ProjectSiteWorkingCheckedEvent; |
| | |
| | | /// <summary> |
| | | /// 创建项目站方案事件 |
| | | /// </summary> |
| | | public event Action<XhsProjectVmo, XhsProjectSiteVmo, Yw.Model.HydroModelInfo, SvgImage> CreateProjectSiteSchemeEvent; |
| | | public event Action<XhsProjectVmo, XhsProjectSiteVmo, Yw.Model.HydroModelInfo, List<XhsSchemeVmo>, SvgImage> CreateProjectSiteSchemeEvent; |
| | | /// <summary> |
| | | /// 项目站方案增加事件 |
| | | /// </summary> |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.CreateProjectSiteSchemeEvent?.Invoke(_project, _projectSite, hydroInfo, this.svgImg32[3]); |
| | | var allSchemeList = _allSchemeHydroInfoDict?.Keys.ToList(); |
| | | this.CreateProjectSiteSchemeEvent?.Invoke(_project, _projectSite, hydroInfo, allSchemeList, this.svgImg32[3]); |
| | | } |
| | | |
| | | //右键弹出 |
| | |
| | | } |
| | | } |
| | | |
| | | var overlay = this.ShowOverlay(); |
| | | WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载模型数据,请稍后..."); |
| | | //var overlay = this.ShowOverlay(); |
| | | if (!_gettingHydroInfoDict.TryAdd(key, true)) |
| | | { |
| | | _gettingHydroInfoDict[key] = true; |
| | |
| | | { |
| | | return default; |
| | | } |
| | | //var hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(relation.ModelID); |
| | | var hydroInfo = await HStation.BLL.XhsHydroInfo.GetByID(relation.ModelID); |
| | | var hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(relation.ModelID); |
| | | _gettingHydroInfoDict[key] = false; |
| | | overlay.Close(); |
| | | |
| | | //overlay.Close(); |
| | | WaitFormHelper.HideWaitForm(); |
| | | return hydroInfo; |
| | | } |
| | | |
| | |
| | | elementWorking.Text = working.Name; |
| | | elementWorking.Hint = working.Description; |
| | | elementWorking.Tag = working; |
| | | elementWorking.Click += async (sender, e) => |
| | | elementWorking.Click += (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); |
| | | this.elementProjectSiteSimulation.Style = DevExpress.XtraBars.Navigation.ElementStyle.Group; |
| | |
| | | elementWorking.Text = working.Name; |
| | | elementWorking.Hint = working.Description; |
| | | elementWorking.Tag = working; |
| | | elementWorking.Click += async (sender, e) => |
| | | elementWorking.Click += (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); |
| | | elementScheme.Style = DevExpress.XtraBars.Navigation.ElementStyle.Group; |
| | |
| | | return; |
| | | } |
| | | this.ShowProjectSiteInfoEvent?.Invoke(_project, _projectSite, hydroInfo, this.svgImg32[0]); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | public async Task<Yw.Model.HydroModelInfo> SaveModel(XhsSchemeVmo scheme, Yw.Model.HydroModelInfo hydroInfo) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | //var id = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo); |
| | | var id = await HStation.BLL.XhsHydroInfo.Save(hydroInfo); |
| | | if (id < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var db = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(id); |
| | | if (scheme == null) |
| | | { |
| | | _hydroInfo = db; |
| | | return _hydroInfo; |
| | | } |
| | | if (_allSchemeHydroInfoDict == null || _allSchemeHydroInfoDict.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var schemeKey = _allSchemeHydroInfoDict.Keys.FirstOrDefault(x => x.ID == scheme.ID); |
| | | if (schemeKey == null) |
| | | { |
| | | return default; |
| | | } |
| | | _allSchemeHydroInfoDict[schemeKey] = db; |
| | | return db; |
| | | } |
| | | |
| | | /// <summary> |