From 96579a48b3b558f5ce58cffe372b1f563a9e62ce Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 03 九月 2025 17:23:56 +0800
Subject: [PATCH] 1.配方列表和配方参数获取合并在线程中获取,并更新状态到对话框; 2.配方参数获取; 3.Bonder, AOI, 真空烘烤, 冷却烧烤配方参数解释。
---
SourceCode/Bond/Servo/RecipeManager.h | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/RecipeManager.h b/SourceCode/Bond/Servo/RecipeManager.h
index a51e14d..41d8f02 100644
--- a/SourceCode/Bond/Servo/RecipeManager.h
+++ b/SourceCode/Bond/Servo/RecipeManager.h
@@ -6,12 +6,14 @@
#include <mutex>
#include <unordered_map>
#include "Database.h"
+#include "CParam.h"
+
// 单个设备配方映射信息
struct DeviceRecipe {
int nDeviceID; // 设备ID
- int nRecipeID; // 该设备对应的子配方ID
- std::string strPPID; // 配方ID(主键)
+ int nRecipeID; // 子配方ID
+ std::string strRecipeName; // 子配方名称
std::string strDeviceName; // 设备名称
};
@@ -21,6 +23,23 @@
std::string strDescription; // 配方描述
std::string strCreateTime; // 创建时间
std::vector<DeviceRecipe> vecDeviceList; // 关联的设备信息列表
+ std::vector<CParam*> m_params; // 出站时记录参数
+ void RecipeInfo::addIntParam(const char* pszName, const char* pszId, const char* pszUnit, int value)
+ {
+ CParam* pParam = new CParam(pszName, pszId, pszUnit, value);
+ m_params.push_back(pParam);
+ }
+
+ void RecipeInfo::addDoubleParam(const char* pszName, const char* pszId, const char* pszUnit, double value)
+ {
+ CParam* pParam = new CParam(pszName, pszId, pszUnit, value);
+ m_params.push_back(pParam);
+ }
+
+ std::vector<CParam*>& RecipeInfo::getParams()
+ {
+ return m_params;
+ }
};
using RecipeMap = std::unordered_map<std::string, RecipeInfo>; // 按 PPID 映射的配方表
@@ -58,6 +77,12 @@
// 查询所有配方
std::vector<RecipeInfo> getAllRecipes();
+ // 根据 PPID 或描述查询配方
+ std::vector<RecipeInfo> getRecipesByKeyword(const std::string& keyword);
+
+ // 获取所有 PPID
+ std::vector<std::string> getAllPPID() const;
+
// 按 PPID 查询配方
RecipeInfo getRecipeByPPID(const std::string& ppid);
--
Gitblit v1.9.3