| | |
| | | */ |
| | | void termRuntimeSetting(); |
| | | |
| | | /** |
| | | * 初始化指定的 SystemV 表 |
| | | * @param tableName: 要初始化的表名(如 "SystemSV" 或 "SystemDV")。 |
| | | * |
| | | * 此函数用于初始化指定名称的 SystemV 表。如果表不存在,将会创建该表。 |
| | | * - 表结构包括:ID、Name、DataType、Length、Unit、Remark、SystemID。 |
| | | * - 如果表已经存在,则不进行任何操作。 |
| | | */ |
| | | void initSystemVTable(const std::string& tableName); |
| | | |
| | | int addSystemVData(const std::string& tableName, int nID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSystemID); |
| | | |
| | | std::vector<std::vector<std::string>> getSystemVByID(const std::string& tableName, int nID); |
| | | |
| | | std::vector<std::vector<std::string>> getAllSystemV(const std::string& tableName); |
| | | |
| | | int updateIDSystemV(const std::string& tableName, int nID, int sNewID); |
| | | |
| | | int updateAllSystemV(const std::string& tableName, int nID, int sNewID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSystemID); |
| | | |
| | | void initEqpVTable(const std::string& tableName); |
| | | |
| | | int addEqpVData(const std::string& tableName, int nID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSeqNo); |
| | | |
| | | std::vector<std::vector<std::string>> getEqpVDataByID(const std::string& tableName, int nID); |
| | | |
| | | int updateEqpV(const std::string& tableName, int nID, int nNewID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSeqNo); |
| | | |
| | | /** |
| | | * 初始化SystemSV表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取所有 EqpSV 数据 |
| | | * @return std::vector<std::vector<std::string>>: 返回一个二维字符串向量,表示查询结果。每行代表一条记录,每列代表该记录的一个字段值。 |
| | | * 如果表中有数据,则返回所有记录;如果表为空,则返回空的二维向量。 |
| | | * |
| | | * 此函数用于从 EqpSV 表中获取所有的数据。通过构造 SQL 查询语句来选择所有记录,并执行查询操作。 |
| | | * 返回的结果是一个二维字符串向量,表示表中的所有记录。每行数据是一个字符串向量,其中包含该记录的各个字段。 |
| | | * 如果表中没有数据,函数将返回一个空的二维向量。 |
| | | */ |
| | | std::vector<std::vector<std::string>> SECSRuntimeManager::getAllEqpSV(); |
| | | bool getAllEqpSV(std::vector<std::vector<std::string>>& outEqpSV); |
| | | |
| | | /** |
| | | * 更新指定 ID 的 EqpSV 数据 |
| | |
| | | */ |
| | | void initSystemDVTable(); |
| | | |
| | | int addSystemDV(int nID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSystemID); |
| | | |
| | | std::vector<std::vector<std::string>> getSystemDVByID(int nID); |
| | | |
| | | std::vector<std::vector<std::string>> getAllSystemDV(); |
| | | |
| | | int updateIDSystemDV(int nID, int sNewID); |
| | | |
| | | int updateAllSystemDV(int nID, int sNewID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSystemID); |
| | | |
| | | int deleteSystemDVByID(int nID); |
| | | |
| | | int deleteAllSystemDV(); |
| | | |
| | | /** |
| | | * 初始化 EqpDV 表 |
| | | */ |
| | | void initEqpDVTable(); |
| | | |
| | | int addEqpDV(int nID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSeqNo); |
| | | |
| | | std::vector<std::vector<std::string>> getEqpDVByID(int nID); |
| | | |
| | | bool getAllEqpDV(std::vector<std::vector<std::string>>& outEqpDV); |
| | | |
| | | int updateEqpDV(int nID, int nNewID, const std::string& sName, const std::string& sDataType, int nLength, const std::string& sUnit, const std::string& sRemark, int nSeqNo); |
| | | |
| | | int deleteEqpDVByID(int nID); |
| | | |
| | | int deleteAllEqpDV(); |
| | | |
| | | /** |
| | | * 初始化 SystemEC 表 |
| | |
| | | // 判断名称是否重复 |
| | | bool isNameDuplicate(const std::string& sName); |
| | | |
| | | // 删除指定表中的所有数据 |
| | | int deleteAllDataFromTable(const std::string& tableName); |
| | | |
| | | // 查询指定表所有数据(通用函数) |
| | | bool getAllDataFromTable(const std::string& tableName, std::vector<std::vector<std::string>>& outData); |
| | | |
| | | // 删除指定表中指定 ID 的数据 |
| | | int deleteDataByID(const std::string& tableName, int nID); |
| | | |
| | | BL::Database* m_pDB; |
| | | static std::mutex m_mutex; |
| | | }; |