| | |
| | | [&](int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | // 此处解释配方数据 |
| | | return decodeRecipeListReport(pszData, size); |
| | | short ret = decodeRecipeListReport(pszData, size); |
| | | pStep->setReturnCode(ret); |
| | | } |
| | | pStep->setReturnCode(MRLRC_OK); |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_MASTER_RECIPE_LIST); |
| | | pStep->setWriteSignalDev(m_nIndex == 0 ? 0x34b : 0x64b); |
| | | pStep->setReturnDev(m_nIndex == 0 ? 0x126d : 0x1bbd); |
| | | if (addStep(STEP_ID_MASTER_RECIPE_LIST_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | |
| | | m_bAutoRecipeChange = bFlag; |
| | | } |
| | | |
| | | // AutoRecipeChange |
| | | // VCR Enable |
| | | bFlag = isBitOn(pszData, size, ++index); |
| | | if (!equalBool(m_bVCREnable[0], bFlag)) { |
| | | m_bVCREnable[0] = bFlag; |
| | |
| | | LOGI("<CEquipment-%s>请求单元<%d>主配方列表成功,正在等待数据.", m_strName.c_str(), unitNo); |
| | | } |
| | | else { |
| | | //m_recipesManager.syncFailed(); |
| | | m_recipesManager.syncFailed(); |
| | | LOGI("<CEquipment-%s>请求单元<%d>主配方列表失败,code:%d", m_strName.c_str(), unitNo, code); |
| | | } |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::decodeRecipeListReport(const char* pszData, size_t size) |
| | | short CEquipment::decodeRecipeListReport(const char* pszData, size_t size) |
| | | { |
| | | return m_recipesManager.decodeRecipeListReport(pszData, size); |
| | | } |
| | |
| | | BOOL isBitOn(const char* pszData, size_t size, int index); |
| | | inline BOOL equalBool(BOOL b1, BOOL b2); |
| | | void addGlassToList(CGlass* pGlass); |
| | | int decodeRecipeListReport(const char* pszData, size_t size); |
| | | short decodeRecipeListReport(const char* pszData, size_t size); |
| | | |
| | | protected: |
| | | EquipmentListener m_listener; |
| | |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | int CReadStep::setReturnCode(short code) |
| | | { |
| | | memcpy(m_szReturnBuf, &code, sizeof(short)); |
| | | m_nReturnDataSize = sizeof(short); |
| | | |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | virtual int onTimeout(); |
| | | inline void nextStep(); |
| | | inline void resetStep(); |
| | | virtual int setReturnCode(short code); |
| | | |
| | | protected: |
| | | HANDLE m_hWorkThreadHandle; |
| | |
| | | unlock(); |
| | | } |
| | | |
| | | int CRecipesManager::decodeRecipeListReport(const char* pszData, size_t size) |
| | | short CRecipesManager::decodeRecipeListReport(const char* pszData, size_t size) |
| | | { |
| | | int index = 0; |
| | | int unitNo, reportType, totalMasterRecipeCount; |
| | |
| | | unsigned TimeoutCheckWorkingProc(); |
| | | int syncing(); |
| | | void syncFailed(); |
| | | int decodeRecipeListReport(const char* pszData, size_t size); |
| | | short decodeRecipeListReport(const char* pszData, size_t size); |
| | | CRecipeList* getRecipeListFromTemp(int unitNo); |
| | | |
| | | public: |