module_other_alarm.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "module_other_alarm.h"
  2. #include "event.h"
  3. #include "common_tool.h"
  4. #include "log.h"
  5. /*
  6. * @brief 低电量报警
  7. * @param std::shared_ptr<card_location_base> card_ptr 卡对象
  8. * @return 无
  9. * @note
  10. * @warning
  11. * @bug
  12. * */
  13. void module_other_alarm::power_lower_serious(std::shared_ptr<card_location_base> card_ptr)
  14. {
  15. //如果车辆,不提供电量极低报警
  16. if(card_ptr->m_type == CT_VEHICLE){
  17. return;
  18. }
  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, ET_CARD_LOW_POWER_SERIOUS, id, 0, 0, true);
  21. }
  22. /*
  23. * @brief 电量正常时,取消电量低报警
  24. * @param std::shared_ptr<card_location_base> card_ptr
  25. * @return 无
  26. * @note
  27. * @warning
  28. * @bug
  29. * */
  30. void module_other_alarm::power_normal(std::shared_ptr<card_location_base> card_ptr)
  31. {
  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, ET_CARD_LOW_POWER_SERIOUS, id, 0, 0, false);
  34. }