|
@@ -53,15 +53,15 @@ void car::set_area_info(int mapid,double scale,int areaid,uint64_t t,int type)
|
|
|
* */
|
|
|
void car::do_business(const std::shared_ptr<site>&site,const point &pt,double acc)
|
|
|
{
|
|
|
- m_acc=acc;
|
|
|
+ m_acc = acc;
|
|
|
m_area_tool->on_point(shared_from_this(),pt);
|
|
|
m_timeval = m_time;
|
|
|
- //handle_three_rates(pt);
|
|
|
handle_traffic_light(pt, site->m_id);
|
|
|
- //if(m_enable_anti_collision){
|
|
|
- if(CYaSetting::m_sys_setting.m_enable_anti_coll){
|
|
|
+
|
|
|
+ if(CYaSetting::m_sys_setting.m_enable_anti_coll){
|
|
|
handle_anti_coll(pt, site->m_id);
|
|
|
}
|
|
|
+
|
|
|
uint64_t id=tool_other::type_id_to_u64(m_type,m_id);
|
|
|
mine_business::inst()->make_arg(id,pt,m_time);
|
|
|
|
|
@@ -99,9 +99,12 @@ void car::handle_over_speed()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ uint64_t id = m_type;
|
|
|
+ id = ((id<<32) | m_id);
|
|
|
if(status){
|
|
|
// 产生告警
|
|
|
- event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, m_id, 0, 0, status);
|
|
|
+ log_info("[v_over_speed] %d begin warning...", m_id);
|
|
|
+ event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, id, 0, 0, status);
|
|
|
}
|
|
|
|
|
|
status = true;
|
|
@@ -112,7 +115,8 @@ void car::handle_over_speed()
|
|
|
}
|
|
|
if(status){
|
|
|
// 结束告警
|
|
|
- event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, m_id, 0, 0, false);
|
|
|
+ log_info("[v_over_speed] %d end warning...", m_id);
|
|
|
+ event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, id, 0, 0, false);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -291,8 +295,21 @@ void car::handle_traffic_light(const point& p, const int& sid)
|
|
|
|
|
|
void car::on_timer()
|
|
|
{
|
|
|
- if(!empty())
|
|
|
+ if(!empty())
|
|
|
make_package();
|
|
|
+
|
|
|
+ //1.找到73号卡,如果计数小于100,更新速度为40;计数大于100,更新速度为20
|
|
|
+/* if(m_cache_nums < 40){
|
|
|
+ m_cache_nums++;
|
|
|
+ m_speed = 40;
|
|
|
+ }else{
|
|
|
+ m_speed = 20;
|
|
|
+ }
|
|
|
+
|
|
|
+ log_info("[v_over_speed] card_id=10004, speed=%.2f", m_speed);
|
|
|
+ handle_over_speed();
|
|
|
+*/
|
|
|
+ //2.调用业务处理
|
|
|
}
|
|
|
|
|
|
int car::get_area()
|