| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // AxisDetailSettingsDlg.cpp: å®ç°æä»¶ |
| | | // |
| | | |
| | | #include "stdafx.h" |
| | | #include "BondEq.h" |
| | | #include "afxdialogex.h" |
| | | #include "AxisDetailSettingsDlg.h" |
| | | #include "NewCellTypes/GridCellCheck.h" |
| | | #include "NewCellTypes/GridCellNumeric.h" |
| | | |
| | | |
| | | // CAxisDetailSettingsDlg å¯¹è¯æ¡ |
| | | |
| | | IMPLEMENT_DYNAMIC(CAxisDetailSettingsDlg, CDialogEx) |
| | | |
| | | CAxisDetailSettingsDlg::CAxisDetailSettingsDlg(const CString& strRecipeName, int nAxisNO, CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DIALOG_AXIS_DETAIL_SETTINGS, pParent) |
| | | { |
| | | m_strRecipeName = strRecipeName; |
| | | m_nAxisNO = nAxisNO; |
| | | |
| | | m_pPLC = nullptr; |
| | | m_nInitialWidth = 0; |
| | | m_nInitialHeight = 0; |
| | | } |
| | | |
| | | CAxisDetailSettingsDlg::~CAxisDetailSettingsDlg() |
| | | { |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::SetPLC(CPLC* pPLC) |
| | | { |
| | | ASSERT(pPLC); |
| | | m_pPLC = pPLC; |
| | | } |
| | | |
| | | 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() |
| | | { |
| | | RecipeManager& g_recipeManager = RecipeManager::getInstance(); |
| | | auto axisDetails = g_recipeManager.getAxis(m_nAxisNO); |
| | | |
| | | int nRowIndex = 1; |
| | | 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() |
| | | { |
| | | // è·åè½´æ°æ® |
| | | RecipeManager& recipeManager = RecipeManager::getInstance(); |
| | | auto axisDetails = recipeManager.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_SPEED_LIMIT)->SetWindowText(formatDouble(axisDetails.maxPositioningSpeed)); // å®ä½é度ä¸é |
| | | //GetDlgItem(IDC_EDIT_AXIS_JOG_SPEED_LIMIT)->SetWindowText(formatDouble(axisDetails.maxManualSpeed)); // æå¨é度ä¸é |
| | | 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)); |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CDialogEx::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, CDialogEx) |
| | | 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() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | |
| | | // TODO: 卿¤æ·»å é¢å¤çåå§å |
| | | CString strTitle; |
| | | strTitle.Format(_T("Axisç»é¨è®¾å®(é
æ¹: %s)"), m_strRecipeName); |
| | | SetWindowText(strTitle); |
| | | |
| | | // è·åè½´æ°æ® |
| | | RecipeManager& recipeManager = RecipeManager::getInstance(); |
| | | auto axisDetails = recipeManager.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: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | // è·åè½´æ°æ® |
| | | RecipeManager& recipeManager = RecipeManager::getInstance(); |
| | | auto& axisDetails = recipeManager.getAxis(m_nAxisNO); |
| | | |
| | | // ä»ç颿§ä»¶è·åç¨æ·è¾å
¥çæ°æ®å¹¶æ´æ°å° axisDetails |
| | | |
| | | // è½´ç¼å·ãæè¿°åèµ·å§å°å |
| | | 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 strPosSpeedLimit; |
| | | //GetDlgItem(IDC_EDIT_AXIS_POSITIONING_SPEED_LIMIT)->GetWindowText(strPosSpeedLimit); |
| | | //axisDetails.maxPositioningSpeed = _ttof(strPosSpeedLimit); // 转æ¢ä¸º double ç±»å |
| | | |
| | | // æå¨é度ä¸é |
| | | //CString strJogSpeedLimit; |
| | | //GetDlgItem(IDC_EDIT_AXIS_JOG_SPEED_LIMIT)->GetWindowText(strJogSpeedLimit); |
| | | //axisDetails.maxManualSpeed = _ttof(strJogSpeedLimit); |
| | | |
| | | // å®ä½ç¹æ° |
| | | CString strPosCount; |
| | | GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->GetWindowText(strPosCount); |
| | | axisDetails.positioningPointCount = _ttoi(strPosCount); // 转æ¢ä¸º int ç±»å |
| | | |
| | | // å¾®å¨é |
| | | 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)); |
| | | } |
| | | |
| | | // æ´æ° RecipeManager ä¸çè½´æ°æ® |
| | | recipeManager.updateAxis(axisDetails); |
| | | |
| | | // ä¿åè½´æ°æ®å°æä»¶ |
| | | CString cstrMessage; |
| | | if (RecipeManager::getInstance().saveRecipe(std::string(CT2A(m_strRecipeName)))) { |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] ç»é¨åæ°æåï¼"), m_nAxisNO); |
| | | SystemLogManager::getInstance().log(SystemLogManager::LogType::Operation, std::string(CT2A(cstrMessage))); |
| | | } |
| | | else { |
| | | cstrMessage.Format(_T("ä¿åè½´ [%d] ç»é¨åæ°å¤±è´¥ï¼"), m_nAxisNO); |
| | | SystemLogManager::getInstance().log(SystemLogManager::LogType::Error, std::string(CT2A(cstrMessage))); |
| | | } |
| | | |
| | | AfxMessageBox(cstrMessage); |
| | | } |
| | | |
| | | void CAxisDetailSettingsDlg::OnBnClickedButtonSetAxisPositioningPoints() |
| | | { |
| | | // TODO: 卿¤æ·»å æ§ä»¶éç¥å¤çç¨åºä»£ç |
| | | CString strPosCount; |
| | | GetDlgItem(IDC_EDIT_AXIS_POSITIONING_POINTS)->GetWindowText(strPosCount); |
| | | if (strPosCount.IsEmpty()) { |
| | | AfxMessageBox(_T("请è¾å
¥å®ä½ç¹æ°ï¼")); |
| | | return; |
| | | } |
| | | |
| | | RecipeManager& recipeManager = RecipeManager::getInstance(); |
| | | AxisInfo axisDetails = recipeManager.getAxis(m_nAxisNO); |
| | | axisDetails.positioningPointCount = _ttoi(strPosCount); |
| | | |
| | | // æ´æ° RecipeManager ä¸çè½´æ°æ® |
| | | recipeManager.updateAxis(axisDetails); |
| | | |
| | | FillAnchorPontManager(); |
| | | } |