Merge branch 'clh' into liuyang
# Conflicts:
# SourceCode/Bond/BoounionPLC/BoounionPLC.rc
# SourceCode/Bond/BoounionPLC/Common.h
# SourceCode/Bond/BoounionPLC/Model.cpp
# SourceCode/Bond/BoounionPLC/Model.h
| | |
| | | void CAlarmMonitor::addAlarmToHistoryRecord(CAlarm* pAlarm) |
| | | { |
| | | // å å
¥æ°æ®åº |
| | | /* |
| | | AlarmManager::getInstance().addAlarm( |
| | | std::to_string(pAlarm->getId()).c_str(), |
| | | getAlarmText(pAlarm->getId()), |
| | | CToolUnits::timeToString2(pAlarm->getOnTime()).c_str(), |
| | | CToolUnits::timeToString2(pAlarm->getOffTime()).c_str()); |
| | | */ |
| | | } |
| | | |
| | | BOOL CAlarmMonitor::addAlarming(CAlarm* pAlarm) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // AxisDetailSettingsDlg.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "BoounionPLC.h" |
| | | #include "AxisDetailSettingsDlg.h" |
| | | #include "NewCellTypes/GridCellCheck.h" |
| | | |
| | | |
| | | // CAxisDetailSettingsDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CAxisDetailSettingsDlg, CBaseDlg) |
| | | |
| | | CAxisDetailSettingsDlg::CAxisDetailSettingsDlg(AxisManager* pAxisManager, int nAxisNO, CWnd* pParent /*=nullptr*/) |
| | | : CBaseDlg(IDD_DIALOG_AXIS_DETAIL_SETTINGS, pParent) |
| | | { |
| | | CPLC* pPLC = theApp.m_model.getCurrentPlc(); |
| | | if (pPLC != nullptr && pAxisManager != nullptr) { |
| | | m_pPLC = pPLC; |
| | | m_pAxisManager = pAxisManager; |
| | | } else { |
| | | m_pPLC = nullptr; |
| | | m_pAxisManager = nullptr; |
| | | } |
| | | |
| | | m_nAxisNO = nAxisNO; |
| | | } |
| | | |
| | | CAxisDetailSettingsDlg::~CAxisDetailSettingsDlg() |
| | | { |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::InitAnchorPontManager() |
| | | { |
| | | if (m_grid.GetSafeHwnd() == NULL) |
| | | return; |
| | | |
| | | int nRows = 1; |
| | | int nCols = 6; |
| | | |
| | | int nFixRows = 1; |
| | | int nFixCols = 0; |
| | | int nRowIdx = 0; |
| | | int nColIdx = 0; |
| | | |
| | | m_grid.DeleteAllItems(); |
| | | m_grid.SetVirtualMode(FALSE); |
| | | m_grid.GetDefaultCell(TRUE, FALSE)->SetBackClr(g_nGridFixCellColor); // 设置åºå®è¡èæ¯è² |
| | | m_grid.GetDefaultCell(FALSE, TRUE)->SetBackClr(g_nGridFixCellColor); // 设置åºå®åèæ¯è² |
| | | m_grid.GetDefaultCell(FALSE, FALSE)->SetBackClr(g_nGridCellColor); // 设置åå
æ ¼èæ¯è² |
| | | m_grid.SetFixedTextColor(g_nGridFixFontColor); // 设置åºå®è¡ååä½é¢è² |
| | | |
| | | m_grid.SetRowCount(nRows); |
| | | m_grid.SetColumnCount(nCols); |
| | | m_grid.SetFixedRowCount(nFixRows); |
| | | m_grid.SetFixedColumnCount(nFixCols); |
| | | |
| | | // Col |
| | | m_grid.SetColumnWidth(nColIdx, 10); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("No.")); |
| | | m_grid.SetColumnWidth(nColIdx, 10); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("æ¿æ´»")); |
| | | m_grid.SetColumnWidth(nColIdx, 50); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("æå°å¼")); |
| | | m_grid.SetColumnWidth(nColIdx, 50); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("å½åå¼")); |
| | | m_grid.SetColumnWidth(nColIdx, 50); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("æå¤§å¼")); |
| | | m_grid.SetColumnWidth(nColIdx, 120); |
| | | m_grid.SetItemText(nRowIdx, nColIdx++, _T("æè¿°")); |
| | | |
| | | m_grid.SetFixedRowSelection(FALSE); |
| | | m_grid.SetFixedColumnSelection(FALSE); |
| | | m_grid.SetEditable(TRUE); |
| | | m_grid.SetRowResize(FALSE); |
| | | m_grid.SetColumnResize(TRUE); |
| | | m_grid.ExpandColumnsToFit(TRUE); |
| | | m_grid.SetListMode(TRUE); // å¯ç¨åè¡¨æ¨¡å¼ |
| | | m_grid.EnableSelection(TRUE); // å¯ç¨éæ© |
| | | m_grid.SetSingleRowSelection(TRUE); // èªå¨æ´è¡é«äº®ï¼éå¶ä¸ºåè¡éæ©ï¼ |
| | | m_grid.ExpandLastColumn(); // æåä¸åå¡«å
ç½æ ¼ |
| | | |
| | | FillAnchorPontManager(); |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::FillAnchorPontManager() |
| | | { |
| | | int nRowIndex = 1; |
| | | auto axisDetails = m_pAxisManager->GetAxis(m_nAxisNO); |
| | | int nPositionsSize = (int)axisDetails.positions.size(); |
| | | |
| | | // æ¸
餿°æ®è¡ï¼ä¿ç表头 |
| | | for (int i = 1; i < m_grid.GetRowCount(); i++) { |
| | | m_grid.DeleteRow(i); |
| | | } |
| | | |
| | | // è®¾ç½®è¡¨æ ¼è¡æ° |
| | | m_grid.SetRowCount(axisDetails.positioningPointCount + 1); |
| | | auto SetCellText = [this](int nRow, int nCol, const CString& strText, UINT nState = GVIS_READONLY) { |
| | | m_grid.SetItemText(nRow, nCol, strText); |
| | | m_grid.SetItemState(nRow, nCol, nState); |
| | | }; |
| | | |
| | | auto FormatFloatToString = [](double dValue) -> CString { |
| | | CString strText; |
| | | strText.Format(_T("%.3f"), dValue); |
| | | return strText; |
| | | }; |
| | | |
| | | for (int nIndex = 0; nIndex < axisDetails.positioningPointCount; nIndex++) { |
| | | m_grid.SetItemState(nIndex, 0, GVIS_READONLY); // åºå·å设置åªè¯» |
| | | SetCellText(nRowIndex, 0, CString(std::to_string(nRowIndex).c_str())); |
| | | |
| | | if (nIndex >= nPositionsSize) { |
| | | // æ·»å æ°è¡çé»è®¤å¼ |
| | | if (m_grid.SetCellType(nRowIndex, 1, RUNTIME_CLASS(CGridCellCheck))) { |
| | | auto* pCell = static_cast<CGridCellCheck*>(m_grid.GetCell(nRowIndex, 1)); |
| | | pCell->SetCheck(TRUE); |
| | | } |
| | | |
| | | SetCellText(nRowIndex, 2, FormatFloatToString(0.0), GVIS_MODIFIED); |
| | | SetCellText(nRowIndex, 3, FormatFloatToString(1.0), GVIS_MODIFIED); |
| | | SetCellText(nRowIndex, 4, FormatFloatToString(10.0), GVIS_MODIFIED); |
| | | SetCellText(nRowIndex, 5, CString(_T("Position ")) + CString(std::to_string(nIndex + 1).c_str()), GVIS_MODIFIED); |
| | | } |
| | | else { |
| | | const auto& enPosition = axisDetails.positions[nIndex]; |
| | | |
| | | if (m_grid.SetCellType(nRowIndex, 1, RUNTIME_CLASS(CGridCellCheck))) { |
| | | auto* pCell = static_cast<CGridCellCheck*>(m_grid.GetCell(nRowIndex, 1)); |
| | | pCell->SetCheck(enPosition.isEnable); |
| | | } |
| | | |
| | | UINT nCellState = enPosition.isEnable ? GVIS_MODIFIED : GVIS_READONLY; |
| | | |
| | | SetCellText(nRowIndex, 2, FormatFloatToString(enPosition.range.minValue), nCellState); |
| | | SetCellText(nRowIndex, 3, FormatFloatToString(enPosition.range.currentValue), nCellState); |
| | | SetCellText(nRowIndex, 4, FormatFloatToString(enPosition.range.maxValue), nCellState); |
| | | SetCellText(nRowIndex, 5, CString(enPosition.description.c_str()), nCellState); |
| | | } |
| | | |
| | | nRowIndex++; |
| | | } |
| | | |
| | | m_grid.ExpandColumnsToFit(FALSE); |
| | | m_grid.ExpandLastColumn(); |
| | | m_grid.Invalidate(); |
| | | m_grid.UpdateWindow(); |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::UpdateAxisDetailSettings() |
| | | { |
| | | // è·åè½´æ°æ® |
| | | auto axisDetails = m_pAxisManager->GetAxis(m_nAxisNO); |
| | | auto formatDouble = [](double value) -> CString { |
| | | CString str; |
| | | str.Format(_T("%.3f"), value); |
| | | return str; |
| | | }; |
| | | |
| | | auto formatInt = [](int value) -> CString { |
| | | CString str; |
| | | str.Format(_T("%d"), value); |
| | | return str; |
| | | }; |
| | | |
| | | m_staticAxisNO.SetWindowText(CString(axisDetails.number.c_str())); // è½´ç¼å· |
| | | m_staticAxisDescription.SetWindowText(CString(axisDetails.description.c_str())); // è½´æè¿° |
| | | m_staticStartAddress.SetWindowText(CString(axisDetails.startAddress.c_str())); // èµ·å§å°å |
| | | |
| | | // å®ä½ç¹æ° |
| | | GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->SetWindowText(formatInt(axisDetails.positioningPointCount)); |
| | | |
| | | // å¾®å¨é |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MIN)->SetWindowText(formatDouble(axisDetails.jogDistance.minValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM)->SetWindowText(formatDouble(axisDetails.jogDistance.currentValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MAX)->SetWindowText(formatDouble(axisDetails.jogDistance.maxValue)); |
| | | |
| | | // æå¨é度 |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MIN)->SetWindowText(formatDouble(axisDetails.manualSpeed.minValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS)->SetWindowText(formatDouble(axisDetails.manualSpeed.currentValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MAX)->SetWindowText(formatDouble(axisDetails.manualSpeed.maxValue)); |
| | | |
| | | // èªå¨é度 |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MIN)->SetWindowText(formatDouble(axisDetails.autoSpeed.minValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED)->SetWindowText(formatDouble(axisDetails.autoSpeed.currentValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MAX)->SetWindowText(formatDouble(axisDetails.autoSpeed.maxValue)); |
| | | |
| | | // å éæ¶é´ |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MIN)->SetWindowText(formatDouble(axisDetails.accelerationTime.minValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME)->SetWindowText(formatDouble(axisDetails.accelerationTime.currentValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MAX)->SetWindowText(formatDouble(axisDetails.accelerationTime.maxValue)); |
| | | |
| | | // åéæ¶é´ |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MIN)->SetWindowText(formatDouble(axisDetails.decelerationTime.minValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME)->SetWindowText(formatDouble(axisDetails.decelerationTime.currentValue)); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MAX)->SetWindowText(formatDouble(axisDetails.decelerationTime.maxValue)); |
| | | } |
| | | |
| | | bool CAxisDetailSettingsDlg::ParsePLCAddress(const CString& address, MC::SOFT_COMPONENT& component, int& addr) |
| | | { |
| | | if (address.GetLength() < 2) { |
| | | return false; |
| | | } |
| | | |
| | | // æåç»ä»¶ç±»åï¼ç¬¬ä¸ä¸ªåç¬¦ï¼ |
| | | TCHAR componentChar = address[0]; |
| | | if (address.Left(2) == _T("ZR")) { |
| | | component = MC::SOFT_COMPONENT::ZR; |
| | | // æåæ°åé¨åï¼å»é¤ZRåç¼ï¼ |
| | | CString numericAddress = address.Mid(2); |
| | | addr = _ttoi(numericAddress); |
| | | return addr != 0 || numericAddress.CompareNoCase(_T("0")) == 0; // å¦ææ¯ "0"ï¼ä¹è®¤ä¸ºææ |
| | | } |
| | | |
| | | // 对äºå
¶ä»ç»ä»¶ï¼æç
§å¸¸è§è§åå¤ç |
| | | CString hexAddress = address.Mid(1); |
| | | switch (componentChar) { |
| | | case 'D': |
| | | component = MC::SOFT_COMPONENT::D; |
| | | addr = _ttoi(hexAddress); |
| | | break; |
| | | case 'M': |
| | | component = MC::SOFT_COMPONENT::M; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'X': |
| | | component = MC::SOFT_COMPONENT::X; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'Y': |
| | | component = MC::SOFT_COMPONENT::Y; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'W': |
| | | component = MC::SOFT_COMPONENT::W; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'L': |
| | | component = MC::SOFT_COMPONENT::L; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'S': |
| | | component = MC::SOFT_COMPONENT::S; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'B': |
| | | component = MC::SOFT_COMPONENT::B; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'F': |
| | | component = MC::SOFT_COMPONENT::F; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | default: |
| | | return false; |
| | | } |
| | | |
| | | // æ£æ¥å°åæ¯å¦ææ |
| | | if (addr == 0 && hexAddress.CompareNoCase(_T("0")) != 0) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::WriteAxisDataToPLC(int nAxisId) |
| | | { |
| | | // è·åè½´æ°æ® |
| | | AxisInfo axisData = m_pAxisManager->GetAxis(nAxisId); |
| | | |
| | | MC::SOFT_COMPONENT enComponent; |
| | | int nStartAddress, nSize; |
| | | if (!ParsePLCAddress(CString(axisData.startAddress.c_str()), enComponent, nStartAddress)) { |
| | | AfxMessageBox(_T("æ æçèµ·å§å°åï¼")); |
| | | } |
| | | |
| | | // åå
¥å¾®å¨é |
| | | m_pPLC->writeWord(enComponent, nStartAddress + 81, (int)(axisData.jogDistance.currentValue * 1000.0), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å¾®å¨é, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å¾®å¨é, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å®ä½ç¹æ° |
| | | m_pPLC->writeWord(enComponent, nStartAddress + 99, (int)(axisData.positioningPointCount), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å®ä½ç¹æ°, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å®ä½ç¹æ°, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥æå¨é度 |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 82, (int)(axisData.manualSpeed.currentValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: æå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: æå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥æå¤§æå¨é度 |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 72, (int)(axisData.manualSpeed.maxValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: æå¤§æå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: æå¤§æå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥èªå¨é度 |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 84, (int)(axisData.autoSpeed.currentValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: èªå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: èªå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥æå¤§èªå¨é度 |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 60, (int)(axisData.autoSpeed.maxValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: æå¤§èªå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: æå¤§èªå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å éæ¶é´ |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 62, (int)(axisData.accelerationTime.currentValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å éæ¶é´, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å éæ¶é´, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥åéæ¶é´ |
| | | m_pPLC->writeDWord(enComponent, nStartAddress + 64, (int)(axisData.decelerationTime.currentValue * 1000), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: åéæ¶é´, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: åéæ¶é´, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å®ä½ç¹æ°æ® |
| | | { |
| | | char szWrite[100] = { 0 }; |
| | | auto writeIntToBuffer = [&](int value, int nWriteIndex) { |
| | | if (nWriteIndex + 4 <= sizeof(szWrite)) { |
| | | // å°ç«¯ |
| | | szWrite[nWriteIndex] = static_cast<char>(value & 0xFF); // ä½åè |
| | | szWrite[nWriteIndex + 1] = static_cast<char>((value >> 8) & 0xFF); // 次ä½åè |
| | | szWrite[nWriteIndex + 2] = static_cast<char>((value >> 16) & 0xFF); // 次é«åè |
| | | szWrite[nWriteIndex + 3] = static_cast<char>((value >> 24) & 0xFF); // é«åè |
| | | } |
| | | }; |
| | | |
| | | nSize = sizeof(szWrite); |
| | | int nAddress = nStartAddress + 100; |
| | | |
| | | for (int i = 0; i < axisData.positions.size(); ++i) { |
| | | const auto& position = axisData.positions[i]; |
| | | writeIntToBuffer(static_cast<int>(position.range.currentValue * 1000), (i * 4)); |
| | | } |
| | | |
| | | m_pPLC->writeData(enComponent, nAddress, szWrite, nSize, [nAddress, &szWrite](IMcChannel* pChannel, int nAddr, DWORD nValue, int nFlag) { |
| | | if (nFlag == 0) { |
| | | TRACE("æä½æåï¼å°å=%dï¼å¼=%s\n", nAddress, szWrite); |
| | | } |
| | | else { |
| | | TRACE("æä½å¤±è´¥ï¼å°å=%dï¼é误ç =%d\n", nAddress, nFlag); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // åå
¥å®ä½ç¹ä¸ä¸é |
| | | { |
| | | char szWrite[200] = { 0 }; |
| | | auto writeIntToBuffer = [&](int value, int nWriteIndex) { |
| | | if (nWriteIndex + 4 <= sizeof(szWrite)) { |
| | | // å°ç«¯ |
| | | szWrite[nWriteIndex] = static_cast<char>(value & 0xFF); // ä½åè |
| | | szWrite[nWriteIndex + 1] = static_cast<char>((value >> 8) & 0xFF); // 次ä½åè |
| | | szWrite[nWriteIndex + 2] = static_cast<char>((value >> 16) & 0xFF); // 次é«åè |
| | | szWrite[nWriteIndex + 3] = static_cast<char>((value >> 24) & 0xFF); // é«åè |
| | | } |
| | | }; |
| | | |
| | | nSize = sizeof(szWrite); |
| | | int nAddress = nStartAddress + 200; |
| | | |
| | | int nIndex = 0; |
| | | for (int i = 0; i < axisData.positions.size(); ++i) { |
| | | const auto& position = axisData.positions[i]; |
| | | writeIntToBuffer(static_cast<int>(position.range.minValue * 1000), (nIndex * 4)); |
| | | writeIntToBuffer(static_cast<int>(position.range.maxValue * 1000), ((nIndex + 1) * 4)); |
| | | nIndex += 2; |
| | | } |
| | | |
| | | m_pPLC->writeData(enComponent, nAddress, szWrite, nSize, [nAddress, &szWrite](IMcChannel* pChannel, int nAddr, DWORD nValue, int nFlag) { |
| | | if (nFlag == 0) { |
| | | TRACE("æä½æåï¼å°å=%dï¼å¼=%s\n", nAddress, szWrite); |
| | | } |
| | | else { |
| | | TRACE("æä½å¤±è´¥ï¼å°å=%dï¼é误ç =%d\n", nAddress, nFlag); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CBaseDlg::DoDataExchange(pDX); |
| | | 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_CUSTOM_AXIS_ANCHOR_POINT, m_grid); |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CAxisDetailSettingsDlg, CBaseDlg) |
| | | ON_NOTIFY(NM_CLICK, IDC_CUSTOM_AXIS_ANCHOR_POINT, &CAxisDetailSettingsDlg::OnGridItemChanged) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_DETAIL_SETTINGS_SAVE, &CAxisDetailSettingsDlg::OnBnClickedButtonAxisDetailSettingsSave) |
| | | ON_BN_CLICKED(IDC_BUTTON_SET_AXIS_POSITIONING_POINTS, &CAxisDetailSettingsDlg::OnBnClickedButtonSetAxisPositioningPoints) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CAxisDetailSettingsDlg æ¶æ¯å¤çç¨åº |
| | | |
| | | |
| | | BOOL CAxisDetailSettingsDlg::OnInitDialog() |
| | | { |
| | | CBaseDlg::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | if (m_pPLC == nullptr || !m_pPLC->isConnected()) { |
| | | AfxMessageBox(_T("PLC æªè¿æ¥ï¼")); |
| | | return FALSE; |
| | | } |
| | | |
| | | if (m_pAxisManager == nullptr) { |
| | | AfxMessageBox(_T("轴管ç卿ªå è½½ï¼")); |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strTitle; |
| | | strTitle.Format(_T("è½´ç»é¨è®¾å®(PLC: %s)"), m_pPLC->getName().c_str()); |
| | | SetWindowText(strTitle); |
| | | |
| | | // è·åè½´æ°æ® |
| | | auto axisDetails = m_pAxisManager->GetAxis(m_nAxisNO); |
| | | if (axisDetails.id == -1) { |
| | | CString strMsg; |
| | | strMsg.Format(_T("è½´ [%d] ä¸åå¨ï¼"), m_nAxisNO); |
| | | AfxMessageBox(strMsg); |
| | | return FALSE; |
| | | } |
| | | |
| | | UpdateAxisDetailSettings(); |
| | | InitAnchorPontManager(); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::OnGridItemChanged(NMHDR* pNotifyStruct, LRESULT* pResult) |
| | | { |
| | | NM_GRIDVIEW* pItem = (NM_GRIDVIEW*)pNotifyStruct; |
| | | int nRow = pItem->iRow; |
| | | int nCol = pItem->iColumn; |
| | | |
| | | // å¤çå¤éæ¡ç¶æåå |
| | | if (nCol == 1) { |
| | | // è·åå¤éæ¡çå½åç¶æ |
| | | CGridCellCheck* pCell = static_cast<CGridCellCheck*>(m_grid.GetCell(nRow, nCol)); |
| | | BOOL bChecked = pCell->GetCheck(); |
| | | |
| | | // å¤çå¤éæ¡ç¶æåå |
| | | m_grid.SetItemState(nRow, 2, bChecked ? GVIS_MODIFIED : GVIS_READONLY); |
| | | m_grid.SetItemState(nRow, 3, bChecked ? GVIS_MODIFIED : GVIS_READONLY); |
| | | m_grid.SetItemState(nRow, 4, bChecked ? GVIS_MODIFIED : GVIS_READONLY); |
| | | m_grid.SetItemState(nRow, 5, bChecked ? GVIS_MODIFIED : GVIS_READONLY); |
| | | } |
| | | |
| | | *pResult = 0; |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::OnBnClickedButtonAxisDetailSettingsSave() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | // è·åè½´æ°æ® |
| | | auto& axisDetails = m_pAxisManager->GetAxis(m_nAxisNO); |
| | | |
| | | // è½´ç¼å·ãæè¿°åèµ·å§å°å |
| | | CString strAxisNo, strAxisDesc, strStartAddr; |
| | | m_staticAxisNO.GetWindowText(strAxisNo); |
| | | m_staticAxisDescription.GetWindowText(strAxisDesc); |
| | | m_staticStartAddress.GetWindowText(strStartAddr); |
| | | |
| | | axisDetails.number = std::string(CT2A(strAxisNo)); |
| | | axisDetails.description = std::string(CT2A(strAxisDesc)); |
| | | axisDetails.startAddress = std::string(CT2A(strStartAddr)); |
| | | |
| | | // å®ä½ç¹æ° |
| | | CString strPosCount; |
| | | GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->GetWindowText(strPosCount); |
| | | axisDetails.positioningPointCount = _ttoi(strPosCount); |
| | | |
| | | // å¾®å¨é |
| | | CString strJogDistanceMin, strJogDistanceCur, strJogDistanceMax; |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MIN)->GetWindowText(strJogDistanceMin); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM)->GetWindowText(strJogDistanceCur); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_MICROMENTUM_MAX)->GetWindowText(strJogDistanceMax); |
| | | axisDetails.jogDistance.minValue = _ttof(strJogDistanceMin); |
| | | axisDetails.jogDistance.currentValue = _ttof(strJogDistanceCur); |
| | | axisDetails.jogDistance.maxValue = _ttof(strJogDistanceMax); |
| | | |
| | | // æå¨é度 |
| | | CString strManualSpeedMin, strManualSpeedCur, strManualSpeedMax; |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MIN)->GetWindowText(strManualSpeedMin); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS)->GetWindowText(strManualSpeedCur); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_POS_MAX)->GetWindowText(strManualSpeedMax); |
| | | axisDetails.manualSpeed.minValue = _ttof(strManualSpeedMin); |
| | | axisDetails.manualSpeed.currentValue = _ttof(strManualSpeedCur); |
| | | axisDetails.manualSpeed.maxValue = _ttof(strManualSpeedMax); |
| | | |
| | | // èªå¨é度 |
| | | CString strAutoSpeedMin, strAutoSpeedCur, strAutoSpeedMax; |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MIN)->GetWindowText(strAutoSpeedMin); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED)->GetWindowText(strAutoSpeedCur); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_AUTO_SPEED_MAX)->GetWindowText(strAutoSpeedMax); |
| | | axisDetails.autoSpeed.minValue = _ttof(strAutoSpeedMin); |
| | | axisDetails.autoSpeed.currentValue = _ttof(strAutoSpeedCur); |
| | | axisDetails.autoSpeed.maxValue = _ttof(strAutoSpeedMax); |
| | | |
| | | // å éæ¶é´ |
| | | CString strAcceTimeMin, strAcceTimeCur, strAcceTimeMax; |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MIN)->GetWindowText(strAcceTimeMin); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME)->GetWindowText(strAcceTimeCur); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_ACCE_TIME_MAX)->GetWindowText(strAcceTimeMax); |
| | | axisDetails.accelerationTime.minValue = _ttof(strAcceTimeMin); |
| | | axisDetails.accelerationTime.currentValue = _ttof(strAcceTimeCur); |
| | | axisDetails.accelerationTime.maxValue = _ttof(strAcceTimeMax); |
| | | |
| | | // åéæ¶é´ |
| | | CString strDeceTimeMin, strDeceTimeCur, strDeceTimeMax; |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MIN)->GetWindowText(strDeceTimeMin); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME)->GetWindowText(strDeceTimeCur); |
| | | GetDlgItem(IDC_EDIT_AXIS_MODITFY_DECE_TIME_MAX)->GetWindowText(strDeceTimeMax); |
| | | axisDetails.decelerationTime.minValue = _ttof(strDeceTimeMin); |
| | | axisDetails.decelerationTime.currentValue = _ttof(strDeceTimeCur); |
| | | axisDetails.decelerationTime.maxValue = _ttof(strDeceTimeMax); |
| | | |
| | | // 妿 positioningPointCount å positions.size() ä¸åï¼åè°æ´å¤§å° |
| | | if (axisDetails.positioningPointCount != (int)axisDetails.positions.size()) { |
| | | axisDetails.positions.resize(axisDetails.positioningPointCount); |
| | | } |
| | | |
| | | // æ´æ°è¡¨æ ¼ä¸çå®ä½ç¹æ°æ® |
| | | for (int i = 0; i < axisDetails.positioningPointCount; i++) { |
| | | auto& enPosition = axisDetails.positions[i]; |
| | | |
| | | // 使è½ç¶æ |
| | | BOOL bIsChecked = ((CGridCellCheck*)m_grid.GetCell(i + 1, 1))->GetCheck(); |
| | | enPosition.isEnable = bIsChecked; |
| | | |
| | | // æå°å¼ãå½åå¼åæå¤§å¼ |
| | | CString strMin, strCur, strMax; |
| | | strMin = m_grid.GetItemText(i + 1, 2); |
| | | strCur = m_grid.GetItemText(i + 1, 3); |
| | | strMax = m_grid.GetItemText(i + 1, 4); |
| | | enPosition.range.minValue = _ttof(strMin); |
| | | enPosition.range.currentValue = _ttof(strCur); |
| | | enPosition.range.maxValue = _ttof(strMax); |
| | | |
| | | // æè¿° |
| | | CString strDesc; |
| | | strDesc = m_grid.GetItemText(i + 1, 5); |
| | | enPosition.description = std::string(CT2A(strDesc)); |
| | | } |
| | | |
| | | m_pAxisManager->UpdateAxis(axisDetails); |
| | | |
| | | // ä¿åè½´æ°æ®å°æä»¶ |
| | | CString cstrMessage; |
| | | if (m_pAxisManager->SaveAxis(m_pPLC->getName())) { |
| | | WriteAxisDataToPLC(m_nAxisNO); |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] ç»é¨åæ°æåï¼"), m_nAxisNO); |
| | | } |
| | | else { |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] ç»é¨åæ°å¤±è´¥ï¼"), m_nAxisNO); |
| | | } |
| | | |
| | | AfxMessageBox(cstrMessage); |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::OnBnClickedButtonSetAxisPositioningPoints() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | CString strPosCount; |
| | | GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->GetWindowText(strPosCount); |
| | | if (strPosCount.IsEmpty()) { |
| | | AfxMessageBox(_T("请è¾å
¥å®ä½ç¹æ°ï¼")); |
| | | return; |
| | | } |
| | | |
| | | short nCount = _ttoi(strPosCount); |
| | | if (nCount < 1 || nCount > 25) { |
| | | AfxMessageBox(_T("èå´å¨1-25ä¹é´ï¼")); |
| | | return; |
| | | } |
| | | |
| | | AxisInfo axisDetails = m_pAxisManager->GetAxis(m_nAxisNO); |
| | | axisDetails.positioningPointCount = _ttoi(strPosCount); |
| | | |
| | | // æ´æ° AxisManager ä¸çè½´æ°æ® |
| | | m_pAxisManager->UpdateAxis(axisDetails); |
| | | |
| | | FillAnchorPontManager(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "afxdialogex.h" |
| | | #include "GridCtrl.h" |
| | | #include "CBaseDlg.h" |
| | | #include "PLC.h" |
| | | #include "AxisManager.h" |
| | | |
| | | |
| | | // CAxisDetailSettingsDlg å¯¹è¯æ¡ |
| | | |
| | | class CAxisDetailSettingsDlg : public CBaseDlg |
| | | { |
| | | DECLARE_DYNAMIC(CAxisDetailSettingsDlg) |
| | | |
| | | public: |
| | | CAxisDetailSettingsDlg(AxisManager* pAxisManager, int nAxisNO, CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CAxisDetailSettingsDlg(); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_AXIS_DETAIL_SETTINGS }; |
| | | #endif |
| | | |
| | | private: |
| | | void InitAnchorPontManager(); |
| | | void FillAnchorPontManager(); |
| | | void UpdateAxisDetailSettings(); |
| | | bool ParsePLCAddress(const CString& address, MC::SOFT_COMPONENT& component, int& addr); |
| | | void WriteAxisDataToPLC(int nAxisId); |
| | | |
| | | private: |
| | | CPLC* m_pPLC; |
| | | int m_nAxisNO; |
| | | |
| | | // 轴管çå¨ |
| | | AxisManager* m_pAxisManager; |
| | | |
| | | // æ§ä»¶ |
| | | CStatic m_staticAxisNO, m_staticAxisDescription, m_staticStartAddress; |
| | | CGridCtrl m_grid; |
| | | |
| | | protected: |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnGridItemChanged(NMHDR* pNotifyStruct, LRESULT* pResult); |
| | | afx_msg void OnBnClickedButtonAxisDetailSettingsSave(); |
| | | afx_msg void OnBnClickedButtonSetAxisPositioningPoints(); |
| | | DECLARE_MESSAGE_MAP() |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // AxisSettingsDlg.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "BoounionPLC.h" |
| | | #include "afxdialogex.h" |
| | | #include "AxisSettingsDlg.h" |
| | | #include "AxisDetailSettingsDlg.h" |
| | | #include "ToolUnits.h" |
| | | #include <cctype> |
| | | |
| | | |
| | | #define COLOR_GREEN_ON RGB(0, 255, 0) // æ£å¸¸ç¶æç»¿è² |
| | | #define COLOR_GREEN_OFF RGB(0, 180, 0) // åç»¿ç¶æ |
| | | #define COLOR_RED RGB(255, 0, 0) // éè¯¯ç¶æçº¢è² |
| | | |
| | | #define TIMER_INIT 1 |
| | | #define TIMER_READ_PLC_DATA 2 |
| | | |
| | | #define ID_MSG_UPDATA_DATA_TO_UI WM_USER + 101 |
| | | |
| | | // CAxisSettingsDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CBaseDlg) |
| | | |
| | | CAxisSettingsDlg::CAxisSettingsDlg(CWnd* pParent /*=nullptr*/) |
| | | : CBaseDlg(IDD_DIALOG_AXIS_SETTINGS, pParent) |
| | | { |
| | | CPLC* pPLC = theApp.m_model.getCurrentPlc(); |
| | | if (pPLC != nullptr) { |
| | | m_pPLC = pPLC; |
| | | m_pAxisManager = new AxisManager(); |
| | | m_pAxisManager->LoadAxis(pPLC->getName()); |
| | | } |
| | | |
| | | m_bSEV = FALSE; |
| | | m_fCurPos = 0.0; |
| | | m_fManualSpeed = 0.0; |
| | | m_fAutoSpeed = 0.0; |
| | | m_fPrm = 0.0; |
| | | m_nLoad = 0; |
| | | m_nErrCode = 0; |
| | | m_nAlarmCode = 0; |
| | | m_bFLS = FALSE; |
| | | m_bDOG = FALSE; |
| | | m_bRLS = 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++) { |
| | | m_pBlLabels[i] = new CBLLabel(); |
| | | } |
| | | |
| | | m_nBtnsFlashState6 = 0; |
| | | m_nBtnsFlashState8 = 0; |
| | | } |
| | | |
| | | CAxisSettingsDlg::~CAxisSettingsDlg() |
| | | { |
| | | 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++) { |
| | | delete m_pBlLabels[i]; |
| | | } |
| | | |
| | | if (m_pAxisManager != nullptr) { |
| | | delete m_pAxisManager; |
| | | m_pAxisManager = nullptr; |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::DoDataExchange(CDataExchange* 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); |
| | | } |
| | | |
| | | UINT CAxisSettingsDlg::FindIDByName(const CString& strControlID) |
| | | { |
| | | // å°èµæºæä»¶ä¸å®ä¹çæ§ä»¶åç§°å ID å è½½å°ä¸ä¸ªæ å°ä¸ |
| | | static const std::map<CString, UINT> controlIdMap = { |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP1", IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP1}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP2", IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP2}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP3", IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP3}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP4", IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP4}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP5", IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP5}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT1", IDC_EDIT_AXIS_ANCHOR_POINT1}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT2", IDC_EDIT_AXIS_ANCHOR_POINT2}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT3", IDC_EDIT_AXIS_ANCHOR_POINT3}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT4", IDC_EDIT_AXIS_ANCHOR_POINT4}, |
| | | {"IDC_EDIT_AXIS_ANCHOR_POINT5", IDC_EDIT_AXIS_ANCHOR_POINT5} |
| | | // å¯ä»¥ç»§ç»æ·»å å
¶ä»æ§ä»¶åç§°å ID |
| | | }; |
| | | |
| | | // æ¥æ¾æ§ä»¶åç§°æ¯å¦å¨æ å°ä¸ |
| | | auto it = controlIdMap.find(strControlID); |
| | | if (it != controlIdMap.end()) { |
| | | return it->second; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | 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 > 20) fontSize = 20; // æå¤§åä½å¤§å° |
| | | |
| | | // 设置åä½å¤§å° |
| | | label.SetFontSize(fontSize); |
| | | |
| | | // å·æ°æ§ä»¶æ¾ç¤º |
| | | label.Invalidate(); |
| | | label.UpdateWindow(); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::SetLabelColor(CBLLabel& label, COLORREF color) |
| | | { |
| | | label.SetBkColor(color); |
| | | label.Invalidate(); // æ è®°åºåæ æ |
| | | label.UpdateWindow(); // ç«å³å·æ° |
| | | } |
| | | |
| | | void CAxisSettingsDlg::SetLabelColorBasedOnState(CBLLabel& label, BOOL bState, COLORREF colorTrue, COLORREF colorFalse) { |
| | | SetLabelColor(label, bState ? colorTrue : colorFalse); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::UpdateLabels() { |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_FLS], m_bFLS, COLOR_GREEN_ON, COLOR_GREEN_OFF); |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_DOG], m_bDOG, COLOR_GREEN_ON, COLOR_GREEN_OFF); |
| | | SetLabelColorBasedOnState(*m_pBlLabels[LABEL_RLS], m_bRLS, COLOR_GREEN_ON, COLOR_GREEN_OFF); |
| | | 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() |
| | | { |
| | | for (int i = 0; i < AXIS_PAGE_SIZE; ++i) { |
| | | BOOL bSelect = (i + 1 == m_currentPage); |
| | | m_pBlBtns[i]->SetFaceColor(bSelect ? |
| | | BTN_PAGE_FACE_SELECT_COLOR: BTN_PAGE_FACE_NORMAL_COLOR); |
| | | m_pBlBtns[i]->SetTextColor(bSelect ? |
| | | BTN_PAGE_TEXT_SELECT_COLOR : BTN_PAGE_TEXT_NORMAL_COLOR); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::HideEditCursor(int nCtrlID) |
| | | { |
| | | CEdit* pEdit = (CEdit*)GetDlgItem(nCtrlID); |
| | | if (pEdit && pEdit->GetSafeHwnd()) { |
| | | pEdit->EnableWindow(FALSE); // ç¦ç¨æ§ä»¶ |
| | | pEdit->SetReadOnly(TRUE); // 设置为åªè¯» |
| | | pEdit->HideCaret(); // éèå
æ |
| | | } |
| | | } |
| | | |
| | | int CAxisSettingsDlg::GetCurrentSelectedAxisID() |
| | | { |
| | | int currentIndex = m_comboAxisNO.GetCurSel(); |
| | | if (currentIndex == CB_ERR) { |
| | | return -1; |
| | | } |
| | | |
| | | CString strAxisIDStr; |
| | | m_comboAxisNO.GetLBText(currentIndex, strAxisIDStr); |
| | | return _ttoi(strAxisIDStr); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::InitializeAxisIDCombo() |
| | | { |
| | | // è·åææè½´çç¼å· |
| | | auto axisNumbers = m_pAxisManager->GetAllAxisID(); |
| | | if (axisNumbers.empty()) { |
| | | AfxMessageBox(_T("æ²¡ææ¾å°è½´ä¿¡æ¯ï¼")); |
| | | return; |
| | | } |
| | | |
| | | // æ¸
ç©ºä¸ææ¡ |
| | | m_comboAxisNO.ResetContent(); |
| | | |
| | | // å¡«å
æ°æ®å°ä¸ææ¡ |
| | | for (const auto& axisID : axisNumbers) { |
| | | CString axisCString; |
| | | axisCString.Format(_T("%d"), axisID); |
| | | m_comboAxisNO.AddString(axisCString); |
| | | } |
| | | |
| | | // é»è®¤éæ©ç¬¬ä¸é¡¹ |
| | | if (m_comboAxisNO.GetCount() > 0) { |
| | | m_comboAxisNO.SetCurSel(0); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::RefreshAxisDetails(int nAxisId) |
| | | { |
| | | // è·åè½´æ°æ® |
| | | auto axisDetails = m_pAxisManager->GetAxis(nAxisId); |
| | | auto formatDouble = [](double value) -> CString { |
| | | CString str; |
| | | str.Format(_T("%.3f"), value); |
| | | return str; |
| | | }; |
| | | |
| | | // æ´æ°æ§ä»¶æ¾ç¤º |
| | | 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) |
| | | { |
| | | // æ¯é¡µæ¾ç¤ºçå®ä½ç¹æ°é |
| | | const int pageSize = AXIS_PAGE_SIZE; |
| | | |
| | | // è·åå®ä½ç¹æ°æ® |
| | | auto positions = m_pAxisManager->GetPositions(nAxisId, pageNumber, pageSize); |
| | | |
| | | // å·æ° UI |
| | | for (int i = 0; i < pageSize; ++i) { |
| | | CString descriptionCtrlName, positionCtrlName; |
| | | descriptionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP%d"), i + 1); |
| | | positionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT%d"), i + 1); |
| | | |
| | | UINT descriptionCtrlId = FindIDByName(descriptionCtrlName); |
| | | UINT positionCtrlId = FindIDByName(positionCtrlName); |
| | | |
| | | CWnd* pDescriptionCtrl = GetDlgItem(descriptionCtrlId); |
| | | CWnd* pPositionCtrl = GetDlgItem(positionCtrlId); |
| | | |
| | | if (i < positions.size()) { |
| | | const PositionRange& position = positions[i]; |
| | | |
| | | // æ¾ç¤ºå®ä½ç¹çæè¿° |
| | | CString description = CString(position.description.c_str()); |
| | | if (pDescriptionCtrl) pDescriptionCtrl->SetWindowText(description); |
| | | |
| | | // æ¾ç¤ºå®ä½ç¹çå½åä½ç½® |
| | | CString value; |
| | | value.Format(_T("%.3f"), position.range.currentValue); |
| | | 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 { |
| | | // æ¸
空æ§ä»¶å
容 |
| | | if (pDescriptionCtrl) { |
| | | pDescriptionCtrl->SetWindowText(_T("")); |
| | | pDescriptionCtrl->EnableWindow(FALSE); |
| | | } |
| | | |
| | | if (pPositionCtrl) { |
| | | pPositionCtrl->SetWindowText(_T("")); |
| | | pPositionCtrl->EnableWindow(FALSE); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::UpdatePositionRange(PositionRange& position, int pageNumber, int pageSize, int currentIndex) |
| | | { |
| | | // è·åå½åè¾å
¥æ¡ä¸çææ¬ |
| | | CString strText; |
| | | GetDlgItem(IDC_EDIT_AXIS_CURR_POS)->GetWindowText(strText); |
| | | if (strText.IsEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | CString descriptionCtrlName, positionCtrlName; |
| | | descriptionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP%d"), currentIndex + 1); |
| | | positionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT%d"), currentIndex + 1); |
| | | |
| | | UINT descriptionCtrlId = FindIDByName(descriptionCtrlName); |
| | | UINT positionCtrlId = FindIDByName(positionCtrlName); |
| | | |
| | | CWnd* pDescriptionCtrl = GetDlgItem(descriptionCtrlId); |
| | | CWnd* pPositionCtrl = GetDlgItem(positionCtrlId); |
| | | |
| | | if (pDescriptionCtrl == nullptr || pPositionCtrl == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | double enteredValue = _ttof(strText); |
| | | double minValue = position.range.minValue; |
| | | double maxValue = position.range.maxValue; |
| | | |
| | | // 夿è¾å
¥ç弿¯å¦å¨åæ³èå´å
|
| | | if (enteredValue < minValue || enteredValue > maxValue) { |
| | | CString strError; |
| | | strError.Format(_T("å®ä½ç¹çå¼å¿
é¡»å¨ %f å %f ä¹é´ï¼"), minValue, maxValue); |
| | | pDescriptionCtrl->SetWindowText(strError); |
| | | } |
| | | else { |
| | | position.range.currentValue = enteredValue; |
| | | pDescriptionCtrl->SetWindowText(CString(position.description.c_str())); |
| | | pPositionCtrl->SetWindowText(strText); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::UpdateAxisSelection(int offset) |
| | | { |
| | | int currentIndex = m_comboAxisNO.GetCurSel(); |
| | | if (currentIndex == CB_ERR) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | int newIndex = currentIndex + offset; |
| | | if (newIndex < 0 || newIndex >= m_comboAxisNO.GetCount()) { |
| | | CString error; |
| | | error.Format(_T("å·²ç»å°è¾¾%sä¸ä¸ªè½´ï¼"), offset < 0 ? _T("ä¸") : _T("ä¸")); |
| | | AfxMessageBox(error); |
| | | return; |
| | | } |
| | | |
| | | m_comboAxisNO.SetCurSel(newIndex); |
| | | RefreshAxisDetails(newIndex + 1); |
| | | RefreshPositionDetails(newIndex + 1, m_currentPage); |
| | | UpdatePageButtonStates(); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::UpdateDataFromUI(int nAxisId) |
| | | { |
| | | const int pageSize = AXIS_PAGE_SIZE; // æ¯é¡µæ¾ç¤º 5 个å®ä½ç¹ |
| | | auto axisData = m_pAxisManager->GetAxis(nAxisId); |
| | | |
| | | // è·åçé¢ä¸çä¿®æ¹åæ° |
| | | CString text; |
| | | m_pRegexEdit[EDIT_MANUAL_SPEED]->GetWindowText(text); |
| | | axisData.manualSpeed.currentValue = _ttof(text); |
| | | |
| | | m_pRegexEdit[EDIT_AUTO_SPEED]->GetWindowText(text); |
| | | axisData.autoSpeed.currentValue = _ttof(text); |
| | | |
| | | m_pRegexEdit[EDIT_ACCE_TIME]->GetWindowText(text); |
| | | axisData.accelerationTime.currentValue = _ttof(text); |
| | | |
| | | m_pRegexEdit[EDIT_DECE_TIME]->GetWindowText(text); |
| | | axisData.decelerationTime.currentValue = _ttof(text); |
| | | |
| | | m_pRegexEdit[EDIT_MICROMENTUM]->GetWindowText(text); |
| | | axisData.jogDistance.currentValue = _ttof(text); |
| | | |
| | | // æ´æ°å®ä½ç¹æ°æ® |
| | | for (int i = 0; i < pageSize; ++i) { |
| | | int index = (m_currentPage - 1) * pageSize + i; |
| | | |
| | | if (index < axisData.positions.size()) { |
| | | // æå»ºæ§ä»¶åç§° |
| | | CString descriptionName, positionName; |
| | | descriptionName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP%d"), i + 1); |
| | | positionName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT%d"), i + 1); |
| | | |
| | | // è·åæ§ä»¶ |
| | | CEdit* pDescriptionEdit = (CEdit*)GetDlgItem(FindIDByName(descriptionName)); |
| | | CEdit* pPositionEdit = (CEdit*)GetDlgItem(FindIDByName(positionName)); |
| | | |
| | | if (pDescriptionEdit && pPositionEdit) { |
| | | CString description, positionValue; |
| | | |
| | | // è·åæ§ä»¶ä¸çææ¬ |
| | | pDescriptionEdit->GetWindowText(description); |
| | | pPositionEdit->GetWindowText(positionValue); |
| | | |
| | | // æ´æ° AxisManager ä¸çæ°æ® |
| | | axisData.positions[index].description = CT2A(description); |
| | | axisData.positions[index].range.currentValue = _ttof(positionValue); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ä¿å AxisManager |
| | | m_pAxisManager->UpdateAxis(axisData); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::SwitchToPage(int targetPage) |
| | | { |
| | | try { |
| | | // 妿å½å页é¢å·²ç»æ¯ç®æ 页é¢ï¼ç´æ¥è¿å |
| | | if (m_currentPage == targetPage) { |
| | | return; |
| | | } |
| | | |
| | | // è·åå½åéä¸çè½´ ID |
| | | int axisId = GetCurrentSelectedAxisID(); |
| | | if (axisId == -1) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | // æ´æ° UI æ°æ®å°å
å |
| | | UpdateDataFromUI(axisId); |
| | | |
| | | // åæ¢é¡µé¢ |
| | | m_currentPage = targetPage; |
| | | RefreshPositionDetails(axisId, targetPage); |
| | | UpdatePageButtonStates(); |
| | | } |
| | | catch (const std::exception& ex) { |
| | | CString errorMsg; |
| | | errorMsg.Format(_T("å·æ°å®ä½ç»%d失败ï¼%s"), targetPage, CString(ex.what())); |
| | | AfxMessageBox(errorMsg, MB_ICONERROR); |
| | | } |
| | | } |
| | | |
| | | bool CAxisSettingsDlg::ParsePLCAddress(const CString& address, MC::SOFT_COMPONENT& component, int& addr) |
| | | { |
| | | if (address.GetLength() < 2) { |
| | | return false; |
| | | } |
| | | |
| | | // æåç»ä»¶ç±»åï¼ç¬¬ä¸ä¸ªåç¬¦ï¼ |
| | | TCHAR componentChar = address[0]; |
| | | if (address.Left(2) == _T("ZR")) { |
| | | component = MC::SOFT_COMPONENT::ZR; |
| | | // æåæ°åé¨åï¼å»é¤ZRåç¼ï¼ |
| | | CString numericAddress = address.Mid(2); |
| | | addr = _ttoi(numericAddress); |
| | | return addr != 0 || numericAddress.CompareNoCase(_T("0")) == 0; // å¦ææ¯ "0"ï¼ä¹è®¤ä¸ºææ |
| | | } |
| | | |
| | | // 对äºå
¶ä»ç»ä»¶ï¼æç
§å¸¸è§è§åå¤ç |
| | | CString hexAddress = address.Mid(1); |
| | | switch (componentChar) { |
| | | case 'D': |
| | | component = MC::SOFT_COMPONENT::D; |
| | | addr = _ttoi(hexAddress); |
| | | break; |
| | | case 'M': |
| | | component = MC::SOFT_COMPONENT::M; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'X': |
| | | component = MC::SOFT_COMPONENT::X; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'Y': |
| | | component = MC::SOFT_COMPONENT::Y; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'W': |
| | | component = MC::SOFT_COMPONENT::W; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'L': |
| | | component = MC::SOFT_COMPONENT::L; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'S': |
| | | component = MC::SOFT_COMPONENT::S; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'B': |
| | | component = MC::SOFT_COMPONENT::B; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | case 'F': |
| | | component = MC::SOFT_COMPONENT::F; |
| | | addr = _tcstoul(hexAddress, nullptr, 16); |
| | | break; |
| | | default: |
| | | return false; |
| | | } |
| | | |
| | | // æ£æ¥å°åæ¯å¦ææ |
| | | if (addr == 0 && hexAddress.CompareNoCase(_T("0")) != 0) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | void CAxisSettingsDlg::WriteAxisDataToPLC(int nAxisId) |
| | | { |
| | | // ä» AxisManager è·åè½´æ°æ® |
| | | auto axisData = m_pAxisManager->GetAxis(nAxisId); |
| | | |
| | | int startAddress; |
| | | MC::SOFT_COMPONENT component; |
| | | if (!ParsePLCAddress(CString(axisData.startAddress.c_str()), component, startAddress)) { |
| | | AfxMessageBox(_T("æ æçèµ·å§å°åï¼")); |
| | | } |
| | | |
| | | // åå
¥æå¨é度 |
| | | m_pPLC->writeDWord(component, startAddress + 82, (int)axisData.manualSpeed.currentValue * 1000, [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: æå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: æå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥èªå¨é度 |
| | | m_pPLC->writeDWord(component, startAddress + 84, (int)(axisData.autoSpeed.currentValue * 1000.0), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: èªå¨é度, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: èªå¨é度, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å éæ¶é´, 转æ¢ä¸ºæ¯«ç§ |
| | | m_pPLC->writeDWord(component, startAddress + 62, (int)(axisData.accelerationTime.currentValue * 1000.0), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å éæ¶é´, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å éæ¶é´, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥åéæ¶é´, 转æ¢ä¸ºæ¯«ç§ |
| | | m_pPLC->writeDWord(component, startAddress + 64, (int)(axisData.decelerationTime.currentValue * 1000.0), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: åéæ¶é´, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: åéæ¶é´, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å¾®å¨é |
| | | m_pPLC->writeWord(component, startAddress + 81, (int)(axisData.jogDistance.currentValue * 1000.0), [](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å¾®å¨é, å°å: %d, å¼: %lu\n", addr, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å¾®å¨é, å°å: %d, é误ç : %d\n", addr, flag); |
| | | } |
| | | }); |
| | | |
| | | // åå
¥å®ä½ç¹æ°æ® |
| | | int positionStartAddress = startAddress + 100; |
| | | for (int i = 0; i < axisData.positions.size(); ++i) { |
| | | const auto& position = axisData.positions[i]; |
| | | unsigned int positionAddress = positionStartAddress + (i * 2); |
| | | |
| | | double valueToWrite = position.range.currentValue; |
| | | m_pPLC->writeDWord(component, positionAddress, (int)(valueToWrite * 1000), [i, positionAddress](IMcChannel* pChannel, int addr, DWORD value, int flag) { |
| | | if (flag == 0) { |
| | | TRACE("\nåå
¥æå: å®ä½ç¹ %d, å°å: %d, å¼: %lu\n", i + 1, positionAddress, value); |
| | | } |
| | | else { |
| | | TRACE("\nåå
¥å¤±è´¥: å®ä½ç¹ %d, å°å: %d, é误ç : %d\n", i + 1, positionAddress, flag); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::HandleAxisOperation(AxisOperationType eOpType, bool bPressed) |
| | | { |
| | | int nAxisId = GetCurrentSelectedAxisID(); |
| | | if (nAxisId == -1) { |
| | | AfxMessageBox(_T("æªéæ©ææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | // è·åè½´æ°æ® |
| | | auto axisData = m_pAxisManager->GetAxis(nAxisId); |
| | | |
| | | int startAddress; |
| | | MC::SOFT_COMPONENT component; |
| | | if (!ParsePLCAddress(CString(axisData.startAddress.c_str()), component, startAddress)) { |
| | | AfxMessageBox(_T("æ æçèµ·å§å°åï¼")); |
| | | } |
| | | |
| | | // æ ¹æ®æä½ç±»å计ç®ç®æ å°å |
| | | int bitIndex = 0; |
| | | char szWrite[4] = { 0x0, 0x0, 0x0, 0x0 }; |
| | | switch (eOpType) { |
| | | case AxisOperationType::OPR: |
| | | startAddress += 0; // OPR ä¿¡å·å°å 0,éªå¨ä¿¡æ¯06.0 |
| | | szWrite[0] = bPressed ? 0x1 : 0; |
| | | break; |
| | | case AxisOperationType::JOG_ADD: |
| | | startAddress += 01; // JOG+ ä¿¡å·å°å c |
| | | szWrite[1] = bPressed ? 0x10 : 0; |
| | | break; |
| | | case AxisOperationType::JOG_SUB: |
| | | startAddress += 01; // JOG- ä¿¡å·å°å d |
| | | szWrite[1] = bPressed ? 0x20 : 0; |
| | | break; |
| | | case AxisOperationType::STOP: |
| | | startAddress += 05; // STOP ä¿¡å·å°å 5.e |
| | | szWrite[1] = bPressed ? 0x40 : 0; |
| | | break; |
| | | case AxisOperationType::SEV_ON: |
| | | startAddress += 01; // SEV_ON ä¿¡å·å°å 1.a |
| | | szWrite[1] = bPressed ? 0x04 : 0; |
| | | break; |
| | | case AxisOperationType::POSITION_1: |
| | | case AxisOperationType::POSITION_2: |
| | | case AxisOperationType::POSITION_3: |
| | | case AxisOperationType::POSITION_4: |
| | | case AxisOperationType::POSITION_5: |
| | | startAddress += ((m_currentPage - 1) * 5 + ((int)eOpType - (int)AxisOperationType::POSITION_1 + 1)) / 16; |
| | | bitIndex = ((m_currentPage-1) * 5 + ((int)eOpType - (int)AxisOperationType::POSITION_1 + 1)) % 16; |
| | | if(bPressed) CToolUnits::setBit(szWrite, bitIndex); |
| | | break; |
| | | default: |
| | | AfxMessageBox(_T("æªç¥æä½ç±»åï¼")); |
| | | return; |
| | | } |
| | | |
| | | // å PLC åå
¥ä¿¡å· |
| | | m_pPLC->writeData(component, startAddress, szWrite, 2, [eOpType, startAddress, bPressed](IMcChannel* pChannel, int nAddr, DWORD nValue, int nFlag) { |
| | | if (nFlag == 0) { |
| | | TRACE("æä½æåï¼ç±»å=%dï¼å°å=%dï¼å¼=%d\n", static_cast<int>(eOpType), nAddr, bPressed); |
| | | } |
| | | else { |
| | | TRACE("æä½å¤±è´¥ï¼ç±»å=%dï¼å°å=%dï¼é误ç =%d\n", static_cast<int>(eOpType), nAddr, nFlag); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::ReadPLCDataToUI(int nAxisId) |
| | | { |
| | | AxisInfo axisData = m_pAxisManager->GetAxis(nAxisId); |
| | | |
| | | MC::SOFT_COMPONENT component; |
| | | int startAddress, endAddress, readSize; |
| | | if (!ParsePLCAddress(CString(axisData.startAddress.c_str()), component, startAddress)) { |
| | | AfxMessageBox(_T("æ æçèµ·å§å°åï¼")); |
| | | } |
| | | endAddress = startAddress + 300; |
| | | readSize = (endAddress - startAddress + 1) * 2; |
| | | |
| | | auto funOnReadData = [this, nAxisId, startAddress, readSize](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == readSize && flag == 0 && ::IsWindow(m_hWnd)) { |
| | | m_fCurPos = CToolUnits::toInt32(&pData[20 * 2]) * 0.001; |
| | | m_fManualSpeed = CToolUnits::toInt32(&pData[82 * 2]) * 0.001; |
| | | m_fAutoSpeed = CToolUnits::toInt32(&pData[84 * 2]) * 0.001; |
| | | m_fPrm = CToolUnits::toInt32(&pData[50 * 2]) * 0.1; |
| | | m_nLoad = CToolUnits::toInt16(&pData[54 * 2]); |
| | | m_nErrCode = CToolUnits::toInt16(&pData[26 * 2]); |
| | | m_nAlarmCode = CToolUnits::toInt16(&pData[27 * 2]); |
| | | |
| | | m_bSEV = CToolUnits::getBit(pData[1 * 2 + 1], 0xa - 8); |
| | | m_bFLS = CToolUnits::getBit(pData[10 * 2], 1); |
| | | m_bDOG = CToolUnits::getBit(pData[10 * 2], 6); |
| | | m_bRLS = CToolUnits::getBit(pData[10 * 2], 0); |
| | | m_bReady = CToolUnits::getBit(pData[10 * 2 + 1], 0xA - 8); |
| | | 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 |
| | | // ä¿®æ¹ZR06.0éªç为1ï¼åæ¢éªçæ¯0 |
| | | // å®ä½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); |
| | | |
| | | // 读åå®ä½ç¹æ°æ® |
| | | AxisInfo axisInfo = m_pAxisManager->GetAxis(nAxisId); |
| | | for (int i = 0; i < axisInfo.positions.size(); ++i) { |
| | | if (axisInfo.positions[i].isEnable == FALSE) { |
| | | unsigned int positionAddress = 100 + (i * 2); |
| | | axisInfo.positions[i].range.currentValue = CToolUnits::toInt32(&pData[positionAddress * 2]) * 0.001; |
| | | } |
| | | } |
| | | m_pAxisManager->UpdateAxis(axisInfo); |
| | | |
| | | PostMessage(ID_MSG_UPDATA_DATA_TO_UI); |
| | | } |
| | | }; |
| | | m_pPLC->readData(component, startAddress, readSize, funOnReadData); |
| | | } |
| | | |
| | | |
| | | 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_ANCHOR_POINT_GROUP2, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup2) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP3, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup3) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP4, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup4) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP5, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup5) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT1, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint1) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT2, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT3, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint3) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT4, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint4) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT5, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint5) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_OPR, &CAxisSettingsDlg::OnBnClickedButtonAxisTestOpr) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_TEST_STOP, &CAxisSettingsDlg::OnBnClickedButtonAxisTestStop) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_SEV, &CAxisSettingsDlg::OnBnClickedButtonAxisSev) |
| | | ON_CBN_SELCHANGE(IDC_COMBO_AXIS_NAME, &CAxisSettingsDlg::OnSelchangeComboAxisName) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_SAVE, &CAxisSettingsDlg::OnBnClickedButtonAxisSave) |
| | | ON_BN_CLICKED(IDC_BUTTON_AXIS_UPDATE_UI, &CAxisSettingsDlg::OnBnClickedButtonAxisUpdateUi) |
| | | 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_TIMER() |
| | | ON_WM_CLOSE() |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CAxisSettingsDlg æ¶æ¯å¤çç¨åº |
| | | |
| | | |
| | | BOOL CAxisSettingsDlg::OnInitDialog() |
| | | { |
| | | CBaseDlg::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | if (m_pPLC == nullptr || !m_pPLC->isConnected()) { |
| | | AfxMessageBox(_T("PLC æªè¿æ¥ï¼")); |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strTitle; |
| | | strTitle.Format(_T("轴设å®é¡µé¢(PLC: %s)"), m_pPLC->getName().c_str()); |
| | | SetWindowText(strTitle); |
| | | |
| | | // éèå
æ |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_POS); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_MANUAL_SPEED); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_AUTO_SPEED); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_ROTA_SPEED); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_LOAD); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_ERROR_NUMBER); |
| | | HideEditCursor(IDC_EDIT_AXIS_CURR_ALARM_NUMBER); |
| | | |
| | | // 设置æµè¯ç¶æ |
| | | m_pBlLabels[LABEL_FLS]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_FLS, this); |
| | | m_pBlLabels[LABEL_DOG]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_DOG, this); |
| | | m_pBlLabels[LABEL_RLS]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_RLS, this); |
| | | m_pBlLabels[LABEL_READY]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_READY, this); |
| | | m_pBlLabels[LABEL_BUSY]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_BUSY, this); |
| | | m_pBlLabels[LABEL_ERR]->SubclassDlgItem(IDC_STATIC_AXIS_TEST_ERR, this); |
| | | |
| | | for (auto pLabel : m_pBlLabels) { |
| | | pLabel->SetBkColor(RGB(0, 180, 0)); |
| | | pLabel->SetRoundedCorners(TRUE, 10); |
| | | pLabel->DisableBorder(); |
| | | pLabel->SetTextColor(RGB(0, 0, 0)); |
| | | 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); |
| | | m_pBlBtns[BTN_PAGE3]->SubclassDlgItem(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP3, this); |
| | | m_pBlBtns[BTN_PAGE4]->SubclassDlgItem(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP4, this); |
| | | m_pBlBtns[BTN_PAGE5]->SubclassDlgItem(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP5, this); |
| | | m_pBlBtns[BTN_JOG_ADD]->SubclassDlgItem(IDC_BUTTON_AXIS_TEST_JOG_ADD, this); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetFrameColor(BS_NORMAL, BTN_JOG_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetFrameColor(BS_HOVER, BTN_JOG_FRAME_HOVER); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetFrameColor(BS_PRESS, BTN_JOG_FRAME_PRESS); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetBkgndColor(BS_NORMAL, BTN_JOG_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetBkgndColor(BS_HOVER, BTN_JOG_BKGND_HOVER); |
| | | m_pBlBtns[BTN_JOG_ADD]->SetBkgndColor(BS_PRESS, BTN_JOG_BKGND_PRESS); |
| | | m_pBlBtns[BTN_JOG_SUB]->SubclassDlgItem(IDC_BUTTON_AXIS_TEST_JOG_SUB, this); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetFrameColor(BS_NORMAL, BTN_JOG_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetFrameColor(BS_HOVER, BTN_JOG_FRAME_HOVER); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetFrameColor(BS_PRESS, BTN_JOG_FRAME_PRESS); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetBkgndColor(BS_NORMAL, BTN_JOG_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetBkgndColor(BS_HOVER, BTN_JOG_BKGND_HOVER); |
| | | m_pBlBtns[BTN_JOG_SUB]->SetBkgndColor(BS_PRESS, BTN_JOG_BKGND_PRESS); |
| | | m_pBlBtns[BTN_JOG_SEV]->SubclassDlgItem(IDC_BUTTON_AXIS_SEV, this); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetFrameColor(BS_NORMAL, BTN_SEV_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetFrameColor(BS_HOVER, BTN_SEV_FRAME_HOVER); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetFrameColor(BS_PRESS, BTN_SEV_FRAME_PRESS); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetBkgndColor(BS_NORMAL, BTN_SEV_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetBkgndColor(BS_HOVER, BTN_SEV_BKGND_HOVER); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetBkgndColor(BS_PRESS, BTN_SEV_BKGND_PRESS); |
| | | m_pBlBtns[BTN_JOG_STOP]->SubclassDlgItem(IDC_BUTTON_AXIS_TEST_STOP, this); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetFrameColor(BS_NORMAL, BTN_STOP_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetFrameColor(BS_HOVER, BTN_STOP_FRAME_HOVER); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetFrameColor(BS_PRESS, BTN_STOP_FRAME_PRESS); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetBkgndColor(BS_NORMAL, BTN_STOP_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetBkgndColor(BS_HOVER, BTN_STOP_BKGND_HOVER); |
| | | m_pBlBtns[BTN_JOG_STOP]->SetBkgndColor(BS_PRESS, BTN_STOP_BKGND_PRESS); |
| | | m_pBlBtns[BTN_JOG_OPR]->SubclassDlgItem(IDC_BUTTON_AXIS_TEST_OPR, this); |
| | | m_pBlBtns[BTN_JOG_OPR]->SetFrameColor(BS_NORMAL, BTN_OPR_FRAME_NORMAL); |
| | | m_pBlBtns[BTN_JOG_OPR]->SetFrameColor(BS_HOVER, BTN_OPR_FRAME_HOVER); |
| | | m_pBlBtns[BTN_JOG_OPR]->SetFrameColor(BS_PRESS, BTN_OPR_FRAME_PRESS); |
| | | 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; |
| | | UpdatePageButtonStates(); |
| | | |
| | | InitializeAxisIDCombo(); |
| | | RefreshAxisDetails(1); |
| | | RefreshPositionDetails(1, m_currentPage); |
| | | |
| | | SetTimer(TIMER_READ_PLC_DATA, 500, nullptr); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | | |
| | | BOOL CAxisSettingsDlg::PreTranslateMessage(MSG* pMsg) |
| | | { |
| | | // TODO: 卿¤æ·»å ä¸ç¨ä»£ç å/æè°ç¨åºç±» |
| | | 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 || |
| | | pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP3)->m_hWnd || |
| | | pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP4)->m_hWnd || |
| | | pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP5)->m_hWnd) { |
| | | int currentIndex = -1; |
| | | |
| | | // æ ¹æ®æ§ä»¶IDç¡®å® currentIndex |
| | | if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP1)->m_hWnd) { |
| | | currentIndex = 0; |
| | | } |
| | | else if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP2)->m_hWnd) { |
| | | currentIndex = 1; |
| | | } |
| | | else if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP3)->m_hWnd) { |
| | | currentIndex = 2; |
| | | } |
| | | else if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP4)->m_hWnd) { |
| | | currentIndex = 3; |
| | | } |
| | | else if (pWnd->GetSafeHwnd() == GetDlgItem(IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP5)->m_hWnd) { |
| | | currentIndex = 4; |
| | | } |
| | | |
| | | if (currentIndex == -1) { |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | CString descriptionCtrlName, positionCtrlName; |
| | | descriptionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT_DESCRIP%d"), currentIndex + 1); |
| | | positionCtrlName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT%d"), currentIndex + 1); |
| | | |
| | | UINT descriptionCtrlId = FindIDByName(descriptionCtrlName); |
| | | UINT positionCtrlId = FindIDByName(positionCtrlName); |
| | | |
| | | CWnd* pDescriptionCtrl = GetDlgItem(descriptionCtrlId); |
| | | CWnd* pPositionCtrl = GetDlgItem(positionCtrlId); |
| | | |
| | | if (pDescriptionCtrl == nullptr || pPositionCtrl == nullptr) { |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | PositionRange& position = m_pAxisManager->GetPositionByIndex(GetCurrentSelectedAxisID(), m_currentPage, AXIS_PAGE_SIZE, currentIndex); |
| | | if (pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONDBLCLK) { |
| | | // å¤çé¼ æ ç¹å»äºä»¶ |
| | | // è®¾ç½®é¼ æ 为ç®å¤´å
æ |
| | | ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); |
| | | |
| | | CString strText; |
| | | GetDlgItem(IDC_EDIT_AXIS_CURR_POS)->GetWindowText(strText); |
| | | if (strText.IsEmpty()) { |
| | | return CBaseDlg::PreTranslateMessage(pMsg);; |
| | | } |
| | | |
| | | double enteredValue = _ttof(strText); |
| | | double minValue = position.range.minValue; |
| | | double maxValue = position.range.maxValue; |
| | | |
| | | // 夿è¾å
¥ç弿¯å¦å¨åæ³èå´å
|
| | | if (enteredValue < minValue || enteredValue > maxValue) { |
| | | CString strError; |
| | | strError.Format(_T("å®ä½ç¹çå¼å¿
é¡»å¨ %f å %f ä¹é´ï¼"), minValue, maxValue); |
| | | pDescriptionCtrl->SetWindowText(strError); |
| | | } |
| | | else { |
| | | position.range.currentValue = enteredValue; |
| | | pPositionCtrl->SetWindowText(strText); |
| | | } |
| | | } |
| | | else if (pMsg->message == WM_LBUTTONUP) { |
| | | // å¤çé¼ æ æ¬èµ·äºä»¶ |
| | | // è®¾ç½®é¼ æ 为æå½¢å
æ |
| | | ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND)); |
| | | |
| | | CString strText; |
| | | strText.Format(_T("%s"), position.description.c_str()); |
| | | pDescriptionCtrl->SetWindowText(strText); |
| | | } |
| | | else if (pMsg->message == WM_MOUSEMOVE) { |
| | | // å¤çé¼ æ ç§»å¨äºä»¶ |
| | | ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND)); |
| | | } |
| | | } |
| | | |
| | | if (pMsg->message == WM_LBUTTONDOWN) { |
| | | if (pMsg->hwnd == GetDlgItem(IDC_BUTTON_AXIS_TEST_JOG_ADD)->m_hWnd) { |
| | | TRACE("JOG+ æé®æä¸\n"); |
| | | HandleAxisOperation(AxisOperationType::JOG_ADD, true); |
| | | } |
| | | else if (pMsg->hwnd == GetDlgItem(IDC_BUTTON_AXIS_TEST_JOG_SUB)->m_hWnd) { |
| | | TRACE("JOG- æé®æä¸\n"); |
| | | // å¯å¨å®æ¶å¨è¿ç»åéä¿¡å· |
| | | HandleAxisOperation(AxisOperationType::JOG_SUB, true); |
| | | } |
| | | } |
| | | else if (pMsg->message == WM_LBUTTONUP) { |
| | | if (pMsg->hwnd == GetDlgItem(IDC_BUTTON_AXIS_TEST_JOG_ADD)->m_hWnd) { |
| | | TRACE("JOG+ æé®æ¾å¼\n"); |
| | | HandleAxisOperation(AxisOperationType::JOG_ADD, false); |
| | | } |
| | | else if (pMsg->hwnd == GetDlgItem(IDC_BUTTON_AXIS_TEST_JOG_SUB)->m_hWnd) { |
| | | TRACE("JOG- æé®æ¾å¼\n"); |
| | | HandleAxisOperation(AxisOperationType::JOG_SUB, false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return CBaseDlg::PreTranslateMessage(pMsg); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CBaseDlg::OnSize(nType, cx, cy); |
| | | |
| | | // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç |
| | | // å¨æè°æ´å个 CBLLabel çåä½å¤§å° |
| | | for (auto pLabel : m_pBlLabels) { |
| | | AdjustLabelFont(*pLabel); |
| | | } |
| | | |
| | | // è°æ´ä¸ææ¡é«åº¦ |
| | | CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_AXIS_NAME); |
| | | CButton* pButtonLeft = (CButton*)GetDlgItem(IDC_BUTTON_AXIS_LAST); |
| | | CButton* pButtonRight = (CButton*)GetDlgItem(IDC_BUTTON_AXIS_NEXT); |
| | | |
| | | if (pComboBox && pButtonLeft && pButtonRight) { |
| | | CRect rectButton; |
| | | pButtonLeft->GetWindowRect(&rectButton); // è·åæé®å°ºå¯¸ |
| | | ScreenToClient(&rectButton); // 转æ¢ä¸ºå®¢æ·ç«¯åæ |
| | | |
| | | CRect rectComboBox; |
| | | pComboBox->GetWindowRect(&rectComboBox); |
| | | ScreenToClient(&rectComboBox); |
| | | |
| | | // è°æ´ä¸ææ¡é«åº¦ |
| | | int heightAdjustment = 2; |
| | | rectComboBox.top = rectButton.top; |
| | | rectComboBox.bottom = rectButton.bottom + heightAdjustment; |
| | | pComboBox->MoveWindow(&rectComboBox); |
| | | pComboBox->SetItemHeight(-1, rectButton.Height() - 6); |
| | | } |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisLast() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | UpdateAxisSelection(-1); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisNext() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | UpdateAxisSelection(1); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup1() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | SwitchToPage(1); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup2() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | SwitchToPage(2); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup3() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | SwitchToPage(3); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup4() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | SwitchToPage(4); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup5() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | SwitchToPage(5); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint1() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::POSITION_1, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::POSITION_1, false); |
| | | m_pBlBtns[BTN_POINT1]->Flash(500); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint2() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::POSITION_2, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::POSITION_2, false); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint3() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::POSITION_3, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::POSITION_3, false); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint4() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::POSITION_4, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::POSITION_4, false); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPoint5() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::POSITION_5, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::POSITION_5, false); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisTestOpr() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::OPR, true); |
| | | Sleep(200); |
| | | HandleAxisOperation(AxisOperationType::OPR, false); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisTestStop() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::STOP, true); |
| | | 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() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleAxisOperation(AxisOperationType::SEV_ON, !m_bSEV); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnSelchangeComboAxisName() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | int axisId = GetCurrentSelectedAxisID(); |
| | | if (axisId == -1) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | RefreshAxisDetails(axisId); |
| | | RefreshPositionDetails(axisId, m_currentPage); |
| | | UpdatePageButtonStates(); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisSave() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | int axisId = GetCurrentSelectedAxisID(); |
| | | if (axisId == -1) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | CString cstrMessage; |
| | | cstrMessage.Format(_T("æ¯å¦ä¿åè½´ [%d] åæ°ï¼"), axisId); |
| | | int ret = AfxMessageBox(_T(cstrMessage), MB_OKCANCEL | MB_ICONEXCLAMATION); |
| | | if (ret != IDOK) { |
| | | return; |
| | | } |
| | | |
| | | UpdateDataFromUI(axisId); |
| | | if (m_pAxisManager->SaveAxis(m_pPLC->getName())) { |
| | | WriteAxisDataToPLC(axisId); |
| | | |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] åæ°æåï¼"), axisId); |
| | | } |
| | | else { |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] åæ°å¤±è´¥ï¼"), axisId); |
| | | } |
| | | |
| | | AfxMessageBox(cstrMessage); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisUpdateUi() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | int axisId = GetCurrentSelectedAxisID(); |
| | | if (axisId == -1) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | RefreshAxisDetails(axisId); |
| | | RefreshPositionDetails(axisId, m_currentPage); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnBnClickedButtonAxisDetailSettings() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | int nAxisId = GetCurrentSelectedAxisID(); |
| | | if (nAxisId == -1) { |
| | | AfxMessageBox(_T("è¯·éæ©ä¸ä¸ªææçè½´ç¼å·ï¼")); |
| | | return; |
| | | } |
| | | |
| | | CAxisDetailSettingsDlg dlg(m_pAxisManager, nAxisId, this); |
| | | dlg.DoModal(); |
| | | |
| | | RefreshAxisDetails(nAxisId); |
| | | RefreshPositionDetails(nAxisId, m_currentPage); |
| | | } |
| | | |
| | | LRESULT CAxisSettingsDlg::OnUpdateDataToUI(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | CToolUnits::setDlgItemDouble(this, IDC_EDIT_AXIS_CURR_POS, m_fCurPos); |
| | | CToolUnits::setDlgItemDouble(this, IDC_EDIT_AXIS_CURR_MANUAL_SPEED, m_fManualSpeed); |
| | | CToolUnits::setDlgItemDouble(this, IDC_EDIT_AXIS_CURR_AUTO_SPEED, m_fAutoSpeed); |
| | | CToolUnits::setDlgItemDouble(this, IDC_EDIT_AXIS_CURR_ROTA_SPEED, m_fPrm); |
| | | SetDlgItemInt(IDC_EDIT_AXIS_CURR_LOAD, m_nLoad); |
| | | SetDlgItemInt(IDC_EDIT_AXIS_CURR_ERROR_NUMBER, m_nErrCode); |
| | | SetDlgItemInt(IDC_EDIT_AXIS_CURR_ALARM_NUMBER, m_nAlarmCode); |
| | | |
| | | // æ´æ°Labelsç¶æ |
| | | UpdateLabels(); |
| | | |
| | | // æ´æ°ä¸å¯åçå®ä½ç¹æ°æ® |
| | | for (int i = 0; i < AXIS_PAGE_SIZE; ++i) { |
| | | PositionRange position = m_pAxisManager->GetPositionByIndex(GetCurrentSelectedAxisID(), m_currentPage, AXIS_PAGE_SIZE, 0); |
| | | if (position.isEnable) { |
| | | continue; |
| | | } |
| | | |
| | | CString positionName; |
| | | positionName.Format(_T("IDC_EDIT_AXIS_ANCHOR_POINT%d"), i + 1); |
| | | |
| | | CEdit* pPositionEdit = (CEdit*)GetDlgItem(FindIDByName(positionName)); |
| | | if (pPositionEdit) { |
| | | CString positionValue; |
| | | positionValue.Format(_T("%.3f"), position.range.currentValue); |
| | | pPositionEdit->GetWindowText(positionValue); |
| | | } |
| | | } |
| | | |
| | | // ZR 06.0 å 08.0 |
| | | // ååç¹è¿å¨ä¸ï¼ZR06.0å¨0å1ä¸åæ¢ï¼ååç¹å®æï¼ 08.0为1 |
| | | // ä¿®æ¹ZR06.0éªç为1ï¼åæ¢éªçæ¯0 |
| | | // OPRæé®æ¯å¦è¦éªçæåæ¢éªç |
| | | // 06.0å08.0 |
| | | if (m_nBtnsFlashState6 & 0x01) { |
| | | // 06.0 |
| | | if (!m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->Flash(500); |
| | | } |
| | | } |
| | | else { |
| | | if (m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | if (m_nBtnsFlashState8 & 0x01) { |
| | | // å®æä¿¡å· |
| | | if (m_pBlBtns[BTN_JOG_OPR]->IsFlash()) { |
| | | m_pBlBtns[BTN_JOG_OPR]->StopFlash(); |
| | | } |
| | | m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_NORMAL, BTN_OPR_BKGND_TEST); |
| | | m_pBlBtns[BTN_JOG_OPR]->Invalidate(); |
| | | } |
| | | else { |
| | | m_pBlBtns[BTN_JOG_OPR]->SetBkgndColor(BS_NORMAL, BTN_OPR_BKGND_NORMAL); |
| | | m_pBlBtns[BTN_JOG_OPR]->Invalidate(); |
| | | } |
| | | |
| | | 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(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & v) { |
| | | if (m_pBlBtns[BTN_POINT1]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT1]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | // è®¾ç½®ä½¿è½æé®ç¶æ |
| | | if (m_bSEV) { |
| | | m_pBlBtns[BTN_JOG_SEV]->SetWindowText(_T("Sev-OFF")); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetBkgndColor(BS_NORMAL, BTN_SEV_BKGND_PRESS); |
| | | } |
| | | else { |
| | | m_pBlBtns[BTN_JOG_SEV]->SetWindowText(_T("Sev-ON")); |
| | | m_pBlBtns[BTN_JOG_SEV]->SetBkgndColor(BS_NORMAL, BTN_SEV_BKGND_NORMAL); |
| | | } |
| | | |
| | | if (m_nBtnsFlashState6 & (v << 1)) { |
| | | if (!m_pBlBtns[BTN_POINT2]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT2]->Flash(500); |
| | | } |
| | | } |
| | | 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(500); |
| | | } |
| | | } |
| | | 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(500); |
| | | } |
| | | } |
| | | 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(500); |
| | | } |
| | | } |
| | | else if (m_nBtnsFlashState8 & (v << 4)) { |
| | | if (m_pBlBtns[BTN_POINT5]->IsFlash()) { |
| | | m_pBlBtns[BTN_POINT5]->StopFlash(); |
| | | } |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnTimer(UINT_PTR nIDEvent) |
| | | { |
| | | if (TIMER_READ_PLC_DATA == nIDEvent) { |
| | | ASSERT(m_pPLC); |
| | | |
| | | int nAxisId = GetCurrentSelectedAxisID(); |
| | | if (nAxisId == -1) { |
| | | return; |
| | | } |
| | | |
| | | ReadPLCDataToUI(nAxisId); |
| | | } |
| | | |
| | | CBaseDlg::OnTimer(nIDEvent); |
| | | } |
| | | |
| | | void CAxisSettingsDlg::OnClose() |
| | | { |
| | | // TODO: 卿¤æ·»å æ¶æ¯å¤çç¨åºä»£ç å/æè°ç¨é»è®¤å¼ |
| | | KillTimer(TIMER_READ_PLC_DATA); |
| | | |
| | | CBaseDlg::OnClose(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "BlButton.h" |
| | | #include "BLLabel.h" |
| | | #include "RegexEdit.h" |
| | | #include "CBaseDlg.h" |
| | | #include "PLC.h" |
| | | #include "AxisManager.h" |
| | | |
| | | // æ¯é¡µå®ä½ç¹æ¾ç¤ºä¸ªæ° |
| | | #define AXIS_PAGE_SIZE 5 |
| | | |
| | | // Labelæ§ä»¶ |
| | | #define LABEL_MAX 6 |
| | | #define LABEL_FLS 0 |
| | | #define LABEL_DOG 1 |
| | | #define LABEL_RLS 2 |
| | | #define LABEL_READY 3 |
| | | #define LABEL_BUSY 4 |
| | | #define LABEL_ERR 5 |
| | | |
| | | // RegexEditæ§ä»¶ |
| | | #define EDIT_MAX 10 |
| | | #define EDIT_MANUAL_SPEED 0 |
| | | #define EDIT_AUTO_SPEED 1 |
| | | #define EDIT_ACCE_TIME 2 |
| | | #define EDIT_DECE_TIME 3 |
| | | #define EDIT_MICROMENTUM 4 |
| | | #define EDIT_ANCHOR_POINT1 5 |
| | | #define EDIT_ANCHOR_POINT2 6 |
| | | #define EDIT_ANCHOR_POINT3 7 |
| | | #define EDIT_ANCHOR_POINT4 8 |
| | | #define EDIT_ANCHOR_POINT5 9 |
| | | |
| | | // BUTTONæ§ä»¶ |
| | | #define BTN_MAX 15 |
| | | #define BTN_PAGE1 0 |
| | | #define BTN_PAGE2 1 |
| | | #define BTN_PAGE3 2 |
| | | #define BTN_PAGE4 3 |
| | | #define BTN_PAGE5 4 |
| | | #define BTN_JOG_ADD 5 |
| | | #define BTN_JOG_SUB 6 |
| | | #define BTN_JOG_SEV 7 |
| | | #define BTN_JOG_OPR 8 |
| | | #define BTN_JOG_STOP 9 |
| | | #define BTN_POINT1 10 |
| | | #define BTN_POINT2 11 |
| | | #define BTN_POINT3 12 |
| | | #define BTN_POINT4 13 |
| | | #define BTN_POINT5 14 |
| | | |
| | | // CAxisSettingsDlg å¯¹è¯æ¡ |
| | | |
| | | enum class AxisOperationType { |
| | | OPR = 0, // ååç¹ |
| | | JOG_ADD, // æ£åç¹å¨ |
| | | JOG_SUB, // ååç¹å¨ |
| | | STOP, // 忢æä½ |
| | | SEV_ON, // ä½¿è½ |
| | | POSITION_1, // å®ä½ç¹1 |
| | | POSITION_2, // å®ä½ç¹2 |
| | | POSITION_3, // å®ä½ç¹3 |
| | | POSITION_4, // å®ä½ç¹4 |
| | | POSITION_5 // å®ä½ç¹5 |
| | | }; |
| | | |
| | | class CAxisSettingsDlg : public CBaseDlg |
| | | { |
| | | DECLARE_DYNAMIC(CAxisSettingsDlg) |
| | | |
| | | public: |
| | | CAxisSettingsDlg(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CAxisSettingsDlg(); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_AXIS_SETTINGS }; |
| | | #endif |
| | | |
| | | private: |
| | | UINT FindIDByName(const CString& strControlID); |
| | | void AdjustLabelFont(CBLLabel& label); |
| | | void SetLabelColor(CBLLabel& label, COLORREF color); |
| | | void SetLabelColorBasedOnState(CBLLabel& label, BOOL bState, COLORREF colorTrue, COLORREF colorFalse); |
| | | void UpdateLabels(); |
| | | void UpdateRegexEdit(CRegexEdit* pRegexEdit, const ValueRange& range, const CString& title); |
| | | void UpdatePageButtonStates(); |
| | | void HideEditCursor(int nCtrlID); |
| | | int GetCurrentSelectedAxisID(); |
| | | void InitializeAxisIDCombo(); |
| | | void RefreshAxisDetails(int nAxisId); |
| | | void RefreshPositionDetails(int nAxisId, int pageNumber); |
| | | void UpdatePositionRange(PositionRange& position, int pageNumber, int pageSize, int currentIndex); |
| | | void UpdateAxisSelection(int offset); |
| | | void UpdateDataFromUI(int nAxisId); |
| | | void SwitchToPage(int targetPage); |
| | | bool ParsePLCAddress(const CString& address, MC::SOFT_COMPONENT& component, int& addr); |
| | | void WriteAxisDataToPLC(int nAxisId); |
| | | void HandleAxisOperation(AxisOperationType eOpType, bool bPressed); |
| | | void ReadPLCDataToUI(int nAxisId); |
| | | |
| | | private: |
| | | CPLC* m_pPLC; |
| | | |
| | | // å½åéä¸çå®ä½é¡µé¢ç´¢å¼ |
| | | int m_currentPage; |
| | | |
| | | // 轴管çå¨ |
| | | AxisManager* m_pAxisManager; |
| | | |
| | | // æ§ä»¶ |
| | | CBlButton* m_pBlBtns[BTN_MAX]; |
| | | CBLLabel* m_pBlLabels[LABEL_MAX]; |
| | | CRegexEdit* m_pRegexEdit[EDIT_MAX]; |
| | | CComboBox m_comboAxisNO; |
| | | CStatic m_staticAxisNO, m_staticAxisDescription, m_staticStartAddress; |
| | | |
| | | // 读å°çæ°æ® |
| | | BOOL m_bSEV; |
| | | double m_fCurPos; |
| | | double m_fManualSpeed; |
| | | double m_fAutoSpeed; |
| | | double m_fPrm; |
| | | int m_nLoad; |
| | | int m_nErrCode; |
| | | int m_nAlarmCode; |
| | | BOOL m_bFLS; |
| | | BOOL m_bDOG; |
| | | BOOL m_bRLS; |
| | | BOOL m_bReady; |
| | | BOOL m_bBusy; |
| | | BOOL m_bErr; |
| | | DWORD m_nBtnsFlashState6; |
| | | DWORD m_nBtnsFlashState8; |
| | | |
| | | protected: |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | virtual BOOL OnInitDialog(); |
| | | virtual BOOL PreTranslateMessage(MSG* pMsg); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnBnClickedButtonAxisLast(); |
| | | afx_msg void OnBnClickedButtonAxisNext(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPointGroup1(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPointGroup2(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPointGroup3(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPointGroup4(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPointGroup5(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPoint1(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPoint2(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPoint3(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPoint4(); |
| | | afx_msg void OnBnClickedButtonAxisAnchorPoint5(); |
| | | afx_msg void OnBnClickedButtonAxisTestOpr(); |
| | | afx_msg void OnBnClickedButtonAxisTestStop(); |
| | | afx_msg void OnBnClickedButtonAxisSev(); |
| | | afx_msg void OnSelchangeComboAxisName(); |
| | | afx_msg void OnBnClickedButtonAxisSave(); |
| | | afx_msg void OnBnClickedButtonAxisUpdateUi(); |
| | | afx_msg void OnBnClickedButtonAxisDetailSettings(); |
| | | afx_msg LRESULT OnUpdateDataToUI(WPARAM wParam, LPARAM lParam); |
| | | afx_msg void OnTimer(UINT_PTR nIDEvent); |
| | | afx_msg void OnClose(); |
| | | DECLARE_MESSAGE_MAP() |
| | | }; |
| | |
| | | } |
| | | } |
| | | else if (code == RX_CODE_ALARM_ON) { |
| | | AlarmOn(); |
| | | // CAlarmMonitor* pComponent = (CAlarmMonitor*)theApp.m_model.getBonder().GetComponent(ALARM_MONITOR); |
| | | // m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | CPLC* pPlc; |
| | | if (pAny->getPtrValue("ptr", (void*&)pPlc) && pPlc == theApp.m_model.getCurrentPlc()) { |
| | | AlarmOn(pPlc); |
| | | CAlarmMonitor* pComponent = (CAlarmMonitor*)pPlc->getComponent(ALARM_MONITOR); |
| | | m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | } |
| | | } |
| | | else if (code == RX_CODE_ALARM_OFF) { |
| | | AlarmOff(); |
| | | // CAlarmMonitor* pComponent = (CAlarmMonitor*)theApp.m_model.getBonder().GetComponent(ALARM_MONITOR); |
| | | // m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | CPLC* pPlc; |
| | | if (pAny->getPtrValue("ptr", (void*&)pPlc) && pPlc == theApp.m_model.getCurrentPlc()) { |
| | | AlarmOff(pPlc); |
| | | CAlarmMonitor* pComponent = (CAlarmMonitor*)pPlc->getComponent(ALARM_MONITOR); |
| | | m_pTopToolbar->GetBtn(IDC_BUTTON_ALARM)->EnableWindow(pComponent->isAlarming()); |
| | | } |
| | | } |
| | | pAny->release(); |
| | | }, [&]() -> void { |
| | |
| | | m_pMainContainer->Resize(); |
| | | } |
| | | |
| | | void CBoounionPLCDlg::AlarmOn() |
| | | void CBoounionPLCDlg::AlarmOn(CPLC* pPlc) |
| | | { |
| | | if (m_pAlarmWnd == nullptr) { |
| | | m_pAlarmWnd = new CAlarmPopupDlg(); |
| | | //m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)")); |
| | | m_pAlarmWnd->SetPLC(pPlc); |
| | | m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this); |
| | | m_pAlarmWnd->CenterWindow(); |
| | | } |
| | | m_pAlarmWnd->AlarmOn(); |
| | | } |
| | | |
| | | void CBoounionPLCDlg::AlarmOff() |
| | | void CBoounionPLCDlg::AlarmOff(CPLC* pPlc) |
| | | { |
| | | if (m_pAlarmWnd == nullptr) { |
| | | m_pAlarmWnd = new CAlarmPopupDlg(); |
| | | //m_pAlarmWnd->SetPLC(theApp.m_model.getBonder().getPLC("PLC(1)")); |
| | | m_pAlarmWnd->SetPLC(pPlc); |
| | | m_pAlarmWnd->Create(IDD_DIALOG_POPUP_ALARM, this); |
| | | m_pAlarmWnd->CenterWindow(); |
| | | } |
| | |
| | | void Resize(); |
| | | CBaseView* CreatePlcView(CPLC* pPlc); |
| | | void CloseView(CBaseView* pView); |
| | | void AlarmOn(); |
| | | void AlarmOff(); |
| | | void AlarmOn(CPLC* pPlc); |
| | | void AlarmOff(CPLC* pPlc); |
| | | |
| | | private: |
| | | COLORREF m_crBkgnd; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CBaseDlg.h" |
| | | #include "GridCtrl.h" |
| | | |
| | | // å
¨å±ä¸»é¢å¯¹è±¡ |
| | | Theme g_lightTheme = { RGB(255, 255, 255), RGB(0, 0, 0), RGB(240, 240, 240), RGB(200, 200, 200) }; |
| | | Theme g_darkTheme = { RGB(40, 40, 40), RGB(255, 255, 255), RGB(60, 60, 60), RGB(80, 80, 80) }; |
| | | |
| | | CFont g_defaultFont; |
| | | Theme* g_currentTheme = &g_lightTheme; |
| | | |
| | | // å
¨å±èµæºå¥æ |
| | | HINSTANCE g_hCurrentResource = NULL; |
| | | |
| | | IMPLEMENT_DYNAMIC(CBaseDlg, CDialogEx) |
| | | |
| | | CBaseDlg::CBaseDlg(UINT nID, CWnd* pPage) : CDialogEx(nID, pPage), m_bResizing(false) |
| | | { |
| | | m_nID = nID; |
| | | m_pParent = pPage; |
| | | m_nInitialWidth = 0; |
| | | m_nInitialHeight = 0; |
| | | |
| | | m_hBrush = CreateSolidBrush(g_currentTheme->backgroundColor); |
| | | } |
| | | |
| | | CBaseDlg::~CBaseDlg() |
| | | { |
| | | // shared_pträ¼èªå¨æ¸
çå
åï¼ä¸éè¦æå¨å é¤ |
| | | m_mapFonts.clear(); |
| | | m_mapCtrlLayouts.clear(); |
| | | m_mapControls.clear(); |
| | | |
| | | DeleteObject(m_hBrush); |
| | | } |
| | | |
| | | void CBaseDlg::SwitchTheme(ThemeType enThemeType) |
| | | { |
| | | // ä½¿ç¨ map æ¥æ ¹æ® themeType æ¥æ¾ä¸»é¢ |
| | | static const std::unordered_map<ThemeType, Theme*> themeMap = { |
| | | { ThemeType::Light, &g_lightTheme }, |
| | | { ThemeType::Dark, &g_darkTheme } |
| | | }; |
| | | |
| | | // 设置å½åä¸»é¢ |
| | | auto it = themeMap.find(enThemeType); |
| | | if (it != themeMap.end()) { |
| | | g_currentTheme = it->second; |
| | | } |
| | | else { |
| | | g_currentTheme = &g_lightTheme; |
| | | } |
| | | |
| | | DeleteObject(m_hBrush); |
| | | m_hBrush = CreateSolidBrush(g_currentTheme->backgroundColor); |
| | | |
| | | // æ´æ°æ§ä»¶çå¤è§ |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | pWnd->Invalidate(); |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | |
| | | // æ´æ°å¯¹è¯æ¡èæ¯é¢è² |
| | | SetBackgroundColor(g_currentTheme->backgroundColor); |
| | | } |
| | | |
| | | void CBaseDlg::LoadResourceLibrary(const CString& strLanguage) |
| | | { |
| | | // å¸è½½ä¹åå è½½çèµæºåº |
| | | UnloadResourceLibrary(); |
| | | |
| | | // å è½½æ°çèµæºåº |
| | | g_hCurrentResource = AfxLoadLibrary(strLanguage); |
| | | |
| | | // 设置æ°çèµæºå¥æ |
| | | if (g_hCurrentResource != NULL) { |
| | | AfxSetResourceHandle(g_hCurrentResource); |
| | | } |
| | | } |
| | | |
| | | void CBaseDlg::UnloadResourceLibrary() |
| | | { |
| | | // å¸è½½ä¹åå è½½çèµæºåº |
| | | if (g_hCurrentResource != NULL) { |
| | | FreeLibrary(g_hCurrentResource); // éæ¾å½åèµæºåº |
| | | g_hCurrentResource = NULL; // æ¸
ç©ºèµæºå¥æ |
| | | } |
| | | } |
| | | |
| | | CFont* CBaseDlg::GetOrCreateFont(int nFontSize) |
| | | { |
| | | auto it = m_mapFonts.find(nFontSize); |
| | | if (it != m_mapFonts.end()) { |
| | | return it->second.get(); |
| | | } |
| | | |
| | | // ä½¿ç¨ shared_ptr æ¥ç®¡çåä½å¯¹è±¡ |
| | | auto font = std::make_shared<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.get(); |
| | | } |
| | | |
| | | void CBaseDlg::SetDefaultFont() |
| | | { |
| | | CFont* defaultFont = GetOrCreateFont(12); |
| | | |
| | | CWnd* pWnd = GetWindow(GW_CHILD); |
| | | while (pWnd) { |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | pWnd = pWnd->GetNextWindow(); |
| | | continue; |
| | | } |
| | | |
| | | pWnd->SetFont(defaultFont, TRUE); |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | } |
| | | |
| | | BOOL CBaseDlg::AddControl(UINT nCtrlID, CWnd* pControl) |
| | | { |
| | | // ç¡®ä¿æ§ä»¶ä¸é夿·»å |
| | | if (m_mapControls.find(nCtrlID) != m_mapControls.end()) { |
| | | return FALSE; // æ§ä»¶å·²ç»åå¨ |
| | | } |
| | | |
| | | m_mapControls[nCtrlID] = std::unique_ptr<CWnd>(pControl); |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CBaseDlg::RemoveControl(UINT nCtrlID) |
| | | { |
| | | auto it = m_mapControls.find(nCtrlID); |
| | | if (it != m_mapControls.end()) { |
| | | m_mapControls.erase(it); |
| | | return TRUE; |
| | | } |
| | | return FALSE; |
| | | } |
| | | |
| | | BOOL CBaseDlg::UpdateControlText(UINT nCtrlID, const CString& strText) |
| | | { |
| | | auto it = m_mapControls.find(nCtrlID); |
| | | if (it != m_mapControls.end()) { |
| | | CWnd* pWnd = it->second.get(); |
| | | if (pWnd->GetSafeHwnd() != nullptr) |
| | | { |
| | | pWnd->SetWindowText(strText); |
| | | return TRUE; |
| | | } |
| | | } |
| | | return FALSE; |
| | | } |
| | | |
| | | CWnd* CBaseDlg::GetControl(UINT nCtrlID) |
| | | { |
| | | auto it = m_mapControls.find(nCtrlID); |
| | | if (it != m_mapControls.end()) { |
| | | return it->second.get(); |
| | | } |
| | | return nullptr; |
| | | } |
| | | |
| | | void CBaseDlg::AdjustControls(float dScaleX, float dScaleY) |
| | | { |
| | | if (m_bResizing) return; // 鲿¢å¨è°æ´è¿ç¨ä¸éå¤è°æ´ |
| | | |
| | | m_bResizing = true; |
| | | 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 表示ææé¡¹çé«åº¦ |
| | | } |
| | | |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd; |
| | | pGridCtrl->SetDefCellHeight(newRect.Height() / 21); |
| | | pGridCtrl->ExpandColumnsToFit(TRUE); |
| | | pGridCtrl->ExpandLastColumn(); |
| | | pGridCtrl->Invalidate(); |
| | | pGridCtrl->UpdateWindow(); |
| | | } |
| | | |
| | | pWnd->MoveWindow(&newRect); |
| | | AdjustControlFont(pWnd, newRect.Width(), newRect.Height()); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | m_bResizing = false; |
| | | } |
| | | |
| | | void CBaseDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight) |
| | | { |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | return; |
| | | } |
| | | |
| | | int fontSize = nHeight / 2; |
| | | if (fontSize < 8) fontSize = 8; |
| | | if (fontSize > 32) fontSize = 32; |
| | | |
| | | CFont* pFont = GetOrCreateFont(fontSize); |
| | | |
| | | pWnd->SetFont(pFont); |
| | | pWnd->Invalidate(); // å·æ°æ§ä»¶æ¾ç¤º |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CBaseDlg, CDialogEx) |
| | | ON_WM_SIZE() |
| | | ON_WM_GETMINMAXINFO() |
| | | ON_WM_CTLCOLOR() |
| | | END_MESSAGE_MAP() |
| | | |
| | | BOOL CBaseDlg::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // è·åå½åè¯è¨ |
| | | LANGID langId = GetUserDefaultLangID(); |
| | | if (langId == LANG_CHINESE) { |
| | | // å è½½ä¸æèµæº |
| | | } |
| | | else { |
| | | // å è½½è±æèµæº |
| | | } |
| | | |
| | | // è·åå¯¹è¯æ¡çå·¥ä½åºï¼å±å¹å¯ç¨åºåï¼ |
| | | CRect screenRect, dlgRect, clientRect; |
| | | SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0); |
| | | 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; |
| | | |
| | | // æé¤ä¸éè¦æä½çæ§ä»¶ï¼å¦èªå®ä¹æ§ä»¶ GridCtrlï¼ |
| | | TCHAR szClassName[256]; |
| | | GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName)); |
| | | if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) { |
| | | pWnd = pWnd->GetNextWindow(); |
| | | continue; |
| | | } |
| | | |
| | | // 设置æ§ä»¶çé»è®¤åä½ |
| | | pWnd->SetFont(pDefaultFont); |
| | | } |
| | | pWnd = pWnd->GetNextWindow(); |
| | | } |
| | | |
| | | // å°å¯¹è¯æ¡å±
ä¸ |
| | | GetWindowRect(&dlgRect); |
| | | int dlgWidth = dlgRect.Width() * 2; |
| | | int dlgHeight = dlgRect.Height() * 2; |
| | | |
| | | 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); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | void CBaseDlg::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CDialogEx::OnSize(nType, cx, cy); |
| | | |
| | | if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) { |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥å°ºå¯¸å忝å¦è¶³å¤å¤§ï¼é¿å
é¢ç¹è°æ´ |
| | | //static int lastWidth = 0, lastHeight = 0; |
| | | //if (abs(cx - lastWidth) < 10 && abs(cy - lastHeight) < 10) { |
| | | // return; |
| | | //} |
| | | |
| | | //lastWidth = cx; |
| | | //lastHeight = cy; |
| | | |
| | | // è®¡ç®æ¯ä¾å¹¶è°æ´å¸å± |
| | | float dScaleX = static_cast<float>(cx) / m_nInitialWidth; |
| | | float dScaleY = static_cast<float>(cy) / m_nInitialHeight; |
| | | |
| | | AdjustControls(dScaleX, dScaleY); |
| | | } |
| | | |
| | | void CBaseDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI) |
| | | { |
| | | lpMMI->ptMinTrackSize.x = 400; |
| | | lpMMI->ptMinTrackSize.y = 300; |
| | | |
| | | CDialogEx::OnGetMinMaxInfo(lpMMI); |
| | | } |
| | | |
| | | HBRUSH CBaseDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | if (g_currentTheme) { |
| | | pDC->SetBkColor(g_currentTheme->backgroundColor); |
| | | pDC->SetTextColor(g_currentTheme->textColor); |
| | | |
| | | // è¿åèæ¯ç»å· |
| | | return m_hBrush; |
| | | } |
| | | |
| | | return CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include <map> |
| | | #include <memory> |
| | | #include <unordered_map> |
| | | |
| | | enum class ThemeType { |
| | | Light, // æµ
è²ä¸»é¢ |
| | | Dark // æ·±è²ä¸»é¢ |
| | | }; |
| | | |
| | | struct Theme { |
| | | COLORREF backgroundColor; |
| | | COLORREF textColor; |
| | | COLORREF buttonColor; |
| | | COLORREF borderColor; |
| | | }; |
| | | |
| | | class CBaseDlg : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CBaseDlg) |
| | | |
| | | public: |
| | | CBaseDlg(UINT nID, CWnd* pPage); // æ åæé 彿° |
| | | virtual ~CBaseDlg(); // ææå½æ° |
| | | |
| | | // 主é¢ç®¡ç |
| | | void SwitchTheme(ThemeType enThemeType); // åæ¢ä¸»é¢ |
| | | |
| | | // èµæºç®¡ç |
| | | void LoadResourceLibrary(const CString& strLanguage); // å è½½èµæºåº |
| | | void UnloadResourceLibrary(); // å¸è½½èµæºåº |
| | | |
| | | // åä½ç®¡ç |
| | | CFont* GetOrCreateFont(int nFontSize); // è·åæå建åä½ |
| | | void SetDefaultFont(); // 设置é»è®¤åä½ |
| | | |
| | | // 卿æ§ä»¶ç®¡ç |
| | | BOOL AddControl(UINT nCtrlID, CWnd* pControl); // æ·»å æ§ä»¶ |
| | | BOOL RemoveControl(UINT nCtrlID); // ç§»é¤æ§ä»¶ |
| | | BOOL UpdateControlText(UINT nCtrlID, const CString& strText); // æ´æ°æ§ä»¶ææ¬ |
| | | CWnd* GetControl(UINT nCtrlID); // è·åæ§ä»¶ |
| | | |
| | | private: |
| | | void AdjustControls(float dScaleX, float dScaleY); // è°æ´æ§ä»¶å¤§å° |
| | | void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight); // è°æ´æ§ä»¶åä½ |
| | | |
| | | private: |
| | | UINT m_nID; // å¯¹è¯æ¡ID |
| | | CWnd* m_pParent; // ç¶çªå£ |
| | | HBRUSH m_hBrush; |
| | | bool m_bResizing; // æ§ä»¶æ¯å¦æ£å¨è°æ´å¤§å° |
| | | int m_nInitialWidth; // å¯¹è¯æ¡åå§å®½åº¦ |
| | | int m_nInitialHeight; // å¯¹è¯æ¡åå§é«åº¦ |
| | | std::unordered_map<int, CRect> m_mapCtrlLayouts; // æ§ä»¶å¸å± |
| | | std::map<UINT, std::unique_ptr<CWnd>> m_mapControls; // æ§ä»¶éå |
| | | std::unordered_map<int, std::shared_ptr<CFont>> m_mapFonts; // æ§ä»¶åä½ |
| | | |
| | | DECLARE_MESSAGE_MAP() |
| | | public: |
| | | virtual BOOL OnInitDialog(); |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); |
| | | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); |
| | | }; |
| | |
| | | m_bIncludeRegex = pCheckBox->GetCheck(); |
| | | theApp.m_model.m_configuration.setLogcatIncludeRegex(m_bIncludeRegex); |
| | | } |
| | | |
| | | |
| | | BOOL CPageLogcat::PreTranslateMessage(MSG* pMsg) |
| | | { |
| | | if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { |
| | | return TRUE; |
| | | } |
| | | |
| | | return CDialogEx::PreTranslateMessage(pMsg); |
| | | } |
| | |
| | | afx_msg void OnButtonIncludeMenuClicked(NMHDR* pNMHDR, LRESULT* pResult); |
| | | afx_msg void OnEnChangeEditInclude(); |
| | | afx_msg void OnBnClickedCheckRegex(); |
| | | virtual BOOL PreTranslateMessage(MSG* pMsg); |
| | | }; |
| | |
| | | #ifndef COMMON_H |
| | | #define COMMON_H |
| | | #pragma once |
| | | |
| | | |
| | | /* Rx Code */ |
| | | #define RX_CODE_TEST 0 |
| | |
| | | #define BTN_OPR_FRAME_NORMAL RGB(88, 88, 88) |
| | | #define BTN_OPR_FRAME_HOVER RGB(88, 88, 88) |
| | | #define BTN_OPR_FRAME_PRESS RGB(88, 88, 88) |
| | | #define BTN_OPR_BKGND_NORMAL RGB(222, 222, 222) |
| | | #define BTN_OPR_BKGND_HOVER RGB(208, 208, 222) |
| | | #define BTN_OPR_BKGND_PRESS RGB(0, 232, 0) |
| | | #define BTN_OPR_BKGND_NORMAL RGB(0, 168, 0) |
| | | #define BTN_OPR_BKGND_HOVER RGB(255, 160, 64) |
| | | #define BTN_OPR_BKGND_PRESS RGB(250, 155, 60) |
| | | #define BTN_OPR_BKGND_TEST RGB(0, 255, 0) |
| | | |
| | | /* å®ä½æé® */ |
| | | #define BTN_POINT_FRAME_NORMAL RGB(88, 88, 88) |
| | |
| | | |
| | | |
| | | /* çæ§æ°æ®id */ |
| | | #define MONITOR_ID_ALARM 1001 |
| | | |
| | | #endif // COMMON_H |
| | | #define MONITOR_ID_ALARM 1001 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include <sstream> |
| | | #include <fstream> |
| | | #include <iostream> |
| | | #include "AxisManager.h" |
| | | #include "ToolUnits.h" |
| | | |
| | | // æé 彿° |
| | | AxisManager::AxisManager() { |
| | | m_directory = CToolUnits::getCurrentExePath() + _T("\\PLCs"); |
| | | if (!CToolUnits::isDirectory(m_directory)) { |
| | | CToolUnits::createDir(m_directory.c_str()); |
| | | } |
| | | } |
| | | |
| | | // å è½½è½´ä¿¡æ¯ |
| | | bool AxisManager::LoadAxes(pugi::xml_node axesNode) { |
| | | m_axes.clear(); |
| | | for (auto axisNode : axesNode.children("Axis")) { |
| | | AxisInfo axisInfo; |
| | | axisInfo.id = axisNode.attribute("id").as_int(); |
| | | axisInfo.number = axisNode.attribute("number").value(); |
| | | axisInfo.description = axisNode.attribute("description").value(); |
| | | axisInfo.startAddress = axisNode.attribute("start_address").value(); |
| | | |
| | | // å è½½ ValueRange å¼ |
| | | axisInfo.jogDistance = ValueRange( |
| | | axisNode.child("jog_distance").attribute("min").as_double(), |
| | | axisNode.child("jog_distance").attribute("max").as_double(), |
| | | axisNode.child("jog_distance").attribute("current").as_double() |
| | | ); |
| | | axisInfo.manualSpeed = ValueRange( |
| | | axisNode.child("manual_speed").attribute("min").as_double(), |
| | | axisNode.child("manual_speed").attribute("max").as_double(), |
| | | axisNode.child("manual_speed").attribute("current").as_double() |
| | | ); |
| | | axisInfo.autoSpeed = ValueRange( |
| | | axisNode.child("auto_speed").attribute("min").as_double(), |
| | | axisNode.child("auto_speed").attribute("max").as_double(), |
| | | axisNode.child("auto_speed").attribute("current").as_double() |
| | | ); |
| | | axisInfo.accelerationTime = ValueRange( |
| | | axisNode.child("acceleration_time").attribute("min").as_double(), |
| | | axisNode.child("acceleration_time").attribute("max").as_double(), |
| | | axisNode.child("acceleration_time").attribute("current").as_double() |
| | | ); |
| | | axisInfo.decelerationTime = ValueRange( |
| | | axisNode.child("deceleration_time").attribute("min").as_double(), |
| | | axisNode.child("deceleration_time").attribute("max").as_double(), |
| | | axisNode.child("deceleration_time").attribute("current").as_double() |
| | | ); |
| | | |
| | | // å è½½ PositionRange å¼ |
| | | axisInfo.positioningPointCount = axisNode.child("Positions").attribute("positioningPointCount").as_int(); |
| | | for (auto positionNode : axisNode.child("Positions").children("Position")) { |
| | | bool isEnable = positionNode.attribute("isEnable").as_bool(); |
| | | std::string description = positionNode.attribute("description").value(); |
| | | ValueRange positionRange( |
| | | positionNode.attribute("min").as_double(), |
| | | positionNode.attribute("max").as_double(), |
| | | positionNode.attribute("current").as_double() |
| | | ); |
| | | |
| | | axisInfo.positions.emplace_back(PositionRange(isEnable, description, positionRange)); |
| | | } |
| | | |
| | | m_axes[axisInfo.id] = axisInfo; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | // ä¿åè½´ä¿¡æ¯ |
| | | void AxisManager::SaveAxes(pugi::xml_node& axesNode) { |
| | | for (const auto& axisEntry : m_axes) { |
| | | const AxisInfo& axisInfo = axisEntry.second; |
| | | |
| | | auto axisNode = axesNode.append_child("Axis"); |
| | | axisNode.append_attribute("id") = axisInfo.id; |
| | | axisNode.append_attribute("number") = axisInfo.number.c_str(); |
| | | axisNode.append_attribute("description") = axisInfo.description.c_str(); |
| | | axisNode.append_attribute("start_address") = axisInfo.startAddress.c_str(); |
| | | |
| | | // ä¿å ValueRange å¼ |
| | | auto jog_distance = axisNode.append_child("jog_distance"); |
| | | jog_distance.append_attribute("min") = axisInfo.jogDistance.minValue; |
| | | jog_distance.append_attribute("max") = axisInfo.jogDistance.maxValue; |
| | | jog_distance.append_attribute("current") = axisInfo.jogDistance.currentValue; |
| | | |
| | | auto manual_speed = axisNode.append_child("manual_speed"); |
| | | manual_speed.append_attribute("min") = axisInfo.manualSpeed.minValue; |
| | | manual_speed.append_attribute("max") = axisInfo.manualSpeed.maxValue; |
| | | manual_speed.append_attribute("current") = axisInfo.manualSpeed.currentValue; |
| | | |
| | | auto auto_speed = axisNode.append_child("auto_speed"); |
| | | auto_speed.append_attribute("min") = axisInfo.autoSpeed.minValue; |
| | | auto_speed.append_attribute("max") = axisInfo.autoSpeed.maxValue; |
| | | auto_speed.append_attribute("current") = axisInfo.autoSpeed.currentValue; |
| | | |
| | | auto acceleration_time = axisNode.append_child("acceleration_time"); |
| | | acceleration_time.append_attribute("min") = axisInfo.accelerationTime.minValue; |
| | | acceleration_time.append_attribute("max") = axisInfo.accelerationTime.maxValue; |
| | | acceleration_time.append_attribute("current") = axisInfo.accelerationTime.currentValue; |
| | | |
| | | auto deceleration_time = axisNode.append_child("deceleration_time"); |
| | | deceleration_time.append_attribute("min") = axisInfo.decelerationTime.minValue; |
| | | deceleration_time.append_attribute("max") = axisInfo.decelerationTime.maxValue; |
| | | deceleration_time.append_attribute("current") = axisInfo.decelerationTime.currentValue; |
| | | |
| | | // ä¿å PositionRange å¼ |
| | | auto positionsNode = axisNode.append_child("Positions"); |
| | | positionsNode.append_attribute("positioningPointCount") = axisInfo.positioningPointCount; |
| | | for (const auto& position : axisInfo.positions) { |
| | | auto positionNode = positionsNode.append_child("Position"); |
| | | positionNode.append_attribute("isEnable") = position.isEnable; |
| | | positionNode.append_attribute("description") = position.description.c_str(); |
| | | positionNode.append_attribute("min") = position.range.minValue; |
| | | positionNode.append_attribute("max") = position.range.maxValue; |
| | | positionNode.append_attribute("current") = position.range.currentValue; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å è½½é
æ¹ï¼å¦ææä»¶ä¸åå¨ï¼å è½½é»è®¤æ°æ®ï¼ |
| | | bool AxisManager::LoadAxis(const std::string& strName) { |
| | | std::string filePath = m_directory + "\\" + strName + "\\" + "AxesConfiguration.xml"; |
| | | pugi::xml_document doc; |
| | | |
| | | if (!doc.load_file(filePath.c_str())) { |
| | | std::cerr << "Recipe file not found: " << filePath << ". Loading default recipe." << std::endl; |
| | | return false; |
| | | } |
| | | |
| | | auto rootNode = doc.child("root"); |
| | | LoadAxes(rootNode); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | // ä¿åé
æ¹ |
| | | bool AxisManager::SaveAxis(const std::string& strName) { |
| | | // çææä»¶è·¯å¾ |
| | | std::string filePath = m_directory + "\\" + strName + "\\" + "AxesConfiguration.xml"; |
| | | |
| | | // å建 XML ææ¡£å¯¹è±¡ |
| | | pugi::xml_document doc; |
| | | |
| | | // å¦æè½´æ°æ®ä¸ºç©ºï¼çæé»è®¤é
æ¹ |
| | | if (m_axes.empty()) { |
| | | GenerateDefaultData(); |
| | | } |
| | | |
| | | // æ·»å è½´ä¿¡æ¯ |
| | | auto rootNode = doc.append_child("root"); |
| | | SaveAxes(rootNode); |
| | | |
| | | // ä¿å XML æä»¶ |
| | | return doc.save_file(filePath.c_str()); |
| | | } |
| | | |
| | | // çæé»è®¤é
æ¹ |
| | | void AxisManager::GenerateDefaultData() { |
| | | m_axes.clear(); |
| | | for (int axisId = 1; axisId <= 12; ++axisId) { |
| | | AxisInfo axisInfo; |
| | | axisInfo.id = axisId; |
| | | axisInfo.positioningPointCount = 25; |
| | | axisInfo.number = "M100-M" + std::to_string(axisId); |
| | | axisInfo.description = "Default_Axis" + std::to_string(axisId); |
| | | axisInfo.startAddress = "ZR" + std::to_string(10000 + (axisId - 1) * 300); |
| | | |
| | | // 设置é»è®¤ç ValueRange |
| | | axisInfo.jogDistance = ValueRange(1.0, 10.0, 1.0); |
| | | axisInfo.manualSpeed = ValueRange(1.0, 100.0, 10.0); |
| | | axisInfo.autoSpeed = ValueRange(5.0, 200.0, 50.0); |
| | | axisInfo.accelerationTime = ValueRange(1.0, 10.0, 1.0); |
| | | axisInfo.decelerationTime = ValueRange(1.0, 10.0, 1.0); |
| | | |
| | | // æ·»å å®ä½ç¹å¹¶è®¾ç½®é»è®¤çæå°å¼åæå¤§å¼ |
| | | for (int posId = 0; posId < axisInfo.positioningPointCount; ++posId) { |
| | | double minPos = (posId + 1) * 5.0; |
| | | double maxPos = (posId + 1) * 20.0; |
| | | axisInfo.positions.emplace_back(PositionRange(TRUE, "Position " + std::to_string(posId + 1), ValueRange(minPos, maxPos, (posId + 1) * 10.0))); |
| | | } |
| | | |
| | | m_axes[axisId] = axisInfo; |
| | | } |
| | | } |
| | | |
| | | // è·åææè½´ä¿¡æ¯ |
| | | const std::map<int, AxisInfo>& AxisManager::GetAxes() const { |
| | | return m_axes; |
| | | } |
| | | |
| | | // è·ååä¸ªè½´ä¿¡æ¯ |
| | | AxisInfo AxisManager::GetAxis(int axisId) const { |
| | | auto it = m_axes.find(axisId); |
| | | if (it != m_axes.end()) { |
| | | return it->second; // 妿æ¾å°äºè½´ï¼è¿åå
¶è¯¦ç»ä¿¡æ¯ |
| | | } |
| | | |
| | | // å¦ææ²¡ææ¾å°è¯¥è½´ï¼è¿åä¸ä¸ªé»è®¤çæ æ AxisInfo |
| | | return AxisInfo{ -1, 0, /*0.0, 0.0,*/ "", "", "", ValueRange(), ValueRange(), ValueRange(), ValueRange(), ValueRange(), {} }; |
| | | } |
| | | |
| | | // æ´æ°è½´ä¿¡æ¯ |
| | | bool AxisManager::UpdateAxis(const AxisInfo& axisInfo) { |
| | | if (m_axes.find(axisInfo.id) == m_axes.end()) { |
| | | return false; // è½´ä¸åå¨ |
| | | } |
| | | m_axes[axisInfo.id] = axisInfo; |
| | | return true; |
| | | } |
| | | |
| | | // æ·»å æ°çè½´ä¿¡æ¯ |
| | | bool AxisManager::AddAxis(const AxisInfo& axisInfo) { |
| | | if (m_axes.find(axisInfo.id) != m_axes.end()) { |
| | | return false; // è½´å·²åå¨ |
| | | } |
| | | m_axes[axisInfo.id] = axisInfo; |
| | | return true; |
| | | } |
| | | |
| | | // å é¤è½´ä¿¡æ¯ |
| | | bool AxisManager::DeleteAxis(int axisId) { |
| | | return m_axes.erase(axisId) > 0; |
| | | } |
| | | |
| | | // è·åææè½´ç¼å· |
| | | std::vector<int> AxisManager::GetAllAxisID() const { |
| | | std::vector<int> axisNumbers; |
| | | for (const auto& axis : m_axes) { |
| | | int axisId = axis.first; |
| | | axisNumbers.push_back(axisId); |
| | | } |
| | | |
| | | return axisNumbers; |
| | | } |
| | | |
| | | // è·åæå®é¡µçå®ä½ç¹ |
| | | std::vector<PositionRange> AxisManager::GetPositions(int axisId, int pageNumber, int pageSize) const { |
| | | std::vector<PositionRange> result; |
| | | |
| | | // æ£æ¥è½´æ¯å¦åå¨ |
| | | auto it = m_axes.find(axisId); |
| | | if (it == m_axes.end()) { |
| | | return result; // å¦æè½´ ID ä¸åå¨ï¼è¿åç©ºç»æ |
| | | } |
| | | |
| | | // è·åæå®è½´çææå®ä½ç¹ |
| | | const auto& positions = it->second.positions; |
| | | |
| | | // ç¡®å®å页èå´ |
| | | int startIndex = (pageNumber - 1) * pageSize; |
| | | int endIndex = startIndex + pageSize; |
| | | |
| | | // éåå®ä½ç¹ï¼æå页æåæ°æ® |
| | | int index = 0; |
| | | for (const auto& pos : positions) { |
| | | const PositionRange& position = pos; // å®ä½ç¹å
å«æè¿°ãä½ç½®ãæå°å¼ãæå¤§å¼åå½åå¼ |
| | | |
| | | if (index >= startIndex && index < endIndex) { |
| | | result.push_back(position); // æ·»å 宿´ç PositionRange 对象 |
| | | } |
| | | |
| | | ++index; |
| | | if (index >= endIndex) { |
| | | break; // è¾¾å°åé¡µç»æç¹ |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | // è·åæå®è½´çå®ä½ç¹ |
| | | PositionRange AxisManager::GetPositionByIndex(int axisId, int pageNumber, int pageSize, int currentIndex) const { |
| | | // æ£æ¥è½´æ¯å¦åå¨ |
| | | auto it = m_axes.find(axisId); |
| | | if (it == m_axes.end()) { |
| | | return PositionRange(); // è½´ä¸åå¨ï¼è¿åé»è®¤æé ç PositionRangeï¼æ æçå®ä½ç¹ï¼ |
| | | } |
| | | |
| | | // è·åæå®è½´çææå®ä½ç¹ |
| | | const auto& positions = it->second.positions; |
| | | |
| | | // ç¡®å®å页èå´ |
| | | int startIndex = (pageNumber - 1) * pageSize; |
| | | int endIndex = startIndex + pageSize; |
| | | |
| | | // 妿 currentIndex è¶
è¿äºå½å页çèå´ï¼è¿åæ æç PositionRange |
| | | if (currentIndex < 0 || currentIndex >= pageSize || currentIndex + startIndex >= positions.size()) { |
| | | return PositionRange(); // è¿åæ æçå®ä½ç¹ |
| | | } |
| | | |
| | | // è¿åæå®å®ä½ç¹ï¼èèåé¡µï¼ |
| | | return positions[startIndex + currentIndex]; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #ifndef RECIPE_MANAGER_H |
| | | #define RECIPE_MANAGER_H |
| | | |
| | | #include <string> |
| | | #include <vector> |
| | | #include <map> |
| | | #include "pugixml.hpp" |
| | | |
| | | struct ValueRange { |
| | | double minValue; // æå°å¼ |
| | | double maxValue; // æå¤§å¼ |
| | | double currentValue; // å½åå¼ |
| | | |
| | | // æé 彿°åå§å |
| | | ValueRange(double minVal = 0.0, double maxVal = 0.0, double curVal = 0.0) |
| | | : minValue(minVal), maxValue(maxVal), currentValue(curVal) {} |
| | | }; |
| | | |
| | | struct PositionRange { |
| | | BOOL isEnable; // æ¯å¦å¯ç¨ |
| | | std::string description; // å®ä½ç¹æè¿° |
| | | ValueRange range; // ä½ç½®çæå°å¼ãæå¤§å¼åå½åå¼ |
| | | |
| | | // æé 彿°åå§å |
| | | PositionRange(BOOL b = TRUE, const std::string& desc = "", const ValueRange& r = ValueRange()) |
| | | :isEnable(b), description(desc), range(r) {} |
| | | }; |
| | | |
| | | // è½´ä¿¡æ¯ç»æä½ |
| | | struct AxisInfo { |
| | | int id; // è½´ID |
| | | int positioningPointCount; // å®ä½ç¹æ° |
| | | std::string number; // è½´ç¼å· |
| | | std::string description; // è½´æè¿° |
| | | std::string startAddress; // èµ·å§å°å |
| | | ValueRange jogDistance; // å¾®å¨éï¼æå°å¼ãæå¤§å¼ãå½åå¼ï¼ |
| | | ValueRange manualSpeed; // æå¨éåº¦ï¼æå°å¼ãæå¤§å¼ãå½åå¼ï¼ |
| | | ValueRange autoSpeed; // èªå¨éåº¦ï¼æå°å¼ãæå¤§å¼ãå½åå¼ï¼ |
| | | ValueRange accelerationTime; // å éæ¶é´ï¼æå°å¼ãæå¤§å¼ãå½åå¼ï¼ |
| | | ValueRange decelerationTime; // åéæ¶é´ï¼æå°å¼ãæå¤§å¼ãå½åå¼ï¼ |
| | | std::vector<PositionRange> positions; // å®ä½ç¹ï¼æè¿°ãä½ç½®åæå°æå¤§å¼ |
| | | }; |
| | | |
| | | // é
æ¹ç®¡çç±» |
| | | class AxisManager { |
| | | public: |
| | | AxisManager(); |
| | | |
| | | // å è½½é
æ¹ï¼æä»¶ä¸å卿¶å è½½é»è®¤æ°æ®ï¼ |
| | | bool LoadAxis(const std::string& strName); |
| | | |
| | | // ä¿åé
æ¹ |
| | | bool SaveAxis(const std::string& strName); |
| | | |
| | | // çæé»è®¤é
æ¹ |
| | | void GenerateDefaultData(); |
| | | |
| | | // è·åææè½´ä¿¡æ¯ |
| | | const std::map<int, AxisInfo>& GetAxes() const; |
| | | |
| | | // è·ååä¸ªè½´ä¿¡æ¯ |
| | | AxisInfo GetAxis(int axisId) const; |
| | | |
| | | // æ´æ°è½´ä¿¡æ¯ |
| | | bool UpdateAxis(const AxisInfo& axisInfo); |
| | | |
| | | // æ·»å æ°çè½´ä¿¡æ¯ |
| | | bool AddAxis(const AxisInfo& axisInfo); |
| | | |
| | | // å é¤è½´ä¿¡æ¯ |
| | | bool DeleteAxis(int axisId); |
| | | |
| | | // è·åææè½´ID |
| | | std::vector<int> GetAllAxisID() const; |
| | | |
| | | // è·åæå®é¡µçå®ä½ç¹ |
| | | std::vector<PositionRange> GetPositions(int axisId, int pageNumber, int pageSize) const; |
| | | |
| | | // è·åæå®é¡µçå®ä½ç¹ |
| | | PositionRange GetPositionByIndex(int axisId, int pageNumber, int pageSize, int currentIndex) const; |
| | | |
| | | private: |
| | | // è½´å è½½åä¿å彿° |
| | | bool LoadAxes(pugi::xml_node axesNode); |
| | | void SaveAxes(pugi::xml_node& axesNode); |
| | | |
| | | private: |
| | | std::string m_directory; // æä»¶å¤¹è·¯å¾ |
| | | std::map<int, AxisInfo> m_axes; // è½´ä¿¡æ¯ç¼å |
| | | }; |
| | | |
| | | #endif // RECIPE_MANAGER_H |
| | |
| | | #include "ToolUnits.h" |
| | | |
| | | // 常é |
| | | #define ADDR_NIGHT_SHIFT_CAPACTITY 2027 |
| | | |
| | | |
| | | CModel* g_pModel = NULL; |
| | | void CALLBACK ModerTimerProc(HWND hWnd, UINT nMsg, UINT nTimerid, DWORD dwTime) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 读å产è½ä¿¡æ¯ |
| | | CPLC* pPlc = getCurrentPlc(); |
| | | if (pPlc != nullptr) { |
| | | pPlc->readPLCDataRegularly(); |
| | | } |
| | | } |
| | | |
| | | std::map<std::string, CPLC*>& CModel::getPlcMap() |
| | |
| | | { |
| | | auto iter = m_mapPlc.find(pszName); |
| | | if (iter != m_mapPlc.end()) return -1; |
| | | CString strPlcDir; |
| | | strPlcDir.Format(_T("%s\\Plcs\\%s"), (LPTSTR)(LPCTSTR)m_strWorkDir, pszName); |
| | | CPLC* pPLC = new CPLC(pszName, pszIp, port); |
| | | pPLC->setWorkDir((LPTSTR)(LPCTSTR)strPlcDir); |
| | | PLCListener listener; |
| | | listener.onStateChanged = [&](void* pFrom, int state) -> void { |
| | | LOGD("PLCç¶ææ¹åï¼%d", state); |
| | | }; |
| | | listener.onMonitorData = [&](void* pFrom, int id) -> void { |
| | | LOGD("PLConMonitorDataï¼%d", id); |
| | | }; |
| | | listener.onAlarm = [&](void* pFrom, CAlarm* pAlarm, int flag) -> void { |
| | | LOGE("onAlarmï¼%d %s", pAlarm->getId(), flag != 0 ? "ON" : "Off"); |
| | | if (flag == 1) { |
| | | pAlarm->addRef(); |
| | | notifyObjAndPtr(RX_CODE_ALARM_ON, pAlarm, pFrom); |
| | | pAlarm->release(); |
| | | } |
| | | else { |
| | | pAlarm->addRef(); |
| | | notifyObjAndPtr(RX_CODE_ALARM_OFF, pAlarm, pFrom); |
| | | pAlarm->release(); |
| | | } |
| | | |
| | | }; |
| | | pPLC->setListener(listener); |
| | | pPLC->init(); |
| | | m_mapPlc[pszName] = pPLC; |
| | | |
| | |
| | | } |
| | | |
| | | return nullptr; |
| | | } |
| | | |
| | | void CModel::readPLCDataRegularly() |
| | | { |
| | | CPLC* pPlc = getCurrentPlc(); |
| | | if (pPlc == nullptr || !pPlc->isConnected()) return; |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == 2 && flag == 0) { |
| | | int nVelocityRatio = CToolUnits::toInt16(&pData[0]); |
| | | if (nVelocityRatio != m_nVelocityRatio) { |
| | | m_nVelocityRatio = nVelocityRatio; |
| | | notifyInt(RX_CODE_VELOCITY_RATIO, m_nVelocityRatio); |
| | | } |
| | | } |
| | | }; |
| | | pPlc->readData(MC::D, 530, 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == 2 && flag == 0) { |
| | | double dTactTime = (double)CToolUnits::toInt16(&pData[0]); |
| | | if (dTactTime != m_dTactTime) { |
| | | m_dTactTime = dTactTime; |
| | | notifyDouble(RX_CODE_TACT_TIME, m_dTactTime); |
| | | } |
| | | } |
| | | }; |
| | | pPlc->readData(MC::ZR, 1500, 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == (ADDR_NIGHT_SHIFT_CAPACTITY - 2012 + 1) * 2 && flag == 0) { |
| | | int nDayShiftCapacity = CToolUnits::toInt16(&pData[0]); |
| | | int nNightShiftCapacity = CToolUnits::toInt16(&pData[(ADDR_NIGHT_SHIFT_CAPACTITY - 2012) * 2]); |
| | | if (nDayShiftCapacity != m_nDayShiftCapacity) { |
| | | m_nDayShiftCapacity = nDayShiftCapacity; |
| | | notifyInt(RX_CODE_DAY_SHIFT_CAPACTITY, nDayShiftCapacity); |
| | | } |
| | | if (nNightShiftCapacity != m_nNightShiftCapacity) { |
| | | m_nNightShiftCapacity = nNightShiftCapacity; |
| | | notifyInt(RX_CODE_NIGHT_SHIFT_CAPACTITY, nNightShiftCapacity); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | pPlc->readData(MC::ZR, 2012, (ADDR_NIGHT_SHIFT_CAPACTITY - 2012 + 1) * 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | int nStartAddress = 1000; |
| | | int nEndAddress = 1200; |
| | | int nReadSize = (nEndAddress - nStartAddress + 1) * 2; |
| | | auto funOnReadData = [this, nStartAddress, nReadSize](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == nReadSize && flag == 0) { |
| | | bool bRun = CToolUnits::toInt16(&pData[(1103 - nStartAddress) * 2]) != 0; // å¯å¨ |
| | | bool bAuto = CToolUnits::toInt16(&pData[(1100 - nStartAddress) * 2]) != 0; // èªå¨ |
| | | bool bPuase = CToolUnits::toInt16(&pData[(1104 - nStartAddress) * 2]) != 0; // æå |
| | | bool bManual = CToolUnits::toInt16(&pData[(1100 - nStartAddress) * 2]) != 0; // æå¨ |
| | | bool bBeep = CToolUnits::toInt16(&pData[(1003 - nStartAddress) * 2]) != 0; // éé³ |
| | | bool bResetting = CToolUnits::toInt16(&pData[(1150 - nStartAddress) * 2]) != 0; // å¤ä½ |
| | | bool bStop = CToolUnits::toInt16(&pData[(1114 - nStartAddress) * 2]) != 0; // ֹͣ |
| | | |
| | | if (m_bBlBtnsStates[0] != bRun) { |
| | | m_bBlBtnsStates[0] = bRun; |
| | | notifyInt(RX_CODE_ACTIVATE, bRun); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[1] != bAuto) { |
| | | m_bBlBtnsStates[1] = bAuto; |
| | | notifyInt(RX_CODE_AUTO, bAuto); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[2] != bPuase) { |
| | | m_bBlBtnsStates[2] = bPuase; |
| | | notifyInt(RX_CODE_PUASE, bPuase); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[3] != bManual) { |
| | | m_bBlBtnsStates[3] = bManual; |
| | | notifyInt(RX_CODE_MANUAL, bManual); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[4] != bBeep) { |
| | | m_bBlBtnsStates[4] = bBeep; |
| | | notifyInt(RX_CODE_BEEP, bBeep); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[5] != bResetting) { |
| | | m_bBlBtnsStates[5] = bResetting; |
| | | notifyInt(RX_CODE_RESETTING, bResetting); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[6] != bStop) { |
| | | m_bBlBtnsStates[6] = bStop; |
| | | notifyInt(RX_CODE_STOP, bStop); |
| | | } |
| | | } |
| | | }; |
| | | pPlc->readData(MC::M, nStartAddress, nReadSize, funOnReadData); |
| | | } |
| | | } |
| | |
| | | int notifyTextAndInt(int code, const char* pszText, int exCode); |
| | | int notifyMesMsg(int code, int stream, int function, const char* pszText); |
| | | |
| | | private: |
| | | void readPLCDataRegularly(); |
| | | |
| | | public: |
| | | CConfiguration m_configuration; |
| | | |
| | | private: |
| | | int m_nVelocityRatio; // éåº¦æ¯ |
| | | double m_dTactTime; // 卿æ¶é´ |
| | | int m_nDayShiftCapacity; // ç½çäº§è½ |
| | | int m_nNightShiftCapacity; // å¤çäº§è½ |
| | | bool m_bBlBtnsStates[7]; // PLC Viewæé®ç¶æ |
| | | |
| | | private: |
| | | IObservable* m_pObservable; |
| | |
| | | #include "stdafx.h" |
| | | #include "PLC.h" |
| | | #include "Log.h" |
| | | #include "ToolUnits.h" |
| | | |
| | | |
| | | #define ADDR_NIGHT_SHIFT_CAPACTITY 1627 |
| | | |
| | | void CALLBACK TimerFileProc(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) |
| | | { |
| | |
| | | m_nTimerId = 0; |
| | | m_hTimeEvent = nullptr; |
| | | m_bMute = false; |
| | | m_pPlcData = new char[4096]; |
| | | m_nVelocityRatio = 0; |
| | | InitializeCriticalSection(&m_criticalSection); |
| | | } |
| | | |
| | | CPLC::CPLC(const char* pszName, const char* pszIp, const unsigned int port) |
| | |
| | | m_state = PLCSTATE::READY; |
| | | m_listener.onStateChanged = nullptr; |
| | | m_listener.onMonitorData = nullptr; |
| | | m_listener.onAlarm = nullptr; |
| | | m_nUnHeartBeat = 0; |
| | | m_hTimeEvent = nullptr; |
| | | m_hMcMonitorStop = nullptr; |
| | |
| | | m_mcMonitorThrdaddr = 0; |
| | | m_nTimerId = 0; |
| | | m_hTimeEvent = nullptr; |
| | | m_pPlcData = new char[4096]; |
| | | m_nVelocityRatio = 0; |
| | | m_dTactTime = 0.0; |
| | | m_nDayShiftCapacity = 0; |
| | | m_nNightShiftCapacity = 0; |
| | | for (int i = 0; i < 7; i++) { |
| | | m_bBlBtnsStates[i] = false; |
| | | } |
| | | |
| | | InitializeCriticalSection(&m_criticalSection); |
| | | } |
| | | |
| | | CPLC::~CPLC() |
| | | { |
| | | if (m_pPlcData != nullptr) { |
| | | delete[] m_pPlcData; |
| | | m_pPlcData = nullptr; |
| | | } |
| | | DeleteCriticalSection(&m_criticalSection); |
| | | } |
| | | |
| | | void CPLC::setListener(PLCListener& listener) |
| | | { |
| | | m_listener.onStateChanged = listener.onStateChanged; |
| | | m_listener.onMonitorData = listener.onMonitorData; |
| | | m_listener.onAlarm = listener.onAlarm; |
| | | } |
| | | |
| | | void CPLC::setWorkDir(const char* pszDir) |
| | |
| | | |
| | | CAlarmMonitor* CPLC::getAlarmMonitor() |
| | | { |
| | | return (CAlarmMonitor*)getComponent("PLC(1)"); |
| | | return (CAlarmMonitor*)getComponent("è¦åä¿¡æ¯"); |
| | | } |
| | | |
| | | int CPLC::addMonitor(int id, int beginAddr, int endAddr, MC::SOFT_COMPONENT softComponent, char* pszRecvBuffer) |
| | | { |
| | | // æ£æ¥æ¯å¦æéå¤ç |
| | | Lock(); |
| | | for (auto& m : m_monitors) { |
| | | if (m.id == id) { |
| | | Unlock(); |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | MONITOR m; |
| | | memset(&m, 0, sizeof(MONITOR)); |
| | | m.id = id; |
| | | m.beginAddr = beginAddr; |
| | | m.readLen = (endAddr - beginAddr + 1) * 2; |
| | | m.softComponent = softComponent; |
| | | m.szRecvBuffer = pszRecvBuffer; |
| | | m.hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | | m_monitors.push_back(m); |
| | | |
| | | Unlock(); |
| | | return 0; |
| | | } |
| | | |
| | | void CPLC::init() |
| | |
| | | m_pChannel->setChannelListener(&m_mcChannellistener); |
| | | m_pChannel->setActionInterval(m_nActionInterval); |
| | | } |
| | | addMonitor(MONITOR_ID_ALARM, 10001, 10064, MC::SOFT_COMPONENT::M, &m_pPlcData[600]); |
| | | |
| | | |
| | | // è¦åçæ§ |
| | | CString strAlarmFile; |
| | | strAlarmFile.Format(_T("%s\\%s\\AlarmList.txt"), m_strWorkDir.c_str(), m_strName.c_str()); |
| | | strAlarmFile.Format(_T("%s\\AlarmList.txt"), m_strWorkDir.c_str()); |
| | | CAlarmMonitor* pAlarmMonitor = new CAlarmMonitor(); |
| | | pAlarmMonitor->setName("è¦åä¿¡æ¯"); |
| | | pAlarmMonitor->setDescription("è¦åä¿¡æ¯çæ§"); |
| | |
| | | WaitForSingleObject(monitor.hEvent, INFINITE); |
| | | ResetEvent(monitor.hEvent); |
| | | if (bReadOk) { |
| | | ASSERT(m_listener.onMonitorData); |
| | | onMonitorData(monitor); |
| | | } |
| | | } |
| | | |
| | | int CPLC::onMonitorData(MONITOR& monitor) |
| | | { |
| | | // 转åå°è¦å模åå¤çè§£éæ°æ® |
| | | if (monitor.id == MONITOR_ID_ALARM) { |
| | | for (auto c : m_components) { |
| | | c->onData(monitor.id, monitor.szRecvBuffer, monitor.readLen); |
| | | } |
| | | } |
| | | |
| | | if (m_listener.onMonitorData) { |
| | | m_listener.onMonitorData(this, monitor.id); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CPLC::readWord(MC::SOFT_COMPONENT softComponent, unsigned int addr, |
| | |
| | | } |
| | | } |
| | | |
| | | void CPLC::readPLCDataRegularly() |
| | | { |
| | | if (!isConnected()) return; |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == 2 && flag == 0) { |
| | | int nVelocityRatio = CToolUnits::toInt16(&pData[0]); |
| | | if (nVelocityRatio != m_nVelocityRatio) { |
| | | m_nVelocityRatio = nVelocityRatio; |
| | | //notifyInt(RX_CODE_VELOCITY_RATIO, m_nVelocityRatio); |
| | | } |
| | | } |
| | | }; |
| | | readData(MC::D, 530, 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == 2 && flag == 0) { |
| | | double dTactTime = (double)CToolUnits::toInt16(&pData[0]); |
| | | if (dTactTime != m_dTactTime) { |
| | | m_dTactTime = dTactTime; |
| | | // notifyDouble(RX_CODE_TACT_TIME, m_dTactTime); |
| | | } |
| | | } |
| | | }; |
| | | readData(MC::ZR, 1500, 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | auto funOnReadData = [this](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == (ADDR_NIGHT_SHIFT_CAPACTITY - 1612 + 1) * 2 && flag == 0) { |
| | | int nDayShiftCapacity = CToolUnits::toInt16(&pData[0]); |
| | | int nNightShiftCapacity = CToolUnits::toInt16(&pData[(ADDR_NIGHT_SHIFT_CAPACTITY - 1612) * 2]); |
| | | if (nDayShiftCapacity != m_nDayShiftCapacity) { |
| | | m_nDayShiftCapacity = nDayShiftCapacity; |
| | | // notifyInt(RX_CODE_DAY_SHIFT_CAPACTITY, nDayShiftCapacity); |
| | | } |
| | | if (nNightShiftCapacity != m_nNightShiftCapacity) { |
| | | m_nNightShiftCapacity = nNightShiftCapacity; |
| | | // notifyInt(RX_CODE_NIGHT_SHIFT_CAPACTITY, nNightShiftCapacity); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | readData(MC::ZR, 1612, (ADDR_NIGHT_SHIFT_CAPACTITY - 1612 + 1) * 2, funOnReadData); |
| | | } |
| | | |
| | | { |
| | | int nStartAddress = 1000; |
| | | int nEndAddress = 1200; |
| | | int nReadSize = (nEndAddress - nStartAddress + 1) * 2; |
| | | auto funOnReadData = [this, nStartAddress, nReadSize](IMcChannel* pChannel, int addr, char* pData, unsigned int nDataSize, int flag) -> void { |
| | | if (nDataSize == nReadSize && flag == 0) { |
| | | bool bRun = CToolUnits::toInt16(&pData[(1103 - nStartAddress) * 2]) != 0; // å¯å¨ |
| | | bool bAuto = CToolUnits::toInt16(&pData[(1100 - nStartAddress) * 2]) != 0; // èªå¨ |
| | | bool bPuase = CToolUnits::toInt16(&pData[(1104 - nStartAddress) * 2]) != 0; // æå |
| | | bool bManual = CToolUnits::toInt16(&pData[(1100 - nStartAddress) * 2]) != 0; // æå¨ |
| | | bool bBeep = CToolUnits::toInt16(&pData[(1003 - nStartAddress) * 2]) != 0; // éé³ |
| | | bool bResetting = CToolUnits::toInt16(&pData[(1150 - nStartAddress) * 2]) != 0; // å¤ä½ |
| | | bool bStop = CToolUnits::toInt16(&pData[(1114 - nStartAddress) * 2]) != 0; // ֹͣ |
| | | |
| | | if (m_bBlBtnsStates[0] != bRun) { |
| | | m_bBlBtnsStates[0] = bRun; |
| | | // notifyInt(RX_CODE_ACTIVATE, bRun); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[1] != bAuto) { |
| | | m_bBlBtnsStates[1] = bAuto; |
| | | // notifyInt(RX_CODE_AUTO, bAuto); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[2] != bPuase) { |
| | | m_bBlBtnsStates[2] = bPuase; |
| | | // notifyInt(RX_CODE_PUASE, bPuase); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[3] != bManual) { |
| | | m_bBlBtnsStates[3] = bManual; |
| | | // notifyInt(RX_CODE_MANUAL, bManual); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[4] != bBeep) { |
| | | m_bBlBtnsStates[4] = bBeep; |
| | | // notifyInt(RX_CODE_BEEP, bBeep); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[5] != bResetting) { |
| | | m_bBlBtnsStates[5] = bResetting; |
| | | // notifyInt(RX_CODE_RESETTING, bResetting); |
| | | } |
| | | |
| | | if (m_bBlBtnsStates[6] != bStop) { |
| | | m_bBlBtnsStates[6] = bStop; |
| | | // notifyInt(RX_CODE_STOP, bStop); |
| | | } |
| | | } |
| | | }; |
| | | readData(MC::M, nStartAddress, nReadSize, funOnReadData); |
| | | } |
| | | } |
| | | |
| | | int CPLC::getVelocityRatio() |
| | | { |
| | | return m_nVelocityRatio; |
| | | } |
| | | |
| | | double CPLC::getTackTime() |
| | | { |
| | | return m_dTactTime; |
| | | } |
| | | |
| | | int CPLC::getDayShiftCapacity() |
| | | { |
| | | return m_nDayShiftCapacity; |
| | | } |
| | | |
| | | int CPLC::getNightShiftCapacity() |
| | | { |
| | | return m_nNightShiftCapacity; |
| | | } |
| | |
| | | #pragma comment(lib,"winmm") |
| | | |
| | | |
| | | #define ALARM_MONITOR _T("è¦åä¿¡æ¯") |
| | | |
| | | typedef std::function<void(void* pFrom, int)> ONPLCSTATECHANGED; |
| | | typedef std::function<void(void* pFrom, int)> ONPLCMONITORDATA; |
| | | typedef std::function<void(void* pFrom, CAlarm*, int)> ONALARM; |
| | |
| | | ~CPLC(); |
| | | |
| | | public: |
| | | void setListener(PLCListener& listener); |
| | | void setWorkDir(const char* pszDir); |
| | | void init(); |
| | | void term(); |
| | |
| | | int writeDWord(MC::SOFT_COMPONENT softComponent, unsigned int addr, int value, ONWRITE funOnWrite); |
| | | int writeBit(MC::SOFT_COMPONENT softComponent, unsigned int addr, BOOL bValue, ONWRITE funOnWrite); |
| | | int writeData(MC::SOFT_COMPONENT softComponent, unsigned int addr, const char* pszData, unsigned int length, ONWRITE funOnWrite); |
| | | void readPLCDataRegularly(); |
| | | |
| | | public: |
| | | int getVelocityRatio(); |
| | | double getTackTime(); |
| | | int getDayShiftCapacity(); |
| | | int getNightShiftCapacity(); |
| | | |
| | | public: |
| | | HANDLE m_hTimeEvent; |
| | | |
| | | private: |
| | | inline void Lock() { EnterCriticalSection(&m_criticalSection); } |
| | | inline void Unlock() { LeaveCriticalSection(&m_criticalSection); } |
| | | void setState(PLCSTATE state); |
| | | void monitorReadData(MONITOR& monitor); |
| | | CString& dataToHexString(const char* pData, const int size, CString& strOut); |
| | | int onMonitorData(MONITOR& monitor); |
| | | |
| | | private: |
| | | std::string m_strWorkDir; |
| | |
| | | unsigned int m_nActionInterval; |
| | | unsigned int m_nUnHeartBeat; |
| | | std::vector<CComponent*> m_components; |
| | | char* m_pPlcData; |
| | | |
| | | private: |
| | | CRITICAL_SECTION m_criticalSection; |
| | | std::vector<MONITOR> m_monitors; |
| | | HANDLE m_hMcMonitorStop; |
| | | HANDLE m_hMcMonitorThreadHandle; |
| | | unsigned m_mcMonitorThrdaddr; |
| | | MMRESULT m_nTimerId; |
| | | bool m_bMute; |
| | | |
| | | private: |
| | | int m_nVelocityRatio; // éåº¦æ¯ |
| | | double m_dTactTime; // 卿æ¶é´ |
| | | int m_nDayShiftCapacity; // ç½çäº§è½ |
| | | int m_nNightShiftCapacity; // å¤çäº§è½ |
| | | bool m_bBlBtnsStates[7]; // PLC Viewæé®ç¶æ |
| | | }; |
| | | |
| | |
| | | ON_BN_CLICKED(IDC_BUTTON_SOUND_OFF, &CPlcView::OnBnClickedButtonSoundOff) |
| | | ON_BN_CLICKED(IDC_BUTTON_RESETTING, &CPlcView::OnBnClickedButtonResetting) |
| | | ON_BN_CLICKED(IDC_BUTTON_STOP, &CPlcView::OnBnClickedButtonStop) |
| | | ON_WM_TIMER() |
| | | END_MESSAGE_MAP() |
| | | |
| | | // CComponentData1Dlg æ¶æ¯å¤çç¨åº |
| | |
| | | SetDlgItemText(IDC_EDIT_DAY_SHIFT_CAPACITY, _T("0")); |
| | | SetDlgItemText(IDC_EDIT_NIGHT_SHIFT_CAPACITY, _T("0")); |
| | | |
| | | |
| | | SetTimer(1, 1000, nullptr); |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE |
| | | } |
| | |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | HandleOperation(OperationType::STOP); |
| | | } |
| | | } |
| | | |
| | | void CPlcView::OnTimer(UINT_PTR nIDEvent) |
| | | { |
| | | if (1 == nIDEvent) { |
| | | ASSERT(m_pContext); |
| | | CPLC* pPlc = ((CPLC*)m_pContext); |
| | | |
| | | CString strText; |
| | | strText.Format(_T("%d %s"), pPlc->getVelocityRatio(), _T("%")); |
| | | GetDlgItem(IDC_EDIT_VELOCITY_RATIO)->SetWindowText(strText); |
| | | strText.Format(_T("%.2f"), pPlc->getTackTime() * 0.01); |
| | | GetDlgItem(IDC_EDIT_TACT_TIME)->SetWindowText(strText); |
| | | SetDlgItemInt(IDC_EDIT_DAY_SHIFT_CAPACITY, pPlc->getDayShiftCapacity()); |
| | | SetDlgItemInt(IDC_EDIT_NIGHT_SHIFT_CAPACITY, pPlc->getNightShiftCapacity()); |
| | | } |
| | | |
| | | CBaseView::OnTimer(nIDEvent); |
| | | } |
| | |
| | | afx_msg void OnBnClickedButtonSoundOff(); |
| | | afx_msg void OnBnClickedButtonResetting(); |
| | | afx_msg void OnBnClickedButtonStop(); |
| | | afx_msg void OnTimer(UINT_PTR nIDEvent); |
| | | }; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "RegexEdit.h" |
| | | #include <stdexcept> |
| | | |
| | | IMPLEMENT_DYNAMIC(CRegexEdit, CEdit) |
| | | |
| | | CRegexEdit::CRegexEdit() |
| | | { |
| | | m_enRegexType = RegexType::Alphanumeric; |
| | | m_dMinValue = LDBL_MIN; |
| | | m_dMaxValue = LDBL_MAX; |
| | | } |
| | | |
| | | CRegexEdit::~CRegexEdit() |
| | | { |
| | | } |
| | | |
| | | void CRegexEdit::SetRegexType(RegexType enType) |
| | | { |
| | | m_enRegexType = enType; |
| | | } |
| | | |
| | | void CRegexEdit::SetCustomRegex(const std::string& strCustomRegex) |
| | | { |
| | | m_strCustomRegex = strCustomRegex; |
| | | } |
| | | |
| | | void CRegexEdit::SetValueRange(long double dMinValue, long double dMaxValue) |
| | | { |
| | | m_dMinValue = dMinValue; |
| | | m_dMaxValue = dMaxValue; |
| | | } |
| | | |
| | | void CRegexEdit::SetCustomComparator(std::function<bool(const std::string&)> comparator) |
| | | { |
| | | m_customComparator = comparator; |
| | | } |
| | | |
| | | void CRegexEdit::SetInvalidInputCallback(std::function<void()> callback) |
| | | { |
| | | m_invalidInputCallback = callback; |
| | | } |
| | | |
| | | bool CRegexEdit::FindMatch(const std::string& pattern, std::string& foundText) |
| | | { |
| | | CString currentText; |
| | | GetWindowText(currentText); |
| | | |
| | | std::string text(CT2A(currentText.GetString())); |
| | | std::regex regexPattern(pattern); |
| | | std::smatch match; |
| | | |
| | | if (std::regex_search(text, match, regexPattern)) { |
| | | foundText = match.str(); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | void CRegexEdit::ReplaceMatch(const std::string& pattern, const std::string& replacement) |
| | | { |
| | | CString currentText; |
| | | GetWindowText(currentText); |
| | | |
| | | std::string text(CT2A(currentText.GetString())); |
| | | std::regex regexPattern(pattern); |
| | | std::string result = std::regex_replace(text, regexPattern, replacement); |
| | | |
| | | SetWindowText(CString(result.c_str())); |
| | | } |
| | | |
| | | std::regex CRegexEdit::GetCurrentRegex() const |
| | | { |
| | | switch (m_enRegexType) |
| | | { |
| | | case RegexType::Alphanumeric: |
| | | return std::regex("^[a-zA-Z0-9]*$"); // 忝忰å |
| | | case RegexType::Letters: |
| | | return std::regex("^[a-zA-Z]*$"); // åªå
è®¸åæ¯ |
| | | case RegexType::Digits: |
| | | return std::regex("^\\d*$"); // åªå
许æ°å |
| | | case RegexType::Decimal: |
| | | return std::regex("^[-+]?\\d+(\\.\\d+)?$"); // å
è®¸å°æ°åæ´æ° |
| | | case RegexType::Custom: |
| | | return std::regex(m_strCustomRegex); // èªå®ä¹æ£å |
| | | default: |
| | | return std::regex(".*"); // é»è®¤å
许è¾å
¥ä»»ä½å
容 |
| | | } |
| | | } |
| | | |
| | | bool CRegexEdit::IsValueInRange(const std::string& strText) |
| | | { |
| | | try { |
| | | if (m_enRegexType == RegexType::Digits || m_enRegexType == RegexType::Decimal) { |
| | | if (strText.find('.') == std::string::npos) { |
| | | int nValue = std::stoi(strText); |
| | | return nValue >= static_cast<int>(m_dMinValue) && nValue <= static_cast<int>(m_dMaxValue); |
| | | } |
| | | else { |
| | | double dValue = std::stod(strText); |
| | | return dValue >= m_dMinValue && dValue <= m_dMaxValue; |
| | | } |
| | | } |
| | | } |
| | | catch (const std::invalid_argument&) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CRegexEdit, CEdit) |
| | | ON_WM_CHAR() |
| | | END_MESSAGE_MAP() |
| | | |
| | | void CRegexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) |
| | | { |
| | | CEdit::OnChar(nChar, nRepCnt, nFlags); |
| | | return; |
| | | |
| | | // å¤çå é¤é®åéæ ¼é® |
| | | if (nChar == VK_BACK || nChar == VK_DELETE) { |
| | | CEdit::OnChar(nChar, nRepCnt, nFlags); |
| | | return; |
| | | } |
| | | |
| | | CString strCurrent; |
| | | GetWindowText(strCurrent); |
| | | |
| | | // è·åå
æ å½åä½ç½® |
| | | int nStartChar, nEndChar; |
| | | GetSel(nStartChar, nEndChar); // è·åå½åéåºçèµ·å§åç»æä½ç½® |
| | | |
| | | std::string strText(CT2A(strCurrent.GetBuffer())); |
| | | strText.insert(strText.begin() + nStartChar, (char)nChar); |
| | | |
| | | bool bValid = m_customComparator ? m_customComparator(strText) : IsValueInRange(strText); |
| | | if (std::regex_match(strText, GetCurrentRegex()) && bValid) { |
| | | CEdit::OnChar(nChar, nRepCnt, nFlags); |
| | | } |
| | | else { |
| | | if (m_invalidInputCallback) { |
| | | m_invalidInputCallback(); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #if !defined(AFX_REGEXEDIT_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_) |
| | | #define AFX_REGEXEDIT_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_ |
| | | |
| | | #if _MSC_VER >= 1000 |
| | | #pragma once |
| | | #endif // _MSC_VER >= 1000 |
| | | |
| | | #include <afxwin.h> |
| | | #include <regex> |
| | | #include <functional> |
| | | #include <limits> |
| | | |
| | | // æä¸¾ç±»åï¼æ£å表达å¼ç±»å |
| | | enum class RegexType |
| | | { |
| | | Alphanumeric, // å
è®¸åæ¯åæ°å |
| | | Letters, // åªå
è®¸åæ¯ |
| | | Digits, // åªå
许æ°å |
| | | Decimal, // å
è®¸å°æ°åæ´æ° |
| | | Custom // èªå®ä¹æ£å |
| | | }; |
| | | |
| | | class CRegexEdit : public CEdit |
| | | { |
| | | DECLARE_DYNAMIC(CRegexEdit) |
| | | |
| | | public: |
| | | // æé 䏿æ |
| | | CRegexEdit(); |
| | | virtual ~CRegexEdit(); |
| | | |
| | | // 设置æ£åç±»å |
| | | void SetRegexType(RegexType enType); |
| | | |
| | | // 设置èªå®ä¹æ£åè¡¨è¾¾å¼ |
| | | void SetCustomRegex(const std::string& strCustomRegex); |
| | | |
| | | // 设置æ°å¼èå´ï¼æ´æ°ææµ®ç¹ï¼ |
| | | void SetValueRange(long double dMinValue, long double dMaxValue); |
| | | |
| | | // 设置èªå®ä¹æ¯è¾å½æ° |
| | | void SetCustomComparator(std::function<bool(const std::string&)> comparator); |
| | | |
| | | // 设置è¾å
¥ä¸åæ³å½æ° |
| | | void SetInvalidInputCallback(std::function<void()> callback); |
| | | |
| | | // æ¥æ¾å¹é
å
容 |
| | | bool FindMatch(const std::string& pattern, std::string& foundText); |
| | | |
| | | // æ¿æ¢å¹é
å
容 |
| | | void ReplaceMatch(const std::string& pattern, const std::string& replacement); |
| | | |
| | | protected: |
| | | // æ ¹æ®æä¸¾å¼è¿å对åºçæ£åè¡¨è¾¾å¼ |
| | | std::regex GetCurrentRegex() const; |
| | | |
| | | // æ ¡éªè¾å
¥æ¯å¦å¨æå®èå´å
|
| | | bool IsValueInRange(const std::string& strText); |
| | | |
| | | protected: |
| | | RegexType m_enRegexType; // å½åéä¸çæ£åç±»å |
| | | std::string m_strCustomRegex; // èªå®ä¹æ£åè¡¨è¾¾å¼ |
| | | long double m_dMinValue; // æå°å¼ |
| | | long double m_dMaxValue; // æå¤§å¼ |
| | | |
| | | std::function<bool(const std::string&)> m_customComparator; // èªå®ä¹æ¯è¾å½æ° |
| | | std::function<void()> m_invalidInputCallback; // ä¸åæ³è¾å
¥çåè°å½æ° |
| | | |
| | | protected: |
| | | void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); |
| | | DECLARE_MESSAGE_MAP() |
| | | }; |
| | | |
| | | #endif // !defined(AFX_REGEXEDIT_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // SecsTestDlg.cpp : å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "Servo.h" |
| | | #include "SecsTestDlg.h" |
| | | #include "afxdialogex.h" |
| | | |
| | | |
| | | // CSecsTestDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CSecsTestDlg, CDialogEx) |
| | | |
| | | CSecsTestDlg::CSecsTestDlg(CWnd* pParent /*=NULL*/) |
| | | : CDialogEx(IDD_DIALOG_SECS_TEST, pParent) |
| | | { |
| | | |
| | | } |
| | | |
| | | CSecsTestDlg::~CSecsTestDlg() |
| | | { |
| | | } |
| | | |
| | | void CSecsTestDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::DoDataExchange(pDX); |
| | | } |
| | | |
| | | |
| | | BEGIN_MESSAGE_MAP(CSecsTestDlg, CDialogEx) |
| | | ON_BN_CLICKED(IDC_BUTTON_S1F13, &CSecsTestDlg::OnBnClickedButtonS1f13) |
| | | ON_BN_CLICKED(IDC_BUTTON_S1F1, &CSecsTestDlg::OnBnClickedButtonS1f1) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | // CSecsTestDlg æ¶æ¯å¤çç¨åº |
| | | |
| | | void CSecsTestDlg::OnBnClickedButtonS1f1() |
| | | { |
| | | theApp.m_model.m_hsmsPassive.requestAreYouThere(); |
| | | } |
| | | |
| | | void CSecsTestDlg::OnBnClickedButtonS1f13() |
| | | { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | |
| | | |
| | | // CSecsTestDlg å¯¹è¯æ¡ |
| | | |
| | | class CSecsTestDlg : public CDialogEx |
| | | { |
| | | DECLARE_DYNAMIC(CSecsTestDlg) |
| | | |
| | | public: |
| | | CSecsTestDlg(CWnd* pParent = NULL); // æ åæé 彿° |
| | | virtual ~CSecsTestDlg(); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | | enum { IDD = IDD_DIALOG_SECS_TEST }; |
| | | #endif |
| | | |
| | | protected: |
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV æ¯æ |
| | | |
| | | DECLARE_MESSAGE_MAP() |
| | | public: |
| | | afx_msg void OnBnClickedButtonS1f13(); |
| | | afx_msg void OnBnClickedButtonS1f1(); |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 1,1,Aåå
_æ¥å_01 |
| | | 2,1,Aåå
_æ¥å_02 |
| | | 3,1,Aåå
_æ¥å_03 |
| | | 4,1,Aåå
_MEO |
| | | |
| | | 10,1,Båå
_æ¥å_01 |
| | | 11,1,Båå
_æ¥å_02 |
| | | 12,1,Båå
_æ¥å_03 |
| | | 13,1,Båå
_MEO |
| | | |
| | | 201,2,Aåå
-ä¸è
ä½ååZè½´1å¼å¸¸ |
| | | 202,2,Aåå
-ä¸è
ä½ååZè½´2å¼å¸¸ |
| | | 203,2,Aåå
-ä¸è
ä½ååZè½´3å¼å¸¸ |
| | | 204,2,Aåå
-ä¸è
ä½ååZè½´4å¼å¸¸ |
| | | 205,2,Aåå
-ä¸è
ä½ååZè½´5å¼å¸¸ |
| | | 206,2,Aåå
-ä¸è
ä½Zè½´1å¼å¸¸ |
| | | 207,2,Aåå
-ä¸è
ä½Zè½´2å¼å¸¸ |
| | | 208,2,Aåå
-å离è¶è¾Zè½´1å¼å¸¸ |
| | | 209,2,Aåå
-å离è¶è¾Zè½´2å¼å¸¸ |
| | | 210,2,Aåå
-左侧å离è¶è¾Xè½´1å¼å¸¸ |
| | | 211,2,Aåå
-左侧å离è¶è¾Xè½´2å¼å¸¸ |
| | | 212,2,Aåå
-å离è¶è¾è°èZè½´å¼å¸¸ |
| | | 213,2,Aåå
-ä¸è
ä½Zè½´å¼å¸¸ |
| | | 214,2,Aåå
-æ¶èæè½¬è½´å¼å¸¸ |
| | | 215,2,Aåå
-æ¾èæè½¬è½´å¼å¸¸ |
| | | |
| | | 217,2,Båå
-ä¸è
ä½ååZè½´1å¼å¸¸ |
| | | 218,2,Båå
-ä¸è
ä½ååZè½´2å¼å¸¸ |
| | | 219,2,Båå
-ä¸è
ä½ååZè½´3å¼å¸¸ |
| | | 220,2,Båå
-ä¸è
ä½ååZè½´4å¼å¸¸ |
| | | 221,2,Båå
-ä¸è
ä½ååZè½´5å¼å¸¸ |
| | | 222,2,Båå
-ä¸è
ä½Zè½´1å¼å¸¸ |
| | | 223,2,Båå
-ä¸è
ä½Zè½´2å¼å¸¸ |
| | | 224,2,Båå
-å离è¶è¾Zè½´1å¼å¸¸ |
| | | 225,2,Båå
-å离è¶è¾Zè½´2å¼å¸¸ |
| | | 226,2,Båå
-左侧å离è¶è¾Xè½´1å¼å¸¸ |
| | | 227,2,Båå
-左侧å离è¶è¾Xè½´2å¼å¸¸ |
| | | 228,2,Båå
-å离è¶è¾è°èZè½´å¼å¸¸ |
| | | 229,2,Båå
-ä¸è
ä½Zè½´å¼å¸¸ |
| | | 230,2,Båå
-æ¶èæè½¬è½´å¼å¸¸ |
| | | 231,2,Båå
-æ¾èæè½¬è½´å¼å¸¸ |
| | | |
| | | 260,2,QD77MS16(U60)å¼å¸¸ |
| | | 261,2,QD77MS16(U62)å¼å¸¸ |
| | | |
| | | 501,3,Aåå
-åç¦»èæ¶èåç´§æ°ç¼¸å¼å¸¸ |
| | | 502,3,Aåå
-åç¦»èæ¾èåç´§æ°ç¼¸å¼å¸¸ |
| | | 503,3,Aåå
-ç²èä¸åæ°ç¼¸å¼å¸¸ |
| | | 504,3,Aåå
-ç²èä¸éæ°ç¼¸å¼å¸¸ |
| | | 505,3,Aåå
-é«ç²ä¸åç´§æ°ç¼¸å¼å¸¸ |
| | | 506,3,Aåå
-é«ç²ä¸åç´§æ°ç¼¸å¼å¸¸ |
| | | 507,3,Aåå
-干泵æ°éå¼å¸¸ |
| | | 508,3,Aåå
-è
ä½å¹²æ³µä¸ååæ³µç»åæ°éå¼å¸¸ |
| | | 509,3,Aåå
-è
ä½ååæ³µæ°éå¼å¸¸ |
| | | 510,3,Aåå
-è
使»ç ´ç空æ°éå¼å¸¸ |
| | | |
| | | 520,3,Båå
-åç¦»èæ¶èåç´§æ°ç¼¸å¼å¸¸ |
| | | 521,3,Båå
-åç¦»èæ¾èåç´§æ°ç¼¸å¼å¸¸ |
| | | 522,3,Båå
-ç²èä¸åæ°ç¼¸å¼å¸¸ |
| | | 523,3,Båå
-ç²èä¸éæ°ç¼¸å¼å¸¸ |
| | | 524,3,Båå
-é«ç²ä¸åç´§æ°ç¼¸å¼å¸¸ |
| | | 525,3,Båå
-é«ç²ä¸åç´§æ°ç¼¸å¼å¸¸ |
| | | 526,3,Båå
-干泵æ°éå¼å¸¸ |
| | | 527,3,Båå
-è
ä½å¹²æ³µä¸ååæ³µç»åæ°éå¼å¸¸ |
| | | 528,3,Båå
-è
ä½ååæ³µæ°éå¼å¸¸ |
| | | 529,3,Båå
-è
使»ç ´ç空æ°éå¼å¸¸ |
| | | |
| | | 541,3,Aåå
-ä¸è
ä½ç ´ç空å¼å¸¸ |
| | | 542,3,Aåå
-ä¸è
ä½ç ´ç空å¼å¸¸ |
| | | 543,3,Aåå
-è
ä½å¹²æ³µç ´ç空å¼å¸¸ |
| | | 544,3,Aåå
-è
ä½åç¦»æ³µç ´ç空å¼å¸¸ |
| | | |
| | | 556,3,Båå
-ä¸è
ä½ç ´ç空å¼å¸¸ |
| | | 557,3,Båå
-ä¸è
ä½ç ´ç空å¼å¸¸ |
| | | 558,3,Båå
-è
ä½å¹²æ³µç ´ç空å¼å¸¸ |
| | | 559,3,Båå
-è
ä½åç¦»æ³µç ´ç空å¼å¸¸ |
| | | |
| | | 571,3,Aåå
-ä¸è
ä½å¸ç空å¼å¸¸ |
| | | 572,3,Aåå
-ä¸è
ä½å¸ç空å¼å¸¸ |
| | | 573,3,Aåå
-è
ä½å¹²æ³µå¸ç空å¼å¸¸ |
| | | 574,3,Aåå
-è
ä½å离泵å¸ç空å¼å¸¸ |
| | | |
| | | 586,3,Båå
-ä¸è
ä½å¸ç空å¼å¸¸ |
| | | 587,3,Båå
-ä¸è
ä½å¸ç空å¼å¸¸ |
| | | 588,3,Båå
-è
ä½å¹²æ³µå¸ç空å¼å¸¸ |
| | | 589,3,Båå
-è
ä½å离泵å¸ç空å¼å¸¸ |
| | | |
| | | 601,3,Aåå
-ä¸è
ä½å¨ç±å¼å¸¸ |
| | | |
| | | 610,3,Båå
-ä¸è
ä½å¨ç±å¼å¸¸ |
| | | |
| | | 621,3,Aåå
-离å¿èææ |
| | | 622,3,Aåå
-离å¿è转å¨å¼å¸¸ |
| | | |
| | | 626,3,Båå
-离å¿èææ |
| | | 627,3,Båå
-离å¿è转å¨å¼å¸¸ |
| | | |
| | | 631,3,Aåå
-ä¸è
ä½ååZè½´1ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 632,3,Aåå
-ä¸è
ä½ååZè½´2ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 633,3,Aåå
-ä¸è
ä½ååZè½´3ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 634,3,Aåå
-ä¸è
ä½ååZè½´4ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 635,3,Aåå
-ä¸è
ä½ååZè½´5ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 636,3,Aåå
-ä¸è
ä½Zè½´1ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 637,3,Aåå
-ä¸è
ä½Zè½´2ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | |
| | | 641,3,Båå
-ä¸è
ä½ååZè½´1ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 642,3,Båå
-ä¸è
ä½ååZè½´2ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 643,3,Båå
-ä¸è
ä½ååZè½´3ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 644,3,Båå
-ä¸è
ä½ååZè½´4ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 645,3,Båå
-ä¸è
ä½ååZè½´5ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 646,3,Båå
-ä¸è
ä½Zè½´1ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | 647,3,Båå
-ä¸è
ä½Zè½´2ç»å¯¹ä½ç½®ä¸¢å¤± |
| | | |
| | | 651,3,Aåå
-å®å
¨é¨å¼å¸¸ |
| | | |
| | | 653,3,Båå
-å®å
¨é¨å¼å¸¸ |
| | | |
| | | 656,3,Aåå
-è®¾å¤æ£åå¼å¸¸ |
| | | 657,3,Aåå
-离å飿£åå¼å¸¸ |
| | | |
| | | 661,3,Båå
-è®¾å¤æ£åå¼å¸¸ |
| | | 662,3,Båå
-离å飿£åå¼å¸¸ |
| | | |
| | | 666,3,Aåå
-ä¸è
ä½ååZè½´åæ¥å¼å¸¸ |
| | | 667,3,Aåå
-ä¸è
ä½Zè½´åæ¥å¼å¸¸ |
| | | 668,3,Aåå
-å离è¶è¾Zè½´åæ¥å¼å¸¸ |
| | | 669,3,Aåå
-å离è¶è¾Xè½´åæ¥å¼å¸¸ |
| | | |
| | | 671,3,Båå
-ä¸è
ä½ååZè½´åæ¥å¼å¸¸ |
| | | 672,3,Båå
-ä¸è
ä½Zè½´åæ¥å¼å¸¸ |
| | | 673,3,Båå
-å离è¶è¾Zè½´åæ¥å¼å¸¸ |
| | | 674,3,Båå
-å离è¶è¾Xè½´åæ¥å¼å¸¸ |
| | | |
| | | 676,3,Aåå
-干泵å¤äºéè¿ç¨æ¨¡å¼ |
| | | 677,3,Aåå
-干泵DVPæªè¿è¡ |
| | | 678,3,Aåå
-干泵MBPæªè¿è¡ |
| | | 679,3,Aåå
-干泵å¼å¸¸ |
| | | 680,3,Aåå
-å¹²æ³µé¢æ¿æ¥å触å |
| | | |
| | | 683,3,Båå
-干泵å¤äºéè¿ç¨æ¨¡å¼ |
| | | 684,3,Båå
-干泵DVPæªè¿è¡ |
| | | 685,3,Båå
-干泵MBPæªè¿è¡ |
| | | 686,3,Båå
-干泵å¼å¸¸ |
| | | 687,3,Båå
-å¹²æ³µé¢æ¿æ¥å触å |
| | | |
| | | 690,3,Aåå
-ä¸è
ä½ååZè½´1è¿è½½æ¥è¦ |
| | | 691,3,Aåå
-ä¸è
ä½ååZè½´2è¿è½½æ¥è¦ |
| | | 692,3,Aåå
-ä¸è
ä½ååZè½´3è¿è½½æ¥è¦ |
| | | 693,3,Aåå
-ä¸è
ä½ååZè½´4è¿è½½æ¥è¦ |
| | | 694,3,Aåå
-ä¸è
ä½ååZè½´5è¿è½½æ¥è¦ |
| | | 695,3,Aåå
-ä¸è
ä½Zè½´1è¿è½½æ¥è¦ |
| | | 696,3,Aåå
-ä¸è
ä½Zè½´2è¿è½½æ¥è¦ |
| | | 697,3,Aåå
-å离è¶è¾Zè½´1è¿è½½æ¥è¦ |
| | | 698,3,Aåå
-å离è¶è¾Zè½´2è¿è½½æ¥è¦ |
| | | 699,3,Aåå
-å离è¶è¾Xè½´1è¿è½½æ¥è¦ |
| | | 700,3,Aåå
-å离è¶è¾Xè½´2è¿è½½æ¥è¦ |
| | | |
| | | 701,3,Båå
-ä¸è
ä½ååZè½´1è¿è½½æ¥è¦ |
| | | 702,3,Båå
-ä¸è
ä½ååZè½´2è¿è½½æ¥è¦ |
| | | 703,3,Båå
-ä¸è
ä½ååZè½´3è¿è½½æ¥è¦ |
| | | 704,3,Båå
-ä¸è
ä½ååZè½´4è¿è½½æ¥è¦ |
| | | 705,3,Båå
-ä¸è
ä½ååZè½´5è¿è½½æ¥è¦ |
| | | 706,3,Båå
-ä¸è
ä½Zè½´1è¿è½½æ¥è¦ |
| | | 707,3,Båå
-ä¸è
ä½Zè½´2è¿è½½æ¥è¦ |
| | | 708,3,Båå
-å离è¶è¾Zè½´1è¿è½½æ¥è¦ |
| | | 709,3,Båå
-å离è¶è¾Zè½´2è¿è½½æ¥è¦ |
| | | 710,3,Båå
-å离è¶è¾Xè½´1è¿è½½æ¥è¦ |
| | | 711,3,Båå
-å离è¶è¾Xè½´2è¿è½½æ¥è¦ |
| | | |
| | | 712,3,Aåå
-ä¸è
ä½ååZè½´5è½´é´è¯¯å·®è¿å¤§ |
| | | 713,3,Aåå
-ä¸è
ä½Zè½´2è½´é´è¯¯å·®è¿å¤§ |
| | | 714,3,Aåå
-ä¸è
ä½Zè½´ä¸ä¸è
ååZ轴误差è¿å¤§ |
| | | |
| | | 717,3,Båå
-ä¸è
ä½ååZè½´5è½´é´è¯¯å·®è¿å¤§ |
| | | 718,3,Båå
-ä¸è
ä½Zè½´2è½´é´è¯¯å·®è¿å¤§ |
| | | 719,3,Båå
-ä¸è
ä½Zè½´ä¸ä¸è
ååZ轴误差è¿å¤§ |
| | | |
| | | 722,3,Aåå
-ååæ³µå¤äºéè¿ç¨æ¨¡å¼ |
| | | 723,3,Aåå
-ååæ³µå¼å¸¸ |
| | | 724,3,Båå
-ååæ³µå¤äºéè¿ç¨æ¨¡å¼ |
| | | 725,3,Båå
-ååæ³µå¼å¸¸ |
| | | 726,3,Aåå
-干泵æ½ç空å¼å¸¸ |
| | | 727,3,Båå
-干泵æ½ç空å¼å¸¸ |
| | | |
| | | 729,3,Aåå
-ä¸è
ä½å ç主æ§ä»ªè¡¨å¼å¸¸ |
| | | 730,3,Aåå
-ä¸è
ä½å çè
使¸©åº¦å¼å¸¸ |
| | | |
| | | 732,3,Aåå
-ä¸è
ä½å ç主æ§ä»ªè¡¨å¼å¸¸ |
| | | 733,3,Aåå
-ä¸è
ä½å çè
使¸©åº¦å¼å¸¸ |
| | | |
| | | 739,3,Båå
-ä¸è
ä½å ç主æ§ä»ªè¡¨å¼å¸¸ |
| | | 740,3,Båå
-ä¸è
ä½å çè
使¸©åº¦å¼å¸¸ |
| | | |
| | | 742,3,Båå
-ä¸è
ä½å ç主æ§ä»ªè¡¨å¼å¸¸ |
| | | 743,3,Båå
-ä¸è
ä½å çè
使¸©åº¦å¼å¸¸ |
| | | |
| | | 801,3,䏿¸¸è¿æ¥ä¸æ |
| | | 802,3,䏿¸¸è¿æ¥ä¸æ |
| | | |
| | | 806,3,䏿¸¸äº¤æ¡è¶
æ¶ |
| | | 807,3,䏿¸¸äº¤æ¡è¶
æ¶ |
| | | |
| | | 811,3,Aåå
-离åé£å¼å¸¸ |
| | | |
| | | 814,3,Båå
-离åé£å¼å¸¸ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0"?> |
| | | <root> |
| | | <Axis id="1" number="M100-M1" description="Default_Axis1" start_address="ZR10000"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="2" number="M100-M2" description="Default_Axis2" start_address="ZR10300"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="3" number="M100-M3" description="Default_Axis3" start_address="ZR10600"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="4" number="M100-M4" description="Default_Axis4" start_address="ZR10900"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="5" number="M100-M5" description="Default_Axis5" start_address="ZR11200"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="6" number="M100-M6" description="Default_Axis6" start_address="ZR11500"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="7" number="M100-M7" description="Default_Axis7" start_address="ZR11800"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="8" number="M100-M8" description="Default_Axis8" start_address="ZR12100"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="9" number="M100-M9" description="Default_Axis9" start_address="ZR12400"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="10" number="M100-M10" description="Default_Axis10" start_address="ZR12700"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="11" number="M100-M11" description="Default_Axis11" start_address="ZR13000"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | <Axis id="12" number="M100-M12" description="Default_Axis12" start_address="ZR13300"> |
| | | <jog_distance min="1" max="10" current="1" /> |
| | | <manual_speed min="1" max="100" current="10" /> |
| | | <auto_speed min="5" max="200" current="50" /> |
| | | <acceleration_time min="1" max="10" current="1" /> |
| | | <deceleration_time min="1" max="10" current="1" /> |
| | | <Positions positioningPointCount="25"> |
| | | <Position isEnable="1" description="Position 1" min="5" max="20" current="10" /> |
| | | <Position isEnable="1" description="Position 2" min="10" max="40" current="20" /> |
| | | <Position isEnable="1" description="Position 3" min="15" max="60" current="30" /> |
| | | <Position isEnable="1" description="Position 4" min="20" max="80" current="40" /> |
| | | <Position isEnable="1" description="Position 5" min="25" max="100" current="50" /> |
| | | <Position isEnable="1" description="Position 6" min="30" max="120" current="60" /> |
| | | <Position isEnable="1" description="Position 7" min="35" max="140" current="70" /> |
| | | <Position isEnable="1" description="Position 8" min="40" max="160" current="80" /> |
| | | <Position isEnable="1" description="Position 9" min="45" max="180" current="90" /> |
| | | <Position isEnable="1" description="Position 10" min="50" max="200" current="100" /> |
| | | <Position isEnable="1" description="Position 11" min="55" max="220" current="110" /> |
| | | <Position isEnable="1" description="Position 12" min="60" max="240" current="120" /> |
| | | <Position isEnable="1" description="Position 13" min="65" max="260" current="130" /> |
| | | <Position isEnable="1" description="Position 14" min="70" max="280" current="140" /> |
| | | <Position isEnable="1" description="Position 15" min="75" max="300" current="150" /> |
| | | <Position isEnable="1" description="Position 16" min="80" max="320" current="160" /> |
| | | <Position isEnable="1" description="Position 17" min="85" max="340" current="170" /> |
| | | <Position isEnable="1" description="Position 18" min="90" max="360" current="180" /> |
| | | <Position isEnable="1" description="Position 19" min="95" max="380" current="190" /> |
| | | <Position isEnable="1" description="Position 20" min="100" max="400" current="200" /> |
| | | <Position isEnable="1" description="Position 21" min="105" max="420" current="210" /> |
| | | <Position isEnable="1" description="Position 22" min="110" max="440" current="220" /> |
| | | <Position isEnable="1" description="Position 23" min="115" max="460" current="230" /> |
| | | <Position isEnable="1" description="Position 24" min="120" max="480" current="240" /> |
| | | <Position isEnable="1" description="Position 25" min="125" max="500" current="250" /> |
| | | </Positions> |
| | | </Axis> |
| | | </root> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | X1000,Unit1_æ¥å EMO,Y1010,Unit1_åè²ç¯-红 |
| | | X1001,Unit1_æ»è¿æ°å忣,Y1011,Unit1_åè²ç¯-é» |
| | | X1002,Unit1_伺æçµæçææ¥è¦,Y1012,Unit1_åè²ç¯-绿 |
| | | X1003,Unit1_å ççµæçææ¥è¦,Y1013,Unit1_åè²ç¯-è |
| | | X1004,å®å
¨ç»§çµå¨æ£,Y1014,Unit1_è鸣å¨-1 |
| | | X1005,,Y1015,Unit1_è鸣å¨-2 |
| | | X1006,,Y1016,Unit1_è鸣å¨-3 |
| | | X1007,Unit1_å®å
¨é¨ç£æ£1,Y1017,Unit1_è鸣å¨-4 |
| | | X1008,Unit1_å®å
¨é¨ç£æ£2,Y1018,Unit1_æºå°ç
§æ |
| | | X1009,Unit1_å®å
¨é¨ç£æ£3,Y1019,Unit1_å®å
¨é¨éå±è½ |
| | | X100A,Unit1_å®å
¨é¨ç£æ£4,Y101A, |
| | | X100B,Unit1_å®å
¨é¨ç£æ£5,Y101B, |
| | | X100C,Unit1_å®å
¨é¨ç£æ£6,Y101C, |
| | | X100D,Unit1_å®å
¨é¨éæ£1,Y101D,Unit1_å®å
¨é¨é1 |
| | | X100E,Unit1_å®å
¨é¨éæ£2,Y101E,Unit1_å®å
¨é¨é2 |
| | | X100F,Unit1_å®å
¨é¨éæ£3,Y101F,Unit1_å®å
¨é¨é3 |
| | | X1020,Unit1_ååæ³µ-Alam(8-14),Y1030,Unit1_ååæ³µå¯å¨(1-9) |
| | | X1021,Unit1_ååæ³µ-è¿ç¨/æ¬å°æ¨¡å¼(7-15),Y1031,Unit1_ååæ³µèéè£
ç½®(2-10) |
| | | X1022,Unit1_ååæ³µ-æ£å¸¸è¿è¡ï¼4-12ï¼,Y1032,Unit1_ååæ³µéæææ¿é |
| | | X1023,Unit1_ååæ³µéæææ¿éåä½,Y1033,Unit1_æ°åéæé |
| | | X1024,Unit1_ååæ³µéæææ¿éå°ä½,Y1034, |
| | | X1025,Unit1_è
使çå·¦æ°ç¼¸åä½,Y1035,Unit1_è
使çå·¦æ°ç¼¸åä½ |
| | | X1026,Unit1_è
使çå·¦æ°ç¼¸å°ä½,Y1036,Unit1_è
使çå·¦æ°ç¼¸å°ä½ |
| | | X1027,Unit1_è
使ç峿°ç¼¸åä½,Y1037,Unit1_è
使ç峿°ç¼¸åä½ |
| | | X1028,Unit1_è
使ç峿°ç¼¸å°ä½,Y1038,Unit1_è
使ç峿°ç¼¸å°ä½ |
| | | X1029,Unit1_é¨éåéæ°ç¼¸åä½,Y1039,Unit1_é¨éåéæ°ç¼¸ |
| | | X102A,Unit1_é¨éåéæ°ç¼¸å°ä½,Y103A, |
| | | X102B,Unit1_è
ä½ç ´ç空æ°éåä½,Y103B,Unit1_è
ä½ç ´ç空æ°é |
| | | X102C,Unit1_è
ä½ç ´ç空æ°éå°ä½,Y103C,Unit1_ååæ³µææ°é |
| | | X102D,Unit1_ä¸è
å¹³å°ç空æ£,Y103D,Unit1_ä¸è
å¹³å°å¸ç空 |
| | | X102E,Unit1_ååæ³µææ°éåä½,Y103E,Unit1_ä¸è
å¹³å°ç ´ç空 |
| | | X102F,Unit1_ååæ³µææ°éå°ä½,Y103F, |
| | | X1040,Unit1_ä¸å çå·²ä¸çµ,Y1050,Unit1_ä¸å çä¸çµ |
| | | X1041,Unit1_ä¸ä¸»æ¸©æ§è¡¨æ¥è¦,Y1051,Unit1_ä¸å çä¸çµ |
| | | X1042,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦1,Y1052, |
| | | X1043,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦2,Y1053, |
| | | X1044,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦3,Y1054, |
| | | X1045,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦4,Y1055, |
| | | X1046,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦5,Y1056, |
| | | X1047,Unit1_ä¸å çå·²ä¸çµ,Y1057, |
| | | X1048,Unit1_ä¸ä¸»æ¸©æ§è¡¨æ¥è¦,Y1058, |
| | | X1049,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦1,Y1059, |
| | | X104A,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦2,Y105A, |
| | | X104B,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦3,Y105B, |
| | | X104C,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦4,Y105C, |
| | | X104D,Unit1_ä¸çæ§æ¸©æ§è¡¨æ¥è¦5,Y105D, |
| | | X104E,,Y105E, |
| | | X104F,,Y105F, |
| | | X1060,Unit1_干泵-DVPè¿è¡æ£æµ-11,Y1070,Unit1_干泵-DVPå¯å¨-1 |
| | | X1061,Unit1_干泵-MBPè¿è¡æ£æµ-12,Y1071,Unit1_干泵-MBPå¯å¨-2 |
| | | X1062,Unit1_干泵-é误æ¥è¦ä¸-14,Y1072,Unit1_干泵-å¼å¸¸è§£é¤-3 |
| | | X1063,Unit1_干泵-é误è¦åä¸-16,Y1073, |
| | | X1064,Unit1_干泵-è¿ç¨/æ¬å°æ¨¡å¼-18,Y1074,Unit1_æ°®æ°éæçµç£é1 |
| | | X1065,Unit1_干泵-ç´§æ¥åæ¢ä¸-20,Y1075,Unit1_æ°®æ°éæçµç£é2 |
| | | X1066,,Y1076,Unit1_æ°®æ°éæçµç£é3 |
| | | X1067,,Y1077,Unit1_æ°®æ°éæçµç£é4 |
| | | X1068,,Y1078,Unit1_å çæ¿æ°´å·éæçµç£é1 |
| | | X1069,,Y1079,Unit1_å çæ¿æ°´å·éæçµç£é2 |
| | | X106A,,Y107A,Unit1_å çæ¿æ°´å·éæçµç£é3 |
| | | X106B,,Y107B,Unit1_å çæ¿æ°´å·éæçµç£é4 |
| | | X106C,,Y107C,Unit1_è
ä½åºæ¿éæçµç£é1 |
| | | X106D,Unit1_æ°´ç®±ä¸æ¶²ä½æ£,Y107D,Unit1_è
ä½åºæ¿éæçµç£é2 |
| | | X106E,Unit1_æ°´ç®±ä¸æ¶²ä½æ£,Y107E,Unit1_æ°´ç®±è¿æ°´é |
| | | X106F,Unit1_æ°´ç®±ä¸æ¶²ä½æ£,Y107F,Unit1_æ°´ç®±åºæ°´é |
| | | X1080,Unit2_æ¥å EMO,Y1090,Unit2_åè²ç¯-红 |
| | | X1081,Unit2_æ»è¿æ°å忣,Y1091,Unit2_åè²ç¯-é» |
| | | X1082,Unit2_伺æçµæçææ¥è¦,Y1092,Unit2_åè²ç¯-绿 |
| | | X1083,Unit2_å ççµæçææ¥è¦,Y1093,Unit2_åè²ç¯-è |
| | | X1084,å®å
¨ç»§çµå¨æ£,Y1094,Unit2_è鸣å¨-1 |
| | | X1085,,Y1095,Unit2_è鸣å¨-2 |
| | | X1086,,Y1096,Unit2_è鸣å¨-3 |
| | | X1087,Unit2_å®å
¨é¨ç£æ£1,Y1097,Unit2_è鸣å¨-4 |
| | | X1088,Unit2_å®å
¨é¨ç£æ£2,Y1098,Unit2_æºå°ç
§æ |
| | | X1089,Unit2_å®å
¨é¨ç£æ£3,Y1099,Unit2_å®å
¨é¨éå±è½ |
| | | X108A,Unit2_å®å
¨é¨ç£æ£4,Y109A, |
| | | X108B,Unit2_å®å
¨é¨ç£æ£5,Y109B, |
| | | X108C,Unit2_å®å
¨é¨ç£æ£6,Y109C, |
| | | X108D,Unit2_å®å
¨é¨éæ£1,Y109D,Unit2_å®å
¨é¨é1 |
| | | X108E,Unit2_å®å
¨é¨éæ£2,Y109E,Unit2_å®å
¨é¨é2 |
| | | X108F,Unit2_å®å
¨é¨éæ£3,Y109F,Unit2_å®å
¨é¨é3 |
| | | X10A0,Unit2_ååæ³µ-Alam(8-14),Y10B0,Unit2_ååæ³µå¯å¨(1-9) |
| | | X10A1,Unit2_ååæ³µ-è¿ç¨/æ¬å°æ¨¡å¼(7-15),Y10B1,Unit2_ååæ³µèéè£
ç½®(2-10) |
| | | X10A2,Unit2_ååæ³µ-æ£å¸¸è¿è¡ï¼4-12ï¼,Y10B2,Unit2_ååæ³µéæææ¿é |
| | | X10A3,,Y10B3,Unit2_æ°åéæé |
| | | X10A4,,Y10B4, |
| | | X10A5,Unit2_è
使çå·¦æ°ç¼¸åä½,Y10B5,Unit2_è
使çå·¦æ°ç¼¸åä½ |
| | | X10A6,Unit2_è
使çå·¦æ°ç¼¸å°ä½,Y10B6,Unit2_è
使çå·¦æ°ç¼¸å°ä½ |
| | | X10A7,Unit2_è
使ç峿°ç¼¸åä½,Y10B7,Unit2_è
使ç峿°ç¼¸åä½ |
| | | X10A8,Unit2_è
使ç峿°ç¼¸å°ä½,Y10B8,Unit2_è
使ç峿°ç¼¸å°ä½ |
| | | X10A9,Unit2_é¨éåéæ°ç¼¸åä½,Y10B9,Unit2_é¨éåéæ°ç¼¸ |
| | | X10AA,Unit2_é¨éåéæ°ç¼¸å°ä½,Y10BA, |
| | | X10AB,Unit2_è
ä½ç ´ç空æ°éåä½,Y10BB,Unit2_è
ä½ç ´ç空æ°é |
| | | X10AC,Unit2_è
ä½ç ´ç空æ°éå°ä½,Y10BC,Unit2_ååæ³µææ°é |
| | | X10AD,Unit2_ä¸è
å¹³å°ç空æ£,Y10BD,Unit2_ä¸è
å¹³å°å¸ç空 |
| | | X10AE,Unit2_ååæ³µææ°éåä½,Y10BE,Unit2_ä¸è
å¹³å°ç ´ç空 |
| | | X10AF,Unit2_ååæ³µææ°éå°ä½,Y10BF, |
| | | X10C0,Unit2_ä¸å çå·²ä¸çµ,Y10D0,Unit2_ä¸å çä¸çµ |
| | | X10C1,Unit2_ä¸ä¸»æ¸©æ§è¡¨æ¥è¦,Y10D1,Unit2_ä¸å çä¸çµ |
| | | X10C2,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦1,Y10D2, |
| | | X10C3,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦2,Y10D3, |
| | | X10C4,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦3,Y10D4, |
| | | X10C5,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦4,Y10D5, |
| | | X10C6,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦5,Y10D6, |
| | | X10C7,Unit2_ä¸å çå·²ä¸çµ,Y10D7, |
| | | X10C8,Unit2_ä¸ä¸»æ¸©æ§è¡¨æ¥è¦,Y10D8, |
| | | X10C9,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦1,Y10D9, |
| | | X10CA,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦2,Y10DA, |
| | | X10CB,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦3,Y10DB, |
| | | X10CC,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦4,Y10DC, |
| | | X10CD,Unit2_ä¸çæ§æ¸©æ§è¡¨æ¥è¦5,Y10DD, |
| | | X10CE,,Y10DE, |
| | | X10CF,,Y10DF, |
| | | X10E0,Unit2_干泵-DVPè¿è¡æ£æµ-11,Y10F0,Unit2_干泵-DVPå¯å¨-1 |
| | | X10E1,Unit2_干泵-MBPè¿è¡æ£æµ-12,Y10F1,Unit2_干泵-MBPå¯å¨-2 |
| | | X10E2,Unit2_干泵-é误æ¥è¦ä¸-14,Y10F2,Unit2_干泵-å¼å¸¸è§£é¤-3 |
| | | X10E3,Unit2_干泵-é误è¦åä¸-16,Y10F3, |
| | | X10E4,Unit2_干泵-è¿ç¨/æ¬å°æ¨¡å¼-18,Y10F4,Unit2_æ°®æ°éæçµç£é1 |
| | | X10E5,Unit2_干泵-ç´§æ¥åæ¢ä¸-20,Y10F5,Unit2_æ°®æ°éæçµç£é2 |
| | | X10E6,,Y10F6,Unit2_æ°®æ°éæçµç£é3 |
| | | X10E7,,Y10F7,Unit2_æ°®æ°éæçµç£é4 |
| | | X10E8,,Y10F8,Unit2_å çæ¿æ°´å·éæçµç£é1 |
| | | X10E9,,Y10F9,Unit2_å çæ¿æ°´å·éæçµç£é2 |
| | | X10EA,,Y10FA,Unit2_å çæ¿æ°´å·éæçµç£é3 |
| | | X10EB,,Y10FB,Unit2_å çæ¿æ°´å·éæçµç£é4 |
| | | X10EC,,Y10FC,Unit2_è
ä½åºæ¿éæçµç£é1 |
| | | X10ED,Unit2_æ°´ç®±ä¸æ¶²ä½æ£,Y10FD,Unit2_è
ä½åºæ¿éæçµç£é2 |
| | | X10EE,Unit2_æ°´ç®±ä¸æ¶²ä½æ£,Y10FE,Unit2_æ°´ç®±è¿æ°´é |
| | | X10EF,Unit2_æ°´ç®±ä¸æ¶²ä½æ£,Y10FF,Unit2_æ°´ç®±åºæ°´é |