Explorar o código

Merge branch 'master' of http://local.beijingyongan.com:3000/linux-dev/ya-serv

zzj %!s(int64=6) %!d(string=hai) anos
pai
achega
bb1af01d38
Modificáronse 7 ficheiros con 112 adicións e 9 borrados
  1. 4 0
      Makefile.am
  2. 2 2
      card.cpp
  3. 96 1
      configure
  4. 6 1
      configure.ac
  5. 1 1
      event.cpp
  6. 3 3
      mine_business.cpp
  7. 0 1
      module_service/area_business_geofault.cpp

+ 4 - 0
Makefile.am

@@ -1,3 +1,7 @@
+
+SUBDIRS=db websocket
+
+
 bin_PROGRAMS=yals 
 noinst_PROGRAMS=client async test 
 

+ 2 - 2
card.cpp

@@ -351,8 +351,8 @@ void card_list::on_message(zloop<task*> *loop,const message_locinfo&loc,bool is_
 		log_warn("数据库中未定义该卡的信息,card_id=%d, card_type=%d,cardid:%lld",loc.m_card_id,loc.m_card_type,cardid);
 		return;
 	}
-	logn_info(3,"card_message:site=%d,ant=%d,card=%d,ct=%d,tof=%lld,rav=%02X,acc=%02X,rssi=%d,stamp=%llu",
-			loc.m_site_id,loc.m_ant_id,loc.m_card_id,loc.m_card_ct,loc.m_tof,loc.m_rav,loc.m_acc,loc.m_rssi,loc.m_time_stamp);
+	logn_info(3,"card_message:site=%d,ant=%d,type=%lu,card=%d,ct=%d,tof=%lld,rav=%02X,acc=%02X,rssi=%d,stamp=%llu",
+			loc.m_site_id,loc.m_ant_id,loc.m_card_type,loc.m_card_id,loc.m_card_ct,loc.m_tof,loc.m_rav,loc.m_acc,loc.m_rssi,loc.m_time_stamp);
 
 	c->on_message(loop,loc,is_history);
 }

+ 96 - 1
configure

@@ -629,6 +629,7 @@ LIBOBJS
 EGREP
 GREP
 CPP
+RANLIB
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -4258,6 +4259,98 @@ else
 fi
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lev" >&5
@@ -5139,7 +5232,7 @@ fi
 done
 
 
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files db/Makefile websocket/Makefile Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -5887,6 +5980,8 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "db/Makefile") CONFIG_FILES="$CONFIG_FILES db/Makefile" ;;
+    "websocket/Makefile") CONFIG_FILES="$CONFIG_FILES websocket/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

+ 6 - 1
configure.ac

@@ -11,6 +11,7 @@ AC_CONFIG_MACRO_DIR([m4])
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_CC
+AC_PROG_RANLIB
 
 AC_CHECK_LIB([ev], [main])
 AC_CHECK_LIB([zlog], [main])
@@ -36,7 +37,11 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([inet_ntoa memset socket])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([
+	db/Makefile
+	websocket/Makefile
+	Makefile
+])
 AC_OUTPUT
 
 

+ 1 - 1
event.cpp

@@ -104,7 +104,7 @@ void Event::handle_alarm_event(EVENT_TYPE et,uint64_t id,double limit_value,doub
         {
             uint64_t _id=id;
             log_info("Create_Event:desc[%s],id:%d,et:%d",desc.c_str(),id,et);
-            if(et == ET_READER_LOCATION_REVERSAL&&!desc.empty())
+            if(et == ET_VEHICLE_REAR_END&&!desc.empty())
             {
                 std::string cardid = desc.substr(0,desc.find_first_of('&'));
                 _id = tool_other::card_id_to_u64(cardid);

+ 3 - 3
mine_business.cpp

@@ -547,7 +547,7 @@ void rear_end_collision_prevented_business::handle_message()
         {
             log_info("vehicle_alarm_time_ %s",vvid.c_str());
             if (vinfo.is_alarm){
-                event_tool::instance()->handle_event(OT_CARD,ET_READER_LOCATION_REVERSAL,id,0,0,false,vvid);
+                event_tool::instance()->handle_event(OT_CARD,ET_VEHICLE_REAR_END,id,0,0,false,vvid);
             }
             it_cv = m_CloserVehicle.erase(it_cv);
             continue;
@@ -568,7 +568,7 @@ void rear_end_collision_prevented_business::handle_message()
             {
                 log_info("vehicle_alarm_backfired_timeout %s",vvid.c_str());
                 if(vinfo.is_alarm){
-                    event_tool::instance()->handle_event(OT_CARD,ET_READER_LOCATION_REVERSAL,id,CYaSetting::m_sys_setting.rear_end_d,dis,false,vvid);
+                    event_tool::instance()->handle_event(OT_CARD,ET_VEHICLE_REAR_END,id,CYaSetting::m_sys_setting.rear_end_d,dis,false,vvid);
                 }
                 it_cv = m_CloserVehicle.erase(it_cv);
                 continue;
@@ -585,7 +585,7 @@ void rear_end_collision_prevented_business::handle_message()
                 if (!vinfo.is_alarm)
                 {
                     log_info("vehicle_alarm_real_end_timeout_exec %s",vvid.c_str());
-                    event_tool::instance()->handle_event(OT_CARD,ET_READER_LOCATION_REVERSAL,id,CYaSetting::m_sys_setting.rear_end_d,dis,true,vvid);
+                    event_tool::instance()->handle_event(OT_CARD,ET_VEHICLE_REAR_END,id,CYaSetting::m_sys_setting.rear_end_d,dis,true,vvid);
                     vinfo.is_alarm = true;
                 }
             }

+ 0 - 1
module_service/area_business_geofault.cpp

@@ -47,7 +47,6 @@ void area_business_geofault::on_enter(const std::shared_ptr<area_hover>&area_hov
 
     auto ptr_temp = std::make_shared<geofault_data>();
     ptr = ptr_temp;
-    area_hover_ptr->m_data[area_business_type()] = ptr_temp;
 
     double dist=0;
     if(_is_near(area_hover_ptr->m_area, card_ptr->x, card_ptr->y, dist))