#ifndef __SYSTEMCONFIGSTRUCT_H__ #define __SYSTEMCONFIGSTRUCT_H__ #include #include #include "GlobalVariable.h" /* ============================================================================= * 基础配置结构体 * ============================================================================= */ /* 不一致判断选项 */ const QMap g_mapNotConsistency = { {1, "在其他报警时,不一致不报警且后台不进行不一致对比"}, {2, "如果主通道、其他通道,二者一个噪音,一个非噪音,直接判定为不一致"}, {3, "不一致对比不进行静音、反相等处理"} }; /* 录音模式 */ const QMap g_mapRecordModes = { {1, "ASIO"} }; /** * @brief 基础配置结构体 * */ struct BaseConfig_t { QString strServerIP; /* 服务器IP地址 */ int nRecordMode; /* 录音模式, ASIO等 */ QString strDriverName; /* 驱动名称 */ int nNotConsistency = 1; /* 不一致判断选项,默认是1 */ bool isEnableMultiCore = false; /* 是否启用多核处理 */ bool isEnableDebugLog = false; /* 是否启用调试日志 */ bool isClearDirSystemOn = false; /* 启动服务时是否清空历史文件夹 */ bool isUsingSoundCardName = false; /* 是否使用声卡名称,确定频道配置的各个通道 */ bool operator==(const BaseConfig_t &other) const; }; /* ============================================================================= * AI对比 * ============================================================================= */ struct AICompareConfig_t { int nAiComputeDuration = 0; /* AI计算所需文件的时长,单位为秒 */ QString strAiCompareDir; /* AI对比文件夹 */ bool operator==(const AICompareConfig_t &other) const; }; /* ============================================================================= * 噪音检测 * ============================================================================= */ struct NoiseDetectBaseConfig_t { QString strNoiseServerAddr; /* 噪音检测服务器地址 */ QString strNoiseDetectDir; /* 噪音检测文件夹 */ QString strServerPath; /* 噪音检测服务器路径 */ int nNoiseDetectDuration = 0; /* 噪音检测间隔,单位为秒 */ bool isEnableNoiseDetect = false; /* 是否启用噪音检测 */ bool isEnableMainRoadDetect = false;/* 是否启用主通道噪音检测 */ bool operator==(const NoiseDetectBaseConfig_t &other) const; }; /** * @brief 噪音检测参数 * */ struct NoiseDetectParam_t { QString strRegitrationCode; /* 注册码 */ int nNoiseDetectContinueCount = 0; /* 噪音检测持续次数 */ int nNoiseContinueCountIsWarn = 0; /* 噪音持续几次为报警 */ int nNoiseContinueCountPercent = 0; /* 检测持续次数中,噪音次数占的百分比 */ int nFreqComponentMini = 0; /* 噪音检测频率分量最小值 */ int nFreqComponentMax = 0; /* 噪音检测频率分量最大值 */ float fOneDBThreshold = 0; /* 单音量阈值 */ int nOneDBComponentMini = 0; /* 单音量分量最小值 */ float fNoiseThreshold = 0; /* 噪音阈值 */ int nNoiseComponentMini = 0; /* 噪音分量最小值 */ int nNoiseDetectDuration = 0; /* 噪音判断时长 */ int nNoiseDetectPercent = 0; /* 噪音检测百分比 */ int nNoiseDBMax = 0; /* 噪音最大DB值 */ bool operator==(const NoiseDetectParam_t &other) const; }; /* ============================================================================= * 数据库配置 * ============================================================================= */ struct DatabaseConfig_t { int nRecordLogRetain = 0; /* 录音日志保留天数 */ int nOperatorLogRetain = 0; /* 操作日志保留天数 */ int nRecordFileRetain = 0; /* 录音文件保留小时数 */ int nClientPort = 0; /* 客户端端口 */ int nListenPort = 0; /* 监听端口 */ QString strRecordFilePath; /* 录音文件路径 */ bool operator==(const DatabaseConfig_t &other) const; }; #endif // __SYSTEMCONFIGSTRUCT_H__