| | |
| | | if (!m_slot[i].isEnable()) continue; |
| | | |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | CGlass* pBuddy = nullptr; |
| | | if (pGlass == nullptr) { |
| | | attrubutes.addAttribute(new CAttribute(m_slot[i].getName().c_str(), |
| | | "", "", weight++)); |
| | | } |
| | | else { |
| | | attrubutes.addAttribute(new CAttribute(m_slot[i].getName().c_str(), |
| | | pGlass->getID().c_str(), "", weight++)); |
| | | pBuddy = pGlass->getBuddy(); |
| | | if (pBuddy == nullptr) { |
| | | attrubutes.addAttribute(new CAttribute(m_slot[i].getName().c_str(), |
| | | pGlass->getID().c_str(), "", weight++)); |
| | | } |
| | | else { |
| | | attrubutes.addAttribute(new CAttribute(m_slot[i].getName().c_str(), |
| | | (pGlass->getID() + " -> " + pBuddy->getID()).c_str(), "", weight++)); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | Lock(); |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | m_slot[i].serialize(ar); |
| | | if (m_slot[i].getContext() != nullptr) { |
| | | ((CGlass*)m_slot[i].getContext())->serialize(ar); |
| | | CGlass* pGlass = (CGlass *)m_slot[i].getContext(); |
| | | if (pGlass != nullptr) { |
| | | pGlass->serialize(ar); |
| | | CGlass* pBuddy = pGlass->getBuddy(); |
| | | if (pBuddy != nullptr) { |
| | | pBuddy->serialize(ar); |
| | | } |
| | | } |
| | | } |
| | | Unlock(); |
| | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->serialize(ar); |
| | | m_slot[i].setContext(pGlass); |
| | | if (pGlass->getBuddy() != nullptr) { |
| | | CGlass* pBuddy = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pBuddy->serialize(ar); |
| | | pGlass->forceSetBuddy(pBuddy); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 梳理各玻璃之间的绑定关系 |
| | | /* |
| | | Lock(); |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | |
| | | } |
| | | } |
| | | Unlock(); |
| | | */ |
| | | } |
| | | } |
| | | |
| | |
| | | return -3; |
| | | } |
| | | |
| | | // 如果此玻璃已经贴合,贴合的玻璃也要从列表中移除 |
| | | CGlass* pBuddy = pContext->getBuddy(); |
| | | if (pBuddy != nullptr) { |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | if (pGlass != nullptr && compareJobDataB(pBuddy->getJobDataB(), pGlass->getJobDataB())) { |
| | | m_slot[i].setContext(nullptr); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | ((CArm*)m_pArm)->tempStore(pContext); |
| | | pContext->release(); |
| | |
| | | |
| | | |
| | | // 如果此玻璃已经贴合,贴合的玻璃也要从加入到列表中 |
| | | /* |
| | | CGlass* pBuddy = pGlass->getBuddy(); |
| | | if (pBuddy != nullptr) { |
| | | Lock(); |
| | |
| | | } |
| | | Unlock(); |
| | | } |
| | | |
| | | */ |
| | | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, EDCC_STORED_JOB); |