#include "stdafx.h" #include "CAligner.h" namespace SERVO { CAligner::CAligner() : CEquipment() { } CAligner::~CAligner() { } const char* CAligner::getClassName() { static char* pszName = "CAligner"; return pszName; } void CAligner::init() { CEquipment::init(); } void CAligner::term() { CEquipment::term(); } // ±ØÐëҪʵÏÖµÄÐ麯Êý£¬Ôڴ˳õʼ»¯PinÁбí void CAligner::initPins() { // ¼ÓÈëPin³õʼ»¯´úÂë LOGI("initPins"); addPin(SERVO::PinType::INPUT, _T("In1")); addPin(SERVO::PinType::INPUT, _T("In2")); addPin(SERVO::PinType::OUTPUT, _T("Out1")); addPin(SERVO::PinType::OUTPUT, _T("Out2")); } // ±ØÐëҪʵÏÖµÄÐ麯Êý£¬Ôڴ˳õʼ»¯SlotÐÅÏ¢ void CAligner::initSlots() { m_slot[0].enable(); m_slot[0].setPosition(m_nID); m_slot[0].setNo(1); m_slot[0].setName("Slot 1"); } void CAligner::onTimer(UINT nTimerid) { CEquipment::onTimer(nTimerid); } void CAligner::serialize(CArchive& ar) { CEquipment::serialize(ar); } void CAligner::getAttributeVector(CAttributeVector& attrubutes) { __super::getAttributeVector(attrubutes); } int CAligner::recvIntent(CPin* pPin, CIntent* pIntent) { return __super::recvIntent(pPin, pIntent); } BOOL CAligner::glassWillArrive(CGlass* pGlass) { BOOL bRet = __super::glassWillArrive(pGlass); if (!bRet) { return FALSE; } return m_glassList.empty(); } BOOL CAligner::onPreStoredJob(int port, CJobDataB* pJobDataB) { CJobDataS* pJobDataS = getJobDataS(pJobDataB->getCassetteSequenceNo(), pJobDataB->getJobSequenceNo()); if (pJobDataS == nullptr) { LOGE("onPreFetchedOutJob,ÕÒ²»µ½¶ÔÓ¦µÄJobDataS(CassetteSequenceNo:%d, JobSequenceNo:%d), ×¢ÒâÅŲé·çÏÕ!", m_strName.c_str(), pJobDataB->getCassetteSequenceNo(), pJobDataB->getJobSequenceNo()); return FALSE; } // Ö»ÄÜһƬһƬµÄ¶Ôλ Lock(); if (!m_glassList.empty()) { Unlock(); LOGE("onPreFetchedOutJob,µ±Ç°»úÆ÷»òµ¥Ôª´æÔÚ²£Á§Æ¬£¬²»ÄܽøÁÏ£¬Çë×¢Òâ·çÏÕ£¡", m_strName.c_str()); return FALSE; } return TRUE; } }