From bb13ecc602edb0247f65a1362135e4ef70a5a79f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 06 六月 2025 13:50:15 +0800
Subject: [PATCH] Merge branch 'master' into clh

---
 SourceCode/Bond/Servo/CRobotTask.cpp |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/CRobotTask.cpp b/SourceCode/Bond/Servo/CRobotTask.cpp
index 6a223de..a33cc40 100644
--- a/SourceCode/Bond/Servo/CRobotTask.cpp
+++ b/SourceCode/Bond/Servo/CRobotTask.cpp
@@ -8,7 +8,7 @@
 	{
 		generateId(m_strId);
 		m_state = ROBOT_TASK_STATE::Ready;
-		m_timeCreate = CToolUnits::getTimestamp();
+		m_timeCreate = CToolUnits::getUnixTimestamp();
 		m_timeFetchOut = 0;
 		m_timeStored = 0;
 		m_timeFinish = 0;
@@ -63,8 +63,8 @@
 
 	void CRobotTask::setContext(CContext* pContext)
 	{
-		if (pContext != nullptr) {
-			pContext->release();
+		if (m_pContext != nullptr) {
+			m_pContext->release();
 		}
 
 		m_pContext = pContext;
@@ -174,13 +174,25 @@
 		return m_robotCmdParam.putSlotNo;
 	}
 
+	CString CRobotTask::getStateString()
+	{
+		switch (m_state) {
+		case ROBOT_TASK_STATE::Ready:     return _T("Ready");
+		case ROBOT_TASK_STATE::Running:   return _T("Running");
+		case ROBOT_TASK_STATE::Error:     return _T("Error");
+		case ROBOT_TASK_STATE::Abort:     return _T("Abort");
+		case ROBOT_TASK_STATE::Completed: return _T("Completed");
+		default:                          return _T("Unknown");
+		}
+	}
+
 	void CRobotTask::fetchOut()
 	{
-		m_timeFetchOut = CToolUnits::getTimestamp();;
+		m_timeFetchOut = CToolUnits::getUnixTimestamp();;
 	}
 
 	void CRobotTask::stored()
 	{
-		m_timeStored = CToolUnits::getTimestamp();;
+		m_timeStored = CToolUnits::getUnixTimestamp();;
 	}
 }

--
Gitblit v1.9.3