mrDarker
2025-07-22 2246e85e7241fe910ed5e819c659fbf139b82054
1. 本地测试Port配置修改,需要通过EFEM扫描结果设置可勾选项
已修改2个文件
78 ■■■■ 文件已修改
SourceCode/Bond/Servo/PortConfigurationDlg.cpp 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -50,39 +50,24 @@
    SetDlgItemText(IDC_EDIT_OPERATIONID, "");
    m_comboMaterialsType.SetCurSel(0);
    bool bJobInfoSet = false;
    for (int i = 0; i < SLOT_MAX; ++i) {
        SERVO::CSlot* pSlot = pPort->getSlot(i);
        if (!pSlot) {
            continue;
        }
    SERVO::CSlot* pSlot = pPort->getSlot(0);
    if (pSlot == nullptr) {
        return;
    }
        SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
        int nRow = i + 1;
        // 设置 Panel ID 和勾选框
        CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(nRow, 1));
        if (pCheck && pGlass) {
            pCheck->SetCheck(pSlot->isEnable() ? TRUE : FALSE);
            pCheck->SetText(pGlass ? pGlass->getID().c_str() : _T(""));
        }
        else {
            pCheck->SetCheck(FALSE);
            pCheck->SetText(_T(""));
        }
        // 回填 Job 信息(只取第一个有效 Glass)
        if (!bJobInfoSet && pGlass) {
            SERVO::CJobDataS* pJS = pGlass->getJobDataS();
            if (pJS) {
                SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
                SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
                SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
                m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
                bJobInfoSet = true;
            }
    SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
    if (pGlass != nullptr) {
        SERVO::CJobDataS* pJS = pGlass->getJobDataS();
        if (pJS) {
            SetDlgItemText(IDC_EDIT_LOTID, CString(pJS->getLotId().c_str()));
            SetDlgItemText(IDC_EDIT_PRODUCTID, CString(pJS->getProductId().c_str()));
            SetDlgItemText(IDC_EDIT_OPERATIONID, CString(pJS->getOperationId().c_str()));
            m_comboMaterialsType.SetCurSel(pJS->getMaterialsType() - 1);
        }
    }
    // 填充 Grid
    FillGrid(pSlot, pGlass);
}
void CPortConfigurationDlg::InitGrid()
@@ -138,28 +123,41 @@
    for (int i = 0; i < nRows; ++i) {
        m_wndGrid.SetRowHeight(i, nEachRowHeight);
    }
    FillGrid();
}
void CPortConfigurationDlg::FillGrid()
void CPortConfigurationDlg::FillGrid(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass)
{
    //CStringArray recipeOptions;
    //recipeOptions.Add(_T("Recipe A"));
    //recipeOptions.Add(_T("Recipe B"));
    //recipeOptions.Add(_T("Recipe C"));
    for (int i = 1; i < 9; ++i) {
    // 去除表头,从第2行开始填充数据
    for (int i = 1; i < SLOT_MAX + 1; ++i) {
        CString strIndex;
        strIndex.Format(_T("%d"), i);
        m_wndGrid.SetItemText(i, 0, strIndex);
        m_wndGrid.SetItemState(i, 0, GVIS_READONLY);
        // Checkbox
        m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellCheck));
        CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
        if (pCheck) {
            pCheck->SetCheck(FALSE);
        if (i != 3) {
            // Checkbox
            m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellCheck));
            CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
            if (pCheck) {
                // 设置 Panel ID 和勾选框
                CGridCellCheck* pCheck = static_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
                if (pCheck && pSlot && pGlass) {
                    pCheck->SetCheck(pSlot->isEnable() ? TRUE : FALSE);
                    pCheck->SetText(pGlass ? pGlass->getID().c_str() : _T(""));
                }
                else {
                    pCheck->SetCheck(FALSE);
                    pCheck->SetText(_T(""));
                }
            }
        }
        else {
            m_wndGrid.SetItemState(i, 1, GVIS_READONLY);
        }
    }
SourceCode/Bond/Servo/PortConfigurationDlg.h
@@ -29,7 +29,7 @@
    int GetLoadPortEqID(const std::string& strPortName);
    void LoadPortConfigToUI(SERVO::CLoadPort* pPort);
    void InitGrid();
    void FillGrid();
    void FillGrid(SERVO::CSlot* pSlot, SERVO::CGlass* pGlass);
    SERVO::CLoadPort* m_pPort[4];