Browse Source

Merge branch 'xcjk' of zengminguo/server-l-zmg into xcjk

zengminguo 2 years ago
parent
commit
7f90025b37
4 changed files with 14 additions and 4 deletions
  1. 1 0
      .gitignore
  2. 6 4
      card_car.cpp
  3. 6 0
      module_service/module_web.cpp
  4. 1 0
      module_service/module_web.h

+ 1 - 0
.gitignore

@@ -40,3 +40,4 @@ three_rates_module
 
 
 
+/3xls

+ 6 - 4
card_car.cpp

@@ -94,11 +94,13 @@ void car::handle_over_speed()
 
 	bool status = true;
 	for(size_t i = 0;i < m_speeds.size();i++){
-		if(m_speed < 35){
+		if(m_speed < CYaSetting::m_sys_setting.over_speed){
 			status = false;
 		}
 	}
 
+	log_info("CYaSetting::m_sys_setting.over_speed=%.2f.", CYaSetting::m_sys_setting.over_speed);
+
 	uint64_t id = m_type;
 	id = ((id<<32) | m_id);
 	if(status){
@@ -109,7 +111,7 @@ void car::handle_over_speed()
 
 	status = true;
 	for(size_t i = 20;i < m_speeds.size();i++){
-		if(m_speed>35){
+		if (m_speed > CYaSetting::m_sys_setting.over_speed) {
 			status = false;
 		}
 	}
@@ -182,7 +184,7 @@ void car::handle_anti_coll(const point& pt, const int& sid, int cell_index)
 			//float dist = pt.dist(c.second->m_v_point);
 			float dist = fabs(cell_index - c.second->m_v_cell_index);
 			// zmg
-			if (true)
+			if (false)
 			{
 				if (m_cid == 82)
 				{
@@ -340,7 +342,7 @@ void car::on_timer()
 	   }
    }
    //zmg
-   if (true)
+   if (false)
    {
 	   if (m_cid == 82)
 	   {

+ 6 - 0
module_service/module_web.cpp

@@ -9,6 +9,8 @@
 #include "module_traffic_light_manager.h"
 #include "websocket/wsTimerThread.h"
 #include "load_raw.h"
+#include "sys_setting.h"
+#include <thread>
 
 static std::string s_file_path;
 // 只支持记录导入,不补报警等信息。
@@ -80,6 +82,10 @@ void module_web::accept( int ID, std::string const& name,
 			pthread_t  tid;
 			pthread_create(&tid, NULL, callback, NULL);    //callback 是一个回调函数
 		}
+		else if (JSON_KEY_NAME_SETTING == cmd) {
+			std::this_thread::sleep_for(std::chrono::milliseconds(300));
+			CYaSetting::Init_sys_setting();
+		}
 		else
 		{
 			sio::message::ptr data_value;

+ 1 - 0
module_service/module_web.h

@@ -50,6 +50,7 @@ public:
         MsgFuncList.insert( std::make_pair( JSON_CMD_REQ_ALL_PERSON_ON_CAR,&module_web::accept)); // 接收web端请求的在车上的人卡信息
         MsgFuncList.insert( std::make_pair( JSON_CMD_VALUE_LIGHTS_CTRL_REQUEST, &module_web::accept));  // 红绿灯控制指令
 		MsgFuncList.insert(std::make_pair(JSON_CMD_VALUE_LOAD_HISTORY_REQUEST, &module_web::accept));  // 导入历史文件指令
+		MsgFuncList.insert(std::make_pair(JSON_KEY_NAME_SETTING, &module_web::accept));  // 导入历史文件指令
     }
 
     /// web前端有用户登录时,反馈给web所有信息