1. [TaskControl] 添加设备启用状态判断(IsEnabled)
2. 在多个工艺任务(如 bake_to_cooling、bond_to_bake 等)中增加 psrEq->IsEnabled() 判断
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | virtual ~CEquipment(); |
| | | |
| | | public: |
| | | void SetEnable(BOOL bEnable); |
| | | BOOL IsEnabled() const; |
| | | virtual const char* getClassName() = 0; |
| | | virtual void setListener(EquipmentListener listener); |
| | | void setCcLink(CCCLinkIEControl* pCcLink); |
| | |
| | | void setProcessState(PROCESS_STATE state); |
| | | |
| | | protected: |
| | | BOOL m_bEnable; |
| | | EquipmentListener m_listener; |
| | | int m_nID; |
| | | std::string m_strName; |
| | |
| | | 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); |
| | |
| | | |
| | | CRobotTask* CMaster::createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq) |
| | | { |
| | | if (!pSrcEq->IsEnabled()) { |
| | | return nullptr; |
| | | } |
| | | |
| | | std::vector<int> slots = {1, 3}; |
| | | |
| | | CRobotTask* pTask = nullptr; |
| | |
| | | |
| | | 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 }; |
| | | |
| | |
| | | |
| | | CRobotTask* CMaster::createTransferTask_bakecooling_to_measurement(CEquipment* pSrcEq, CEquipment* pTarEq) |
| | | { |
| | | if (!pSrcEq->IsEnabled()) { |
| | | return nullptr; |
| | | } |
| | | |
| | | std::vector<int> slots = { 2, 4 }; |
| | | |
| | | CRobotTask* pTask = nullptr; |
| | |
| | | |
| | | CRobotTask* CMaster::createTransferTask_restore(CEquipment* pEqSrc, CLoadPort** pPorts) |
| | | { |
| | | if (!pEqSrc->IsEnabled()) { |
| | | return nullptr; |
| | | } |
| | | |
| | | CRobotTask* pTask = nullptr; |
| | | CSlot* pSrcSlot, * pTarSlot = nullptr, * pTempSlot; |
| | | pSrcSlot = pEqSrc->getInspFailSlot(); |
| | |
| | | |
| | | CPageLinkSignal::CPageLinkSignal(CWnd* pParent /*=nullptr*/) |
| | | : CHMPropertyPage(IDD_PAGE_LINK_SIGNAL, pParent) |
| | | , m_bEnable(TRUE) |
| | | { |
| | | m_pEquipment = nullptr; |
| | | } |
| | |
| | | void CPageLinkSignal::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | | CHMPropertyPage::DoDataExchange(pDX); |
| | | DDX_Check(pDX, IDC_CHECK_ENABLE, m_bEnable); |
| | | } |
| | | |
| | | |
| | |
| | | ON_WM_DESTROY() |
| | | ON_WM_SIZE() |
| | | ON_WM_TIMER() |
| | | ON_BN_CLICKED(IDC_CHECK_ENABLE, &CPageLinkSignal::OnClickedCheckEnable) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | |
| | | 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 |
| | |
| | | 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) |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | void CPageLinkSignal::OnClickedCheckEnable() |
| | | { |
| | | // TODO: 在此添加控件通知处理程序代码 |
| | | UpdateData(TRUE); |
| | | m_pEquipment->SetEnable(m_bEnable); |
| | | } |
| | |
| | | private: |
| | | SERVO::CEquipment* m_pEquipment; |
| | | CBlButton* m_pBtn[8][8]; |
| | | BOOL m_bEnable; |
| | | |
| | | // 对话框数据 |
| | | #ifdef AFX_DESIGN_TIME |
| | |
| | | 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(); |
| | | }; |