| | |
| | | |
| | | // CAxisSettingsDlg 对话框 |
| | | |
| | | IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CDialogEx) |
| | | IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CBaseDlg) |
| | | |
| | | CAxisSettingsDlg::CAxisSettingsDlg(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DIALOG_AXIS_SETTINGS, pParent) |
| | | : CBaseDlg(IDD_DIALOG_AXIS_SETTINGS, pParent) |
| | | { |
| | | m_nInitialWidth = 0; |
| | | m_nInitialHeight = 0; |
| | | m_pPLC = nullptr; |
| | | |
| | | m_bSEV = FALSE; |
| | |
| | | m_bReady = FALSE; |
| | | m_bBusy = FALSE; |
| | | m_bErr = FALSE; |
| | | |
| | | for (int i = 0; i < BTN_MAX; i++) { |
| | | m_pBlBtns[i] = new CBlButton(); |
| | | } |
| | | |
| | | for (int i = 0; i < EDIT_MAX; i++) { |
| | | m_pRegexEdit[i] = new CRegexEdit(); |
| | | } |
| | | |
| | | for (int i = 0; i < LABEL_MAX; i++) { |
| | |
| | | |
| | | CAxisSettingsDlg::~CAxisSettingsDlg() |
| | | { |
| | | for (auto& pair : m_mapFonts) { |
| | | if (pair.second) { |
| | | pair.second->DeleteObject(); |
| | | delete pair.second; |
| | | } |
| | | } |
| | | m_mapFonts.clear(); |
| | | |
| | | for (int i = 0; i < BTN_MAX; i++) { |
| | | delete m_pBlBtns[i]; |
| | | } |
| | | |
| | | for (int i = 0; i < EDIT_MAX; i++) { |
| | | delete m_pRegexEdit[i]; |
| | | } |
| | | |
| | | for (int i = 0; i < LABEL_MAX; i++) { |
| | |
| | | |
| | | void CAxisSettingsDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | CBaseDlg::DoDataExchange(pDX); |
| | | DDX_Control(pDX, IDC_COMBO_AXIS_NAME, m_comboAxisNO); |
| | | DDX_Control(pDX, IDC_STATIC_AXIS_NUMBER, m_staticAxisNO); |
| | | DDX_Control(pDX, IDC_STATIC_AXIS_DESCRIP, m_staticAxisDescription); |
| | | DDX_Control(pDX, IDC_STATIC_START_ADDRESS, m_staticStartAddress); |
| | | DDX_Control(pDX, IDC_EDIT_AXIS_MODITFY_POS, m_editManualSpeed); |
| | | DDX_Control(pDX, IDC_EDIT_AXIS_MODITFY_AUTO_SPEED, m_editAutoSpeed); |
| | | DDX_Control(pDX, IDC_EDIT_AXIS_MODITFY_ACCE_TIME, m_editAccelerationTime); |
| | | DDX_Control(pDX, IDC_EDIT_AXIS_MODITFY_DECE_TIME, m_editDecelerationTime); |
| | | DDX_Control(pDX, IDC_EDIT_AXIS_MODITFY_MICROMENTUM, m_editJogDistance); |
| | | } |
| | | |
| | | UINT CAxisSettingsDlg::FindIDByName(const CString& strControlID) |
| | |
| | | return 0; |
| | | } |
| | | |
| | | CFont* CAxisSettingsDlg::GetOrCreateFont(int nFontSize) |
| | | { |
| | | auto it = m_mapFonts.find(nFontSize); |
| | | if (it != m_mapFonts.end()) { |
| | | return it->second; |
| | | } |
| | | |
| | | CFont* font = new CFont(); |
| | | LOGFONT logFont = { 0 }; |
| | | _tcscpy_s(logFont.lfFaceName, _T("Segoe UI")); |
| | | logFont.lfHeight = -nFontSize; |
| | | logFont.lfQuality = CLEARTYPE_QUALITY; |
| | | font->CreateFontIndirect(&logFont); |
| | | m_mapFonts[nFontSize] = font; |
| | | |
| | | return font; |
| | | } |
| | | |
| | | void CAxisSettingsDlg::SetDefaultFont() |
| | | { |
| | | CFont* defaultFont = GetOrCreateFont(12); |
| | | |
| | | // 遍历所有控件,应用默认字体 |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | pWnd->SetFont(defaultFont, TRUE); |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::AdjustControls(float dScaleX, float dScaleY) |
| | | { |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | int nCtrlID = pWnd->GetDlgCtrlID(); |
| | | if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end()) |
| | | { |
| | | CRect originalRect = m_mapCtrlLayouts[nCtrlID]; |
| | | CRect newRect( |
| | | static_cast<int>(originalRect.left * dScaleX), |
| | | static_cast<int>(originalRect.top * dScaleY), |
| | | static_cast<int>(originalRect.right * dScaleX), |
| | | static_cast<int>(originalRect.bottom * dScaleY)); |
| | | |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | |
| | | if (_tcsicmp(szClassName, _T("ComboBox")) == 0) { |
| | | CComboBox* pComboBox = (CComboBox*)pWnd; |
| | | pComboBox->SetItemHeight(-1, newRect.Height()); // -1 表示所有项的高度 |
| | | } |
| | | |
| | | pWnd->MoveWindow(&newRect); |
| | | AdjustControlFont(pWnd, newRect.Width(), newRect.Height()); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight) |
| | | { |
| | | // 根据控件高度动态调整字体大小 |
| | | int fontSize = nHeight / 2; |
| | | if (fontSize < 8) fontSize = 8; |
| | | if (fontSize > 24) fontSize = 24; // 最大字体大小 |
| | | |
| | | // 获取或创建字体 |
| | | CFont* pFont = GetOrCreateFont(fontSize); |
| | | |
| | | pWnd->SetFont(pFont); |
| | | pWnd->Invalidate(); // 刷新控件显示 |
| | | } |
| | | |
| | | void CAxisSettingsDlg::AdjustLabelFont(CBLLabel& label) |
| | | { |
| | | if (label.m_hWnd == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | // 获取控件的矩形区域 |
| | | CRect rect; |
| | | label.GetClientRect(&rect); |
| | |
| | | // 动态计算字体大小,基于控件的高度 |
| | | int fontSize = rect.Height() / 2; // 控件高度的一半作为字体大小 |
| | | if (fontSize < 8) fontSize = 8; // 最小字体大小 |
| | | if (fontSize > 30) fontSize = 30; // 最大字体大小 |
| | | if (fontSize > 20) fontSize = 20; // 最大字体大小 |
| | | |
| | | // 设置字体大小 |
| | | label.SetFontSize(fontSize); |
| | |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_READY], m_bReady, COLOR_GREEN_ON, COLOR_GREEN_OFF); |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_BUSY], m_bBusy, COLOR_GREEN_ON, COLOR_GREEN_OFF); |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_ERR], m_bErr, COLOR_RED, COLOR_GREEN_OFF); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::UpdateRegexEdit(CRegexEdit* pRegexEdit, const ValueRange& range, const CString& title) |
| | | { |
| | | auto formatDouble = [](double value) -> CString { |
| | | CString str; |
| | | str.Format(_T("%.3f"), value); |
| | | return str; |
| | | }; |
| | | |
| | | pRegexEdit->SetWindowText(formatDouble(range.currentValue)); |
| | | pRegexEdit->SetRegexType(RegexType::Decimal); |
| | | pRegexEdit->SetValueRange(range.minValue, range.maxValue); |
| | | pRegexEdit->SetInvalidInputCallback([title, range]() { |
| | | CString strError; |
| | | strError.Format(_T("%s的值必须在 %.3f 和 %.3f 之间!"), title, range.minValue, range.maxValue); |
| | | AfxMessageBox(strError); |
| | | }); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::updatePageButtonStates() |
| | |
| | | RecipeManager& recipeManager = RecipeManager::getInstance(); |
| | | if (m_strRecipeName.IsEmpty() || !recipeManager.loadRecipe(std::string(CT2A(m_strRecipeName)))) { |
| | | AfxMessageBox(_T("加载配方失败!")); |
| | | recipeManager.saveRecipe(std::string(CT2A(m_strRecipeName))); |
| | | return; |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | // 更新控件显示 |
| | | m_staticAxisNO.SetWindowText(CString(axisDetails.number.c_str())); // 轴编号 |
| | | m_staticAxisDescription.SetWindowText(CString(axisDetails.description.c_str())); // 轴描述 |
| | | m_staticStartAddress.SetWindowText(CString(axisDetails.startAddress.c_str())); // 起始地址 |
| | | m_editJogDistance.SetWindowText(formatDouble(axisDetails.jogDistance.currentValue)); // 微动量 |
| | | m_editManualSpeed.SetWindowText(formatDouble(axisDetails.manualSpeed.currentValue)); // 手动速度 |
| | | m_editAutoSpeed.SetWindowText(formatDouble(axisDetails.autoSpeed.currentValue)); // 自动速度 |
| | | m_editAccelerationTime.SetWindowText(formatDouble(axisDetails.accelerationTime.currentValue)); // 加速时间 |
| | | m_editDecelerationTime.SetWindowText(formatDouble(axisDetails.decelerationTime.currentValue)); // 减速时间 |
| | | m_staticAxisNO.SetWindowText(CString(axisDetails.number.c_str())); // 轴编号 |
| | | m_staticAxisDescription.SetWindowText(CString(axisDetails.description.c_str())); // 轴描述 |
| | | m_staticStartAddress.SetWindowText(CString(axisDetails.startAddress.c_str())); // 起始地址 |
| | | |
| | | UpdateRegexEdit(m_pRegexEdit[EDIT_MICROMENTUM], axisDetails.jogDistance, _T("微动量")); |
| | | UpdateRegexEdit(m_pRegexEdit[EDIT_MANUAL_SPEED], axisDetails.manualSpeed, _T("手动速度")); |
| | | UpdateRegexEdit(m_pRegexEdit[EDIT_AUTO_SPEED], axisDetails.autoSpeed, _T("自动速度")); |
| | | UpdateRegexEdit(m_pRegexEdit[EDIT_ACCE_TIME], axisDetails.accelerationTime, _T("加速时间")); |
| | | UpdateRegexEdit(m_pRegexEdit[EDIT_DECE_TIME], axisDetails.decelerationTime, _T("减速时间")); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::refreshPositionDetails(int nAxisId, int pageNumber) |
| | |
| | | if (pPositionCtrl) { |
| | | pPositionCtrl->SetWindowText(value); |
| | | pPositionCtrl->EnableWindow(position.isEnable); |
| | | |
| | | if (position.isEnable) { |
| | | CString strError; |
| | | strError.Format(_T("定位点%d"), i + 1); |
| | | UpdateRegexEdit((CRegexEdit*)pPositionCtrl, position.range, strError); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | |
| | | |
| | | // 获取界面上的修改参数 |
| | | CString text; |
| | | m_editManualSpeed.GetWindowText(text); |
| | | m_pRegexEdit[EDIT_MANUAL_SPEED]->GetWindowText(text); |
| | | axisData.manualSpeed.currentValue = _ttof(text); |
| | | |
| | | m_editAutoSpeed.GetWindowText(text); |
| | | m_pRegexEdit[EDIT_AUTO_SPEED]->GetWindowText(text); |
| | | axisData.autoSpeed.currentValue = _ttof(text); |
| | | |
| | | m_editAccelerationTime.GetWindowText(text); |
| | | m_pRegexEdit[EDIT_ACCE_TIME]->GetWindowText(text); |
| | | axisData.accelerationTime.currentValue = _ttof(text); |
| | | |
| | | m_editDecelerationTime.GetWindowText(text); |
| | | m_pRegexEdit[EDIT_DECE_TIME]->GetWindowText(text); |
| | | axisData.decelerationTime.currentValue = _ttof(text); |
| | | |
| | | m_editJogDistance.GetWindowText(text); |
| | | m_pRegexEdit[EDIT_MICROMENTUM]->GetWindowText(text); |
| | | axisData.jogDistance.currentValue = _ttof(text); |
| | | |
| | | // 更新定位点数据 |
| | |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CAxisSettingsDlg, CDialogEx) |
| | | BEGIN_MESSAGE_MAP(CAxisSettingsDlg, CBaseDlg) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_LAST, &CAxisSettingsDlg::OnBnClickedButtonAxisLast) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_NEXT, &CAxisSettingsDlg::OnBnClickedButtonAxisNext) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP1, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup1) |
| | |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_DETAIL_SETTINGS, &CAxisSettingsDlg::OnBnClickedButtonAxisDetailSettings) |
| | | ON_MESSAGE(ID_MSG_UPDATA_DATA_TO_UI, &CAxisSettingsDlg::OnUpdateDataToUI) |
| | | ON_WM_SIZE() |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_SIZING() |
| | | ON_WM_TIMER() |
| | | ON_WM_CLOSE() |
| | | END_MESSAGE_MAP() |
| | |
| | | |
| | | BOOL CAxisSettingsDlg::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | CBaseDlg::OnInitDialog(); |
| | | |
| | | // TODO: 在此添加额外的初始化 |
| | | CString strTitle; |
| | |
| | | pLabel->SetTextColor(RGB(255, 255, 255)); |
| | | pLabel->SetAlignment(AlignCenter); |
| | | pLabel->SetDynamicFont(TRUE); |
| | | |
| | | AdjustLabelFont(*pLabel); |
| | | } |
| | | |
| | | // 初始化编辑框 |
| | | m_pRegexEdit[EDIT_MANUAL_SPEED]->SubclassDlgItem(IDC_EDIT_AXIS_MODITFY_MANUAL_SPEED, this); |
| | | m_pRegexEdit[EDIT_AUTO_SPEED]->SubclassDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED, this); |
| | | m_pRegexEdit[EDIT_ACCE_TIME]->SubclassDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME, this); |
| | | m_pRegexEdit[EDIT_DECE_TIME]->SubclassDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME, this); |
| | | m_pRegexEdit[EDIT_MICROMENTUM]->SubclassDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM, this); |
| | | m_pRegexEdit[EDIT_ANCHOR_POINT1]->SubclassDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT1, this); |
| | | m_pRegexEdit[EDIT_ANCHOR_POINT2]->SubclassDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT2, this); |
| | | m_pRegexEdit[EDIT_ANCHOR_POINT3]->SubclassDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT3, this); |
| | | m_pRegexEdit[EDIT_ANCHOR_POINT4]->SubclassDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT4, this); |
| | | m_pRegexEdit[EDIT_ANCHOR_POINT5]->SubclassDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT5, this); |
| | | |
| | | // 按钮初始化 |
| | | m_pBlBtns[BTN_PAGE1]->SubclassDlgItem(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP1, this); |
| | | m_pBlBtns[BTN_PAGE2]->SubclassDlgItem(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP2, this); |
| | |
| | | initializeAxisIDCombo(); |
| | | refreshAxisDetails(1); |
| | | refreshPositionDetails(1, m_currentPage); |
| | | |
| | | CRect screenRect, dlgRect, clientRect; |
| | | GetClientRect(&clientRect); |
| | | m_nInitialWidth = clientRect.Width(); |
| | | m_nInitialHeight = clientRect.Height(); |
| | | |
| | | // 初始化默认字体 |
| | | CFont* pDefaultFont = GetOrCreateFont(12); |
| | | |
| | | // 遍历所有子控件,记录初始位置并设置默认字体 |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | int nCtrlID = pWnd->GetDlgCtrlID(); |
| | | if (nCtrlID != -1) { |
| | | // 记录控件初始布局 |
| | | CRect ctrlRect; |
| | | pWnd->GetWindowRect(&ctrlRect); |
| | | ScreenToClient(&ctrlRect); |
| | | m_mapCtrlLayouts[nCtrlID] = ctrlRect; |
| | | |
| | | // 设置默认字体 |
| | | pWnd->SetFont(pDefaultFont); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | |
| | | GetWindowRect(&dlgRect); |
| | | int dlgWidth = dlgRect.Width() * 2; |
| | | int dlgHeight = dlgRect.Height() * 2; |
| | | |
| | | SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0); |
| | | if (dlgWidth > screenRect.Width()) { |
| | | dlgWidth = screenRect.Width(); |
| | | } |
| | | if (dlgHeight > screenRect.Height()) { |
| | | dlgHeight = screenRect.Height(); |
| | | } |
| | | |
| | | int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2; |
| | | int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2; |
| | | MoveWindow(centerX, centerY, dlgWidth, dlgHeight); |
| | | |
| | | SetTimer(TIMER_READ_PLC_DATA, 500, nullptr); |
| | | |
| | |
| | | CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd); |
| | | |
| | | if (pWnd) { |
| | | if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) { |
| | | // 阻止回车键默认处理,防止对话框关闭 |
| | | return TRUE; |
| | | } |
| | | |
| | | // 判断鼠标是否进入指定控件区域 |
| | | if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP1)->m_hWnd || |
| | | pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP2)->m_hWnd || |
| | |
| | | } |
| | | |
| | | if (currentIndex == -1) { |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | CString descriptionCtrlName, positionCtrlName; |
| | |
| | | CWnd* pPositionCtrl = GetDlgItem(positionCtrlId); |
| | | |
| | | if (pDescriptionCtrl == nullptr || pPositionCtrl == nullptr) { |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | PositionRange& position = recipeManager.getPositionByIndex(getCurrentSelectedAxisID(), m_currentPage, AXIS_PAGE_SIZE, currentIndex); |
| | |
| | | CString strText; |
| | | GetDlgItem(IDC_EDIT_AXIS_CURR_POS)->GetWindowText(strText); |
| | | if (strText.IsEmpty()) { |
| | | return CDialogEx::PreTranslateMessage(pMsg);; |
| | | return CBaseDlg::PreTranslateMessage(pMsg);; |
| | | } |
| | | |
| | | double enteredValue = _ttof(strText); |
| | |
| | | } |
| | | } |
| | | |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | CBaseDlg::OnSize(nType, cx, cy); |
| | | |
| | | // TODO: 在此处添加消息处理程序代码 |
| | | if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) { |
| | | return; |
| | | } |
| | | |
| | | float dScaleX = static_cast<float>(cx) / m_nInitialWidth; |
| | | float dScaleY = static_cast<float>(cy) / m_nInitialHeight; |
| | | |
| | | // 遍历对话框中的所有控件 |
| | | AdjustControls(dScaleX, dScaleY); |
| | | |
| | | // 动态调整各个 CBLLabel 的字体大小 |
| | | for (auto pLabel : m_pBlLabels) { |
| | | AdjustLabelFont(*pLabel); |
| | |
| | | pComboBox->MoveWindow(&rectComboBox); |
| | | pComboBox->SetItemHeight(-1, rectButton.Height() - 6); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnSizing(UINT fwSide, LPRECT pRect) |
| | | { |
| | | if (fwSide == WMSZ_BOTTOMRIGHT) { |
| | | if (pRect->right - pRect->left < 200) { |
| | | pRect->right = pRect->left + 200; |
| | | } |
| | | if (pRect->bottom - pRect->top < 150) { |
| | | pRect->bottom = pRect->top + 150; |
| | | } |
| | | } |
| | | |
| | | CDialogEx::OnSizing(fwSide, pRect); |
| | | } |
| | | |
| | | HBRUSH CAxisSettingsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | |
| | | // TODO: 在此更改 DC 的任何特性 |
| | | |
| | | // TODO: 如果默认的不是所需画笔,则返回另一个画笔 |
| | | return hbr; |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisLast() |
| | |
| | | handleAxisOperation(AxisOperationType::POSITION_1, true); |
| | | Sleep(200); |
| | | handleAxisOperation(AxisOperationType::POSITION_1, false); |
| | | m_pBlBtns[BTN_POINT1]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT1]->Flash(500); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2() |
| | |
| | | if (m_nBtnsFlashState6 & 0x01) { |
| | | // 06.0 |
| | | if (!m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->Flash(1000); |
| | | m_pBlBtns[BTN_JOG_OPR]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & 0x01) { |
| | |
| | | |
| | | if (m_nBtnsFlashState6 & v) { |
| | | if (!m_pBlBtns[BTN_POINT1]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT1]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT1]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & v) { |
| | |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 1)) { |
| | | if (!m_pBlBtns[BTN_POINT2]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT2]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT2]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 1)) { |
| | |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 2)) { |
| | | if (!m_pBlBtns[BTN_POINT3]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT3]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT3]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 2)) { |
| | |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 3)) { |
| | | if (!m_pBlBtns[BTN_POINT4]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT4]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT4]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 3)) { |
| | |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 4)) { |
| | | if (!m_pBlBtns[BTN_POINT5]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT5]->Flash(1000); |
| | | m_pBlBtns[BTN_POINT5]->Flash(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 4)) { |
| | |
| | | readPLCDataToUI(nAxisId); |
| | | } |
| | | |
| | | CDialogEx::OnTimer(nIDEvent); |
| | | CBaseDlg::OnTimer(nIDEvent); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnClose() |
| | |
| | | // TODO: 在此添加消息处理程序代码和/或调用默认值 |
| | | KillTimer(TIMER_READ_PLC_DATA); |
| | | |
| | | CDialogEx::OnClose(); |
| | | CBaseDlg::OnClose(); |
| | | } |