#include "stdafx.h"
|
#include "CRobotTask.h"
|
#include "ToolUnits.h"
|
|
|
namespace SERVO {
|
CRobotTask::CRobotTask()
|
{
|
generateId(m_strId);
|
m_timeCreate = CToolUnits::getTimestamp();
|
}
|
|
CRobotTask::~CRobotTask()
|
{
|
|
}
|
|
std::string& CRobotTask::generateId(std::string& out)
|
{
|
char szBuffer[256];
|
CTime time = CTime::GetCurrentTime();
|
__int64 nTick = 0;
|
QueryPerformanceCounter((LARGE_INTEGER*)&nTick);
|
sprintf_s(szBuffer, 256, "%d%02d%02d%02d%02d%02d%010llu", time.GetYear(),
|
time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond(),
|
nTick % 10000000000);
|
out = szBuffer;
|
|
return out;
|
}
|
|
std::string& CRobotTask::getId()
|
{
|
return m_strId;
|
}
|
|
void CRobotTask::setRobotTransferParam(int seq, int armNo, int fromPos, int toPos, int fromSlot, int toSlot)
|
{
|
m_robotCmdParam = {};
|
m_robotCmdParam.sequenceNo = static_cast<short>(seq);
|
m_robotCmdParam.rcmd = static_cast<short>(SERVO::RCMD::Transfer);
|
m_robotCmdParam.armNo = static_cast<short>(armNo);
|
m_robotCmdParam.getPosition = static_cast<short>(fromPos);
|
m_robotCmdParam.getSlotNo = static_cast<short>(fromSlot);
|
m_robotCmdParam.putPosition = static_cast<short>(toPos);
|
m_robotCmdParam.putSlotNo = static_cast<short>(toSlot);
|
}
|
|
ROBOT_CMD_PARAM& CRobotTask::getRobotCmdParam()
|
{
|
return m_robotCmdParam;
|
}
|
|
time_t CRobotTask::getCreateTime()
|
{
|
return m_timeCreate;
|
}
|
|
time_t CRobotTask::getFinishTime()
|
{
|
return m_timeFinish;
|
}
|
}
|