| | |
| | | |
| | | { |
| | | // 请æ±é
æ¹åæ° |
| | | //CEqWriteStep* pStep = new CEqWriteStep(); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | //pStep->setWriteSignalDev(0x967); |
| | | //pStep->setDataDev(0x379b); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | pStep->setWriteSignalDev(0x967); |
| | | pStep->setDataDev(0x24fb); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | // recipe parameter report |
| | | //CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2, |
| | | // [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | // if (code == ROK && pszData != nullptr && size > 0) { |
| | | // // æ¤å¤è§£éé
æ¹æ°æ® |
| | | // short ret = decodeRecipeParameterReport(pszData, size); |
| | | // pStep->setReturnCode(ret); |
| | | // } |
| | | // pStep->setReturnCode(MRLRC_OK); |
| | | // return -1; |
| | | // }); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | //pStep->setWriteSignalDev(0x94c); |
| | | //pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqReadStep* pStep = new CEqReadStep(0x12a54, 257 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | CEqReadStep* pTmpStep = (CEqReadStep*)pFrom; |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeParameterReport(pszData, size); |
| | | pTmpStep->setReturnCode(ret); |
| | | } |
| | | pTmpStep->setReturnCode(MRLRC_OK); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | pStep->setWriteSignalDev(0x94c); |
| | | pStep->setReturnDev(0x250c); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨CEqReadStepæ¿æ¢CEqJobEventStep |
| | |
| | | if (pGlass == nullptr) return false; |
| | | return pGlass->isProcessed(m_nID, getSlotUnit(slot)); |
| | | } |
| | | |
| | | int CBakeCooling::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) |
| | | { |
| | | ASSERT(pszData); |
| | | if (size < 250) return 0; |
| | | int i = 0, v; |
| | | |
| | | |
| | | // 1.A_è
çç¤æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("A_è
çç¤æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 2.A_è
å·å´æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("A_è
å·å´æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 3.B_è
çç¤æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("B_è
çç¤æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 4.BB_è
å·å´æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("B_è
å·å´æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 5.A_çç¤æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("A_çç¤æ¸©åº¦è®¾å®", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 6.B_çç¤æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("B_çç¤æ¸©åº¦è®¾å®", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | |
| | | return (int)params.size(); |
| | | } |
| | | |
| | | } |
| | |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | virtual short getSlotUnit(short slotNo) { return slotNo % 2 == 1 ? 0 : 1; }; |
| | | virtual bool isSlotProcessed(int slot); |
| | | virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& parsms); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | // recipe parameter report |
| | | CEqReadStep* pStep = new CEqReadStep(m_nIndex == 0 ? 0xaa54 : 0xea54, 257 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | [&, pStep](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | CEqReadStep* pTmpStep = (CEqReadStep*)pFrom; |
| | | short ret = MRLRC_OK; |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeParameterReport(pszData, size); |
| | | pStep->setReturnCode(ret); |
| | | ret = decodeRecipeParameterReport(pszData, size); |
| | | } |
| | | pStep->setReturnCode(MRLRC_OK); |
| | | pTmpStep->setReturnCode(ret); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | |
| | | |
| | | { |
| | | // FAC Data Report |
| | | CEqReadStep* pStep = new CEqReadStep(0xA60E, 108 * 2, |
| | | CEqReadStep* pStep = new CEqReadStep(m_nIndex == 0 ? 0xA60E : 0xE60E, 108 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | decodePanelDataReport((CStep*)pFrom, pszData, size); |
| | | decodeFacDataReport((CStep*)pFrom, pszData, size); |
| | | } |
| | | return -1; |
| | | }); |
| | |
| | | { |
| | | return m_nIndex == 0 ? 15000 : 20000; |
| | | } |
| | | |
| | | int CBonder::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) |
| | | { |
| | | ASSERT(pszData); |
| | | if (size < 250) return 0; |
| | | int i = 0, v; |
| | | |
| | | |
| | | // 1.æ ¡æ£å¯¹ä½å»¶æ¶ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("æ ¡æ£å¯¹ä½å»¶æ¶", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 2.ä¿åæ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("ä¿åæ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 3.è
ä½ç ´çç©ºå»¶æ¶ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("è
ä½ç ´ç空延æ¶", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 4.è
ä½ååæ³µå¯å¨å»¶æ¶ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("è
ä½ååæ³µå¯å¨å»¶æ¶", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 5.è
ä½è´´éæ½çç©ºå»¶æ¶ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("è
ä½è´´éæ½ç空延æ¶", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 6.å ççå¾
å»¶æ¶ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("å ççå¾
å»¶æ¶", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 7.æ°åååè®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("æ°ååå设å®", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 8.æ°åå åéç |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("æ°åå åéç", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 9.æ°åæ³åéç |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("æ°åæ³åéç", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 10.è´´éååä¸é |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("è´´éååä¸é", "", "", v * 0.1f)); |
| | | i += 4; |
| | | |
| | | // 11.Z轴转ç©éåº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
Z轴转ç©é度设å®", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 12.ä¸è
æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("ä¸è
温度设å®", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 13.ä¸è
æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("ä¸è
温度设å®", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 14.ä¸è
Zè½´é¢è´´åä½é度 |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
Zè½´é¢è´´åä½é度", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 15.ä¸è
Zè½´è´´éä½é度 |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
Zè½´è´´éä½é度", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 16.ä¸è
Zä¸è
å çä½é´è· |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
Zä¸è
å çä½é´è·", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 17.ä¸è
è´´éä½åå
¥é |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
è´´éä½åå
¥é", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 18.ä¸è
Zè½´ç ´ç空è·ç¦» |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸è
Zè½´ç ´ç空è·ç¦»", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 19.ä¸é¡¶Pinç ´ç空è·ç¦» |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸é¡¶Pinç ´ç空è·ç¦»", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 20.ä¸é¡¶Pinå çä½é´è· |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("ä¸é¡¶Pinå çä½é´è·", "", "", v * 0.001f)); |
| | | i += 4; |
| | | |
| | | // 21.è
ä½ç空泵ç空è§è®¾å®å¼ |
| | | params.push_back(CParam("è
ä½ç空泵ç空è§è®¾å®å¼", "", "", (double)toFloat(&pszData[i]))); |
| | | i += 4; |
| | | |
| | | // 22.è
ä½ååæ³µå°è¾¾è®¾å®å¼ |
| | | params.push_back(CParam("è
ä½ååæ³µå°è¾¾è®¾å®å¼", "", "", (double)toFloat(&pszData[i]))); |
| | | i += 4; |
| | | |
| | | |
| | | return (int)params.size(); |
| | | } |
| | | } |
| | |
| | | virtual int onProcessData(CProcessData* pProcessData); |
| | | virtual int onProcessStateChanged(PROCESS_STATE state); |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& parsms); |
| | | |
| | | public: |
| | | void setIndex(unsigned int index); |
| | |
| | | // 主é
æ¹ä¸æ¥ |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_MASTER_RECIPE_LIST_REPORT, pszData, size); |
| | | |
| | | // é
æ¹åæ° |
| | | CHECK_WRITE_STEP_SIGNAL(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_RECIPE_PARAMETER_REPORT, pszData, size); |
| | | |
| | | |
| | | // CIM Mode |
| | | CHECK_WRITE_STEP_SIGNAL(STEP_ID_CIMMODE_CHANGED_CMD_REPLY, pszData, size); |
| | | |
| | |
| | | CRecipeList* CEquipment::getRecipeList(int unitNo) |
| | | { |
| | | return m_recipesManager.getRecipeList(unitNo); |
| | | } |
| | | |
| | | bool CEquipment::saveRecipeList(int unitNo, std::string& strFilepath) |
| | | { |
| | | return m_recipesManager.saveRecipeList(unitNo, strFilepath); |
| | | } |
| | | |
| | | bool CEquipment::readRecipeList(int unitNo, std::string& strFilepath) |
| | | { |
| | | return m_recipesManager.readRecipeList(unitNo, strFilepath); |
| | | } |
| | | |
| | | int CEquipment::recvIntent(CPin* pPin, CIntent* pIntent) |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo) |
| | | int CEquipment::recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo, ONSYNCINGSTATECHANGED block) |
| | | { |
| | | SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_MASTER_RECIPE_LIST_REQ); |
| | | LOGI("<CEquipment-%s>æ£å¨è¯·æ±åå
<%d>主é
åæ°å表", m_strName.c_str(), unitNo); |
| | | m_recipesManager.setOnSyncingStateChanged(block); |
| | | if (m_recipesManager.syncing() != 0) { |
| | | return -2; |
| | | } |
| | | |
| | | SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | if (pStep == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | LOGI("<CEquipment-%s>æ£å¨è¯·æ±åå
<%d>主é
æ¹å表", m_strName.c_str(), unitNo); |
| | | if (m_recipesManager.syncing() != 0) { |
| | | return -2; |
| | | } |
| | | pStep->writeShort(unitNo, [&, unitNo](int code) -> int { |
| | | char szBuffer[14 * 2] = {0}; |
| | | int index = 0; |
| | | memcpy(&szBuffer[index], &masterRecipeId, sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&szBuffer[index], &localRecipeId, sizeof(short)); |
| | | index += sizeof(short); |
| | | memcpy(&szBuffer[index], &unitNo, sizeof(short)); |
| | | |
| | | pStep->writeDataEx(szBuffer, 14 * 2, [&, unitNo](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹å表æåï¼æ£å¨çå¾
æ°æ®.", m_strName.c_str(), unitNo); |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹åæ°å表æåï¼æ£å¨çå¾
æ°æ®.", m_strName.c_str(), unitNo); |
| | | } |
| | | else { |
| | | m_recipesManager.syncFailed(); |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹å表失败ï¼code:%d", m_strName.c_str(), unitNo, code); |
| | | LOGI("<CEquipment-%s>请æ±åå
<%d>主é
æ¹åæ°å表失败ï¼code:%d", m_strName.c_str(), unitNo, code); |
| | | } |
| | | |
| | | return 0; |
| | | }); |
| | | }); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | |
| | | std::string strSvTimeRecord, strSvData; |
| | | CToolUnits::convertString(&pszData[index], 8 * 2, strSvTimeRecord); |
| | | index += 128 * 2; |
| | | CToolUnits::convertString(&pszData[index], 640 * 2, strSvData); |
| | | CToolUnits::convertString(&pszData[index], 100 * 2, strSvData); |
| | | index += 256 * 2; |
| | | |
| | | |
| | |
| | | |
| | | return InspResult::NotInspected; |
| | | } |
| | | |
| | | float CEquipment::toFloat(const char* pszAddr) |
| | | { |
| | | BYTE szBuffer[4]; |
| | | szBuffer[0] = pszAddr[0]; |
| | | szBuffer[1] = pszAddr[1]; |
| | | szBuffer[2] = pszAddr[2]; |
| | | szBuffer[3] = pszAddr[3]; |
| | | float f = 0.0; |
| | | memcpy(&f, szBuffer, 4); |
| | | |
| | | return f; |
| | | } |
| | | |
| | | int CEquipment::parsingParams(const char* pszData, size_t size, std::string& strOut) |
| | | { |
| | | std::vector<CParam> params; |
| | | int nRet = parsingParams(pszData, size, params); |
| | | if (nRet <= 0) return nRet; |
| | | |
| | | char szBuffer[256]; |
| | | for (auto p : params) { |
| | | if(!strOut.empty()) strOut.append(","); |
| | | if (p.getValueType() == PVT_INT) { |
| | | sprintf_s(szBuffer, 256, "%s:%d", p.getName().c_str(), p.getIntValue()); |
| | | } |
| | | else if (p.getValueType() == PVT_DOUBLE) { |
| | | sprintf_s(szBuffer, 256, "%s:%f", p.getName().c_str(), p.getDoubleValue()); |
| | | } |
| | | strOut.append(szBuffer); |
| | | } |
| | | |
| | | return 0; |
| | | }; |
| | | } |
| | |
| | | #include "CProcessData.h" |
| | | #include "CPortStatusReport.h" |
| | | #include "CSlot.h" |
| | | #include "CParam.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | std::vector<CPin*>& CEquipment::getInputPins(); |
| | | std::vector<CPin*>& CEquipment::getOutputPins(); |
| | | CRecipeList* getRecipeList(int unitNo); |
| | | bool saveRecipeList(int unitNo, std::string& strFilepath); |
| | | bool readRecipeList(int unitNo, std::string& strFilepath); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual int fetchedOutJob(int port, CJobDataB* pJobDataB); |
| | | virtual int storedJob(int port, CJobDataB* pJobDataB, short putSlot); |
| | |
| | | // masterRecipeId: 主é
æ¹id |
| | | // localRecipeId: æ¬å°é
æ¹id |
| | | // unitNo: 0:local; Others:unit No |
| | | int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo); |
| | | int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo, ONSYNCINGSTATECHANGED block); |
| | | |
| | | // è§£æé
æ¹åæ°å表 |
| | | virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) { return 0; }; |
| | | virtual int parsingParams(const char* pszData, size_t size, std::string& strOut); |
| | | |
| | | // è·åæå®çSlot |
| | | CSlot* getSlot(int index); |
| | |
| | | int decodeJobProcessEndReport(CStep* pStep, const char* pszData, size_t size); |
| | | BOOL compareJobData(CJobDataB* pJobDataB, CJobDataS* pJobDataS); |
| | | void setProcessState(PROCESS_STATE state); |
| | | float toFloat(const char* pszAddr); |
| | | |
| | | protected: |
| | | BOOL m_bEnable; |
| | |
| | | |
| | | int CJobDataS::serialize(char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 256 * 2) return -1; |
| | | if (nBufferSize < JOBDATAS_SIZE) return -1; |
| | | |
| | | int index = 0; |
| | | memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short)); |
| | |
| | | memcpy(&pszBuffer[index], &m_nFirstGlassFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nLastGlassFlag, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nQTime[0], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | |
| | | memcpy(&pszBuffer[index], &m_nProductJudge, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 256 * 2; |
| | | return JOBDATAS_SIZE; |
| | | } |
| | | |
| | | int CJobDataS::unserialize(const char* pszBuffer, int nBufferSize) |
| | |
| | | m_pActiveRobotTask = createTransferTask(pLoadPorts[s], pAligner, primaryType, secondaryType, m_bJobMode); |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | CGlass* pGlass = (CGlass*)m_pActiveRobotTask->getContext(); |
| | | if (pGlass->getBuddy() != nullptr) { |
| | | delete m_pActiveRobotTask; |
| | | m_pActiveRobotTask = nullptr; |
| | | continue; |
| | | } |
| | | |
| | | pEFEM->setContext(pGlass); |
| | | pGlass->start(); |
| | | bool bMoved = glassFromQueueToInPorcess(pGlass); |
| | |
| | | m_pControlJob = new CControlJob(); |
| | | if (!CControlJob::deserialize(ifs, *m_pControlJob)) return false; |
| | | } |
| | | |
| | | else { |
| | | return false; |
| | | } |
| | | |
| | | // 读å ProcessJob å表 |
| | | uint32_t count = 0; |
| | |
| | | |
| | | { |
| | | // 请æ±é
æ¹åæ° |
| | | //CEqWriteStep* pStep = new CEqWriteStep(); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | //pStep->setWriteSignalDev(0xf67); |
| | | //pStep->setDataDev(0x379b); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | pStep->setWriteSignalDev(0xf67); |
| | | pStep->setDataDev(0x379b); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | // recipe parameter report |
| | | //CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2, |
| | | // [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | // if (code == ROK && pszData != nullptr && size > 0) { |
| | | // // æ¤å¤è§£éé
æ¹æ°æ® |
| | | // short ret = decodeRecipeParameterReport(pszData, size); |
| | | // pStep->setReturnCode(ret); |
| | | // } |
| | | // pStep->setReturnCode(MRLRC_OK); |
| | | // return -1; |
| | | // }); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | //pStep->setWriteSignalDev(0xf4c); |
| | | //pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | CEqReadStep* pTmpStep = (CEqReadStep*)pFrom; |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeParameterReport(pszData, size); |
| | | pTmpStep->setReturnCode(ret); |
| | | } |
| | | pTmpStep->setReturnCode(MRLRC_OK); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | pStep->setWriteSignalDev(0xf4c); |
| | | pStep->setReturnDev(0x37ac); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨CEqReadStepæ¿æ¢CEqJobEventStep |
| | |
| | | { |
| | | return 35000; |
| | | } |
| | | |
| | | int CMeasurement::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) |
| | | { |
| | | ASSERT(pszData); |
| | | if (size < 250) return 0; |
| | | int i = 0, v; |
| | | |
| | | |
| | | // 1.æ£æµåè½å¯ç¨/ç¦ç¨ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("æ£æµåè½å¯ç¨/ç¦ç¨", "", "", v)); |
| | | i += 2; |
| | | |
| | | // 2.æ£æµé度 |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("æ£æµé度", "", "", v * 0.001)); |
| | | i += 4; |
| | | |
| | | return (int)params.size(); |
| | | } |
| | | } |
| | |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& parsms); |
| | | }; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CParam.h" |
| | | |
| | | |
| | | CParam::CParam() |
| | | { |
| | | m_nValueType = PVT_INT; |
| | | m_nValue = 0; |
| | | m_fValue = 0.0; |
| | | } |
| | | |
| | | CParam::CParam(const char* pszName, const char* pszId, const char* pszUnit, int value) |
| | | { |
| | | m_nValueType = PVT_INT; |
| | | m_nValue = value; |
| | | m_fValue = 0.0; |
| | | m_strId = pszId; |
| | | m_strName = pszName; |
| | | m_strUnit = pszUnit; |
| | | } |
| | | |
| | | CParam::CParam(const char* pszName, const char* pszId, const char* pszUnit, double value) |
| | | { |
| | | m_nValueType = PVT_DOUBLE; |
| | | m_nValue = 0; |
| | | m_fValue = value; |
| | | m_strId = pszId; |
| | | m_strName = pszName; |
| | | m_strUnit = pszUnit; |
| | | } |
| | | |
| | | CParam::~CParam() |
| | | { |
| | | } |
| | | |
| | | std::string& CParam::getName() |
| | | { |
| | | return m_strName; |
| | | } |
| | | |
| | | std::string& CParam::getId() |
| | | { |
| | | return m_strId; |
| | | } |
| | | |
| | | std::string& CParam::getUnit() |
| | | { |
| | | return m_strUnit; |
| | | } |
| | | |
| | | int CParam::getValueType() |
| | | { |
| | | return m_nValueType; |
| | | } |
| | | |
| | | int CParam::getIntValue() |
| | | { |
| | | return m_nValue; |
| | | } |
| | | |
| | | void CParam::setIntValue(int value) |
| | | { |
| | | m_nValue = value; |
| | | } |
| | | |
| | | double CParam::getDoubleValue() |
| | | { |
| | | return m_fValue; |
| | | } |
| | | |
| | | void CParam::setDoubleValue(double value) |
| | | { |
| | | m_fValue = value; |
| | | } |
| | | |
| | | void CParam::Serialize(CArchive& ar) |
| | | { |
| | | if (ar.IsStoring()) |
| | | { |
| | | WriteString(ar, m_strName); |
| | | WriteString(ar, m_strUnit); |
| | | ar << m_nValueType; |
| | | ar << m_nValue; |
| | | ar << m_fValue; |
| | | } |
| | | else |
| | | { |
| | | ReadString(ar, m_strName); |
| | | ReadString(ar, m_strUnit); |
| | | ar >> m_nValueType; |
| | | ar >> m_nValue; |
| | | ar >> m_fValue; |
| | | } |
| | | } |
| | | |
| | | void CParam::ReadString(CArchive& ar, std::string& string) |
| | | { |
| | | CString strTemp; |
| | | ar >> strTemp; |
| | | string = (LPTSTR)(LPCTSTR)strTemp; |
| | | } |
| | | |
| | | void CParam::WriteString(CArchive& ar, std::string& string) |
| | | { |
| | | CString strTemp = string.c_str(); |
| | | ar << strTemp; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include <string> |
| | | |
| | | #define PVT_INT 0 |
| | | #define PVT_DOUBLE 1 |
| | | |
| | | class CParam |
| | | { |
| | | public: |
| | | CParam(); |
| | | CParam(const char* pszName, const char* pszId, const char* pszUnit, int value); |
| | | CParam(const char* pszName, const char* pszId, const char* pszUnit, double value); |
| | | ~CParam(); |
| | | |
| | | public: |
| | | std::string& getId(); |
| | | std::string& getName(); |
| | | std::string& getUnit(); |
| | | int getValueType(); |
| | | int getIntValue(); |
| | | void setIntValue(int value); |
| | | double getDoubleValue(); |
| | | void setDoubleValue(double value); |
| | | void Serialize(CArchive& ar); |
| | | |
| | | private: |
| | | void ReadString(CArchive& ar, std::string& string); |
| | | void WriteString(CArchive& ar, std::string& string); |
| | | |
| | | private: |
| | | int m_nValueType; |
| | | std::string m_strId; |
| | | std::string m_strName; |
| | | std::string m_strUnit; |
| | | int m_nValue; |
| | | double m_fValue; |
| | | }; |
| | | |
| | |
| | | #include "CRecipeList.h" |
| | | #include "Common.h" |
| | | #include "ToolUnits.h" |
| | | #include <fstream> |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | } |
| | | |
| | | if (m_nCurrentGroupCount == m_nToatlGroupCount) { |
| | | m_nToatlGroupCount = 0; |
| | | m_nCurrentGroupCount = 0; |
| | | return MRLRC_CURRENT_RECIPE_COMPLETE; |
| | | } |
| | | |
| | |
| | | return m_ids; |
| | | } |
| | | |
| | | std::unordered_map<short, std::vector<uint8_t>>& CRecipeList::getParamsRawData() |
| | | { |
| | | return m_paramsRawData; |
| | | } |
| | | |
| | | void CRecipeList::reset() |
| | | { |
| | | m_nToatlGroupCount = 0; |
| | | m_nCurrentGroupCount = 0; |
| | | m_ids.clear(); |
| | | m_paramsRawData.clear(); |
| | | } |
| | | |
| | | void CRecipeList::reset2() |
| | | { |
| | | m_nToatlGroupCount = 0; |
| | | m_nCurrentGroupCount = 0; |
| | | } |
| | | |
| | | int CRecipeList::addParamsPacket(int totalCount, int totalGroup, int currentGroup, |
| | | short unitId, short recipeId, |
| | | const char* pszData, size_t size) |
| | | { |
| | | if (m_nToatlGroupCount == 0) m_nToatlGroupCount = totalGroup; |
| | | if (m_nToatlGroupCount != totalGroup) { |
| | | reset2(); |
| | | return MRLRC_GROUP_COUNT_NG; |
| | | } |
| | | if (currentGroup == 0) { |
| | | reset2(); |
| | | } |
| | | if (m_nCurrentGroupCount + 1 > currentGroup) { |
| | | return MRLRC_DUPLICATION_GROUP_COUNT_NG; |
| | | } |
| | | if (m_nCurrentGroupCount + 1 < currentGroup) { |
| | | return ORDER_BY_GROUP_COUNT_NG; |
| | | } |
| | | m_nCurrentGroupCount++; |
| | | |
| | | m_paramsRawData[recipeId].insert(m_paramsRawData[recipeId].end(), (uint8_t*)(pszData), (uint8_t*)(pszData) + size); |
| | | if (m_nCurrentGroupCount == m_nToatlGroupCount) { |
| | | // è§£éæ°æ®å°±äº¤ç»åºç¨å±å§ |
| | | reset2(); |
| | | |
| | | return MRLRC_CURRENT_RECIPE_COMPLETE; |
| | | } |
| | | |
| | | |
| | | return MRLRC_CONTINUE; |
| | | } |
| | | |
| | | // åºåå |
| | | bool CRecipeList::serialize(const std::string& filename) const |
| | | { |
| | | std::ofstream ofs(filename, std::ios::binary); |
| | | if (!ofs) return false; |
| | | |
| | | // ååºæ¬æå |
| | | ofs.write(reinterpret_cast<const char*>(&m_nUnitNo), sizeof(m_nUnitNo)); |
| | | ofs.write(reinterpret_cast<const char*>(&m_nToatlGroupCount), sizeof(m_nToatlGroupCount)); |
| | | ofs.write(reinterpret_cast<const char*>(&m_nCurrentGroupCount), sizeof(m_nCurrentGroupCount)); |
| | | |
| | | // д m_ids |
| | | size_t idsSize = m_ids.size(); |
| | | ofs.write(reinterpret_cast<const char*>(&idsSize), sizeof(idsSize)); |
| | | for (auto& kv : m_ids) { |
| | | ofs.write(reinterpret_cast<const char*>(&kv.first), sizeof(kv.first)); |
| | | ofs.write(reinterpret_cast<const char*>(&kv.second), sizeof(kv.second)); |
| | | } |
| | | |
| | | // д m_paramsRawData |
| | | size_t paramsSize = m_paramsRawData.size(); |
| | | ofs.write(reinterpret_cast<const char*>(¶msSize), sizeof(paramsSize)); |
| | | for (auto& kv : m_paramsRawData) { |
| | | // д key |
| | | ofs.write(reinterpret_cast<const char*>(&kv.first), sizeof(kv.first)); |
| | | |
| | | // å vector å¤§å° |
| | | size_t vecSize = kv.second.size(); |
| | | ofs.write(reinterpret_cast<const char*>(&vecSize), sizeof(vecSize)); |
| | | |
| | | // å vector å
容 |
| | | if (!kv.second.empty()) { |
| | | ofs.write(reinterpret_cast<const char*>(kv.second.data()), vecSize); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | // ååºåå |
| | | bool CRecipeList::deserialize(const std::string& filename) |
| | | { |
| | | std::ifstream ifs(filename, std::ios::binary); |
| | | if (!ifs) return false; |
| | | |
| | | reset(); // æ¸
ç©ºæ§æ°æ® |
| | | |
| | | // è¯»åºæ¬æå |
| | | ifs.read(reinterpret_cast<char*>(&m_nUnitNo), sizeof(m_nUnitNo)); |
| | | ifs.read(reinterpret_cast<char*>(&m_nToatlGroupCount), sizeof(m_nToatlGroupCount)); |
| | | ifs.read(reinterpret_cast<char*>(&m_nCurrentGroupCount), sizeof(m_nCurrentGroupCount)); |
| | | |
| | | // 读 m_ids |
| | | size_t idsSize = 0; |
| | | ifs.read(reinterpret_cast<char*>(&idsSize), sizeof(idsSize)); |
| | | for (size_t i = 0; i < idsSize; ++i) { |
| | | int key; |
| | | short value; |
| | | ifs.read(reinterpret_cast<char*>(&key), sizeof(key)); |
| | | ifs.read(reinterpret_cast<char*>(&value), sizeof(value)); |
| | | m_ids[key] = value; |
| | | } |
| | | |
| | | // 读 m_paramsRawData |
| | | size_t paramsSize = 0; |
| | | ifs.read(reinterpret_cast<char*>(¶msSize), sizeof(paramsSize)); |
| | | for (size_t i = 0; i < paramsSize; ++i) { |
| | | short key; |
| | | size_t vecSize = 0; |
| | | ifs.read(reinterpret_cast<char*>(&key), sizeof(key)); |
| | | ifs.read(reinterpret_cast<char*>(&vecSize), sizeof(vecSize)); |
| | | |
| | | std::vector<uint8_t> buffer(vecSize); |
| | | if (vecSize > 0) { |
| | | ifs.read(reinterpret_cast<char*>(buffer.data()), vecSize); |
| | | } |
| | | m_paramsRawData[key] = std::move(buffer); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | #pragma once |
| | | #pragma once |
| | | #include <map> |
| | | |
| | | |
| | |
| | | int addRecipePacket(int totalCount,int totalGroup, int currentGroup, const char* pszData, size_t size); |
| | | int addRecipe(int index, short id); |
| | | std::map<int, short>& getIds(); |
| | | std::unordered_map<short, std::vector<uint8_t>>& getParamsRawData(); |
| | | void reset(); |
| | | void reset2(); |
| | | |
| | | // æ·»å åæ°å
|
| | | int addParamsPacket(int totalCount, int totalGroup, int currentGroup, |
| | | short unitId, short recipeId, |
| | | const char* pszData, size_t size); |
| | | |
| | | // â æ°å¢åºåååååºåå彿° |
| | | bool serialize(const std::string& filename) const; |
| | | bool deserialize(const std::string& filename); |
| | | |
| | | private: |
| | | int m_nUnitNo; |
| | | int m_nToatlGroupCount; |
| | | int m_nCurrentGroupCount; |
| | | std::map<int, short> m_ids; |
| | | std::unordered_map<short, std::vector<uint8_t>> m_paramsRawData; |
| | | }; |
| | | } |
| | | |
| | |
| | | } |
| | | m_mapRecipes = m_mapRecipesTemp; |
| | | m_mapRecipesTemp.clear(); |
| | | m_nSyncStatus = SS_COMPLETE; |
| | | m_nSyncStatus = SS_LIST_COMPLETE; |
| | | unlock(); |
| | | |
| | | if (m_onSyncingStateChanged != nullptr) { |
| | |
| | | |
| | | |
| | | |
| | | // æ¾å°å¯¹åºCRecipeList, æ¾ä¸å°åæ°å»º |
| | | /* |
| | | // æ¾å°å¯¹åºCRecipeList, æ¾ä¸å°åè¿åNG |
| | | lock(); |
| | | CRecipeList* pRecipeList = getRecipeListFromTemp(unitNo); |
| | | CRecipeList* pRecipeList = getRecipeList(unitNo); |
| | | if (pRecipeList == nullptr) { |
| | | pRecipeList = new CRecipeList(unitNo); |
| | | m_mapRecipesTemp[unitNo] = pRecipeList; |
| | | unlock(); |
| | | return MRLRC_NG; |
| | | } |
| | | unlock(); |
| | | ASSERT(pRecipeList); |
| | | */ |
| | | |
| | | /* |
| | | 1: Create |
| | |
| | | 3: Delete |
| | | 4: Request from EAS |
| | | */ |
| | | /* |
| | | if (reportType == RT_CREATE) { |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | else if (reportType == RT_REQUEST_FROM_EAS) { |
| | | int nRet = pRecipeList->addRecipePacket(toatlGroupCount, currentGroupCount, pszIdsData, 250 * 2); |
| | | int nRet = pRecipeList->addParamsPacket(totalParameterCount, toatlGroupCount, currentGroupCount, |
| | | unitNo, localRecipeId, |
| | | pszParameterData, 250 * 2); |
| | | if (MRLRC_CURRENT_RECIPE_COMPLETE == nRet) { |
| | | lock(); |
| | | if (m_nTotalMasterRecipeCount == m_mapRecipesTemp.size()) { |
| | | for (auto item : m_mapRecipes) { |
| | | delete item.second; |
| | | } |
| | | m_mapRecipes = m_mapRecipesTemp; |
| | | m_mapRecipesTemp.clear(); |
| | | m_nSyncStatus = SS_COMPLETE; |
| | | unlock(); |
| | | return MRLRC_OK; |
| | | } |
| | | m_nSyncStatus = SS_PARAMS_COMPLETE; |
| | | unlock(); |
| | | |
| | | if (m_onSyncingStateChanged != nullptr) { |
| | | m_onSyncingStateChanged(m_nSyncStatus); |
| | | } |
| | | |
| | | return MRLRC_OK; |
| | | } |
| | | else if (MRLRC_CONTINUE == nRet) { |
| | | return MRLRC_CONTINUE; |
| | | } |
| | | |
| | | return nRet; |
| | | } |
| | | */ |
| | | |
| | | |
| | | return MRLRC_OK; |
| | | } |
| | |
| | | return iter->second; |
| | | } |
| | | |
| | | bool CRecipesManager::saveRecipeList(int unitNo, std::string& strFilepath) |
| | | { |
| | | CRecipeList* pRecipeList = getRecipeList(unitNo); |
| | | if (pRecipeList == nullptr) return false; |
| | | return pRecipeList->serialize(strFilepath); |
| | | } |
| | | |
| | | bool CRecipesManager::readRecipeList(int unitNo, std::string& strFilepath) |
| | | { |
| | | CRecipeList* pRecipeList = getRecipeList(unitNo); |
| | | if (pRecipeList == nullptr) { |
| | | pRecipeList = new CRecipeList(); |
| | | m_mapRecipes[unitNo] = pRecipeList; |
| | | } |
| | | return pRecipeList->deserialize(strFilepath); |
| | | } |
| | | |
| | | void CRecipesManager::setOnSyncingStateChanged(ONSYNCINGSTATECHANGED block) |
| | | { |
| | | m_onSyncingStateChanged = block; |
| | |
| | | |
| | | #define SS_NONE 0 |
| | | #define SS_SYNCING 1 |
| | | #define SS_COMPLETE 2 |
| | | #define SS_TIMEOUT 3 |
| | | #define SS_FAILED 4 |
| | | #define SS_LIST_COMPLETE 2 |
| | | #define SS_PARAMS_COMPLETE 3 |
| | | #define SS_TIMEOUT 4 |
| | | #define SS_FAILED 5 |
| | | |
| | | namespace SERVO { |
| | | typedef std::function<void(int state)> ONSYNCINGSTATECHANGED; |
| | |
| | | short decodeRecipeParameterReport(const char* pszData, size_t size); |
| | | CRecipeList* getRecipeListFromTemp(int unitNo); |
| | | CRecipeList* getRecipeList(int unitNo); |
| | | bool saveRecipeList(int unitNo, std::string& strFilepath); |
| | | bool readRecipeList(int unitNo, std::string& strFilepath); |
| | | |
| | | public: |
| | | inline void lock() { ::EnterCriticalSection(&m_cs); }; |
| | |
| | | LOGI(_T("RobotTaskå·²ä¸åå°EFEM")); |
| | | } |
| | | else { |
| | | LOGI(_T("RobotTaskå·²ä¸å失败")); |
| | | LOGI(_T("RobotTaskä¸å失败")); |
| | | } |
| | | |
| | | return 0; |
| | |
| | | |
| | | { |
| | | // 请æ±é
æ¹åæ° |
| | | //CEqWriteStep* pStep = new CEqWriteStep(); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | //pStep->setWriteSignalDev(0xc67); |
| | | //pStep->setDataDev(0x379b); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER_REQ); |
| | | pStep->setWriteSignalDev(0xc67); |
| | | pStep->setDataDev(0x2e4b); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_CMD_REPLY, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | { |
| | | // recipe parameter report |
| | | //CEqReadStep* pStep = new CEqReadStep(0x1aa54, 257 * 2, |
| | | // [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | // if (code == ROK && pszData != nullptr && size > 0) { |
| | | // // æ¤å¤è§£éé
æ¹æ°æ® |
| | | // short ret = decodeRecipeParameterReport(pszData, size); |
| | | // pStep->setReturnCode(ret); |
| | | // } |
| | | // pStep->setReturnCode(MRLRC_OK); |
| | | // return -1; |
| | | // }); |
| | | //pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | //pStep->setWriteSignalDev(0xc4c); |
| | | //pStep->setReturnDev(m_nIndex == 0 ? 0x126c : 0x1bbc); |
| | | //if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | // delete pStep; |
| | | //} |
| | | CEqReadStep* pStep = new CEqReadStep(0x16a54, 257 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | CEqReadStep* pTmpStep = (CEqReadStep*)pFrom; |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // æ¤å¤è§£éé
æ¹æ°æ® |
| | | short ret = decodeRecipeParameterReport(pszData, size); |
| | | pTmpStep->setReturnCode(ret); |
| | | } |
| | | pTmpStep->setReturnCode(MRLRC_OK); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_RECIPE_PARAMETER); |
| | | pStep->setWriteSignalDev(0xc4c); |
| | | pStep->setReturnDev(0x2ec); |
| | | if (addStep(STEP_ID_RECIPE_PARAMETER_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨CEqReadStepæ¿æ¢CEqJobEventStep |
| | |
| | | { |
| | | return 30000; |
| | | } |
| | | |
| | | int CVacuumBake::parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) |
| | | { |
| | | ASSERT(pszData); |
| | | if (size < 250) return 0; |
| | | int i = 0, v; |
| | | |
| | | |
| | | // 1.A_è
å çæ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("A_è
å çæ¶é´", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 2.B_è
å çæ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("B_è
å çæ¶é´", "", "", v * 0.1f)); |
| | | i += 2; |
| | | |
| | | // 3.A_è
ç ´ç空æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("A_è
ç ´ç空æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 4.B_è
ç ´ç空æ¶é´ |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8; |
| | | params.push_back(CParam("B_è
ç ´ç空æ¶é´", "", "", v * 0.01f)); |
| | | i += 2; |
| | | |
| | | // 5.A_è
ç空å°è¾¾å¼ |
| | | params.push_back(CParam("A_è
ç空å°è¾¾å¼", "", "", (double)toFloat(&pszData[i]))); |
| | | i += 4; |
| | | |
| | | // 6.B_è
ç空å°è¾¾å¼ |
| | | params.push_back(CParam("B_è
ç空å°è¾¾å¼", "", "", (double)toFloat(&pszData[i]))); |
| | | i += 4; |
| | | |
| | | // 7.A_è
温æ§è¡¨ä¸»æ§æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("A_è
温æ§è¡¨ä¸»æ§æ¸©åº¦è®¾å®", "", "", v * 0.1f)); |
| | | i += 4; |
| | | |
| | | // 8.B_è
温æ§è¡¨ä¸»æ§æ¸©åº¦è®¾å® |
| | | v = (pszData[i] & 0xff) | (pszData[i + 1] & 0xff) << 8 | (pszData[i + 2] & 0xff) << 16 | (pszData[i + 3] & 0xff) << 24; |
| | | params.push_back(CParam("B_è
温æ§è¡¨ä¸»æ§æ¸©åº¦è®¾å®", "", "", v * 0.1f)); |
| | | i += 4; |
| | | |
| | | |
| | | return (int)params.size(); |
| | | } |
| | | } |
| | |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | virtual int getIndexerOperationModeBaseValue(); |
| | | |
| | | virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& parsms); |
| | | }; |
| | | } |
| | | |
| | |
| | | #include "Servo.h" |
| | | #include "afxdialogex.h" |
| | | #include "PageRecipe.h" |
| | | #include "MsgDlg.h" |
| | | #include "RecipeDeviceBindDlg.h" |
| | | |
| | | |
| | | // CPageRecipe å¯¹è¯æ¡ |
| | | |
| | |
| | | m_listPPID.SetColumnWidth(nColCount - 1, LVSCW_AUTOSIZE_USEHEADER); |
| | | } |
| | | |
| | | void CPageRecipe::FillRecipeListToListCtrl(SERVO::CRecipeList* pList) |
| | | void CPageRecipe::FillRecipeListToListCtrl(SERVO::CEquipment* pEq) |
| | | { |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST_PPID); |
| | | if (pListCtrl == nullptr || !::IsWindow(pListCtrl->m_hWnd)) { |
| | | return; |
| | |
| | | |
| | | // æ¸
空å½åCListCtrlä¸çææé¡¹ |
| | | pListCtrl->DeleteAllItems(); |
| | | if (pList == nullptr) { |
| | | if (pRecipeList == nullptr) { |
| | | return; |
| | | } |
| | | |
| | | // éåæ°æ®å¹¶æå
¥å°CListCtrlä¸ |
| | | std::map<int, short>& ids = pList->getIds(); |
| | | std::map<int, short>& ids = pRecipeList->getIds(); |
| | | auto rawDatas = pRecipeList->getParamsRawData(); |
| | | for (auto item : ids) { |
| | | int index = m_listPPID.InsertItem(m_listPPID.GetItemCount(), _T("")); |
| | | m_listPPID.SetItemText(index, 1, std::to_string(item.first).c_str()); |
| | | m_listPPID.SetItemText(index, 2, std::to_string(item.second).c_str()); |
| | | |
| | | auto iter = rawDatas.find(item.second); |
| | | if (iter != rawDatas.end()) { |
| | | std::string strDescription; |
| | | pEq->parsingParams((const char*)iter->second.data(), iter->second.size(), strDescription); |
| | | } |
| | | } |
| | | |
| | | // è·ååæ° |
| | |
| | | pEq[i] == nullptr ? _T("Master") : pEq[i]->getName().c_str()); |
| | | pComboBox->SetItemDataPtr(i, pEq[i]); |
| | | |
| | | // 读å忥 |
| | | char szBuffer[_MAX_PATH]; |
| | | if (pEq[i]) { |
| | | pEq[i]->masterRecipeListRequest(0, nullptr); |
| | | sprintf_s(szBuffer, _MAX_PATH, "%s\\Recipe\\EQ%d_Unit0.recipelist", (LPTSTR)(LPCTSTR)theApp.m_strAppDir, pEq[i]->getID()); |
| | | std::string strFilepath(szBuffer); |
| | | pEq[i]->readRecipeList(0, strFilepath); |
| | | } |
| | | } |
| | | pComboBox->SetCurSel(0); |
| | |
| | | FillDataToListCtrl(vecData); |
| | | } |
| | | else { |
| | | // enable port |
| | | CMsgDlg msgDlg("请çå¾
", "æ£å¨è·åé
æ¹..."); |
| | | pEq->masterRecipeListRequest(0, [&, pEq](int status) -> void { |
| | | if (status == SS_FAILED || status == SS_TIMEOUT) { |
| | | CString strMsg; |
| | | strMsg.Format(status == SS_FAILED ? _T("è·åé
æ¹å¤±è´¥ï¼") : _T("è·åé
æ¹è¶
æ¶ï¼")); |
| | | msgDlg.DelayClose(3000); |
| | | msgDlg.SetIcon(MSG_BOX_ERROR); |
| | | msgDlg.SetTitle(_T("æä½å¤±è´¥")); |
| | | msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | msgDlg.SetMarquee(FALSE, 0); |
| | | msgDlg.SetCompleteCode(-1); |
| | | } |
| | | else if (status == SS_COMPLETE) { |
| | | CString strMsg; |
| | | strMsg.Format(_T("è·åé
æ¹å®æï¼")); |
| | | msgDlg.DelayClose(3000); |
| | | msgDlg.SetIcon(MSG_BOX_SUCCEED); |
| | | msgDlg.SetTitle(_T("æä½æå")); |
| | | msgDlg.SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | msgDlg.SetMarquee(FALSE, 0); |
| | | msgDlg.SetCompleteCode(0); |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | FillRecipeListToListCtrl(pRecipeList); |
| | | } |
| | | }); |
| | | // è·åé
æ¹å表 |
| | | CMsgDlg msgDlg("请çå¾
", "æ£å¨è·åé
æ¹å表..."); |
| | | msgDlg.SetData((DWORD_PTR)this); |
| | | msgDlg.SetDataEx((DWORD_PTR)pEq); |
| | | msgDlg.BeginThread(SyncThreadFunction); |
| | | msgDlg.DoModal(); |
| | | } |
| | | } |
| | |
| | | } |
| | | else { |
| | | InitListCtrlHeaderForDevice(); |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | FillRecipeListToListCtrl(pRecipeList); |
| | | FillRecipeListToListCtrl(pEq); |
| | | } |
| | | } |
| | | |
| | | UINT CPageRecipe::SyncThreadFunction(LPVOID lpvData) |
| | | { |
| | | CMsgDlg* pMsgDlg = (CMsgDlg*)lpvData; |
| | | CPageRecipe* pPageRecipe = (CPageRecipe*)pMsgDlg->GetData(); |
| | | return pPageRecipe->SyncThreadFunctionInner(pMsgDlg); |
| | | } |
| | | |
| | | UINT CPageRecipe::SyncThreadFunctionInner(CMsgDlg* pMsgDlg) |
| | | { |
| | | SERVO::CEquipment* pEq = (SERVO::CEquipment*)pMsgDlg->GetDataEx(); |
| | | HANDLE hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | | int nStep = 0; |
| | | |
| | | // åå¤é
æ¹è·¯å¾ |
| | | char szBuffer[_MAX_PATH]; |
| | | sprintf_s(szBuffer, _MAX_PATH, "%s\\Recipe\\EQ%d_Unit0.recipelist", (LPTSTR)(LPCTSTR)theApp.m_strAppDir, pEq->getID()); |
| | | std::string strFilepath(szBuffer); |
| | | |
| | | pEq->masterRecipeListRequest(0, [&, pEq, pMsgDlg, hEvent](int status) -> void { |
| | | Sleep(300); |
| | | if (status == SS_FAILED || status == SS_TIMEOUT) { |
| | | CString strMsg; |
| | | strMsg.Format(status == SS_FAILED ? _T("è·åé
æ¹å表失败ï¼") : _T("è·åé
æ¹å表è¶
æ¶ï¼")); |
| | | pMsgDlg->SetIcon(MSG_BOX_ERROR); |
| | | pMsgDlg->SetTitle(_T("æä½å¤±è´¥")); |
| | | pMsgDlg->SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | SetEvent(hEvent); |
| | | } |
| | | else if (status == SS_LIST_COMPLETE) { |
| | | CString strMsg; |
| | | strMsg.Format(_T("è·åé
æ¹åè¡¨å®æï¼")); |
| | | pMsgDlg->SetTitle(_T("æä½æå")); |
| | | pMsgDlg->SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | if (pRecipeList != nullptr && !pRecipeList->getIds().empty()) { |
| | | nStep = 1; |
| | | } |
| | | SetEvent(hEvent); |
| | | } |
| | | }); |
| | | ::WaitForSingleObject(hEvent, INFINITE); |
| | | if (nStep != 1) { |
| | | pEq->saveRecipeList(0, strFilepath); |
| | | pMsgDlg->SetIcon(MSG_BOX_SUCCEED); |
| | | pMsgDlg->SetMarquee(FALSE, 0); |
| | | pMsgDlg->SetCompleteCode(-1); |
| | | pMsgDlg->DelayClose(3000); |
| | | } |
| | | ResetEvent(hEvent); |
| | | |
| | | |
| | | // åæ°å表 |
| | | if (nStep == 1) { |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | ASSERT(pRecipeList); |
| | | auto& ids = pRecipeList->getIds(); |
| | | pMsgDlg->SetTitle(_T("æ£å¨è·ååæ°")); |
| | | for (auto item : ids) { |
| | | int recipeId = item.second; |
| | | CString strMsg; |
| | | strMsg.Format(_T("æ£å¨è·åé
æ¹ %d åæ°..."), item.second); |
| | | pMsgDlg->SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | pEq->recipeParameterRequest(0, recipeId, 0, [&, pEq, pMsgDlg, recipeId, hEvent](int status) -> void { |
| | | Sleep(500); |
| | | if (status == SS_FAILED || status == SS_TIMEOUT) { |
| | | CString strMsg; |
| | | strMsg.Format(status == SS_FAILED ? _T("è·åé
æ¹ %d åæ°å¤±è´¥ï¼") : _T("è·åé
æ¹ %d åæ°è¶
æ¶ï¼"), recipeId); |
| | | pMsgDlg->SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | |
| | | Sleep(30); |
| | | SetEvent(hEvent); |
| | | } |
| | | else if (status == SS_PARAMS_COMPLETE) { |
| | | CString strMsg; |
| | | strMsg.Format(_T("è·åé
æ¹ %d 忰宿ï¼"), item.second); |
| | | pMsgDlg->SetMessage((LPTSTR)(LPCTSTR)strMsg); |
| | | |
| | | Sleep(30); |
| | | SetEvent(hEvent); |
| | | } |
| | | }); |
| | | ::WaitForSingleObject(hEvent, INFINITE); |
| | | ResetEvent(hEvent); |
| | | } |
| | | |
| | | |
| | | pEq->saveRecipeList(0, strFilepath); |
| | | pMsgDlg->SetIcon(MSG_BOX_SUCCEED); |
| | | pMsgDlg->SetTitle(_T("æä½å®æ")); |
| | | pMsgDlg->SetCompleteCode(0); |
| | | pMsgDlg->SetMarquee(FALSE, 0); |
| | | pMsgDlg->DelayClose(3000); |
| | | }; |
| | | |
| | | FillRecipeListToListCtrl(pEq); |
| | | CloseHandle(hEvent); |
| | | |
| | | |
| | | |
| | | // 卿¤æå°é
æ¹åæ°ä»¥ä¾¿æ ¸å¯¹æ°æ® |
| | | SERVO::CRecipeList* pRecipeList = pEq->getRecipeList(0); |
| | | ASSERT(pRecipeList); |
| | | auto rawDatas = pRecipeList->getParamsRawData(); |
| | | for (auto item : rawDatas) { |
| | | TRACE("================= é
æ¹ %d\n", item.first); |
| | | |
| | | std::vector<CParam> params; |
| | | pEq->parsingParams((const char*)item.second.data(), item.second.size(), params); |
| | | for (auto p : params) { |
| | | if (p.getValueType() == PVT_INT) { |
| | | TRACE("%s: %d\n", p.getName().c_str(), p.getIntValue()); |
| | | } |
| | | else if (p.getValueType() == PVT_DOUBLE) { |
| | | TRACE("%s: %f\n", p.getName().c_str(), p.getDoubleValue()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | |
| | | #include "afxdialogex.h" |
| | | #include "RecipeManager.h" |
| | | #include "ListCtrlEx.h" |
| | | #include "MsgDlg.h" |
| | | |
| | | |
| | | // CPageRecipe å¯¹è¯æ¡ |
| | | |
| | |
| | | CPageRecipe(CWnd* pParent = nullptr); // æ åæé 彿° |
| | | virtual ~CPageRecipe(); |
| | | |
| | | public: |
| | | static UINT SyncThreadFunction(LPVOID lpvData); |
| | | UINT SyncThreadFunctionInner(CMsgDlg* pMsgDlg); |
| | | |
| | | private: |
| | | void InitListCtrlHeaderForMaster(); |
| | | void InitListCtrlHeaderForDevice(); |
| | | void UpdateRecipeByPPID(const CString& strPPID); |
| | | void FillDataToListCtrl(const std::vector<RecipeInfo>& vecRecipe); |
| | | void FillRecipeListToListCtrl(SERVO::CRecipeList* pList); |
| | | void FillRecipeListToListCtrl(SERVO::CEquipment* pEq); |
| | | |
| | | // å¯¹è¯æ¡æ°æ® |
| | | #ifdef AFX_DESIGN_TIME |
| | |
| | | CGridCellCombo* pCombo = dynamic_cast<CGridCellCombo*>(m_wndGrid.GetCell(i, 2)); |
| | | ASSERT(pCheck && pCombo); |
| | | pGlass->setScheduledForProcessing(pCheck->GetCheck()); |
| | | /*pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));*/ |
| | | pGlass->setType(static_cast<SERVO::MaterialsType>(nMaterialType)); |
| | | |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | pJobDataS->setLotId(config.strLotID.c_str()); |
| | |
| | | #include <mutex> |
| | | #include <unordered_map> |
| | | #include "Database.h" |
| | | #include "CParam.h" |
| | | |
| | | |
| | | // å个设å¤é
æ¹æ å°ä¿¡æ¯ |
| | | struct DeviceRecipe { |
| | |
| | | int nRecipeID; // åé
æ¹ID |
| | | std::string strRecipeName; // åé
æ¹åç§° |
| | | std::string strDeviceName; // 设å¤åç§° |
| | | std::vector<uint8_t> paramsRawData; // é
æ¹åå§æ°æ® |
| | | std::vector<CParam*> m_params; // åºç«æ¶è®°å½åæ° |
| | | }; |
| | | |
| | | // é
æ¹ä¿¡æ¯ |
| | |
| | | <ClInclude Include="CPageLinkSignal.h" /> |
| | | <ClInclude Include="CPageReport.h" /> |
| | | <ClInclude Include="CPageVarialbles.h" /> |
| | | <ClInclude Include="CParam.h" /> |
| | | <ClInclude Include="CReport.h" /> |
| | | <ClInclude Include="CRobotCmdContainerDlg.h" /> |
| | | <ClInclude Include="CRobotCmdTestDlg.h" /> |
| | |
| | | <ClCompile Include="CPageLinkSignal.cpp" /> |
| | | <ClCompile Include="CPageReport.cpp" /> |
| | | <ClCompile Include="CPageVarialbles.cpp" /> |
| | | <ClCompile Include="CParam.cpp" /> |
| | | <ClCompile Include="CReport.cpp" /> |
| | | <ClCompile Include="CRobotCmdContainerDlg.cpp" /> |
| | | <ClCompile Include="CRobotCmdTestDlg.cpp" /> |
| | |
| | | <ClCompile Include="CControlJob.cpp" /> |
| | | <ClCompile Include="CExpandableListCtrl.cpp" /> |
| | | <ClCompile Include="CControlJobDlg.cpp" /> |
| | | <ClCompile Include="CParam.cpp" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="AlarmManager.h" /> |
| | |
| | | <ClInclude Include="SerializeUtil.h" /> |
| | | <ClInclude Include="CExpandableListCtrl.h" /> |
| | | <ClInclude Include="CControlJobDlg.h" /> |
| | | <ClInclude Include="CParam.h" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ResourceCompile Include="Servo.rc" /> |