|
@@ -6,12 +6,8 @@
|
|
|
* @date 2018-10-11
|
|
|
*/
|
|
|
|
|
|
-#include <string>
|
|
|
-#include <memory>
|
|
|
-#include <atomic>
|
|
|
-#include <mutex>
|
|
|
-#include <map>
|
|
|
-#include "module_const.h"
|
|
|
+#include "module_singleton_base.h"
|
|
|
+#include "card.h"
|
|
|
|
|
|
|
|
|
class module_other_alarm:public singleton_base<module_other_alarm>
|
|
@@ -23,43 +19,9 @@ private:
|
|
|
}
|
|
|
|
|
|
public:
|
|
|
- static void power_lower_serious(std::shared_ptr<card_location_base> card_ptr)
|
|
|
- {
|
|
|
- auto ev_ptr = event_list::instance()->get_event_card(card_ptr->m_id, card_ptr->m_type, ET_CARD_LOW_POWER_SERIOUS);
|
|
|
- if(ev_ptr)
|
|
|
- {
|
|
|
- event_list::copy_event(card_ptr, ev_ptr);
|
|
|
- }
|
|
|
- else//从没有告警状态转化为告警状态
|
|
|
- {
|
|
|
- ev_ptr = event_list::create_event_card(card_ptr->m_id, card_ptr->m_type, ET_CARD_LOW_POWER_SERIOUS);
|
|
|
-
|
|
|
- event_list::copy_event(card_ptr, ev_ptr);
|
|
|
-
|
|
|
- //保存到数据库
|
|
|
- event_list::save_event(ev_ptr);
|
|
|
-
|
|
|
- event_list::instance()->add(ev_ptr->get_list_id(),ev_ptr);
|
|
|
-
|
|
|
- log_info("电量极低告警开始:卡id=%d,卡type=%d", card_ptr->m_id, card_ptr->m_type);
|
|
|
- }
|
|
|
- }
|
|
|
+ static void power_lower_serious(std::shared_ptr<card_location_base> card_ptr);
|
|
|
|
|
|
- static void power_nomarl(std::shared_ptr<card_location_base> card_ptr)
|
|
|
- {
|
|
|
- auto ev_ptr = event_list::instance()->get_event_card(card_ptr->m_id, card_ptr->m_type, ET_CARD_LOW_POWER_SERIOUS);
|
|
|
- if(ev_ptr && !ev_ptr->is_end())
|
|
|
- {
|
|
|
- event_list::copy_event(card_ptr, ev_ptr);
|
|
|
-
|
|
|
- ev_ptr->m_status = ES_END;
|
|
|
-
|
|
|
- //保存到数据库
|
|
|
- event_list::save_event(ev_ptr);
|
|
|
-
|
|
|
- log_info("电量极低告警结束:卡id=%d,卡type=%d", card_ptr->m_id, card_ptr->m_type);
|
|
|
- }
|
|
|
- }
|
|
|
+ static void power_nomarl(std::shared_ptr<card_location_base> card_ptr);
|
|
|
};
|
|
|
|
|
|
#endif // MODULE_OTHER_ALARM_H
|