using DevExpress.Utils.Extensions; using System.Collections.Generic; namespace IStation.WinFrmUI.Monitor { public partial class MonitorMgrPage : DocumentPage { public MonitorMgrPage() { InitializeComponent(); this.PageTitle.Caption = "监测数据"; this.SurfaceGuid = new SurfaceGuid() { Modular = eModular.Basic, Function = this.PageTitle.Caption }; } private Dictionary _tabRibbon = null; /// /// 初始化数据 /// public override void InitialDataSource() { WaitFrmHelper.ShowWaitForm(); this.tabPane1.SelectedPage = this.tabNavigationPage1; this.dataScreeningChartCtrl1.SetBindingData(); _tabRibbon = new Dictionary() { {this.tabNavigationPage1,this.ribbonPageGroupScreening }, {this.tabNavigationPage3,this.ribbonPageGroupDataList }, }; WaitFrmHelper.HideWaitForm(); } /// /// 刷新数据 /// public override void RefreshDataSource() { } //页面变换 private bool _initialPage2 = false; private bool _initialPage3 = false; private void tabPane1_SelectedPageChanged(object sender, DevExpress.XtraBars.Navigation.SelectedPageChangedEventArgs e) { if (_tabRibbon == null) return; var page = (DevExpress.XtraBars.Navigation.TabNavigationPage)e.Page; if(page == tabNavigationPage2 && !_initialPage2) { WaitFrmHelper.ShowWaitForm(); _initialPage2 = true; this.dataComparisonCharCtrl1.SetBindingData(); WaitFrmHelper.HideWaitForm(); } if (page == tabNavigationPage3 && !_initialPage3) { WaitFrmHelper.ShowWaitForm(); _initialPage3 = true; this.dataListGridCtrl1.SetBindingData(); WaitFrmHelper.HideWaitForm(); } if (!_tabRibbon.ContainsKey(page)) { this.ribbonPage1.Groups.ForEach(x => { if (x != this.ribbonPageGroupDefault) { x.Visible = false; } }); } else { _tabRibbon[page].Visible = true; } } //导入数据 private void barImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { MonitorDataImportHelper.Import(); } //刷新数据 private void barBtnReload_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.dataScreeningChartCtrl1.SetBindingData(); } private void barBtnAnalysisAndSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if(_initialPage3) this.dataListGridCtrl1.AnalysisAndSave(); } } }