#include "stdafx.h"
|
#include "CEqJobEventStep.h"
|
#include "Log.h"
|
|
|
namespace SERVO {
|
CEqJobEventStep::CEqJobEventStep() : CReadStep()
|
{
|
m_nJobDataADev = 0;
|
}
|
|
CEqJobEventStep::~CEqJobEventStep()
|
{
|
|
}
|
|
void CEqJobEventStep::setJobDataDev(int nDev)
|
{
|
m_nJobDataADev = nDev;
|
}
|
|
void CEqJobEventStep::getAttributeVector(CAttributeVector& attrubutes)
|
{
|
unsigned int weight = 31;
|
std::string strTemp;
|
attrubutes.addAttribute(new CAttribute("Dev",
|
("W" + CToolUnits::toHexString(m_nJobDataADev, strTemp)).c_str(), "", weight++));
|
m_jobDataS.getAttributeVector(attrubutes, weight);
|
}
|
|
int CEqJobEventStep::onReadData()
|
{
|
CReadStep::onReadData();
|
|
|
char szBuffer[1024];
|
int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nJobDataADev,
|
640, szBuffer);
|
if (0 != nRet) {
|
return -1;
|
}
|
|
m_jobDataS.unserialize(szBuffer, 640);
|
LOGI("<CEqJobEventStep-%s>Read JobDataA\n", m_strName.c_str());
|
|
return 0;
|
}
|
|
int CEqJobEventStep::onComplete()
|
{
|
CReadStep::onComplete();
|
LOGI("<CEqJobEventStep> onComplete.");
|
|
return 0;
|
}
|
|
int CEqJobEventStep::onTimeout()
|
{
|
CReadStep::onTimeout();
|
LOGI("<CEqJobEventStep> onTimeout.");
|
|
return 0;
|
}
|
|
CJobDataS* CEqJobEventStep::getJobDataS()
|
{
|
return &m_jobDataS;
|
}
|
}
|