| | |
| | | using HStation.WinFrmUI.Assets; |
| | | 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; |
| | | using MathNet.Numerics.LinearAlgebra.Factorization; |
| | | using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; |
| | | |
| | | namespace PBS.Desktop |
| | | { |
| | |
| | | { |
| | | pguid = this.tabbedView1.ActiveDocument.Tag as PageGuid; |
| | | } |
| | | |
| | | SelectModular(tag, pguid); |
| | | } |
| | | |
| | |
| | | //界面记载事件 |
| | | private void MainForm_Load(object sender, EventArgs e) |
| | | { |
| | | var homeGuid = new PageGuid(); |
| | | var HomePage = new HomeXhsProjectPage(); |
| | | HomePage.PageGuid = homeGuid; |
| | | HomePage.PageTitle.Caption = "首页"; |
| | | // HomePage.PageTitle.HeaderSvgImage = svg; |
| | | // HomePage.PageTitle.SvgImageSize = size; |
| | | if (!IsExistPage(homeGuid, true)) |
| | | { |
| | | CreatePage(HomePage, homeGuid); |
| | | } |
| | | } |
| | | |
| | | //界面显示事件 |
| | |
| | | //if (!IsExistPage(guid, true)) |
| | | //{ |
| | | //} |
| | | |
| | | SelectModular("Home"); |
| | | var pageGuid = new PageGuid() |
| | | { |
| | | Modular = "Home", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "MapInfo", |
| | | }; |
| | | SelectModular("Home", pageGuid); |
| | | } |
| | | |
| | | //界面正在退出时确认 |
| | |
| | | //初始功能列表 |
| | | this.accordionControlFunction.Elements.Clear(); |
| | | var list = GetAccordionElementList(modular); |
| | | this.accordionControlFunction.Elements.Clear(); |
| | | if (list != null && list.Count > 0) |
| | | { |
| | | foreach (var element in list) |
| | | { |
| | | 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; |
| | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool _ibox_status = false; |
| | | |
| | | //获取 |
| | | private List<AccordionElement> GetAccordionElementList(string modular) |
| | |
| | | CreatePage(page,guid); |
| | | } |
| | | }), |
| | | Get("电费配置",new PageGuid() |
| | | { |
| | | Modular = "BasicData", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "ElecPriceMgr", |
| | | }, svgImgItem32[12], new Size(18, 18), (caption,guid,svg,size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page=new ElecPriceMgr(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page,guid); |
| | | } |
| | | }), |
| | | } |
| | | }; |
| | | |
| | |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | |
| | | } |
| | | }); |
| | | var modelEdit = Get("模型编辑", new PageGuid() |
| | | { |
| | | Modular = "ModelManage", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = " ", |
| | | Function = "ModelEdit", |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new ModelEditPage(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | } |
| | | }); |
| | | list.Add(hydraulicScenario); |
| | |
| | | CreatePage(page, guid); |
| | | } |
| | | }); |
| | | //var simulationDrill = Get("模拟调度", new PageGuid() |
| | | //{ |
| | | // Modular = "WaterSupplyAnalysis", |
| | | // MoudingType = eMoudingType.Tab, |
| | | // Function = "SimulationSchedule", |
| | | //}, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | //{ |
| | | // if (!IsExistPage(guid, true)) |
| | | // { |
| | | // var page = new SimulationSchedulePage(); |
| | | // page.PageGuid = guid; |
| | | // page.PageTitle.Caption = caption; |
| | | // page.PageTitle.HeaderSvgImage = svg; |
| | | // page.PageTitle.SvgImageSize = size; |
| | | // CreatePage(page, guid); |
| | | // } |
| | | //}); |
| | | var forecastWater = Get("水量预测", new PageGuid() |
| | | { |
| | | Modular = "WaterSupplyAnalysis", |
| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | |
| | | case "SmartHardware": |
| | | { |
| | | var guid = new PageGuid(); |
| | | guid.Modular = "SmartHardware"; |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new IBoxHomeMgr(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = "硬件详情"; |
| | | // page.PageTitle.HeaderSvgImage = svg; |
| | | // page.PageTitle.SvgImageSize = size; |
| | | CreatePage(page, guid); |
| | | } |
| | | // 创建一个列表来存储所有需要操作的 AccordionElement 对象 |
| | | List<AccordionElement> allAccordionElements = new List<AccordionElement>(); |
| | | AccordionElement accordionElement_Facility = new(); |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "FlowPressAnalysis", |
| | | }, svgImgItem32[4], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[7], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | var dlg = new PBS.WinFrmUI.Box.ChoiceFacilityDlg(); |
| | | dlg.SetDataSource(); |
| | |
| | | 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", |
| | | }, svgImageIBox[10], 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 = "监测分析", |
| | | SvgImage = svgImgGroup32[0], |
| | | SvgImage = svgImageIBox[4], |
| | | SvgImageSize = new Size(24, 24), |
| | | AllowGlyphSkinning = true, |
| | | Elements = new List<AccordionElement>() |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "MonitorMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[3], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "AnalysisMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[1], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | { |
| | | Id = "management", |
| | | Caption = "数据管理", |
| | | SvgImage = svgImgGroup32[0], |
| | | SvgImage = svgImageIBox[9], |
| | | SvgImageSize = new Size(24, 24), |
| | | AllowGlyphSkinning = true, |
| | | Elements = new List<AccordionElement>() |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "ProtocolMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[11], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "MonitorConfigurationMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[5], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "DataFilterMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | },svgImageIBox[8], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | | var page = new IBoxFormDataFilter(); |
| | | var page = new DataFilter(); |
| | | page.PageGuid = guid; |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "ParameterMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[0], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | page.PageTitle.Caption = caption; |
| | | page.PageTitle.HeaderSvgImage = svg; |
| | | page.PageTitle.SvgImageSize = size; |
| | | |
| | | CreatePage(page, guid); |
| | | } |
| | | }),/*Get("智控数据", new PageGuid() |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "BasicInfoMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | Modular = "SmartHardware", |
| | | MoudingType = eMoudingType.Tab, |
| | | Function = "LogManagentMgr", |
| | | }, svgImgItem32[2], new Size(18, 18), (caption, guid, svg, size) => |
| | | }, svgImageIBox[6], new Size(18, 18), (caption, guid, svg, size) => |
| | | { |
| | | if (!IsExistPage(guid, true)) |
| | | { |
| | |
| | | } |
| | | }; |
| | | allAccordionElements.Add(accordionElement_DataManagement); |
| | | foreach (var item in allAccordionElements) |
| | | if (!_ibox_status) |
| | | { |
| | | foreach (var ele in item.Elements) |
| | | foreach (var item in allAccordionElements) |
| | | { |
| | | ele.Enable = false; |
| | | 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); |
| | | } |
| | |
| | | |
| | | case "Home": |
| | | { |
| | | var homeGuid = new PageGuid(); |
| | | var HomePage = new HomeXhsProjectPage(); |
| | | HomePage.PageGuid = homeGuid; |
| | | HomePage.PageTitle.Caption = "首页"; |
| | | // HomePage.PageTitle.HeaderSvgImage = svg; |
| | | // HomePage.PageTitle.SvgImageSize = size; |
| | | if (!IsExistPage(homeGuid, true)) |
| | | AccordionElement accordionElement_Home = new(); |
| | | accordionElement_Home = Get("地图信息", new PageGuid() |
| | | { |
| | | CreatePage(HomePage, homeGuid); |
| | | } |
| | | 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; |
| | | |
| | |
| | | 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; |
| | | } |
| | | |