Browse Source

修复人卡低电量告警,但是人卡页面显示正常的bug

lixioayao 5 years ago
parent
commit
3a5689a35a
2 changed files with 3 additions and 35 deletions
  1. 1 35
      card_base.cpp
  2. 2 0
      event.cpp

+ 1 - 35
card_base.cpp

@@ -158,17 +158,6 @@ void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&lo
 		m_message_handle->on_message(loop,loc,is_history);
 	}
 }
-struct ld_1318
-{
-    ld_1318(double a,double b,double c)
-        :x(a)
-        ,y(b)
-        ,speed(c)
-    {}
-    double x;
-    double y;
-    double speed;
-};
 //前端推送位置函数.
 void card_location_base::upt_card_pos(YA::_CARD_POS_&cp, point &pt)
 {
@@ -185,29 +174,6 @@ void card_location_base::upt_card_pos(YA::_CARD_POS_&cp, point &pt)
 	cp.Type=m_type;
 	cp.ID = m_id;
 
-   // if(m_type==4 &&  m_id==1318)
-   // {
-   //     static std::list<ld_1318> list_1318;
-   //     if(list_1318.size()>=60)
-   //     {
-   //         double tx=0,ty=0,ts=0;
-   //         std::for_each(list_1318.begin(),list_1318.end(),[&tx,&ty,&ts](const ld_1318& ld){
-   //                     tx+=ld.x;ty=ld.y;ts+=ld.speed;
-   //                     });
-   //         size_t n=list_1318.size();
-
-   //         tx/=n;ts/=n;
-   //         _p.set(tx,ty,0);
-   //         cp.speed = ts;
-   //         list_1318.pop_front();
-   //         log_info("get_speed:%d (%f,%f), %f",m_id,tx,ty,ts);
-   //     }
-   //     else
-   //         _p=*this;
-   //     double speed = abs((int)(m_speed*10000)/10000.);
-   //     list_1318.emplace_back(x,y,speed);
-   // }
-   // else
 	cp.speed = abs(ceil(m_speed));
 
 	cp.x = tool_other::round(_p.x,3);
@@ -234,7 +200,7 @@ int  card_location_base::get_stat()
 	//盲区>呼救>呼叫>超时>超速>正常
     uint64_t now = time(0)*1000;
     uint64_t tlost=now>m_time?now-m_time:m_time-now;
-    log_info("card_lost:%03d%010d,[%lu-%lu]tlost:%lu---%s",m_type,m_id,now,m_time,tlost,tlost>CARD_LOST_TIME_OUT?"True":"False");
+
     if(tlost>CARD_LOST_TIME_OUT)
     {
         // 人卡盲区: 当人卡丢失信号大于60s,判定人卡进入盲区

+ 2 - 0
event.cpp

@@ -374,6 +374,8 @@ void event_list::load_his_data_from_db(bool init /*=true*/)
                         }
                     }
                     c->set_event_flag(ev->m_ev_type);
+                    if(event_type_id==ET_CARD_LOW_POWER_SERIOUS)
+                        c->m_pwr_stat=STATUS_POWER_LOWER_SERIOUS;
                 } else {
                     log_warn("load_evnet_history:card_id:%s not exist...",obj_id.c_str());
                     continue;