Browse Source

delete three rate

zhuyf 2 năm trước cách đây
mục cha
commit
2a628eda86

+ 7 - 5
card_base.cpp

@@ -8,7 +8,7 @@
 #include "module_service/module_mgr.h"
 #include "websocket/wsClientMgr.h"
 #include "websocket/wsTimerThread.h"
-#include "three_rates.h"
+//#include "three_rates.h"
 #include "his_location.h"
 #include "event.h"
 #include "module_service/module_call.h"
@@ -22,6 +22,7 @@
 #include "db/db_tool.h"
 #include "tool_time.h"
 #include "tool_byte.h"
+#include "struct_def.h"
 
 extern config_file config;
 card_location_base::card_location_base(const std::string&type,uint32_t id,uint16_t dis,int16_t t,int32_t deptid,int32_t level_id,uint32_t cid)
@@ -382,9 +383,9 @@ void  card_location_base::clear()
     m_cb_point.clear();
 }
 
-void card_location_base::put_three_rates(card_pos & cp)
-{
-    if(!three_rates_flag)
+/*void card_location_base::put_three_rates(card_pos & cp)
+{   
+	if(!three_rates_flag)
         return;
 	
     cp.rec_time     = m_time;
@@ -404,7 +405,8 @@ void card_location_base::put_three_rates(card_pos & cp)
 
 	log_info("three_rates:type:%d,id:%d,cid:%d",cp.type,cp.id,cp.identifier_id);
 	three_rates::get_instance()->put(cp);
-}
+	
+}*/
 
 void card_location_base::put_traffic_light(card_pos& cp)
 {

+ 1 - 1
card_base.h

@@ -152,7 +152,7 @@ struct card_location_base:card,std::enable_shared_from_this<card_location_base>
 	void upt_card_pos(sys::_CARD_POS_&cp, point &pt);
 	void del_card_pos();
 	int	 get_stat();
-	void put_three_rates(card_pos &);
+	//void put_three_rates(card_pos &);
     void put_traffic_light(card_pos& cp);
     void set_event_flag(EVENT_TYPE et,std::uint8_t f=1){m_event[et]=f;}
     bool get_event_flag(EVENT_TYPE et){return m_event[et];}

+ 4 - 3
card_car.cpp

@@ -42,7 +42,7 @@ void car::do_business(const std::shared_ptr<site>&site,const point &pt,double ac
 	m_acc=acc;
 	m_area_tool->on_point(shared_from_this(),pt);
 	m_timeval = m_time;
-	handle_three_rates(pt);
+	//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){
@@ -89,7 +89,8 @@ void car::handle_anti_coll(const point& pt, const int& sid)
             int d = (c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) / 1000.0;
             s = ((c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) /1000.0 <= 30);
             //float dist = pt.dist(*c.second);
-			float dist = pt.dist(*c.second.m_v_point);
+			float dist = pt.dist(c.second->m_v_point);
+			log_info("[anti_coll] vid=%d, pid=%d, dist=%.2f", m_id, c.second->m_id, dist);
             if(dist < k.second && s){
                 int call_level = 5 - k.first;
                 log_info("[anti_coll] distance=%.3f, level=%d, thre_value=%.3f, time_diff=%d", dist, call_level, k.second, d);
@@ -177,7 +178,7 @@ void car::handle_three_rates(const point &pt)
     cp.z = pt.z;	
 	cp.map_id = m_area_tool->get_mapid();
 	cp.vibration = m_acc;
-	put_three_rates(cp);
+	//put_three_rates(cp);
 }
 
 /*

+ 1 - 1
card_person.cpp

@@ -198,7 +198,7 @@ void person::handle_three_rates(const point & pt)
     cp.y = pt.y;
     cp.z = pt.z;
 	cp.work_type_id = m_worktype_id;
-	put_three_rates(cp);
+	//put_three_rates(cp);
 }
 
 //定时推送到web函数,

+ 2 - 1
main.cpp

@@ -119,13 +119,14 @@ struct Init_Setting
 
 	void init_three_rates(const db_para& dbs)
 	{
-		log_info("init three_rates ...................");
+		/*log_info("init three_rates ...................");
 		init_para ip;
 		ip.send_pt = handlereader;
 		ip.driving_face_alarm = Handle_ThreeRates_Event_Callback;
 		three_rates::get_instance()->init(ip,dbs);
 		three_rates::get_instance()->start();
         std_info("加载三率模块成功");
+		*/
 	}
 
     void init_traffic_light()

+ 4 - 5
module_service/area_business_work_rate.cpp

@@ -1,14 +1,13 @@
 #include"area_business_work_rate.h"
-
 #include<memory>
 #include<string>
-
 #include"log.h"
 #include"card.h"
 #include"struct_def.h"
-#include"three_rates.h"
+//#include"three_rates.h"
 #include"area.h"
 #include"tool_time.h"
+
 struct work_rate_data:business_data
 {
     work_rate_data()
@@ -38,7 +37,7 @@ void area_business_work_rate::on_enter(const std::shared_ptr<area_hover>&area_ho
     area->is_work_area = area_hover_ptr->m_area->m_is_work_area;
     area->enter_time = area_hover_ptr->m_enter_time/1000;
 
-    three_rates::get_instance()->enter_area(card, area);
+    //three_rates::get_instance()->enter_area(card, area);
 }
 
 void area_business_work_rate::on_hover(const std::shared_ptr<area_hover>&area_hover_ptr,
@@ -63,6 +62,6 @@ void area_business_work_rate::on_leave(const std::shared_ptr<area_hover>&area_ho
     area->is_work_area = area_hover_ptr->m_area->m_is_work_area;
     area->leave_time = area_hover_ptr->m_last_time/1000;
 
-    three_rates::get_instance()->leave_area(card, area);
+    //three_rates::get_instance()->leave_area(card, area);
 }
 

+ 1 - 1
module_service/module_meta_data_changed.cpp

@@ -113,7 +113,7 @@ void module_meta_data_changed::accept(sio::message::ptr const& data)
 			|| JSON_KEY_NAME_DRIVINGFACE_REF_POINT == name
 			|| JSON_KEY_NAME_DRIVINGFACE_WARNING_POINT == name)
 		{			
-			three_rates::get_instance()->update_db_data(name, szParam, edit_type_id);
+			//three_rates::get_instance()->update_db_data(name, szParam, edit_type_id);
 		}else if(JSON_KEY_NAME_ANTI_COLLISION == name){
             deal_edit_anti_collision(szParam, edit_type_id);
         }