//数据的Load private void AutoTimer_Tick(object sender, EventArgs e) { try { //显示待机内容 if (_standbyContent && _UserControlID == 1) { this.GetFacSurevyFromXML(); FacMessageControl control = (FacMessageControl)this.mainLayout.GetControlFromPosition(0, 0); control.RTF = FacConfigMessage.CommonInfo; control.ValueRefresh(); } //显示综合看板 if (_comprehensivePanel && _UserControlID == 2) { FacProductMessageControlNew FacProductMessageControl = (FacProductMessageControlNew)this.mainLayout.GetControlFromPosition(0, 0); SetFacProductMessageControlValue(FacProductMessageControl); FacProductMessageControl.Dock = DockStyle.Fill; } //显示看板明细 if (_panelDetails && _UserControlID == 3) { WatchPanelDetails watchPanelDetail = (WatchPanelDetails)this.mainLayout.GetControlFromPosition(0, 0); SetPanelDetailsControlValue(watchPanelDetail); watchPanelDetail.Dock = DockStyle.Fill; } this.mainLayout.Refresh(); } catch { } }
//初始化看板显示 private void InitShowWatch() { //双屏显示时,选择第二屏显示 if (_ShowScreensNumber == 2) { //判断是否有第二屏 Screen[] allScreens = Screen.AllScreens; Screen currentScreen = Screen.FromRectangle(this.DisplayRectangle); bool isSecondScreen = false; if (allScreens.Length == 2) { isSecondScreen = true; } if (isSecondScreen) { this.DesktopLocation = Screen.AllScreens[1].Bounds.Location; this.FormBorderStyle = FormBorderStyle.None; this.DesktopBounds = Screen.AllScreens[1].Bounds; } } //是否要显示待机信息 if (_standbyContent) { FacMessageControl user = new FacMessageControl(); user.RTF = FacConfigMessage.CommonInfo; RefreshTableLayout(); this.mainLayout.Controls.Add(user, 0, 0); user.Dock = DockStyle.Fill; user.ValueRefresh(); _UserControlID = 1; return; } //显示综合看板 if (_comprehensivePanel) { FacProductMessageControlNew FacProductMessageControl = new FacProductMessageControlNew(); SetFacProductMessageControlValue(FacProductMessageControl); RefreshTableLayout(); this.mainLayout.Controls.Add(FacProductMessageControl, 0, 0); FacProductMessageControl.Dock = DockStyle.Fill; _UserControlID = 2; return; } //显示明细看板 if (_panelDetails) { WatchPanelDetails watchPanelDetail = new WatchPanelDetails(); SetPanelDetailsControlValue(watchPanelDetail); RefreshTableLayout(); this.mainLayout.Controls.Add(watchPanelDetail, 0, 0); watchPanelDetail.Dock = DockStyle.Fill; _UserControlID = 3; return; } }
//画面的切换 private void WatchTimer_Tick(object sender, EventArgs e) { try { #region 综合看板和看板明细之间的切换 if (_UserControlID == 1) { if (_standbyContent) { if (!this.mainLayout.GetControlFromPosition(0, 0).Name.Equals("FacMessageControl")) { this.GetFacSurevyFromXML(); this.mainLayout.Controls.Clear(); FacMessageControl control = new FacMessageControl(); control.RTF = FacConfigMessage.CommonInfo; this.mainLayout.Controls.Add(control, 0, 0); control.Dock = DockStyle.Fill; control.ValueRefresh(); _UserControlID = 3; return; } } _UserControlID = 3; } if (_UserControlID == 3) { if (_comprehensivePanel) { //if (!this.mainLayout.GetControlFromPosition(0, 0).Name.Equals("FacProductMessageControlNew")) //{ FacProductMessageControlNew FacProductMessageControl = new FacProductMessageControlNew(); SetFacProductMessageControlValue(FacProductMessageControl); RefreshTableLayout(); this.mainLayout.Controls.Add(FacProductMessageControl, 0, 0); FacProductMessageControl.Dock = DockStyle.Fill; _UserControlID = 2; return; //} } _UserControlID = 2; if (string.IsNullOrEmpty(_ssCode) && _ssCodeInWrokShopCode.Equals((_ssCodeListInWorkShop[_ssCodeListInWorkShop.Length - 1] as StepSequence).StepSequenceCode)) { AutoTimer_Tick(sender, e); } } #endregion if (_UserControlID == 2) { if (_panelDetails) { //if (!this.mainLayout.GetControlFromPosition(0, 0).Name.Equals("WatchPanelDetails")) //{ WatchPanelDetails watchPanelDetail = new WatchPanelDetails(); SetPanelDetailsControlValue(watchPanelDetail); RefreshTableLayout(); this.mainLayout.Controls.Add(watchPanelDetail, 0, 0); watchPanelDetail.Dock = DockStyle.Fill; _UserControlID = 1; return; // } } _UserControlID = 1; } if (_UserControlID == 1 && this.mainLayout.GetControlFromPosition(0, 0).Name.Equals("FacProductMessageControlNew") && _standbyContent) { this.GetFacSurevyFromXML(); this.mainLayout.Controls.Clear(); FacMessageControl control = new FacMessageControl(); control.RTF = FacConfigMessage.CommonInfo; this.mainLayout.Controls.Add(control, 0, 0); control.Dock = DockStyle.Fill; control.ValueRefresh(); _UserControlID = 3; return; } } catch { } }