mrDarker
2025-06-19 8ffc831c6bf37a73961e22efc145be4e8c8f1241
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, onWritedRetBlock](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;
   }