| | |
| | | using HStation.WinFrmUI.Basic; |
| | | using HStation.WinFrmUI.Dict; |
| | | using IBox.WinFrmUI; |
| | | using NPOI.SS.Formula.Functions; |
| | | using PBS.WinFrmUI; |
| | | using PBS.WinFrmUI.Box; |
| | | using PBS.WinFrmUI.DataAnalysis; |
| | | using PBS.WinFrmUI.Hydro; |
| | | using Yw.WinFrmUI; |
| | | using Yw.WinFrmUI.Page; |
| | | using PBS.Vmo; |
| | | using PBS.WinFrmUI.Box; |
| | | |
| | | namespace PBS.Desktop |
| | | { |
| | |
| | | { |
| | | pguid = this.tabbedView1.ActiveDocument.Tag as PageGuid; |
| | | } |
| | | |
| | | SelectModular(tag, pguid); |
| | | } |
| | | |
| | |
| | | //if (!IsExistPage(guid, true)) |
| | | //{ |
| | | //} |
| | | |
| | | SelectModular("BasicData"); |
| | | var pageGuid = new PageGuid() |
| | | { |
| | | Modular = "Home", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "MapInfo", |
| | | }; |
| | | SelectModular("Home", pageGuid); |
| | | } |
| | | |
| | | //界面正在退出时确认 |
| | |
| | | } |
| | | } |
| | | |
| | | /* //智能硬件 |
| | | if (modular == "SmartHardware") |
| | | { |
| | | var guid = new PageGuid() |
| | | { |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "IBox", |
| | | }; |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var ibox = IBoxDataHelper.GetData(); |
| | | var page = new IBoxForm(ibox); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = "智能硬件"; |
| | | page.PageTitle.HeaderSvgImage = svgImgItem32[4]; |
| | | page.PageTitle.SvgImageSize = new Size(18, 18); |
| | | CreatePage(page, guid); |
| | | } |
| | | }*/ |
| | | |
| | | //初始功能列表 |
| | | this.accordionControlFunction.Elements.Clear(); |
| | | var list = GetAccordionElementList(modular); |
| | |
| | | { |
| | | var accEle = GetAccordionControlElement(element); |
| | | this.accordionControlFunction.Elements.Add(accEle); |
| | | } |
| | | |
| | | foreach (var element in list) |
| | | { |
| | | if (element.IsNormallyOpen && !IsExistPage(element.PageGuid, false)) |
| | | { |
| | | element.Click.Invoke(); |
| | | } |
| | | } |
| | | } |
| | | _sel_modular = modular; |
| | |
| | | ctrl_ele.OwnerElement.Expanded = true; |
| | | this.accordionControlFunction.Refresh(); |
| | | } |
| | | //if (!IsExistPage(pguid, true)) |
| | | //{ |
| | | // ele.Click.Invoke(); |
| | | //} |
| | | return true; |
| | | } |
| | | else |
| | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool _ibox_status = false; |
| | | |
| | | //获取 |
| | | private List<AccordionElement> GetAccordionElementList(string modular) |
| | |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new TemplateMgr(); |
| | | var page = new ModelTemplatePage(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | |
| | | |
| | | case "DataAnalysis": |
| | | { |
| | | var analysis = Get("能耗分析", new PageGuid() |
| | | { |
| | | Modular = "DataAnalysis", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "EnergyAnalysis", |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new EnergyAnalysis(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | } |
| | | }); |
| | | var analysis1 = Get("流量压力比对分析", new PageGuid() |
| | | { |
| | | Modular = "DataAnalysis", |
| | |
| | | CreatePage(page, guid); |
| | | } |
| | | }); |
| | | |
| | | list.Add(analysis); |
| | | list.Add(analysis1); |
| | | list.Add(analysis2); |
| | | } |
| | |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | var dlg = new PBS.WinFrmUI.Box.ChoiceFacilityDlg(); |
| | | dlg.SetDataSource(); |
| | | dlg.VisibleChanged += (bol) => |
| | | { |
| | | accordionElement_Facility.Enable = bol; |
| | |
| | | foreach (var ele in item.Elements) |
| | | { |
| | | ele.Enable = true; |
| | | _ibox_status = true; |
| | | } |
| | | } |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }); |
| | | AccordionElement accordionElement_IboxInfo = new(); |
| | | accordionElement_IboxInfo = Get("硬件详情", new PageGuid() |
| | | { |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "IBoxInfo", |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new IBoxInfoMgr(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | } |
| | | }, true); |
| | | |
| | | var accordionElement_Monitor = new AccordionElement() |
| | | { |
| | | Id = "monitor", |
| | | Caption = "检测分析", |
| | | Caption = "监测分析", |
| | | SvgImage = svgImgGroup32[0], |
| | | SvgImageSize = new Size(24, 24), |
| | | AllowGlyphSkinning = true, |
| | |
| | | { |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "DataProcessingMgr", |
| | | Function = "DataFilterMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new DataProcessingMgr(); |
| | | var page = new DataFilter(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | |
| | | CreatePage(page, guid); |
| | | } |
| | | }),Get("智控数据", new PageGuid() |
| | | }),/*Get("智控数据", new PageGuid() |
| | | { |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | } |
| | | }),Get("基础信息", new PageGuid() |
| | | })*/ |
| | | Get("基础信息", new PageGuid() |
| | | { |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | |
| | | } |
| | | }; |
| | | allAccordionElements.Add(accordionElement_DataManagement); |
| | | /* foreach (var item in allAccordionElements) |
| | | { |
| | | foreach (var ele in item.Elements) |
| | | { |
| | | ele.Enable = false; |
| | | } |
| | | }*/ |
| | | if (!_ibox_status) |
| | | { |
| | | foreach (var item in allAccordionElements) |
| | | { |
| | | foreach (var ele in item.Elements) |
| | | { |
| | | ele.Enable = false; |
| | | } |
| | | } |
| | | } |
| | | list.Add(accordionElement_Facility); |
| | | list.Add(accordionElement_IboxInfo); |
| | | list.Add(accordionElement_Monitor); |
| | | list.Add(accordionElement_DataManagement); |
| | | } |
| | | |
| | | break; |
| | | |
| | | case "Home": |
| | | { |
| | | AccordionElement accordionElement_Home = new(); |
| | | accordionElement_Home = Get("地图信息", new PageGuid() |
| | | { |
| | | Modular = "Home", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "MapInfo", |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new HomePbsProjectPage(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | } |
| | | }, true); |
| | | list.Add(accordionElement_Home); |
| | | } |
| | | break; |
| | | |
| | | default: |
| | |
| | | return list; |
| | | } |
| | | |
| | | private AccordionElement Get(string caption, PageGuid guid, SvgImage svg_img, Size size, Action<string, PageGuid, SvgImage, Size> action, bool glyph_skinning = true) |
| | | private AccordionElement Get(string caption, PageGuid guid, SvgImage svg_img, Size size, Action<string, PageGuid, SvgImage, Size> action, bool is_normally_open = false, bool glyph_skinning = true) |
| | | { |
| | | var ele = new AccordionElement(); |
| | | if (guid == null) |
| | |
| | | ele.SvgImage = svg_img; |
| | | ele.SvgImageSize = size; |
| | | ele.AllowGlyphSkinning = glyph_skinning; |
| | | ele.IsNormallyOpen = is_normally_open; |
| | | return ele; |
| | | } |
| | | |