已修改12个文件
127 ■■■■ 文件已修改
SourceCode/Bond/Servo/CAttributeVector.cpp 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CAttributeVector.h 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CStep.cpp 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.cpp 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/PortConfigurationDlg.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/TopToolbar.cpp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/TopToolbar.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CAttributeVector.cpp
@@ -17,15 +17,15 @@
        m_attributes.clear();
    }
    void CAttributeVector::addAttribute(CAttribute* pAttribute, BOOL bReplace/* = FALSE*/)
    BOOL CAttributeVector::addAttribute(CAttribute* pAttribute, BOOL bReplace/* = FALSE*/)
    {
        if (!pAttribute) { 
            return;
            return FALSE;
        }
        const std::string& name = pAttribute->getName();
        if (name.empty()) { 
            return;
            return FALSE;
        }
        if (bReplace) {
@@ -41,6 +41,7 @@
        }
        m_attributes.push_back(pAttribute);
        return TRUE;
    }
    void CAttributeVector::addAttributeVector(CAttributeVector& av)
@@ -80,4 +81,9 @@
        ASSERT(index < m_attributes.size());
        return m_attributes[index];
    }
    std::vector<CAttribute*>& CAttributeVector::getAttributes()
    {
        return m_attributes;
    }
}
SourceCode/Bond/Servo/CAttributeVector.h
@@ -11,13 +11,14 @@
        virtual ~CAttributeVector();
    public:
        void addAttribute(CAttribute* pAttribute, BOOL bReplace = FALSE);
        BOOL addAttribute(CAttribute* pAttribute, BOOL bReplace = FALSE);
        void addAttributeVector(CAttributeVector& av);
        void clear();
        void sortWithWeight();
        unsigned int size();
        bool empty();
        CAttribute* getAttribute(unsigned int index);
        std::vector<CAttribute*>& getAttributes();
    private:
        std::vector<CAttribute*> m_attributes;
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -300,7 +300,7 @@
            pStep->setName(pszName[m_nIndex]);
            pStep->setWriteSignalDev(0x128 + m_nIndex);
            pStep->setDataDev(dev[m_nIndex]);
            if (addStep(STEP_ID_PROT1_TYPE_AUTO_CHANGE_REPLY + m_nIndex, pStep) != 0) {
            if (addStep(STEP_ID_PROT1_CASSETTE_TYPE_CHANGE_REPLY + m_nIndex, pStep) != 0) {
                delete pStep;
            }
        }
SourceCode/Bond/Servo/CMaster.cpp
@@ -698,7 +698,7 @@
                // Aligner -> Fliper(G2)
                // Aligner -> VacuumBake(G1)
                if (!rmd.armState[1]) {
                    m_pActiveRobotTask = createTransferTask(pAligner, pFliper, primaryType, secondaryType, 2);
                    m_pActiveRobotTask = createTransferTask(pAligner, pFliper, primaryType, secondaryType);
                    if (m_pActiveRobotTask != nullptr) {
                        m_pActiveRobotTask->pick();
                        std::string strDescription = m_pActiveRobotTask->getDescription();
SourceCode/Bond/Servo/CStep.cpp
@@ -94,9 +94,16 @@
    void CStep::addAttributeVector(CAttributeVector& attributeVector)
    {
        // 添加attribute时,要前删除存在的同名的attribute
        unsigned int size = attributeVector.size();
        for (unsigned int i = 0; i < size; i++) {
            m_attributeVector.addAttribute(attributeVector.getAttribute(i), TRUE);
        std::vector<CAttribute*>& srcs = attributeVector.getAttributes();
        auto it = srcs.begin();
        while (it != srcs.end()) {
            BOOL bAdd = m_attributeVector.addAttribute((*it), TRUE);
            if (bAdd) {
                it = srcs.erase(it);
            }
            else {
                ++it;
            }
        }
    }
SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -19,7 +19,11 @@
CPortConfigurationDlg::CPortConfigurationDlg(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_PORT_CONFIGURATION, pParent)
{
    // 初始化成员变量
    m_pPort[0] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT1));
    m_pPort[1] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT2));
    m_pPort[2] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT3));
    m_pPort[3] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT4));
}
CPortConfigurationDlg::~CPortConfigurationDlg()
@@ -35,6 +39,52 @@
    return -1; // 未知端口
}
void CPortConfigurationDlg::LoadPortConfigToUI(SERVO::CLoadPort* pPort)
{
    if (!pPort) {
        return;
    }
    SetDlgItemText(IDC_EDIT_LOTID, "");
    SetDlgItemText(IDC_EDIT_PRODUCTID, "");
    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::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;
            }
        }
    }
}
void CPortConfigurationDlg::InitGrid()
{
    if (m_wndGrid.GetSafeHwnd() == NULL) {
@@ -43,7 +93,7 @@
    const int nCols = 2;
    const int nFixRows = 1;
    const int nRows = 9;
    const int nRows = SLOT_MAX + 1; // 存在表头,所以 +1
    int nColIdx = 0;
    m_wndGrid.DeleteAllItems();
@@ -64,8 +114,6 @@
    // 设置列宽
    m_wndGrid.SetColumnWidth(nColIdx, 50);
    m_wndGrid.SetItemText(0, nColIdx++, _T("Slot ID"));
    m_wndGrid.SetColumnWidth(nColIdx, 150);
    m_wndGrid.SetItemText(0, nColIdx++, _T("Panel ID"));
    m_wndGrid.SetColumnWidth(nColIdx, 60);
    m_wndGrid.SetItemText(0, nColIdx++, _T("启用"));
@@ -130,6 +178,7 @@
BEGIN_MESSAGE_MAP(CPortConfigurationDlg, CDialogEx)
    ON_CBN_SELCHANGE(IDC_COMBO_PORT, &CPortConfigurationDlg::OnSelchangeComboPort)
    ON_BN_CLICKED(IDC_BUTTON_APPLY, &CPortConfigurationDlg::OnBnClickedButtonApply)
END_MESSAGE_MAP()
@@ -160,14 +209,31 @@
    for (const auto& item : materialTypes) {
        m_comboMaterialsType.AddString(item);
    }
    m_comboMaterialsType.SetCurSel(0); // 默认选择第一个物料类型
    m_comboMaterialsType.SetCurSel(0);  // 默认选择第一个物料类型
    InitGrid();
    LoadPortConfigToUI(m_pPort[0]);     // 默认加载第一个端口的配置
    // 设置对话框标题
    SetWindowText(_T("Port Configuration"));
    return TRUE;  // return TRUE unless you set the focus to a control
    // 异常: OCX 属性页应返回 FALSE
}
void CPortConfigurationDlg::OnSelchangeComboPort()
{
    // TODO: 在此添加控件通知处理程序代码
    int selPort = m_comboPort.GetCurSel();
    if (selPort < 0 || selPort >= 4) {
        return; // 无效选择
    }
    // 加载选中端口的配置到 UI
    LoadPortConfigToUI(m_pPort[selPort]);
}
void CPortConfigurationDlg::OnBnClickedButtonApply()
{
    // TODO: 在此添加控件通知处理程序代码
SourceCode/Bond/Servo/PortConfigurationDlg.h
@@ -1,6 +1,7 @@
#pragma once
#include "afxdialogex.h"
#include "GridCtrl.h"
#include "CLoadPort.h"
// CPortConfigurationDlg 对话框
@@ -20,14 +21,18 @@
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
    virtual BOOL OnInitDialog();
    afx_msg void OnSelchangeComboPort();
    afx_msg void OnBnClickedButtonApply();
    DECLARE_MESSAGE_MAP()
private:
    int GetLoadPortEqID(const std::string& strPortName);
    void LoadPortConfigToUI(SERVO::CLoadPort* pPort);
    void InitGrid();
    void FillGrid();
    SERVO::CLoadPort* m_pPort[4];
    CGridCtrl m_wndGrid;
    CComboBox m_comboPort;
    CComboBox m_comboRecipe;
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -21,6 +21,7 @@
#include "SystemLogManagerDlg.h"
#include "UserManager.h"
#include "SystemLogManager.h"
#include "PortConfigurationDlg.h"
#ifdef _DEBUG
@@ -885,6 +886,10 @@
            m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
        }
    }
    else if (id == IDC_BUTTON_PORT_CONFIG) {
        CPortConfigurationDlg dlg;
        dlg.DoModal();
    }
    else if (id == IDC_BUTTON_ROBOT) {
        theApp.m_model.getMaster().clearError();
        SERVO::CEFEM* pEFEM = (SERVO::CEFEM*)theApp.m_model.getMaster().getEquipment(EQ_ID_EFEM);
SourceCode/Bond/Servo/TopToolbar.cpp
@@ -30,6 +30,7 @@
    DDX_Control(pDX, IDC_BUTTON_STOP, m_btnStop);
    DDX_Control(pDX, IDC_BUTTON_ALARM, m_btnAlarm);
    DDX_Control(pDX, IDC_BUTTON_SETTINGS, m_btnSettings);
    DDX_Control(pDX, IDC_BUTTON_PORT_CONFIG, m_btnPortConfig);
    DDX_Control(pDX, IDC_BUTTON_ROBOT, m_btnRobot);
    DDX_Control(pDX, IDC_BUTTON_OPERATOR, m_btnOperator);
}
@@ -55,6 +56,7 @@
    InitBtn(m_btnAlarm, "Alarm_o_32.ico", "Alarm_gray_32.ico");
    InitBtn(m_btnSettings, "Settings_High_32.ico", "Settings_Gray_32.ico");
    InitBtn(m_btnRobot, "Robot_High_32.ico", "Robot_Gray_32.ico");
    InitBtn(m_btnPortConfig, "PortConfig_High_32.ico", "PortConfig_Gray_32.ico");
    InitBtn(m_btnOperator, "Operator_High_32.ico", "Operator_Gray_32.ico");
    HMENU hMenu = LoadMenu(AfxGetInstanceHandle(), MAKEINTRESOURCEA(IDR_MENU_OPEATOR));
    m_btnOperator.SetMenu(hMenu);
@@ -133,6 +135,11 @@
    x += BTN_WIDTH;
    x += 2;
    pItem = GetDlgItem(IDC_BUTTON_PORT_CONFIG);
    pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
    x += BTN_WIDTH;
    x += 2;
    pItem = GetDlgItem(IDC_BUTTON_ROBOT);
    pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
    x += BTN_WIDTH;
@@ -186,6 +193,7 @@
    case IDC_BUTTON_STOP:
    case IDC_BUTTON_ALARM:
    case IDC_BUTTON_SETTINGS:
    case IDC_BUTTON_PORT_CONFIG:
    case IDC_BUTTON_ROBOT:
        GetParent()->SendMessage(ID_MSG_TOOLBAR_BTN_CLICKED, 0, LOWORD(wParam));
        break;
SourceCode/Bond/Servo/TopToolbar.h
@@ -34,6 +34,7 @@
    CBlButton m_btnStop;
    CBlButton m_btnAlarm;
    CBlButton m_btnSettings;
    CBlButton m_btnPortConfig;
    CBlButton m_btnRobot;
    CBlButton m_btnOperator;
SourceCode/Bond/Servo/resource.h
Binary files differ