LAPTOP-SNT8I5JK\Boounion
2025-06-18 96266d494fe227a0481c305f9c859e69421da6ae
SourceCode/Bond/Servo/CEquipment.cpp
@@ -1012,30 +1012,34 @@
      return 0;
   }
   int CEquipment::indexerOperationModeChange(IDNEXER_OPERATION_MODE mode, ONWRITED onWritedBlock/* = nullptr*/)
   int CEquipment::indexerOperationModeChange(IDNEXER_OPERATION_MODE mode, ONWRITEDRET onWritedRetBlock)
   {
      SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EFEM_IN_OP_MODE_CHANGE);
      SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_IN_OP_MODE_CHANGE);
      if (pStep == nullptr) {
         return -1;
      }
      unsigned short operationMode = (unsigned short)((unsigned short)mode + getIndexerOperationModeBaseValue());
      LOGI("<CEquipment-%s>准备设置indexerOperationMode<%d>", m_strName.c_str(), (int)mode);
      if (onWritedBlock != nullptr) {
         pStep->writeShort(operationMode, onWritedBlock);
      }
      else {
         pStep->writeShort(operationMode, [&, mode](int code) -> int {
            if (code == WOK) {
               LOGI("<CEquipment-%s>设置indexerOperationMode成功.", m_strName.c_str());
            }
            else {
               LOGI("<CEquipment-%s>设置indexerOperationMode失败,code:%d", m_strName.c_str(), code);
            }
      pStep->writeShort(operationMode, [&, mode](int code) -> int {
         int retCode = 0;
         if (code == WOK) {
            LOGI("<CEquipment-%s>设置indexerOperationMode成功.", m_strName.c_str());
            const char* pszRetData = nullptr;
            pStep->getReturnData(pszRetData);
            ASSERT(pszRetData);
            retCode = (unsigned int)CToolUnits::toInt16(pszRetData);
         }
         else {
            LOGI("<CEquipment-%s>设置indexerOperationMode失败,code:%d", m_strName.c_str(), code);
         }
            return 0;
            });
      }
         if (onWritedRetBlock != nullptr) {
            onWritedRetBlock(code, retCode);
         }
         return 0;
      });
      return 0;
   }