SystemConfigStruct.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef __SYSTEMCONFIGSTRUCT_H__
  2. #define __SYSTEMCONFIGSTRUCT_H__
  3. #include <QString>
  4. #include <QMap>
  5. /* =============================================================================
  6. * 基础配置结构体
  7. * ============================================================================= */
  8. /* 不一致判断选项 */
  9. const QMap<int, QString> g_mapNotConsistency =
  10. {
  11. {1, "在其他报警时,不一致不报警且后台不进行不一致对比"},
  12. {2, "如果主通道、其他通道,二者一个噪音,一个非噪音,直接判定为不一致"},
  13. {3, "不一致对比不进行静音、反相等处理"}
  14. };
  15. /* 录音模式 */
  16. const QMap<int, QString> g_mapRecordModes =
  17. {
  18. {1, "ASIO"}
  19. };
  20. /**
  21. * @brief 基础配置结构体
  22. *
  23. */
  24. struct BaseConfig_t
  25. {
  26. QString strServerIP; /* 服务器IP地址 */
  27. int nRecordMode; /* 录音模式, ASIO等 */
  28. QString strDriverName; /* 驱动名称 */
  29. int nNotConsistency = 1; /* 不一致判断选项,默认是1 */
  30. bool isEnableMultiCore = false; /* 是否启用多核处理 */
  31. bool isEnableDebugLog = false; /* 是否启用调试日志 */
  32. bool isClearDirSystemOn = false; /* 启动服务时是否清空历史文件夹 */
  33. bool isUsingSoundCardName = false; /* 是否使用声卡名称,确定频道配置的各个通道 */
  34. bool operator==(const BaseConfig_t &other) const;
  35. };
  36. /* =============================================================================
  37. * AI对比
  38. * ============================================================================= */
  39. struct AICompareConfig_t
  40. {
  41. int nAiComputeDuration = 0; /* AI计算所需文件的时长,单位为秒 */
  42. QString strAiCompareDir; /* AI对比文件夹 */
  43. bool operator==(const AICompareConfig_t &other) const;
  44. };
  45. /* =============================================================================
  46. * 噪音检测
  47. * ============================================================================= */
  48. struct NoiseDetectBaseConfig_t
  49. {
  50. QString strNoiseServerAddr; /* 噪音检测服务器地址 */
  51. QString strNoiseDetectDir; /* 噪音检测文件夹 */
  52. QString strServerPath; /* 噪音检测服务器路径 */
  53. int nNoiseDetectDuration = 0; /* 噪音检测间隔,单位为秒 */
  54. bool isEnableNoiseDetect = false; /* 是否启用噪音检测 */
  55. bool isEnableMainRoadDetect = false;/* 是否启用主通道噪音检测 */
  56. bool operator==(const NoiseDetectBaseConfig_t &other) const;
  57. };
  58. /**
  59. * @brief 噪音检测参数
  60. *
  61. */
  62. struct NoiseDetectParam_t
  63. {
  64. QString strRegitrationCode; /* 注册码 */
  65. int nNoiseDetectContinueCount = 0; /* 噪音检测持续次数 */
  66. int nNoiseContinueCountIsWarn = 0; /* 噪音持续几次为报警 */
  67. int nNoiseContinueCountPercent = 0; /* 检测持续次数中,噪音次数占的百分比 */
  68. int nFreqComponentMini = 0; /* 噪音检测频率分量最小值 */
  69. int nFreqComponentMax = 0; /* 噪音检测频率分量最大值 */
  70. float fOneDBThreshold = 0; /* 单音量阈值 */
  71. int nOneDBComponentMini = 0; /* 单音量分量最小值 */
  72. float fNoiseThreshold = 0; /* 噪音阈值 */
  73. int nNoiseComponentMini = 0; /* 噪音分量最小值 */
  74. int nNoiseDetectDuration = 0; /* 噪音判断时长 */
  75. int nNoiseDetectPercent = 0; /* 噪音检测百分比 */
  76. int nNoiseDBMax = 0; /* 噪音最大DB值 */
  77. bool operator==(const NoiseDetectParam_t &other) const;
  78. };
  79. /* =============================================================================
  80. * 数据库配置
  81. * ============================================================================= */
  82. struct DatabaseConfig_t
  83. {
  84. int nRecordLogRetain = 0; /* 录音日志保留天数 */
  85. int nOperatorLogRetain = 0; /* 操作日志保留天数 */
  86. int nRecordFileRetain = 0; /* 录音文件保留小时数 */
  87. int nClientPort = 0; /* 客户端端口 */
  88. int nListenPort = 0; /* 监听端口 */
  89. QString strRecordFilePath; /* 录音文件路径 */
  90. bool operator==(const DatabaseConfig_t &other) const;
  91. };
  92. #endif // __SYSTEMCONFIGSTRUCT_H__