| | |
| | | void CEquipment::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | attrubutes.clear(); |
| | | |
| | | unsigned int weight = 0; |
| | | attrubutes.addAttribute(new CAttribute("Network", |
| | | std::to_string(m_station.nNetNo).c_str(), "")); |
| | | std::to_string(m_station.nNetNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Station", |
| | | std::to_string(m_station.nStNo).c_str(), "")); |
| | | std::to_string(m_station.nStNo).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("ID", |
| | | std::to_string(m_nID).c_str(), "")); |
| | | std::to_string(m_nID).c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Name", |
| | | m_strName.c_str(), "")); |
| | | m_strName.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Description", |
| | | m_strDescription.c_str(), "")); |
| | | m_strDescription.c_str(), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Alive", |
| | | this->isAlive() ? _T("TRUE") : _T("FALSE"), "")); |
| | | this->isAlive() ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("CIM State", |
| | | m_bCimState ? _T("ON") : _T("OFF"), "")); |
| | | m_bCimState ? _T("ON") : _T("OFF"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Upstream", |
| | | m_bUpstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | m_bUpstreamInline ? _T("Inline") : _T("Offline"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Downstream", |
| | | m_bDownstreamInline ? _T("Inline") : _T("Offline"), "")); |
| | | m_bDownstreamInline ? _T("Inline") : _T("Offline"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Local Alarm", |
| | | m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "")); |
| | | m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | attrubutes.addAttribute(new CAttribute("Auto Recipe Change", |
| | | m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "")); |
| | | m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "", weight++)); |
| | | char szTemp[256]; |
| | | for (int i = 0; i < VCR_MAX; i++) { |
| | | sprintf_s(szTemp, 256, "VCR-%d", i + 1); |
| | | attrubutes.addAttribute(new CAttribute(szTemp, |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "")); |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_inputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | std::to_string((int)item->getType()).c_str(), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_outputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | std::to_string((int)item->getType()).c_str(), "", weight++)); |
| | | } |
| | | |
| | | for (auto item : m_glassList) { |
| | | attrubutes.addAttribute(new CAttribute("Glass", |
| | | item->getID().c_str(), "")); |
| | | item->getID().c_str(), "", weight++)); |
| | | } |
| | | } |
| | | |
| | |
| | | return m_recipesManager.decodeRecipeParameterReport(pszData, size); |
| | | } |
| | | |
| | | int CEquipment::decodeFetchedOutJobReport(int port, const char* pszData, size_t size) |
| | | int CEquipment::decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo; |
| | | CJobDataB jobDataB; |
| | | int nRet = jobDataB.unserialize(&pszData[index], size); |
| | | int nRet = jobDataB.unserialize(&pszData[index], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | index += nRet; |
| | | |
| | |
| | | index += sizeof(short); |
| | | memcpy(&subSlotNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | |
| | | // 缓存Attribute,用于调试时显示信息 |
| | | unsigned int weight = 201; |
| | | pStep->addAttribute(new CAttribute("UnitOrPort", |
| | | std::to_string(unitOrPort).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("UnitOrPortNo", |
| | | std::to_string(unitOrPortNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubUnitNo", |
| | | std::to_string(subUnitNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubSlotNo", |
| | | std::to_string(subSlotNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("GlassId", |
| | | jobDataB.getGlassId().c_str(), "", weight++)); |
| | | |
| | | |
| | | onFetchedOut(port, jobDataB.getGlassId().c_str()); |
| | | |
| | |
| | | |
| | | int CEquipment::onFetchedOut(int port, const char* pszGlassId) |
| | | { |
| | | LOGI("<CEquipment-%s>onFetchedOut:port:%d|GlassId:%s", |
| | | m_strName.c_str(), port, pszGlassId); |
| | | return fetchedOut(pszGlassId); |
| | | } |
| | | |
| | | int CEquipment::decodeStoredJobReport(int port, const char* pszData, size_t size) |
| | | int CEquipment::decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo; |
| | | CJobDataB jobDataB; |
| | | int nRet = jobDataB.unserialize(&pszData[index], size); |
| | | int nRet = jobDataB.unserialize(&pszData[index], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | index += nRet; |
| | | |
| | |
| | | memcpy(&subSlotNo, &pszData[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | |
| | | // 缓存Attribute,用于调试时显示信息 |
| | | unsigned int weight = 201; |
| | | pStep->addAttribute(new CAttribute("UnitOrPort", |
| | | std::to_string(unitOrPort).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("UnitOrPortNo", |
| | | std::to_string(unitOrPortNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubUnitNo", |
| | | std::to_string(subUnitNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("SubSlotNo", |
| | | std::to_string(subSlotNo).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++)); |
| | | pStep->addAttribute(new CAttribute("GlassId", |
| | | jobDataB.getGlassId().c_str(), "", weight++)); |
| | | |
| | | |
| | | onStore(port, jobDataB.getGlassId().c_str()); |
| | | |
| | | return index; |
| | |
| | | |
| | | int CEquipment::onStore(int port, const char* pszGlassId) |
| | | { |
| | | LOGI("<CEquipment-%s>onStore:port:%d|GlassId:%s", |
| | | m_strName.c_str(), port, pszGlassId); |
| | | return storedJob(pszGlassId); |
| | | } |
| | | } |