浏览代码

20200929, 调度模块完成snap7通信

huli 4 年之前
父节点
当前提交
9cfe37a60f
共有 37 个文件被更改,包括 4069 次插入363 次删除
  1. 9 3
      CMakeLists.txt
  2. 4 0
      communication/communication_message.cpp
  3. 40 17
      communication/communication_message.h
  4. 2 2
      communication/communication_socket_base.cpp
  5. 85 0
      dispatch/dispatch_communication.cpp
  6. 182 0
      dispatch/dispatch_communication.h
  7. 12 2
      error_code/error_code.cpp
  8. 48 8
      error_code/error_code.h
  9. 15 2
      main.cpp
  10. 526 137
      message/measure_message.pb.cc
  11. 389 77
      message/measure_message.pb.h
  12. 56 10
      message/measure_message.proto
  13. 121 70
      message/message_base.pb.cc
  14. 37 0
      message/message_base.pb.h
  15. 6 0
      message/message_base.proto
  16. 3 1
      proto.sh
  17. 11 6
      setting/communication.prototxt
  18. 62 1
      setting/laser.prototxt
  19. 19 12
      setting/locate.prototxt
  20. 7 0
      setting/snap7_communication.prototxt
  21. 182 0
      snap7_communication/plc_data.cpp
  22. 75 0
      snap7_communication/plc_data.h
  23. 85 0
      snap7_communication/s7_plc.cpp
  24. 32 0
      snap7_communication/s7_plc.h
  25. 119 0
      snap7_communication/snap7_buf.cpp
  26. 54 0
      snap7_communication/snap7_buf.h
  27. 681 0
      snap7_communication/snap7_communication.pb.cc
  28. 438 0
      snap7_communication/snap7_communication.pb.h
  29. 12 0
      snap7_communication/snap7_communication.proto
  30. 327 0
      snap7_communication/snap7_communication_base.cpp
  31. 102 0
      snap7_communication/snap7_communication_base.h
  32. 41 0
      tool/common_data.cpp
  33. 57 0
      tool/common_data.h
  34. 139 0
      tool/point2D_tool.cpp
  35. 81 0
      tool/point2D_tool.h
  36. 6 10
      tool/thread_safe_list.h
  37. 4 5
      tool/thread_safe_queue.h

+ 9 - 3
CMakeLists.txt

@@ -15,6 +15,7 @@ FIND_PACKAGE(PCL REQUIRED)
 MESSAGE(WARN "pcl:: ${PCL_INCLUDE_DIRS} --- ${PCL_LIBRARIES}")
 include_directories(
         /usr/local/include
+		/usr/local/include/snap7
         ${PCL_INCLUDE_DIRS}
         ${OpenCV_INCLUDE_DIRS}
         ${PROTOBUF_INCLUDE_DIRS}
@@ -44,6 +45,7 @@ aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/dispatch DISPATCH_SRC )
+aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/snap7_communication SNAP7_COMMUNICATION_SRC )
 
 
 add_executable(terminal
@@ -59,10 +61,14 @@ add_executable(terminal
         ${LOCATE_SRC}
         ${TASK_MANAGER_SRC}
         ${TOOL_SRC}
-        ${COMMUNICATION_SRC}
+		${COMMUNICATION_SRC}
+		${SNAP7_COMMUNICATION_SRC}
         ${SYSTEM_SRC}
 		${DISPATCH_SRC}
-		dispatch/dispatch_manager.cpp dispatch/dispatch_manager.h dispatch/carrier_base.cpp dispatch/carrier_base.h)
+
+		)
+
+
 
 target_link_libraries(terminal
         /usr/local/lib/libglog.a
@@ -81,7 +87,7 @@ target_link_libraries(terminal
         libtensorflow_cc.so
         #tf_3dcnn_api.so
         pointSIFT_API.so
-
+		snap7
         -lpthread
         )
 

+ 4 - 0
communication/communication_message.cpp

@@ -83,6 +83,10 @@ std::string& Communication_message::get_message_buf()
 	return m_message_buf;
 }
 
+std::chrono::system_clock::time_point Communication_message::get_receive_time()
+{
+	return m_receive_time;
+}
 
 
 

+ 40 - 17
communication/communication_message.h

@@ -25,30 +25,48 @@ public:
 		eBase_msg=0x00,
 		eCommand_msg=0x01,                      //指令消息
 
+
 		eLocate_status_msg=0x11,                //定位模块状态消息
 		eLocate_request_msg=0x12,               //定位请求消息
 		eLocate_response_msg=0x13,              //定位反馈消息
 
+		eLocate_sift_request_msg = 0x14,            //预测算法请求消息
+		eLocate_sift_response_msg = 0x15,           //预测算法反馈消息
+
 		eDispatch_status_msg=0x21,                //调度模块硬件状态消息
 		eDispatch_request_msg=0x22,              //请求调度消息
 		eDispatch_response_msg=0x23,             //调度结果反馈消息
 
-        eParkspace_allocation_status_msg = 0x31,   //车位分配模块状态消息,包括车位信息
-        eParkspace_allocation_request_msg = 0x32,  //请求分配车位消息
-        eParkspace_allocation_response_msg = 0x33, //分配车位结果反馈消息
-        eParkspace_search_request_msg = 0x34,    //查询车位请求消息
-        eParkspace_search_response_msg = 0x35,    //查询车位反馈消息
-        eParkspace_release_request_msg = 0x36,    //释放车位请求消息
-        eParkspace_release_response_msg = 0x37,    //释放车位反馈消息
+		eParkspace_allocation_status_msg=0x31,  //车位分配模块状态消息,包括车位信息
+		eParkspace_allocation_request_msg=0x32, //请求分配车位消息
+		eParkspace_allocation_response_msg=0x33,//分配车位结果反馈消息
+		eParkspace_search_request_msg = 0x34,		//查询车位请求消息
+		eParkspace_search_response_msg = 0x35,		//查询车位反馈消息
+		eParkspace_release_request_msg = 0x36,		//释放车位请求消息
+		eParkspace_release_response_msg = 0x37,		//释放车位反馈消息
+		eParkspace_force_update_request_msg = 0x38,	//手动修改车位消息
+		eParkspace_force_update_response_msg = 0x39,//手动修改车位反馈消息
+		eParkspace_confirm_alloc_request_msg = 0x3A,//确认分配车位请求消息
+		eParkspace_confirm_alloc_response_msg = 0x3B,//确认分配车位反馈消息
+
+
+		eStore_command_request_msg=0x41,        //终端停车请求消息
+		eStore_command_response_msg=0x42,       //停车请求反馈消息
+		ePickup_command_request_msg=0x43,       //取车请求消息
+		ePickup_command_response_msg=0x44,       //取车请求反馈消息
+
 
-        eStore_command_request_msg=0x41,        //终端停车请求消息
-        eStore_command_response_msg=0x42,       //停车请求反馈消息
-        ePickup_command_request_msg=0x43,       //取车请求消息
-        ePickup_command_response_msg=0x44,       //取车请求反馈消息
 
-        eEntrance_statu_msg=0x51,              //出入口状态消息
+		eStoring_process_statu_msg=0x90,        //停车指令进度条消息
+		ePicking_process_statu_msg=0x91,        //取车指令进度消息
 
 
+		eCentral_controller_statu_msg=0xa0,     //中控系统状态消息
+
+
+		eEntrance_manual_operation_msg=0xb0,            //针对出入口状态操作的手动消息
+		eProcess_manual_operation_msg=0xb1,             //针对流程的手动消息
+
 	};
 
 //通讯单元
@@ -58,12 +76,16 @@ public:
 		eMain=0x0001,    //主流程
 
 		eTerminor=0x0100,
+		//车位表
+		eParkspace=0x0200,
+		//测量单元
+		eMeasurer=0x0300,
+		//测量单元
+		eMeasurer_sift_server=0x0301,
+		//调度机构
+		eDispatch=0x0400,
+		//...
 
-		eParkspace=0x0200,          //车位表
-
-		eMeasurer=0x0300,           //测量单元
-
-		eDispatch=0x0400,            //调度机构
 	};
 public:
 	Communication_message();
@@ -81,6 +103,7 @@ public://get or set member variable
 	Communicator get_sender();
 	Communicator get_receiver();
 	std::string& get_message_buf();
+	std::chrono::system_clock::time_point get_receive_time();
 
 protected://member variable
 	Message_type								m_message_type;				//消息类型

+ 2 - 2
communication/communication_socket_base.cpp

@@ -318,8 +318,8 @@ Error_manager Communication_socket_base::check_msg(Communication_message*  p_msg
 	else
 	{
 		//无效的消息,
-		return Error_code::INVALID_MESSAGE;
-	}
+		return Error_manager(Error_code::INVALID_MESSAGE, Error_level::NEGLIGIBLE_ERROR,
+							 " INVALID_MESSAGE error ");	}
 }
 
 //mp_analysis_data_thread 解析线程执行函数,

+ 85 - 0
dispatch/dispatch_communication.cpp

@@ -0,0 +1,85 @@
+//
+// Created by huli on 2020/9/25.
+//
+
+#include "dispatch_communication.h"
+
+
+Dispatch_communication::Dispatch_communication()
+{
+
+}
+
+
+Dispatch_communication::~Dispatch_communication()
+{
+
+}
+
+
+//初始化 通信 模块。如下三选一
+Error_manager Dispatch_communication::communication_init()
+{
+	//往map通信缓存里面添加所需要的buf
+	{
+		std::unique_lock<std::mutex> t_lock(m_receive_buf_lock);
+		Snap7_buf t_response(RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER, 0, sizeof(Response_from_plc_to_dispatch), Snap7_buf::LOOP_COMMUNICATION);
+		m_receive_buf_map[0] = t_response;
+		Snap7_buf t_plc_status(STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER, 0, sizeof(Status_from_plc_to_dispatch), Snap7_buf::LOOP_COMMUNICATION);
+		m_receive_buf_map[1] = t_plc_status;
+	}
+	{
+		std::unique_lock<std::mutex> t_lock(m_send_buf_lock);
+		Snap7_buf t_request(REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER, 0, sizeof(Request_from_dispatch_to_plc), Snap7_buf::NO_COMMUNICATION);
+		m_send_buf_map[0] = t_request;
+		Snap7_buf t_dispatch_status(STATUS_FROM_DISPATCH_TO_PLC_DBNUMBER, 0, sizeof(Status_from_dispatch_to_plc), Snap7_buf::NO_COMMUNICATION);
+		m_send_buf_map[1] = t_dispatch_status;
+	}
+
+
+	return Snap7_communication_base::communication_init();
+}
+
+//反初始化 通信 模块。
+Error_manager Dispatch_communication::communication_uninit()
+{
+	return Snap7_communication_base::communication_uninit();
+}
+
+//更新数据
+Error_manager Dispatch_communication::updata_receive_buf()
+{
+	std::unique_lock<std::mutex> t_lock1(m_receive_buf_lock);
+	std::unique_lock<std::mutex> t_lock2(m_data_lock);
+
+	memcpy(&m_response_from_plc_to_dispatch, &m_receive_buf_map[0], m_receive_buf_map[0].m_size);
+	memcpy(&m_status_from_plc_to_dispatch, &m_receive_buf_map[1], m_receive_buf_map[1].m_size);
+
+
+	std::cout << " huli test :::: " << " m_response_from_plc_to_dispatch.m_command_key = " << m_response_from_plc_to_dispatch.m_command_key << std::endl;
+	std::cout << " huli test :::: " << " m_status_from_plc_to_dispatch.m_elevator_coordinates = " << m_status_from_plc_to_dispatch.m_elevator_coordinates << std::endl;
+	std::cout << " huli test :::: " << " m_status_from_plc_to_dispatch.m_carrier_coordinates = " << m_status_from_plc_to_dispatch.m_carrier_coordinates << std::endl;
+
+	return Error_code::SUCCESS;
+}
+Error_manager Dispatch_communication::updata_send_buf()
+{
+	std::unique_lock<std::mutex> t_lock1(m_send_buf_lock);
+	std::unique_lock<std::mutex> t_lock2(m_data_lock);
+
+	memcpy(&m_request_from_dispatch_to_plc.m_command_key, "from_dispatch_to_plc_123", 24);
+	m_status_from_dispatch_to_plc.m_year = 2020;
+
+	memcpy(&m_send_buf_map[0], &m_request_from_dispatch_to_plc, m_send_buf_map[0].m_size);
+	m_send_buf_map[0].set_communication_mode(Snap7_buf::ONCE_COMMUNICATION);
+	memcpy(&m_send_buf_map[1], &m_status_from_dispatch_to_plc, m_send_buf_map[1].m_size);
+	m_send_buf_map[1].set_communication_mode(Snap7_buf::ONCE_COMMUNICATION);
+
+
+
+	return Error_code::SUCCESS;
+}
+
+
+
+

+ 182 - 0
dispatch/dispatch_communication.h

@@ -0,0 +1,182 @@
+//
+// Created by huli on 2020/9/25.
+//
+
+#ifndef NNXX_TESTS_DISPATCH_COMMUNICATION_H
+#define NNXX_TESTS_DISPATCH_COMMUNICATION_H
+
+#include "../tool/singleton.h"
+#include "../snap7_communication/snap7_communication_base.h"
+
+class Dispatch_communication:public Singleton<Dispatch_communication>, public Snap7_communication_base
+{
+public:
+#pragma pack(push, 1)	//struct按照1个byte对齐
+	//调度模块给plc发送请求消息的DB编号
+	#define REQUEST_FROM_DISPATCH_TO_PLC_DBNUMBER		100
+	//调度模块给plc发送请求消息的指令结构体
+	struct Request_from_dispatch_to_plc
+	{
+	    unsigned char 			m_reserved0 = 0;				//预留
+	    unsigned char			m_command_flag = 0;				//指令标志位, 0bit==1:流程开始, 1bit==1:校验无误
+		unsigned char			m_reserved2 = 0;				//预留
+		unsigned char			m_reserved3_11[9] = {0};		//预留
+
+	    //指令信息
+		unsigned short 			m_block_id = 0;					//单位编号(区域编号), 1~3
+		unsigned short 			m_floor_id = 0;					//楼层编号, 1~14
+		unsigned short 			m_parkspace_id = 0;				//同层的车位索引, 一楼为1~4, 楼上为1~6
+		unsigned char			m_command_key[256] = {0};		//指令key(任务唯一码), 作为通信标志位
+		unsigned char			m_is_entrance_flag = 0;			//是否为入口, 1=入口,0=非入口, (如果是入口, 中跑车需要按照汽车的旋转角进行偏移)
+		unsigned char			m_reserved275_289[15] = {0};	//预留
+
+		//汽车定位信息
+		float  					m_center_x = 0;					//整车的中心点x值, 四轮的中心
+		float  					m_center_y = 0;					//整车的中心点y值, 四轮的中心
+		float  					m_car_angle = 0;				//整车的车身旋转角,
+		float  					m_car_length = 0;				//整车的长度, 用于规避碰撞
+		float  					m_car_width = 0;				//整车的宽度, 用于规避碰撞
+		float  					m_car_height = 0;				//整车的高度, 用于规避碰撞
+		float  					m_wheel_base = 0;				//整车的轮距, 前后轮的距离, 用于机器人或agv的抓车
+		float  					m_wheel_width = 0;				//整车的轮距, 左右轮的距离, 用于机器人或agv的抓车
+		unsigned char			m_voucher_number[256] = {0};	//停取凭证号
+		unsigned char			m_plate_number[512] = {0};		//车牌号
+		unsigned char			m_phone_number[256] = {0};		//电话号码
+		unsigned char			m_reserved1346_1377[32] = {0};	//预留
+	};
+
+	//plc给调度模块发送答复消息的DB编号
+	#define RESPONSE_FROM_PLC_TO_DISPATCH_DBNUMBER		101
+	//plc给调度模块发送答复消息的指令结构体
+	struct Response_from_plc_to_dispatch
+	{
+		unsigned char			m_reserved0 = 0;				//预留
+		unsigned char			m_command_flag = 0;				//指令标志位, 0bit==1:流程结束
+		unsigned char			m_task_status = 0;				//流程状态, 0=正常,1=可恢复型故障,2=不可恢复故障
+		unsigned char			m_reserved3_11[9] = {0};		//预留
+
+		//指令信息
+		unsigned short 			m_block_id = 0;					//单位编号(区域编号), 1~3
+		unsigned short 			m_floor_id = 0;					//楼层编号, 1~14
+		unsigned short 			m_parkspace_id = 0;				//同层的车位索引, 一楼为1~4, 楼上为1~6
+		unsigned char			m_command_key[256] = {0};		//指令key(任务唯一码), 作为通信标志位
+		unsigned char			m_is_entrance_flag = 0;			//是否为入口, 1=入口,0=非入口, (如果是入口, 中跑车需要按照汽车的旋转角进行偏移)
+		unsigned char			m_reserved275_289[15] = {0};	//预留
+
+		//汽车定位信息
+		float  					m_center_x = 0;					//整车的中心点x值, 四轮的中心
+		float  					m_center_y = 0;					//整车的中心点y值, 四轮的中心
+		float  					m_car_angle = 0;				//整车的车身旋转角,
+		float  					m_car_length = 0;				//整车的长度, 用于规避碰撞
+		float  					m_car_width = 0;				//整车的宽度, 用于规避碰撞
+		float  					m_car_height = 0;				//整车的高度, 用于规避碰撞
+		float  					m_wheel_base = 0;				//整车的轮距, 前后轮的距离, 用于机器人或agv的抓车
+		float  					m_wheel_width = 0;				//整车的轮距, 左右轮的距离, 用于机器人或agv的抓车
+		unsigned char			m_voucher_number[256] = {0};	//停取凭证号
+		unsigned char			m_plate_number[512] = {0};		//车牌号
+		unsigned char			m_phone_number[256] = {0};		//电话号码
+		unsigned char			m_reserved1346_1377[32] = {0};	//预留
+	};
+
+	//调度模块给plc发送状态消息的DB编号
+	#define STATUS_FROM_DISPATCH_TO_PLC_DBNUMBER		110
+	//调度模块给plc发送状态消息的指令结构体
+	struct Status_from_dispatch_to_plc
+	{
+		unsigned char			m_heartbeat = 0;				//心跳位, 0-255循环
+		unsigned char			m_check_flag = 0;				//校验标志位
+		unsigned char			m_reserved2_9[8] = {0};			//预留
+
+		//时钟
+		unsigned short			m_year = 0;						//年
+		unsigned char			m_month = 0;					//月
+		unsigned char			m_day = 0;						//日
+		unsigned char			m_weekday = 0;					//周
+		unsigned char			m_hour = 0;						//时
+		unsigned char			m_minute = 0;					//分
+		unsigned char			m_second = 0;					//秒
+		unsigned int			m_nanosecond = 0;				//纳秒
+		unsigned char			m_reserved22_29[8] = {0};		//预留
+
+	};
+
+	//plc给调度模块发送状态消息的DB编号
+	#define STATUS_FROM_PLC_TO_DISPATCH_DBNUMBER		111
+	//plc给调度模块发送状态消息的指令结构体
+	struct Status_from_plc_to_dispatch
+	{
+		unsigned char			m_heartbeat = 0;				//心跳位, 0-255循环
+		unsigned char			m_check_flag = 0;				//校验标志位
+		unsigned char			m_reserved2_9[8] = {0};			//预留
+
+		//时钟
+		unsigned short			m_year = 0;						//年
+		unsigned char			m_month = 0;					//月
+		unsigned char			m_day = 0;						//日
+		unsigned char			m_weekday = 0;					//周
+		unsigned char			m_hour = 0;						//时
+		unsigned char			m_minute = 0;					//分
+		unsigned char			m_second = 0;					//秒
+		unsigned int			m_nanosecond = 0;				//纳秒
+		unsigned char			m_reserved22_29[8] = {0};		//预留
+
+		//升降机状态, (楚天项目代指电梯)
+		//升降机信息, 0bit==1:急停正常, 1bit==1:处于安全位置, 2bit==1:静止状态, 3bit==1:可执行新指令, 4bit==1:存在故障,
+		unsigned char			m_elevator_information = 0;		//升降机信息,
+		unsigned char			m_reserved31 = 0;				//预留
+		double 					m_elevator_coordinates = 0;		//升降机坐标
+		unsigned char			m_reserved40_73[34] = {0};		//预留
+
+		//搬运器状态, (楚天项目代指中跑车)
+		//搬运器信息, 0bit==1:急停正常, 1bit==1:处于安全位置, 2bit==1:静止状态, 3bit==1:可执行新指令, 4bit==1:存在故障,
+		unsigned char			m_carrier_information = 0;		//搬运器信息,
+		unsigned char			m_reserved75 = 0;				//预留
+		double 					m_carrier_coordinates = 0;		//搬运器坐标
+		double 					m_carrier_angle = 0;			//搬运器坐标
+		unsigned char			m_reserved92_125[34] = {0};		//预留
+
+		//故障信息
+		unsigned char			m_carrier_error_code[50] = {0};		//搬运器错误码
+		unsigned char			m_carrier_error_string[512] = {0};	//搬运器错误描述
+		unsigned char			m_elevator_error_code[50] = {0};	//升降机错误码
+		unsigned char			m_elevator_error_string[512] = {0};	//升降机错误描述
+	};
+#pragma pack(pop)		//取消对齐
+
+// 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。
+   friend class Singleton<Dispatch_communication>;
+private:
+ // 父类的构造函数必须保护,子类的构造函数必须私有。
+   Dispatch_communication();
+public:
+    //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。
+    Dispatch_communication(const Dispatch_communication& other) = delete;
+    Dispatch_communication& operator =(const Dispatch_communication& other) = delete;
+    ~Dispatch_communication();
+public://API functions
+	//初始化 通信 模块。如下三选一
+	virtual Error_manager communication_init();
+	//反初始化 通信 模块。
+	virtual Error_manager communication_uninit();
+public://get or set member variable
+
+
+protected://member functions
+	//更新数据
+	virtual Error_manager updata_receive_buf();
+	virtual Error_manager updata_send_buf();
+
+protected://member variable
+
+	std::mutex									m_data_lock;						//数据锁
+	Request_from_dispatch_to_plc				m_request_from_dispatch_to_plc;		//调度模块给plc发送请求消息的指令结构体
+	Response_from_plc_to_dispatch				m_response_from_plc_to_dispatch;	//plc给调度模块发送答复消息的指令结构体
+	Status_from_dispatch_to_plc					m_status_from_dispatch_to_plc;		//调度模块给plc发送状态消息的指令结构体
+	Status_from_plc_to_dispatch					m_status_from_plc_to_dispatch;		//plc给调度模块发送状态消息的指令结构体
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_DISPATCH_COMMUNICATION_H

+ 12 - 2
error_code/error_code.cpp

@@ -108,23 +108,26 @@ void Error_manager::error_manager_clear_all()
     m_error_code = SUCCESS;
     m_error_level = NORMAL;
     free_description();
+	return;
 }
 
 //重载=
 Error_manager& Error_manager::operator=(const Error_manager & error_manager)
 {
     error_manager_reset(error_manager);
+	return *this;
 }
 //重载=,支持Error_manager和Error_code的直接转化,会清空错误等级和描述
 Error_manager& Error_manager::operator=(Error_code error_code)
 {
     error_manager_clear_all();
     set_error_code(error_code);
+	return *this;
 }
 //重载==
 bool Error_manager::operator==(const Error_manager & error_manager)
 {
-    is_equal_error_manager(error_manager);
+	return is_equal_error_manager(error_manager);
 }
 //重载==,支持Error_manager和Error_code的直接比较
 bool Error_manager::operator==(Error_code error_code)
@@ -142,7 +145,7 @@ bool Error_manager::operator==(Error_code error_code)
 //重载!=
 bool Error_manager::operator!=(const Error_manager & error_manager)
 {
-    ! is_equal_error_manager(error_manager);
+	return (! is_equal_error_manager(error_manager));
 }
 //重载!=,支持Error_manager和Error_code的直接比较
 bool Error_manager::operator!=(Error_code error_code)
@@ -310,6 +313,7 @@ void Error_manager::add_error_description(std::string & error_description_string
 
         reallocate_memory_and_copy_string(t_description_string);
     }
+	return;
 }
 
 //比较错误是否相同,
@@ -361,6 +365,7 @@ void Error_manager::compare_and_cover_error(const Error_manager & error_manager)
             add_error_description(pt_string_inside,t_string_inside_length);
         }
     }
+	return;
 }
 //比较并覆盖错误,讲低级错误转为字符串存放于描述中,
 //如果错误相同,则保留this的,将输入参数转入描述。
@@ -397,6 +402,7 @@ void Error_manager::compare_and_cover_error( Error_manager * p_error_manager)
 			add_error_description(pt_string_inside,t_string_inside_length);
 		}
 	}
+	return;
 }
 
 //将所有的错误信息,格式化为字符串,用作日志打印。
@@ -432,6 +438,7 @@ void Error_manager::translate_error_to_string(char* p_error_aggregate, int aggre
             pt_index_back++;
         }
     }
+	return;
 }
 //output:error_description_string     错误汇总的string
 void Error_manager::translate_error_to_string(std::string & error_aggregate_string)
@@ -448,6 +455,7 @@ void Error_manager::translate_error_to_string(std::string & error_aggregate_stri
     {
         //error_aggregate_string += "NULL";
     }
+	return;
 }
 //错误码转字符串的简易版,可支持cout<<
 //return     错误汇总的string
@@ -470,6 +478,7 @@ void Error_manager::free_description()
         pm_error_description = NULL;
     }
     m_description_length = 0;
+	return;
 }
 
 //重新分配错误描述的内存,并从外部拷贝新的(深拷贝)
@@ -529,6 +538,7 @@ void Error_manager::reallocate_memory_and_copy_string(std::string & error_aggreg
 
         strcpy(pm_error_description ,   error_aggregate_string.c_str()  );
     }
+	return;
 }
 
 

+ 48 - 8
error_code/error_code.h

@@ -53,9 +53,12 @@ enum Error_code
     WARNING                         = 0x00000003,//警告
     FAILED                          = 0x00000004,//失败
 
-    NO_DATA                         = 0x00000010,//没有数据,传入参数容器内部没有数据时,
+    NODATA                          = 0x00000010,//没有数据,传入参数容器内部没有数据时,
 	INVALID_MESSAGE					= 0x00000011, //无效的消息,
-    RESPONSE_TIMEOUT                = 0x00000012,
+	PARSE_FAILED					= 0x00000012,//解析失败
+
+    TASK_TIMEOVER					= 0x00000020,//任务超时
+	RESPONSE_TIMEOUT                = 0x00000021,//答复超时
 
     POINTER_IS_NULL                 = 0x00000101,//空指针
     PARAMETER_ERROR                 = 0x00000102,//参数错误,传入参数不符合规范时,
@@ -109,8 +112,8 @@ enum Error_code
 	LASER_MANAGER_STATUS_ERROR,						//雷达管理模块,状态错误
 	LASER_MANAGER_TASK_TYPE_ERROR,					//雷达管理模块,任务类型错误
 	LASER_MANAGER_IS_NOT_READY,						//雷达管理模块,不在准备状态
-	LASER_MANAGER_LASER_INDEX_ERRPR,				//雷达管理模块,雷达索引错误,编号错误。
 	LASER_MANAGER_TASK_OVER_TIME,					//雷达管理模块,任务超时
+	LASER_MANAGER_LASER_INDEX_ERRPR,				//雷达管理模块,雷达索引错误,编号错误。
 	LASER_MANAGER_LASER_INDEX_REPEAT,				//雷达管理模块,需要扫描的雷达索引重复,可忽略的错误,提示作用
 
 //livox_driver 雷达livox驱动模块
@@ -147,7 +150,7 @@ enum Error_code
 	LOCATER_MANAGER_TASK_TYPE_ERROR,					//定位管理模块,任务类型错误
 	LOCATER_MANAGER_IS_NOT_READY,						//定位管理模块,不在准备状态
 	LOCATER_MANAGER_CLOUD_MAP_ERROR,					//定位管理模块,任务输入点云map的error
-	LOCATE_MANAGER_TASK_OVER_TIME,
+	LOCATE_MANAGER_TASK_OVER_TIME,						//定位管理模块,任务超时
 
 
 	//Locater.cpp error from 0x0301000-0x030100FF
@@ -174,6 +177,7 @@ enum Error_code
 	LOCATER_SIFT_CLOUD_VERY_LITTLE,
 	LOCATER_SIFT_CREATE_INPUT_DATA_FAILED,
 	LOCATER_SIFT_PREDICT_FAILED,
+	LOCATER_SIFT_PREDICT_TIMEOUT,
 	LOCATER_SIFT_PREDICT_NO_WHEEL_POINT,
 	LOCATER_SIFT_PREDICT_NO_CAR_POINT,
 
@@ -236,8 +240,21 @@ enum Error_code
     HARDWARE_LIMIT_TERMINAL_LR_ERROR,
 
 
-    //wj_lidar error from 0x06010000-0x0601FFFF
-        WJ_LIDAR_CONNECT_FAILED=0x06010000,
+
+    WANJI_LIDAR_DEVICE_ERROR_BASE=0x06080000,						//万集设备模块,错误基类
+	WANJI_LIDAR_DEVICE_STATUS_BUSY,									//万集设备模块,状态正忙
+	WANJI_LIDAR_DEVICE_STATUS_ERROR,								//万集设备模块,状态错误
+	WANJI_LIDAR_DEVICE_TASK_TYPE_ERROR,								//万集设备模块,任务类型错误
+	WANJI_LIDAR_DEVICE_TASK_OVER_TIME,								//万集设备模块,任务超时
+	WANJI_LIDAR_DEVICE_NO_CLOUD,									//万集设备模块,没有点云
+
+
+	//wj_lidar error from 0x06010000-0x0601FFFF
+	WJ_LIDAR_COMMUNICATION_ERROR_BASE=0x06010000,
+	WJ_LIDAR_COMMUNICATION_UNINITIALIZED,							//万集通信,未初始化
+	WJ_LIDAR_COMMUNICATION_DISCONNECT,								//万集通信,断连
+	WJ_LIDAR_COMMUNICATION_FAULT,									//万集通信,故障
+	WJ_LIDAR_CONNECT_FAILED,
     WJ_LIDAR_UNINITIALIZED,
     WJ_LIDAR_READ_FAILED,
     WJ_LIDAR_WRITE_FAILED,
@@ -245,13 +262,17 @@ enum Error_code
 
     //wj lidar protocol error from 0x06020000-0x0602FFFF
         WJ_PROTOCOL_ERROR_BASE=0x06020000,
+	WJ_PROTOCOL_STATUS_BUSY,										//万集解析, 状态正忙
+	WJ_PROTOCOL_STATUS_ERROR,										//系统执行模块, 状态错误
     WJ_PROTOCOL_INTEGRITY_ERROR,
     WJ_PROTOCOL_PARSE_FAILED,
     WJ_PROTOCOL_EMPTY_PACKAGE,
     WJ_PROTOCOL_EXCEED_MAX_SIZE,
 
     //wj region detect error from 0x06030000-0x0603FFFF
-        WJ_REGION_EMPTY_CLOUD=0x06030000,
+	WJ_REGION_ERROR_BASE					= 0x06030000,
+	WJ_REGION_EMPTY_CLOUD,
+	WJ_REGION_EMPTY_NO_WHEEL_INFORMATION,
     WJ_REGION_RECTANGLE_ANGLE_ERROR,
     WJ_REGION_RECTANGLE_SIZE_ERROR,
     WJ_REGION_RECTANGLE_SYMMETRY_ERROR,
@@ -262,8 +283,17 @@ enum Error_code
     WJ_MANAGER_LIDAR_DISCONNECTED,
     WJ_MANAGER_PLC_DISCONNECTED,
     WJ_MANAGER_EMPTY_CLOUD,
+	WJ_MANAGER_READ_PROTOBUF_ERROR,								//万集管理模块,读取参数错误
+	WJ_MANAGER_INIT_REPEAT,										//万集管理模块,重复初始化
+	WJ_MANAGER_TASK_TYPE_ERROR,									//万集管理模块,任务类型错误
+	WJ_MANAGER_STATUS_BUSY,										//万集管理模块,状态正忙
+	WJ_MANAGER_STATUS_ERROR,									//万集管理模块,状态错误
+	WJ_MANAGER_LASER_INDEX_ERRPR,								//万集管理模块,雷达索引错误,编号错误。
+	WJ_MANAGER_LASER_INDEX_REPEAT,								//万集管理模块,需要扫描的雷达索引重复,可忽略的错误,提示作用
+	WJ_MANAGER_TASK_OVER_TIME,									//万集管理模块,任务超时
 
-    WJ_LIDAR_TASK_EMPTY_RESULT=0x06050000,
+
+	WJ_LIDAR_TASK_EMPTY_RESULT=0x06050000,
     WJ_LIDAR_TASK_EMPTY_TASK,
     WJ_LIDAR_TASK_WRONG_TYPE,
     WJ_LIDAR_TASK_INVALID_TASK,
@@ -306,6 +336,16 @@ enum Error_code
 	DISPATCH_MANAGER_STATUS_ERROR,						//调度管理模块,状态错误
 	DISPATCH_MANAGER_TASK_TYPE_ERROR,					//调度管理模块,任务类型错误
 	DISPATCH_MANAGER_IS_NOT_READY,						//调度管理模块,不在准备状态
+
+	//snap7 通信模块 错误码
+	SNAP7_ERROR_BASE								= 0x1401000,
+	SNAP7_READ_PROTOBUF_ERROR,							//snap7通信模块,读取参数错误
+	SNAP7_CONNECT_ERROR,								//snap7通信模块,连接错误
+	SNAP7_DISCONNECT_ERROR,								//snap7通信模块,断连错误
+	SNAP7_READ_ERROR,									//snap7通信模块,读取错误
+	SNAP7_WRITE_ERROR,									//snap7通信模块,写入错误
+	SNAP7_ANALYSIS_TIME_OUT,									//解析超时,
+	SNAP7_EXCUTER_IS_BUSY,										//处理器正忙, 请稍等
 };
 
 //错误等级,用来做故障处理

+ 15 - 2
main.cpp

@@ -14,7 +14,7 @@
 #include "./system/system_executor.h"
 
 #include "./dispatch/dispatch_manager.h"
-
+#include "./dispatch/dispatch_communication.h"
 
 
 
@@ -48,7 +48,6 @@ int main(int argc,char* argv[])
 {
 
 
-
 	const char* logPath = "./";
 	google::InitGoogleLogging("LidarMeasurement");
 	google::SetStderrLogging(google::INFO);
@@ -61,6 +60,20 @@ int main(int argc,char* argv[])
 	FLAGS_max_log_size = 1024;            // Set max log file size(GB)
 	FLAGS_stop_logging_if_full_disk = true;
 
+	
+	Error_manager t_error;
+
+	t_error = Dispatch_communication::get_instance_references().communication_init();
+	std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
+	std::cout << "Dispatch_communication = " << Dispatch_communication::get_instance_references().get_status() << std::endl;
+
+	char ch123 ;
+	std::cin >> ch123 ;
+
+	Dispatch_communication::get_instance_references().communication_uninit();
+	return 0;
+
+
 
 
 	int t_dispatch_id = 0;

文件差异内容过多而无法显示
+ 526 - 137
message/measure_message.pb.cc


+ 389 - 77
message/measure_message.pb.h

@@ -159,6 +159,74 @@ inline bool Locate_manager_status_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Locate_manager_status>(
     Locate_manager_status_descriptor(), name, value);
 }
+enum Wanji_manager_status {
+  WANJI_MANAGER_UNKNOWN = 0,
+  WANJI_MANAGER_READY = 1,
+  WANJI_MANAGER_BUSY = 2,
+  WANJI_MANAGER_ISSUED_SCAN = 3,
+  WANJI_MANAGER_WAIT_SCAN = 4,
+  WANJI_MANAGER_ISSUED_DETECT = 5,
+  WANJI_MANAGER_WAIT_DETECT = 6,
+  WANJI_MANAGER_FAULT = 10
+};
+bool Wanji_manager_status_IsValid(int value);
+const Wanji_manager_status Wanji_manager_status_MIN = WANJI_MANAGER_UNKNOWN;
+const Wanji_manager_status Wanji_manager_status_MAX = WANJI_MANAGER_FAULT;
+const int Wanji_manager_status_ARRAYSIZE = Wanji_manager_status_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Wanji_manager_status_descriptor();
+inline const ::std::string& Wanji_manager_status_Name(Wanji_manager_status value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Wanji_manager_status_descriptor(), value);
+}
+inline bool Wanji_manager_status_Parse(
+    const ::std::string& name, Wanji_manager_status* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Wanji_manager_status>(
+    Wanji_manager_status_descriptor(), name, value);
+}
+enum Wanji_lidar_device_status {
+  WANJI_LIDAR_DEVICE_UNKNOWN = 0,
+  WANJI_LIDAR_DEVICE_READY = 1,
+  WANJI_LIDAR_DEVICE_DISCONNECT = 2,
+  WANJI_LIDAR_DEVICE_BUSY = 3,
+  WANJI_LIDAR_DEVICE_FAULT = 10
+};
+bool Wanji_lidar_device_status_IsValid(int value);
+const Wanji_lidar_device_status Wanji_lidar_device_status_MIN = WANJI_LIDAR_DEVICE_UNKNOWN;
+const Wanji_lidar_device_status Wanji_lidar_device_status_MAX = WANJI_LIDAR_DEVICE_FAULT;
+const int Wanji_lidar_device_status_ARRAYSIZE = Wanji_lidar_device_status_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Wanji_lidar_device_status_descriptor();
+inline const ::std::string& Wanji_lidar_device_status_Name(Wanji_lidar_device_status value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Wanji_lidar_device_status_descriptor(), value);
+}
+inline bool Wanji_lidar_device_status_Parse(
+    const ::std::string& name, Wanji_lidar_device_status* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Wanji_lidar_device_status>(
+    Wanji_lidar_device_status_descriptor(), name, value);
+}
+enum Region_worker_status {
+  REGION_WORKER_UNKNOWN = 0,
+  REGION_WORKER_READY = 1,
+  REGION_WORKER_BUSY = 2,
+  REGION_WORKER_FAULT = 10
+};
+bool Region_worker_status_IsValid(int value);
+const Region_worker_status Region_worker_status_MIN = REGION_WORKER_UNKNOWN;
+const Region_worker_status Region_worker_status_MAX = REGION_WORKER_FAULT;
+const int Region_worker_status_ARRAYSIZE = Region_worker_status_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Region_worker_status_descriptor();
+inline const ::std::string& Region_worker_status_Name(Region_worker_status value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Region_worker_status_descriptor(), value);
+}
+inline bool Region_worker_status_Parse(
+    const ::std::string& name, Region_worker_status* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Region_worker_status>(
+    Region_worker_status_descriptor(), name, value);
+}
 // ===================================================================
 
 class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Measure_status_msg) */ {
@@ -260,6 +328,38 @@ class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insert
   const ::google::protobuf::RepeatedField<int>& laser_statu_vector() const;
   ::google::protobuf::RepeatedField<int>* mutable_laser_statu_vector();
 
+  // repeated .message.Wanji_lidar_device_status wanji_lidar_device_status = 7;
+  int wanji_lidar_device_status_size() const;
+  void clear_wanji_lidar_device_status();
+  static const int kWanjiLidarDeviceStatusFieldNumber = 7;
+  ::message::Wanji_lidar_device_status wanji_lidar_device_status(int index) const;
+  void set_wanji_lidar_device_status(int index, ::message::Wanji_lidar_device_status value);
+  void add_wanji_lidar_device_status(::message::Wanji_lidar_device_status value);
+  const ::google::protobuf::RepeatedField<int>& wanji_lidar_device_status() const;
+  ::google::protobuf::RepeatedField<int>* mutable_wanji_lidar_device_status();
+
+  // repeated .message.Region_worker_status region_worker_status = 8;
+  int region_worker_status_size() const;
+  void clear_region_worker_status();
+  static const int kRegionWorkerStatusFieldNumber = 8;
+  ::message::Region_worker_status region_worker_status(int index) const;
+  void set_region_worker_status(int index, ::message::Region_worker_status value);
+  void add_region_worker_status(::message::Region_worker_status value);
+  const ::google::protobuf::RepeatedField<int>& region_worker_status() const;
+  ::google::protobuf::RepeatedField<int>* mutable_region_worker_status();
+
+  // repeated .message.Locate_information locate_information_realtime = 9;
+  int locate_information_realtime_size() const;
+  void clear_locate_information_realtime();
+  static const int kLocateInformationRealtimeFieldNumber = 9;
+  const ::message::Locate_information& locate_information_realtime(int index) const;
+  ::message::Locate_information* mutable_locate_information_realtime(int index);
+  ::message::Locate_information* add_locate_information_realtime();
+  ::google::protobuf::RepeatedPtrField< ::message::Locate_information >*
+      mutable_locate_information_realtime();
+  const ::google::protobuf::RepeatedPtrField< ::message::Locate_information >&
+      locate_information_realtime() const;
+
   // required .message.Base_info base_info = 1;
   bool has_base_info() const;
   void clear_base_info();
@@ -269,19 +369,10 @@ class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
 
-  // optional .message.Locate_information locate_information_realtime = 6;
-  bool has_locate_information_realtime() const;
-  void clear_locate_information_realtime();
-  static const int kLocateInformationRealtimeFieldNumber = 6;
-  const ::message::Locate_information& locate_information_realtime() const;
-  ::message::Locate_information* release_locate_information_realtime();
-  ::message::Locate_information* mutable_locate_information_realtime();
-  void set_allocated_locate_information_realtime(::message::Locate_information* locate_information_realtime);
-
-  // required .message.Error_manager error_manager = 7;
+  // required .message.Error_manager error_manager = 10;
   bool has_error_manager() const;
   void clear_error_manager();
-  static const int kErrorManagerFieldNumber = 7;
+  static const int kErrorManagerFieldNumber = 10;
   const ::message::Error_manager& error_manager() const;
   ::message::Error_manager* release_error_manager();
   ::message::Error_manager* mutable_error_manager();
@@ -308,6 +399,13 @@ class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::message::Locate_manager_status locate_manager_status() const;
   void set_locate_manager_status(::message::Locate_manager_status value);
 
+  // required .message.Wanji_manager_status wanji_manager_status = 6;
+  bool has_wanji_manager_status() const;
+  void clear_wanji_manager_status();
+  static const int kWanjiManagerStatusFieldNumber = 6;
+  ::message::Wanji_manager_status wanji_manager_status() const;
+  void set_wanji_manager_status(::message::Wanji_manager_status value);
+
   // @@protoc_insertion_point(class_scope:message.Measure_status_msg)
  private:
   void set_has_base_info();
@@ -318,8 +416,8 @@ class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insert
   void clear_has_laser_manager_status();
   void set_has_locate_manager_status();
   void clear_has_locate_manager_status();
-  void set_has_locate_information_realtime();
-  void clear_has_locate_information_realtime();
+  void set_has_wanji_manager_status();
+  void clear_has_wanji_manager_status();
   void set_has_error_manager();
   void clear_has_error_manager();
 
@@ -330,12 +428,15 @@ class Measure_status_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::google::protobuf::RepeatedField<int> laser_statu_vector_;
+  ::google::protobuf::RepeatedField<int> wanji_lidar_device_status_;
+  ::google::protobuf::RepeatedField<int> region_worker_status_;
+  ::google::protobuf::RepeatedPtrField< ::message::Locate_information > locate_information_realtime_;
   ::message::Base_info* base_info_;
-  ::message::Locate_information* locate_information_realtime_;
   ::message::Error_manager* error_manager_;
   ::google::protobuf::int32 terminal_id_;
   int laser_manager_status_;
   int locate_manager_status_;
+  int wanji_manager_status_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsMeasure_status_msgImpl();
 };
@@ -983,10 +1084,10 @@ class Locate_sift_request_msg : public ::google::protobuf::Message /* @@protoc_i
 
   // accessors -------------------------------------------------------
 
-  // repeated .message.Cloud_coordinate cloud_coordinates = 4;
+  // repeated .message.Cloud_coordinate cloud_coordinates = 5;
   int cloud_coordinates_size() const;
   void clear_cloud_coordinates();
-  static const int kCloudCoordinatesFieldNumber = 4;
+  static const int kCloudCoordinatesFieldNumber = 5;
   const ::message::Cloud_coordinate& cloud_coordinates(int index) const;
   ::message::Cloud_coordinate* mutable_cloud_coordinates(int index);
   ::message::Cloud_coordinate* add_cloud_coordinates();
@@ -1026,6 +1127,13 @@ class Locate_sift_request_msg : public ::google::protobuf::Message /* @@protoc_i
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
 
+  // required int32 lidar_id = 4;
+  bool has_lidar_id() const;
+  void clear_lidar_id();
+  static const int kLidarIdFieldNumber = 4;
+  ::google::protobuf::int32 lidar_id() const;
+  void set_lidar_id(::google::protobuf::int32 value);
+
   // @@protoc_insertion_point(class_scope:message.Locate_sift_request_msg)
  private:
   void set_has_base_info();
@@ -1034,6 +1142,8 @@ class Locate_sift_request_msg : public ::google::protobuf::Message /* @@protoc_i
   void clear_has_command_key();
   void set_has_terminal_id();
   void clear_has_terminal_id();
+  void set_has_lidar_id();
+  void clear_has_lidar_id();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -1045,6 +1155,7 @@ class Locate_sift_request_msg : public ::google::protobuf::Message /* @@protoc_i
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
   ::google::protobuf::int32 terminal_id_;
+  ::google::protobuf::int32 lidar_id_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsLocate_sift_request_msgImpl();
 };
@@ -1139,10 +1250,10 @@ class Locate_sift_response_msg : public ::google::protobuf::Message /* @@protoc_
 
   // accessors -------------------------------------------------------
 
-  // repeated .message.Cloud_type cloud_type = 4;
+  // repeated .message.Cloud_type cloud_type = 5;
   int cloud_type_size() const;
   void clear_cloud_type();
-  static const int kCloudTypeFieldNumber = 4;
+  static const int kCloudTypeFieldNumber = 5;
   const ::message::Cloud_type& cloud_type(int index) const;
   ::message::Cloud_type* mutable_cloud_type(int index);
   ::message::Cloud_type* add_cloud_type();
@@ -1175,6 +1286,15 @@ class Locate_sift_response_msg : public ::google::protobuf::Message /* @@protoc_
   ::message::Base_info* mutable_base_info();
   void set_allocated_base_info(::message::Base_info* base_info);
 
+  // required .message.Error_manager error_manager = 6;
+  bool has_error_manager() const;
+  void clear_error_manager();
+  static const int kErrorManagerFieldNumber = 6;
+  const ::message::Error_manager& error_manager() const;
+  ::message::Error_manager* release_error_manager();
+  ::message::Error_manager* mutable_error_manager();
+  void set_allocated_error_manager(::message::Error_manager* error_manager);
+
   // required int32 terminal_id = 3;
   bool has_terminal_id() const;
   void clear_terminal_id();
@@ -1182,6 +1302,13 @@ class Locate_sift_response_msg : public ::google::protobuf::Message /* @@protoc_
   ::google::protobuf::int32 terminal_id() const;
   void set_terminal_id(::google::protobuf::int32 value);
 
+  // required int32 lidar_id = 4;
+  bool has_lidar_id() const;
+  void clear_lidar_id();
+  static const int kLidarIdFieldNumber = 4;
+  ::google::protobuf::int32 lidar_id() const;
+  void set_lidar_id(::google::protobuf::int32 value);
+
   // @@protoc_insertion_point(class_scope:message.Locate_sift_response_msg)
  private:
   void set_has_base_info();
@@ -1190,6 +1317,10 @@ class Locate_sift_response_msg : public ::google::protobuf::Message /* @@protoc_
   void clear_has_command_key();
   void set_has_terminal_id();
   void clear_has_terminal_id();
+  void set_has_lidar_id();
+  void clear_has_lidar_id();
+  void set_has_error_manager();
+  void clear_has_error_manager();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -1200,7 +1331,9 @@ class Locate_sift_response_msg : public ::google::protobuf::Message /* @@protoc_
   ::google::protobuf::RepeatedPtrField< ::message::Cloud_type > cloud_type_;
   ::google::protobuf::internal::ArenaStringPtr command_key_;
   ::message::Base_info* base_info_;
+  ::message::Error_manager* error_manager_;
   ::google::protobuf::int32 terminal_id_;
+  ::google::protobuf::int32 lidar_id_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_measure_5fmessage_2eproto::InitDefaultsLocate_sift_response_msgImpl();
 };
@@ -1267,13 +1400,13 @@ inline void Measure_status_msg::set_allocated_base_info(::message::Base_info* ba
 
 // required int32 terminal_id = 2;
 inline bool Measure_status_msg::has_terminal_id() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Measure_status_msg::set_has_terminal_id() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Measure_status_msg::clear_has_terminal_id() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Measure_status_msg::clear_terminal_id() {
   terminal_id_ = 0;
@@ -1291,13 +1424,13 @@ inline void Measure_status_msg::set_terminal_id(::google::protobuf::int32 value)
 
 // required .message.Laser_manager_status laser_manager_status = 3;
 inline bool Measure_status_msg::has_laser_manager_status() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Measure_status_msg::set_has_laser_manager_status() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Measure_status_msg::clear_has_laser_manager_status() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Measure_status_msg::clear_laser_manager_status() {
   laser_manager_status_ = 0;
@@ -1348,13 +1481,13 @@ Measure_status_msg::mutable_laser_statu_vector() {
 
 // required .message.Locate_manager_status locate_manager_status = 5;
 inline bool Measure_status_msg::has_locate_manager_status() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void Measure_status_msg::set_has_locate_manager_status() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void Measure_status_msg::clear_has_locate_manager_status() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void Measure_status_msg::clear_locate_manager_status() {
   locate_manager_status_ = 0;
@@ -1371,65 +1504,131 @@ inline void Measure_status_msg::set_locate_manager_status(::message::Locate_mana
   // @@protoc_insertion_point(field_set:message.Measure_status_msg.locate_manager_status)
 }
 
-// optional .message.Locate_information locate_information_realtime = 6;
-inline bool Measure_status_msg::has_locate_information_realtime() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+// required .message.Wanji_manager_status wanji_manager_status = 6;
+inline bool Measure_status_msg::has_wanji_manager_status() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
-inline void Measure_status_msg::set_has_locate_information_realtime() {
-  _has_bits_[0] |= 0x00000002u;
+inline void Measure_status_msg::set_has_wanji_manager_status() {
+  _has_bits_[0] |= 0x00000020u;
 }
-inline void Measure_status_msg::clear_has_locate_information_realtime() {
-  _has_bits_[0] &= ~0x00000002u;
+inline void Measure_status_msg::clear_has_wanji_manager_status() {
+  _has_bits_[0] &= ~0x00000020u;
 }
-inline const ::message::Locate_information& Measure_status_msg::locate_information_realtime() const {
-  const ::message::Locate_information* p = locate_information_realtime_;
-  // @@protoc_insertion_point(field_get:message.Measure_status_msg.locate_information_realtime)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Locate_information*>(
-      &::message::_Locate_information_default_instance_);
+inline void Measure_status_msg::clear_wanji_manager_status() {
+  wanji_manager_status_ = 0;
+  clear_has_wanji_manager_status();
 }
-inline ::message::Locate_information* Measure_status_msg::release_locate_information_realtime() {
-  // @@protoc_insertion_point(field_release:message.Measure_status_msg.locate_information_realtime)
-  clear_has_locate_information_realtime();
-  ::message::Locate_information* temp = locate_information_realtime_;
-  locate_information_realtime_ = NULL;
-  return temp;
+inline ::message::Wanji_manager_status Measure_status_msg::wanji_manager_status() const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.wanji_manager_status)
+  return static_cast< ::message::Wanji_manager_status >(wanji_manager_status_);
 }
-inline ::message::Locate_information* Measure_status_msg::mutable_locate_information_realtime() {
-  set_has_locate_information_realtime();
-  if (locate_information_realtime_ == NULL) {
-    locate_information_realtime_ = new ::message::Locate_information;
-  }
+inline void Measure_status_msg::set_wanji_manager_status(::message::Wanji_manager_status value) {
+  assert(::message::Wanji_manager_status_IsValid(value));
+  set_has_wanji_manager_status();
+  wanji_manager_status_ = value;
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.wanji_manager_status)
+}
+
+// repeated .message.Wanji_lidar_device_status wanji_lidar_device_status = 7;
+inline int Measure_status_msg::wanji_lidar_device_status_size() const {
+  return wanji_lidar_device_status_.size();
+}
+inline void Measure_status_msg::clear_wanji_lidar_device_status() {
+  wanji_lidar_device_status_.Clear();
+}
+inline ::message::Wanji_lidar_device_status Measure_status_msg::wanji_lidar_device_status(int index) const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.wanji_lidar_device_status)
+  return static_cast< ::message::Wanji_lidar_device_status >(wanji_lidar_device_status_.Get(index));
+}
+inline void Measure_status_msg::set_wanji_lidar_device_status(int index, ::message::Wanji_lidar_device_status value) {
+  assert(::message::Wanji_lidar_device_status_IsValid(value));
+  wanji_lidar_device_status_.Set(index, value);
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.wanji_lidar_device_status)
+}
+inline void Measure_status_msg::add_wanji_lidar_device_status(::message::Wanji_lidar_device_status value) {
+  assert(::message::Wanji_lidar_device_status_IsValid(value));
+  wanji_lidar_device_status_.Add(value);
+  // @@protoc_insertion_point(field_add:message.Measure_status_msg.wanji_lidar_device_status)
+}
+inline const ::google::protobuf::RepeatedField<int>&
+Measure_status_msg::wanji_lidar_device_status() const {
+  // @@protoc_insertion_point(field_list:message.Measure_status_msg.wanji_lidar_device_status)
+  return wanji_lidar_device_status_;
+}
+inline ::google::protobuf::RepeatedField<int>*
+Measure_status_msg::mutable_wanji_lidar_device_status() {
+  // @@protoc_insertion_point(field_mutable_list:message.Measure_status_msg.wanji_lidar_device_status)
+  return &wanji_lidar_device_status_;
+}
+
+// repeated .message.Region_worker_status region_worker_status = 8;
+inline int Measure_status_msg::region_worker_status_size() const {
+  return region_worker_status_.size();
+}
+inline void Measure_status_msg::clear_region_worker_status() {
+  region_worker_status_.Clear();
+}
+inline ::message::Region_worker_status Measure_status_msg::region_worker_status(int index) const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.region_worker_status)
+  return static_cast< ::message::Region_worker_status >(region_worker_status_.Get(index));
+}
+inline void Measure_status_msg::set_region_worker_status(int index, ::message::Region_worker_status value) {
+  assert(::message::Region_worker_status_IsValid(value));
+  region_worker_status_.Set(index, value);
+  // @@protoc_insertion_point(field_set:message.Measure_status_msg.region_worker_status)
+}
+inline void Measure_status_msg::add_region_worker_status(::message::Region_worker_status value) {
+  assert(::message::Region_worker_status_IsValid(value));
+  region_worker_status_.Add(value);
+  // @@protoc_insertion_point(field_add:message.Measure_status_msg.region_worker_status)
+}
+inline const ::google::protobuf::RepeatedField<int>&
+Measure_status_msg::region_worker_status() const {
+  // @@protoc_insertion_point(field_list:message.Measure_status_msg.region_worker_status)
+  return region_worker_status_;
+}
+inline ::google::protobuf::RepeatedField<int>*
+Measure_status_msg::mutable_region_worker_status() {
+  // @@protoc_insertion_point(field_mutable_list:message.Measure_status_msg.region_worker_status)
+  return &region_worker_status_;
+}
+
+// repeated .message.Locate_information locate_information_realtime = 9;
+inline int Measure_status_msg::locate_information_realtime_size() const {
+  return locate_information_realtime_.size();
+}
+inline const ::message::Locate_information& Measure_status_msg::locate_information_realtime(int index) const {
+  // @@protoc_insertion_point(field_get:message.Measure_status_msg.locate_information_realtime)
+  return locate_information_realtime_.Get(index);
+}
+inline ::message::Locate_information* Measure_status_msg::mutable_locate_information_realtime(int index) {
   // @@protoc_insertion_point(field_mutable:message.Measure_status_msg.locate_information_realtime)
-  return locate_information_realtime_;
+  return locate_information_realtime_.Mutable(index);
 }
-inline void Measure_status_msg::set_allocated_locate_information_realtime(::message::Locate_information* locate_information_realtime) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(locate_information_realtime_);
-  }
-  if (locate_information_realtime) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      locate_information_realtime = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, locate_information_realtime, submessage_arena);
-    }
-    set_has_locate_information_realtime();
-  } else {
-    clear_has_locate_information_realtime();
-  }
-  locate_information_realtime_ = locate_information_realtime;
-  // @@protoc_insertion_point(field_set_allocated:message.Measure_status_msg.locate_information_realtime)
+inline ::message::Locate_information* Measure_status_msg::add_locate_information_realtime() {
+  // @@protoc_insertion_point(field_add:message.Measure_status_msg.locate_information_realtime)
+  return locate_information_realtime_.Add();
+}
+inline ::google::protobuf::RepeatedPtrField< ::message::Locate_information >*
+Measure_status_msg::mutable_locate_information_realtime() {
+  // @@protoc_insertion_point(field_mutable_list:message.Measure_status_msg.locate_information_realtime)
+  return &locate_information_realtime_;
+}
+inline const ::google::protobuf::RepeatedPtrField< ::message::Locate_information >&
+Measure_status_msg::locate_information_realtime() const {
+  // @@protoc_insertion_point(field_list:message.Measure_status_msg.locate_information_realtime)
+  return locate_information_realtime_;
 }
 
-// required .message.Error_manager error_manager = 7;
+// required .message.Error_manager error_manager = 10;
 inline bool Measure_status_msg::has_error_manager() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000002u) != 0;
 }
 inline void Measure_status_msg::set_has_error_manager() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000002u;
 }
 inline void Measure_status_msg::clear_has_error_manager() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000002u;
 }
 inline const ::message::Error_manager& Measure_status_msg::error_manager() const {
   const ::message::Error_manager* p = error_manager_;
@@ -2098,7 +2297,31 @@ inline void Locate_sift_request_msg::set_terminal_id(::google::protobuf::int32 v
   // @@protoc_insertion_point(field_set:message.Locate_sift_request_msg.terminal_id)
 }
 
-// repeated .message.Cloud_coordinate cloud_coordinates = 4;
+// required int32 lidar_id = 4;
+inline bool Locate_sift_request_msg::has_lidar_id() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Locate_sift_request_msg::set_has_lidar_id() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Locate_sift_request_msg::clear_has_lidar_id() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Locate_sift_request_msg::clear_lidar_id() {
+  lidar_id_ = 0;
+  clear_has_lidar_id();
+}
+inline ::google::protobuf::int32 Locate_sift_request_msg::lidar_id() const {
+  // @@protoc_insertion_point(field_get:message.Locate_sift_request_msg.lidar_id)
+  return lidar_id_;
+}
+inline void Locate_sift_request_msg::set_lidar_id(::google::protobuf::int32 value) {
+  set_has_lidar_id();
+  lidar_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_sift_request_msg.lidar_id)
+}
+
+// repeated .message.Cloud_coordinate cloud_coordinates = 5;
 inline int Locate_sift_request_msg::cloud_coordinates_size() const {
   return cloud_coordinates_.size();
 }
@@ -2247,13 +2470,13 @@ inline void Locate_sift_response_msg::set_allocated_command_key(::std::string* c
 
 // required int32 terminal_id = 3;
 inline bool Locate_sift_response_msg::has_terminal_id() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Locate_sift_response_msg::set_has_terminal_id() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Locate_sift_response_msg::clear_has_terminal_id() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Locate_sift_response_msg::clear_terminal_id() {
   terminal_id_ = 0;
@@ -2269,7 +2492,31 @@ inline void Locate_sift_response_msg::set_terminal_id(::google::protobuf::int32
   // @@protoc_insertion_point(field_set:message.Locate_sift_response_msg.terminal_id)
 }
 
-// repeated .message.Cloud_type cloud_type = 4;
+// required int32 lidar_id = 4;
+inline bool Locate_sift_response_msg::has_lidar_id() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Locate_sift_response_msg::set_has_lidar_id() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Locate_sift_response_msg::clear_has_lidar_id() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Locate_sift_response_msg::clear_lidar_id() {
+  lidar_id_ = 0;
+  clear_has_lidar_id();
+}
+inline ::google::protobuf::int32 Locate_sift_response_msg::lidar_id() const {
+  // @@protoc_insertion_point(field_get:message.Locate_sift_response_msg.lidar_id)
+  return lidar_id_;
+}
+inline void Locate_sift_response_msg::set_lidar_id(::google::protobuf::int32 value) {
+  set_has_lidar_id();
+  lidar_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_sift_response_msg.lidar_id)
+}
+
+// repeated .message.Cloud_type cloud_type = 5;
 inline int Locate_sift_response_msg::cloud_type_size() const {
   return cloud_type_.size();
 }
@@ -2299,6 +2546,56 @@ Locate_sift_response_msg::cloud_type() const {
   return cloud_type_;
 }
 
+// required .message.Error_manager error_manager = 6;
+inline bool Locate_sift_response_msg::has_error_manager() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Locate_sift_response_msg::set_has_error_manager() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Locate_sift_response_msg::clear_has_error_manager() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline const ::message::Error_manager& Locate_sift_response_msg::error_manager() const {
+  const ::message::Error_manager* p = error_manager_;
+  // @@protoc_insertion_point(field_get:message.Locate_sift_response_msg.error_manager)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Error_manager*>(
+      &::message::_Error_manager_default_instance_);
+}
+inline ::message::Error_manager* Locate_sift_response_msg::release_error_manager() {
+  // @@protoc_insertion_point(field_release:message.Locate_sift_response_msg.error_manager)
+  clear_has_error_manager();
+  ::message::Error_manager* temp = error_manager_;
+  error_manager_ = NULL;
+  return temp;
+}
+inline ::message::Error_manager* Locate_sift_response_msg::mutable_error_manager() {
+  set_has_error_manager();
+  if (error_manager_ == NULL) {
+    error_manager_ = new ::message::Error_manager;
+  }
+  // @@protoc_insertion_point(field_mutable:message.Locate_sift_response_msg.error_manager)
+  return error_manager_;
+}
+inline void Locate_sift_response_msg::set_allocated_error_manager(::message::Error_manager* error_manager) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == NULL) {
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(error_manager_);
+  }
+  if (error_manager) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      error_manager = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, error_manager, submessage_arena);
+    }
+    set_has_error_manager();
+  } else {
+    clear_has_error_manager();
+  }
+  error_manager_ = error_manager;
+  // @@protoc_insertion_point(field_set_allocated:message.Locate_sift_response_msg.error_manager)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -2337,6 +2634,21 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Locate_manager_status>() {
   return ::message::Locate_manager_status_descriptor();
 }
+template <> struct is_proto_enum< ::message::Wanji_manager_status> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Wanji_manager_status>() {
+  return ::message::Wanji_manager_status_descriptor();
+}
+template <> struct is_proto_enum< ::message::Wanji_lidar_device_status> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Wanji_lidar_device_status>() {
+  return ::message::Wanji_lidar_device_status_descriptor();
+}
+template <> struct is_proto_enum< ::message::Region_worker_status> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Region_worker_status>() {
+  return ::message::Region_worker_status_descriptor();
+}
 
 }  // namespace protobuf
 }  // namespace google

+ 56 - 10
message/measure_message.proto

@@ -32,18 +32,61 @@ enum Locate_manager_status
 	LOCATE_MANAGER_FAULT					= 5;	//故障
 }
 	
-	
+
+//雷达管理的状态
+enum Wanji_manager_status
+{
+	WANJI_MANAGER_UNKNOWN              	= 0;    //未知
+	WANJI_MANAGER_READY               	= 1;    //准备,待机
+	WANJI_MANAGER_BUSY					= 2; 	//工作正忙
+
+	WANJI_MANAGER_ISSUED_SCAN			= 3; 	//下发任务; 获取点云
+	WANJI_MANAGER_WAIT_SCAN				= 4;	//等待任务; 扫描点云
+
+	WANJI_MANAGER_ISSUED_DETECT			= 5; 	//下发任务; 算法预测
+	WANJI_MANAGER_WAIT_DETECT			= 6; 	//等待任务; 算法预测
+
+	WANJI_MANAGER_FAULT					= 10;	//故障
+}
+
+//万集设备身状态
+enum Wanji_lidar_device_status
+{
+	WANJI_LIDAR_DEVICE_UNKNOWN              	= 0;    //未知
+	WANJI_LIDAR_DEVICE_READY	             	= 1;    //正常待机
+	WANJI_LIDAR_DEVICE_DISCONNECT			= 2;	//断连
+
+	WANJI_LIDAR_DEVICE_BUSY					= 3; 	//工作正忙
+
+	WANJI_LIDAR_DEVICE_FAULT					=10;	//故障
+}
+
+//万集区域功能的状态
+enum Region_worker_status
+{
+	REGION_WORKER_UNKNOWN              	= 0;    //未知
+	REGION_WORKER_READY               	= 1;    //准备,待机
+	REGION_WORKER_BUSY					= 2; 	//工作正忙
+
+	REGION_WORKER_FAULT					= 10;	//故障
+}
+
 //定位模块状态
 message Measure_status_msg
 {
     required Base_info                  base_info=1;                 //消息类型
     required int32                      terminal_id=2;
-    required Laser_manager_status       laser_manager_status = 3;
-    repeated Laser_statu                laser_statu_vector = 4;
-    required Locate_manager_status      locate_manager_status = 5;
 
-    optional Locate_information         locate_information_realtime=6;  //地面雷达的 实时定位信息
-    required Error_manager              error_manager = 7;
+    required Laser_manager_status       laser_manager_status = 3;       //大疆管理状态
+    repeated Laser_statu                laser_statu_vector = 4;         //大疆雷达设备状态
+    required Locate_manager_status      locate_manager_status = 5;      //大疆定位算法状态
+
+    required Wanji_manager_status       wanji_manager_status = 6;       //万集管理状态
+    repeated Wanji_lidar_device_status  wanji_lidar_device_status = 7;  //万集设备身状态
+    repeated Region_worker_status       region_worker_status = 8;       //万集区域功能的状态
+    repeated Locate_information         locate_information_realtime = 9;//地面雷达的 实时定位信息
+
+    required Error_manager              error_manager = 10;
 }
 
 
@@ -79,20 +122,23 @@ message Cloud_type
     required int32                      type=1;
 }
 
-//筛选点云, 请求消息
+//筛选点云; 请求消息
 message Locate_sift_request_msg
 {
     required Base_info                  base_info=1;            //消息类型
     required string                     command_key=2;          //指令唯一标识符id
     required int32                      terminal_id=3;          //终端id
-    repeated Cloud_coordinate           cloud_coordinates=4;     //点云坐标
+    required int32                      lidar_id=4;             //雷达id
+    repeated Cloud_coordinate           cloud_coordinates=5;     //点云坐标
 }
 
-//筛选点云, 请求消息
+//筛选点云; 答复消息
 message Locate_sift_response_msg
 {
     required Base_info                  base_info=1;            //消息类型
     required string                     command_key=2;          //指令唯一标识符id
     required int32                      terminal_id=3;          //终端id
-    repeated Cloud_type                 cloud_type=4;            //点云类型
+    required int32                      lidar_id=4;             //雷达id
+    repeated Cloud_type                 cloud_type=5;            //点云类型
+    required Error_manager              error_manager = 6;      //错误码
 }

+ 121 - 70
message/message_base.pb.cc

@@ -229,6 +229,7 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_information, locate_wheel_base_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_information, locate_wheel_width_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_information, locate_correct_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_information, locate_front_theta_),
   0,
   1,
   2,
@@ -238,6 +239,7 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   6,
   7,
   8,
+  9,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Car_info, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Car_info, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -283,9 +285,9 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT
   { 0, 9, sizeof(::message::Base_info)},
   { 13, 19, sizeof(::message::Base_msg)},
   { 20, 28, sizeof(::message::Error_manager)},
-  { 31, 45, sizeof(::message::Locate_information)},
-  { 54, 63, sizeof(::message::Car_info)},
-  { 67, 83, sizeof(::message::Parkspace_info)},
+  { 31, 46, sizeof(::message::Locate_information)},
+  { 56, 65, sizeof(::message::Car_info)},
+  { 69, 85, sizeof(::message::Parkspace_info)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -327,69 +329,72 @@ void AddDescriptorsImpl() {
       "base_info\030\001 \002(\0132\022.message.Base_info\"i\n\rE"
       "rror_manager\022\022\n\nerror_code\030\001 \002(\005\022)\n\013erro"
       "r_level\030\002 \001(\0162\024.message.Error_level\022\031\n\021e"
-      "rror_description\030\003 \001(\t\"\341\001\n\022Locate_inform"
+      "rror_description\030\003 \001(\t\"\375\001\n\022Locate_inform"
       "ation\022\020\n\010locate_x\030\001 \001(\002\022\020\n\010locate_y\030\002 \001("
       "\002\022\024\n\014locate_angle\030\003 \001(\002\022\025\n\rlocate_length"
       "\030\004 \001(\002\022\024\n\014locate_width\030\005 \001(\002\022\025\n\rlocate_h"
       "eight\030\006 \001(\002\022\031\n\021locate_wheel_base\030\007 \001(\002\022\032"
       "\n\022locate_wheel_width\030\010 \001(\002\022\026\n\016locate_cor"
-      "rect\030\t \001(\010\"V\n\010Car_info\022\022\n\ncar_length\030\001 \001"
-      "(\002\022\021\n\tcar_width\030\002 \001(\002\022\022\n\ncar_height\030\003 \001("
-      "\002\022\017\n\007license\030\004 \001(\t\"\234\002\n\016Parkspace_info\022\024\n"
-      "\014parkspace_id\030\001 \001(\005\022\r\n\005index\030\002 \001(\005\022%\n\tdi"
-      "rection\030\003 \001(\0162\022.message.Direction\022\r\n\005flo"
-      "or\030\004 \001(\005\022\016\n\006length\030\005 \001(\002\022\r\n\005width\030\006 \001(\002\022"
-      "\016\n\006height\030\007 \001(\002\0223\n\020parkspace_status\030\010 \001("
-      "\0162\031.message.Parkspace_status\022#\n\010car_info"
-      "\030\t \001(\0132\021.message.Car_info\022\022\n\nentry_time\030"
-      "\n \001(\t\022\022\n\nleave_time\030\013 \001(\t*\253\007\n\014Message_ty"
-      "pe\022\r\n\teBase_msg\020\000\022\020\n\014eCommand_msg\020\001\022\026\n\022e"
-      "Locate_status_msg\020\021\022\027\n\023eLocate_request_m"
-      "sg\020\022\022\030\n\024eLocate_response_msg\020\023\022\030\n\024eDispa"
-      "tch_status_msg\020!\022\031\n\025eDispatch_request_ms"
-      "g\020\"\022\032\n\026eDispatch_response_msg\020#\022$\n ePark"
-      "space_allocation_status_msg\0201\022%\n!eParksp"
-      "ace_allocation_request_msg\0202\022&\n\"eParkspa"
-      "ce_allocation_response_msg\0203\022!\n\035eParkspa"
-      "ce_search_request_msg\0204\022\"\n\036eParkspace_se"
-      "arch_response_msg\0205\022\"\n\036eParkspace_releas"
-      "e_request_msg\0206\022#\n\037eParkspace_release_re"
-      "sponse_msg\0207\022\'\n#eParkspace_force_update_"
-      "request_msg\0208\022(\n$eParkspace_force_update"
-      "_response_msg\0209\022(\n$eParkspace_confirm_al"
-      "loc_request_msg\020:\022)\n%eParkspace_confirm_"
-      "alloc_response_msg\020;\022\036\n\032eStore_command_r"
-      "equest_msg\020A\022\037\n\033eStore_command_response_"
-      "msg\020B\022\037\n\033ePickup_command_request_msg\020C\022 "
-      "\n\034ePickup_command_response_msg\020D\022\037\n\032eSto"
-      "ring_process_statu_msg\020\220\001\022\037\n\032ePicking_pr"
-      "ocess_statu_msg\020\221\001\022\"\n\035eCentral_controlle"
-      "r_statu_msg\020\240\001\022#\n\036eEntrance_manual_opera"
-      "tion_msg\020\260\001\022\"\n\035eProcess_manual_operation"
-      "_msg\020\261\001*f\n\014Communicator\022\n\n\006eEmpty\020\000\022\t\n\005e"
-      "Main\020\001\022\016\n\teTerminor\020\200\002\022\017\n\neParkspace\020\200\004\022"
-      "\016\n\teMeasurer\020\200\006\022\016\n\teDispatch\020\200\010**\n\014Proce"
-      "ss_type\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013E"
-      "rror_level\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ERR"
-      "OR\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022"
-      "\n\016CRITICAL_ERROR\020\004*q\n\020Parkspace_status\022\024"
-      "\n\020eParkspace_empty\020\000\022\027\n\023eParkspace_occup"
-      "ied\020\001\022\030\n\024eParkspace_reserverd\020\002\022\024\n\020ePark"
-      "space_error\020\003*(\n\tDirection\022\014\n\010eForward\020\001"
-      "\022\r\n\teBackward\020\002*\335\002\n\tStep_type\022\017\n\013eAlloc_"
-      "step\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_st"
-      "ep\020\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_ste"
-      "p\020\004\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021\n"
-      "\reRelease_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBack"
-      "Confirm_step\020\t\022\026\n\022eBack_compare_step\020\n\022\025"
-      "\n\021eBackMeasure_step\020\013\022\023\n\017eBackAlloc_step"
-      "\020\014\022\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch_"
-      "step\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackCom"
-      "plete\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010e"
-      "Working\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
+      "rect\030\t \001(\010\022\032\n\022locate_front_theta\030\n \001(\002\"V"
+      "\n\010Car_info\022\022\n\ncar_length\030\001 \001(\002\022\021\n\tcar_wi"
+      "dth\030\002 \001(\002\022\022\n\ncar_height\030\003 \001(\002\022\017\n\007license"
+      "\030\004 \001(\t\"\234\002\n\016Parkspace_info\022\024\n\014parkspace_i"
+      "d\030\001 \001(\005\022\r\n\005index\030\002 \001(\005\022%\n\tdirection\030\003 \001("
+      "\0162\022.message.Direction\022\r\n\005floor\030\004 \001(\005\022\016\n\006"
+      "length\030\005 \001(\002\022\r\n\005width\030\006 \001(\002\022\016\n\006height\030\007 "
+      "\001(\002\0223\n\020parkspace_status\030\010 \001(\0162\031.message."
+      "Parkspace_status\022#\n\010car_info\030\t \001(\0132\021.mes"
+      "sage.Car_info\022\022\n\nentry_time\030\n \001(\t\022\022\n\nlea"
+      "ve_time\030\013 \001(\t*\350\007\n\014Message_type\022\r\n\teBase_"
+      "msg\020\000\022\020\n\014eCommand_msg\020\001\022\026\n\022eLocate_statu"
+      "s_msg\020\021\022\027\n\023eLocate_request_msg\020\022\022\030\n\024eLoc"
+      "ate_response_msg\020\023\022\034\n\030eLocate_sift_reque"
+      "st_msg\020\024\022\035\n\031eLocate_sift_response_msg\020\025\022"
+      "\030\n\024eDispatch_status_msg\020!\022\031\n\025eDispatch_r"
+      "equest_msg\020\"\022\032\n\026eDispatch_response_msg\020#"
+      "\022$\n eParkspace_allocation_status_msg\0201\022%"
+      "\n!eParkspace_allocation_request_msg\0202\022&\n"
+      "\"eParkspace_allocation_response_msg\0203\022!\n"
+      "\035eParkspace_search_request_msg\0204\022\"\n\036ePar"
+      "kspace_search_response_msg\0205\022\"\n\036eParkspa"
+      "ce_release_request_msg\0206\022#\n\037eParkspace_r"
+      "elease_response_msg\0207\022\'\n#eParkspace_forc"
+      "e_update_request_msg\0208\022(\n$eParkspace_for"
+      "ce_update_response_msg\0209\022(\n$eParkspace_c"
+      "onfirm_alloc_request_msg\020:\022)\n%eParkspace"
+      "_confirm_alloc_response_msg\020;\022\036\n\032eStore_"
+      "command_request_msg\020A\022\037\n\033eStore_command_"
+      "response_msg\020B\022\037\n\033ePickup_command_reques"
+      "t_msg\020C\022 \n\034ePickup_command_response_msg\020"
+      "D\022\037\n\032eStoring_process_statu_msg\020\220\001\022\037\n\032eP"
+      "icking_process_statu_msg\020\221\001\022\"\n\035eCentral_"
+      "controller_statu_msg\020\240\001\022#\n\036eEntrance_man"
+      "ual_operation_msg\020\260\001\022\"\n\035eProcess_manual_"
+      "operation_msg\020\261\001*\202\001\n\014Communicator\022\n\n\006eEm"
+      "pty\020\000\022\t\n\005eMain\020\001\022\016\n\teTerminor\020\200\002\022\017\n\nePar"
+      "kspace\020\200\004\022\016\n\teMeasurer\020\200\006\022\032\n\025eMeasurer_s"
+      "ift_server\020\201\006\022\016\n\teDispatch\020\200\010**\n\014Process"
+      "_type\022\014\n\010eStoring\020\001\022\014\n\010ePicking\020\002*e\n\013Err"
+      "or_level\022\n\n\006NORMAL\020\000\022\024\n\020NEGLIGIBLE_ERROR"
+      "\020\001\022\017\n\013MINOR_ERROR\020\002\022\017\n\013MAJOR_ERROR\020\003\022\022\n\016"
+      "CRITICAL_ERROR\020\004*q\n\020Parkspace_status\022\024\n\020"
+      "eParkspace_empty\020\000\022\027\n\023eParkspace_occupie"
+      "d\020\001\022\030\n\024eParkspace_reserverd\020\002\022\024\n\020eParksp"
+      "ace_error\020\003*(\n\tDirection\022\014\n\010eForward\020\001\022\r"
+      "\n\teBackward\020\002*\335\002\n\tStep_type\022\017\n\013eAlloc_st"
+      "ep\020\000\022\021\n\reMeasure_step\020\001\022\021\n\reCompare_step"
+      "\020\002\022\022\n\016eDispatch_step\020\003\022\021\n\reConfirm_step\020"
+      "\004\022\020\n\014eSearch_step\020\005\022\016\n\neWait_step\020\006\022\021\n\re"
+      "Release_step\020\007\022\r\n\teComplete\020\010\022\025\n\021eBackCo"
+      "nfirm_step\020\t\022\026\n\022eBack_compare_step\020\n\022\025\n\021"
+      "eBackMeasure_step\020\013\022\023\n\017eBackAlloc_step\020\014"
+      "\022\022\n\016eBackWait_step\020\r\022\026\n\022eBackDispatch_st"
+      "ep\020\016\022\024\n\020eBackSearch_step\020\017\022\021\n\reBackCompl"
+      "ete\020\020*C\n\nStep_statu\022\014\n\010eWaiting\020\000\022\014\n\010eWo"
+      "rking\020\001\022\n\n\006eError\020\002\022\r\n\teFinished\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 2716);
+      descriptor, 2834);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -417,6 +422,8 @@ bool Message_type_IsValid(int value) {
     case 17:
     case 18:
     case 19:
+    case 20:
+    case 21:
     case 33:
     case 34:
     case 35:
@@ -457,6 +464,7 @@ bool Communicator_IsValid(int value) {
     case 256:
     case 512:
     case 768:
+    case 769:
     case 1024:
       return true;
     default:
@@ -1610,6 +1618,7 @@ const int Locate_information::kLocateHeightFieldNumber;
 const int Locate_information::kLocateWheelBaseFieldNumber;
 const int Locate_information::kLocateWheelWidthFieldNumber;
 const int Locate_information::kLocateCorrectFieldNumber;
+const int Locate_information::kLocateFrontThetaFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 Locate_information::Locate_information()
@@ -1627,16 +1636,16 @@ Locate_information::Locate_information(const Locate_information& from)
       _cached_size_(0) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   ::memcpy(&locate_x_, &from.locate_x_,
-    static_cast<size_t>(reinterpret_cast<char*>(&locate_correct_) -
-    reinterpret_cast<char*>(&locate_x_)) + sizeof(locate_correct_));
+    static_cast<size_t>(reinterpret_cast<char*>(&locate_front_theta_) -
+    reinterpret_cast<char*>(&locate_x_)) + sizeof(locate_front_theta_));
   // @@protoc_insertion_point(copy_constructor:message.Locate_information)
 }
 
 void Locate_information::SharedCtor() {
   _cached_size_ = 0;
   ::memset(&locate_x_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&locate_correct_) -
-      reinterpret_cast<char*>(&locate_x_)) + sizeof(locate_correct_));
+      reinterpret_cast<char*>(&locate_front_theta_) -
+      reinterpret_cast<char*>(&locate_x_)) + sizeof(locate_front_theta_));
 }
 
 Locate_information::~Locate_information() {
@@ -1682,7 +1691,11 @@ void Locate_information::Clear() {
         reinterpret_cast<char*>(&locate_wheel_width_) -
         reinterpret_cast<char*>(&locate_x_)) + sizeof(locate_wheel_width_));
   }
-  locate_correct_ = false;
+  if (cached_has_bits & 768u) {
+    ::memset(&locate_correct_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&locate_front_theta_) -
+        reinterpret_cast<char*>(&locate_correct_)) + sizeof(locate_front_theta_));
+  }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -1823,6 +1836,20 @@ bool Locate_information::MergePartialFromCodedStream(
         break;
       }
 
+      // optional float locate_front_theta = 10;
+      case 10: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(85u /* 85 & 0xFF */)) {
+          set_has_locate_front_theta();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &locate_front_theta_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -1895,6 +1922,11 @@ void Locate_information::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->locate_correct(), output);
   }
 
+  // optional float locate_front_theta = 10;
+  if (cached_has_bits & 0x00000200u) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->locate_front_theta(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -1955,6 +1987,11 @@ void Locate_information::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->locate_correct(), target);
   }
 
+  // optional float locate_front_theta = 10;
+  if (cached_has_bits & 0x00000200u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->locate_front_theta(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -2014,11 +2051,18 @@ size_t Locate_information::ByteSizeLong() const {
     }
 
   }
-  // optional bool locate_correct = 9;
-  if (has_locate_correct()) {
-    total_size += 1 + 1;
-  }
+  if (_has_bits_[8 / 32] & 768u) {
+    // optional bool locate_correct = 9;
+    if (has_locate_correct()) {
+      total_size += 1 + 1;
+    }
+
+    // optional float locate_front_theta = 10;
+    if (has_locate_front_theta()) {
+      total_size += 1 + 4;
+    }
 
+  }
   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = cached_size;
@@ -2076,8 +2120,14 @@ void Locate_information::MergeFrom(const Locate_information& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 0x00000100u) {
-    set_locate_correct(from.locate_correct());
+  if (cached_has_bits & 768u) {
+    if (cached_has_bits & 0x00000100u) {
+      locate_correct_ = from.locate_correct_;
+    }
+    if (cached_has_bits & 0x00000200u) {
+      locate_front_theta_ = from.locate_front_theta_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
 }
 
@@ -2114,6 +2164,7 @@ void Locate_information::InternalSwap(Locate_information* other) {
   swap(locate_wheel_base_, other->locate_wheel_base_);
   swap(locate_wheel_width_, other->locate_wheel_width_);
   swap(locate_correct_, other->locate_correct_);
+  swap(locate_front_theta_, other->locate_front_theta_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 37 - 0
message/message_base.pb.h

@@ -92,6 +92,8 @@ enum Message_type {
   eLocate_status_msg = 17,
   eLocate_request_msg = 18,
   eLocate_response_msg = 19,
+  eLocate_sift_request_msg = 20,
+  eLocate_sift_response_msg = 21,
   eDispatch_status_msg = 33,
   eDispatch_request_msg = 34,
   eDispatch_response_msg = 35,
@@ -137,6 +139,7 @@ enum Communicator {
   eTerminor = 256,
   eParkspace = 512,
   eMeasurer = 768,
+  eMeasurer_sift_server = 769,
   eDispatch = 1024
 };
 bool Communicator_IsValid(int value);
@@ -837,6 +840,13 @@ class Locate_information : public ::google::protobuf::Message /* @@protoc_insert
   bool locate_correct() const;
   void set_locate_correct(bool value);
 
+  // optional float locate_front_theta = 10;
+  bool has_locate_front_theta() const;
+  void clear_locate_front_theta();
+  static const int kLocateFrontThetaFieldNumber = 10;
+  float locate_front_theta() const;
+  void set_locate_front_theta(float value);
+
   // @@protoc_insertion_point(class_scope:message.Locate_information)
  private:
   void set_has_locate_x();
@@ -857,6 +867,8 @@ class Locate_information : public ::google::protobuf::Message /* @@protoc_insert
   void clear_has_locate_wheel_width();
   void set_has_locate_correct();
   void clear_has_locate_correct();
+  void set_has_locate_front_theta();
+  void clear_has_locate_front_theta();
 
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
@@ -870,6 +882,7 @@ class Locate_information : public ::google::protobuf::Message /* @@protoc_insert
   float locate_wheel_base_;
   float locate_wheel_width_;
   bool locate_correct_;
+  float locate_front_theta_;
   friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
   friend void ::protobuf_message_5fbase_2eproto::InitDefaultsLocate_informationImpl();
 };
@@ -1753,6 +1766,30 @@ inline void Locate_information::set_locate_correct(bool value) {
   // @@protoc_insertion_point(field_set:message.Locate_information.locate_correct)
 }
 
+// optional float locate_front_theta = 10;
+inline bool Locate_information::has_locate_front_theta() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void Locate_information::set_has_locate_front_theta() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void Locate_information::clear_has_locate_front_theta() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void Locate_information::clear_locate_front_theta() {
+  locate_front_theta_ = 0;
+  clear_has_locate_front_theta();
+}
+inline float Locate_information::locate_front_theta() const {
+  // @@protoc_insertion_point(field_get:message.Locate_information.locate_front_theta)
+  return locate_front_theta_;
+}
+inline void Locate_information::set_locate_front_theta(float value) {
+  set_has_locate_front_theta();
+  locate_front_theta_ = value;
+  // @@protoc_insertion_point(field_set:message.Locate_information.locate_front_theta)
+}
+
 // -------------------------------------------------------------------
 
 // Car_info

+ 6 - 0
message/message_base.proto

@@ -12,6 +12,8 @@ enum Message_type
     eLocate_request_msg=0x12;               //定位请求消息
     eLocate_response_msg=0x13;              //定位反馈消息
 
+    eLocate_sift_request_msg = 0x14;            //预测算法请求消息
+    eLocate_sift_response_msg = 0x15;           //预测算法反馈消息
 
     eDispatch_status_msg=0x21;                //调度模块硬件状态消息
     eDispatch_request_msg=0x22;              //请求调度消息
@@ -61,6 +63,8 @@ enum Communicator
     eParkspace=0x0200;
     //测量单元
     eMeasurer=0x0300;
+    //测量单元
+    eMeasurer_sift_server=0x0301;
     //调度机构
     eDispatch=0x0400;
     //...
@@ -123,6 +127,8 @@ message Locate_information
     optional float locate_wheel_base = 7;	    //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
     optional float locate_wheel_width = 8;	    //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
     optional bool locate_correct = 9;		    //整车的校准标记位
+
+    optional float locate_front_theta = 10;	    //整车的前轮的旋转角
 }
 
 //车辆基本信息

+ 3 - 1
proto.sh

@@ -1,7 +1,9 @@
 protoc -I=./message message_base.proto --cpp_out=./message
 protoc -I=./message measure_message.proto --cpp_out=./message
-protoc -I=./message dispatch_message.proto --cpp_out=./message
+
 protoc -I=./communication communication.proto --cpp_out=./communication
+protoc -I=./message dispatch_message.proto --cpp_out=./message
+protoc -I=./snap7_communication snap7_communication.proto --cpp_out=./snap7_communication
 
 
 

+ 11 - 6
setting/communication.prototxt

@@ -10,14 +10,19 @@ communication_parameters
   # connect_string_vector:"tcp://192.168.2.125:9876"
   # connect_string_vector:"tcp://192.168.2.166:1234"
 
-  # bind_string:"tcp://192.168.2.166:4444"
-  #      bind_string:"tcp://192.168.3.106:5555"
+ #  bind_string:"tcp://192.168.2.192:30001"
+ #  bind_string:"tcp://192.168.2.167:30001"
 
-#    bind_string:"tcp://192.168.2.192:30002"
- #   bind_string:"tcp://192.168.2.167:30002"
-  #  connect_string_vector:"tcp://192.168.2.183:30003"
-    connect_string_vector:"tcp://192.168.2.183:30000"
 
 
+
+
+
+  # connect_string_vector:"tcp://192.168.2.183:30002"
+   connect_string_vector:"tcp://192.168.2.125:7001"
+
+
+#   connect_string_vector:"tcp://192.168.2.233:2333"
+
 }
 

+ 62 - 1
setting/laser.prototxt

@@ -1,5 +1,5 @@
 #1号雷达
-#  0TFDFG700601881  0TFDFCE00502001
+#  0TFDFG700601881  0TFDFCE00502001 0TFDH5L00684HE1  0TFDH5R006RCJ91
 
 
 
@@ -23,3 +23,64 @@ laser_parameters
     mat_r23:0
 }
 
+
+laser_parameters
+{
+	type:"Livox"
+	sn:"0TFDFCE00502001"
+	frame_num:1000
+    mat_r00:1
+    mat_r01:0
+    mat_r02:0
+    mat_r03:0
+    mat_r10:0
+    mat_r11:1
+    mat_r12:0
+    mat_r13:0
+    mat_r20:0
+    mat_r21:0
+    mat_r22:1
+    mat_r23:0
+}
+
+
+
+laser_parameters
+{
+	type:"Livox"
+	sn:"0TFDH5L00684HE1"
+	frame_num:1000
+    mat_r00:1
+    mat_r01:0
+    mat_r02:0
+    mat_r03:0
+    mat_r10:0
+    mat_r11:1
+    mat_r12:0
+    mat_r13:0
+    mat_r20:0
+    mat_r21:0
+    mat_r22:1
+    mat_r23:0
+}
+
+
+
+laser_parameters
+{
+	type:"Livox"
+	sn:"0TFDH5R006RCJ91"
+	frame_num:1000
+    mat_r00:1
+    mat_r01:0
+    mat_r02:0
+    mat_r03:0
+    mat_r10:0
+    mat_r11:1
+    mat_r12:0
+    mat_r13:0
+    mat_r20:0
+    mat_r21:0
+    mat_r22:1
+    mat_r23:0
+}

+ 19 - 12
setting/locate.prototxt

@@ -1,10 +1,17 @@
 area{
-    x_min:-1227.5
-    x_max:1802.9
-    y_min:-2789.8
-    y_max:3777.19
-    z_min:0
-    z_max:1800
+ #   x_min:-1227.5
+ #   x_max:1802.9
+ #   y_min:-2789.8
+ #   y_max:3777.19
+  #  z_min:0
+  #  z_max:1800
+
+        x_min:-1000000
+        x_max:1000000
+        y_min:-1000000
+        y_max:1000000
+        z_min:-1000000
+        z_max:1000000
 }
 
 net_3dcnn_parameter
@@ -24,12 +31,12 @@ seg_parameter
     freq:0.020
     area
     {
-        x_min:-10000.0
-    	x_max:10000.0
-    	y_min:-10000.0
-    	y_max:10000.0
-    	z_min:-10000.0
-    	z_max:10000.0
+        x_min:-100000.0
+    	x_max:100000.0
+    	y_min:-100000.0
+    	y_max:100000.0
+    	z_min:-100000.0
+    	z_max:100000.0
     }
     graph:"../model_param/seg_model_404500.ckpt.meta"
     cpkt:"../model_param/seg_model_404500.ckpt"

+ 7 - 0
setting/snap7_communication.prototxt

@@ -0,0 +1,7 @@
+
+snap7_communication_parameters
+{
+    ip_string:"192.168.0.1"
+ #   ip_string:"192.168.2.134"
+}
+

+ 182 - 0
snap7_communication/plc_data.cpp

@@ -0,0 +1,182 @@
+//
+// Created by zx on 2019/12/9.
+//
+
+#include "plc_data.h"
+#include <string.h>
+Plc_data *Plc_data::g_ins = 0;
+std::mutex Plc_data::g_lock;
+
+/**
+ * 获取单例句柄
+ * */
+Plc_data *Plc_data::get_instance(std::string ip)
+{
+    if (g_ins == 0)
+    {
+        std::lock_guard<std::mutex> lock(g_lock);
+        if (g_ins == 0)
+        {
+            if (ip != "")
+            {
+                g_ins = new Plc_data(ip);
+                LOG(INFO) << "plc data, handle created";
+            }
+            else
+            {
+                return 0;
+            }
+        }
+    }
+    return g_ins;
+}
+
+// void Plc_data::Release()
+// {
+//     if (g_ins)
+//     {
+//         g_ins->m_cond_exit.Notify(true);
+//         LOG(INFO) << "plc data, try to exit plc send thread";
+//         g_lock.lock();
+//         if (g_ins->p_send_thread)
+//         {
+//             LOG(INFO) << "plc data, try to join plc send thread";
+//             // LOG(INFO) << g_ins->p_send_thread->joinable();
+//             if (g_ins->p_send_thread->joinable())
+//                 g_ins->p_send_thread->join();
+//             LOG(INFO) << "plc data, try to delete plc send thread";
+//             delete g_ins->p_send_thread;
+//             g_ins->p_send_thread = 0;
+//             LOG(INFO) << "plc data, delete data send thread";
+//         }
+//         g_lock.unlock();
+
+//         LOG(INFO) << "plc data, start to exit plc handle";
+//         // if(g_instance->p_plc){
+//         //     LOG(INFO)<<"plc data, try to delete plc handle";
+//         //     delete g_instance->p_plc;
+//         //     g_instance->p_plc = 0;
+//         // }
+//         // LOG(INFO)<<"plc data, delete plc handle";
+//         LOG(INFO) << "plc data, delete instance";
+//         // delete g_ins;
+//         // g_ins = 0;
+//         LOG(INFO) << "plc data, instance deleted";
+//     }
+//     else
+//     {
+//         LOG(WARNING) << "plc data, cannot find the instance";
+//     }
+// }
+
+/**
+ * 更新区域状态
+ * */
+void Plc_data::update_data(int state_code, int border_status, int id)
+{
+//     LOG(INFO) << "plc data 更新数据 id: "<<id<<", code: "<<state_code;
+    if(id<0 || id>=MAX_REGIONS)
+        return ;
+    std::lock_guard<std::mutex> lock(g_lock);
+    m_data[2 * id] = state_code;
+    m_data[2 * id + 1] = border_status;
+}
+
+/**
+ * plc更新线程,将区域状态写入plc
+ * */
+void Plc_data::plc_update_thread(Plc_data *p)
+{
+    if (p == 0)
+    {
+        LOG(ERROR) << "plc update thread null pointer";
+        return;
+    }
+    while (!p->m_cond_exit.wait_for_millisecond(1))
+    {
+
+        // 判断plc状态
+        if (p->m_plc.getConnection() && p->mb_is_ready)
+        {
+
+
+            for (int i = 0; i < ELE_FENCE_COUNT; ++i)
+            {
+
+                g_lock.lock();
+                p->mb_is_ready = p->m_plc.WriteShorts(ELE_FENCE_DB_NUM,
+                                                      ELE_FENCE_BOUNDARY_START_ADDR + i * ELE_FENCE_OFFSET,
+                                                      2,
+                                                      p->m_data + (i * 2));
+                memcpy(p->m_last_data + (i * 2), p->m_data + (i * 2), 2 * sizeof(short));
+
+                g_lock.unlock();
+                usleep(10 * 1000);
+            }
+
+        }
+        else
+        {
+            // 重连plc
+            LOG(WARNING) << "find plc connection error, trying to reconnect.";
+            g_lock.lock();
+            p->m_plc.disconnect();
+            // LOG(WARNING) << "find plc connection error, diconnect first.";
+            if (p->m_ip_str != "")
+            {
+                p->mb_is_ready = p->m_plc.connect(p->m_ip_str);
+                // LOG(WARNING) << "find plc connection error, trying to connect";
+                if (p->mb_is_ready)
+                {
+                    LOG(INFO) << "successfully reconnect.";
+                }
+                else
+                {
+                    LOG(WARNING) << "failed to connect plc.";
+                }
+            }
+            g_lock.unlock();
+            usleep(p->m_update_interval_milli * 5 * 1000);
+        }
+        usleep(p->m_update_interval_milli * 1000);
+    }
+}
+
+/**
+ * 有参构造
+ * */
+Plc_data::Plc_data(std::string ip) : mp_update_thread(0),
+                                     m_ip_str(""),
+                                     mb_is_ready(0)
+{
+    m_ip_str = ip;
+    memset(m_data, 0, MAX_REGIONS*2 * sizeof(short));
+    memset(m_last_data, 0, MAX_REGIONS*2 * sizeof(short));
+    // p_plc = new S7PLC();
+    if (m_ip_str != "")
+    {
+        if (m_plc.connect(m_ip_str))
+        {
+            mb_is_ready = true;
+        }
+        else
+        {
+            LOG(ERROR) << "Plc_data instance, connect failed";
+        }
+    }
+    else
+    {
+        LOG(ERROR) << "Plc_data instance, empty ip string.";
+    }
+    m_cond_exit.notify_all(false);
+    mp_update_thread = new std::thread(plc_update_thread, this);
+    mp_update_thread->detach();
+}
+
+/**
+ * 获取plc连接状态
+ * */
+bool Plc_data::get_plc_status()
+{
+    return mb_is_ready;
+}

+ 75 - 0
snap7_communication/plc_data.h

@@ -0,0 +1,75 @@
+//
+// Created by zx on 2019/12/9.
+//
+
+#ifndef PLC_DATA_H
+#define PLC_DATA_H
+#include <iostream>
+#include <string>
+#include <mutex>
+#include <atomic>
+#include "../tool/thread_condition.h"
+#include <thread>
+#include "../snap7_communication/s7_plc.h"
+#include "unistd.h"
+//#include "define.h"
+#include "glog/logging.h"
+
+#define MAX_REGIONS 6
+#define ELE_FENCE_BOUNDARY_START_ADDR 3
+#define ELE_FENCE_DB_NUM 95
+#define ELE_FENCE_OFFSET 7
+#define ELE_FENCE_COUNT 6
+
+#define CENTRAL_CONTROLLER_DB_NUM 41
+#define DOOR_STATUS_OFFSET 18
+
+
+class Plc_data
+{
+public:
+    // 获取plc通信类单例
+    static Plc_data *get_instance(std::string ip = "");
+    // static void Release();
+    // 更新区域状态数据
+    void update_data(int state_code, int border_status, int id);
+    // plc更新线程
+    static void plc_update_thread(Plc_data *p);
+    // 获取plc实时状态
+    bool get_plc_status();
+
+public:
+    std::atomic<bool> mb_is_ready; // 状态正常与否
+
+private:
+    static Plc_data *g_ins;   // 全局Plc_data实例
+    static std::mutex g_lock; // 全局Plc_data实例访问互斥锁
+
+    Thread_condition m_cond_exit;                // 系统关闭标志
+    std::thread *mp_update_thread;           // plc更新线程
+    S7PLC m_plc;                             // S7协议句柄
+    const int m_update_interval_milli = 100; // plc更新频率
+
+    // 有参构造函数
+    Plc_data(std::string ip);
+
+    // class CGarbo
+    // {
+    // public:
+    // 	~CGarbo() {
+    // 		if (g_ins)
+    // 		{
+    // 			delete g_ins;
+    // 			g_ins = 0;
+    // 		}
+    // 	}
+    // };
+    // static CGarbo Garbo;	//--->1
+
+protected:
+    short m_data[MAX_REGIONS*2];
+    short m_last_data[MAX_REGIONS*2];
+    std::string m_ip_str;
+};
+
+#endif //PLC_DATA_H

+ 85 - 0
snap7_communication/s7_plc.cpp

@@ -0,0 +1,85 @@
+#include "s7_plc.h"
+
+S7PLC::S7PLC():bConnected_(false)
+{
+}
+S7PLC::~S7PLC()
+{
+    disconnect();
+}
+
+bool S7PLC::getConnection(){
+    return bConnected_;
+}
+
+bool S7PLC::connect(std::string ip)    
+{
+    std::lock_guard<std::mutex> lck (mutex_);
+    int ret=client_.ConnectTo(ip.c_str(),0,1);
+    bConnected_=(ret==0);
+    return bConnected_;
+}
+
+bool S7PLC::ReadShorts(int DBNumber,int start,int size,short* pdata)
+{
+    short* plc_data= (short*)malloc(size*sizeof(short));
+    bool ret=read_dbs(DBNumber,start*sizeof(short),size*sizeof(short),pdata);
+    if(ret)
+    {
+        reverse_byte(pdata,size*sizeof(short),plc_data);
+        for(int i=0;i<size;++i)
+            pdata[i]=plc_data[size-i-1];
+    }
+    free(plc_data);
+    return ret;
+
+}
+    bool S7PLC::WriteShorts(int DBNumber,int start,int size,short* pdata)
+    {
+        short* plc_data=(short*)malloc(size*sizeof(short));
+        memcpy(plc_data,pdata,size*sizeof(short));
+        for(int i=0;i<size;++i)
+            plc_data[i]=HTON(plc_data[i]);
+
+        bool ret=write_dbs(DBNumber,start*sizeof(short),size*sizeof(short),plc_data);
+        free(plc_data);
+        return ret;
+    }
+
+ bool S7PLC::read_dbs(int DBNumber,int start,int size,void* pdata)
+ {
+     std::lock_guard<std::mutex> lck (mutex_);
+     usleep(1000* 50);
+     if(bConnected_==false)
+        return false;
+     
+     int ret=client_.AsDBRead(DBNumber,start,size,pdata);
+
+     return ret == 0;
+ }
+ bool S7PLC::write_dbs(int DBNumber, int start, int size, void *pdata)
+ {
+    std::lock_guard<std::mutex> lck(mutex_);
+    usleep(1000*50);
+     if(bConnected_==false)
+        return false;
+     
+     int ret = client_.AsDBWrite(DBNumber, start, size, pdata);
+
+     return ret == 0;
+ }
+ void S7PLC::disconnect()
+ {
+     std::lock_guard<std::mutex> lck(mutex_);
+     client_.Disconnect();
+ }
+
+ void S7PLC::reverse_byte(void* pdata,int num_byte,void* out)
+ {
+     char* pin=(char*)pdata;
+     char* pout=(char*)out;
+     for(int i=0;i<num_byte;++i)
+     {
+         pout[i]=pin[num_byte-i-1];
+     }
+ }

+ 32 - 0
snap7_communication/s7_plc.h

@@ -0,0 +1,32 @@
+#ifndef S7__PLC__H
+#define S7__PLC__H
+
+#include <s7_client.h>
+#include <mutex>
+#include <iostream>
+
+class S7PLC
+{
+public:
+#define HTON(T) ((T) << 8) | ((T) >> 8)
+protected:
+    bool        bConnected_;
+    std::mutex  mutex_;
+    TSnap7Client client_;
+public:
+    S7PLC();
+    ~S7PLC();
+
+    bool connect(std::string ip);
+    bool getConnection();
+    bool ReadShorts(int DBNumber,int start,int size,short* pdata);
+    bool WriteShorts(int DBNumber,int start,int size,short* pdata);
+    void disconnect();
+private:
+    bool read_dbs(int DBNumber,int start,int size,void* pdata);
+    bool write_dbs(int DBNumber,int start,int size,void* pdata);
+    void reverse_byte(void* pdata,int num_byte,void* out);
+
+};
+
+#endif // !S7__PLC__H

+ 119 - 0
snap7_communication/snap7_buf.cpp

@@ -0,0 +1,119 @@
+
+
+
+#include "snap7_buf.h"
+#include <string>
+#include <string.h>
+
+Snap7_buf::Snap7_buf()
+{
+	m_id = 0;
+	m_start_index = 0;
+	m_size = 0;
+	mp_buf_obverse = nullptr;
+	mp_buf_reverse = nullptr;
+	m_communication_mode = NO_COMMUNICATION;
+
+}
+Snap7_buf::Snap7_buf(const Snap7_buf& other)
+{
+	m_id = other.m_id;
+	m_start_index = other.m_start_index;
+	m_communication_mode = other.m_communication_mode;
+
+	if ( other.m_size > 0 && other.mp_buf_obverse != nullptr && other.mp_buf_reverse != nullptr)
+	{
+		mp_buf_obverse = (void*)malloc(other.m_size);
+		memcpy(mp_buf_obverse, other.mp_buf_obverse, other.m_size);
+		mp_buf_reverse = (void*)malloc(other.m_size);
+		memcpy(mp_buf_reverse, other.mp_buf_reverse, other.m_size);
+		m_size = other.m_size;
+	}
+}
+Snap7_buf& Snap7_buf::operator =(const Snap7_buf& other)
+{
+	m_id = other.m_id;
+	m_start_index = other.m_start_index;
+	m_communication_mode = other.m_communication_mode;
+
+	if ( other.m_size > 0 && other.mp_buf_obverse != nullptr && other.mp_buf_reverse != nullptr)
+	{
+		mp_buf_obverse = (void*)malloc(other.m_size);
+		memcpy(mp_buf_obverse, other.mp_buf_obverse, other.m_size);
+		mp_buf_reverse = (void*)malloc(other.m_size);
+		memcpy(mp_buf_reverse, other.mp_buf_reverse, other.m_size);
+		m_size = other.m_size;
+	}
+}
+Snap7_buf::~Snap7_buf()
+{
+	if ( mp_buf_obverse )
+	{
+		free(mp_buf_obverse);
+		mp_buf_obverse = NULL;
+	}
+	if ( mp_buf_reverse )
+	{
+		free(mp_buf_reverse);
+		mp_buf_reverse = NULL;
+	}
+}
+
+Snap7_buf::Snap7_buf(int id, int start_index, int size, Communication_mode communication_mode)
+{
+	m_id = id;
+	m_start_index = start_index;
+	m_communication_mode = communication_mode;
+
+	if ( size > 0)
+	{
+		mp_buf_obverse = (void*)malloc(size);
+		mp_buf_reverse = (void*)malloc(size);
+		m_size = size;
+	}
+}
+Snap7_buf::Snap7_buf(int id, int start_index, int size, void* p_buf_obverse, void* p_buf_reverse, Communication_mode communication_mode)
+{
+	m_id = id;
+	m_start_index = start_index;
+	m_communication_mode = communication_mode;
+
+	if ( size > 0 && p_buf_obverse != nullptr && p_buf_reverse != nullptr)
+	{
+		mp_buf_obverse = (void*)malloc(size);
+		memcpy(mp_buf_obverse, p_buf_obverse, size);
+		mp_buf_reverse = (void*)malloc(size);
+		memcpy(mp_buf_reverse, p_buf_reverse, size);
+		m_size = size;
+	}
+}
+
+int Snap7_buf::get_id()
+{
+	return m_id;
+}
+int Snap7_buf::get_start_index()
+{
+	return m_start_index;
+}
+int Snap7_buf::get_size()
+{
+	return m_size;
+}
+void* Snap7_buf::get_buf_obverse()
+{
+	return mp_buf_obverse;
+}
+void* Snap7_buf::get_buf_reverse()
+{
+	return mp_buf_reverse;
+}
+
+Snap7_buf::Communication_mode Snap7_buf::get_communication_mode()
+{
+	return m_communication_mode;
+}
+void Snap7_buf::set_communication_mode(Communication_mode communication_mode)
+{
+	m_communication_mode = communication_mode;
+}

+ 54 - 0
snap7_communication/snap7_buf.h

@@ -0,0 +1,54 @@
+
+
+
+#ifndef NNXX_TESTS_SNAP7_BUF_H
+#define NNXX_TESTS_SNAP7_BUF_H
+
+//Snap7协议的数据结构
+class Snap7_buf
+{
+public:
+	//通信模式
+	enum Communication_mode
+	{
+	    NO_COMMUNICATION               		= 0,    //不通信
+	    ONCE_COMMUNICATION               	= 1,    //一次通信
+	    LOOP_COMMUNICATION					= 2,	//循环通信
+	};
+public:
+	Snap7_buf();
+	Snap7_buf(const Snap7_buf& other);
+	Snap7_buf& operator =(const Snap7_buf& other);
+	~Snap7_buf();
+public://API functions
+	Snap7_buf(int id, int start_index, int size, Communication_mode communication_mode = NO_COMMUNICATION);
+	Snap7_buf(int id, int start_index, int size, void* p_buf_obverse, void* p_buf_reverse, Communication_mode communication_mode = NO_COMMUNICATION);
+public://get or set member variable
+	int get_id();
+	int get_start_index();
+	int get_size();
+	void* get_buf_obverse();
+	void* get_buf_reverse();
+	Communication_mode get_communication_mode();
+	void set_communication_mode(Communication_mode communication_mode);
+protected://member functions
+
+public://member variable
+
+	int 		m_id;					//Snap7协议的数据块的编号
+	int 		m_start_index;			//Snap7协议的数据起始位下标
+	int			m_size;					//Snap7协议的数据字节大小
+	void*		mp_buf_obverse;			//Snap7协议的正序数据指针, 和数据结构体进行强转, 内存由本类管理
+	void*		mp_buf_reverse;			//Snap7协议的倒序数据指针, 用作s7通信, 内存由本类管理
+	//注:s7的通信的数据必须要倒序之后才能进行通信,
+
+	Communication_mode 		m_communication_mode;	//Snap7协议的通信模式
+	//注:s7协议传输很慢, 防止相同的数据重复发送...
+
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_SNAP7_BUF_H

+ 681 - 0
snap7_communication/snap7_communication.pb.cc

@@ -0,0 +1,681 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: snap7_communication.proto
+
+#include "snap7_communication.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// This is a temporary google only hack
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+#include "third_party/protobuf/version.h"
+#endif
+// @@protoc_insertion_point(includes)
+namespace Snap7_communication_proto {
+class Snap7_communication_parameterDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<Snap7_communication_parameter>
+      _instance;
+} _Snap7_communication_parameter_default_instance_;
+class Snap7_communication_parameter_allDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<Snap7_communication_parameter_all>
+      _instance;
+} _Snap7_communication_parameter_all_default_instance_;
+}  // namespace Snap7_communication_proto
+namespace protobuf_snap7_5fcommunication_2eproto {
+void InitDefaultsSnap7_communication_parameterImpl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+  ::google::protobuf::internal::InitProtobufDefaults();
+#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  {
+    void* ptr = &::Snap7_communication_proto::_Snap7_communication_parameter_default_instance_;
+    new (ptr) ::Snap7_communication_proto::Snap7_communication_parameter();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::Snap7_communication_proto::Snap7_communication_parameter::InitAsDefaultInstance();
+}
+
+void InitDefaultsSnap7_communication_parameter() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSnap7_communication_parameterImpl);
+}
+
+void InitDefaultsSnap7_communication_parameter_allImpl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+  ::google::protobuf::internal::InitProtobufDefaults();
+#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter();
+  {
+    void* ptr = &::Snap7_communication_proto::_Snap7_communication_parameter_all_default_instance_;
+    new (ptr) ::Snap7_communication_proto::Snap7_communication_parameter_all();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::Snap7_communication_proto::Snap7_communication_parameter_all::InitAsDefaultInstance();
+}
+
+void InitDefaultsSnap7_communication_parameter_all() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSnap7_communication_parameter_allImpl);
+}
+
+::google::protobuf::Metadata file_level_metadata[2];
+
+const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter, ip_string_),
+  0,
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter_all, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter_all, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Snap7_communication_proto::Snap7_communication_parameter_all, snap7_communication_parameters_),
+  0,
+};
+static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, 6, sizeof(::Snap7_communication_proto::Snap7_communication_parameter)},
+  { 7, 13, sizeof(::Snap7_communication_proto::Snap7_communication_parameter_all)},
+};
+
+static ::google::protobuf::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::google::protobuf::Message*>(&::Snap7_communication_proto::_Snap7_communication_parameter_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::Snap7_communication_proto::_Snap7_communication_parameter_all_default_instance_),
+};
+
+void protobuf_AssignDescriptors() {
+  AddDescriptors();
+  ::google::protobuf::MessageFactory* factory = NULL;
+  AssignDescriptors(
+      "snap7_communication.proto", schemas, file_default_instances, TableStruct::offsets, factory,
+      file_level_metadata, NULL, NULL);
+}
+
+void protobuf_AssignDescriptorsOnce() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
+}
+
+void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
+void protobuf_RegisterTypes(const ::std::string&) {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
+}
+
+void AddDescriptorsImpl() {
+  InitDefaults();
+  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+      "\n\031snap7_communication.proto\022\031Snap7_commu"
+      "nication_proto\"2\n\035Snap7_communication_pa"
+      "rameter\022\021\n\tip_string\030\001 \002(\t\"\205\001\n!Snap7_com"
+      "munication_parameter_all\022`\n\036snap7_commun"
+      "ication_parameters\030\001 \002(\01328.Snap7_communi"
+      "cation_proto.Snap7_communication_paramet"
+      "er"
+  };
+  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
+      descriptor, 242);
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
+    "snap7_communication.proto", &protobuf_RegisterTypes);
+}
+
+void AddDescriptors() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
+}
+// Force AddDescriptors() to be called at dynamic initialization time.
+struct StaticDescriptorInitializer {
+  StaticDescriptorInitializer() {
+    AddDescriptors();
+  }
+} static_descriptor_initializer;
+}  // namespace protobuf_snap7_5fcommunication_2eproto
+namespace Snap7_communication_proto {
+
+// ===================================================================
+
+void Snap7_communication_parameter::InitAsDefaultInstance() {
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Snap7_communication_parameter::kIpStringFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+Snap7_communication_parameter::Snap7_communication_parameter()
+  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+    ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter();
+  }
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:Snap7_communication_proto.Snap7_communication_parameter)
+}
+Snap7_communication_parameter::Snap7_communication_parameter(const Snap7_communication_parameter& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(NULL),
+      _has_bits_(from._has_bits_),
+      _cached_size_(0) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ip_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.has_ip_string()) {
+    ip_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_string_);
+  }
+  // @@protoc_insertion_point(copy_constructor:Snap7_communication_proto.Snap7_communication_parameter)
+}
+
+void Snap7_communication_parameter::SharedCtor() {
+  _cached_size_ = 0;
+  ip_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+
+Snap7_communication_parameter::~Snap7_communication_parameter() {
+  // @@protoc_insertion_point(destructor:Snap7_communication_proto.Snap7_communication_parameter)
+  SharedDtor();
+}
+
+void Snap7_communication_parameter::SharedDtor() {
+  ip_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+
+void Snap7_communication_parameter::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Snap7_communication_parameter::descriptor() {
+  ::protobuf_snap7_5fcommunication_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_snap7_5fcommunication_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const Snap7_communication_parameter& Snap7_communication_parameter::default_instance() {
+  ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter();
+  return *internal_default_instance();
+}
+
+Snap7_communication_parameter* Snap7_communication_parameter::New(::google::protobuf::Arena* arena) const {
+  Snap7_communication_parameter* n = new Snap7_communication_parameter;
+  if (arena != NULL) {
+    arena->Own(n);
+  }
+  return n;
+}
+
+void Snap7_communication_parameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:Snap7_communication_proto.Snap7_communication_parameter)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    GOOGLE_DCHECK(!ip_string_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
+    (*ip_string_.UnsafeRawStringPointer())->clear();
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear();
+}
+
+bool Snap7_communication_parameter::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:Snap7_communication_proto.Snap7_communication_parameter)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string ip_string = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_ip_string()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+            this->ip_string().data(), static_cast<int>(this->ip_string().length()),
+            ::google::protobuf::internal::WireFormat::PARSE,
+            "Snap7_communication_proto.Snap7_communication_parameter.ip_string");
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      default: {
+      handle_unusual:
+        if (tag == 0) {
+          goto success;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, _internal_metadata_.mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:Snap7_communication_proto.Snap7_communication_parameter)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:Snap7_communication_proto.Snap7_communication_parameter)
+  return false;
+#undef DO_
+}
+
+void Snap7_communication_parameter::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:Snap7_communication_proto.Snap7_communication_parameter)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required string ip_string = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->ip_string().data(), static_cast<int>(this->ip_string().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "Snap7_communication_proto.Snap7_communication_parameter.ip_string");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      1, this->ip_string(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:Snap7_communication_proto.Snap7_communication_parameter)
+}
+
+::google::protobuf::uint8* Snap7_communication_parameter::InternalSerializeWithCachedSizesToArray(
+    bool deterministic, ::google::protobuf::uint8* target) const {
+  (void)deterministic; // Unused
+  // @@protoc_insertion_point(serialize_to_array_start:Snap7_communication_proto.Snap7_communication_parameter)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required string ip_string = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->ip_string().data(), static_cast<int>(this->ip_string().length()),
+      ::google::protobuf::internal::WireFormat::SERIALIZE,
+      "Snap7_communication_proto.Snap7_communication_parameter.ip_string");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        1, this->ip_string(), target);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:Snap7_communication_proto.Snap7_communication_parameter)
+  return target;
+}
+
+size_t Snap7_communication_parameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:Snap7_communication_proto.Snap7_communication_parameter)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  // required string ip_string = 1;
+  if (has_ip_string()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->ip_string());
+  }
+  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = cached_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Snap7_communication_parameter::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:Snap7_communication_proto.Snap7_communication_parameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Snap7_communication_parameter* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const Snap7_communication_parameter>(
+          &from);
+  if (source == NULL) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:Snap7_communication_proto.Snap7_communication_parameter)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:Snap7_communication_proto.Snap7_communication_parameter)
+    MergeFrom(*source);
+  }
+}
+
+void Snap7_communication_parameter::MergeFrom(const Snap7_communication_parameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:Snap7_communication_proto.Snap7_communication_parameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from.has_ip_string()) {
+    set_has_ip_string();
+    ip_string_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_string_);
+  }
+}
+
+void Snap7_communication_parameter::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:Snap7_communication_proto.Snap7_communication_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Snap7_communication_parameter::CopyFrom(const Snap7_communication_parameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:Snap7_communication_proto.Snap7_communication_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Snap7_communication_parameter::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  return true;
+}
+
+void Snap7_communication_parameter::Swap(Snap7_communication_parameter* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void Snap7_communication_parameter::InternalSwap(Snap7_communication_parameter* other) {
+  using std::swap;
+  ip_string_.Swap(&other->ip_string_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata Snap7_communication_parameter::GetMetadata() const {
+  protobuf_snap7_5fcommunication_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_snap7_5fcommunication_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// ===================================================================
+
+void Snap7_communication_parameter_all::InitAsDefaultInstance() {
+  ::Snap7_communication_proto::_Snap7_communication_parameter_all_default_instance_._instance.get_mutable()->snap7_communication_parameters_ = const_cast< ::Snap7_communication_proto::Snap7_communication_parameter*>(
+      ::Snap7_communication_proto::Snap7_communication_parameter::internal_default_instance());
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Snap7_communication_parameter_all::kSnap7CommunicationParametersFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+Snap7_communication_parameter_all::Snap7_communication_parameter_all()
+  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+    ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter_all();
+  }
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:Snap7_communication_proto.Snap7_communication_parameter_all)
+}
+Snap7_communication_parameter_all::Snap7_communication_parameter_all(const Snap7_communication_parameter_all& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(NULL),
+      _has_bits_(from._has_bits_),
+      _cached_size_(0) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  if (from.has_snap7_communication_parameters()) {
+    snap7_communication_parameters_ = new ::Snap7_communication_proto::Snap7_communication_parameter(*from.snap7_communication_parameters_);
+  } else {
+    snap7_communication_parameters_ = NULL;
+  }
+  // @@protoc_insertion_point(copy_constructor:Snap7_communication_proto.Snap7_communication_parameter_all)
+}
+
+void Snap7_communication_parameter_all::SharedCtor() {
+  _cached_size_ = 0;
+  snap7_communication_parameters_ = NULL;
+}
+
+Snap7_communication_parameter_all::~Snap7_communication_parameter_all() {
+  // @@protoc_insertion_point(destructor:Snap7_communication_proto.Snap7_communication_parameter_all)
+  SharedDtor();
+}
+
+void Snap7_communication_parameter_all::SharedDtor() {
+  if (this != internal_default_instance()) delete snap7_communication_parameters_;
+}
+
+void Snap7_communication_parameter_all::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Snap7_communication_parameter_all::descriptor() {
+  ::protobuf_snap7_5fcommunication_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_snap7_5fcommunication_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const Snap7_communication_parameter_all& Snap7_communication_parameter_all::default_instance() {
+  ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter_all();
+  return *internal_default_instance();
+}
+
+Snap7_communication_parameter_all* Snap7_communication_parameter_all::New(::google::protobuf::Arena* arena) const {
+  Snap7_communication_parameter_all* n = new Snap7_communication_parameter_all;
+  if (arena != NULL) {
+    arena->Own(n);
+  }
+  return n;
+}
+
+void Snap7_communication_parameter_all::Clear() {
+// @@protoc_insertion_point(message_clear_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    GOOGLE_DCHECK(snap7_communication_parameters_ != NULL);
+    snap7_communication_parameters_->Clear();
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear();
+}
+
+bool Snap7_communication_parameter_all::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_snap7_communication_parameters()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      default: {
+      handle_unusual:
+        if (tag == 0) {
+          goto success;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, _internal_metadata_.mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:Snap7_communication_proto.Snap7_communication_parameter_all)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:Snap7_communication_proto.Snap7_communication_parameter_all)
+  return false;
+#undef DO_
+}
+
+void Snap7_communication_parameter_all::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      1, *this->snap7_communication_parameters_, output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:Snap7_communication_proto.Snap7_communication_parameter_all)
+}
+
+::google::protobuf::uint8* Snap7_communication_parameter_all::InternalSerializeWithCachedSizesToArray(
+    bool deterministic, ::google::protobuf::uint8* target) const {
+  (void)deterministic; // Unused
+  // @@protoc_insertion_point(serialize_to_array_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        1, *this->snap7_communication_parameters_, deterministic, target);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:Snap7_communication_proto.Snap7_communication_parameter_all)
+  return target;
+}
+
+size_t Snap7_communication_parameter_all::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  // required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+  if (has_snap7_communication_parameters()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *this->snap7_communication_parameters_);
+  }
+  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = cached_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Snap7_communication_parameter_all::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Snap7_communication_parameter_all* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const Snap7_communication_parameter_all>(
+          &from);
+  if (source == NULL) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:Snap7_communication_proto.Snap7_communication_parameter_all)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:Snap7_communication_proto.Snap7_communication_parameter_all)
+    MergeFrom(*source);
+  }
+}
+
+void Snap7_communication_parameter_all::MergeFrom(const Snap7_communication_parameter_all& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from.has_snap7_communication_parameters()) {
+    mutable_snap7_communication_parameters()->::Snap7_communication_proto::Snap7_communication_parameter::MergeFrom(from.snap7_communication_parameters());
+  }
+}
+
+void Snap7_communication_parameter_all::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Snap7_communication_parameter_all::CopyFrom(const Snap7_communication_parameter_all& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:Snap7_communication_proto.Snap7_communication_parameter_all)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Snap7_communication_parameter_all::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  if (has_snap7_communication_parameters()) {
+    if (!this->snap7_communication_parameters_->IsInitialized()) return false;
+  }
+  return true;
+}
+
+void Snap7_communication_parameter_all::Swap(Snap7_communication_parameter_all* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void Snap7_communication_parameter_all::InternalSwap(Snap7_communication_parameter_all* other) {
+  using std::swap;
+  swap(snap7_communication_parameters_, other->snap7_communication_parameters_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata Snap7_communication_parameter_all::GetMetadata() const {
+  protobuf_snap7_5fcommunication_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_snap7_5fcommunication_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+}  // namespace Snap7_communication_proto
+
+// @@protoc_insertion_point(global_scope)

+ 438 - 0
snap7_communication/snap7_communication.pb.h

@@ -0,0 +1,438 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: snap7_communication.proto
+
+#ifndef PROTOBUF_snap7_5fcommunication_2eproto__INCLUDED
+#define PROTOBUF_snap7_5fcommunication_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 3005000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_table_driven.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/metadata.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
+#include <google/protobuf/extension_set.h>  // IWYU pragma: export
+#include <google/protobuf/unknown_field_set.h>
+// @@protoc_insertion_point(includes)
+
+namespace protobuf_snap7_5fcommunication_2eproto {
+// Internal implementation detail -- do not use these members.
+struct TableStruct {
+  static const ::google::protobuf::internal::ParseTableField entries[];
+  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
+  static const ::google::protobuf::internal::ParseTable schema[2];
+  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
+  static const ::google::protobuf::internal::SerializationTable serialization_table[];
+  static const ::google::protobuf::uint32 offsets[];
+};
+void AddDescriptors();
+void InitDefaultsSnap7_communication_parameterImpl();
+void InitDefaultsSnap7_communication_parameter();
+void InitDefaultsSnap7_communication_parameter_allImpl();
+void InitDefaultsSnap7_communication_parameter_all();
+inline void InitDefaults() {
+  InitDefaultsSnap7_communication_parameter();
+  InitDefaultsSnap7_communication_parameter_all();
+}
+}  // namespace protobuf_snap7_5fcommunication_2eproto
+namespace Snap7_communication_proto {
+class Snap7_communication_parameter;
+class Snap7_communication_parameterDefaultTypeInternal;
+extern Snap7_communication_parameterDefaultTypeInternal _Snap7_communication_parameter_default_instance_;
+class Snap7_communication_parameter_all;
+class Snap7_communication_parameter_allDefaultTypeInternal;
+extern Snap7_communication_parameter_allDefaultTypeInternal _Snap7_communication_parameter_all_default_instance_;
+}  // namespace Snap7_communication_proto
+namespace Snap7_communication_proto {
+
+// ===================================================================
+
+class Snap7_communication_parameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Snap7_communication_proto.Snap7_communication_parameter) */ {
+ public:
+  Snap7_communication_parameter();
+  virtual ~Snap7_communication_parameter();
+
+  Snap7_communication_parameter(const Snap7_communication_parameter& from);
+
+  inline Snap7_communication_parameter& operator=(const Snap7_communication_parameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  Snap7_communication_parameter(Snap7_communication_parameter&& from) noexcept
+    : Snap7_communication_parameter() {
+    *this = ::std::move(from);
+  }
+
+  inline Snap7_communication_parameter& operator=(Snap7_communication_parameter&& from) noexcept {
+    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+  #endif
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields();
+  }
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields();
+  }
+
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const Snap7_communication_parameter& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Snap7_communication_parameter* internal_default_instance() {
+    return reinterpret_cast<const Snap7_communication_parameter*>(
+               &_Snap7_communication_parameter_default_instance_);
+  }
+  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+    0;
+
+  void Swap(Snap7_communication_parameter* other);
+  friend void swap(Snap7_communication_parameter& a, Snap7_communication_parameter& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Snap7_communication_parameter* New() const PROTOBUF_FINAL { return New(NULL); }
+
+  Snap7_communication_parameter* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void CopyFrom(const Snap7_communication_parameter& from);
+  void MergeFrom(const Snap7_communication_parameter& from);
+  void Clear() PROTOBUF_FINAL;
+  bool IsInitialized() const PROTOBUF_FINAL;
+
+  size_t ByteSizeLong() const PROTOBUF_FINAL;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
+  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
+      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
+  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void InternalSwap(Snap7_communication_parameter* other);
+  private:
+  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+    return NULL;
+  }
+  inline void* MaybeArenaPtr() const {
+    return NULL;
+  }
+  public:
+
+  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required string ip_string = 1;
+  bool has_ip_string() const;
+  void clear_ip_string();
+  static const int kIpStringFieldNumber = 1;
+  const ::std::string& ip_string() const;
+  void set_ip_string(const ::std::string& value);
+  #if LANG_CXX11
+  void set_ip_string(::std::string&& value);
+  #endif
+  void set_ip_string(const char* value);
+  void set_ip_string(const char* value, size_t size);
+  ::std::string* mutable_ip_string();
+  ::std::string* release_ip_string();
+  void set_allocated_ip_string(::std::string* ip_string);
+
+  // @@protoc_insertion_point(class_scope:Snap7_communication_proto.Snap7_communication_parameter)
+ private:
+  void set_has_ip_string();
+  void clear_has_ip_string();
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::HasBits<1> _has_bits_;
+  mutable int _cached_size_;
+  ::google::protobuf::internal::ArenaStringPtr ip_string_;
+  friend struct ::protobuf_snap7_5fcommunication_2eproto::TableStruct;
+  friend void ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameterImpl();
+};
+// -------------------------------------------------------------------
+
+class Snap7_communication_parameter_all : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Snap7_communication_proto.Snap7_communication_parameter_all) */ {
+ public:
+  Snap7_communication_parameter_all();
+  virtual ~Snap7_communication_parameter_all();
+
+  Snap7_communication_parameter_all(const Snap7_communication_parameter_all& from);
+
+  inline Snap7_communication_parameter_all& operator=(const Snap7_communication_parameter_all& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  Snap7_communication_parameter_all(Snap7_communication_parameter_all&& from) noexcept
+    : Snap7_communication_parameter_all() {
+    *this = ::std::move(from);
+  }
+
+  inline Snap7_communication_parameter_all& operator=(Snap7_communication_parameter_all&& from) noexcept {
+    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+  #endif
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields();
+  }
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields();
+  }
+
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const Snap7_communication_parameter_all& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Snap7_communication_parameter_all* internal_default_instance() {
+    return reinterpret_cast<const Snap7_communication_parameter_all*>(
+               &_Snap7_communication_parameter_all_default_instance_);
+  }
+  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+    1;
+
+  void Swap(Snap7_communication_parameter_all* other);
+  friend void swap(Snap7_communication_parameter_all& a, Snap7_communication_parameter_all& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Snap7_communication_parameter_all* New() const PROTOBUF_FINAL { return New(NULL); }
+
+  Snap7_communication_parameter_all* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void CopyFrom(const Snap7_communication_parameter_all& from);
+  void MergeFrom(const Snap7_communication_parameter_all& from);
+  void Clear() PROTOBUF_FINAL;
+  bool IsInitialized() const PROTOBUF_FINAL;
+
+  size_t ByteSizeLong() const PROTOBUF_FINAL;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
+  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
+      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
+  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void InternalSwap(Snap7_communication_parameter_all* other);
+  private:
+  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+    return NULL;
+  }
+  inline void* MaybeArenaPtr() const {
+    return NULL;
+  }
+  public:
+
+  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+  bool has_snap7_communication_parameters() const;
+  void clear_snap7_communication_parameters();
+  static const int kSnap7CommunicationParametersFieldNumber = 1;
+  const ::Snap7_communication_proto::Snap7_communication_parameter& snap7_communication_parameters() const;
+  ::Snap7_communication_proto::Snap7_communication_parameter* release_snap7_communication_parameters();
+  ::Snap7_communication_proto::Snap7_communication_parameter* mutable_snap7_communication_parameters();
+  void set_allocated_snap7_communication_parameters(::Snap7_communication_proto::Snap7_communication_parameter* snap7_communication_parameters);
+
+  // @@protoc_insertion_point(class_scope:Snap7_communication_proto.Snap7_communication_parameter_all)
+ private:
+  void set_has_snap7_communication_parameters();
+  void clear_has_snap7_communication_parameters();
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::HasBits<1> _has_bits_;
+  mutable int _cached_size_;
+  ::Snap7_communication_proto::Snap7_communication_parameter* snap7_communication_parameters_;
+  friend struct ::protobuf_snap7_5fcommunication_2eproto::TableStruct;
+  friend void ::protobuf_snap7_5fcommunication_2eproto::InitDefaultsSnap7_communication_parameter_allImpl();
+};
+// ===================================================================
+
+
+// ===================================================================
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif  // __GNUC__
+// Snap7_communication_parameter
+
+// required string ip_string = 1;
+inline bool Snap7_communication_parameter::has_ip_string() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Snap7_communication_parameter::set_has_ip_string() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Snap7_communication_parameter::clear_has_ip_string() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Snap7_communication_parameter::clear_ip_string() {
+  ip_string_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  clear_has_ip_string();
+}
+inline const ::std::string& Snap7_communication_parameter::ip_string() const {
+  // @@protoc_insertion_point(field_get:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+  return ip_string_.GetNoArena();
+}
+inline void Snap7_communication_parameter::set_ip_string(const ::std::string& value) {
+  set_has_ip_string();
+  ip_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+}
+#if LANG_CXX11
+inline void Snap7_communication_parameter::set_ip_string(::std::string&& value) {
+  set_has_ip_string();
+  ip_string_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+}
+#endif
+inline void Snap7_communication_parameter::set_ip_string(const char* value) {
+  GOOGLE_DCHECK(value != NULL);
+  set_has_ip_string();
+  ip_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+}
+inline void Snap7_communication_parameter::set_ip_string(const char* value, size_t size) {
+  set_has_ip_string();
+  ip_string_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+}
+inline ::std::string* Snap7_communication_parameter::mutable_ip_string() {
+  set_has_ip_string();
+  // @@protoc_insertion_point(field_mutable:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+  return ip_string_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* Snap7_communication_parameter::release_ip_string() {
+  // @@protoc_insertion_point(field_release:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+  clear_has_ip_string();
+  return ip_string_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void Snap7_communication_parameter::set_allocated_ip_string(::std::string* ip_string) {
+  if (ip_string != NULL) {
+    set_has_ip_string();
+  } else {
+    clear_has_ip_string();
+  }
+  ip_string_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ip_string);
+  // @@protoc_insertion_point(field_set_allocated:Snap7_communication_proto.Snap7_communication_parameter.ip_string)
+}
+
+// -------------------------------------------------------------------
+
+// Snap7_communication_parameter_all
+
+// required .Snap7_communication_proto.Snap7_communication_parameter snap7_communication_parameters = 1;
+inline bool Snap7_communication_parameter_all::has_snap7_communication_parameters() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Snap7_communication_parameter_all::set_has_snap7_communication_parameters() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Snap7_communication_parameter_all::clear_has_snap7_communication_parameters() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Snap7_communication_parameter_all::clear_snap7_communication_parameters() {
+  if (snap7_communication_parameters_ != NULL) snap7_communication_parameters_->Clear();
+  clear_has_snap7_communication_parameters();
+}
+inline const ::Snap7_communication_proto::Snap7_communication_parameter& Snap7_communication_parameter_all::snap7_communication_parameters() const {
+  const ::Snap7_communication_proto::Snap7_communication_parameter* p = snap7_communication_parameters_;
+  // @@protoc_insertion_point(field_get:Snap7_communication_proto.Snap7_communication_parameter_all.snap7_communication_parameters)
+  return p != NULL ? *p : *reinterpret_cast<const ::Snap7_communication_proto::Snap7_communication_parameter*>(
+      &::Snap7_communication_proto::_Snap7_communication_parameter_default_instance_);
+}
+inline ::Snap7_communication_proto::Snap7_communication_parameter* Snap7_communication_parameter_all::release_snap7_communication_parameters() {
+  // @@protoc_insertion_point(field_release:Snap7_communication_proto.Snap7_communication_parameter_all.snap7_communication_parameters)
+  clear_has_snap7_communication_parameters();
+  ::Snap7_communication_proto::Snap7_communication_parameter* temp = snap7_communication_parameters_;
+  snap7_communication_parameters_ = NULL;
+  return temp;
+}
+inline ::Snap7_communication_proto::Snap7_communication_parameter* Snap7_communication_parameter_all::mutable_snap7_communication_parameters() {
+  set_has_snap7_communication_parameters();
+  if (snap7_communication_parameters_ == NULL) {
+    snap7_communication_parameters_ = new ::Snap7_communication_proto::Snap7_communication_parameter;
+  }
+  // @@protoc_insertion_point(field_mutable:Snap7_communication_proto.Snap7_communication_parameter_all.snap7_communication_parameters)
+  return snap7_communication_parameters_;
+}
+inline void Snap7_communication_parameter_all::set_allocated_snap7_communication_parameters(::Snap7_communication_proto::Snap7_communication_parameter* snap7_communication_parameters) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == NULL) {
+    delete snap7_communication_parameters_;
+  }
+  if (snap7_communication_parameters) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      snap7_communication_parameters = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, snap7_communication_parameters, submessage_arena);
+    }
+    set_has_snap7_communication_parameters();
+  } else {
+    clear_has_snap7_communication_parameters();
+  }
+  snap7_communication_parameters_ = snap7_communication_parameters;
+  // @@protoc_insertion_point(field_set_allocated:Snap7_communication_proto.Snap7_communication_parameter_all.snap7_communication_parameters)
+}
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic pop
+#endif  // __GNUC__
+// -------------------------------------------------------------------
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace Snap7_communication_proto
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_snap7_5fcommunication_2eproto__INCLUDED

+ 12 - 0
snap7_communication/snap7_communication.proto

@@ -0,0 +1,12 @@
+syntax = "proto2";
+package Snap7_communication_proto;
+
+message Snap7_communication_parameter
+{
+    required string ip_string = 1 [default="192.168.0.1"];
+}
+
+message Snap7_communication_parameter_all
+{
+    required Snap7_communication_parameter        snap7_communication_parameters=1;
+}

+ 327 - 0
snap7_communication/snap7_communication_base.cpp

@@ -0,0 +1,327 @@
+//
+// Created by huli on 2020/9/25.
+//
+
+#include "snap7_communication_base.h"
+#include "../tool/proto_tool.h"
+
+Snap7_communication_base::Snap7_communication_base()
+{
+	m_communication_status = E_UNKNOWN;
+	m_communication_delay_time_ms = SNAP7_COMMUNICATION_DELAY_TIME_MS;
+	mp_communication_thread = NULL;
+}
+
+Snap7_communication_base::~Snap7_communication_base()
+{
+	communication_uninit();
+}
+
+//初始化 通信 模块。如下三选一
+Error_manager Snap7_communication_base::communication_init()
+{
+	return  communication_init_from_protobuf(SNAP7_COMMUNICATION_PARAMETER_PATH);
+}
+//初始化 通信 模块。从文件读取
+Error_manager Snap7_communication_base::communication_init_from_protobuf(std::string prototxt_path)
+{
+	Snap7_communication_proto::Snap7_communication_parameter_all t_snap7_communication_parameter_all;
+	if(!  proto_tool::read_proto_param(prototxt_path,t_snap7_communication_parameter_all) )
+	{
+		return Error_manager(SNAP7_READ_PROTOBUF_ERROR,MINOR_ERROR,
+							 "Snap7_communication_base::communication_init_from_protobuf read_proto_param  failed");
+	}
+	return communication_init_from_protobuf(t_snap7_communication_parameter_all);
+}
+//初始化 通信 模块。从protobuf读取
+Error_manager Snap7_communication_base::communication_init_from_protobuf(Snap7_communication_proto::Snap7_communication_parameter_all& snap7_communication_parameter_all)
+{
+	LOG(INFO) << " ---Communication_socket_base::communication_init() --- "<< this;
+	Error_manager t_error;
+
+	if ( snap7_communication_parameter_all.snap7_communication_parameters().has_ip_string() )
+	{
+		m_ip_string = snap7_communication_parameter_all.snap7_communication_parameters().ip_string();
+		t_error = communication_connect(m_ip_string);
+		if ( t_error != Error_code::SUCCESS )
+		{
+			//连接失败, 不要直接返回, 而是改为断连, 后面继续启动线程, (线程内部有重连功能)
+			m_communication_status = E_DISCONNECT;
+		}
+		else
+		{
+			m_communication_status = E_READY;
+		}
+	}
+
+	//启动通信, run thread
+	communication_run();
+	return Error_code::SUCCESS;
+}
+
+
+//反初始化 通信 模块。
+Error_manager Snap7_communication_base::communication_uninit()
+{
+	//关闭线程并回收资源
+	if (mp_communication_thread)
+	{
+		m_communication_condition.kill_all();
+	}
+	if (mp_communication_thread)
+	{
+		mp_communication_thread->join();
+		delete mp_communication_thread;
+		mp_communication_thread = NULL;
+	}
+
+	//清空map
+	{
+		std::unique_lock<std::mutex> t_lock(m_receive_buf_lock);
+		m_receive_buf_map.clear();
+	}
+	{
+		std::unique_lock<std::mutex> t_lock(m_send_buf_lock);
+		m_send_buf_map.clear();
+	}
+
+	communication_disconnect();
+	m_communication_status = E_UNKNOWN;
+
+	return Error_code::SUCCESS;
+}
+
+Snap7_communication_base::Communication_statu Snap7_communication_base::get_status()
+{
+	return m_communication_status;
+}
+
+//通信连接
+Error_manager Snap7_communication_base::communication_connect(std::string ip_string)
+{
+	std::unique_lock<std::mutex> t_lock(m_communication_lock);
+	int result=m_snap7_client.ConnectTo(ip_string.c_str(),0,1);
+	std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+	if (result==0)
+	{
+		return Error_code::SUCCESS;
+	}
+	else
+	{
+		return Error_manager(Error_code::SNAP7_CONNECT_ERROR, Error_level::MINOR_ERROR,
+							 " Snap7_communication_base::communication_connect error ");
+	}
+	return Error_code::SUCCESS;
+}
+//启动通信, run thread
+Error_manager Snap7_communication_base::communication_run()
+{
+	//启动4个线程。
+	//接受线程默认循环, 内部的nn_recv进行等待, 超时1ms
+	m_communication_condition.reset(false, false, false);
+	mp_communication_thread = new std::thread(&Snap7_communication_base::communication_thread, this);
+
+	return Error_code::SUCCESS;
+}
+//通信断连
+Error_manager Snap7_communication_base::communication_disconnect()
+{
+	std::unique_lock<std::mutex> t_lock(m_communication_lock);
+	int result=m_snap7_client.Disconnect();
+	std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+	if (result==0)
+	{
+		return Error_code::SUCCESS;
+	}
+	else
+	{
+		return Error_manager(Error_code::SNAP7_DISCONNECT_ERROR, Error_level::MINOR_ERROR,
+							 " Snap7_communication_base::communication_disconnect error ");
+	}
+	return Error_code::SUCCESS;
+}
+//mp_communication_thread线程的执行函数, 负责进行s7的通信
+void Snap7_communication_base::communication_thread()
+{
+	LOG(INFO) << " ---Snap7_communication_base::communication_thread()--- "<< this;
+Error_manager t_error;
+	while (m_communication_condition.is_alive())
+	{
+		m_communication_condition.wait_for_ex(std::chrono::microseconds(1));
+
+		//s7的通信时间较长, 所以将发送和接受分开
+		//发送多个时, 必须加锁后一起发送, 不允许分段写入, 防止数据错误
+		if ( m_communication_condition.is_alive() )
+		{
+			std::this_thread::yield();
+			switch ( m_communication_status )
+			{
+			    case E_READY:
+				case E_RECEIVE:
+			    {
+					{
+						std::unique_lock<std::mutex> t_lock(m_receive_buf_lock);
+						for (auto iter = m_receive_buf_map.begin(); iter != m_receive_buf_map.end(); ++iter)
+						{
+							//接受数据, 读取DB块,
+							t_error = read_data_buf(iter->second);
+							if (t_error == Error_code::SNAP7_READ_ERROR)
+							{
+								m_communication_status = E_DISCONNECT;
+								std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
+								break;
+							}
+						}
+					}
+					//注:数据更新放在锁的外面, 防止重复加锁....
+					updata_receive_buf();
+					m_communication_status = E_SEND;
+			        break;
+			    }
+			    case E_SEND:
+			    {
+					//注:数据更新放在锁的外面, 防止重复加锁....
+					updata_send_buf();
+					{
+						std::unique_lock<std::mutex> t_lock(m_send_buf_lock);
+						for (auto iter = m_send_buf_map.begin(); iter != m_send_buf_map.end(); ++iter)
+						{
+							//发送数据, 写入DB块,
+							t_error = write_data_buf(iter->second);
+							if (t_error == Error_code::SNAP7_WRITE_ERROR)
+							{
+								m_communication_status = E_DISCONNECT;
+								std::cout << " huli test :::: " << " t_error = " << t_error << std::endl;
+								break;
+							}
+						}
+					}
+					m_communication_status = E_RECEIVE;
+			        break;
+			    }
+				case E_DISCONNECT:
+				{
+					//重连
+					LOG(WARNING) << "find plc connection error, trying to reconnect.";
+					communication_disconnect();
+					std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+					t_error = communication_connect(m_ip_string);
+					if ( t_error != Error_code::SUCCESS )
+					{
+						//连接失败, 不要直接返回, 而是改为断连, 后面继续启动线程, (线程内部有重连功能)
+						m_communication_status = E_DISCONNECT;
+					}
+					else
+					{
+						m_communication_status = E_READY;
+					}
+					std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+
+					break;
+				}
+			    default:
+			    {
+
+			        break;
+			    }
+			}
+		}
+	}
+
+	LOG(INFO) << " Communication_socket_base::send_data_thread end "<< this;
+	return;
+}
+
+//接受数据, 读取DB块,
+Error_manager Snap7_communication_base::read_data_buf(Snap7_buf& snap7_buf)
+{
+	Error_manager t_error;
+	if ( snap7_buf.m_communication_mode != Snap7_buf::NO_COMMUNICATION)
+	{
+		std::unique_lock<std::mutex> lck(m_communication_lock);
+		int result = m_snap7_client.AsDBRead(snap7_buf.m_id, snap7_buf.m_start_index, snap7_buf.m_size, snap7_buf.mp_buf_reverse);
+		if ( snap7_buf.m_communication_mode == Snap7_buf::ONCE_COMMUNICATION )
+		{
+			snap7_buf.m_communication_mode = Snap7_buf::NO_COMMUNICATION;
+		}
+		if (result==0)
+		{
+			t_error = reverse_byte(snap7_buf.mp_buf_reverse, snap7_buf.mp_buf_obverse, snap7_buf.m_size);
+			if ( t_error != Error_code::SUCCESS )
+			{
+				return t_error;
+			}
+			std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			return Error_manager(Error_code::SNAP7_READ_ERROR, Error_level::MINOR_ERROR,
+								 " Snap7_communication_base::read_data_buf error ");
+		}
+	}
+
+	return Error_code::SUCCESS;
+}
+//发送数据, 写入DB块,
+Error_manager Snap7_communication_base::write_data_buf(Snap7_buf& snap7_buf)
+{
+	Error_manager t_error;
+	if ( snap7_buf.m_communication_mode != Snap7_buf::NO_COMMUNICATION)
+	{
+		t_error = reverse_byte(snap7_buf.mp_buf_obverse, snap7_buf.mp_buf_reverse, snap7_buf.m_size);
+		if (t_error != Error_code::SUCCESS)
+		{
+			return t_error;
+		}
+
+		std::unique_lock<std::mutex> lck(m_communication_lock);
+		int result = m_snap7_client.AsDBWrite(snap7_buf.m_id, snap7_buf.m_start_index, snap7_buf.m_size,
+											  snap7_buf.mp_buf_reverse);
+		if ( snap7_buf.m_communication_mode != Snap7_buf::ONCE_COMMUNICATION )
+		{
+			snap7_buf.m_communication_mode = Snap7_buf::NO_COMMUNICATION;
+		}
+		if (result == 0)
+		{
+			std::this_thread::sleep_for(std::chrono::milliseconds(m_communication_delay_time_ms));
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			return Error_manager(Error_code::SNAP7_WRITE_ERROR, Error_level::MINOR_ERROR,
+								 " Snap7_communication_base::write_data_buf error ");
+		}
+	}
+	return Error_code::SUCCESS;
+}
+
+//数据颠倒
+Error_manager Snap7_communication_base::reverse_byte(void* p_buf_in, void* p_buf_out, int size)
+{
+	if ( p_buf_in == NULL || p_buf_out == NULL )
+	{
+	    return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
+	    					"  POINTER IS NULL ");
+	}
+	char* tp_in=(char*)p_buf_in;
+	char* tp_out=(char*)p_buf_out;
+	for(int i=0;i<size;++i)
+	{
+		tp_out[i]=tp_in[size-i-1];
+	}
+	return Error_code::SUCCESS;
+}
+
+//更新数据
+Error_manager Snap7_communication_base::updata_receive_buf()
+{
+	return Error_code::SUCCESS;
+}
+Error_manager Snap7_communication_base::updata_send_buf()
+{
+	return Error_code::SUCCESS;
+}
+
+
+

+ 102 - 0
snap7_communication/snap7_communication_base.h

@@ -0,0 +1,102 @@
+//
+// Created by huli on 2020/9/25.
+//
+
+#ifndef NNXX_TESTS_SNAP7_E_BASE_H
+#define NNXX_TESTS_SNAP7_E_BASE_H
+
+#include <s7_client.h>
+#include <mutex>
+#include <map>
+#include <glog/logging.h>
+
+#include "../error_code/error_code.h"
+#include "../tool/thread_condition.h"
+#include "../snap7_communication/snap7_buf.h"
+#include "../snap7_communication/s7_plc.h"
+#include "../snap7_communication/snap7_communication.pb.h"
+
+class Snap7_communication_base
+{
+public:
+	//snap7的通信延时, 默认50ms
+#define SNAP7_COMMUNICATION_DELAY_TIME_MS 	50
+//snap7的通信参数路径
+#define SNAP7_COMMUNICATION_PARAMETER_PATH	"../setting/snap7_communication.prototxt"
+	//通信状态
+	enum Communication_statu
+	{
+		E_UNKNOWN		=0,	        //通信状态 未知
+		E_READY			=1,			//通信状态 正常
+
+		E_RECEIVE		=2, 		//接受
+		E_SEND			=3, 		//发送
+		E_DISCONNECT	=4, 		//断连
+
+		E_FAULT			=10,         //通信状态 错误
+	};
+public:
+	Snap7_communication_base();
+	Snap7_communication_base(const Snap7_communication_base& other)= default;
+	Snap7_communication_base& operator =(const Snap7_communication_base& other)= default;
+	~Snap7_communication_base();
+public://API functions
+	//初始化 通信 模块。如下三选一
+	virtual Error_manager communication_init();
+	//初始化 通信 模块。从文件读取
+	virtual Error_manager communication_init_from_protobuf(std::string prototxt_path);
+	//初始化 通信 模块。从protobuf读取
+	virtual Error_manager communication_init_from_protobuf(Snap7_communication_proto::Snap7_communication_parameter_all& snap7_communication_parameter_all);
+	//反初始化 通信 模块。
+	virtual Error_manager communication_uninit();
+public://get or set member variable
+	Communication_statu get_status();
+protected://member functions
+	//通信连接
+	Error_manager communication_connect(std::string ip_string);
+	//启动通信, run thread
+	Error_manager communication_run();
+	//通信断连
+	Error_manager communication_disconnect();
+	//mp_communication_thread线程的执行函数, 负责进行s7的通信
+	void communication_thread();
+
+	//接受数据, 读取DB块,
+	Error_manager read_data_buf(Snap7_buf& snap7_buf);
+	//发送数据, 写入DB块,
+	Error_manager write_data_buf(Snap7_buf& snap7_buf);
+	//数据颠倒
+	Error_manager reverse_byte(void* p_buf_in, void* p_buf_out, int size);
+
+	//更新数据
+	virtual Error_manager updata_receive_buf();
+	virtual Error_manager updata_send_buf();
+protected://member variable
+
+	//状态
+	Communication_statu				m_communication_status;	//通信状态
+	std::string						m_ip_string;			//通信ip
+
+	//通信模块
+	std::mutex  					m_communication_lock;	//通信锁
+	TSnap7Client 					m_snap7_client;			//通信的客户端
+	int 							m_communication_delay_time_ms;//通信延时, 单位ms
+	//注:s7协议通信很不稳定, 在每次使用 TSnap7Client 之后, 都需要加延时
+
+	//数据
+	std::mutex  					m_receive_buf_lock;		//接受的锁
+	std::map<int, Snap7_buf>		m_receive_buf_map; 		//接受的map容器
+	std::mutex  					m_send_buf_lock;		//发送的锁
+	std::map<int, Snap7_buf>		m_send_buf_map; 		//发送的map容器
+
+	//线程, snap7的通信核心就是对 发送和接受内存的 周期性读写, 所以使用一个线程即可.
+	std::thread*					mp_communication_thread;    		//通信的线程指针
+	Thread_condition				m_communication_condition;			//通信的条件变量
+
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_SNAP7_E_BASE_H

+ 41 - 0
tool/common_data.cpp

@@ -0,0 +1,41 @@
+//
+// Created by huli on 2020/9/8.
+//
+float center_x;				//整车的中心点x值, 四轮的中心
+float center_y;				//整车的中心点y值, 四轮的中心
+float car_angle;			//整车的车身旋转角,
+float car_length;			//整车的长度, 用于规避碰撞
+float car_width;			//整车的宽度, 用于规避碰撞
+float car_height;			//整车的高度, 用于规避碰撞
+float wheel_base;			//整车的轮距, 前后轮的距离, 用于机器人或agv的抓车
+float wheel_width;			//整车的轮距, 左右轮的距离, 用于机器人或agv的抓车
+float front_theta;			//整车的前轮的旋转角
+
+bool correctness;			//整车的校准标记位
+
+#include "common_data.h"
+
+void Common_data::copy_data(Car_measure_information& car_measure_information_in, Car_wheel_information& car_wheel_information_out)
+{
+	car_wheel_information_out.center_x = car_measure_information_in.center_x;
+	car_wheel_information_out.center_y = car_measure_information_in.center_y;
+	car_wheel_information_out.car_angle = car_measure_information_in.car_angle;
+
+	car_wheel_information_out.wheel_base = car_measure_information_in.wheel_base;
+	car_wheel_information_out.wheel_width = car_measure_information_in.wheel_width;
+	car_wheel_information_out.front_theta = car_measure_information_in.front_theta;
+	car_wheel_information_out.correctness = car_measure_information_in.correctness;
+}
+void Common_data::copy_data(Car_wheel_information& car_wheel_information_in, Car_measure_information& car_measure_information_out)
+{
+	car_measure_information_out.center_x = car_wheel_information_in.center_x;
+	car_measure_information_out.center_y = car_wheel_information_in.center_y;
+	car_measure_information_out.car_angle = car_wheel_information_in.car_angle;
+	car_measure_information_out.car_length = 0;
+	car_measure_information_out.car_width = 0;
+	car_measure_information_out.car_height = 0;
+	car_measure_information_out.wheel_base = car_wheel_information_in.wheel_base;
+	car_measure_information_out.wheel_width = car_wheel_information_in.wheel_width;
+	car_measure_information_out.front_theta = car_wheel_information_in.front_theta;
+	car_measure_information_out.correctness = car_wheel_information_in.correctness;
+}

+ 57 - 0
tool/common_data.h

@@ -0,0 +1,57 @@
+//
+// Created by huli on 2020/9/8.
+//
+
+#ifndef NNXX_TESTS_COMMON_DATA_H
+#define NNXX_TESTS_COMMON_DATA_H
+
+
+class Common_data
+{
+public:
+	//万集雷达扫描周期66ms, (频率15hz), 一般设置大一些
+#define WANJI_716_SCAN_CYCLE_MS 		70
+
+
+	//整车的测量信息
+	struct Car_measure_information
+	{
+		float center_x = 0;				//整车的中心点x值, 四轮的中心
+		float center_y = 0;				//整车的中心点y值, 四轮的中心
+		float car_angle = 0;			//整车的车身旋转角,
+		float car_length = 0;			//整车的长度, 用于规避碰撞
+		float car_width = 0;			//整车的宽度, 用于规避碰撞
+		float car_height = 0;			//整车的高度, 用于规避碰撞
+		float wheel_base = 0;			//整车的轮距, 前后轮的距离, 用于机器人或agv的抓车
+		float wheel_width = 0;			//整车的轮距, 左右轮的距离, 用于机器人或agv的抓车
+		float front_theta = 0;			//整车的前轮的旋转角
+
+		bool correctness = false;			//整车的校准标记位
+
+	};
+
+	//四轮的测量信息
+	struct Car_wheel_information
+	{
+		float center_x = 0;				//整车的中心点x值, 四轮的中心
+		float center_y = 0;				//整车的中心点y值, 四轮的中心
+		float car_angle = 0;			//整车的车身旋转角,
+
+		float wheel_base = 0;			//整车的轮距, 前后轮的距离, 用于机器人或agv的抓车
+		float wheel_width = 0;			//整车的轮距, 左右轮的距离, 用于机器人或agv的抓车
+		float front_theta = 0;			//整车的前轮的旋转角
+
+		bool correctness = false;			//整车的校准标记位
+
+	};
+
+
+	static void copy_data(Car_measure_information& car_measure_information_in, Car_wheel_information& car_wheel_information_out);
+	static void copy_data(Car_wheel_information& car_wheel_information_in, Car_measure_information& car_measure_information_out);
+
+
+
+};
+
+
+#endif //NNXX_TESTS_COMMON_DATA_H

+ 139 - 0
tool/point2D_tool.cpp

@@ -0,0 +1,139 @@
+//
+// Created by huli on 2020/9/1.
+//
+
+#include "point2D_tool.h"
+
+//极坐标 -> 平面坐标
+bool Point2D_tool::Polar_coordinates_to_point2D(Point2D_tool::Polar_coordinates* p_polar_coordinates, Point2D_tool::Point2D* p_point2D)
+{
+	if ( p_polar_coordinates == NULL || p_point2D == NULL)
+	{
+		return false;
+	}
+	else
+	{
+		p_point2D->x = p_polar_coordinates->distance * cos(p_polar_coordinates->angle);
+		p_point2D->y = p_polar_coordinates->distance * sin(p_polar_coordinates->angle);
+		return true;
+	}
+	return true;
+}
+//平面坐标 -> 极坐标
+bool Point2D_tool::Point2D_to_polar_coordinates(Point2D_tool::Point2D* p_point2D, Point2D_tool::Polar_coordinates* p_polar_coordinates)
+{
+	if ( p_polar_coordinates == NULL || p_point2D == NULL)
+	{
+		return false;
+	}
+	else
+	{
+		p_polar_coordinates->distance = sqrt(p_point2D->x * p_point2D->x + p_point2D->y * p_point2D->y);
+		p_polar_coordinates->angle = atan(p_point2D->y / p_point2D->x);
+		return true;
+	}
+	return true;
+}
+
+//判断极坐标点是否在限制范围
+bool Point2D_tool::limit_with_polar_coordinates_box(float distance, float angle, Point2D_tool::Polar_coordinates_box* p_polar_coordinates_box)
+{
+	if ( p_polar_coordinates_box == NULL )
+	{
+		return false;
+	}
+	else
+	{
+		if ( angle >= p_polar_coordinates_box->angle_min &&
+			 angle <= p_polar_coordinates_box->angle_max &&
+			 distance >= p_polar_coordinates_box->distance_min &&
+			 distance <= p_polar_coordinates_box->distance_max )
+		{
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	return true;
+}
+
+//判断平面坐标点是否在限制范围
+bool Point2D_tool::limit_with_point2D_box(float x, float y, Point2D_tool::Point2D_box* p_point2D_box)
+{
+	if ( p_point2D_box == NULL )
+	{
+		return false;
+	}
+	else
+	{
+		if ( x >= p_point2D_box->x_min &&
+			 x <= p_point2D_box->x_max &&
+			 y >= p_point2D_box->y_min &&
+			 y <= p_point2D_box->y_max )
+		{
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+	return true;
+}
+
+//平面坐标的转换, 可以进行旋转和平移, 不能缩放
+bool Point2D_tool::transform_with_translation_rotation(float* p_x_in, float* p_y_in, float* p_x_out, float* p_y_out,
+										 Point2D_tool::Point2D_transform* p_point2D_transform)
+{
+	if ( p_x_in == NULL || p_x_in == NULL || p_x_out == NULL || p_y_out == NULL || p_point2D_transform == NULL)
+	{
+		return false;
+	}
+	else
+	{
+		*p_x_out = *p_x_in * p_point2D_transform->m00 + *p_y_in * p_point2D_transform->m01 + p_point2D_transform->m02;
+		*p_y_out = *p_x_in * p_point2D_transform->m10 + *p_y_in * p_point2D_transform->m11 + p_point2D_transform->m12;
+		return true;
+	}
+	return true;
+}
+bool Point2D_tool::transform_with_translation_rotation(pcl::PointXYZ* p_point3D_in, pcl::PointXYZ* p_point3D_out,
+												Point2D_tool::Point2D_transform* p_point2D_transform)
+{
+	if (p_point3D_in == NULL || p_point3D_out == NULL || p_point2D_transform == NULL)
+	{
+		return false;
+	}
+	else
+	{
+		p_point3D_out->x = p_point3D_in->x * p_point2D_transform->m00 + p_point3D_in->y * p_point2D_transform->m01 +
+						   p_point2D_transform->m02;
+		p_point3D_out->y = p_point3D_in->x * p_point2D_transform->m10 + p_point3D_in->y * p_point2D_transform->m11 +
+						   p_point2D_transform->m12;
+		return true;
+	}
+	return true;
+}
+bool Point2D_tool::transform_with_translation_rotation(pcl::PointCloud<pcl::PointXYZ>::Ptr p_cloud_in,
+												pcl::PointCloud<pcl::PointXYZ>::Ptr p_cloud_out,
+												Point2D_tool::Point2D_transform* p_point2D_transform)
+{
+	if ( p_cloud_in.get() == NULL || p_cloud_out.get() == NULL || p_point2D_transform == NULL)
+	{
+	    return false;
+	}
+	else
+	{
+		pcl::PointXYZ point;
+		for (int i = 0; i < p_cloud_in->size(); ++i)
+		{
+			point.x = p_cloud_in->points[i].x * p_point2D_transform->m00 + p_cloud_in->points[i].y * p_point2D_transform->m01 + p_point2D_transform->m02;
+			point.y = p_cloud_in->points[i].x * p_point2D_transform->m10 + p_cloud_in->points[i].y * p_point2D_transform->m11 + p_point2D_transform->m12;
+			p_cloud_out->push_back(point);
+		}
+		return true;
+	}
+	return true;
+}

+ 81 - 0
tool/point2D_tool.h

@@ -0,0 +1,81 @@
+//
+// Created by huli on 2020/9/1.
+//
+
+#ifndef NNXX_TESTS_POINT2D_H
+#define NNXX_TESTS_POINT2D_H
+
+#include <pcl/point_types.h>
+#include <pcl/PCLPointCloud2.h>
+#include <pcl/conversions.h>
+#include <pcl/common/common.h>
+
+class Point2D_tool
+{
+public:
+	//极坐标
+	struct Polar_coordinates
+	{
+		float angle=0;				//弧度
+		float distance=0;				//距离
+	};
+
+	//极坐标的限定范围
+	struct Polar_coordinates_box
+	{
+		float angle_min=0;			//角度最小值
+		float angle_max=0;			//角度最大值
+		float distance_min=0;			//距离最小值
+		float distance_max=0;			//距离最大值
+	};
+
+	//平面坐标
+	struct Point2D
+	{
+		float x=0;				//x轴
+		float y=0;				//y轴
+	};
+
+	//平面坐标的限定范围
+	struct Point2D_box
+	{
+		float x_min=0;				//x轴最小值
+		float x_max=0;				//x轴最大值
+		float y_min=0;				//y轴最小值
+		float y_max=0;				//y轴最大值
+	};
+
+	//平面坐标的转换矩阵, 可以进行旋转和平移, 不能缩放
+	struct Point2D_transform
+	{
+		float m00=1;
+		float m01=0;
+		float m02=0;
+		float m10=0;
+		float m11=1;
+		float m12=0;
+	};
+
+	//极坐标 -> 平面坐标
+	static bool Polar_coordinates_to_point2D(Point2D_tool::Polar_coordinates* p_polar_coordinates, Point2D_tool::Point2D* p_point2D);
+	//平面坐标 -> 极坐标
+	static bool Point2D_to_polar_coordinates(Point2D_tool::Point2D* p_point2D, Point2D_tool::Polar_coordinates* p_polar_coordinates);
+
+
+	//判断极坐标点是否在限制范围
+	static bool limit_with_polar_coordinates_box(float distance, float angle, Point2D_tool::Polar_coordinates_box* p_polar_coordinates_box);
+	//判断平面坐标点是否在限制范围
+	static bool limit_with_point2D_box(float x, float y, Point2D_tool::Point2D_box* p_point2D_box);
+
+	//平面坐标的转换, 可以进行旋转和平移, 不能缩放
+	static bool transform_with_translation_rotation(float* p_x_in, float* p_y_in, float* p_x_out, float* p_y_out,
+													Point2D_tool::Point2D_transform* p_point2D_transform);
+	static bool transform_with_translation_rotation(pcl::PointXYZ* p_point3D_in, pcl::PointXYZ* p_point3D_out,
+													Point2D_tool::Point2D_transform* p_point2D_transform);
+	static bool transform_with_translation_rotation(pcl::PointCloud<pcl::PointXYZ>::Ptr p_cloud_in,
+													pcl::PointCloud<pcl::PointXYZ>::Ptr p_cloud_out,
+													Point2D_tool::Point2D_transform* p_point2D_transform);
+};
+
+
+#endif //NNXX_TESTS_POINT2D_H

+ 6 - 10
tool/thread_safe_list.h

@@ -156,9 +156,8 @@ bool Thread_safe_list<T>::wait_and_pop(T& value)
 		}
 		else
 		{
-//			value = move(*m_data_list.front());
-			value = (*m_data_list.front());
-
+			value = std::move(*m_data_list.front());
+		
 			m_data_list.pop_front();
 			return true;
 		}
@@ -182,9 +181,8 @@ bool Thread_safe_list<T>::try_pop(T& value)
 		}
 		else
 		{
-//			value = move(*m_data_list.front());
-			value = (*m_data_list.front());
-
+			value = std::move(*m_data_list.front());
+	
 			m_data_list.pop();
 			return true;
 		}
@@ -256,8 +254,7 @@ bool Thread_safe_list<T>::push(T new_value)
 	}
 	else
 	{
-//		std::shared_ptr<T> data(std::make_shared<T>(move(new_value)));
-		std::shared_ptr<T> data(std::make_shared<T>((new_value)));
+		std::shared_ptr<T> data(std::make_shared<T>(std::move(new_value)));
 		std::unique_lock<std::mutex> lk(m_mutex);
 		m_data_list.push_back(data);
 		m_data_cond.notify_one();
@@ -286,8 +283,7 @@ bool Thread_safe_list<T>::clear_and_delete()
 	while (!m_data_list.empty())
 	{
 		T res = NULL;
-//		res = move(*m_data_list.front());
-		res = (*m_data_list.front());
+		res = std::move(*m_data_list.front());
 
 		m_data_list.pop_front();
 		if(res != NULL)

+ 4 - 5
tool/thread_safe_queue.h

@@ -41,7 +41,6 @@
 #include <mutex>
 #include <condition_variable>
 
-
 template<class T>
 class Thread_safe_queue
 {
@@ -154,7 +153,7 @@ bool Thread_safe_queue<T>::wait_and_pop(T& value)
 		}
 		else
 		{
-			value = move(*m_data_queue.front());
+			value = std::move(*m_data_queue.front());
 			m_data_queue.pop();
 			return true;
 		}
@@ -178,7 +177,7 @@ bool Thread_safe_queue<T>::try_pop(T& value)
 		}
 		else
 		{
-			value = move(*m_data_queue.front());
+			value = std::move(*m_data_queue.front());
 			m_data_queue.pop();
 			return true;
 		}
@@ -247,7 +246,7 @@ bool Thread_safe_queue<T>::push(T new_value)
 	}
 	else
 	{
-		std::shared_ptr<T> data(std::make_shared<T>(move(new_value)));
+		std::shared_ptr<T> data(std::make_shared<T>(std::move(new_value)));
 		std::unique_lock<std::mutex> lk(m_mutex);
 		m_data_queue.push(data);
 		m_data_cond.notify_one();
@@ -274,7 +273,7 @@ bool Thread_safe_queue<T>::clear_and_delete()
 	while (!m_data_queue.empty())
 	{
 		T res = NULL;
-		res = move(*m_data_queue.front());
+		res = std::move(*m_data_queue.front());
 		m_data_queue.pop();
 		if(res != NULL)
 		{