From 95ab46e7acc80e11494f3c3796c571f77c83ed41 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 04 六月 2025 11:53:22 +0800
Subject: [PATCH] 1. 添加搬运数据到数据库 2. 添加秒级的时间戳(毫秒级使用time_t可能是负数,因为有符号),防止使用strftime闪退 3. 实时更新搬运记录界面

---
 SourceCode/Bond/Servo/CEqReadStep.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEqReadStep.cpp b/SourceCode/Bond/Servo/CEqReadStep.cpp
index 854338e..e94ba79 100644
--- a/SourceCode/Bond/Servo/CEqReadStep.cpp
+++ b/SourceCode/Bond/Servo/CEqReadStep.cpp
@@ -27,9 +27,10 @@
 	{
 		CReadStep::getAttributeVector(attrubutes);
 
+		unsigned int weight = 31;
 		std::string strTemp;
 		attrubutes.addAttribute(new CAttribute("Dev",
-			("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), ""));
+			("W" + CToolUnits::toHexString(m_nDataDev, strTemp)).c_str(), "", weight++));
 	}
 
 	int CEqReadStep::onReadData()
@@ -43,14 +44,14 @@
 		if (0 != nRet) {
 			LOGI("<CEqReadStep>Read data error.");
 			if (m_onReadBlock != nullptr) {
-				m_onReadBlock(RERROR, nullptr, 0);
+				m_onReadBlock(this, RERROR, nullptr, 0);
 			}
 			return -1;
 		}
 
 		LOGI("<CEqReadStep>read data succeed.");
 		if (m_onReadBlock != nullptr) {
-			m_onReadBlock(ROK, szBuffer, m_nReadSize);
+			m_onReadBlock(this, ROK, szBuffer, m_nReadSize);
 		}
 
 
@@ -62,7 +63,7 @@
 		CReadStep::onComplete();
 		LOGI("<CEqReadStep> onComplete.");
 		if (m_onReadBlock != nullptr) {
-			m_onReadBlock(RCOMPLETE, nullptr, 0);
+			m_onReadBlock(this, RCOMPLETE, nullptr, 0);
 		}
 
 		return 0;
@@ -73,7 +74,7 @@
 		CReadStep::onTimeout();
 		LOGI("<CEqReadStep> onTimeout.");
 		if (m_onReadBlock != nullptr) {
-			m_onReadBlock(RTIMEOUT, nullptr, 0);
+			m_onReadBlock(this, RTIMEOUT, nullptr, 0);
 		}
 
 		return 0;

--
Gitblit v1.9.3