private void padStatus(BOARD_ZONE zone, int x, int y, PAD_STATUS status) { if (this.panelStatus.InvokeRequired) { padStatus_Call d = new padStatus_Call(padStatus); this.panelStatus.BeginInvoke(d, new object[] { zone, x, y, status }); } else { if (zone == boardZone) { refresh(x, y, status); } } }
public void refresh() { //if (editFlag) //{ // LB_StatusApply.Text = "Apply:"; padStatus = padApplyStatus; //} //else //{ // LB_StatusApply.Text = "State:"; // padStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn); //} TB_Row.Text = (indexRow + 1).ToString(); TB_Column.Text = (indexColumn + 1).ToString(); if (padStatus == PAD_STATUS.INVALID) { BT_PadStatus.BackColor = Color.White; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Not Ready"; } else if (padStatus == PAD_STATUS.READY) { BT_PadStatus.BackColor = UtilityControl.colorCode[(int)COLORCODE.READY]; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Ready"; } else if (padStatus == PAD_STATUS.SKIP) { BT_PadStatus.BackColor = UtilityControl.colorCode[(int)COLORCODE.SKIP]; BT_PadStatus.ForeColor = Color.White; BT_PadStatus.Text = "Skip"; } else if (padStatus == PAD_STATUS.ATTACH_DONE) { BT_PadStatus.BackColor = UtilityControl.colorCode[(int)COLORCODE.ATTACH_OK]; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Attach Done"; } else if (padStatus == PAD_STATUS.ATTACH_FAIL) { BT_PadStatus.BackColor = UtilityControl.colorCode[(int)COLORCODE.ATTACH_FAIL]; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Attach Fail"; } else if (padStatus == PAD_STATUS.TILT_OK) { BT_PadStatus.BackColor = UtilityControl.colorCode[(int)COLORCODE.TILT_OK]; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Tilt OK"; } else { BT_PadStatus.BackColor = Color.White; BT_PadStatus.ForeColor = Color.Black; BT_PadStatus.Text = "Not Ready"; } }
private void refresh(int x, int y, PAD_STATUS status) { // CornflowerBlue. DodgerBlue Color color; if (WorkAreaControl.workArea[x, y] == 1) { if (status == PAD_STATUS.INVALID) { color = Color.White; btnArray[x, y].Text = "Not Ready"; } else if (status == PAD_STATUS.SKIP) { color = UtilityControl.colorCode[(int)COLORCODE.SKIP]; btnArray[x, y].Text = "Skip"; } else if (status == PAD_STATUS.READY) { color = UtilityControl.colorCode[(int)COLORCODE.READY]; btnArray[x, y].Text = "Ready"; } else if (status == PAD_STATUS.ATTACH_DONE) { color = UtilityControl.colorCode[(int)COLORCODE.ATTACH_OK]; btnArray[x, y].Text = "Attach Done"; } // else if (status == PAD_STATUS.PRE_VISION_ERROR) { color = Color.Yellow; btnArray[x, y].Text = "PreInspection Error"; } else if (status == PAD_STATUS.PCB_ERROR) { color = UtilityControl.colorCode[(int)COLORCODE.PCB_SIZE_ERR]; btnArray[x, y].Text = "PCB Size Error"; } else if (status == PAD_STATUS.BARCODE_ERROR) { color = UtilityControl.colorCode[(int)COLORCODE.BARCODE_ERR]; btnArray[x, y].Text = "Barcode Error"; } else if (status == PAD_STATUS.EPOXY_NG) { color = UtilityControl.colorCode[(int)COLORCODE.NO_EPOXY]; btnArray[x, y].Text = "No Epoxy"; } else if (status == PAD_STATUS.EPOXY_UNDER_FILL) { color = UtilityControl.colorCode[(int)COLORCODE.EPOXY_UNDERFLOW]; btnArray[x, y].Text = "Epoxy Underflow"; } else if (status == PAD_STATUS.EPOXY_OVER_FILL) { color = UtilityControl.colorCode[(int)COLORCODE.EPOXY_OVERFLOW]; btnArray[x, y].Text = "Epoxy Overflow"; } else if (status == PAD_STATUS.EPOXY_POS_ERROR) { color = UtilityControl.colorCode[(int)COLORCODE.EPOXY_POS_ERR]; btnArray[x, y].Text = "Epoxy Position Error"; } else if (status == PAD_STATUS.EPOXY_SHAPE_ERROR) { color = UtilityControl.colorCode[(int)COLORCODE.EPOXY_SHAPE_ERROR]; btnArray[x, y].Text = "Epoxy Shape Error"; } else if (status == PAD_STATUS.ATTACH_FAIL) { color = UtilityControl.colorCode[(int)COLORCODE.ATTACH_FAIL]; btnArray[x, y].Text = "Attach Fail"; } else if (status == PAD_STATUS.ATTACH_UNDERPRESS) { color = UtilityControl.colorCode[(int)COLORCODE.ATTACH_UNDERPRESS]; btnArray[x, y].Text = "Attach Underpress"; } else if (status == PAD_STATUS.ATTACH_OVERPRESS) { color = UtilityControl.colorCode[(int)COLORCODE.ATTACH_OVERPRESS]; btnArray[x, y].Text = "Attach Overpress"; } else if (status == PAD_STATUS.PEDESTAL_SUC_ERR) { color = UtilityControl.colorCode[(int)COLORCODE.PEDESTAL_SUC_ERR]; btnArray[x, y].Text = "Pedestal Suction Fail"; } else if (status == PAD_STATUS.TILT_OK) { color = UtilityControl.colorCode[(int)COLORCODE.TILT_OK]; btnArray[x, y].Text = "Tilt OK"; } else if (status == PAD_STATUS.PRESS_READY) { color = Color.HotPink; btnArray[x, y].Text = "Press Ready"; } else { color = Color.Red; btnArray[x, y].Text = "Invalid"; } // 색을 동일하게 해서 Text가 보이지 않도록 만든다. Text는 Mouse Hovering할때 X,Y 인덱스와 부품의 현재 상태 정보를 표시하도록 한다. } else { color = Color.Transparent; btnArray[x, y].Text = "DISABLED"; } btnArray[x, y].BackColor = color; btnArray[x, y].ForeColor = color; }
//BOARD_WORK_DATA localWorkEdit = new BOARD_WORK_DATA(); // BOARD_WORK_DATA prevBoardStatus; private void Control_Click(object sender, EventArgs e) { if (windowState) { EVENT.hWindow2Display(); } if (sender.Equals(BT_Close)) { //FormSelect ff = new FormSelect(); FormUserMessage ff = new FormUserMessage(); ff.SetDisplayItems(DIAG_SEL_MODE.YesNoCancel, DIAG_ICON_MODE.QUESTION, textResource.MB_ETC_PARA_SAVE); //MainForm.UserMessageBox(DIAG_SEL_MODE.YesNoCancel, DIAG_ICON_MODE.QUESTION, "변경된 데이터를 Update할까요?", "[Tray Edit] : "); ff.ShowDialog(); ret.usrDialog = FormUserMessage.diagResult; //mc.message.YesNoCancel("변경된 데이터를 Update할까요?", out ret.dialog, "[Tray Edit] : "); if (ret.usrDialog == DIAG_RESULT.Yes) { // 20130513 , Update 시 한번더 로그인 하도록 추가 //FormLogIn fl = new FormLogIn(); //fl.ShowDialog(); //if (FormLogIn.logInCheck == false) return; //else //{ //mc.para.paraLogWrite(mc.user.userName + "로그인"); UpdateWorkData(); //mc.para.paraLogWrite(); //} } else if (ret.usrDialog == DIAG_RESULT.No) { ; } else { goto EXIT; } IsDisplayed = false; editFlag = false; EVENT.boardStatus(BOARD_ZONE.WORKING, mc.board.padStatus(BOARD_ZONE.WORKING), (int)mc.para.MT.padCount.x.value, (int)mc.para.MT.padCount.y.value); this.Close(); } if (sender.Equals(BT_Empty)) { editFlag = false; //mc.board.padStatus(BOARD_ZONE.WORKING, indexRow, indexColumn, PAD_STATUS.INVALID, out ret.b); } if (sender.Equals(BT_Ready)) { editFlag = true; padApplyStatus = PAD_STATUS.READY; //mc.board.padStatus(BOARD_ZONE.WORKING, indexRow, indexColumn, PAD_STATUS.READY, out ret.b); } if (sender.Equals(BT_Skip)) { editFlag = true; padApplyStatus = PAD_STATUS.SKIP; //mc.board.padStatus(BOARD_ZONE.WORKING, indexRow, indexColumn, PAD_STATUS.SKIP, out ret.b); } if (sender.Equals(BT_AttachDone)) { editFlag = true; padApplyStatus = PAD_STATUS.ATTACH_DONE; //mc.board.padStatus(BOARD_ZONE.WORKING, indexRow, indexColumn, PAD_STATUS.PLACE, out ret.b); } if (sender.Equals(BT_AttachFail)) { editFlag = true; padApplyStatus = PAD_STATUS.ATTACH_FAIL; //mc.board.padStatus(BOARD_ZONE.WORKING, indexRow, indexColumn, PAD_STATUS.PLACE_ERROR, out ret.b); } if (sender.Equals(BT_PadStatus)) { { if (editFlag) { //editFlag = false; if (CB_AllChange.Checked) { mc.message.OkCancel(textResource.MB_ETC_UPDATE_TRAY_INFO_ALL, out ret.dialog, "[Tray Edit] : "); if (ret.dialog != System.Windows.Forms.DialogResult.OK) { goto EXIT; } for (int i = 0; i < (int)mc.para.MT.padCount.x.value; i++) { for (int j = 0; j < (int)mc.para.MT.padCount.y.value; j++) { if (WorkAreaControl.workArea[i, j] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, i, j, padApplyStatus, out ret.b); } } } } else { if (WorkAreaControl.workArea[indexRow, indexColumn] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn, padApplyStatus, out ret.b); } } BoardStatus_WorkArea.backupPadStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT); } } } if (sender.Equals(BT_Left)) { //editFlag = false; if (mc.para.mcType.FrRr == McTypeFrRr.FRONT) { indexRow--; if (indexRow < 0) { indexRow = 0; } } else { indexRow++; if (indexRow >= (int)mc.para.MT.padCount.x.value) { indexRow = (int)mc.para.MT.padCount.x.value - 1; } } BoardStatus_WorkArea.SelectChange(indexRow, indexColumn); if (editFlag) { if (WorkAreaControl.workArea[indexRow, indexColumn] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn, padApplyStatus, out ret.b); BoardStatus_WorkArea.backupPadStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT); } } } if (sender.Equals(BT_Right)) { //editFlag = false; if (mc.para.mcType.FrRr == McTypeFrRr.FRONT) { indexRow++; if (indexRow >= (int)mc.para.MT.padCount.x.value) { indexRow = (int)mc.para.MT.padCount.x.value - 1; } } else { indexRow--; if (indexRow < 0) { indexRow = 0; } } BoardStatus_WorkArea.SelectChange(indexRow, indexColumn); if (editFlag) { if (WorkAreaControl.workArea[indexRow, indexColumn] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn, padApplyStatus, out ret.b); BoardStatus_WorkArea.backupPadStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT); } } } if (sender.Equals(BT_Up)) { //editFlag = false; if (mc.para.mcType.FrRr == McTypeFrRr.FRONT) { indexColumn++; if (indexColumn >= (int)mc.para.MT.padCount.y.value) { indexColumn = (int)mc.para.MT.padCount.y.value - 1; } } else { indexColumn--; if (indexColumn < 0) { indexColumn = 0; } } BoardStatus_WorkArea.SelectChange(indexRow, indexColumn); if (editFlag) { if (WorkAreaControl.workArea[indexRow, indexColumn] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn, padApplyStatus, out ret.b); BoardStatus_WorkArea.backupPadStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT); } } } if (sender.Equals(BT_Down)) { //editFlag = false; if (mc.para.mcType.FrRr == McTypeFrRr.FRONT) { indexColumn--; if (indexColumn < 0) { indexColumn = 0; } } else { indexColumn++; if (indexColumn >= (int)mc.para.MT.padCount.y.value) { indexColumn = (int)mc.para.MT.padCount.y.value - 1; } } BoardStatus_WorkArea.SelectChange(indexRow, indexColumn); if (editFlag) { if (WorkAreaControl.workArea[indexRow, indexColumn] == 1) // WorkArea값이 1일때만 업데이트 { mc.board.padStatus(BOARD_ZONE.WORKEDIT, indexRow, indexColumn, padApplyStatus, out ret.b); BoardStatus_WorkArea.backupPadStatus = mc.board.padStatus(BOARD_ZONE.WORKEDIT); } } } EXIT: refresh(); }