LAPTOP-SNT8I5JK\Boounion
2025-09-01 a0022a4e7d8da7391db2926acd69b3c712135762
SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -240,7 +240,6 @@
    GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(FALSE);
    GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(FALSE);
   return TRUE;  // return TRUE unless you set the focus to a control
   // 异常: OCX 属性页应返回 FALSE
}
@@ -254,6 +253,12 @@
   }
   // 加载选中端口的配置到 UI
    for (int i = 1; i <= 8; i++) {
        m_wndGrid.SetItemText(i, 0, "");
        m_wndGrid.SetItemText(i, 1, "");
        m_wndGrid.SetCellType(i, 1, RUNTIME_CLASS(CGridCellNumeric));
    }
    m_wndGrid.Invalidate();
   LoadPortConfigToUI(m_pPort[selPort]);
}
@@ -312,6 +317,7 @@
   }
    // 获取 Grid 表格中 Slot 状态(第1~8行)
    /*
    for (int i = 1; i <= SLOT_MAX; ++i) {
        SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0);
        if (pGlass != nullptr) {
@@ -319,14 +325,92 @@
            ASSERT(pCheck);
            pGlass->setScheduledForProcessing(pCheck->GetCheck());
            pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
            LOGI("i: %d, nMaterialType:%d", i, config.nMaterialType);
            SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
            pJobDataS->setLotId(config.strLotID.c_str());
            pJobDataS->setProductId(config.strProductID.c_str());
            pJobDataS->setOperationId(config.strOperationID.c_str());
            pJobDataS->setMaterialsType(config.nMaterialType);
            RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(config.strRecipe);
            std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList;
            for (const auto& info : vecRecipeInfo) {
                const std::string& name = info.strDeviceName;
                short nRecipeID = (short)info.nRecipeID;
                if (name == EQ_NAME_EFEM) {
                    pJobDataS->setDeviceRecipeId(0, nRecipeID);
                }
                else if (name == EQ_NAME_BONDER1) {
                    pJobDataS->setDeviceRecipeId(1, nRecipeID);
                }
                else if (name == EQ_NAME_BONDER2) {
                    pJobDataS->setDeviceRecipeId(2, nRecipeID);
                }
                else if (name == EQ_NAME_BAKE_COOLING) {
                    pJobDataS->setDeviceRecipeId(3, nRecipeID);
                }
                else if (name == EQ_NAME_VACUUMBAKE) {
                    pJobDataS->setDeviceRecipeId(4, nRecipeID);
                }
                else if (name == EQ_NAME_MEASUREMENT) {
                    pJobDataS->setDeviceRecipeId(5, nRecipeID);
                }
            }
        }
    }
    */
    // 打勾为更新类型,暂时测试使用,原打色为是否加工
    for (int i = 1; i <= SLOT_MAX; ++i) {
        SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0);
        if (pGlass != nullptr) {
            CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1));
            ASSERT(pCheck);
            pGlass->setScheduledForProcessing(TRUE);
            if (pCheck->GetCheck()) {
                pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
                LOGI("i: %d, nMaterialType:%d", i, config.nMaterialType);
                SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
                pJobDataS->setLotId(config.strLotID.c_str());
                pJobDataS->setProductId(config.strProductID.c_str());
                pJobDataS->setOperationId(config.strOperationID.c_str());
                pJobDataS->setMaterialsType(config.nMaterialType);
                RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(config.strRecipe);
                std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList;
                for (const auto& info : vecRecipeInfo) {
                    const std::string& name = info.strDeviceName;
                    short nRecipeID = (short)info.nRecipeID;
                    if (name == EQ_NAME_EFEM) {
                        pJobDataS->setDeviceRecipeId(0, nRecipeID);
                    }
                    else if (name == EQ_NAME_BONDER1) {
                        pJobDataS->setDeviceRecipeId(1, nRecipeID);
                    }
                    else if (name == EQ_NAME_BONDER2) {
                        pJobDataS->setDeviceRecipeId(2, nRecipeID);
                    }
                    else if (name == EQ_NAME_BAKE_COOLING) {
                        pJobDataS->setDeviceRecipeId(3, nRecipeID);
                    }
                    else if (name == EQ_NAME_VACUUMBAKE) {
                        pJobDataS->setDeviceRecipeId(4, nRecipeID);
                    }
                    else if (name == EQ_NAME_MEASUREMENT) {
                        pJobDataS->setDeviceRecipeId(5, nRecipeID);
                    }
                }
            }
        }
    }
    GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(TRUE);
    GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(TRUE);