#include "area_business_forbid.h" #include"vector" #include"event.h" #include"common_tool.h" #include"area.h" #include "card.h" #include "module_call.h" //删除区域,区域上的告警事件如何清除 //记录进入时间等信息,生成告警 void area_business_forbid::on_load_his(const std::shared_ptr&a,const std::shared_ptr&c,std::shared_ptr&ptr) { EVENT_TYPE ev_type = c->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON; c->set_event_flag(ev_type); } void area_business_forbid::on_enter(const std::shared_ptr&a, const std::shared_ptr&card_ptr,std::shared_ptr&ptr) { EVENT_TYPE ev_type = card_ptr->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON; uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id); event_tool::instance()->handle_event(OT_CARD, ev_type, id, 0, 0, true); //呼叫 module_call::instance()->system_call_apoint(card_ptr->m_id,card_ptr->m_type); } void area_business_forbid::on_hover(const std::shared_ptr&a,const std::shared_ptr&c,std::shared_ptr ptr) { } //记录退出时间等信息 void area_business_forbid::on_leave(const std::shared_ptr&a, const std::shared_ptr&card_ptr,std::shared_ptr ptr) { EVENT_TYPE ev_type = card_ptr->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON; uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id); event_tool::instance()->handle_event(OT_CARD, ev_type, id, 0, 0, false); //取消呼叫 module_call::instance()->system_cancel_call_apoint(card_ptr->m_id,card_ptr->m_type); }