1
0

area_business_motionless_persion.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef AREA_BUSINESS_MOTIONLESS_PERSION
  2. #define AREA_BUSINESS_MOTIONLESS_PERSION
  3. /**
  4. * @brief 简要说明
  5. * @author 戴月腾
  6. * @date 2019-01-12
  7. */
  8. //#include"module_singleton_base.h"
  9. //#include"module_i_thread.h"
  10. //#include"card.h"
  11. #include"area_business.h"
  12. struct config_file;
  13. /**
  14. * @brief 一、硬件输出的状态
  15. 当完全静止时人卡会连续发送 30 次定位数据,在该定位数据中的加速度状态为 0;发送
  16. 完这一系列的定位数据之后进入休眠状态,不再发送任何定位数据。
  17. 当人卡从静止切换到运动状态会在毫秒级完成。然后 2 秒后把定位数据发上来,此时加
  18. 速度状态为 1(运动状态)。
  19. 二、处理逻辑
  20. 当连续收到 X(X 可以配置,X 建议不小于 10)次静止状态定位数据之后才认为完全静止。
  21. 经过 Y(Y 可以配置)秒之后开始告警,只要收到运动状态的定位数据就认为非静止立刻取消
  22. 告警
  23. */
  24. class area_business_motionless_persion : public area_business// : public i_thread, public singleton_base<module_motionless_persion>
  25. {
  26. // void run()
  27. // {
  28. // auto cardlist = card_list::instance()->m_map;
  29. // auto iter_m_map=cardlist.begin();
  30. // for(;iter_m_map!=cardlist.end();++iter_m_map)
  31. // {
  32. // deal_alarm(iter_m_map->second);
  33. // }
  34. // }
  35. // void deal_alarm(std::shared_ptr<card_location_base>& card_ptr);
  36. private:
  37. static int _acc_0count_limit;
  38. static int _acc_seconds_limit;
  39. public:
  40. static void init(config_file& config);
  41. void on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);
  42. void on_enter(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);
  43. void on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
  44. void on_leave(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
  45. };
  46. #endif // MODULE_MOTIONLESS_PERSION_H