mrDarker
2025-09-08 6dc80508b1c0f431007f8a8c947c152ec00c3d15
SourceCode/Bond/Servo/CEquipment.cpp
@@ -496,6 +496,11 @@
      // 主配方上报
      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);
@@ -811,6 +816,16 @@
   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)
@@ -1513,6 +1528,24 @@
      processData.getAttributeVector(attrubutes, weight);
      onProcessData(&processData);
      // 找到玻璃,关联数据
      CGlass* pGlass = this->getGlassWithCassette(processData.getCassetteSequenceNo(),
         processData.getJobSequenceNo());
      if (pGlass == nullptr) {
         LOGE("<CEquipment-%s>找不到对应Glass, 关联工艺参数失败。", this->getName().c_str(),
            processData.getCassetteSequenceNo(),
            processData.getJobSequenceNo());
         return -1;
      }
      auto rawData = processData.getParamsRawData();
      std::vector<CParam> params;
      this->parsingParams((const char*)rawData.data(), rawData.size(), params);
      pGlass->addParams(params);
      return nRet;
   }
@@ -2099,4 +2132,25 @@
      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;
   };
}