area_business_forbid.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "area_business_forbid.h"
  2. #include"vector"
  3. #include"event.h"
  4. #include"common_tool.h"
  5. #include"area.h"
  6. #include "card.h"
  7. #include "module_call.h"
  8. //删除区域,区域上的告警事件如何清除
  9. //记录进入时间等信息,生成告警
  10. void area_business_forbid::on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr)
  11. {
  12. EVENT_TYPE ev_type = c->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON;
  13. c->set_event_flag(ev_type);
  14. }
  15. void area_business_forbid::on_enter(const std::shared_ptr<area_hover>&a,
  16. const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data>&ptr)
  17. {
  18. EVENT_TYPE ev_type = card_ptr->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON;
  19. uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id);
  20. event_tool::instance()->handle_event(OT_CARD, ev_type, id, 0, 0, true);
  21. //呼叫
  22. module_call::instance()->system_call_apoint(card_ptr->m_id,card_ptr->m_type);
  23. }
  24. void area_business_forbid::on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
  25. {
  26. }
  27. //记录退出时间等信息
  28. void area_business_forbid::on_leave(const std::shared_ptr<area_hover>&a,
  29. const std::shared_ptr<card_location_base>&card_ptr,std::shared_ptr<business_data> ptr)
  30. {
  31. EVENT_TYPE ev_type = card_ptr->is_vehicle()?ET_CARD_AREA_FORBIDDEN_VEHICLE:ET_CARD_AREA_FORBIDDEN_PERSON;
  32. uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id);
  33. event_tool::instance()->handle_event(OT_CARD, ev_type, id, 0, 0, false);
  34. //取消呼叫
  35. module_call::instance()->system_cancel_call_apoint(card_ptr->m_id,card_ptr->m_type);
  36. }