Selaa lähdekoodia

fix over speed bug

zhuyf 2 vuotta sitten
vanhempi
commit
8585e2ac29
2 muutettua tiedostoa jossa 8 lisäystä ja 10 poistoa
  1. 2 4
      card_base.h
  2. 6 6
      card_car.cpp

+ 2 - 4
card_base.h

@@ -6,8 +6,6 @@
 #include "point.h"
 #include "common.h"
 #include <boost/circular_buffer.hpp>
-#include "../algo/MovAvgFilter/CMovAvgFilter.h"
-#include "../algo/GaussianFilter/CGaussianFilter.h"
 
 struct task;
 template<typename T> struct zloop;
@@ -136,8 +134,8 @@ struct card_location_base:card,std::enable_shared_from_this<card_location_base>
     bool m_enable_anti_collision = false;
     int m_call_level = 0;
 
-	CMovAvgFilter m_mov_avg_filter;
-	CGaussianFilter m_gaussian_filter;
+	//CMovAvgFilter m_mov_avg_filter;
+	//CGaussianFilter m_gaussian_filter;
 
     card_location_base()=default;
     card_location_base(const std::string&type,uint32_t id,uint16_t dis,int16_t t,int32_t,int32_t,uint32_t );

+ 6 - 6
card_car.cpp

@@ -76,11 +76,11 @@ void car::handle_over_speed()
 	m_speeds.push_back(m_speed);
 
 	bool status = true;
-	if(m_speed.size() < 30){
+	if(m_speeds.size() < 30){
 		status = false;
 	}else{
 		for(size_t i = 0;i < m_speeds.size();i++){
-			if(v < 35){
+			if(m_speed < 35){
 				status = false;
 			}
 		}
@@ -88,19 +88,19 @@ void car::handle_over_speed()
 
 	if(status){
 		// 产生告警
-		event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, id, 0, 0, status);
+		event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, m_id, 0, 0, status);
 	}
 
 	status = true;
-	if(m_speed.size() == 30){
+	if(m_speeds.size() == 30){
 		for(size_t i = 20;i < m_speeds.size();i++){
-			if(v>35){
+			if(m_speed>35){
 				status = false;
 			}
 		}
 		if(status){
 			// 结束告警
-			event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, id, 0, 0, false);
+			event_tool::instance()->handle_event(OT_CARD, ET_CARD_OVER_SPEED, m_id, 0, 0, false);
 		}
 	}