| | |
| | | #include <mutex> |
| | | #include <unordered_map> |
| | | #include "Database.h" |
| | | #include "CParam.h" |
| | | |
| | | |
| | | // 单个设备配方映射信息 |
| | | struct DeviceRecipe { |
| | | int nDeviceID; // 设备ID |
| | | int nRecipeID; // 子配方ID |
| | | std::string strDeviceName; // 设备名称 |
| | | std::string strRecipeName; // 子配方名称 |
| | | int nDeviceID; // 设备ID |
| | | int nRecipeID; // 子配方ID |
| | | std::string strRecipeName; // 设备名称 |
| | | std::string strDeviceName; // 子配方名称 |
| | | std::vector<uint8_t> paramsRawData; // 原始参数数据 |
| | | std::vector<CParam*> m_params; // 参数对象列表 |
| | | }; |
| | | |
| | | // 配方信息 |
| | |
| | | // 更新设备配方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); |
| | | bool addDeviceRecipe(const std::string& strDeviceName, int nID, const std::string& strName, const std::string& strPara); |
| | | bool updateDeviceRecipeName(const std::string& strDeviceName, int nID, const std::string& strNewName); |
| | | bool updateDeviceRecipePara(const std::string& strDeviceName, int nID, const std::string& strNewPara); |
| | | std::string getDeviceRecipeName(const std::string& strDeviceName, int nID); |
| | | std::string getDeviceRecipePara(const std::string& strDeviceName, int nID); |
| | | bool deleteDeviceRecipe(const std::string& strDeviceName, int nID); |
| | | std::vector<std::pair<int, std::string>> getDeviceRecipes(const std::string& strDeviceName); |
| | | |
| | | // 模拟插入数据(测试用) |
| | | void insertMockData(); |