|
@@ -87,6 +87,7 @@ event_tool * event_tool::instance()
|
|
|
* */
|
|
|
void event_tool::make_event_object()
|
|
|
{
|
|
|
+ log_info("handle_alarm_event:make_event_object");
|
|
|
m_map[OT_MORE_CARD] = std::make_shared<mine_event>();
|
|
|
m_map[OT_AREA] = std::make_shared<area_event>();
|
|
|
m_map[OT_DEVICE_READER] = std::make_shared<device_reader_event>();
|
|
@@ -180,7 +181,6 @@ void Event::handle_alarm_event(EVENT_TYPE et, uint64_t id, double limit_value, d
|
|
|
ev_ptr=event_ptr;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if(ev_ptr)
|
|
|
{
|
|
|
//event_list::save_event(ev_ptr);
|
|
@@ -190,6 +190,11 @@ void Event::handle_alarm_event(EVENT_TYPE et, uint64_t id, double limit_value, d
|
|
|
event_list::save_event_v(ev_ptr);
|
|
|
}else if(ev_ptr->m_ev_type == 8 || ev_ptr->m_ev_type == 21 || ev_ptr->m_ev_type == 41){
|
|
|
// 红绿灯失联、人车防碰撞、超速告警这三类保存到his_event_data_v表中
|
|
|
+ if (ev_ptr->m_ev_type == 21)
|
|
|
+ {
|
|
|
+ ev_ptr->m_cell_index = limit_value;
|
|
|
+ ev_ptr->m_speed = cur_value;
|
|
|
+ }
|
|
|
event_list::save_event_v(ev_ptr);
|
|
|
}else{
|
|
|
//其他的人员相关报警保存到his_event_data表中
|
|
@@ -355,8 +360,8 @@ void event_list::save_event_v(const std::shared_ptr<ya_event> &ev_ptr)
|
|
|
std::string _time = tool_time::to_str_ex(ev_ptr->m_cur_time);
|
|
|
switch(ev_ptr->m_status){
|
|
|
case 0:
|
|
|
- sprintf(sql, "INSERT IGNORE INTO his_event_data_v(id, event_type_id, obj_id, x, y ,start_time) VALUES(%ld, %d, '%s', %.2f, %.2f, '%s');",
|
|
|
- ev_ptr->m_ev_id, ev_ptr->m_ev_type, ev_ptr->m_obj_id.c_str(), ev_ptr->x, ev_ptr->y, _time.c_str());
|
|
|
+ sprintf(sql, "INSERT IGNORE INTO his_event_data_v(id, event_type_id, obj_id, x, y ,start_time, speed, cell_index) VALUES(%ld, %d, '%s', %.2f, %.2f, '%s', %.2f, %d);",
|
|
|
+ ev_ptr->m_ev_id, ev_ptr->m_ev_type, ev_ptr->m_obj_id.c_str(), ev_ptr->x, ev_ptr->y, _time.c_str(), ev_ptr->m_speed, ev_ptr->m_cell_index);
|
|
|
break;
|
|
|
case 100:
|
|
|
sprintf(sql, "update his_event_data_v set end_time='%s' where id=%ld;", _time.c_str(), ev_ptr->m_ev_id);
|