1.Path增加Unit,因为BakeCooling比较特殊,它分为烧烤笔冷却,相当于两单元
| | |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | virtual short getSlotUnit(short slot) { return slot <= 2 ? 0 : 1; }; |
| | | }; |
| | | } |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::storedJob(CJobDataB* pJobDataB, short& putSlot) |
| | | int CEquipment::storedJob(CJobDataB* pJobDataB, short putSlot) |
| | | { |
| | | if (m_pArm == nullptr) { |
| | | return -1; |
| | |
| | | |
| | | ASSERT(pGlass); |
| | | Lock(); |
| | | pGlass->addPath(m_nID); |
| | | pGlass->addPath(m_nID, getSlotUnit(putSlot)); |
| | | m_slot[putSlot - 1].setContext(pGlass); |
| | | pGlass->release(); // tempFetchOut需要调用一次release |
| | | Unlock(); |
| | |
| | | CGlass* pBuddy = pGlass->getBuddy(); |
| | | if (pBuddy != nullptr) { |
| | | Lock(); |
| | | pBuddy->addPath(m_nID); |
| | | pBuddy->addPath(m_nID, 0); |
| | | if (putSlot % 2 == 0) { |
| | | m_slot[putSlot - 2].setContext(pBuddy); |
| | | } |
| | |
| | | MaterialsType glassType = pGlass->getType(); |
| | | if (glassType == MaterialsType::G1 && putSlotType == MaterialsType::G2) continue; |
| | | if (glassType == MaterialsType::G2 && putSlotType == MaterialsType::G1) continue; |
| | | if (!pGlass->isProcessed(m_nID)) continue; |
| | | if (!pGlass->isProcessed(m_nID, 0)) continue; |
| | | |
| | | return &m_slot[i]; |
| | | } |
| | |
| | | int CEquipment::onProcessData(CProcessData* pProcessData) |
| | | { |
| | | LOGI("<CEquipment-%s>onProcessData.", m_strName.c_str()); |
| | | CGlass* pGlass = getGlass(pProcessData->getGlassId().c_str()); |
| | | if (pGlass != nullptr) { |
| | | pGlass->processEnd(m_nID); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | |
| | | virtual void onReceiveLBData(const char* pszData, size_t size); |
| | | virtual int onStepEvent(CStep* pStep, int code); |
| | | virtual CPin* addPin(PinType type, char* pszName); |
| | | virtual short getSlotUnit(short slot) { return 0; }; |
| | | CPin* getPin(char* pszName); |
| | | std::vector<CPin*>& CEquipment::getInputPins(); |
| | | std::vector<CPin*>& CEquipment::getOutputPins(); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual int fetchedOutJob(CJobDataB* pJobDataB); |
| | | virtual int storedJob(CJobDataB* pJobDataB, short& putSlot); |
| | | virtual int storedJob(CJobDataB* pJobDataB, short putSlot); |
| | | virtual int onReceivedJob(int port, CJobDataS* pJobDataS); |
| | | virtual int onSentOutJob(int port, CJobDataS* pJobDataS); |
| | | virtual BOOL onPreFetchedOutJob(int port, CJobDataB* pJobDataB); |
| | |
| | | return m_strID; |
| | | } |
| | | |
| | | CPath* CGlass::getPathWithSiteID(unsigned int nSiteId) |
| | | { |
| | | CPath* pPath = m_pPath; |
| | | while (pPath != nullptr) { |
| | | if (nSiteId == pPath->getSiteID()) { |
| | | return pPath; |
| | | } |
| | | pPath = pPath->getNext(); |
| | | } |
| | | |
| | | return nullptr; |
| | | } |
| | | |
| | | CPath* CGlass::getPath() |
| | | { |
| | | return m_pPath; |
| | | } |
| | | |
| | | CPath* CGlass::getPathWithSiteId(unsigned int nSiteId) |
| | | CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit) |
| | | { |
| | | CPath* pTemp = m_pPath; |
| | | while (pTemp != nullptr) { |
| | | if (pTemp->getSiteID() == nSiteId) { |
| | | if (pTemp->getEqID() == nEqId && pTemp->getUnit() == nUnit) { |
| | | return pTemp; |
| | | } |
| | | |
| | |
| | | return nullptr; |
| | | } |
| | | |
| | | void CGlass::addPath(unsigned int nSiteId) |
| | | void CGlass::addPath(unsigned int nEqId, unsigned int nUnit) |
| | | { |
| | | CPath* pPath = new CPath(nSiteId); |
| | | CPath* pPath = new CPath(nEqId, nUnit); |
| | | if (m_pPath == nullptr) { |
| | | m_pPath = pPath; |
| | | } |
| | |
| | | return m_strBuddyId; |
| | | } |
| | | |
| | | void CGlass::processEnd(unsigned int nSiteId) |
| | | void CGlass::processEnd(unsigned int nEqId, unsigned int nUnit) |
| | | { |
| | | CPath* pPath = getPathWithSiteID(nSiteId); |
| | | CPath* pPath = getPathWithEq(nEqId, nUnit); |
| | | if (pPath != nullptr) { |
| | | pPath->processEnd(); |
| | | } |
| | | } |
| | | |
| | | BOOL CGlass::isProcessed(unsigned int nSiteId) |
| | | BOOL CGlass::isProcessed(unsigned int nEqId, unsigned int nUnit) |
| | | { |
| | | CPath* pPath = getPathWithSiteID(nSiteId); |
| | | CPath* pPath = getPathWithEq(nEqId, nUnit); |
| | | if (pPath == nullptr) return FALSE; |
| | | |
| | | return pPath->isProcessEnd(); |
| | |
| | | void setType(MaterialsType type); |
| | | void setID(const char* pszID); |
| | | std::string& getID(); |
| | | CPath* getPathWithSiteID(unsigned int nSiteId); |
| | | CPath* getPathWithEq(unsigned int nEqId, unsigned int nUnit); |
| | | CPath* getPath(); |
| | | CPath* getPathWithSiteId(unsigned int nSiteId); |
| | | void addPath(unsigned int nSiteId); |
| | | void addPath(unsigned int nEqId, unsigned int nUnit); |
| | | void serialize(CArchive& ar); |
| | | void setJobDataB(CJobDataB* pJobDataB); |
| | | CJobDataB* getJobDataB(); |
| | |
| | | BOOL setBuddy(CGlass* pGlass); |
| | | CGlass* getBuddy(); |
| | | std::string& getBuddyId(); |
| | | void processEnd(unsigned int nSiteId); |
| | | BOOL isProcessed(unsigned int nSiteId); |
| | | void processEnd(unsigned int nEqId, unsigned int nUnit); |
| | | BOOL isProcessed(unsigned int nEqId, unsigned int nUnit); |
| | | |
| | | private: |
| | | MaterialsType m_type; |
| | |
| | | } |
| | | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->addPath(m_nID); |
| | | pGlass->processEnd(m_nID); |
| | | pGlass->addPath(m_nID, 0); |
| | | pGlass->processEnd(m_nID, 0); |
| | | pGlass->setID(szBuffer); |
| | | pGlass->setJobDataB(&jb); |
| | | pGlass->setType(type); |
| | |
| | | namespace SERVO { |
| | | CPath::CPath() |
| | | { |
| | | m_nSiteID = 0; |
| | | m_nEqID = 0; |
| | | m_timeOut = 0; |
| | | m_timeIn = CToolUnits::getTimestamp(); |
| | | m_bProcessed = FALSE; |
| | |
| | | m_pNext = nullptr; |
| | | } |
| | | |
| | | CPath::CPath(unsigned int nSiteId) |
| | | CPath::CPath(unsigned int nEqId, unsigned int nUnit) |
| | | { |
| | | m_nSiteID = nSiteId; |
| | | m_nEqID = nEqId; |
| | | m_nUnit = nUnit; |
| | | m_timeOut = 0; |
| | | m_timeIn = CToolUnits::getTimestamp(); |
| | | m_pPrev = nullptr; |
| | |
| | | void CPath::getDescription(std::string& strOut) |
| | | { |
| | | strOut.clear(); |
| | | strOut = "CPath<SiteID:"; |
| | | strOut = strOut + std::to_string(m_nSiteID); |
| | | strOut = "CPath<EqID:"; |
| | | strOut = strOut + std::to_string(m_nEqID); |
| | | strOut = strOut + ",Unit:"; |
| | | strOut = strOut + std::to_string(m_nUnit); |
| | | strOut = strOut + ",InTime:"; |
| | | strOut = strOut + CToolUnits::timeToString2(m_timeIn); |
| | | strOut = strOut + ",OutTime:"; |
| | |
| | | void CPath::serialize(CArchive& ar) |
| | | { |
| | | if (ar.IsStoring()) { |
| | | ar << m_nSiteID; |
| | | ar << m_nEqID; |
| | | ar << m_nUnit; |
| | | ar << m_timeIn; |
| | | ar << m_timeOut; |
| | | ar << m_bProcessed; |
| | |
| | | } |
| | | } |
| | | else { |
| | | ar >> m_nSiteID; |
| | | ar >> m_nEqID; |
| | | ar >> m_nUnit; |
| | | ar >> m_timeIn; |
| | | ar >> m_timeOut; |
| | | ar >> m_bProcessed; |
| | |
| | | } |
| | | } |
| | | |
| | | unsigned int CPath::getSiteID() |
| | | unsigned int CPath::getEqID() |
| | | { |
| | | return m_nSiteID; |
| | | return m_nEqID; |
| | | } |
| | | |
| | | unsigned int CPath::getUnit() |
| | | { |
| | | return m_nUnit; |
| | | } |
| | | |
| | | ULONGLONG CPath::getInTime() |
| | |
| | | { |
| | | public: |
| | | CPath(); |
| | | CPath(unsigned int nSiteId); |
| | | CPath(unsigned int nEqId, unsigned int nUnit); |
| | | virtual ~CPath(); |
| | | |
| | | public: |
| | |
| | | void addPath(CPath* pPath); |
| | | CPath* getTailPath(); |
| | | CPath* getHeadPath(); |
| | | unsigned int getSiteID(); |
| | | unsigned int getEqID(); |
| | | unsigned int getUnit(); |
| | | ULONGLONG getInTime(); |
| | | void setOutTime(ULONGLONG time); |
| | | ULONGLONG getOutTime(); |
| | |
| | | BOOL isProcessEnd(); |
| | | |
| | | private: |
| | | unsigned int m_nSiteID; |
| | | unsigned int m_nEqID; |
| | | unsigned int m_nUnit; |
| | | ULONGLONG m_timeIn; |
| | | ULONGLONG m_timeOut; |
| | | BOOL m_bProcessed; |