|
@@ -4,12 +4,30 @@
|
|
|
|
|
|
#include "GlobalVariable.h"
|
|
|
#include "SystemConfigStruct.h"
|
|
|
+#include <string>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+enum class eSystemConfigType
|
|
|
+{
|
|
|
+ eSCT_BaseConfig = 0, // 基础配置
|
|
|
+ eSCT_CompareAI, // AI对比
|
|
|
+ eSCT_NoiseDetect, // 噪音检测
|
|
|
+ eSCT_Database, // 数据库设置
|
|
|
+ eSCT_DetectPeriod // 检测时段
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+#define Config_Base "ACAS_Base" // 基础配置
|
|
|
+#define Config_CompareAI "ACAS_CompareAI" // AI对比配置
|
|
|
+#define Config_NoiseDetect "ACAS_NoiseDetect" // 噪音检测配置
|
|
|
+#define Config_Database "ACAS_Database" // 数据库设置
|
|
|
+#define Config_DetectPeriod "ACAS_DetectPeriod" // 检测时段配置
|
|
|
|
|
|
/**
|
|
|
* @brief ACA系统的设置信息
|
|
|
*
|
|
|
*/
|
|
|
-
|
|
|
#define SysConfig SystemConfigInfo::instance()
|
|
|
|
|
|
class SystemConfigInfo
|
|
@@ -26,16 +44,28 @@ public:
|
|
|
return instance;
|
|
|
}
|
|
|
|
|
|
+ /* 系统设置类型 */
|
|
|
+ const QMap<eSystemConfigType, std::string> mapSysConfigDesc = {
|
|
|
+ {eSystemConfigType::eSCT_BaseConfig, "基础配置"},
|
|
|
+ {eSystemConfigType::eSCT_CompareAI, "AI对比设置"},
|
|
|
+ {eSystemConfigType::eSCT_NoiseDetect, "噪音检测参数"},
|
|
|
+ {eSystemConfigType::eSCT_Database, "数据库设置信息"},
|
|
|
+ {eSystemConfigType::eSCT_DetectPeriod, "检测时段信息"}
|
|
|
+ };
|
|
|
+
|
|
|
|
|
|
/* 获取未被修改的基础配置 */
|
|
|
const BaseConfig_t& getBaseConfigSrc() const { return m_baseConfigSrc; }
|
|
|
/* 设置基础配置 */
|
|
|
void setBaseConfig(const BaseConfig_t& config);
|
|
|
+ /* 将数据库的json转换成结构体 */
|
|
|
+ bool getBaseConfigFromJson(const std::string& jsonStr);
|
|
|
+ /* 将结构体转换成json */
|
|
|
+ bool setBaseConfigToJson(const BaseConfig_t& baseConfig, std::string& strJson) const;
|
|
|
|
|
|
|
|
|
public:
|
|
|
- /* 基础配置 */
|
|
|
- BaseConfig_t baseConfig;
|
|
|
+
|
|
|
|
|
|
private:
|
|
|
/* 基础配置未被修改版本 */
|