| | |
| | | static int writeSignalDev[] = { 0xa0, 0xa1, 0xa2, 0xa3 }; |
| | | static int addr[] = { STEP_ID_PORT1_TYPE_CHANGE, STEP_ID_PORT2_TYPE_CHANGE, STEP_ID_PORT3_TYPE_CHANGE, STEP_ID_PORT4_TYPE_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_nType = (unsigned int)CToolUnits::toInt16(pszData); |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | |
| | | static int writeSignalDev[] = { 0xa8, 0xa9, 0xaa, 0xab }; |
| | | static int addr[] = { STEP_ID_PORT1_MODE_CHANGE, STEP_ID_PORT2_MODE_CHANGE, STEP_ID_PORT3_MODE_CHANGE, STEP_ID_PORT4_MODE_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_nMode = (unsigned int)CToolUnits::toInt16(pszData); |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | |
| | | static int writeSignalDev[] = { 0xb0, 0xb1, 0xb2, 0xb3 }; |
| | | static int addr[] = { STEP_ID_PORT1_CASSETTE_TYPE_CHANGE, STEP_ID_PORT2_CASSETTE_TYPE_CHANGE, STEP_ID_PORT3_CASSETTE_TYPE_CHANGE, STEP_ID_PORT4_CASSETTE_TYPE_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_nCassetteType = (unsigned int)CToolUnits::toInt16(pszData); |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | |
| | | static int writeSignalDev[] = { 0xb8, 0xb9, 0xba, 0xbb }; |
| | | static int addr[] = { STEP_ID_PORT1_TRANSFER_MODE_CHANGE, STEP_ID_PORT2_TRANSFER_MODE_CHANGE, STEP_ID_PORT3_TRANSFER_MODE_CHANGE, STEP_ID_PORT4_TRANSFER_MODE_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_nTransferMode = (unsigned int)CToolUnits::toInt16(pszData); |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | |
| | | static int writeSignalDev[] = { 0xc0, 0xc1, 0xc2, 0xc3 }; |
| | | static int addr[] = { STEP_ID_PORT1_ENABLE_MODE_CHANGE, STEP_ID_PORT2_ENABLE_MODE_CHANGE, STEP_ID_PORT3_ENABLE_MODE_CHANGE, STEP_ID_PORT4_ENABLE_MODE_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_bEnable = (unsigned int)CToolUnits::toInt16(pszData) == 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | |
| | | static int writeSignalDev[] = { 0xc8, 0xc9, 0xca, 0xcb }; |
| | | static int addr[] = { STEP_ID_PORT1_TYPE_AUTO_CHANGE, STEP_ID_PORT2_TYPE_AUTO_CHANGE, STEP_ID_PORT3_TYPE_AUTO_CHANGE, STEP_ID_PORT4_TYPE_AUTO_CHANGE }; |
| | | |
| | | CEqReadIntStep* pStep = new CEqReadIntStep(__INT16, dev[m_nIndex]); |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], sizeof(short), |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | m_bAutoChangeEnable = (unsigned int)CToolUnits::toInt16(pszData) == 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | pStep->setName(pszName[m_nIndex]); |
| | | pStep->setWriteSignalDev(writeSignalDev[m_nIndex]); |
| | | if (addStep(addr[m_nIndex], pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | char* pszName[6][4] = { |
| | | {STEP_EQ_PORT1_EMPTY, STEP_EQ_PORT2_EMPTY, STEP_EQ_PORT3_EMPTY, STEP_EQ_PORT4_EMPTY}, |
| | | {STEP_EQ_PORT1_LOAD_EADY, STEP_EQ_PORT2_LOAD_EADY, STEP_EQ_PORT3_LOAD_EADY, STEP_EQ_PORT4_LOAD_EADY}, |
| | | {STEP_EQ_PORT1_LOADED, STEP_EQ_PORT2_LOADED, STEP_EQ_PORT3_LOADED, STEP_EQ_PORT4_LOADED}, |
| | | {STEP_EQ_PORT1_INUSE, STEP_EQ_PORT2_INUSE, STEP_EQ_PORT3_INUSE, STEP_EQ_PORT4_INUSE}, |
| | | {STEP_EQ_PORT1_UNLOAD_EADY, STEP_EQ_PORT2_UNLOAD_EADY, STEP_EQ_PORT3_UNLOAD_EADY, STEP_EQ_PORT4_UNLOAD_EADY}, |
| | | {STEP_EQ_PORT1_BLOCKED, STEP_EQ_PORT2_BLOCKED, STEP_EQ_PORT3_BLOCKED, STEP_EQ_PORT4_BLOCKED} |
| | | }; |
| | | static int dev[] = { 0x6050, 0x6070, 0x6090, 0x60b0 }; |
| | | static int writeSignalDev[6][4] = { |
| | | {0xd8, 0xd9, 0xda, 0xdb}, |
| | | {0xe0, 0xe1, 0xe2, 0xe3}, |
| | | {0xe8, 0xe9, 0xea, 0xeb}, |
| | | {0xf0, 0xf1, 0xf2, 0xf3}, |
| | | {0xf8, 0xf9, 0xfa, 0xfb}, |
| | | {0x100, 0x101, 0x102, 0x103} |
| | | }; |
| | | static int addr[6][4] = { |
| | | { STEP_ID_PORT1_EMPTY, STEP_ID_PORT2_EMPTY, STEP_ID_PORT3_EMPTY, STEP_ID_PORT4_EMPTY }, |
| | | { STEP_ID_PORT1_LOAD_READY, STEP_ID_PORT2_LOAD_READY, STEP_ID_PORT3_LOAD_READY, STEP_ID_PORT4_LOAD_READY }, |
| | | { STEP_ID_PORT1_LOADED, STEP_ID_PORT2_LOADED, STEP_ID_PORT3_LOADED, STEP_ID_PORT4_LOADED }, |
| | | { STEP_ID_PORT1_INUSE, STEP_ID_PORT2_INUSE, STEP_ID_PORT3_INUSE, STEP_ID_PORT4_INUSE }, |
| | | { STEP_ID_PORT1_UNLOAD_READY, STEP_ID_PORT2_UNLOAD_READY, STEP_ID_PORT3_UNLOAD_READY, STEP_ID_PORT4_UNLOAD_READY }, |
| | | { STEP_ID_PORT1_BLOCKED, STEP_ID_PORT2_BLOCKED, STEP_ID_PORT3_BLOCKED, STEP_ID_PORT4_BLOCKED }, |
| | | }; |
| | | |
| | | for (int i = 0; i < 6; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(dev[m_nIndex], 32 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | decodePortStatusReport((CStep*)pFrom, pszData, size); |
| | | } |
| | | return -1; |
| | | }); |
| | | pStep->setName(pszName[i][m_nIndex]); |
| | | pStep->setProp("Port", (void*)(__int64)(m_nIndex + 1)); |
| | | pStep->setWriteSignalDev(writeSignalDev[i][m_nIndex]); |
| | | if (addStep(addr[i][m_nIndex], pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | CHECK_READ_STEP_SIGNAL2(autoType[m_nIndex], pszData, size); |
| | | } |
| | | |
| | | int CLoadPort::onStepEvent(CStep* pStep, int code) |
| | | int CLoadPort::decodePortStatusReport(CStep* pStep, const char* pszData, size_t size) |
| | | { |
| | | int nRet = CEquipment::onStepEvent(pStep, code); |
| | | if (nRet > 0) return nRet; |
| | | |
| | | if (code == STEP_EVENT_READDATA) { |
| | | if (isPortTypeStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_nType = pReadIntStep->getValue(); |
| | | } |
| | | else if(isPortModeStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_nMode = pReadIntStep->getValue(); |
| | | } |
| | | else if (isPortCassetteTypeStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_nCassetteType = pReadIntStep->getValue(); |
| | | } |
| | | else if (isPortTransferModeStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_nTransferMode = pReadIntStep->getValue(); |
| | | } |
| | | else if (isPortEnableStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_bEnable = pReadIntStep->getValue() == 1; |
| | | } |
| | | else if (isPortTypeAutoChangeEnableStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | m_bAutoChangeEnable = pReadIntStep->getValue() == 1; |
| | | } |
| | | } |
| | | CPortStatusReport portStatusReport; |
| | | int nRet = portStatusReport.unserialize(&pszData[0], (int)size); |
| | | if (nRet < 0) return nRet; |
| | | m_portStatusReport.copyEx(portStatusReport); |
| | | |
| | | |
| | | return 0; |
| | | // 缓存Attribute,用于调试时显示信息 |
| | | unsigned int weight = 201; |
| | | CAttributeVector attrubutes; |
| | | m_portStatusReport.getAttributeVector(attrubutes, weight); |
| | | pStep->addAttributeVector(attrubutes); |
| | | |
| | | |
| | | LOGI("<CCassetteTranserStateStep>decodePortStatusReport<Status:%d, CassetteSequenceNo:%d>", |
| | | m_portStatusReport.getPortStatus(), m_portStatusReport.getCassetteSequenceNo()); |
| | | |
| | | |
| | | return nRet; |
| | | } |
| | | |
| | | /* |