123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #ifndef __SYSTEMCONFIGSTRUCT_H__
- #define __SYSTEMCONFIGSTRUCT_H__
- #include <QString>
- #include <QMap>
- #include "GlobalVariable.h"
- /* =============================================================================
- * 基础配置结构体
- * ============================================================================= */
- /* 不一致判断选项 */
- const QMap<int, QString> g_mapNotConsistency =
- {
- {1, "在其他报警时,不一致不报警且后台不进行不一致对比"},
- {2, "如果主通道、其他通道,二者一个噪音,一个非噪音,直接判定为不一致"},
- {3, "不一致对比不进行静音、反相等处理"}
- };
- /* 录音模式 */
- const QMap<int, QString> 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
- {
- int nNoiseOneDetectDuration = 0; /* 单次噪音检测时长,单位为秒 */
- int nNoiseDetectContinueCount = 0; /* 噪音检测持续次数 */
- int nNoiseContinueCountIsWarn = 0; /* 噪音持续几次为报警 */
- int nNoiseContinueCountPercent = 0; /* 检测持续次数中,噪音次数占的百分比 */
-
- double dThresholdSlient = 0; /* 静音阈值 */
- double dThresholdDB = 0; /* 分贝阈值 */
- double dThresholdCV = 0; /* 变异系数阈值 */
- int nPerseg = 0; /* 每段样本数 */
- int nOverlap = 0; /* 重叠样本数 */
- int nFFT= 0; /* FFT点数 */
- 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__
|