private void ActiveBoard(BoardCell bar, BoardState currentBoardState) { if (BoardState.UNSELECTED == currentBoardState) { return; } int panelrow = this._boardRowNumber; int panelcol = this._boardColNumber + 1; for (int i = panelrow - 1; i > -1; i--) { for (int j = 0; j < panelcol; j++) { this._boardList[i, j].BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); } } bar.BorderPainter = PainterFactory.GetPlainBoarderPainter("ACTIVE"); if (this.ActiveBoardEvent != null) { this.ActiveBoardEvent(this, new BoardLocateEventArgs(bar.RowId, bar.ColId, bar.Text)); } if (this.NotifyState != null && this._currentClickBoard != null) { this.NotifyState(currentBoardState, null); } }
private void ConfigureBoardCell(out BoardCell bc, int row, int col, TableLayoutPanel tbLayoutPanel) { string controlName = ""; bc = new BoardCell(row, col); bc.BackgroundPainter = PainterFactory.GetBoardStatePainter("UNSELECTED"); bc.BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); bc.ContextMenuStrip = this.cmsRightClick; bc.Dock = System.Windows.Forms.DockStyle.Fill; bc.ProgressType = ProgressODoom.ProgressType.Smooth; bc.ShowPercentage = false; if (col != 0) { controlName = this._posMapScheme.GetBoardName(row + 1, col); //controlName = 'L'+ (row + 1).ToString() + '-'+ col.ToString(); } else { controlName = 'F' + (row + 1).ToString(); } bc.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ProgressBarEx_MouseDown); bc.Text = controlName; bc.Name = "pbeBoardUC" + controlName; bc.Value = 0; tbLayoutPanel.Controls.Add(bc); }
private void ActiveProduct(ProgressBarEx bar) { foreach (ProgressBarEx productBar in this._progressBarList) { productBar.BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); } bar.BorderPainter = PainterFactory.GetPlainBoarderPainter("ACTIVE"); }
private void CreateBackgroundPainterDict() { bgPainterDict = new Dictionary <int, PlainBackgroundPainter>(); string[] state = new string[] { "EMPTY", "READY", "BURNIN", "PAUSE", "PASS", "FAIL" }; for (int i = 0; i < state.Length; i++) { bgPainterDict.Add(i, PainterFactory.GetProductStatePainter(state[i])); } }
private void ProductUC_Load(object sender, EventArgs e) { var tbLayoutPanel = new TableLayoutPanel(); tbLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); tbLayoutPanel.Name = "tlpProduct"; tbLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.OutsetDouble; tbLayoutPanel.ColumnCount = _seatCols; for (int i = 0; i < _seatCols; i++) { tbLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, (float)(100.0 / _seatCols))); } tbLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; tbLayoutPanel.Location = new System.Drawing.Point(0, 0); tbLayoutPanel.RowCount = _seatRows; for (int i = 0; i < _seatRows; i++) { tbLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, (float)(100.0 / _seatRows))); } tbLayoutPanel.Size = this.Parent.Size; tbLayoutPanel.TabIndex = 0; this.Controls.Add(tbLayoutPanel); _progressBarList = new ProgressBarEx[_productpositioncount]; tbLayoutPanel.SuspendLayout(); for (int i = 0; i < _productpositioncount; i++) { _progressBarList[i] = new ProgressBarEx(); _progressBarList[i].BackgroundPainter = PainterFactory.GetProductStatePainter("EMPTY"); _progressBarList[i].ProgressPainter = PainterFactory.GetProgressPainter("BURNIN"); _progressBarList[i].BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); _progressBarList[i].Dock = System.Windows.Forms.DockStyle.Fill; _progressBarList[i].Location = new System.Drawing.Point(6 + (i % _seatCols) * 166, 6 + (i / _seatCols) * 124); _progressBarList[i].MarqueePercentage = 25; _progressBarList[i].MarqueeSpeed = 30; _progressBarList[i].MarqueeStep = 1; _progressBarList[i].Maximum = 100; _progressBarList[i].Minimum = 0; _progressBarList[i].Name = "pbeProduct" + i.ToString(); _progressBarList[i].ProgressPadding = 0; _progressBarList[i].ProgressType = ProgressODoom.ProgressType.Smooth; _progressBarList[i].ShowPercentage = false; _progressBarList[i].Text = (i + 1).ToString() + ": "; _progressBarList[i].Value = 0; _progressBarList[i].MouseDown += new System.Windows.Forms.MouseEventHandler(this.ProgressBarEx_MouseDown); _progressBarList[i].ContextMenuStrip = null; tbLayoutPanel.Controls.Add(_progressBarList[i]); } tbLayoutPanel.ResumeLayout(false); }
public virtual IPainter GetPainter(Type type) { IPainter result = null; Dictionary <Type, IPainter> painterCache = PainterCache; painterCache.TryGetValue(type, out result); if (result == null) { result = PainterFactory.CreatePainter(type); if (result != null) { painterCache.Add(type, result); } else { painterCache.Add(type, PainterFactory.CreatePainter(typeof(string))); } } return(result); }
private void RefreshDutsStatus() { BoardState currentBoardState = this._model.GetBoardState(this.ActiveBoardName); if (currentBoardState != BoardState.SELECTED && currentBoardState != BoardState.UNSELECTED) { int dutCount = this._model.GetBoardSeatsCount(ActiveBoardName); string[] productStatus = this._model.GetProductStateOnBoard(ActiveBoardName); for (int i = 0; i < this._progressBarList.Length; i++) { if (i < dutCount) { int seat = i + 1; string sn = this._model.GetSnByPos(ActiveBoardName, seat); this._progressBarList[i].Text = seat + ": " + sn; this._progressBarList[i].BackgroundPainter = PainterFactory.GetProductStatePainter(productStatus[i]); this._progressBarList[i].Value = (productStatus[i] == "BURNIN") ? this._model.GetProgress(sn) : 0; this._progressBarList[i].ContextMenuStrip = (currentBoardState == BoardState.LOADED && productStatus[i] != "EMPTY")?this.cmsUnitDisable:null; } else { this._progressBarList[i].Text = (i + 1) + ": "; this._progressBarList[i].BackgroundPainter = PainterFactory.GetProductStatePainter("EMPTY"); this._progressBarList[i].Value = 0; this._progressBarList[i].ContextMenuStrip = null; } } } else { for (int i = 0; i < _progressBarList.Length; i++) { this._progressBarList[i].Text = (i + 1).ToString() + ": "; this._progressBarList[i].BackgroundPainter = PainterFactory.GetProductStatePainter("EMPTY"); this._progressBarList[i].Value = 0; } } }
private void PaintFirstRowUI() { for (int i = 0; i < BOARDCOLUMCOUNT; i++) { boardList[i] = new ProgressBarEx(); boardList[i].BackgroundPainter = bgPainterDict[i]; //differ boardList[i].BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); boardList[i].Dock = System.Windows.Forms.DockStyle.Fill; boardList[i].Location = new System.Drawing.Point(4 + BOARDCOLUMCOUNT * 54, 11);// + (i / BOARDCOLUMCOUNT) * 43); boardList[i].MarqueePercentage = 25; boardList[i].MarqueeSpeed = 30; boardList[i].MarqueeStep = 1; boardList[i].Maximum = 100; boardList[i].Minimum = 0; boardList[i].ProgressPadding = 0; boardList[i].ProgressType = ProgressODoom.ProgressType.Smooth; boardList[i].ShowPercentage = false; boardList[i].Name = "pbeProcessBarUC" + (BOARDCOLUMCOUNT + i).ToString(); boardList[i].Text = labelTextDict[i]; boardList[i].ForeColor = Color.Black; boardList[i].Font = new Font(FontFamily.GenericSansSerif, 8); this.tlpProcessBar.Controls.Add(boardList[i], i, 0); } }
public override void Refresh() { int panelrow = this._boardRowNumber; int panelcol = this._boardColNumber + 1; for (int row = panelrow - 1; row > -1; row--) { for (int col = 0; col < panelcol; col++) { BoardState state = this._model.GetBoardState(_boardList[row, col].Text); this._boardList[row, col].BackgroundPainter = PainterFactory.GetBoardStatePainter(state.ToString()); if (state == BoardState.UNSELECTED) { this._boardList[row, col].BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); } } } if (this.NotifyState != null && this._currentClickBoard != null) { this.NotifyState(this._model.GetBoardState(this.ActiveBoardName), null); } base.Refresh(); }