zhuyf преди 2 години
родител
ревизия
da98708569
променени са 4 файла, в които са добавени 17 реда и са изтрити 7 реда
  1. 3 3
      card_area.h
  2. 1 1
      card_car.cpp
  3. 10 3
      mine_business.cpp
  4. 3 0
      mine_business.h

+ 3 - 3
card_area.h

@@ -7,9 +7,9 @@ struct mine_tool;
 struct card_area
 {
 	card_area();
-	std::shared_ptr<site_area_hover> m_site_area=nullptr;
-	std::shared_ptr<area_tool> m_area_tool=nullptr;
-    std::shared_ptr<mine_tool> m_mine_tool=nullptr;
+	std::shared_ptr<site_area_hover> m_site_area = nullptr;
+	std::shared_ptr<area_tool> m_area_tool = nullptr;
+    std::shared_ptr<mine_tool> m_mine_tool = nullptr;
 };
 
 #endif

+ 1 - 1
card_car.cpp

@@ -230,7 +230,7 @@ void car::handle_anti_coll(const point& pt, const int& sid)
             ++i;
         }
 		
-		desc = desc.sub_str(0, desc.length()-1) + "]";
+		desc = desc.substr(0, desc.length()-1) + "]";
         log_info("[anti_coll] the distance's list between person and vehicle : %s", desc.c_str());
 		event_tool::instance()->handle_event(OT_CARD, ET_PERSON_VEHICLE_ANTI_COLLISION, id, min_d, cur_v, true, DT_COMMON, desc);
     }

+ 10 - 3
mine_business.cpp

@@ -22,6 +22,7 @@
 #include <rapidjson/document.h>
 #include <rapidjson/pointer.h>
 #include "wsClientMgr.h"
+
 struct card_sensor
 {
     card_sensor(int32_t wid,const point &p,const std::string &cid)
@@ -113,6 +114,7 @@ struct card_sensor
     int reader_id(){return sid;}
     void push_back(int32_t sensor_id){sensorId_list.push_back(sensor_id);}
 };
+
 struct card_sensor_mgr
 {
     void push(int32_t wid,int32_t sid,const point &p,const std::string & cardid)
@@ -150,7 +152,11 @@ struct staffer_num_business
 	}
     uint32_t get_staff_num() const { return m_staff_num.load();}
 private:
-	void reset(){m_staff_num=0;m_staff_num_real=0;}
+	void reset()
+	{
+		m_staff_num=0;
+		m_staff_num_real=0;
+	}
 	// 井下考勤并且要显示的人数
 	std::atomic<uint32_t> m_staff_num{0};
 	// 井下总人数
@@ -246,12 +252,14 @@ struct rear_end_collision_prevented_business
     std::map<uint64_t,car_data> m_map;
     std::map<std::string,vInfo> m_CloserVehicle;
 };
+
 mine_business::mine_business()
 {
     m_staffer_num_ptr.reset(new staffer_num_business);
     m_reverse_alarm_ptr.reset(new reverse_alarm_business);
     m_rear_ended_ptr.reset(new rear_end_collision_prevented_business);
 }
+
 mine_business* mine_business::inst()
 {
     static mine_business mb;
@@ -387,9 +395,8 @@ void reverse_alarm_business::load_working_sensor()
         
         m_working_sensor[card_id]=sensor_id;
     }
-
-
 }
+
 //前端修改数据库表,dat_sensor dat_drivingface,dat_drivingface_vehicle的时候,需要加载.
 void reverse_alarm_business::load_sensor()
 {

+ 3 - 0
mine_business.h

@@ -4,10 +4,12 @@
 #include <ctime>
 #include <memory>
 #include "point.h"
+
 class staffer_num_business;
 class reverse_alarm_business;
 class rear_end_collision_prevented_business;
 class card_location_base;
+
 struct mine_business
 {
 	mine_business(const mine_business&)=delete;
@@ -34,4 +36,5 @@ private:
 	std::unique_ptr<reverse_alarm_business> m_reverse_alarm_ptr;
 	std::unique_ptr<rear_end_collision_prevented_business> m_rear_ended_ptr;
 };
+
 #endif