You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.1 KiB
67 lines
2.1 KiB
#ifndef __KERNEL_MODULE_ATTENTION_CLOUD__
|
|
#define __KERNEL_MODULE_ATTENTION_CLOUD__
|
|
|
|
#include "kernelModule.h"
|
|
#include "../../components/base/basicThread.h"
|
|
#include "../../components/base/basicMutex.h"
|
|
#include "../../components/base/basicEventHeap.h"
|
|
#include <vector>
|
|
|
|
#define ATTENTION_STATUS_NEW 0
|
|
#define ATTENTION_STATUS_SHOWING 1
|
|
#define ATTENTION_STATUS_RESTING 2
|
|
#define ATTENTION_STATUS_ZOMBIE 3
|
|
|
|
typedef struct S_AttentionTarget{
|
|
float temperature;
|
|
}AttentionTarget;
|
|
|
|
typedef std::vector<AttentionTarget *> AttentionTargets;
|
|
|
|
typedef struct S_CamCtlArea{
|
|
uint64_t cam_id;
|
|
uint64_t lts;
|
|
C3D_DECART loc;
|
|
float range;
|
|
basicMutex block;
|
|
bool busy;
|
|
}CamCtlArea;
|
|
|
|
typedef struct S_AttentionZone{
|
|
C3D_DECART loc;
|
|
float range;
|
|
uint64_t ts;
|
|
uint8_t status;
|
|
CamCtlArea * cam_ctl;
|
|
}AttentionZone;
|
|
|
|
typedef std::vector<AttentionZone *> AttentionCloud;
|
|
typedef std::vector<CamCtlArea *> CamCtlAreas;
|
|
|
|
class kernelAttentionCloud : public kernelModule, public basicThread {
|
|
private:
|
|
basicEventHeap * m_pEvtHeap;
|
|
AttentionCloud m_vCloud;
|
|
CamCtlAreas m_vCameras;
|
|
DBC_ATC_MODULE_DATA m_sModuleData;
|
|
basicMutex m_mCloudsProtector;
|
|
bool isCamBusy( uint64_t cam_id );
|
|
bool registerAttention( /*uint32_t TargetRefID,*/ C3D_DECART L );
|
|
bool checkLocation( C3D_DECART BASE, C3D_DECART N, float range );
|
|
bool createMoveToEvt( uint32_t cam_id, C3D_DECART L );
|
|
AttentionZone * getOldest();
|
|
bool loadCameras();
|
|
bool deleteCameras();
|
|
protected:
|
|
void m_fThreadProc(void);
|
|
public:
|
|
explicit kernelAttentionCloud( uint32_t id );
|
|
~kernelAttentionCloud();
|
|
virtual bool reloadSettings();
|
|
virtual bool startService();
|
|
virtual bool stopService(bool force = false);
|
|
virtual bool validate();
|
|
virtual bool dispatchEvent(EVENT_CONTAINER * Evt);
|
|
};
|
|
|
|
#endif
|