1. 在配置文件中添加设备名称
2. 配方绑定界面显示需要的设备ID和设备名称
已修改3个文件
111 ■■■■■ 文件已修改
SourceCode/Bond/Servo/Common.h 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/RecipeDeviceBindDlg.h 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h
@@ -79,6 +79,49 @@
#define EQ_ID_ARM                101
#define EQ_ID_OPERATOR_REMOVE    102
/* Equipment Name */
#define EQ_NAME_LOADPORT1            "LoadPort1"
#define EQ_NAME_LOADPORT2            "LoadPort2"
#define EQ_NAME_LOADPORT3            "LoadPort3"
#define EQ_NAME_LOADPORT4            "LoadPort4"
#define EQ_NAME_ARM_TRAY1            "ArmTray1"
#define EQ_NAME_ARM_TRAY2            "ArmTray2"
#define EQ_NAME_ALIGNER                "Aligner"
#define EQ_NAME_FLIPER                "Fliper"
#define EQ_NAME_VACUUMBAKE            "VacuumBake"
#define EQ_NAME_BONDER1                "Bonder1"
#define EQ_NAME_BONDER2                "Bonder2"
#define EQ_NAME_BAKE_COOLING        "BakeCooling"
#define EQ_NAME_MEASUREMENT            "Measurement"
#define EQ_NAME_EFEM                "EFEM"
#define EQ_NAME_ARM                    "Arm"
#define EQ_NAME_OPERATOR_REMOVE        "OperatorRemove"
// 设备元信息结构体
struct DeviceMetaInfo {
    int nDeviceID;
    const char* strDeviceName;  // 指针,仅指向常量字符串
};
// 全局设备元信息列表
static const DeviceMetaInfo g_allDeviceMetaInfos[] = {
    {EQ_ID_LOADPORT1, EQ_NAME_LOADPORT1},
    {EQ_ID_LOADPORT2, EQ_NAME_LOADPORT2},
    {EQ_ID_LOADPORT3, EQ_NAME_LOADPORT3},
    {EQ_ID_LOADPORT4, EQ_NAME_LOADPORT4},
    {EQ_ID_ARM_TRAY1, EQ_NAME_ARM_TRAY1},
    {EQ_ID_ARM_TRAY2, EQ_NAME_ARM_TRAY2},
    {EQ_ID_ALIGNER,   EQ_NAME_ALIGNER},
    {EQ_ID_FLIPER,    EQ_NAME_FLIPER},
    {EQ_ID_VACUUMBAKE, EQ_NAME_VACUUMBAKE},
    {EQ_ID_Bonder1, EQ_NAME_BONDER1},
    {EQ_ID_Bonder2, EQ_NAME_BONDER2},
    {EQ_ID_BAKE_COOLING, EQ_NAME_BAKE_COOLING},
    {EQ_ID_MEASUREMENT, EQ_NAME_MEASUREMENT},
    {EQ_ID_EFEM, EQ_NAME_EFEM},
    {EQ_ID_ARM, EQ_NAME_ARM},
    {EQ_ID_OPERATOR_REMOVE, EQ_NAME_OPERATOR_REMOVE},
};
/* step name */
#define STEP_MODE                        _T("EQMode")
SourceCode/Bond/Servo/RecipeDeviceBindDlg.cpp
@@ -5,10 +5,22 @@
#include "Servo.h"
#include "afxdialogex.h"
#include "RecipeDeviceBindDlg.h"
#include "RecipeManager.h"
#include "Common.h"
#define IDC_EDIT_DEVICEID_BASE     3000
#define IDC_EDIT_DEVICENAME_BASE   3050
#define IDC_COMBO_RECIPEID_BASE    3100
// 绑定界面需要显示的设备
static const std::vector<DeviceMetaInfo> g_vecBindDevices = {
    { EQ_ID_VACUUMBAKE,      EQ_NAME_VACUUMBAKE },
    { EQ_ID_Bonder1,         EQ_NAME_BONDER1 },
    { EQ_ID_Bonder2,         EQ_NAME_BONDER2 },
    { EQ_ID_BAKE_COOLING,    EQ_NAME_BAKE_COOLING },
    { EQ_ID_MEASUREMENT,     EQ_NAME_MEASUREMENT },
    { EQ_ID_EFEM,            EQ_NAME_EFEM }
};
// CRecipeDeviceBindDlg 对话框
@@ -31,6 +43,8 @@
BEGIN_MESSAGE_MAP(CRecipeDeviceBindDlg, CDialogEx)
    ON_WM_CLOSE()
    ON_WM_SIZE()
END_MESSAGE_MAP()
@@ -50,24 +64,64 @@
    GetClientRect(&clientRect);
    int xStart = (clientRect.Width() - totalControlWidth) / 2;
    const int nRowCount = 8;
    const int nRowHeight = 30;
    const int yStart = 30; // 顶部起始高度
    for (int i = 0; i < nRowCount; ++i)
    {
    const int nRowCount = static_cast<int>(g_vecBindDevices.size());
    for (int i = 0; i < nRowCount; ++i) {
        int y = yStart + i * nRowHeight;
        const auto& meta = g_vecBindDevices[i];
        CEdit* pEditID = new CEdit();
        pEditID->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart, y, xStart + 100, y + 25), this, IDC_EDIT_DEVICEID_BASE + i);
        CString strID;
        strID.Format(_T("%d"), meta.nDeviceID);
        pEditID->SetWindowText(strID);
        pEditID->SetReadOnly(TRUE);     // 设备ID只读
        CEdit* pEditName = new CEdit();
        pEditName->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(xStart + 110, y, xStart + 210, y + 25), this, IDC_EDIT_DEVICENAME_BASE + i);
        pEditName->SetWindowText(CA2T(meta.strDeviceName));
        pEditName->SetReadOnly(TRUE);   // 设备名称只读
        CComboBox* pCombo = new CComboBox();
        pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, CRect(xStart + 220, y, xStart + 340, y + 300), this, IDC_COMBO_RECIPEID_BASE + i);
        // 添加选项到 ComboBox
        m_vecDevices.push_back({ pEditID, pEditName, pCombo });
    }
    return TRUE;  // return TRUE unless you set the focus to a control
    // 异常: OCX 属性页应返回 FALSE
}
void CRecipeDeviceBindDlg::OnClose()
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
    CDialogEx::OnClose();
    // 清理控件
    for (auto& device : m_vecDevices) {
        if (device.editDeviceID) {
            device.editDeviceID->DestroyWindow();
            delete device.editDeviceID;
        }
        if (device.editDeviceName) {
            device.editDeviceName->DestroyWindow();
            delete device.editDeviceName;
        }
        if (device.comboRecipeID) {
            device.comboRecipeID->DestroyWindow();
            delete device.comboRecipeID;
        }
    }
    m_vecDevices.clear();
}
void CRecipeDeviceBindDlg::OnSize(UINT nType, int cx, int cy)
{
    CDialogEx::OnSize(nType, cx, cy);
    // TODO: 在此处添加消息处理程序代码
}
SourceCode/Bond/Servo/RecipeDeviceBindDlg.h
@@ -20,13 +20,15 @@
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
    virtual BOOL OnInitDialog();
    afx_msg void OnClose();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    DECLARE_MESSAGE_MAP()
private:
    struct DeviceWidget {
        CEdit editDeviceID;
        CEdit editDeviceName;
        CComboBox comboRecipeID;
        CEdit* editDeviceID;
        CEdit* editDeviceName;
        CComboBox* comboRecipeID;
    };
    std::vector<DeviceWidget> m_vecDevices;