SystemConfigStruct.h 4.4 KB

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