SystemConfigStruct.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. strSoundCardName == other.strSoundCardName &&
  15. isEnableMultiCore == other.isEnableMultiCore &&
  16. isEnableDebugLog == other.isEnableDebugLog &&
  17. isClearDirSystemOn == other.isClearDirSystemOn &&
  18. isUsingSoundCardName == other.isUsingSoundCardName)
  19. {
  20. return true;
  21. }
  22. return false;
  23. }
  24. bool AICompareConfig_t::operator==(const AICompareConfig_t &other) const
  25. {
  26. if(&other == this)
  27. {
  28. return true; // 自身比较
  29. }
  30. if( nAiComputeDuration == other.nAiComputeDuration &&
  31. nAiCompareCount == other.nAiCompareCount &&
  32. std::abs(fNotSimilarThrehold - other.fNotSimilarThrehold) <= fespipe &&
  33. std::abs(fSimilarThrehold - other.fSimilarThrehold) <= fespipe &&
  34. bNoConsistencyAlarmOtherAlarm == other.bNoConsistencyAlarmOtherAlarm)
  35. {
  36. return true;
  37. }
  38. return false;
  39. }
  40. bool NoiseDetectBaseConfig_t::operator==(const NoiseDetectBaseConfig_t &other) const
  41. {
  42. if(&other == this)
  43. {
  44. return true;
  45. }
  46. if( strNoiseServerAddr == other.strNoiseServerAddr &&
  47. strNoiseDetectDir == other.strNoiseDetectDir &&
  48. strServerPath == other.strServerPath &&
  49. nNoiseDetectInterval == other.nNoiseDetectInterval &&
  50. isEnableNoiseDetect == other.isEnableNoiseDetect &&
  51. isEnableMainRoadDetect == other.isEnableMainRoadDetect
  52. )
  53. {
  54. return true;
  55. }
  56. return false;
  57. }
  58. bool NoiseDetectParam_t::operator==(const NoiseDetectParam_t &other) const
  59. {
  60. if(&other == this)
  61. {
  62. return true; // 自身比较
  63. }
  64. if( nNoiseOneDetectDuration == other.nNoiseOneDetectDuration &&
  65. nNoiseDetectContinueCount == other.nNoiseDetectContinueCount &&
  66. nNoiseContinueCountIsWarn == other.nNoiseContinueCountIsWarn &&
  67. nNoiseContinueCountPercent == other.nNoiseContinueCountPercent &&
  68. std::abs(dThresholdSlient - other.dThresholdSlient) <= despipe &&
  69. std::abs(dThresholdDB - other.dThresholdDB) <= despipe &&
  70. std::abs(dThresholdCV - other.dThresholdCV) <= despipe &&
  71. nPerseg == other.nPerseg &&
  72. nOverlap == other.nOverlap &&
  73. nFFT == other.nFFT
  74. )
  75. {
  76. return true;
  77. }
  78. return false;
  79. }
  80. bool DatabaseConfig_t::operator==(const DatabaseConfig_t &other) const
  81. {
  82. if(&other == this)
  83. {
  84. return true; // 自身比较
  85. }
  86. if( nRecordLogRetain == other.nRecordLogRetain &&
  87. nAlarmLogRetain == other.nAlarmLogRetain &&
  88. nOperatorLogRetain == other.nOperatorLogRetain &&
  89. nRecordFileRetain == other.nRecordFileRetain &&
  90. nAlarmFileRetain == other.nAlarmFileRetain &&
  91. nListenPort == other.nListenPort &&
  92. strRecordFilePath == other.strRecordFilePath &&
  93. strFtpPath == other.strFtpPath &&
  94. strFtpUser == other.strFtpUser &&
  95. strFtpPassword == other.strFtpPassword
  96. )
  97. {
  98. return true;
  99. }
  100. return false;
  101. }