From 62a4a8db6c05c98f180ae7f6429a9a232fce6c0c Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 03 七月 2025 17:19:16 +0800
Subject: [PATCH] 1. 重构机器人动画逻辑,采用分帧动画机制,避免在 OnTimer 中阻塞主线程; 2. 动画过程中允许动态中断,确保设备状态变化时可即时响应; 3. 动画结束时自动校正位置与角度,确保最终状态准确一致;

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

diff --git a/SourceCode/Bond/Servo/RecipeManager.cpp b/SourceCode/Bond/Servo/RecipeManager.cpp
index 465c1af..48cbb56 100644
--- a/SourceCode/Bond/Servo/RecipeManager.cpp
+++ b/SourceCode/Bond/Servo/RecipeManager.cpp
@@ -238,6 +238,29 @@
     return recipes;
 }
 
+std::vector<RecipeInfo> RecipeManager::getRecipesByKeyword(const std::string& keyword) {
+    std::vector<RecipeInfo> recipes;
+    if (!m_pDB || keyword.empty()) {
+        return recipes;
+    }
+
+    std::ostringstream query;
+    query << "SELECT ppid, description, create_time FROM recipes "
+        << "WHERE ppid LIKE '%" << keyword << "%' OR description LIKE '%" << keyword << "%';";
+
+    auto rows = m_pDB->fetchResults(query.str());
+    for (const auto& row : rows) {
+        if (row.size() >= 3) {
+            RecipeInfo info;
+            info.strPPID = row[0];
+            info.strDescription = row[1];
+            info.strCreateTime = row[2];
+            recipes.push_back(info);
+        }
+    }
+    return recipes;
+}
+
 std::vector<std::string> RecipeManager::getAllPPID() const {
     std::vector<std::string> vecPPID;
 

--
Gitblit v1.9.3