1. [TaskControl] 添加设备启用状态判断(IsEnabled)
2. 在多个工艺任务(如 bake_to_cooling、bond_to_bake 等)中增加 psrEq->IsEnabled() 判断
已修改7个文件
62 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEquipment.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMaster.cpp 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageLinkSignal.cpp 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageLinkSignal.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp
@@ -11,6 +11,7 @@
    CEquipment::CEquipment() : m_nID(0), m_strName(""), m_strDescription(""), m_station(0, 255)
    {
        m_bEnable = TRUE;
        m_listener = { };
        m_alive = { FALSE, 0, FALSE };
        m_bCimState = FALSE;
@@ -56,6 +57,16 @@
        DeleteCriticalSection(&m_criticalSection);
    }
    void CEquipment::SetEnable(BOOL bEnable)
    {
        m_bEnable = bEnable;
    }
    BOOL CEquipment::IsEnabled() const
    {
        return m_bEnable;
    }
    void CEquipment::setListener(EquipmentListener listener)
    {
        m_listener = listener;
SourceCode/Bond/Servo/CEquipment.h
@@ -76,6 +76,8 @@
        virtual ~CEquipment();
    public:
        void SetEnable(BOOL bEnable);
        BOOL IsEnabled() const;
        virtual const char* getClassName() = 0;
        virtual void setListener(EquipmentListener listener);
        void setCcLink(CCCLinkIEControl* pCcLink);
@@ -248,6 +250,7 @@
        void setProcessState(PROCESS_STATE state);
    protected:
        BOOL m_bEnable;
        EquipmentListener m_listener;
        int m_nID;
        std::string m_strName;
SourceCode/Bond/Servo/CMaster.cpp
@@ -1409,6 +1409,10 @@
        MaterialsType primaryType/* = MaterialsType::G1*/, MaterialsType secondaryType/* = MaterialsType::G2*/,
        int armNo/* = 1*/)
    {
        if (!pSrcEq->IsEnabled()) {
            return nullptr;
        }
        CRobotTask* pTask = nullptr;
        CSlot* pSrcSlot, * pTarSlot;
        pTarSlot = pTarEq->getAvailableSlotForGlass(primaryType);
@@ -1433,6 +1437,10 @@
    CRobotTask* CMaster::createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq)
    {
        if (!pSrcEq->IsEnabled()) {
            return nullptr;
        }
        std::vector<int> slots = {1, 3};
        CRobotTask* pTask = nullptr;
@@ -1454,6 +1462,10 @@
    CRobotTask* CMaster::createTransferTask_bake_to_cooling(CEquipment* pSrcEq)
    {
        if (!pSrcEq->IsEnabled()) {
            return nullptr;
        }
        std::vector<int> slotsTar = { 2, 4 };
        std::vector<int> slotsSrc = { 1, 3 };
@@ -1476,6 +1488,10 @@
    CRobotTask* CMaster::createTransferTask_bakecooling_to_measurement(CEquipment* pSrcEq, CEquipment* pTarEq)
    {
        if (!pSrcEq->IsEnabled()) {
            return nullptr;
        }
        std::vector<int> slots = { 2, 4 };
        CRobotTask* pTask = nullptr;
@@ -1497,6 +1513,10 @@
    CRobotTask* CMaster::createTransferTask_restore(CEquipment* pEqSrc, CLoadPort** pPorts)
    {
        if (!pEqSrc->IsEnabled()) {
            return nullptr;
        }
        CRobotTask* pTask = nullptr;
        CSlot* pSrcSlot, * pTarSlot = nullptr, * pTempSlot;
        pSrcSlot = pEqSrc->getInspFailSlot();
SourceCode/Bond/Servo/CPageLinkSignal.cpp
@@ -19,6 +19,7 @@
CPageLinkSignal::CPageLinkSignal(CWnd* pParent /*=nullptr*/)
    : CHMPropertyPage(IDD_PAGE_LINK_SIGNAL, pParent)
    , m_bEnable(TRUE)
{
    m_pEquipment = nullptr;
}
@@ -30,6 +31,7 @@
void CPageLinkSignal::DoDataExchange(CDataExchange* pDX)
{
    CHMPropertyPage::DoDataExchange(pDX);
    DDX_Check(pDX, IDC_CHECK_ENABLE, m_bEnable);
}
@@ -38,6 +40,7 @@
    ON_WM_DESTROY()
    ON_WM_SIZE()
    ON_WM_TIMER()
    ON_BN_CLICKED(IDC_CHECK_ENABLE, &CPageLinkSignal::OnClickedCheckEnable)
END_MESSAGE_MAP()
@@ -56,6 +59,12 @@
    KillTimer(TIMER_ID_SIGNAL_UPDATE);
    SetTimer(TIMER_ID_SIGNAL_UPDATE, TIMER_INTERVAL_MS, nullptr);
    if (m_pEquipment) {
        m_bEnable = m_pEquipment->IsEnabled();
        UpdateData(FALSE);
    }
    return TRUE;  // return TRUE unless you set the focus to a control
                  // 异常: OCX 属性页应返回 FALSE
@@ -139,6 +148,14 @@
            BTN_Y - 36,
            rcItem.Width(), rcItem.Height());
    }
    pItem = GetDlgItem(IDC_CHECK_ENABLE);
    if (pItem) {
        int nCheckboxX = max(0, BTN_X - 50);
        int nCheckboxY = max(0, BTN_Y - rcItem.Height() - 30);
        pItem->GetWindowRect(&rcItem);
        pItem->MoveWindow(nCheckboxX, nCheckboxY, rcItem.Width(), rcItem.Height());
    }
}
void CPageLinkSignal::OnTimer(UINT_PTR nIDEvent)
@@ -158,7 +175,7 @@
    for (int nRow = 0; nRow < 8; ++nRow) {
        for (int nCol = 0; nCol < 8; ++nCol) {
            BOOL bCurrentState = m_pEquipment->isLinkSignalUpstreamOn(nRow, nCol);
            BOOL bCurrentState = m_pEquipment->isLinkSignalUpstreamOn(nRow, nCol) && m_pEquipment->IsEnabled();
            UpdateSignalState(nRow, nCol, bCurrentState);
        }
    }
@@ -177,4 +194,9 @@
    }
}
void CPageLinkSignal::OnClickedCheckEnable()
{
    // TODO: 在此添加控件通知处理程序代码
    UpdateData(TRUE);
    m_pEquipment->SetEnable(m_bEnable);
}
SourceCode/Bond/Servo/CPageLinkSignal.h
@@ -21,6 +21,7 @@
private:
    SERVO::CEquipment* m_pEquipment;
    CBlButton* m_pBtn[8][8];
    BOOL m_bEnable;
// 对话框数据
#ifdef AFX_DESIGN_TIME
@@ -37,4 +38,5 @@
    afx_msg void OnDestroy();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg void OnClickedCheckEnable();
};
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/resource.h
Binary files differ