| | |
| | | for (int i = 0; i < 6; i++) { |
| | | m_pBlLabels[i] = new CBLLabel(); |
| | | } |
| | | m_nBtnsFlashState6 = 0; |
| | | m_nBtnsFlashState8 = 0; |
| | | } |
| | | |
| | | CAxisSettingsDlg::~CAxisSettingsDlg() |
| | |
| | | m_bBusy = CToolUnits::getBit(pData[10 * 2 + 1], 0xB - 8); |
| | | m_bErr = CToolUnits::getBit(pData[10 * 2 + 1], 0xF - 8); |
| | | |
| | | // 记录按钮刷新状态 |
| | | // 6,7,8,9为原点和25个点位状态和完成状态 |
| | | // ZR 06.0 和 08.0 |
| | | // 回原点运动中,ZR06.0在0和1中切换,回原点完成, 08.0为1 |
| | | // 定位1 |
| | | // ZR 06.1 和 08.1 |
| | | // ... |
| | | int b = 6 * 2; |
| | | m_nBtnsFlashState6 = ((BYTE)pData[b] | (BYTE)pData[b + 1] << 8); |
| | | m_nBtnsFlashState6 |= ((BYTE)pData[b + 2] << 16 | (BYTE)pData[b + 3] << 24); |
| | | m_nBtnsFlashState8 = ((BYTE)pData[b + 4] | (BYTE)pData[b + 5] << 8); |
| | | m_nBtnsFlashState8 |= ((BYTE)pData[b + 6] << 16 | (BYTE)pData[b + 7] << 24); |
| | | |
| | | PostMessage(ID_MSG_UPDATA_DATA_TO_UI); |
| | | } |
| | | }; |
| | |
| | | m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_NORMAL, BTN_OPR_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_HOVER, BTN_OPR_BKGND_HOVER); |
| | | m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_PRESS, BTN_OPR_BKGND_PRESS); |
| | | static UINT btnPointIds[] = { IDC_BUTTON_AXIS_ANCHOR_POINT1, IDC_BUTTON_AXIS_ANCHOR_POINT2, |
| | | IDC_BUTTON_AXIS_ANCHOR_POINT3, IDC_BUTTON_AXIS_ANCHOR_POINT4, IDC_BUTTON_AXIS_ANCHOR_POINT5}; |
| | | for (int i = 0; i < 5; i++) { |
| | | m_pBlBtns[BTN_POINT1 + i]->SubclassDlgItem(btnPointIds[i], this); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_NORMAL, BTN_POINT_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_HOVER, BTN_POINT_FRAME_HOVER); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetFrameColor(BS_PRESS, BTN_POINT_FRAME_PRESS); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_NORMAL, BTN_POINT_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_HOVER, BTN_POINT_BKGND_HOVER); |
| | | m_pBlBtns[BTN_POINT1 + i]->SetBkgndColor(BS_PRESS, BTN_POINT_BKGND_PRESS); |
| | | } |
| | | |
| | | |
| | | // 初始化当前页面为第一页 |
| | | m_currentPage = 1; |
| | |
| | | handleAxisOperation(AxisOperationType::POSITION_1, true); |
| | | Sleep(200); |
| | | handleAxisOperation(AxisOperationType::POSITION_1, false); |
| | | m_pBlBtns[BTN_POINT1]->Flash(1000); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2() |
| | |
| | | handleAxisOperation(AxisOperationType::OPR, true); |
| | | Sleep(200); |
| | | handleAxisOperation(AxisOperationType::OPR, false); |
| | | m_pBlBtns[BTN_JOG_OPR]->Flash(1000); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisTestStop() |
| | |
| | | Sleep(200); |
| | | handleAxisOperation(AxisOperationType::STOP, false); |
| | | m_pBlBtns[BTN_JOG_OPR]->StopFlash(); |
| | | m_pBlBtns[BTN_POINT1]->StopFlash(); |
| | | m_pBlBtns[BTN_POINT2]->StopFlash(); |
| | | m_pBlBtns[BTN_POINT3]->StopFlash(); |
| | | m_pBlBtns[BTN_POINT3]->StopFlash(); |
| | | m_pBlBtns[BTN_POINT4]->StopFlash(); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisSev() |
| | |
| | | SetLabelColor(*m_pBlLabels[5], RGB(0, 180, 0)); |
| | | } |
| | | |
| | | |
| | | // OPR按钮是否要闪烁或停止闪烁 |
| | | // 06.0和08.0 |
| | | TRACE("m_nBtnsFlashState6 %x %x\n", m_nBtnsFlashState6, m_nBtnsFlashState8); |
| | | if (m_nBtnsFlashState6 & 0x01) { |
| | | // 06.0 |
| | | if (!m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & 0x01) { |
| | | if (m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | int v = 0x02; |
| | | if (m_currentPage > 1) { |
| | | v = v << (5 * (m_currentPage - 1)); |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & v) { |
| | | if (!m_pBlBtns[BTN_POINT1]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT1]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & v) { |
| | | if (m_pBlBtns[BTN_POINT1]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT1]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 1)) { |
| | | if (!m_pBlBtns[BTN_POINT2]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT2]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 1)) { |
| | | if (m_pBlBtns[BTN_POINT2]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT2]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 2)) { |
| | | if (!m_pBlBtns[BTN_POINT3]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT3]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 2)) { |
| | | if (m_pBlBtns[BTN_POINT3]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT3]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 3)) { |
| | | if (!m_pBlBtns[BTN_POINT4]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT4]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 3)) { |
| | | if (m_pBlBtns[BTN_POINT4]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT4]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 4)) { |
| | | if (!m_pBlBtns[BTN_POINT5]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT5]->Flash(1000); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 4)) { |
| | | if (m_pBlBtns[BTN_POINT5]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT5]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |