| #ifndef APPPACONTROLLER_H | 
| #define APPPACONTROLLER_H | 
|   | 
| #include <basic/pipe/PipeController.h> | 
| #include <basic/pipe_element/ffmpeg/FfmpegElement.h> | 
| #include <basic/pipe_element/ImageShowElement.h> | 
| #include <basic/util/curl/HttpRequestWithCrul.hpp> | 
| #include "PaImageDrawElement.h" | 
| #include "../StructureApp/RecordVideoElement.h" | 
| #include "PaYoloRpcElement.h" | 
| #include <TriggerElement.h> | 
| #include <QtCore/QDateTime> | 
| #include <jsoncpp/json/json.h> | 
| //#include <basic/rpc/IceRpc.hpp> | 
| //#include "../Alarm/rpc/Alarm.h" | 
| //#include "../netsoundbox/rpc/NetSoundBox.h" | 
| //#include <QtCore/QVector> | 
| //网络音箱配置 | 
| struct SoundPlayInfo | 
| { | 
|     SoundPlayInfo():nSoundDuration(-1) | 
|     {} | 
|     //int nID; | 
|     std::string strIP;//音箱IP | 
|     int nSoundDuration;//声音间隔时间 | 
|     std::string strPath;//声音路径 | 
| }; | 
| //摄像头信息 | 
| struct CamInfo | 
| { | 
|     int nFps;//帧率 | 
|     std::string strCamId; | 
|     std::string strAdrr; | 
|     std::string strRtsp;//RTSP地址 | 
| }; | 
|   | 
| //报警信息 | 
| struct PaAlarmInfo | 
| { | 
| //    int nWallNum;//墙号 | 
| //    int nWallSubNum;//子墙号 | 
| //    int nWindowNum;//窗口号 | 
|     int nTriggerDelay;//报警开始延时时间间隔 | 
|     int nAlarmDelay;//报警结束延时时间间隔 | 
|     QString strMaskPath; //alarm maskPath解码器报警的ROI区域小图路径 | 
|     float fSensitivity;//alarm sensitivity报警的检测阈值 | 
|     int nAssembleCount;//聚集的人数 | 
| }; | 
|   | 
| //聚集信息 | 
| struct AssembleInfo | 
| { | 
|     int nAssembleCount;//聚集的人数 | 
|     float fSensitivity;//AssembleInfo sensitivity聚集的检测阈值 | 
|     //std::string strProxy; | 
|     std::string strMaskPath;// AssembleInfo maskPath聚集的ROI区域小图路径 | 
|     std::vector<SoundPlayInfo> sounds;//网络音箱播放信息 | 
| }; | 
|   | 
| struct RuleWeekInfo | 
| { | 
|     RuleWeekInfo() | 
|     { | 
|         m_nType = 1; | 
|         m_strBegin = ""; | 
|         m_strEnd = ""; | 
|     } | 
|   | 
|     int m_nType; //周几 | 
|     QString m_strBegin;//00:00 | 
|     QString m_strEnd; | 
| }; | 
| //addcamera配置项 | 
| struct ControllerConfig | 
| { | 
|   | 
|     //NONE neither alarm nor assemble | 
|     //ALARM alarm | 
|     //ASSEMBLE Assemble | 
|   | 
|     //camInfo | 
|     CamInfo camInfo;//摄像头信息 | 
|   | 
|     //alarmInfo | 
|     PaAlarmInfo paAlarmInfo;//报警信息 | 
|   | 
|     //AssembleInfo | 
|   //  AssembleInfo assembleInfo;//聚集信息 | 
|   | 
|     QVector<RuleWeekInfo> ruleWeekInfoVec; | 
|   | 
| }; | 
|   | 
| class AppPaController : public PipeController { | 
| public: | 
|     /*** | 
|      * 用于快速视频结构化 | 
|      * @param folderPath 任务根目录,用于做共享内存id | 
|      * @param json 参数为rtsp流地址 sdk是否启用的标识 | 
|      */ | 
|   | 
|     AppPaController(int index, const ControllerConfig& cfg); | 
|   | 
|     virtual ~AppPaController(); | 
|   | 
|     void sendVideoAlarm(bool value); | 
|     //通知报警服务报警 | 
|     void openSoundAlarm(); | 
|     //通知报警服务关闭报警 | 
|     void closeSoundAlarm(); | 
|     //通知网络音箱播放音乐 | 
|     void playSound(); | 
|     //通知网络音箱停止播放音乐 | 
|     void stopSound(); | 
|   | 
|     //void alarmResultSaveToDB(std::string&,std::string&,std::string&); | 
|   | 
|     //保存人体裁剪图 | 
|     static int saveRectsImage(const vector<cv::Rect2f>& rects,const cv::Mat& img,const char* path); | 
|   | 
|   | 
|     bool isSaveVideo(); | 
|   | 
|     bool isSaveResult(); | 
|   | 
|     bool isSaveImage(); | 
|   | 
|   | 
|     bool getRunning(); | 
|   | 
|     std::string getRtmp(); | 
|   | 
|     void setfdfsClient(FastFdsWithLock *p_fdfsClient); | 
|   | 
| private: | 
|     void init(); | 
|   | 
| private: | 
|     ffmpeg::VideoCaptureElement videoCaptureElement; | 
|     PaYoloRpcElement yoloRpcElement; | 
|     PaImageDrawElement imageDrawElement; | 
|     RecordVideoElement recordVideoElement; | 
| //    VideoPublishElement videoPublishElement; | 
|   | 
|     int m_index; | 
|     std::string m_folderPath; | 
|     Json::Value m_json_Record; | 
|   | 
|     Json::FastWriter m_fastWriter; | 
|     FastFdsWithLock *fdfsClient; | 
|   | 
|   | 
|     TriggerElement triggerElement; | 
|     std::atomic<bool> bUp; | 
|   | 
|     QDateTime m_dt; | 
|   | 
|   | 
|     const ControllerConfig m_cfg; | 
|   | 
|   //  NetSoundBox::SoundInfos soundInfos; | 
| //    IceRpcClient<Alarm::AlarmInterfacePrx> alarmRpc; | 
| //    IceRpcClient<NetSoundBox::SoundInterfacePrxPtr> soundRpc; | 
|   //  IceRpcClient<SaveModule::SaveAlarmPrx> m_SaveAlarmRpc; | 
|   | 
| }; | 
|   | 
| #endif // APPPIPECONTROLLER_H |