SystemConfigStruct.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #include "SystemConfigStruct.h"
  2. #include <cstdlib>
  3. /* =============================================================================
  4. * 基础配置结构体
  5. * ============================================================================= */
  6. bool BaseConfig_t::operator==(const BaseConfig_t &other) const
  7. {
  8. if(&other == this)
  9. {
  10. return true; // 自身比较
  11. }
  12. if(strServerIP == other.strServerIP &&
  13. nRecordMode == other.nRecordMode &&
  14. strDriverName == other.strDriverName &&
  15. nNotConsistency == other.nNotConsistency &&
  16. isEnableMultiCore == other.isEnableMultiCore &&
  17. isEnableDebugLog == other.isEnableDebugLog &&
  18. isClearDirSystemOn == other.isClearDirSystemOn &&
  19. isUsingSoundCardName == other.isUsingSoundCardName)
  20. {
  21. return true;
  22. }
  23. return false;
  24. }
  25. bool AICompareConfig_t::operator==(const AICompareConfig_t &other) const
  26. {
  27. if(&other == this)
  28. {
  29. return true; // 自身比较
  30. }
  31. if( nAiComputeDuration == other.nAiComputeDuration &&
  32. nAiCompareCount == other.nAiCompareCount &&
  33. std::abs(fNotSimilarThrehold - other.fNotSimilarThrehold) <= fespipe &&
  34. std::abs(fSimilarThrehold - other.fSimilarThrehold) <= fespipe &&
  35. bNoConsistencyAlarmOtherAlarm == other.bNoConsistencyAlarmOtherAlarm)
  36. {
  37. return true;
  38. }
  39. return false;
  40. }
  41. bool NoiseDetectBaseConfig_t::operator==(const NoiseDetectBaseConfig_t &other) const
  42. {
  43. if(&other == this)
  44. {
  45. return true;
  46. }
  47. if( strNoiseServerAddr == other.strNoiseServerAddr &&
  48. strNoiseDetectDir == other.strNoiseDetectDir &&
  49. strServerPath == other.strServerPath &&
  50. nNoiseDetectInterval == other.nNoiseDetectInterval &&
  51. isEnableNoiseDetect == other.isEnableNoiseDetect &&
  52. isEnableMainRoadDetect == other.isEnableMainRoadDetect
  53. )
  54. {
  55. return true;
  56. }
  57. return false;
  58. }
  59. bool NoiseDetectParam_t::operator==(const NoiseDetectParam_t &other) const
  60. {
  61. if(&other == this)
  62. {
  63. return true; // 自身比较
  64. }
  65. if( nNoiseOneDetectDuration == other.nNoiseOneDetectDuration &&
  66. nNoiseDetectContinueCount == other.nNoiseDetectContinueCount &&
  67. nNoiseContinueCountIsWarn == other.nNoiseContinueCountIsWarn &&
  68. nNoiseContinueCountPercent == other.nNoiseContinueCountPercent &&
  69. std::abs(dThresholdSlient - other.dThresholdSlient) <= despipe &&
  70. std::abs(dThresholdDB - other.dThresholdDB) <= despipe &&
  71. std::abs(dThresholdCV - other.dThresholdCV) <= despipe &&
  72. nPerseg == other.nPerseg &&
  73. nOverlap == other.nOverlap &&
  74. nFFT == other.nFFT
  75. )
  76. {
  77. return true;
  78. }
  79. return false;
  80. }
  81. bool DatabaseConfig_t::operator==(const DatabaseConfig_t &other) const
  82. {
  83. if(&other == this)
  84. {
  85. return true; // 自身比较
  86. }
  87. if( nRecordLogRetain == other.nRecordLogRetain &&
  88. nOperatorLogRetain == other.nOperatorLogRetain &&
  89. nRecordFileRetain == other.nRecordFileRetain &&
  90. nClientPort == other.nClientPort &&
  91. nListenPort == other.nListenPort &&
  92. strRecordFilePath == other.strRecordFilePath &&
  93. strFtpPath == other.strFtpPath
  94. )
  95. {
  96. return true;
  97. }
  98. return false;
  99. }