Browse Source

修复供电告警当加载历史后,供电恢复正常。导致得告警不取消得bug

lixioayao 5 years ago
parent
commit
3fcc87c7ff
1 changed files with 4 additions and 1 deletions
  1. 4 1
      event.cpp

+ 4 - 1
event.cpp

@@ -347,7 +347,10 @@ void event_list::load_his_data_from_db()
                 uint64_t c_id= tool_other::card_id_to_u64(ev->m_obj_id);
                 if(auto c=card_list::instance()->get(c_id))
                     c->set_event_flag(ev->m_ev_type);
-            }  
+            } 
+            if(ev->m_ev_type==ET_READER_POWER_BY_BATTERY)
+                if(auto r=sit_list::instance()->get(std::stoi(obj_id)))
+                    r->m_power_ac_down=true;
             
             map.insert(std::make_pair(id, ev));
             log_info("event_list %lld,%lld,%d,%d,%d,%s,%d,%d,%d,%.2f,%.2f,%.2f,%.2f,%s"