LAPTOP-SNT8I5JK\Boounion
2025-03-19 1823e5c63bac2246d066eb74318230952484c58a
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -34,6 +34,8 @@
   {
      // 加入Pin初始化代码
      LOGI("<CLoadPort>initPins");
      addPin(SERVO::PinType::INPUT, _T("In"));
      addPin(SERVO::PinType::OUTPUT, _T("Out"));
   }
   void CLoadPort::onTimer(UINT nTimerid)
@@ -45,4 +47,27 @@
   {
      CEquipment::serialize(ar);
   }
   void CLoadPort::getAttributeVector(CAttributeVector& attrubutes)
   {
      __super::getAttributeVector(attrubutes);
      for (auto item : m_inputPins) {
         attrubutes.addAttribute(new CAttribute(item->getName().c_str(),
            std::to_string((int)item->getType()).c_str(), ""));
      }
      for (auto item : m_outputPins) {
         attrubutes.addAttribute(new CAttribute(item->getName().c_str(),
            std::to_string((int)item->getType()).c_str(), ""));
      }
   }
   void CLoadPort::outputPanel()
   {
      CPin* pOutPin = getPin("Out");
      CSample* pSample = new CSample();
      pOutPin->sendSample(pSample);
   }
}