From 8d492d8d449d6aaff1825a99055298682ebf71b7 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期二, 02 九月 2025 09:55:49 +0800
Subject: [PATCH] 1. 配方数据库管理表里面添加ID(下发JobDataS) 2. 如果任务没有创建,那么配方是当前选择的(不是默认第一个)
---
SourceCode/Bond/Servo/RecipeManager.h | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/RecipeManager.h b/SourceCode/Bond/Servo/RecipeManager.h
index a51e14d..008a1fd 100644
--- a/SourceCode/Bond/Servo/RecipeManager.h
+++ b/SourceCode/Bond/Servo/RecipeManager.h
@@ -10,9 +10,9 @@
// 单个设备配方映射信息
struct DeviceRecipe {
int nDeviceID; // 设备ID
- int nRecipeID; // 该设备对应的子配方ID
- std::string strPPID; // 配方ID(主键)
+ int nRecipeID; // 子配方ID
std::string strDeviceName; // 设备名称
+ std::string strRecipeName; // 子配方名称
};
// 配方信息
@@ -58,6 +58,18 @@
// 查询所有配方
std::vector<RecipeInfo> getAllRecipes();
+ // 根据 PPID 或描述查询配方
+ std::vector<RecipeInfo> getRecipesByKeyword(const std::string& keyword);
+
+ // 获取所有 PPID
+ std::vector<std::string> getAllPPID() const;
+
+ // 按 ID 查询 PPID
+ std::string getPPIDById(int nId);
+
+ // 按 PPID 查询 ID
+ int getIdByPPID(const std::string& ppid);
+
// 按 PPID 查询配方
RecipeInfo getRecipeByPPID(const std::string& ppid);
@@ -85,6 +97,12 @@
// 更新设备配方ID(通过 PPID 和设备名称)
bool updateDeviceRecipeIDByName(const std::string& ppid, const std::string& strDeviceName, int nNewRecipeID);
+ bool addDeviceRecipe(const std::string& deviceName, int nRecipeID, const std::string& strRecipeName);
+ bool updateDeviceRecipe(const std::string& deviceName, int nRecipeID, const std::string& newName);
+ std::string getDeviceRecipeName(const std::string& deviceName, int nRecipeID);
+ bool deleteDeviceRecipe(const std::string& deviceName, int nRecipeID);
+ std::vector<std::pair<int, std::string>> getDeviceRecipes(const std::string& deviceName);
+
// 模拟插入数据(测试用)
void insertMockData();
--
Gitblit v1.9.3