mrDarker
2025-05-22 5cf5e464a5891c8eb62aafadfce0d204fdc79b02
SourceCode/Bond/Servo/CEquipment.cpp
@@ -3,6 +3,8 @@
#include "ToolUnits.h"
#include <regex>
#include "CArm.h"
#include "CGlassPool.h"
#include "Servo.h"
#define CHECK_READ_STEP_SIGNAL(addr, data, size) {                     \
@@ -315,7 +317,7 @@
         int count;
         ar >> count;
         for (int i = 0; i < count; i++) {
            CGlass* pGlass = new CGlass();
            CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
            pGlass->serialize(ar);
            addGlassToList(pGlass);
         }
@@ -1061,6 +1063,33 @@
      return pStep->setDateTime(year, month, day, hour, minute, second);
   }
   int CEquipment::setDispatchingMode(DISPATCHING_MODE mode, ONWRITED onWritedBlock/* = nullptr*/)
   {
      SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_DISPATCHINT_MODE_CHANGE);
      if (pStep == nullptr) {
         return -1;
      }
      LOGI("<CEquipment-%s>准备设置DispatchingMode<%d>", m_strName.c_str(), (int)mode);
      if (onWritedBlock != nullptr) {
         pStep->writeShort((short)mode, onWritedBlock);
      }
      else {
         pStep->writeShort((short)mode, [&, mode](int code) -> int {
            if (code == WOK) {
               LOGI("<CEquipment-%s>设置DispatchingMode成功.", m_strName.c_str());
            }
            else {
               LOGI("<CEquipment-%s>设置DispatchingMode失败,code:%d", m_strName.c_str(), code);
            }
            return 0;
            });
      }
      return 0;
   }
   int CEquipment::masterRecipeListRequest(short unitNo)
   {
      SERVO::CEqWriteStep* pStep = (SERVO::CEqWriteStep*)getStepWithName(STEP_EQ_MASTER_RECIPE_LIST_REQ);