123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef _SENDSTRUCT_H_
- #define _SENDSTRUCT_H_
- #include <string>
- #include <map>
- #include "GlobalVariable.h"
- #include "ChannelParam.h"
- /**
- * @brief 对比项信息结构体
- *
- */
- // struct StCompareItemInfo
- // {
- // int compareItemID; /* 对比项ID */
- // std::string compareItemName; /* 对比项名称 */
- // std::map<ERoadID, std::string> mapRoad; /* 录音通道 */
- // /* 静音检测条件 */
- // bool isSilentSwitch; /* 静音开关 */
- // int silentThreshold; /* 静音阈值,单位:DB */
- // int silentDuration; /* 静音持续时间,单位:秒 */
- // /* 过载检测条件 */
- // bool isOverloadSwitch; /* 过载开关 */
- // int overloadThreshold; /* 过载阈值,单位:DB */
- // int overloadDuration; /* 过载持续时间,单位:秒 */
- // };
- /**
- * @brief 单个通道的音量信息结构体
- *
- */
- struct StOneRoadVolumeInfo
- {
- int bSilence;
- int bOverload;
- int bReversed;
- int m_bNoise;
- // 噪音预警
- int m_bNoiseWarning;
- // 一个音量包有30个DB
- int aryLeftDB[VOLUME_INFO_NUM];
- int aryRightDB[VOLUME_INFO_NUM];
- // 实时计算音量信息 1000毫秒30个数据,100/3毫秒(更新一次)一个数据
- int m_nLeftDBOfRealTime;
- int m_nRightDBOfRealTime;
- StOneRoadVolumeInfo();
- StOneRoadVolumeInfo& operator=(const StOneRoadVolumeInfo &obj);
- StOneRoadVolumeInfo(const StOneRoadVolumeInfo& obj);
- std::string GetString();
- std::string GetStringNoise();
- std::string GetStringNoiseWarning();
- bool isHasAlarm();
- // nDBNum要返回多少个音量值
- void GetDBString(std::string &strLeftDB, std::string &strRightDB, const uint32_t nDBNum = 10) const;
-
- };
- /**
- * @brief 需要发送的总的结构体,带有频道信息
- *
- */
- struct StSendChannelVolumeInfo
- {
- int bConsistency; /* 一致性 */
- int bNotConsistencyWarning; /* 不一致预警 */
- StOneRoadVolumeInfo road1VolumeInfo; /* 通道1的音量信息 */
- StOneRoadVolumeInfo road2VolumeInfo; /* 通道2的音量信息 */
- int bAlarm; /* 客户端界面是否报警【噪音和不一致】 */
- double dSimilarity; /* 相似度,0-100之间 */
- long m_tCurTime; /* 当前时间戳,单位:毫秒 */
- StSendChannelVolumeInfo(): bConsistency(false), bNotConsistencyWarning(false), bAlarm(true), m_tCurTime(0) { }
- StSendChannelVolumeInfo(const StSendChannelVolumeInfo& obj);
- StSendChannelVolumeInfo& operator=(const StSendChannelVolumeInfo &obj);
- std::string GetString();
- std::string GetStringNoise();
- std::string GetStringNoiseWarning();
- // 除不一致报警外,有没有其他报警
- bool isHasAlarmExcept();
- };
- #endif /* _SENDSTRUCT_H_ */
|