#include "stdafx.h"
|
#include "CLoadPort.h"
|
|
|
namespace SERVO {
|
CLoadPort::CLoadPort() : CEquipment()
|
{
|
|
}
|
|
CLoadPort::~CLoadPort()
|
{
|
|
}
|
|
const char* CLoadPort::getClassName()
|
{
|
static char* pszName = "CLoadPort";
|
return pszName;
|
}
|
|
void CLoadPort::init()
|
{
|
CEquipment::init();
|
}
|
|
void CLoadPort::term()
|
{
|
CEquipment::term();
|
}
|
|
// ±ØÐëҪʵÏÖµÄÐ麯Êý£¬Ôڴ˳õʼ»¯PinÁбí
|
void CLoadPort::initPins()
|
{
|
// ¼ÓÈëPin³õʼ»¯´úÂë
|
LOGI("<CLoadPort>initPins");
|
addPin(SERVO::PinType::INPUT, _T("In"));
|
addPin(SERVO::PinType::OUTPUT, _T("Out"));
|
}
|
|
void CLoadPort::onTimer(UINT nTimerid)
|
{
|
CEquipment::onTimer(nTimerid);
|
}
|
|
void CLoadPort::serialize(CArchive& ar)
|
{
|
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");
|
|
CIntent intent;
|
intent.setCode(1);
|
intent.setMsg("Hello");
|
pOutPin->sendIntent(&intent);
|
}
|
}
|