From 5b6e648814aa829706cb94e6c44766ee9a6d9f12 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 28 五月 2025 11:06:47 +0800
Subject: [PATCH] 1.机器槽位信息设计(CSlot)

---
 SourceCode/Bond/Servo/CRobotTask.cpp |   63 +++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CRobotTask.cpp b/SourceCode/Bond/Servo/CRobotTask.cpp
new file mode 100644
index 0000000..26017c7
--- /dev/null
+++ b/SourceCode/Bond/Servo/CRobotTask.cpp
@@ -0,0 +1,63 @@
+#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;
+	}
+}

--
Gitblit v1.9.3